This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate and EJB 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Hibernate and EJB 3.0" Watch "Hibernate and EJB 3.0" New topic
Author

Hibernate and EJB 3.0

Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
Cameron,
How are hibernate and ejb 3.0 related?
How do they overlap (or not)?
When would you choose one over the other?


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

EJB provides an object relational mapping mechanism that uses JPA. Many people think Hibernate is based on EJB 3.0, or EJB 3.0 is based on Hibernate, which isn't true, although both technologies pull from many of the lessons learned over the past 5 or 6 years in the industry, and as such, they share a great many similarities.

I like the fact that Hibernate does not need an EJB container to run. This is especially helpful for my WebSphere clients that don't have access to an full version WebSphere EJB 3.0 server. This is always a big concern for clients.

-Cameron McKenzie


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
I don't want to barge in on Cameron's parade (sorry, Cameron!), but I just need to clarify Cameron's answer, because I think it was a little misleading (unintentionally, I'm sure).

JPA doesn't need an EJB container any more than Hibernate does (although if you do have a container then JPA is much easier to use than the Hibernate API).

Cameron is quite correct that EJB 3.0 (the JPA part of it) was based on many products and technologies, including but not limited to Hibernate.


-Mike
Pro JPA 2: Mastering the Java Persistence API
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
is Hibernate annotations more advanced(more capabilities) than EJB 3.0annotations?
I know Hibernate annotations are based on EJB 3 annotations.


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1430

Hibernate Annotations does offer some annotation "extensions" (for lack of a better description) that are Hibernate specific, and not part of the EJB 3.0 persistence specification.
[ June 04, 2008: Message edited by: Jelle Klap ]

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8876

Originally posted by Jelle Klap:
Hibernate Annotations does offer some annotation "extensions" (for lack of a better description) that are Hibernate specific, and not part of the EJB 3.0 persistence specification.

[ June 04, 2008: Message edited by: Jelle Klap ]


So what are those annotations ?


Groovy
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Hibernate and EJB 3.0
 
Similar Threads
EJB 3.0 and Hibernate
Will Ejb3 make other technologies not used
Do your bit to shackle the reputation of earlier EJB versions
Hibernate and EJB 3 and 3.1
Hibernate vs EJB 3.0