|
|
(12 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | =Entity=
| |
− | 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.
| |
− |
| |
− |
| |
− |
| |
− | {{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]]}}
| |