-->
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: Mapping "invisible" tables
PostPosted: Mon Sep 13, 2004 12:07 pm 
Newbie

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

Name and version of the database you are using:Oracle 9i

My DB schema consists of 40+ known tables of which I have already mapped. However, I also have x number of unknown tables that will be generated throughout the course of the application (by the application) and thus cannot be mapped directly into the hibernate XML file. The table(s) are generated by the application, and the table name and column names are stored in a table maintained by the application. I have read about dynamic mapping support in 3.0 but I don't understand it fully. What would the architecture in Hibernate look like for these invisible tables? Has anyone done this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 13, 2004 1:03 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
dynamic mapping is the ability to map 1 table to a Map in Java (no concrete POJO).
You can build the configuration DOM yourself at Hibernate start to add your particular tables.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 13, 2004 1:59 pm 
Newbie

Joined: Mon Aug 30, 2004 2:48 pm
Posts: 11
Thanks for your reply. I understand how to create a config file on startup but that isn't really an option. Even after the application has started (and already loaded the configuration file), there will be tables added to the database. Let me give you a more specific description of the schema.

I have a table called filecabinets that holds meta data about file cabinets that users can create. It contains fields like fc_id, name, etc. It also has fields to connect it to a table like, table_name. Each row in the filecabinets table represents a file cabinet and there is a whole table in the database represented by each filecabinet. There is another table that contains further information about each filecabinet table such as field names. I might have a hundred different filecabinets, if not more.

What I need is a general class that would map to the known fields in field cabinet such as name, fc_id, but also other parametized methods that would allow me to pass in the field names for that specific file cabinet and get back the values.


class filecabinet {
string getFcId()
string getName();
string[] getFields()
string getFieldValue(string fieldName)
}

Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 13, 2004 2:00 pm 
Newbie

Joined: Mon Aug 30, 2004 2:48 pm
Posts: 11
Thanks for your reply. I understand how to create a config file on startup but that isn't really an option. Even after the application has started (and already loaded the configuration file), there will be tables added to the database. Let me give you a more specific description of the schema.

I have a table called filecabinets that holds meta data about file cabinets that users can create. It contains fields like fc_id, name, etc. It also has fields to connect it to a table like, table_name. Each row in the filecabinets table represents a file cabinet and there is a whole table in the database represented by each filecabinet. There is another table that contains further information about each filecabinet table such as field names. I might have a hundred different filecabinets, if not more.

What I need is a general class that would map to the known fields in field cabinet such as name, fc_id, but also other parametized methods that would allow me to pass in the field names for that specific file cabinet and get back the values.


class filecabinet {
string getFcId()
string getName();
string[] getFields()
string getFieldValue(string fieldName)
}

Any ideas?


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.