beautypg.com

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

Page 401

background image

20 Integrating JPA with Hibernate into Spring

This section 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

chapter) using the Eclipse IDE.

The following topics are discussed in this section:

Why Integrate JPA with Hibernate in Spring

Example of Integrating JPA with Hibernate into Spring

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

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

chapter) developed

on your Windows system.

Following software installed on your NonStop system:
— NonStop iTP WebServer
— NonStop Servlets for Java Server Pages (NSJSP)
— JDBC Type 2 driver for NonStop SQL/MX
— NonStop SQL/MX
— NonStop Server for Java (NSJ)

Following software installed on your Windows system:
— Java Development Kit (JDK)
— JDBC Type 4 driver for NonStop SQL/MX
— Eclipse IDE

Why Integrate JPA with Hibernate in Spring

401

This manual is related to the following products: