0

I am using Hibernate Criteria Projections Property. I want to test 'IS NULL' condition before adding into Projection List.

Consider sample example

.add(Projections.property("normalRange"),"normalRange")

i want to test this property value IS NULL and do some operations

(i.e) in Mysql

IF(normalRange IS NULL,testRange,normalRange) as normalRange

How to achieve this query in my Hibernate criteria ?

I hope my questions is clear. Please Help !

Aravinthan K
  • 1,763
  • 2
  • 19
  • 22
  • I don't think so there is way to do this. You have to use native SQL. – Amogh Jul 20 '15 at 18:53
  • possible duplicate of [Please provide example for an If statement in hibernate criteria](http://stackoverflow.com/questions/15826567/please-provide-example-for-an-if-statement-in-hibernate-criteria) – Amogh Jul 20 '15 at 18:54

0 Answers0