NHIbernate and quotcollection was not an associationquot when using bag and composite-element
Look at this mapping
|
|
It seems ok but it has a subtle error, when you try to save the object, a “collection was not an association” error will arise. This error is derived from the cascade=”all-delete-orphan”, this attribute is used for real entity object not value ones. A mapping with composite element does not need cascade, the RawSearchDefinition is a value object, its lifecycle will span that of the owner.
The solution is simply to remove cascade attribute, that is not required.
alk.
Tags: NHibernate