persistence@glassfish.java.net

Can orm.xml be used in Java SE env?

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Wed, 14 Dec 2005 02:03:37 +0530

Hi Mike,

Reading the following test taken from section #6.2.1.6 of the spec, I
get the impression that orm.xml can't be used in Java SE in a portable
way. Is this true? I am saying this because if orm.xml can be used, then
a provider can get the list of managed persistence classes from that file.

*A list of named managed persistence classes may also be specified
instead of, or in addition to, the JAR
files and mapping files. Any mapping metadata annotations found on these
classes will be processed, or
they will be mapped using the mapping annotation defaults. The class
element is used to list a managed
persistence class. A list of all named managed persistence classes must
be specified in Java SE
environments to insure portability. Portable Java SE applications should
not rely on the other mechanisms
described here to specify the managed persistence classes of a
persistence unit. Persistence providers
may also require that the set of entity classes and classes that are to
be managed must be fully
enumerated in each of the persistence.xml files in Java SE environments.

*Thanks,
Sahoo