Hi all,
I recently ran into a difficult mapping scenario in a legacy database. Appreciate if any guru out there that can help.
Table A
---------
PrimaryKey1
LogicalKey_B
LogicalKey_C
DataField_A1
Table B
---------
PrimaryKey_B
LogicalKey_B
DataField_B1
Table C
---------
PrimaryKey_C
LogicalKey_C
DataField_C1
Now, if A.LogicalKey_B is the key field to be used to join with B.LogicalKey_B, how would I map that?
With native SQL, the statement should be like:
select * from A, B, C
where A.LogicalKey_B = B.LogicalKey_B
and A.LogicalKey_C = C.LogicalKey_C
This is what I did and I think it didn't got it right:
In the mapping document for A, I use
<set name="x" table="A">
<key column="LogicalKey_B"/>
<many-to-many class="B" column="LogicalKey_B"/>
</set>
Anyone that is good can help in this?
Many thanks!
-RS
|