• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what exactly meant by JPA?

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

My question may be very silly. What exactly is meant by JPA? I see it is often used related to "hibernate with annotations" and ejb 3.0.


Is JPA a specification which is implemented by Hibernate and EJB3.0?

Thanks
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
once upon a time there was EJB2 that really sucked and was very difficult to use, and there was Hibernate and Toplink and some other ORM technologies, and sun said ok guys our EJB2 really suck and we have to change them, and in that days Hibernate was used heavily so they asked them if they can cooperate together to make a new specification .. and they agreed.

and JPA was born. which stands for Java Persistance API, using JPA you annotate beans to be both used for hibernate and EJB3, however there are some things you can do only in hibernate so you sometimes find some annotations that are not under the javax.persistance packages such as the delete orphan in the Cascade type.

in both cases wether you are using Hibernate or EJB3 you will be using the same annotations, the difference is that in EJB3 to access those persistence objects you use an EntityManager while in Hibernate you use a Session, another difference is how transactions are managed.

hope it helps ;).
 
Sagar Kale
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Omar, Sure it will certainly help.
 
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See also,

http://en.wikibooks.org/wiki/Java_Persistence/What_is_JPA%3F
 
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic