Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes EJB and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and Hibernate" Watch "EJB and Hibernate" New topic
Author

EJB and Hibernate

sachin pachpute
Ranch Hand

Joined: Nov 04, 2004
Posts: 38
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

Joined: Dec 07, 2006
Posts: 208
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

Joined: Aug 21, 2004
Posts: 1855
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.


SCJP, SCJD, SCWCD, SCBCD
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

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


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

Joined: Nov 04, 2004
Posts: 38
Thank you all for giving time,
Sachin.
 
 
subject: EJB and Hibernate