cascade="all" and on-delete="cascade", don't work ? 2008/10/1 Will Shaver <[EMAIL PROTECTED]>
> > So there is this wonderfully clear sentenece in the current (1.2) > documentation: > > "Please note that NHibernate does not support bidirectional > one-to-many associations with an indexed collection (list, map or > array) as the "many" end, you have to use a set or bag mapping. " > > Here's what I'm trying to do, perhaps it isn't supported. > > I have a many-to-many that I'm implementing with two one-to-many on a > bridge class. > > [Equipment] <-->[EquipmentSequenceToEquipment] <--> [EquipmentSequence] > > This worked great as two bags marked with inverse="true" and > cascade="all-delete-orphan". I'd set the properties on the > EquipmentSequenceToEquipment or adding the link, and remove it from > the respective collections to delete the link. > > Now I want to have the list sorted, things have gone downhill. > > This works for adding elements: > > <list name="EquipmentSequenceToEquipment" inverse="true" > lazy="true" cascade="all-delete-orphan"> > <key column="EquipmentSequenceId"/> > <index column="PositionIndex" /> > <one-to-many class="EquipmentSequenceToEquipment"/> > </list> > > but as soon as I remove an element, NH tries to do two things: > 1) set the EquipmentSequenceToEquipment.Equipment column to null > 2) delete the EquipmentSequenceToEquipment object. > > #2 is what I want it to do. I don't need it to set the column to null > before it deletes the entity. > > Is there a way to get this to work, or am I going to need to go back > to using a bag, and updating the index myself? > > -Will > > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
