Network Deployment (Distributed operating systems), v8.0 > Applications > EJB applications


Java Persistence API (JPA) architecture

Data persistence is the ability to maintain data between application executions. Persistence is vital to enterprise applications because of the required access to relational databases. Applications that are developed for this environment must manage persistence themselves or use 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 EJB 3.1 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.x 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 an EJB 3.x environment:

For more information about persistence, see the section on Java Persistence API Architecture and the section on Persistence in the Apache OpenJPA User Guide. For more information and examples on specific elements of persistence, see the sections on the EntityManagerFactory, and the EntityManager in the Apache OpenJPA User Guide.
Task overview: Storing and retrieving persistent data with the JPA API
Task overview: IBM Optim pureQuery Runtime
Apache OpenJPA User Guide Concept topic

+

Search Tips   |   Advanced Search