Srinivasulu Ch
Srinivasulu Ch

Reputation: 1

java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: null near line 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

Answers (3)

Christian Beikov
Christian Beikov

Reputation: 16430

You are missing a closing parenthesis ) at the end.

Upvotes: 1

Kirinya
Kirinya

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

Alien
Alien

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

Related Questions