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?
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?
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 value so what you should have in place of :age is the actual column name of one of your tables. What you are probably trying to do is y.min >= :age and y.max <=:age.
where 1=1 is valid in sql? And if age is not a parameter, why does it have a : in front?y.min >= :age and y.max <=:age would probably do the trick.