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 and later 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 context. If there is no container to manage JPA, the application must handle the persistence context 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 can function in a container environment or a Java SE environment.

Elements of a JPA Persistence Provider

Java EE containers that support the EJB 3.0 and later programming model must support a JPA implementation, also called a persistence provider. A JPA persistence provider uses the following elements to allow for easier persistence management in this type of 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 tasks
Task overview: IBM Optim pureQuery Runtime
Task overview: Storing and retrieving persistent data with the JPA API
Related information
Dynamic, typesafe queries in JPA 2.0
Concept topic Concept topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jun 11, 2013 8:40:09 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v701sca&product=was-nd-mp&topic=cejb_persistence
File name: cejb_persistence.html