I have been trying to map a legacy database using HBM file mappings and need some help getting a join to hopefully behave the way I would like. I need to join on a table using two fields, where the primary table's primary key is not the field that I would like to join on. For example:
Quote:
Table A
Key1
Field1
Field2
Table B
Key1
Key2
I need to map A.Field1 to B.Key1 and and A.Field2 to B.Key2 while using A.Key1 as my ID for the object. My object looks like this:
Code:
class Object {
int number
String uid
int p_number
}
where number is A.Key1, uid is A.Field1 adn B.key1 and p_number is A.Field2 and B.Key2.
This scenario is possible when I use table B as a composite key on the Object but I need to be able to reference Table A as the Identifier since this field is the referencing field throughout the rest of the system.
Any help is much appreciated.