AFAIK there is no mapping capability for this. We've handled it by having our implementation of IInterceptor call a protected OnDelete() method on the entity via reflection (sort of like our own ILifecycle implementation). In the child's OnDelete(), it checks if there are no other siblings left in the parent's collection, and if none, it deletes the parent. This way at least, application-level code isn't responsible for it, and guarantees that it always gets cleaned up.
I know this violates the rule that stuff in IInterceptor shouldn't make additional changes to the session, but it works fine for us ...
|