Embedded mapping


Use an Embedded Mapping to specify a persistent field or property of an entity whose value is an instance of an embeddable class.

  1. In the Persistence Outline view, select the field to map. The Persistence Properties view (for attributes) displays the properties for the selected field.

  2. In the Map As field, select Embedded.

  3. Use this table to complete the remaining fields on the Persistence Properties view.

    Property Description Default
    Map As Defines this mapping as a Embedded.

    This field corresponds to the @Embedded annotation.

    Embedded
    Attribute Overrides Specify to override the default mapping of an entity's attribute.
    Columns The database column (and its table) mapped to the entity attribute. See "Column" for details.
    • Name – Name of the database column.

    • Table – Name of the database table.

    • Insertable – Specify if the column is always included in SQL INSERT statements.

    • Updatable – Specify if the column is always included in SQL UPDATE statements.

    By default, the Column is assumed to be named identically to the attribute and always included in the INSERT and UPDATE statements.

Eclipse adds the following annotations to the field:

@Embedded

 

Related task

Mapping an entity

 

Related reference

Persistence Outline view
Persistence Properties view (for attributes)

 

Related concept

Understanding OR mappings
Understanding JSR220: EJB 3.0