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