Modifying the applicationcontext.xml file, Figure 19-1 – HP Integrity NonStop H-Series User Manual

Page 389

Advertising
background image

Figure 19-1 Project Explorer View

Modifying the EmpInfo application involves the following tasks:

Modifying the applicationContext.xml File

Modifying the EmployeeDao.java File

Creating the Employee.hbm.xml File

Removing the EmployeeRowMapper.java File

Adding Dependency

JAR

Files

Modifying the

applicationContext.xml

File

Modify the

EmpInfo/WebContent/WEB-INF/applicationContext.xml

file, so that it uses

the Hibernate SessionFactory to connect to the

employee SQL/MX

database table using the

following steps:

1.

Specify the SessionFactory in the

applicationContext.xml

file as shown:

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>Employee.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SqlmxDialect</prop>

Example of Integrating Hibernate into Spring

389

Advertising
This manual is related to the following products: