Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/Basic JPA Development/Entities/Ids/Generating and Configuring Entity Identities"

m (Entity)
m (Entity)
Line 17: Line 17:
  
 
{{EclipseLink_JPA
 
{{EclipseLink_JPA
|previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/Mapping|Mapping]]
+
|previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping|Mapping]]
|next=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/Mapping/Id|@Id]]
+
|next=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Id|@Id]]
 
|up=[[EclipseLink/UserGuide/JPA/Basic JPA Development|Basic JPA Development]]}}
 
|up=[[EclipseLink/UserGuide/JPA/Basic JPA Development|Basic JPA Development]]}}

Revision as of 12:23, 15 June 2010

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 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:

  • @Id
  • @IdClass
  • @EmbeddedId
  • @GeneratedValue
  • @TableGenerator
  • @SequenceGenerator

You can also use these annotations to fine-tune how your database maintains the identity of your entities.


Eclipselink-logo.gif
Version: DRAFT
Other versions...

Back to the top