| Author |
what exactly meant by JPA?
|
Sagar Kale
Ranch Hand
Joined: May 02, 2008
Posts: 188
|
|
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
|
 |
Omar Al Kababji
Ranch Hand
Joined: Jan 13, 2009
Posts: 357
|
|
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 ;).
|
Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
|
 |
Sagar Kale
Ranch Hand
Joined: May 02, 2008
Posts: 188
|
|
|
Thank you Omar, Sure it will certainly help.
|
 |
James Sutherland
Ranch Hand
Joined: Oct 01, 2007
Posts: 550
|
|
See also,
http://en.wikibooks.org/wiki/Java_Persistence/What_is_JPA%3F
|
TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
|
 |
 |
|
|
subject: what exactly meant by JPA?
|
|
|