Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB and Hibernate

 
sachin pachpute
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to EJB technology. I have little knowledge on Hibernate. Hibernates also works on Object relational maping and so objects are made persistant so can we say that EJB is obsolate? Shall I continue studing EJB? How can I compare these two?

Thanks.
Sachin.
 
Niall Loughnane
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

As i understand it - i am also new to both EJB and Hibernate :-)

is that EJB is divided up into 3 main sections, i.e. Session EJB beans, Entity EJB beans and Message driven beans

Hibernate is a representation of database tables using java classes i.e. using a database in an object orientated way.

Session beans are a single transaction with the user with no direct database involvement

Entity beans represent entities within a persistant storage (for example a database). Entity beans have direct database involvement and can use EJB-SQL.

Message beans are used by a client to send a message to a bean and doesnt really care if the data gets to the client or not.



Entity beans is most like Hibernate. So Hibernate represents 1 section out of 3 of EJB

EJB 2.0 doesnt use Hibernate so what i would (and plan to do) is to study and understand EJB 2.0 with SQL

The newest version of EJB (3.0) doesnt have SQL for Entity beans but rather uses Hibernate to do database involvement.

I hope the above helps :-)

Niall
[ March 24, 2007: Message edited by: Niall Loughnane ]
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sachin pachpute:
Hibernates also works on Object relational maping and so objects are made persistant so can we say that EJB is obsolate? Shall I continue studing EJB?


HFEJB has 12 chapters about EJB. Only 2 of them are about Entity Beans. If you like to go Hibernate, forget those 2 chapters (actually read them too ) and concentrate on the 10 other chapters.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EJB 2.x Hibernate is a replacement for Entity Beans, plus a whole lot more.

In EJB 3.x Hibernate is an implementation of the JPA spec, plus a whole lot more.

Mark
 
sachin pachpute
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for giving time,
Sachin.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic