0

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]

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Sep 10, 2021 at 11:49

3 Answers 3

1

You are missing a closing parenthesis ) at the end.

Sign up to request clarification or add additional context in comments.

Comments

0

Can you try <> operator for not equal to.

leave_status <> 104

Also give an alias and then do COUNT(alias) instead of a *.

1 Comment

still getting the same error but in column 235......thanks for u r effort
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.