users@glassfish.java.net

Re: Persisting entities that are loaded at runtime

From: <glassfish_at_javadesktop.org>
Date: Tue, 25 Nov 2008 11:35:34 PST

persistence.xml is usually processe during EMF creation (either via Persistence.createEntityManagerFactory() call or em/emf lookup or injection). The entities are usually scanned during the 1st EM creation from that EMF (again either explicitly or when an EM is looked up or injected).

If entities from different plugins do not have relationships between each other, you can have 1 PU per plugin, and load such PU on demand (unless you create your entities from bytecodes on the fly - in this case you need to check if there is a JPA provider that supports such feature).

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=318700