Using Hibernate 3.0 with EJB 3.0 and JPA

Where I work, the guys who are sitting across from me are working on a project. This is a JavaEE application that uses Struts, Spring, EJB 3.0, JPA, and Hibernate 3.0. They use an EJB 3.0 beans object with annotations. I asked them why Hibernate 3.0 is in this mix, and no one can tell me. It looks like they turned on Hibernate 3.0 because they were told but didn’t use it for anything that they cannot get from the beans / JPA EJB 3.0 object. They use CMP and gain access to all database functions through EJB.

Can Hibernate provide you anything in this setting that cannot be provided by EJB 3.0 / JPA?

+3
source share
2 answers

JPA itself is just a specification, not a product; it cannot perform persistence or anything else on its own. JPA is just a set of interfaces and requires implementation (a persistence provider). There are open source versions and commercial JPAs (Toplink Essentials, EclipseLink, Hibernate EntityManager, OpenJPA, Kodo, etc.), And any Java EE 5 application server (or Java EE 6) must provide support for its use (JBoss uses Hibernate EntityManager, GlassFish v2 uses Toplink Essentials by default, GlassFish v3 uses EclipseLink by default, WebLogic uses Kodo by default, etc.) 1 .

JPA , , , Java SE ( EJB 2.x). , , . , Hibernate EntityManager, Hibernate Core, , , .

1 , (?) , . , Hibernate Kodo Weblogic EclipseLink GlassFish. , .

+2

Hibernate JPA, . JavaEE Hibernate . , JBoss Hibernate . , Hibernate , .

, Hibernate , , . Hibernate , JPA. (, Toplink Eclipselink). , , , , - , Hibernate.

+4

Source: https://habr.com/ru/post/1734311/


All Articles