It is kind of standard modeling practice for foreign keys to refer to a primary key of related table, it simply has a lot of sense.
For one, if you will ever need to change value of SET_ID you do not need to update dependent objects because they are linked to surrogate key a_OrderId.
However, I suspect (just guessing), that you have a set definition table where SET_ID is the primary key, and in the TSOrder object you want to have set of descriptions associated with the set. If that is the case then I recommend to have a SomeSet class which will have normal map mapping and on the TSOrder have a field of SomeSet type, that will be mapped simply as many-to-one.
Then in the TSOrder object the desired map will be accessible as
tfOrder.getSet().getDescriptionsMap(). H will take care of the rest.
_________________ --------------
Konstantin
SourceLabs - dependable OpenSource systems
|