Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA dependency difference

 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On google, I found that there can be two ways of specifying JPA dependency.
I want to know difference between these two depdendencies. Also , which dependency can used when ?

Dependency 1

Dependency 2


 
H Paul
Ranch Hand
Posts: 471
4
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hibernate-jpa-2.0-api:

It's the JPA API spec version 2.0. If you open the jar, you will see javax.persistence packages

hibernate-entitymanager
It's the hibernate JPA implementation. Just open the jar to see…

The 4.3.6 Final support JPA 2.1

If you use any IDE, you can see Maven Dependencies / Hierarchy of jars / pom.xml

(Whatever framework you use, just go to the Official site to see what the latest version is and what Maven Coordinate(s) are)
 
Dave Tolls
Ranch Hand
Posts: 2103
15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhay Agarwal wrote:On google, I found that there can be two ways of specifying JPA dependency.
I want to know difference between these two depdendencies. Also , which dependency can used when ?


Adding to what H Paul says, the first is a spec and the second is the implementation.
You can't use Hibernate with just the former.
And the former is a dependency of the latter, so is included when you pull the entitymanager off the repository.
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for all replies.
Understood the difference between these dependencies.
hibernate-jpa-2.0-api is the JPA API spec version 2.0. So does this jar contains only interfaces and abstract classes (no implementation) ?



 
Dave Tolls
Ranch Hand
Posts: 2103
15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open it and have a look.
I'll save you the trouble, since I have it in my IDE at the moment...it's interfaces, annotations and enums.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic