Spring Boot Jpa 简明教程

Spring Boot JPA - Overview

What is JPA?

Java 持久化 API 是一个类和方法的集合,用于将海量数据持久性地存储到由 Oracle Corporation 提供的数据库中。

Java Persistence API is a collection of classes and methods to persistently store the vast amounts of data into a database which is provided by the Oracle Corporation.

Where to use JPA?

为了减轻编写关系对象管理代码的负担,程序员遵循“JPA 提供程序”框架,该框架允许轻松与数据库实例进行交互。此处必需的框架由 JPA 接管。

To reduce the burden of writing codes for relational object management, a programmer follows the ‘JPA Provider’ framework, which allows easy interaction with database instance. Here the required framework is taken over by JPA.

jpa provider

JPA History

早期版本的 EJB 将持久性层与业务逻辑层结合在一起,使用 javax.ejb.EntityBean 接口定义。

Earlier versions of EJB, defined persistence layer combined with business logic layer using javax.ejb.EntityBean Interface.

  1. While introducing EJB 3.0, the persistence layer was separated and specified as JPA 1.0 (Java Persistence API). The specifications of this API were released along with the specifications of JAVA EE5 on May 11, 2006 using JSR 220.

  2. JPA 2.0 was released with the specifications of JAVA EE6 on December 10, 2009 as a part of Java Community Process JSR 317.

  3. JPA 2.1 was released with the specification of JAVA EE7 on April 22, 2013 using JSR 338.

JPA Providers

JPA 是一个开源 API,因此,各种企业供应商(如 Oracle、Redhat、Eclipse 等)通过在其中添加 JPA 持久性风格来提供新产品。其中一些产品包括 -

JPA is an open source API, therefore various enterprise vendors such as Oracle, Redhat, Eclipse, etc. provide new products by adding the JPA persistence flavor in them. Some of these products include −

Hibernate, Eclipselink, Toplink, Spring Data JPA, etc.

Hibernate, Eclipselink, Toplink, Spring Data JPA, etc.