• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

EJB3 vs Hibernate vs Toplink vs OpenJPA

Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When people refer to EJB3 entity beans, are they refering to a particular implementation? Or does EJB3 entity bean refer to the JPA implementation such as Hibernate ?

I see a lot of posts which have the title "Hibernate vs EJB3" well, are they competing products, or??

Can someone explain this to me? Does EJB3 Entity compete with Hibernate?
or ??

Billy thanks you

Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB3 entity beans mean JPA beans. As such, this is 'just' a specification of the API, behaviour, semantics. JPA by itself is not usable, it requires someone to implement the specification. Such implementations (called JPA providers) are: Oracle TopLink Essentials* (reference implementation of JPA1), Hibernate (JPA1 and JPA2 recently with HB 3.5), EclipseLink (JPA1 and reference implementation of JPA2, TopLink donated by Oracle to Eclipse). There are others. Different implementations are used in different application servers: Glassfish v2.1 uses TopLink Essentials, JBoss uses HIbernate, Glassfish v3 uses EclipseLink. The idea is that you write your application against interfaces on GF 3 and then you are able to deploy and use it in JBoss AS 6, for instance - this requires that you don't use any provider specific functionality. If you do, you would have to bundle the provider with your application or simply rewrite parts of the app for the new runtime.
When comparing EJB3 vs. Hibernate, people mean JPA vs. Hibernate native API. Hibernate native has much functionality that didn't make it to JPA (EclipseLink as well), so if you need it, you might consider 'jailbreaking' from JPA. All project that I was on started with JPA, and if necessary breaked out (but not often).

* TopLink and TopLink Essentials - TopLink was a product by Oracle (as such I think it was closed source, but I am not sure), TopLink Essentials was an Open Source subset of TopLink that restricted itself to only implement what JPA requires. TopLink was later donated to Eclipse and is now an Open Source product under the name EclipseLink, and serves as the reference implementation for JPA2. It is worth checking out.

Hopefully this clears some of your doubts.

He's my best friend. Not yours. Mine. You can have this tiny ad:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic