beautypg.com

Removing the employee.hbm.xml file, Adding dependency jar files, Downloading hibernate entity manager – HP Integrity NonStop J-Series User Manual

Page 256

background image

EntityEmployee entityEmployee = em.find(EntityEmployee.class,
new Integer(empid));
em.remove(entityEmployee);
em.flush();
t.commit();
return "Employee deleted";
}
}

Removing the Employee.hbm.xml File

JPA annotations (EntityEmployee.java class) have been used to map the database entities.
Hence, the Hibernate Mapping file (Employee.hbm.xml) is no longer needed and is removed.

Adding Dependency JAR Files

Adding the dependency JAR files involves the following tasks:

1.

“Downloading Hibernate Entity Manager” (page 256)

2.

“Adding Dependency JAR Files” (page 256)

Downloading Hibernate Entity Manager

To use JPA with Hibernate, the javassist.jar and ejb3-persistence.jar dependency
JAR files present in the Hibernate Entity Manager package must be downloaded.

To download the Hibernate Entity Manger, complete the following steps:

1.

Go to

http://sourceforge.net/project/showfiles.php?group_id=40712&package_id=156160

A page displaying a list of Hibernate Entity Manager Releases appears.

2.

Click 3.2.0.GA Release.

3.

Click hibernate-entitymanager-3.2.0.GA.zip and download it to a location on the
Windows system.

4.

After the download is complete, unzip the hibernate-entitymanager-3.2.0.GA.zip
file to a location on the Windows system.

For example, this location could be <Hibernate Entity Manager Home>.

Adding Dependency JAR Files

To incorporate the features of JPA in the EmpInfo application, the following JAR files, other than
the ones added while developing EmpInfo application, must be added in the EmpInfo project
library.

Table 29 Dependency JAR Files

Source Location

Dependency JAR Files

http://ebr.springsource.com/repository/
app/

com.springsource.org.hibernate.ejb-3.4.0.GA.jar

com.springsource.javax.persistence-1.0.0.jar

\lib\jpa

hibernate-jpa-2.0-api-1.0.0.Final.jar

<Maven Repository>\org\
hibernate\hibernate-entitymanager\3.4.0.GA

hibernate-entitymanager-3.4.0.GA.jar

256 Integrating Frameworks

This manual is related to the following products: