-->
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: Question about Legacy db mapping
PostPosted: Thu Dec 16, 2010 1:04 pm 
Newbie

Joined: Thu Dec 16, 2010 12:39 pm
Posts: 1
Hi,

I have to map an existing legacy db application to Hibernate.

Table Master {
int id;
....
int type1code;
int type2code;
int type3code;
int type4code;
int type5code;
}

and a metatable {
int id;
string type;
int code;
string name;
}

I want to create a Master entity object with the existing properties along with the name from the metatable. The type+code makes the row unique in metatable but they have db generated id as primary key in metatable. These tables are updated once a week through a batch process and the app uses this table extensively (dynamic searching as the master table has 40 attributes).. So I ruled out caching and thought of inmemory database. Since its an inmemory database I have more control of changing the schema ., so I thought of having one table which combines the both such as

Table Master_InMemory {
int id;
....
int type1code;
String type1codeName;
int type2code;
String type2codeName;
int type3code;
String type3codeName;
int type4code;
String type4codeName;
int type5code;
String type5codeName;
}

Now the question is I dont want multiple Master entities , Is there a way I can use a single Master entity for in-memory and non-in-memory to load, save and search?

Any pointers appreciated.

Thanks.


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.