|
|
(4 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | {{EclipseLink_UserGuide
| |
− | |info=y
| |
− | |toc=n
| |
− | |eclipselink=y
| |
− | |eclipselinktype=JPA
| |
− | |api=y
| |
− | |apis=
| |
− | *[http://www.eclipse.org/eclipselink/api/latest/javax/persistence/Id.html @Id]
| |
− | * [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/IdClass.html @IdClass]
| |
− | * [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/Emeddeded.html @Emeddeded]
| |
− | * [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/GeneratedValue.html @GeneratedValue]
| |
− | * [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/TableGenerator.html @TableGenerator]
| |
− | * [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/SequenceGenerator.html @SequenceGenerator ]
| |
| | | |
− | }}
| |
− |
| |
− | = Generating and Configuring Entity Identities =
| |
− |
| |
− | Every entity must have a persistent identity, which is an equivalent of a primary key in a database table that stores the entity state.
| |
− |
| |
− | By default, the [[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/persistence.xml|EclipseLink persistence provider]] assumes that each entity has at least one field or property that serves as a primary key.
| |
− |
| |
− | You can generate and/or configure the identity of your entities by using the following annotations:
| |
− |
| |
− | *[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entity/Id|@Id]]
| |
− | *[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entity/IdClass|@IdClass]]
| |
− | *[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entity/EmbeddedId|@EmbeddedId]]
| |
− | *[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entity/GeneratedValue|@GeneratedValue]]
| |
− | *[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entity/TableGenerator|@TableGenerator]]
| |
− | *[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entity/SequenceGenerator|@SequenceGenerator ]]
| |
− |
| |
− | You can also use these annotations to fine-tune how your database maintains the identity of your entities.
| |
− |
| |
− | <br>
| |
− |
| |
− | {{EclipseLink_JPA
| |
− | |previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping|Mapping]]
| |
− | |next=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entity/Id|@Id]]
| |
− | |up=[[EclipseLink/UserGuide/JPA/Basic JPA Development|Basic JPA Development]]
| |
− | |version=2.2.0 DRAFT}}
| |