Removing the employeerowmapper.java file – HP Integrity NonStop J-Series User Manual

Page 375

Advertising
background image

Figure 142 New XML File: Create XML Dialog Box

The Employee.hbm.xml file is created in the EmpInfo/src directory.

5.

Modify the Employee.hbm.xml file to add the mapping details. The Employee.hbm.xml
file must appear as:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
package="com.hp.empinfo.domain">
<class name="Employee">
<id name="empid">
<column name="emp_id"/>
</id>
<property name="firstname">
<column name="first_name"/>
</property>
<property name="lastname">
<column name="last_name"/>
</property>
<property name="age">
<column name="age"/>
</property>
<property name="email">
<column name="email"/>
</property>
</class>
</hibernate-mapping>

Removing the EmployeeRowMapper.java File

The EmpInfo application uses the EmployeeRowMapper.java class for mapping various database
table entities. Because Hibernate maps database table entities using the Hibernate mapping file

Example of Integrating Hibernate into Spring 375

Advertising
This manual is related to the following products: