Hi,
I have a legacy system that have its own database already in production. In this system, there is a table that contains a pure string, which leads to another Table and its value.
The case is like the following, where the current system uses the Destine as a Table and DestineId as this Table primary key value.
Table1
ID, Active, Destine, DestineID 1, true, Client, 1; 2, true, Client, 2; 1, true, Address, 5;
What is the best practice for me to update this table and map this in Hibernate?
I considere the following:
1-Create a superclass for this "Destines", which would have a Enum telling its Type 2-Create a column for every possible "Destine" table (someplaces this can be up to 10 distinct tables) 3-Create a superclass for "Destines", which would have a column for every possible "Destine"
Note: Changing this relation will reflect in many modules, so i need to keep as easy as posssible to upgrade
I dont know what are the best practices for this case, maybe there is something i cant see...
How would you do this mapping? Please tell me if the example is not so clear
|