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.



On Apr 16, 11:21 am, Oskar Berggren <[email protected]> wrote:
> Den 16 april 2012 07:40 skrev Raj <[email protected]>:
>
> > Hi,
>
> > Can I create custom EntityNotFoundDelegate in such a way that when I
> > try to access an entity in my code then NH returns NULL if that entity
> > is not found in db?
> > Until I access that entity it has Proxy which is fine but the moment I
> > try to access that entity in my code then I get exception. Is there a
> > way that it gives me NULL in this case so that I can apply a NULL
> > check before accessing it?
>
> If you get a hold of a proxy, it can't suddenly be replaced by null.
>
> Have you looked at not-found="ignore"? Even better is to clean up the 
> database.
>
> /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.

Reply via email to