Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database Schema Query Using Hibernate

 
Vaibhav G Garg
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am pretty new to Hibernate framework. While reading through the various features provided by Hibernate like associations, inheritance, etc I found that it is required to change the database schema as well. Below are a couple of instances:

i. If we are using List to store a collection, then we need to add an index column to the database to store the order of insertion.

ii. If we are implementing inheritance, then it is required to create a new table to store the relationship or add a discriminator column in the same table.

iii. In case of relationships, if an entity has a collection of other objects, then that collection would be stored in a separate table. How would we be able to handle such scenarios where entity can have multiple collections.

These are a few of the instances I have encountered which needs database schema changes. I have the following queries:

i. Please let me know if my understanding is correct and it is required to update the db schema in these cases.

ii. Does this mean that we wouldn't be able to use the Hibernate if we don't have access to update the db schmea?

iii. If we have to change the schema a lot like adding indexes or creating new table to hold relationships, won't it be tightly coupled information related to hibernate?

iv. Is Hibernate benefits really outweigh the changes made by us to the db schema? What are the benefits of using hibernate if we are required to put in so much effort in changing the db schema?


Thanks in Advance!

Regards,
Vaibhav G
 
Vaibhav G Garg
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please suggest your inputs.
 
Vaibhav G Garg
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please provide your inputs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic