Monday, March 5, 2007

What is the difference between Hibernate and EJB 2.1?

Hibernate is a ORM(object relation mapping ) tool which can be used for creating a mapping between plain java bean objects (POJO) and a persitent storage (rdbms).The EJB 3.0 specification is divided into two parts The first which deals with session and MDBs and the second which deals with persistence and entity beans. The latter part is called JPA(java persistance API ). Hibernate 3.0 implements the JPA specification.EJB 2.1 is a specification for defining loosely coupled reusable business componenets.

EJB 2.1 and hibernate serve two different purposes. Hibernate can be co related with the entity beans in EJB 2.1.HIbernate offers far more extensive features then plain entity beans.still there are no containers (applicaiton servers) available which fully implement the EJB 3.0 specification. depending upon the buisness needs hibernate framework can be used in conjuction with EJB2.1 to achieve the JPA abstraction.

SOURCE : www.referjava.com

No comments: