EJB

If you ever created an EJB application using older versions of JEE specifications, J2EE, you would remember that data persistence was achieved using Entity Beans, which implemented the javax.ejb.EntityBean interface, and you had to implement all those horrifying methods and provide different implementations, depending on the persistence nature of the entity bean, that is container-managed or bean-managed.

Thanks, mostly, to Hibernate, the Java Persistence API (JPA) was born to simplify the implementation. In the next section, we will see how to set up Hibernate as the entity manager when using EJB 3.

Persistence unit

In the JPA world, the Entity Manager represents the persistence unit. It is defined by the javax.persistence.EntityManager interface. ...

Get Mastering Hibernate now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.