Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer's Guide

- Previous: cmp
- Next: cmp-resource

## 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 A–28 `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.

- Previous: cmp
- Next: cmp-resource

- © 2010, Oracle Corporation and/or its affiliates