I've got a problem with the following objects(Really ugly table structure, but we're stuck with it for now):
Class UserWorkgroupSetup{
WorkgroupSetup workgroup;
Set workgroupSellerSetups;
}
Class WorkgroupSetup{
Set sellerPartnerships;
}
Class WorkgroupSellerSetup{
UserWorkgroupSetup userWorkgroup;
SellerPartnershipSetup sellerPartner;
}
Class SellerPartnership{
WorkgroupSetup workgroup;
}
The problem appears to me to be in the mapping between the UserWorkgroupSetup and the WorkgroupSellerSetup which is a follows:
UserWorkgroupSetup:
<set name="workgroupSellers" cascade="all" lazy="false" inverse="true">
<key column="USER_WORKGROUP_ID"/>
<one-to-many class="com.notiva.cbo.buyer.data.setup.types.WorkgroupSellerSetup"/>
</set>
WorkgroupSellerSetup:
<many-to-one column="USER_WORKGROUP_ID" name="userWorkgroup" not-null="true" class="com.notiva.cbo.buyer.data.setup.types.UserWorkgroupSetup"/>
If I don't use session.lock(userWorkgroupSetup, LockMode.NONE), I get a stale object exception. If I do, I get a "reassociated object has dirty collection" exception.
Any help would be greatly appreciated.
|