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?
Omar Al Kababji
Joined: Jan 13, 2009
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