6.2. Metadata Factory

The kodo.MetaDataFactory configuration property controls metadata loading and storing. This property takes a plugin string (see Section 2.5, “Plugin Configuration”) describing a concrete kodo.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 Section 7.5, “Mapping Factory”). Kodo recognizes the following built-in metadata factories:

The standard metadata factories all accept the following properties for locating persistent classes. Each property represents a different mechanism for locating persistent types; you can choose the mechanism or combination of mechanisms that are most convenient. See Section 5.1, “Persistent Class List” for a discussion of when it is necessary to list your persistent classes.

Example 6.2. Setting a Standard Metadata Factory

JPA:

<property name="kodo.MetaDataFactory" value="jpa"/>

JDO:

kodo.MetaDataFactory: jdo(Resources=com/aaa/package.jdo;com/bbb/package.jdo,\
    ClasspathScan=build) 

Example 6.3. Setting a Custom Metadata Factory

JPA XML format:

<property name="kodo.MetaDataFactory" value="com.xyz.CustomMetaDataFactory"/>

JDO properties format:

kodo.MetaDataFactory: com.xyz.CustomMetaDataFactory

 

Skip navigation bar   Back to Top