Home

 

Introducing the Java Persistence API

This section is an extract from the IBM Redbooks publication, WebSphere Application Server Version 6.1 Feature Pack for EJB 3.0, SG24-7611, Chapter 2, Introduction to JPA.

The persistence layer in a typical J2EE application that interacts with a relational database has been implemented over the last years in several ways:

EJB 2.x entity beans

Data access object (DAO) pattern

Data mapper frameworks (such as IBatis)

Object-relational mapping (ORM) frameworks both commercial (such as Oracle Toplink) or from the open-source world (such as Hibernate)

Data mapper and ORM frameworks gained a great approval among developers communities, because they give a concrete answer to the demand of simplification of the design of the persistence layer, and let developers concentrate on the business related aspects of their solutions.

However, even if these frameworks overcome the limitations of EJB 2.x CMP entity beans, one of the common concerns related to the adoption of such frameworks was that they were not standardized.

One of the main innovative concepts introduced by EJB 3.0 is the provisioning of a single persistence standard for the Java platform that can be used in both the Java EE and Java SE environments, and that can be used to build the persistence layer of a Java EE application. Furthermore, it defines a pluggable service interface model, so that you can plug in different provider implementations, without a significant changes to your application.

The Java Persistence API provides an object relational mapping facility to Java developers for managing relational data in Java applications. Java persistence consists of three areas:

Java Persistence API

Object-relational mapping metadata

Query language
ibm.com/redbooks