Oracle GlassFish Server 3.0.1 Application Deployment Guide

cmp-field-mapping

The cmp-field-mapping element associates a field with one or more columns to which it maps. The column can be from a bean’s primary table or any defined secondary table. If a field is mapped to multiple columns, the column listed first in this element is used as a source for getting the value from the database. The columns are updated in the order they appear. There is one cmp-field-mapping element for each cmp-field element defined in the ejb-jar.xml file.

Superelements

entity-mapping (sun-cmp-mappings.xml)

Subelements

The following table describes subelements for the cmp-field-mapping element.

Table C–31 cmp-field-mapping Subelements

Element 

Required 

Description 

field-name

only one 

Specifies the Java identifier of a field. This identifier must match the value of the field-name subelement of the cmp-field that is being mapped.

column-name

one or more 

Specifies the name of a column from the primary table, or the qualified table name (TABLE.COLUMN) of a column from a secondary or related table. 

read-only

zero or one 

Specifies that a field is read-only. 

fetched-with

zero or one 

Specifies the fetch group for this CMP field’s mapping.