I. Details about JPA
JPA (Java persistence API) is a Java persistence specification officially proposed by Sun. It provides an object/link ing tool for Java developers to manage the relational data in Java applications. His appearance mainly aims to simplify the existing persistent development work and integrate the ORM technology, and end the current situation where hibernate, toplink, and other ORM frameworks work independently. It is worth noting that JPA is developed on the basis of fully absorbing existing ORM frameworks such as Hibernate and toplink, and has advantages such as ease of use and high scalability. From the current response of the development community, JPA was greatly supported and praised, including the development teams of spring and ejb3.0. With a focus on the technology trend in the next few years, JPA should be easily achieved as the standardization integrator in the orm field.
The overall idea of PA is basically the same as that of existing ORM frameworks such as Hibernate and toplink. In general, JPA includes the following three technologies:
Orm ing metadata
JPA supports two types of metadata: XML and JDK 5.0 annotations (which can also be translated as annotations). The metadata describes the ing between objects and tables, and the framework persistently stores object in database tables.
Java persistence API
It is used to operate entity objects and perform crud operations. The framework completes all things for us in the background. developers can free up from tedious JDBC and SQL code.
Query Language
This is an important aspect of persistence operations. You can use object-oriented rather than database-oriented query languages to query data and avoid tightly coupled SQL statements.
Tip: JPA is not a New ORM framework. It is only used to standardize the existing ORM technology. It cannot replace the existing ORM frameworks such as Hibernate and toplink. On the contrary, when using JPA for development, we will still use these ORM frameworks, but the applications developed at this time do not depend on a persistence provider. Applications can run in any JPA environment without modifying the code, truly achieving low coupling and scalable programming.
Learning notes for JPA: learning the video tutorial record of Chuanzhi podcast
JPA learning --- Section 1: JPA details