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

- Previous: enterprise-beans
- Next: establish-trust-in-client

## entity-mapping

Specifies the mapping a bean to database columns.

### Superelements

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

### Subelements

The following table describes subelements for the `entity-mapping` element.

Table A–45 `entity-mapping` Subelements

Element | Required | Description
--- | --- | ---
ejb-name | only one | Specifies the name of the entity bean in the `ejb-jar.xml` file to which the CMP bean corresponds.
table-name | only one | Specifies the name of a database table. The table must be present in the database schema file.
cmp-field-mapping | one or more | Associates a field with one or more columns to which it maps.
cmr-field-mapping | zero or more | A container-managed relationship field has a name and one or more column pairs that define the relationship.
secondary-table | zero or more | Describes the relationship between a bean’s primary and secondary table.
consistency | zero or one | Specifies container behavior in guaranteeing transactional consistency of the data in the bean.

- Previous: enterprise-beans
- Next: establish-trust-in-client

- © 2010, Oracle Corporation and/or its affiliates