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.
|