Joined: Thu Jan 13, 2005 11:41 pm Posts: 10
|
Lets assume I have the following HQL query:
from MyObject m
where
m.column1 = :column1 and
m.column2 = :column2 and
m.column3 = :column3
It is possible in the business logic that any of the values may be null (the values are all strings). The query works fine when all the columns have values other than null. I tried using empty string or null but it doesn't seem to return back a result.
My question is whether in the case of null, do I have to explicitly state so in the HQL query (this would mean writing lots of queries for each case)?
I think that this "problem" should be something quite common and there is probably a trivial solution which eludes me (I'm rusty).
|
|