Why has javax.persistence-api been replaced by jakarta.persistence-api in spring data jpa starter?

SternK :

I've recently started to learn spring boot, data jpa. As I can see from this, the spring boot data jpa starter uses jakarta.persistence-api instead of javax.persistence-api:

   <artifactId>spring-boot-starter-data-jpa</artifactId>
   ...
   <dependencies>
      <dependency>
         <groupId>jakarta.persistence</groupId>
         <artifactId>jakarta.persistence-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <exclusions>
            <exclusion>
               <groupId>javax.persistence</groupId>
               <artifactId>javax.persistence-api</artifactId>
            </exclusion>
            ...
         </exclusions>
      </dependency>
   </dependencies>

What is the differences between jakarta.persistence-api and javax.persistence-api? What is the reason of this replacement?

Krisztian Toth :

From wikipedia:

The Java Persistence API (JPA), in 2019 renamed to Jakarta Persistence, is a Java application programming interface specification that describes the management of relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition/Jakarta EE.

You can read more about it here.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=421511&siteId=1