Hey everyone
I have the following mapping:
Code:
<class name="Order" table="SalesOrder">
<list name="_orderLines" access="field" table="OrderLines" cascade="all" lazy="false" inverse="true">
<key>
<column name="orderId"/>
</key>
<index column="sequence"/>
<composite-element class="OrderLine">
<many-to-one access="field" name="_order" column="orderId" class="Order" not-null="true"/>
</composite-element>
</list>
</class>
It gives me the following error:
Code:
Exception in thread "main" org.hibernate.MappingException: Repeated column in mapping for collection: nl...domain.Order._orderLines column: orderId
at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:275)
at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:298)
...
Which is probably totally valid. But how can I mantain a reference from the OrderLine to the Order without creating an additonal column? Am I missing something?
Thanks in advance,
Vincent