File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Or JPA Implementation

 
milind moghe
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since I am a newbie I dont know where should I look for this information and I see this would be a very common question and somewhere it mush have been answered. We are planning to use persistent layer and we are evaluating the options. We found that Hibernate is very popular tool and has lot of rich features. Now we have option of using JPA implementation or use pure hibernate implementation(use entityManager or SessionManager ). I am confused right now which one to go for. What makes pure hibernate better than JPA impl? Or whats not there in JPA impl that will force us to use Hibernate? Do you have any pointers for it?
 
Jayesh A Lalwani
Rancher
Pie
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use Hibernate as the JPA provider, you can really use both. For us, we picked JPA because we wanted to stick with "standard" java. So, we used Hibernate as the JPA provider, and implmented the code using JPA. However, we ran into some thing that Hibernate supports but JPA doesn't. Luckily, we just mixed in the Hibernate annotations with the JPA acnnotations, and Hibernate is fine with it. When the day comes we have to move away from Hibernate, 10% of the code won;t compile, and we will have to do something about it. Meh. atleast we went from 100% provider dependency to 10% provider dependency.
 
milind moghe
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jayesh for the prompt reply.

Is there a list of important hibernate features that are not part of JPA specification?

I also found that one can still access hibernate specific functionality by accessing session manager from entityManager. Has any one used this? and is that something we can use without any issues?

I also found an interesting article where

http://www.theserverside.com/news/2240186700/The-JPA-20-EntityManager-vs-the-Hibernate-Session-Which-one-to-use

In this article Emmanuel Bernard, a data architect for JBoss who is part of the Hibernate team has suggested to use entityManager over sessionManager. Something that forced me think more about JPA.


 
Jayesh A Lalwani
Rancher
Pie
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have a list of features off hand. You might want to compare the javadocs for JPA annotations with javadocs for Hibernate annotations. There are lot of similarities, and in many cases JPA has even borrowed the name of the annotation from Hibernate. You will also find some differrences.
 
Salil Vverma
Ranch Hand
Posts: 255
Hibernate Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Milind,

I do not have complete list but I know that DetachedCriteria is one of such features as are available in Hibernate, but does not exist in JPA.
 
milind moghe
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Salil,Jayesh for your feedback. We are going with JPA but would use proprietary extension where ever it is required.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic