if the domain-state is consistent in RAM, then yes. If you have a bidirectional-one-to-many and you are removing a collection element without nullify the bidirectional relation, then no. If you have a bidirectional-one-to-many and you are removing a collection element nullifying the bidirectional relation but without delete-orphan cascade, then no. .... .... mapping and code.
On Tue, Mar 15, 2011 at 5:50 PM, Trinition <[email protected]> wrote: > I've been very happy with NH where I can open a session/transaction, > retrieve some objects, manipulate them and then Commit the > transaction. NH properly tracks my objects and persists my changes. > The only time I've had to explicitly tell my session anything is when > saving a new objects. > > Now I have an object that has an ICollection (mapped as set). When I > remove an object from that collection, that change is NOT getting > persisted. It very well could be a mapping problem, but I want to > make sure my expectation is correct: > > If I retrieve an object through my Session in a Transaction, and that > object has a Collection property mapped as a set, and I remove an item > from that collection, and then Commit my transaction, should that > removal be persisted to the database via an SQL delete (assuming I'm > deleting orphans)? > > -- > 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. > > -- 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.
