-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Dynamic schema changes
PostPosted: Mon Jul 22, 2013 10:17 am 
Newbie

Joined: Mon Jul 22, 2013 9:55 am
Posts: 2
Hi all,

I'm working on a project using a relational database with a dynamic schema, i.e. columns can be added to tables at runtime. We're using plain SQL with JDBC now, but we're trying to switch to a more object-oriented approach and JPA. Is it possible to handle such schema changes with Hibernate?

I can imagine how I would create a new configuration and provide it to the application dynamically, my concern is how I can deal with object mapping afterwards. In other words, objects are mapped to tables and their attributes are mapped to columns. Arbitrary columns can be added (i.e. there is no way to determine how many of them and what their type would be before the application is started), hence the approach of having multiple classes reflecting several possible changes in the schema would not work. How can I "update" an object to be aware of additional columns if they appear? What I'm thinking of is having e.g. an object with a map as its attribute and I'm wondering if it's possible to map the values from that map to columns in a table somehow.

I would like to steer the discussion away from whether this is a good design - it's a decision that was made in the past due to performance reasons (having such a flat database improved performance dramatically) and changing it now is not an option.

Thanks, any advice is greatly appreciated!


Top
 Profile  
 
 Post subject: Re: Dynamic schema changes
PostPosted: Tue Jul 23, 2013 11:47 am 
Beginner
Beginner

Joined: Wed Feb 06, 2013 2:43 am
Posts: 46
I think you have to change the designs.

As far as i have seen we can not add columns dynamically to hibernate.
But if some how you does i have another thing in my mind, if you will provide hibernate configuration dynamically, it will also reduce the performance as that would be a process equal to building your whole project.

_________________
Thanks,
Ajit Singh
ajits@mindfiresolutions.com
www.mindfiresolutions.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.