my dog learned polymorphism*
The moose likes Object Relational Mapping and the fly likes Doubt about Hibernate Usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Doubt about Hibernate Usage" Watch "Doubt about Hibernate Usage" New topic
Author

Doubt about Hibernate Usage

Vaibhav G Garg
Ranch Hand

Joined: Sep 23, 2011
Posts: 140
Hi All,

I am a beginner in Hibernate. I have just started reading the Hibernate. And, as per reading, I have found that Hibernate will add some columns like 'Discriminator'. And, there are some inheritance implementation strategies in Hibernate. So, I am confused about the actual Hibernate usage i.e. whether we should use Hibernate in an application where Database is already in place or not. Or, Hibernate is a good candidate for an application where we are also designing the db from scratch. Since I see some tight coupling of DB with Hibernate. Please suggest.

Thanks & Regards,
Vaibhav Garg
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

You can use Hibernate in legacy applications or new ones. Whether it is worth it to introduce into a legacy application may be debatable as it would most likely be a big change. However I would use it in any new application regardless of whether it was using a new database or a legacy database behind the scenes just because of the many benefits it offers. I would argue that an ORM decouples the application from the database as one of the issues an ORM addresses is that applications should be written in terms of the domain model,not bound to the relational model.

That said in any new applications I abstract things one level further and use JPA2 with hibernate as my provider. This also gives you the flexibility to switch persistence providers in the future if necessary and makes you compliant with the standard.



[How To Ask Questions][Read before you PM me]
Vaibhav G Garg
Ranch Hand

Joined: Sep 23, 2011
Posts: 140
Thanks Bill for your inputs.
 
Don't get me started about those stupid light bulbs.
 
subject: Doubt about Hibernate Usage
 
Similar Threads
purpose of dialects
Why should I use annotations and what are those?
Should I use Hibernate?
Deploy Hibernate2.1 on JBoss 3.2.3
Seeking advice about implementing Application Level Pessimistic Locking