Table of Contents
Kodo JDO uses standard JDO metadata documents, which are covered in the JDO Overview. Kodo JDO also takes advantage of metadata's built-in extension mechanism to allow you to specify object-relational mapping information. You can use metadata's extension elements to customize the schema that is created from your persistent classes, or to map your classes to an existing schema. All extensions are optional; Kodo JDO will define its own schema mapping by default.
All Kodo JDO extension elements must have a vendor-name of kodo. The next sections present a list of the available extensions.
The following keys are recognized for extension elements that are direct children of class elements in the metadata document:
table: This extension specifies the table used to store the primary data for the class. If not specified, Kodo will auto-generate a table name based on the name of the class. This attribute is also used in multi-table inheritance mappings
pk-column: This extension is only for classes using datastore identity. It specifies the primary key column for the table in which the class is held. This column must be of a numeric type and must not be mapped to any fields of the class. If the pk-column extension is not specified, Kodo will add its own primary key column, usually named JDOIDX.
lock-column: This extension specifies the column used to record the version number of objects. Versioning is used to detect concurrent modification of objects during optimistic transactions. The given column must be of a numeric type and must not be mapped to any fields of the class. If the extension is not present, Kodo JDO will add its own lock column, usually named JDOLOCKX. You can prevent the creation of a lock column by specifying a value of none. In this case, concurrent modification violations will not be detected.
class-column: This column stores the class name of the object represented by each table row. The column must be a string type, and must be large enough to hold the full class name of any persistent class mapped to the table. It must not be mapped to any fields of the class. If the extension is not present, Kodo JDO will add its own class column, usually named JDOCLASSX. If the table's corresponding persistent class has no persistent subclasses and you do not want a column to be generated, specify a value of none.