users@glassfish.java.net

Re: Sematics of the orm.xml file

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Fri, 16 Jun 2006 10:25:21 -0700

Hi Vince,

You can choose. This is what the spec says:

10.1 XML Overriding Rules
...
If the xml-mapping-metadata-complete subelement of the persistence-unit-metadata
element is specified, the complete set of mapping metadata for the persistence
unit is contained in
the XML mapping files for the persistence unit, and annotations on the classes
are ignored. When
xml-mapping-metadata-complete is specified and XML elements are omitted, the
default values
apply[47].
[47] If the xml-mapping-metadata-complete element is specified, any
metadata-complete attributes specified within
the entity, mapped-superclass, and embeddable elements are ignored.
...

10.1.3.1 metadata-complete
If the metadata-complete attribute is specified on the entity element itself,
any annotations on
the entity class (and its fields and properties) are ignored. When
metadata-complete is specified
on the entity element and XML elements are omitted, the default values apply to
the given class.

-marina

vince kraemer wrote:
> If I create a persistence unit with a an orm.xml file in it, does the
> file selectively override the annotations, or does the file completely
> override the annotations....
>
> Thanks,
> vbk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>