20 integrating jpa with hibernate into spring, Why integrate jpa with hibernate in spring, Prerequisites – HP Integrity NonStop J-Series User Manual

Page 383

Advertising
background image

20 Integrating JPA with Hibernate into Spring

This chapter describes how a Spring application can use the Java Persistence API (JPA) with
Hibernate for its database operation. This is demonstrated by modifying the EmpInfo application
(developed in

“Getting Started with Spring” (page 75)

chapter) using the Eclipse Galileo IDE.

The following topics are discussed in this section:

“Why Integrate JPA with Hibernate in Spring” (page 383)

“Example of Integrating JPA with Hibernate into Spring” (page 383)

Why Integrate JPA with Hibernate in Spring

JPA combines the best features from each of the persistence mechanisms, such as serialization,
JDBC, Java Data Objects (JDO), proprietary object-relational mapping tools, object databases,
and EJB 2.x entity beans.

JPA enables you to:

store and retrieve persistent data

use advanced object-oriented concepts such as inheritance

avoid vendor lock-in

focus on relational databases

Spring provides the complete EJB container contract for JPA, allowing JPA to be used under a
Spring managed services layer (with all the AOP and DI richness of Spring) in any environment.
Because Hibernate is compliant with JPA, its features can also be leveraged within the Spring JPA
implementation.

Example of Integrating JPA with Hibernate into Spring

The EmpInfo application (developed in the

“Integrating Hibernate into Spring” (page 367)

chapter)

is a Spring application that uses Hibernate for handling database operations.

This section describes how to use JPA with Hibernate for handling the database operations of the
EmpInfo application.

Prerequisites

The prerequisites of integrating JPA with Hibernate in Spring are:

Basic knowledge of the Spring and Hibernate frameworks.

EmpInfo application (explained in the

“Integrating Hibernate into Spring” (page 367)

chapter)

developed on the Windows system.

Following software installed on the NonStop system:

NonStop iTP WebServer version T8996H02 or later

NSJSP version T1222H60 or later

JDBC Type 2 driver version T1275H50 or later, or JDBC Type 4 driver version T1249V11
or later

Why Integrate JPA with Hibernate in Spring 383

Advertising
This manual is related to the following products: