• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JPA and Hiberate

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JPA and Hibernate are ORM solutions? what is the difference between them?
JPA can use Hibernate or any other ORM to work with DB but it also has its own implementation to work with the DB right?
Does JPA provide an common API to talk to any ORM that will work with a DB?

Can someone tell me more on this?

Regards,
Chetan Shinde
 
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

C Shinde wrote:JPA and Hibernate are ORM solutions? what is the difference between them?


JPA is a standardized specification for ORM, while Hibernate being an ORM framework itself and also provides an implementation of JPA.

JPA can use Hibernate or any other ORM to work with DB


Yes If those ORMs implement JPA.

.. but it also has its own implementation to work with the DB right?


Hibernate does.

Does JPA provide an common API to talk to any ORM that will work with a DB?


It's the ORM framework should implement JPA hence can use any provider if that implements JPA
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you say that JPA is the common API whose implementation is provided by Hibernate,iBatis,Toplink and similar ORM? I have read a couple of places and thats what I understood.

I have read Hibernate books and have never read about JPA in their books....any idea why?

Thanks in advance.
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also where in the JPA configuration do I tell which ORM should I use?
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

C Shinde wrote:So you say that JPA is the common API whose implementation is provided by Hibernate,iBatis,Toplink and similar ORM? I have read a couple of places and thats what I understood.

I have read Hibernate books and have never read about JPA in their books....any idea why?

Thanks in advance.



iBatis is not JPA standard and in fact iBatis is not an ORM framework.
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I had a look at the persistent.xml file and there is a provider tag in that file which tells which provider is to be used....

Something like this...

 
Vijitha Kumara
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

C Shinde wrote:.. I have read Hibernate books and have never read about JPA in their books....any idea why?


Hibernate came before the JPA. So the books written before may not have JPA covered.
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you mean Hibernate has rewritten their API to JPA spec?

Chetan
 
Vijitha Kumara
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

C Shinde wrote:So you mean Hibernate has rewritten their API to JPA spec?


No. Hibernate provide JPA through EntityManager implementation.
 
Sheriff
Posts: 6837
1299
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the Hibernate EntityManager Library as well. Personally I would prefer using the EntityManager with JPA annotations on Hibernate, instead of using the session-based codes of old day hibernate.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic