Den 16 april 2012 08:32 skrev Raj <[email protected]>: > Currently I am using not-found="ignore" but I want to get away from > it. Cleaning database is not an option for me. > One way I found is to put necessary logic inside 'getter' of that > entity i.e. if exception comes then return NULL... but that's does not > seem to be a good way of doing it so looking for a better approach. >
If exception comes from what? To me it sound like you are trying to do: var entityA = session.Get(5); var entityB = entityA.ReferenceToEntityB When the entityA instance is created, the entityB proxy will also be created. The reference from entityA to that proxy cannot later automatically be replaced by null just by accessing it. Perhaps something more would be theoretically possible if entityA is also a proxy. Or did you have some other pattern in mind? I think you will have to explore the NH code. /Oskar -- 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.
