-->
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.  [ 4 posts ] 
Author Message
 Post subject: Support for Dynamic Tables
PostPosted: Wed Dec 10, 2003 11:50 am 
Newbie

Joined: Wed Dec 10, 2003 11:29 am
Posts: 15
Hi,

This is a bit interesting and I cant be more thankful If I get a fast response on this as my complete architecture is based on this reply :)

Ok ...
Some Background on this.

I have dynamic tables in my application as in the sense I can add cards in
my network which have in built database. So in other words my database tables would be runtime even though the type would be known at compile time. The name of the database would be something like TABLENAME_PTTSERVERID (where PTTSERVERID would be a run time value.)

So in this case I donot even know the exact name of my database tables though "TABLENAME_" would be common and the type of the table would be the same.
So my question whether I can use Hibernate to work with such tables. I believe Hibernate code generation is based on database table schema, and the name of the Object would be same as the Table name. So if I dont even know the Table name would It be possibe to have some proxy configuration wherein I can write generic code which dips into the table at run time and load on the values into an Object. And then use the Object normally...
Right now I am finding the name of the table at runtime and generating SQL queries for everything for that table. I need to change this.
I just want to know whether It is possible to do it using Hibernate and if YES then HOW?????????/

Please do get back to me......Thanks a TON in Advance,

Amit


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2003 11:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
the name of the Object would be same as the Table name


Of course not. Please read the documentation.


Quote:
So in other words my database tables would be runtime even though the type would be known at compile time.


It is possible to manipulate the mapping metamodel at runtime, via the Configuration object. I'm not sure if this is sufficiently dynamic for your needs.

Alternatively, you can do just about anything you like with a custom persister.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 2:01 pm 
Newbie

Joined: Mon Nov 17, 2003 7:53 pm
Posts: 15
I understand that you can do anything you want using a custom persister but even with customer persister how can one specify a table you want your class to map to at runtime? Do II


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2004 1:26 pm 
Newbie

Joined: Mon Nov 17, 2003 7:53 pm
Posts: 15
*bumb*


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