-->
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: Create tables at runtime
PostPosted: Fri Oct 28, 2005 3:26 am 
Newbie

Joined: Fri Oct 28, 2005 3:18 am
Posts: 1
I want to write a web application in which part of the database schema is stable (i.e. will not change after the application has started) and part of the schema is dynamic (i.e. at runtime it is possible for users to create , alter and drop tables).
I was wondering if it is possible to use Hibernate for this. I read something on the createMappings function, but there is so little documentation about it, that I don't know if and how I can use this.

Is it possible to use Hibernate merely to abstract from the underlying database specific code? In that case I could use Hibernate mappings for the stable part of the schema and execute the necessary queries for the dynamic part using Hibernate to figure out how to translate the results coming from Postgres, MySQL, Oracle etc. and their different versions. This would be especially helpful when handling BLOBS.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 2:50 pm 
Newbie

Joined: Thu Oct 06, 2005 9:30 am
Posts: 18
Location: Canada
Hibernate is a good tool with database. As long as you have your mapping file correct, make sure that you do have proper catalog in your database there is no need for you to create tables. Hibernate will automatically create tables for you. Even if you alter your objects (add new properties), Hibernate will automatically updates your tables.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 5:13 am 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
You could look at using hibernate 3's other entity modes, e.g. DOM, so that you can create mappings whilst the application is running, re-create the session factory with the new mappings, and use DOM models to perform the actions you would otherwise do with objects.

See the dynamic models section of the reference manual at:
Dynamic Models


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.