JPA provides a subset of the Hibernate functions, but EJB3 provides other services that Hibernate does not address (e.g. web services, EJB, timer service)
JPA offers the following advantages over Hibernate:
- Standardized API
- Provider Independence (can switch between Hibernate, TopLink, OpenEJB, etc.)
Hibernate offers the following benefits:
- Widely used
- De facto standard
- Direct support from Spring, Grails, etc.
- Perhaps the best tools support
- Additional Features Except JPA
What you can do is write an application in EJB using JPA, and then use Hibernate functions when necessary. Or just use simple Hibernate to save if you don't need standardization and vendor locking. Actually, you are unlikely to switch between Hibernate and another provider, but this will happen.
Ken liu
source share