Hi, I'm having a problem with mapping a composite element. Here's the code:
Code:
<bag name="hireDetails" cascade="all, delete-orphan" lazy="false">
<key column="userId" />
<composite-element class="libraryImpl.HireDetailsImpl">
<many-to-one name="item" class="libraryImpl.ItemImpl" column="itemId" />
<many-to-one name="user" class="corporateImpl.UserImpl" column="userId" />
<property name="startDate" type="date" column="startDate" />
<property name="endDate" type="date" column="endDate" />
</composite-element>
</bag>
The exception:
Code:
Repeated column in mapping for collection: corporateImpl.UserImpl.hireDetails column: userId
How can I tell Hibernate to use the userId as a key, as well as mapping it to the composite-element ?
Thanks in advance.