Chapter 6. Metadata

6.1. Generating Default JDO Metadata
6.2. Metadata Factory
6.3. Additional JPA Metadata
6.3.1. Datastore Identity
6.3.2. Surrogate Version
6.3.3. Persistent Field Values
6.3.4. Persistent Collection Fields
6.3.5. Persistent Map Fields
6.4. Metadata Extensions
6.4.1. Class Extensions Fetch Groups Data Cache Detached State Lock Groups Auditable
6.4.2. Field Extensions Dependent Load Fetch Group LRS Order-By Inverse-Logical Lock Group Read-Only Type Externalizer Factory External Values
6.4.3. Example

The JPA and JDO Overview documents cover standard metadata in Chapter 5, Metadata and Chapter 5, Metadata, respectively. This chapter discusses the tools Kodo provides to aid in metadata creation, and metadata extensions that Kodo recognizes.

6.1. Generating Default JDO Metadata

Kodo's mapping tool can generate default JDO metadata for your persistent classes. The tool can only rely on reflection, so it cannot fill in information that is not available from the class definition itself, such as the element type of collections or the primary key fields of a class using application identity. It does, however, provide a good starting point from which to build up your metadata. See Section 7.1, “Forward Mapping” for details on the mapping tool.

Example 6.1. Generating Metadata with the Mapping Tool

This command adds metadata for all classes in the mypackage directory to the mypackage/package.jdo file. If the file does not exist, the mapping tool will create it.

mappingtool -a add -m true -f mypackage/package.jdo mypackage/*.java


Skip navigation bar   Back to Top