0

I have the following hql :

SELECT obj FROM com.domain.view.DomainClass obj  WHERE  obj.x  LIKE  :p1 AND  obj.y is not :p2 AND  obj.z = :p3 ORDER BY a DESC

while the result from hibernate is:

select obj0_.a as a_, obj0_.b as b_ from obj_table obj0_ where (obj0_.x like ?) and obj0_.y<>? and obj0_.z=? order by obj0_.a DESC

note that the 'is not' (an also 'is') is converted to <> and = which doesn't work with null values

The query is actually generated from TypedQuery class. My question is how to prevent JPA/Hibernate entityManager from converting 'is' and 'is not' to = and <>?

Muhammad Bekette
  • 1,396
  • 1
  • 24
  • 60

0 Answers0