Customizing the hibernate dialect for nonstop, Identity column, Customizing the hibernate dialect for nonstop – HP Integrity NonStop J-Series User Manual
Page 95

5.
Transfer the hibernate_Dependency.jar files from C:\Documents and
Settings\<User name>
to the OSS root directory.
6.
Extract hibernate_Dependency.jar:
OSS> cd <OSS root directory>
OSS> jar -xvf hibernate_Dependency.jar
The Hibernate framework libraries are installed on the NonStop system. You can use these libraries
to develop and run Hibernate applications on a NonStop system.
Customizing the Hibernate Dialect for NonStop
The Hibernate dialect is customized for NonStop to support new features of Hibernate version
4.1.1. These features are supported by making changes to the Hibernate dialect. This section
describes the changes made to the Hibernate dialect for SQL/MX database. The dialect is the
basic component, which Hibernate uses for query generation and execution process for a specific
database. The basic dialect file developed for NonStop users is used.
Hibernate now supports the following features:
•
IDENTITY column
•
Error Mapping
IDENTITY Column
Hibernate can leverage the IDENTITY column provided by SQL/MX database. To leverage the
column, in Hibernate, the mapped classes must declare the primary key column of the database
table. Most classes also have a JavaBeans-style property holding the unique identifier of an instance.
The
declare the mapping as follows:
NOTE:
The ID value will be generated by SQL/MX.
type="typename"
column="column_name"
unsaved-value="null|any|none|undefined|id_value"
access="field|property|ClassName">
node="element-name|@attribute-name|element/@attribute|."
where,
•
name
: Name of the identifier property. This attribute is optional.
•
type
: A name that indicates the Hibernate type. This attribute is optional.
•
column
: Name of the primary key column. This attribute is optional and defaults to the property
name.
•
unsaved-value
: An identifier property value that indicates an instance is newly instantiated
(unsaved), distinguishing it from detached instances that were saved or loaded in a previous
session. This attribute is optional and defaults to a sensible value.
•
access
: The strategy Hibernate should use for accessing the property value. This attribute is
optional and defaults to property.
The optional
for instances of the persistent class. If any parameters are required to configure or initialize the
generator instance, they are passed using the element.
Installing the Hibernate Framework
95