I am trying to create a DetachedCriteria query using an or. It workds fine with createCriteria but here the or is being replaced by an and. Any ideas why? Is that a bug. The fact that a and b are defined as closure is a simplified version of what I ultimately need.
a= { eq ('name', 'east') }
b= { eq ('name', 'west') }
q=new DetachedCriteria (Property) .build { projections { property 'name' } }
q.or (a)
q.or (b)
q.list()
gives this query:
Hibernate: select this_.name as y0_ from property this_ where (this_.name=?) **and** (this_.name=?)
Notice the and in the where condition. I am trying to get an or. Any help appreciated
Thanks
Pascal