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/Creating and Configuring Entities"

m (Replacing page with ' '''Warning See "Understanding Entities" in the [http://www.eclipse.org/eclipselink/documentation/ EclipseLink Concepts Guide]'''')
(36 intermediate revisions by 2 users 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/Entity.html @Entity]
 
* [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/IdClass.html @IdClass]
 
* [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/Embedded.html @Embedded]
 
* [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 ]
 
* [http://www.eclipse.org/eclipselink/api/latest/javax/persistence/package-summary.html Package javax.persistence]
 
  
}}
 
  
= Configuring Entities and Mappings=
 
  
Every entity must have a persistent identity, which is an equivalent of a primary key in a database table that stores the entity state.
+
'''[[Image:Elug_draft_icon.png|Warning]] See "Understanding Entities" in the [http://www.eclipse.org/eclipselink/documentation/ EclipseLink Concepts Guide]'''
 
+
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:
+
 
+
*[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entities/Ids/Id|@Id]]  
+
*[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entities/Ids/IdClass|@IdClass]]
+
*[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entities/Ids/EmbeddedId|@EmbeddedId]]
+
*[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entities/Ids/GeneratedValue|@GeneratedValue]]
+
*[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entities/Ids/TableGenerator|@TableGenerator]]
+
*[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Entities/Ids/SequenceGenerator|@SequenceGenerator ]]
+
 
+
You can also use these annotations to fine-tune how your database maintains the identity of your entities.  
+
 
+
<br>
+
 
+
<br>
+
 
+
{{EclipseLink_JPA
+
|previous=[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Configuration/JPA/Overriding_and_Merging|Overriding and Merging]]
+
|up=[[EclipseLink/UserGuide/JPA/Basic JPA Development|Basic JPA Development]]
+
|next=[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Entities/Ids/Generating_and_Configuring_Entity_Identities|Generating and Configuring Entity Identities]]
+
|version=2.2.0 DRAFT}}
+

Revision as of 11:53, 25 January 2013


Warning See "Understanding Entities" in the EclipseLink Concepts Guide

Back to the top