Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Advantages of Hibernate

 
Amol Umrani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody give me the advantages of hibernate technology

I am no getting the proper answer.

regards
Amol Umrani
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you gone to the Hibernate website? I believe they have lots of advantages listed.

Basically, there is a mismatch between a Database and Objects, so Hibernate bridges the gap without you having to create the whole framework yourself.

There are almost a hundred other great reasons, but too long to type all of them out.

Mark
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Spritzler:

Basically, there is a mismatch between a Database and Objects, so Hibernate bridges the gap without you having to create the whole framework yourself.


Well, it bridges *some* of the gap. There are still cases where you need to "polute" the database and/or object model to be able to map them to each other using hibernate.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:


Well, it bridges *some* of the gap. There are still cases where you need to "polute" the database and/or object model to be able to map them to each other using hibernate.


I can only think of one case where this is so, and that would be versioning. Other than that, I can create a complete third normal form database that maps, I can create a Data Warehouse Star Schema that maps, and I can have legacy old style data modelling that maps.

Which other, if any, instances are you talking about that "polutes" the database? (This is not a bashing question, but one that I want to know so I can learn more and see what I am not seeing)

Mark
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which other, if any, instances are you talking about that "polutes" the database?

Some of the Hibernate documentation recommends techniques that weaken (I don't like the word polute - it sounds a bit strong) the data model. I particularaly disagree with their table per class hierarchy design, since it tends to break the ability to use null contraints properly.
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im a new hibernate user and I find it to be very useful.

The main advantage to me is that I can change the DB schema, and run hibernate - which will automatically create a perfect object model for me
from the schema - by replacing foreign keys with nested objects.

It not only provides a great tool to experienced data driven project developers butalso is a learning experience for anyone that ever wandered exactly what the nature of the object relational gap really is.

Im about to post a question about it, however - so I must also admit it is very difficult to "launch" when you first start. Some tutorials make you build all the xml maps yourself - which to me is harder than hardcoding youre own orm layer from scratch.

On small projects (2 or 3 tables) i.e. a hello world style project, Hibernate wont help because the orm is simple and their is no need for the hibernate layer. If using hibernate you better get the hibernate plugin for eclipse (or some equivalent tool which reverse engineers object code from youre data model), and learn to use the reverse engineering tool - otherwise hibernate is more trouble than its worth.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Sturrock:

Some of the Hibernate documentation recommends techniques that weaken (I don't like the word polute - it sounds a bit strong) the data model. I particularaly disagree with their table per class hierarchy design, since it tends to break the ability to use null contraints properly.


Well, for me this case is a matter of the database rather than the object model that dictates which inheritance solution to use. If you have a fully third normal form, then you can map that without "poluting" the database. I guess, I consider this a "It is already poluted" Hibernate didn't create that.

But still a good one.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic