File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "difference between hibernate and entity beans?" Watch "difference between hibernate and entity beans?" New topic

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

Joined: Feb 05, 2001
Posts: 17276

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.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 293

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.
I agree. Here's the link:
subject: difference between hibernate and entity beans?
It's not a secret anymore!