aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Hibernate implements JPA. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Hibernate implements JPA." Watch "Hibernate implements JPA." New topic
Author

Hibernate implements JPA.

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Hi ,
As the docs say.Hibernate implements JPA 3.0.

so i am having a basic doubt on the above on how to implement this .(knows its a dumb question but please help me as i can't understand)


If i planned to use Hibernate , JPA , EJB3.0 in my application then is the below scenario correct ??

When i submit a form with the fields ,the request is gone to SessionBean of EJB3.0 , which implements all the Hibernate DAO methods , now my question is that do we need do get the Hibernate SessionFactory and Session as the way we obtain a EntityManagerFactory and a EntityManager ??


If you want something you never had do something which you had never done
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
If you use EJB 3, you don't need to use Hibernate, because EJB 3 already includes JPA implementation.
But if you want to use Hibernate, try to search how to change JPA implementation in EJB 3.

But don't use Hibernate interfaces, use JPA interfaces. If your codes use Hibernates interfaces, your codes will not be portable.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Kengkaj Sathianpantarit wrote:If you use EJB 3, you don't need to use Hibernate, because EJB 3 already includes JPA implementation.


EJB 3 is a standard, not an implementation, so it can't include a JPA implementation. Its the application server that implements both.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Kengkaj ,

Though you were wrong on this "If you use EJB 3, you don't need to use Hibernate, because EJB 3 already includes JPA implementation. "
as Paul said

But you made one valid point " But don't use Hibernate interfaces, use JPA interfaces. If your codes use Hibernates interfaces, your codes will not be portable. "

I want to implement this approach .Do i need to get the Hibernate components from JPA interfaces in a DAO implementation layer only know??

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate implements JPA.