Java Persistence API (JPA) Architecture

Data persistence, the ability to maintain data between application executions, is vital to enterprise applications because the required access to relational databases. Applications that are developed for this environment must manage persistence themselves or make use of third-party solutions to handle database updates and retrievals with persistence. The Java Persistence API (JPA) provides a mechanism for managing persistence and object-relational mapping and functions for the EJB 3.0 specifications.

The JPA specification defines the object-relational mapping internally, rather than relying on vendor-specific mapping implementations. JPA is based on the Java programming model that applies to Java EE environments, but JPA can function within a Java SE environment for testing application functions.

JPA represents a simplification of the persistence programming model. The JPA specification explicitly defines the object-relational mapping, rather than relying on vendor-specific mapping implementations. JPA standardizes the important task of object-relational mapping by using annotations or XML to map objects into one or more tables of a database. To further simplify the persistence programming model:

JPA is designed to operate both inside and outside of a Java Enterprise Edition (Java EE) container. When you run JPA inside a container, the applications can use the container to manage the persistence. If there is no container to manage JPA, the application must handle the persistence management itself. Applications that are designed for container-managed persistence do not require as much code implementation to handle persistence, but these applications cannot be used outside of a container. Applications that manage their own persistence, while larger, can function in a container environment or a Java SE environment.

Elements of a JPA Persistence Provider

Java EE containers that support JPA must supply a persistence provider. A JPA persistence provider uses the following elements to allow for easier persistence management in an EJB 3.0 environment:

For more information about persistence, see the section on Java Persistence API Architecture and the section on Persistence in the Apache OpenJPA User's Guide. For more information and examples on specific elements of persistence, refer to the sections on the EntityManagerFactory, and the EntityManager in the Apache OpenJPA User's Guide.




Related concepts
Task overview: Storing and retrieving persistent data with the Java Persistence API (JPA)
Related information
Apache OpenJPA manual: Java Persistence API Architecture
Apache OpenJPA manual: Persistent Classes
Apache OpenJPA manual: Persistence
Apache OpenJPA manual: EntityManagerFactory
Apache OpenJPA manual: EntityManager
Concept topic Concept topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 31, 2013 2:56:59 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-dist&topic=cejb_persistence
File name: cejb_persistence.html