Hello everyone. I'm quite new to Hibernate and need help in a hopefully simple task.
I do have: An XML mapping of table A to class A.java.
I do have: Another table B that has a common column with A (its value is key in A, but can occur more than once in B), and 2 other columns that I do need in the mapping to class A.
I can map a column region to a Set like this in the XML mapping of table A:
Code:
<set name="name of the Set" inverse="false" lazy="false" table="B" fetch="select">
<key>
<column name="the common column" not-null="true" />
</key>
<many-to-many entity-name="de.test.A">
<column name="one of the 2 other columns in B" not-null="true" />
</many-to-many>
</set>
... and do the same for the other column.
But, this does not help me since the order of a Set can be random, and if I get 2 Sets I can't know which values read from B's 2 other columns were in the same row. I do however need this information.
I too can't use mappings to List since B has no index column.
Does anyone know how I can work around my problem?Thanks in advance and kind regards
Eques T.