Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Virtual Metlhods | questions

The refreshMetadata call causes the whole EntityManagerFactory to reinitialize, potentially with new metadata - basically it restarts the bootstrapping of an EntityManagerFactory from the beginning. The main reason we provide that method is for those that are providing an eclipselink.metadata-source in their persistence unit setup. If you have customizers or event listeners that customize the mappings based on data that may change, it could also be used for that. Is that what you are using it for?

Basically, if you want the underlying mappings in an EntityManagerFactory to change after you have used it, that is the way to do it.

-Tom

On 24/07/2012 3:27 PM, Gaurav Malhotra wrote:

Hi Tom,
   In real application I have to make following call to make programtic
relationships creation on the fly to make the things work
JpaHelper.getEntityManagerFactory(<entityManager>).refreshMetadata(null);

What I found at the object building phase, the following statement always
results in the NULL for the newly creationed relationships
  oneToManyMapping.getSelectionQuery().getDescriptor()

Hence resulted in NPE.

  Please validate that
JpaHelper.getEntityManagerFactory(<entityManager>).refreshMetadata(null); is
OK.

  I found the above call resulted in the increase in deployment time (which i
also expected). Is there any other API I can use?? which can decrease my
deployment time.

~Gaurav Malhotra


Back to the top