Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.3
How to use named queries with potential nullable columns/values?
e.g.
<query ...
and a.mycol = :mycolval
</query>
At runtime there are some possibilities:
1. mycolval != null
2. mycolval == null
3. mycolval == (empty string)
for 1. the named query works fine
for 2. (and possibly 3), the named query is wrong (s/be a.mycol is null)
Is their any elegant solution using named queries?
Thanks.