Show TOC

Component documentationOverview of the Java Persistence API Locate this document in the navigation structure

 

Business applications often deal with persistent data which is stored in a relational database. For the Java platform, there are a variety of standards and proprietary solutions that address the issue, so that sometimes it is not easy to decide which to use.

The most fundamental low-level programming interface is the Java Database Connectivity, better known as JDBC. Although widespread, it is not convenient to use. JDBC works with tabular row and column data rather than with Java objects, so that a considerable amount of work has to be undertaken to convert data back and forth.

Object-relational persistence frameworks, on the other hand, allow you to work with the Java object model only. The framework undertakes the task of mapping the Java objects to the relational database, it translates searches for or manipulations on the objects to SQL, and it handles the entire communication with the database.

From the beginning, the Java Platform, Enterprise Edition (Java EE; previously called J2EE) comes with a built-in object-relational persistence framework based on the Enterprise JavaBeans (EJB) technology - EJB container-managed persistence (CMP). Although standardized and an integral part of any J2EE application server, EJB CMP has never been popular or widely adopted because it is rather complex and has a reputation to be difficult to use. Many people opt instead for a lightweight, modern object-relational persistence framework like Java Data Objects (JDO), TopLink or Hibernate. However, neither solution is part of the Java EE standard, so there is a certain additional effort to integrate it into a Java EE application server.

With Java EE 5, a new object-relational persistence application programming interface (API), the Java Persistence API (JPA), is added to the Java EE standard. JPA draws upon the best ideas from the existing persistence frameworks, and finally provides a lightweight and easy-to-use persistence API integrated into any Java EE 5 application server.

Note Note

SAP NetWeaver AS Java contains an SAP implementation of JPA. This implementation is also referred to as JPA 1.0.

End of the note.

More information: Using JPA in the Persistence Layer