tags:

views:

33

answers:

0

Hi all,

I got the following situation: In my project, I updated programmatically persistence unit. So, at first, the persistence.xml contains 1 entity class and then I created entity manager factory and everything worked like a charm. Bu then, I updated the persistence.xml file by adding more entity classes and re-invoke createEntityManagerFactory (the same persistence unit name). However, this method does not create a new entity manager factory rather it used the old one. That means the entity manager factory does not "see" my new entity classes that I had added.

So I want to ask are there any ways to inform the entity manager that "I have added some new entity classes in the persistence unit and please update your entity manager factory with new entity classes"?

Thank you all.