Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between hibernate and entity beans?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think entity beans also like ORM. then why ORM tools like hibernate better than entity beans?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic