I have a kind of same but a but different question as asked Syntax for input parameters in a MySQL query.
At the above link the query is implemented with @ Variables. I have implemented a query with ?. it's not working.. the code is here
String queryString = "from OptimumMeasure as model where model.id.goalId= ? " +
" and model.id.questionId= ? and model.id.attributeId= ?";
Query queryObject = getSession().createQuery(queryString);
queryObject.setParameter(0, goalId);
queryObject.setParameter(1, questionId);
queryObject.setParameter(2, attributeId);
return queryObject.list()
Thanks in advance.