3.7.1. Metadata Factory
The openjpa.MetaDataFactory configuration property controls metadata loading and storing.
This property takes a plugin string (see Plugin Configuration) describing a concrete
org.apache.openjpa.meta.MetaDataFactory implementation.
A metadata factory can load mapping information as well as persistence metadata, or it can leave mapping information to a separate mapping factory (see Mapping Factory). OpenJPA recognizes the following built-in metadata factories:
-
jpa: Standard JPA metadata. This is an alias for the org.apache.openjpa.persistence.PersistenceMetaDataFactory.
JPA has built-in settings for listing your persistent classes, which the JPA Overview describes. OpenJPA supports these JPA standard settings by translating them into its own internal metadata factory properties. Each internal property represents a different mechanism for locating persistent types; you can choose the mechanism or combination of mechanisms that are most convenient. See Persistent Class List for a discussion of when it is necessary to list your persistent classes.
-
Types: A semicolon-separated list of fully-qualified persistent class names. -
Resources: A semicolon-separated list of resource paths to metadata files or jar archives. Each jar archive will be scanned for annotated JPA entities. -
URLs: A semicolon-separated list of URLs of metadata files or jar archives. Each jar archive will be scanned for annotated JPA entities. -
ClasspathScan: A semicolon-separated list of directories or jar archives listed in your classpath. Each directory and jar archive will be scanned for annotated JPA entities.
<property name="openjpa.MetaDataFactory" value="jpa(ClasspathScan=build;lib.jar)"/>
<property name="openjpa.MetaDataFactory" value="com.xyz.CustomMetaDataFactory"/>