简体   繁体   中英

If using EJB3 JPA , do I need hibernate?

I know that JPA is just a standard and to use it you need an implementation such as Hibernate3.2 , My question is : does EJB3 come with an implementation of JPA or I still need implementation such as hibernate to use besides EJB3 ? If you can point me to any useful tutorial on this it will be great :)

Thanks

If the container supports JPA, it gives you an API ( EntityManager and others), you don't care what implements it. So no, you don't have to use Hibernate. Some containers will use Hibernate underneath, other EclipseLink, etc. But from your perspective you are using an API that just works .

If you are using Hibernate features such as @Filter then you shall use Hibernate as your JPA provider. Some application servers (such as JBoss) use Hibernate as their JPA provider.

It depends on the Java EE container specific implementation. JPA is more like an interface, specification, and Hibernate is a custom JPA implementation.

Hibernate comes on board with JBoss, Eclipselink is an example of another JPA implementation which comes with Glassfish. But you can still use Hibernate + Glassfish, if you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM