5.2. JDO, Package, and Extension Elements

The root element of all persistence metadata documents is the jdo element. The only legal children of the jdo element are package elements and extension elements. Each package element must specify a name attribute giving the full name of the package it represents. Extensions are used to annotate metadata with vendor-specific information. The extension element may contain arbitrary XML content, and has three attributes:

[Note]Note

Kodo defines many useful metadata extensions. See Section 6.4, “Metadata Extensions” in the Reference Guide for the complete set.

Through the course of this chapter, we will build a persistence metadata document for the model above. Our first step is to define the basic metadata structure using the elements we have examined so far:

Example 5.1. Basic Structure of Metadata Documents

<?xml version="1.0"?>
<jdo>
    <package name="org.mag">
        ...
    </package>
    <package name="org.mag.pub">
        ...
    </package>
    <package name="org.mag.subscribe">
        ...
    </package>
</jdo>

 

Skip navigation bar   Back to Top