An important decision in the object-relational mapping process is how and where to store the data necessary to map your persistent classes to the database schema.
Section 1, “
Metadata Factory
” introduced OpenJPA's
MetaDataFactory
interface. OpenJPA uses this same interface to
abstract the storage and retrieval of mapping information. OpenJPA includes the
built-in mapping factories below, and you can create your own factory if you
have custom needs. You control which mapping factory OpenJPA uses with the
openjpa.jdbc.MappingFactory
configuration property.
The bundled mapping factories are:
-
: Leaving the openjpa.jdbc.MappingFactory
property unset allows your metadata factory to take over mappings as
well. If you are using the default jpa
metadata factory,
OpenJPA will read mapping information from your annotations and
orm.xml
when you leave the mapping factory unspecified.
Example 7.13. Standard JPA Configuration
In the standard JPA configuration, the mapping factory is left unset.
<property name="openjpa.MetaDataFactory" value="jpa"/>