Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Discussion OJB vs. Hibernate

 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used Hibernate yet. I used OJB on a project and it was pretty simple to use. I just wanted to get some opinions on which one is better.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question Mathew. I was just wondering myself. I had spent over two weeks trying to get a simple 1:1 relationship to save to both tables, or just one for that matter. I found that using OJB with MySQL to be tough, especially if you use an auto-increment data-type.
I want to know if Hibernate is easier?
Mark
 
Boon Subra
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can you pl let me know the procedures to implement ojb with oracle.I am trying to implement it for Struts.
I do not know which to choose OJB or Hibernate.
I want to know both rather.
Thanks,
Bhuvana
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know OJB doesn't implement lazy loading, and I think OQL isn't as rich as HQL, nor does OJB support native SQL. Might be wrong, since I have only ever used it during an evalutaion and never on a proper project, so please correct me if I am. I would be interested to hear if anyone has use both Hibernate and OJB on proper projects.
 
Don Stadler
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot comment on OJB having no background in it, but I'm using Hibernate on my current project and am impressed. It seems fairly easy to use.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Sturrock:
As far as I know OJB doesn't implement lazy loading, and I think OQL isn't as rich as HQL, nor does OJB support native SQL. Might be wrong, since I have only ever used it during an evalutaion and never on a proper project, so please correct me if I am. I would be interested to hear if anyone has use both Hibernate and OJB on proper projects.

OJB definitely implements lazy loading. Actually, the feature sets of Hibernate and OJB are very similiar. The major difference between the two is that Hibernate definitely has more market penetration. That alone would make me want to choose Hibernate over OJB.

One interesting tidbit, OJB will eventually implement the JDO specification while Gavin has said that Hibernate never will. Of course, persistence in EJB 3.0 is basically going to become Hibernate...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic