if all you need to do is satisfy the error, you can use a Get/Load to get a proxy of the entity if you know the ID.
yourEntity.PreviouslyNullProperty = session.Load<YourEntityType>(yourEntity.PreviouslyNullPropertyID); session.Delete(yourEntity); as long as you don't access any properties of the PreviouslyNullProperty, NH won't initiate a SELECT to the database. see http://ayende.com/blog/3988/nhibernate-the-difference-between-get-load-and-querying-by-id On Jul 8, 2:36 am, Evgeniy The Best <[email protected]> wrote: > It's my question > fromhttp://stackoverflow.com/questions/6620554/nhibernate-exception-while... > > When I delete object graph and there are some one-way master (many-to- > one) associations, NH throw error when found this not-null association > in DB, but didn't find master object in the session. > > How to make it work? > mappings and scheme on stackoverflow -- 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.
