You're right... I have the cascade="all" attribute at the parent :
<bag name="FlightEntryServices" access="property" table="FlightEntryService" lazy="false" cascade="all"> But ofcourse it's not needed at the child... I removed it and it works fine. Thank you very much ! Dimitris Andrakakis On Aug 23, 1:20 am, Oskar Berggren <[email protected]> wrote: > 2009/8/22 Dimitris Andrakakis <[email protected]>: > > Hi all, > > > I have a problem which I find hard to understand : when I delete a > > child object, the father gets deleted too. > > > The father is a class called FlightEntry. The children are classes > > FlightEntryService and FlightEntryDelay (both exchibit the same > > behaviour). > > > The (ActiveRecord generated) hbm files are included below. The C# code > > is as simple as this (obviously m_editedObject as the FlightEntry > > being manipulated) : > > > FlightEntryService svc = m_editedObject.FlightEntryServices[0]; > > svc.Delete(); > > > <class name="OlympicHandling.Oly.ObjectModel.FlightEntryService, > > <many-to-one name="FlightEntryId" access="property" > > class="OlympicHandling.Oly.ObjectModel.FlightEntry, > > OlympicHandling.Oly.ObjectModel" column="FlightEntryId" foreign- > > key="FK_FlightEntry_FlightEntryService" cascade="all" lazy="proxy" /> > > I believe this is caused by cascade="all"? What is that doing there? > > /Oskar- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
