ID Mapping |
Use an ID Mapping to specify the primary key of an entity. ID mappings may be used with a Persistent Entity or Mapped Superclass.
In the Persistence Outline View, select the field to map. The Persistence Properties View (for Attributes) displays the properties for the selected.
In the Map As field, select ID.
Use this table to complete the remaining fields on the Persistence Properties view.
Property | Description | Default |
---|---|---|
Map As | Defines this mapping as an ID Mapping. | ID |
Generated Value | These fields define how the primary key is generated. |
|
Strategy | See "Generated Value" for details. | Auto |
Generator Name | Name of the primary key generator specified in the Strategy |
|
Column | The database column for the primary key of the table associated with the entity. | By default, the primary key Column is assumed to be named identically to the primary key of the entity. |
Eclipse adds the following annotations to the field:
@Id @Column(name="<COLUMN>") @GeneratedValue(strategy=GeneratorType.<STRATEGY>, generator = "<GENERATOR_NAME>")