1

Difference between Spring-JPA and Spring-Data-JPA and I don't mean JPA the specification .
I am new to JPA and Spring.
While integrating Hibernate with Spring as JPA provider i came across two Spring project.
Please clarify the difference as well as relationship between
https://mvnrepository.com/artifact/org.springframework/spring-jpa
https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa
I found out spring-data-jpa contains JpaRepository interface which i intend to use but then what is the use of spring-jpa.

Piyush
  • 599
  • 1
  • 7
  • 16
  • to freely quote star wars, *those are not the artifacts you are looking for*. Spring JPA has been long time superseded/merged into Spring ORM (which is part of the Spring Framework). Which provides basic integration for JPA within your application like configuring an `EntityManagerFactory`, transaction managers and `OpenEntityManagerInView[Filter|Interceptor]`. Spring Data JPA is an abstraction layer for JPA based repositories saving you from writing the nitty gritty repetitive JPA stuff. – M. Deinum Jun 28 '16 at 11:23
  • Should i be using Spring-ORM https://mvnrepository.com/artifact/org.springframework/spring-orm/4.1.4.RELEASE Will I still need Hibernate or any other JPA provider with Spring-ORM ? – Piyush Jun 28 '16 at 12:01
  • Spring, as with other things, only provides wrappers, it isn't a JPA implementation. Which is also explained in the reference guide. – M. Deinum Jun 28 '16 at 12:17
  • Thanks you. The name "Spring-ORM" confused me . – Piyush Jun 28 '16 at 12:25

2 Answers2

1

If you look at the artifcat dates that is something really old - 2008. You should not worry about it.

Robert Niestroj
  • 15,299
  • 14
  • 76
  • 119
1

Essentially, Spring Data is predecessor for Spring Framework: JPA.

Hrabosch
  • 1,541
  • 8
  • 12