• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB and hibernate --same or different

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the purpose of having EJB and hibernate in a project?
I thought hibernate is an alternative to EJB? Please clear me on this.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shah rah wrote:What is the purpose of having EJB and hibernate in a project?
I thought hibernate is an alternative to EJB? Please clear me on this.



Hibernate shouldn't be thought of as an alternative to EJB, with exception to CMP (container-managed persistence). Hibernate basically gives object/relational mapping functionality. Although EJB does have POJO which provides object/relational mapping. Hibernate is great if you don't want to bother writing SQL, but I much prefer EJB. As far as using both in a project...well sure its can be done (and is supported obviously), but I have never done it, nor found a good enough reason to. Hope that helps.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shah rah wrote:What is the purpose of having EJB and hibernate in a project? I thought hibernate is an alternative to EJB? Please clear me on this.


EJBs include Session, MDB & persistence, whereas Hibernate is for the persistence (O/R Mapping framework). While EJB3 introduces the standard way for O/R Mapping (JPA) you can use hibernate (or any other O/R Mapping framework which supports JPA) behind the scene for the persistence of your application.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB (I'm speaking in-terms of EJB 3) is a specification in which JPA is a part of it and Hibernate could be said as the reference implementation of the JPA specification.
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic