Spring Data JPA的基础实现是什么

时间:2018-12-31 04:36:50

标签: hibernate spring-data-jpa

那么Spring Data JPA的基础实现是什么,它是休眠的吗?因为当我使用PagingAndSortingRepository时,它在控制台中显示了Hibernate日志。

如果它不是休眠的,那么JPA提供程序是什么,正如我在另一篇文章中看到的那样,

  

那么这是否意味着Spring Data JPA本身不能存在?也就是说,它使用了JPA提供程序之一(例如Hibernate,Eclipselink或任何其他JPA提供程序)? – CuriousMind 16年5月3日在19:17

     

是的。 Spring JPA需要JPA提供程序。 – Vlad Mihalcea '16 May 3 '16 at 19:58

What is the difference between Hibernate and Spring Data JPA

我在春季启动时在PagingAndSortingRepository中使用,我只看到EnableJpaRepositories批注。这就是为什么我感到困惑。

1 个答案:

答案 0 :(得分:0)

我在spring-boot-starters pom.xml中看到了hibernate-core依赖关系,所以我认为默认情况下是休眠状态。

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starters</artifactId>
<version>2.0.4.RELEASE</version>

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-core</artifactId>
  <version>5.2.17.Final</version>
  <scope>compile</scope>
   <exclusions>
    <exclusion>
      <artifactId>jboss-transaction-api_1.2_spec</artifactId>
      <groupId>org.jboss.spec.javax.transaction</groupId>
    </exclusion>
     </exclusions>
   </dependency>

enter image description here

相关问题