I am looking for least possible redesign of my java code.
The database has gone for a major change. Prior to this, my java program uses single primary key to identify the entity and on the basis of this key, I create the sets of java object (Which actually represent the tables in database). So logically each table is identifiable from the other by respective primary key (which is in fact one and only one).
The same key server as a foreign key for the other table, which has it’s own primary key. And so on. Each table is represented as java object.
But now the database tables have been given a different look. Each table is representation of a huge 5-6 fields serving as primary key (instead of old model of having just one primary key).
This model is not very different from the old one except each table has a combination of fields serving as primary key and referential integrity is served the same way as earlier.
My problem is huge code has been written out by considering one unique key. I need to know, how can I generate unique key from combinations of keys and use them with least possible java code modification. Can it be possible ..
You feedback will be a great help