-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate 3.2 Dynamic Tables possible?
PostPosted: Tue Nov 20, 2007 6:53 pm 
Newbie

Joined: Tue Nov 20, 2007 6:43 pm
Posts: 2
Hi All,
I hate dynamic tables, but this time it looks like we need them.

I would love to use Hibernate (not used before, but looks good!), but I am starting to think it is not possible to use hibernate with tables we need to create at runtime due to not knowing what will be in the various tables linked to a dynamically created app created by users.

I came up with a static version (cols as rows, as cols not known up front), but that version made the queries complex and slow and that was before aggregate functions like sum!

Otherwise will have to use something like JDO, iBATIS or something else that allows this.

Fingers crossed that it can be done in hibernate at runtime and someone replies!

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 5:34 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
You could create your mapping at run time, either by manipulating the mapping objects (probably undocumented, you'll have to look at the hibernate source code) or by creating DOM objects for the mapping files. Then you can feed those mappings into a new Configuration object every time your database schema changes. You then create a new SessionFactory based on this Configuration.

So you can have the dynamic nature, but only between Sessions. You won't be able to change a single Session's mapping while it is active.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 6:21 am 
Newbie

Joined: Tue Nov 20, 2007 6:43 pm
Posts: 2
Thanks for info will give it a whirl!

If anyone else has ideas, code etc, please post!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.