Hi everyone!
Is it possible to set a cascade type on a Collection to set child field to null when a parent is deleted. I'll give you an example.
I get two object : «Classification» and «Taxo». Classification is the parent and Taxo, the child. A Taxo don't have to get any Classification. (so it's a "not-null=false").
My mapping is ok and everyting works just fine. Except when I try to delete a Classification that get some child, the child field are not set to null. They always keep the classification ID. So my application doesn't work at all.
Code:
<set name="taxo" inverse="true" lazy="true" table="taxo" fetch="select" cascade="don't_know_what">
<key>
<column name="id_classification" />
</key>
<one-to-many class="ca.ogsl.SpeciesGuide.hibernate.Taxo" />
</set>
Is it possible to set a cascade type to avoid the fact of change all child field value to null manually before to delete the parent?
Thanks a lot for the answer!!
Kev