Setting hibernate configurations, Hibernate.cfg.xml – HP Integrity NonStop J-Series User Manual
Page 137
![background image](/manuals/397993/137/background.png)
length="15"
column="lname"/>
NOTE:
The generator class for tag <id> is increment. This is to use the auto-increment
feature of Hibernate.
Setting Hibernate Configurations
To set up Hibernate configurations, create and modify the following files:
•
•
hibernate.cfg.xml
This file is used to set up the environment.
1.
Create the hibernate.cfg.xml file in the EmployeeInfo/src directory, as explained
in
“Creating the Hibernate Mapping File” (page 134)
.
2.
Modify the file as follows:
•
Add a reference for the Hibernate mapping file under the <session-factory> tag.
•
Add a reference for the Hibernate dialect file by including the following property tag
under the <session-factory> tag.
org.hibernate.dialect.SqlmxDialect
•
Enable auto-creation of database tables using the Hibernate mapping file by including
the following property tag under the <session-factory> tag.
The hibernate.cfg.xml file now appears as:
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
org.hibernate.dialect.SqlmxDialect
Getting Started with Hibernate
137