Explain the main difference between Entity Beans and Hibernate.- Entity beans are to be implemented by containers, classes, descriptors. Hibernate is just a tool that quickly persist the object tree to a class hierarchy in a database and without using a single SQL statement. The inheritance and polymorphism is quite simply implemented in hibernate which is out of the box of EJB and a big drawback.Explain the main difference between Entity Beans and Hibernate.- In hibernate, Session Cache or collection of loaded objects relates to a single unit of work. In EJB, Persistence Context-Set of entities that can be managed by a given EntityManager is defined by a persistence unit.
- Hibernate defines HQL for expressing queries to the database. EJB defines EJB QL for expressing queries
- Entity Relationships are unidirectional. Bidirectional relationships are implemented by two unidirectional relationships. Entity Relationships are bidirectional or unidirectional.
|