Event time I save my object after adding children it bombs.
For instance.. Class a has a bag of items ( id's 12, 13, and 14 )
I have already saved to the collection so they exist in a many to many mapping table.
My question is, now do I tell it to skip re-adding pre-existing entries.
When I save it tries to save id's 12, 13, and 14 even though already exist. And ideas?
{"a different object with the same identifier value was already associated with the session: 12, of entity: Class Name Here"} <class name="DocumentSavingsEvent, DomainObjects" table="DCSEvent" lazy="false"> <id name="Id" column="EventId" unsaved-value="-1"> <generator class="native" /> </id>
<bag name="ActivityListItems" table="DCSEventActivityItemTypeMapping" lazy="false" cascade="save-update" inverse="false"> <key column="EventId" /> <many-to-many class="DocumentSavingsCostActivityItem, DomainObjects" column="ActivityListId" /> </bag> </class>
Thanks, Nick
|