I have a query
select ... from x join y on ..
where ... and :age between y.min and y.max
But when executing the query with hibernate i receive
org.hibernate.QueryParameterException: could not locate named parameter [age]
What is wrong?
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.
Since you haven’t posted the actual query, my inference from your snippet is that you have the :age parameter in the wrong place in the query. The syntax for a query’s where clause is
column_name operator valueso what you should have in place of:ageis the actual column name of one of your tables. What you are probably trying to do isy.min >= :age and y.max <=:age.