HI
I have a <list> of components which have a reference to an Entity.
HEre is the collection mapping:
<list name="Specimens"
access="nosetter.camelcase"
table="Ariz410cSpecimens"
cascade="all"
lazy="false">
<key column="Ariz410cId"/>
<index column="SpecimenIndex" type="int"/>
<composite-element
class="Cei.MaterialsTesting.Ariz410c.Ariz410cSpecimen">
<many-to-one name="Ariz415c" access="nosetter.camelcase"
cascade="all" lazy="false"/>
<property name="Height" access="nosetter.camelcase"/>
<property name="Stability" access="nosetter.camelcase"/>
<property name="Flow" access="nosetter.camelcase"/>
</composite-element>
I need to 'Clear()' the collection (an IList<>) each time the
specimens are updated .
The entity which holds this collection does an 'specimens.Clear()' so
I would expect an DELETE for the Ariz415c references (the many-to-one
in the component), but instead the components are being UPDATEd and
the old Ariz415c references persist in the db...the cascade is not
being enforced.
I have checked my Equals/GetHashCode implementations and they should
be getting marked as dirty by NH. Can anyone see in my mapping where I
am doing wrong? Do I need to elevate the component class
(Ariz410cSpecimen) to an NH Entity for this to cascade correctly?
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---