|
JPA requires the persistence of classes to be defined via Metadata. This Metadata
can be provided in the following forms
-
XML : the traditional mechanism, with XML files
containing information for each class to be persisted.
-
Annotations : using JDK1.5+ annotations in the
classes to be persisted
JPA defines the priority order for metadata as being
-
JPA XML Metadata
-
Annotations
If a class has annotations and JPA XML Metadata then the XML Metadata
will take precedence over the annotations (or rather be merged on top of the
annotations).
By default any XML Metadata will be validated for accuracy when loading it.
Obviously XML is defined by a DTD or XSD schema and so should follow that.
You can turn off such validations by setting the persistence property
datanucleus.metadata.validate
to false when creating your PMF.
Note that this only turns off the XML strictness validation, and
not
the checks on inconsistency of specification of relations etc.
|
|