-->
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.  [ 1 post ] 
Author Message
 Post subject: dynamic-class heterogenous tables per class
PostPosted: Wed Dec 01, 2004 5:49 pm 
Newbie

Joined: Mon Aug 30, 2004 2:48 pm
Posts: 11
Hibernate version:3.0 alpha

How do I tell Hibernate to join to a different table depending on a value in one column. I have two known tables and an unknown amount of extra tables that I will be linking to based on table name. Each unknown table contains different information for each filecabinet (but requires different amounts/types of columns). [This is also a legacy db schema so there is nothing I can do to change it.]

filecabinet
id
tbl_name

fields
filecabinet_id
fld_name
fld_type


I would like my filecabinet POJO to look like this:

class Filecabinet {
int getId(){}
string getTableName(){}
void setTableName(String x){}
Object getFieldValue(int row, String key) {}
void setFieldValue(int row, String key, Object o) {}
}

When the Filecabinet object gets loaded, I would like Hibernate to populate the an array of Map objects that corresponds to each row in the unknown table. Is this or anything like this possible and/or is this what dynamic-classes seek to fulfill.?


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

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.