How to set Null Value to query.setString for a named parameter in Hibernate ?
Thanks,
Kathir
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you can’t do, because in SQL you need a different syntax for null values. Examples in SQL:
But with a null value you do
As a consequence, you can’t set null in named parameters in SQL. Also in Hibernate you need a different query when your string is null. For example: