Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
Mapping documents:
<set name="worklistRecords"
table="WORKLIST_RECORDS" cascade="all-delete-orphan">
<key column="ROLE_ID"/>
<composite-element class="WorklistRecord">
<parent name="Role"/>
<many-to-one name="SubSource" class="SubSource"
column="SUB_SOURCE_ID" not-null="true"/>
<many-to-one name="RecordStatus" class="RecordStatus"
column="RECORD_STATUS_ID" not-null="true"/>
<many-to-one name="RecordType" class="RecordType"
column="RECORD_TYPE_ID" not-null="true"/>
</composite-element>
</set>
Composite object mapping
<class name="WorklistRecord" table="WORKLIST_RECORDS">
<id column="WORKLIST_RECORD_ID" name="id" type="long"
unsaved-value="-1">
<generator class="native">
<param name="sequence">SEQ_WORKLIST_RECORD_ID</param>
</generator>
</id>
<many-to-one name="role" column="ROLE_ID"
not-null="true">
</many-to-one>
<many-to-one name="subSource" column="SUB_SOURCE_ID"
not-null="true">
</many-to-one>
<many-to-one name="recordStatus" column="RECORD_STATUS_ID"
not-null="true">
</many-to-one>
<many-to-one name="recordType" column="RECORD_TYPE_ID"
not-null="true">
</many-to-one>
</class>
using spring:
Full stack trace of any exception that occurs:
Oracle 8i:
Removing a WorklistRecord from the collection managed by the Roles class results in an update being called rather than a delete and a null error being thrown since I nullify the objects before removing. This is shown below.
public void removeWorklistRecord(WorklistRecord record) {
record.setRole(null);
record.setRecordStatus(null);
record.setRecordType(null);
record.setSubSource(null);
_worklistRecords.remove(record);
}
Any ideas, I've played with the inverse and cascade options but have not had any success. Inserts are working just fine.
thx
sean