hi!
thanks for your quick answers.
I am going to use your examples - however I think that this is a
workaround.. in my mind, "= NULL" is not a valid output for this
scenario and NHibernate should handle this. or you should at least
include your "EqOrNull" code into NHibernate, because it's not
possible to create static extension methods so we have to use some
kind of "MyRestrictions" or "RestrictionsEx"... class.
I'm sure there are quite a few people running into this issue.
thanks for your help,
christian
On 15 Dez., 05:33, Fabio Maulo <
fabioma...@gmail.com> wrote:
> you can use thishttp://
code.google.com/p/unhaddins/source/browse/trunk/uNhAddIns/uNhA...
>
> 2009/12/14 Christian <
christ...@chwe.at>
>
>
>
> > hi everyone,
>
> > i was just running into a really annoying problem with nhibernate. if
> > you pass a null value to Restrictions.Eq() it gets translated to
> > "WHERE ColumnName = NULL" instead of "WHERE ColumnName IS NULL".
>
> > as far as I have read in documentations, "= NULL" per specification
> > ALWAYS returns false so in my mind, this is a bug in (N)Hibernate.
>
> > there's also already an open bug in Hibernate:
> >
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2951
>
> > any chance to get this bug resolved in near future? or is there any
> > other simple solution? i don't want to add NULL-checks before every
> > call to Restrictions.Eq().
>
> > everything else with NH worked quite well, so I don't want to change
> > the code myself just for this little patch, because this would make
> > updating NHibernate harder...
>
> > ps: setting "set ansi_nulls off" is not an option because this isn't
> > ansi standard.
>
> > thanks for your help!
>
> > regards, christian
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to
nhu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
nhusers+u...@googlegroups.com<
nhusers%2Bunsu...@googlegroups.com>
> > .