Reputation: 1
java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: null near line 1, column 226 [SELECT COUNT(*) FROM com.pmp.vupadhi.model.EmpLeave WHERE ((start_date >=:startdate AND start_date <=:enddate) OR (end_date >=:startdate AND end_date <=:enddate)) AND em_id =:id AND (leave_status !=103 AND leave_status !=104]
Upvotes: 0
Views: 1031
Reputation: 245
You might have a null parameter even when you do not expect that. Try logging the parameters like described in https://www.baeldung.com/hibernate-logging-levels and check for null values.
Upvotes: 0
Reputation: 15898
Can you try <>
operator for not equal to.
leave_status <> 104
Also give an alias and then do COUNT(alias) instead of a *.
Upvotes: 0