HIBERNATE TUTORIAL

HIBERNATE - Hibernate O/R Mapping

<id> element

The <id> element defines the mapping from that property to the primary key column. Mapped classes must declare the primary key column of the database table. Most classes will also have a JavaBeans-style property holding the unique identifier of an instance.

<id
 

name="propertyName"
type="typename"
column="column_name"
unsaved-value="null|any|none|undefined|id_value"
access="field|property|ClassName">

<generator class="generatorClass"/>

(1)
(2)
(3)
(4)
(5)
/> 

(1) name (optional): The name of the identifier property.
(2) type (optional): A name that indicates the Hibernate type.
(3) column (optional - defaults to the property name): The name of the primary key column.
(4) unsaved-value (optional - defaults to a "sensible" value): An identifier property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session.
(5) access (optional - defaults to property): The strategy Hibernate should use for accessing the property value.



Hibernate tutorial
Introduction to Hibernate
Overview of Hibernate
Features of Hibernate
Getting Started with Hibernate
Hibernate O/R Mapping

Mapping declaration

Mapping Document
<hibernate-mapping> element
<class> element
<id> element
<generator> element
<property> element
<many-to-one> element
<one-to-one> element
Hibernate Mapping In Depth
Hibernate Query Language
Hibernate Complete Example

Use of this website constitutes acceptance of the AllAppLabs.com Terms and Conditions