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
6.4.1.1. Fetch Groups
6.4.1.2. Data Cache
6.4.1.3. Detached State
6.4.1.4. Lock Groups
6.4.1.5. Auditable
6.4.2. Field Extensions
6.4.2.1. Dependent
6.4.2.2. Load Fetch Group
6.4.2.3. LRS
6.4.2.4. Order-By
6.4.2.5. Inverse-Logical
6.4.2.6. Lock Group
6.4.2.7. Read-Only
6.4.2.8. Type
6.4.2.9. Externalizer
6.4.2.10. Factory
6.4.2.11. 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