Right, here's my first attempt at implementing a composite-element. Please could someone take a look at my mapping and tell me why I'm getting the following error?
Code:
could not initialize a collection: [com.lsb.uk.mqs.value.ChecklistValue.checklistItemRecords#64]
........
ORA-00904: "CHECKLISTI0_"."NOTEID": invalid identifier
The column in my DB table is NOTE_ID, not NOTEID. So I'm not sure where Hibernate is getting that from.
Thanks!
Code:
<class name="com.lsb.uk.mqs.value.ChecklistValue" table="CHECKLIST">
<id name="checklistId" column="CHECKLIST_ID" unsaved-value="0">
<generator class="sequence">
<param name="sequence">checklist_seq</param>
</generator>
</id>
<property name="applicationId" column="APPLICATION_ID"/>
<property name="adHocRequirements" column="AD_HOC_REQUIREMENTS"/>
<property name="applicationException" column="APPLICATION_EXCEPTION"/>
<list name="checklistItemRecords" table="CHECKLIST_ITEM_RECORD" lazy="false">
<key column="CHECKLIST_ID" />
<list-index column="CHECKLIST_ITEM_RECORD_ID"/>
<composite-element class="com.lsb.uk.mqs.value.ChecklistItemRecordValue">
<property name="checklistItemId"/>
<property name="checklistId"/>
<property name="noteId"/>
<property name="checked"/>
</composite-element>
<!-- many-to-many class="com.lsb.uk.mqs.value.ChecklistItemRecordValue" column="CHECKLIST_ITEM_ID" lazy="false"/-->
</list>
</class>
<class name="com.lsb.uk.mqs.value.ChecklistItemRecordValue" table="CHECKLIST_ITEM_RECORD">
<composite-id unsaved-value="any">
<key-property name="checklistItemId" column="CHECKLIST_ITEM_ID"/>
<key-property name="checklistId" column="CHECKLIST_ID"/>
</composite-id>
<property name="noteId" column="NOTE_ID"/>
<property name="checked" column="CHECKED"/>
</class>