This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes difference between hibernate and entity beans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "difference between hibernate and entity beans?" Watch "difference between hibernate and entity beans?" New topic
Author

difference between hibernate and entity beans?

yamini nadella
Ranch Hand

Joined: Apr 13, 2004
Posts: 257
I think entity beans also like ORM. then why ORM tools like hibernate better than entity beans?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Well before EJB3, which isn't final yet. Entity Beans did not map well to relational databases. The different types of relationships that you can have in a database did not match up well. ORM tools also provide better integration with specific database bases, whereas Entity Beans were abstracted out too far to greatly enhance their speed with RDBMS specific tuning capabilities.

ORM tools also tend to be easier to work with than the complexities of EJB Entity Beans.

Now, with that said, I think in EJB3 you will find out that there won't be a difference. Hopefully.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 292

With EJB 2.x entity beans, you are forced to implement certain interfaces and the EJB framework is quite pervasive upon your objects. You can't have "clean" objects and this somewhat limits your design choices when designing your objects. Also, because of this, its quite hard to test your objets outside of their container.

With Hibernate you do not have this problem as there are no specific interfaces you must implement and you do not have to extend any Hibernate specific classes. You can therefor have a "cleaner" design to your objects and can test them a lot easier as they can be tested both inside and outside their container.
 
 
subject: difference between hibernate and entity beans?