Hello,
I've got a problem with bidirectional relations one-to-many/many-to-one.
The A class has got a list of elements from B class. And the C class has got a list of elements from B too.
One element of B class is relationed with A element or C element (XOR relation).
My solution is:
Code:
<class name="A"
table="A">
...
<list name="bs">
<key column="A_ID" not-null="true"/>
<list-index column="POSITION"/>
<one-to-many class="B"/>
</list>
</class>
<class name="B"
table="B">
...
<many-to-one name="As"
column="A_ID"
class="A"
not-null="true"
insert="false"
update="false"/>
....
<many-to-one name="Cs"
column="C_ID"
class="C"
not-null="true"
insert="false"
update="false"/>
</class>
</class>
<class name="C"
table="C">
...
<list name="bs">
<key column="C_ID" not-null="true"/>
<list-index column="POSITION"/>
<one-to-many class="C"/>
</list>
</class>
But this fails. The excpetion is:
Code:
Repeated column in mapping for entity: B column: POSITION (should be mapped with insert="false" update="false")
Any suggestion?
Thanks