What is JPA (Java Persistence API)?

What is commonly referred to as jpa?

1. JPA concept

        The abbreviation of Java persistence API , the Chinese name is Java Persistence Layer API, which is JDK5.0 annotation or XML description object-relational table mapping relationship, and persists the entity object in the runtime to the database. (Object Persistence: It is a technology to save objects in memory to a storage device that can be stored permanently)

2. The reason for the emergence of JPA

        1. Simplify the development of object persistence for existing JavaEE and JavaSE applications;
        2. Sun hopes to integrate ORM technology to achieve a unified application in the field of persistence;

3. Technology provided by JPA

1. ORM mapping metadata

        JPA supports two forms of metadata, XML and JDK5.0 annotations. The metadata describes the mapping relationship between objects and tables. Based on this, the entity object is persisted to the database table; (Metadata: refers to the data used to describe Data is the data that describes the relationship between codes, such as: hibernate uses hbm files. After JDK5.0 came out, there are four types (TYPE) in the java language, namely class (class), enumeration (enum), interface (interface) and annotations (@interface), they are at the same level. Java expresses metadata through annotations.)

2. APIs of JPA

        It is used to operate entity objects and perform crud operations. The framework does all the work for us at the bottom, and developers are freed from cumbersome JDBC and SQL codes;

3. Query language

        Query data through an object-oriented rather than database-oriented query language to avoid tight coupling of SQL statements in the program;

Continuously updating........

Guess you like

Origin blog.csdn.net/banzhengyu/article/details/129930785