5.4. Field Element

The class element may contain extension elements, field elements, and fetch-group elements. field elements represent fields declared by the persistent class. These elements are optional; if a field declared in the class is not named by some field element, then its properties are defaulted as explained in the attribute listings below. Thanks to JDO's comprehensive set of defaults, most fields do not need to be listed explicitly. field elements accept the following attributes:

All field elements may contain extension child elements. field elements that represent array, collection, or map fields may also contain a single array, collection, or map child element, respectively. Each of these elements may contain additional extension elements in turn.

The array element has two attributes:

The collection element also has the dependent-element and embedded-element attributes. Additionally, it declares the element-type attribute. Use this attribute to tell the JDO implementation what class of objects the collection contains. This is important for efficient storage of the collection contents. The element-type defaults to java.lang.Object unless you are using Java 5 parameterized types, in which case it defaults to the type parameter in your field declaration.

The map element define six attributes. They are:

 

Skip navigation bar   Back to Top