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.
entity-mapping (sun-cmp-mappings.xml)
The following table describes subelements for the cmp-field-mapping element.
Table A–27 cmp-field-mapping Subelements
Element |
Required |
Description |
---|---|---|
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. |
|
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. |
|
zero or one |
Specifies that a field is read-only. |
|
zero or one |
Specifies the fetch group for this CMP field’s mapping. |