Hi,
I need some help in mapping two Objects A & B described below along with their Tables. There is a one-to-many relationship between Object A and Object B. But I want to do a one-to-one mapping between these two objects (A combination of "aId" & "bId" makes it one-to-one). Can some one tell me how to map these two objects so that whenever I read Object A I get unique values of Object B (using "aId" & "bId" as key) into bId, bField3, bField4 of Object A?
Code:
ObjectA{
Long aId;
String aField2;
String aField3;
Long bId;
String bField3;
String bField4;
}
ObjectB{
Long bId;
Long aId;
String bField3;
String bField4;
}
TABLE_A
-----------
A_ID
COL2
COL3
TABLE_B
----------
A_ID
B_ID
COL3
COL4
Thanks