I've got a query builder that builds a parameterised HQL query for doing OData filtering. When building a query against a property being NULL
, the where
claluse of the HQL looks like this...
... where $entity.Property is ?
...where the ?
gets replaced by a parameter who's value is NULL
. However, when I call session.CreateQuery(hql)
with the above query, the SQL executed is not an is null
query, but becomes a =@p1
query with @p1
filled in to be NULL. This obviously doesn't do what I want.
If I make the HQL explicitly $entity.Propery is null
then everything works fine, but I feel like I'm missing something or doing something stupid.
What is going on here?