I fact I cant, but I'm gonna paste a few lines with examples:
I have this object QueryImpl called q and the query inside is:
SELECT st FROM PersistentSearchTerm st WHERE 1=1 AND ( (subcategories_active = TRUE AND typologies_id IS NULL AND productattributes_id IS NULL) OR (subcategories_active = TRUE AND typologies_active = TRUE AND productattributes_id IS NULL) OR (subcategories_active = TRUE AND typologies_id IS NULL AND productattributes_active = TRUE) OR (subcategories_active = TRUE AND typologies_active = TRUE AND productattributes_active = TRUE) ) AND ( (subcategories_id = :subcategory_id0 AND typologies_id IS NULL AND productattributes_id IS NULL) OR (subcategories_id = :subcategory_id1 AND typologies_id IS NULL AND productattributes_id IS NULL) ) )
As you can see the only 2 parameters are :subcategory_id0 and :subcategory_id1, but when the line:
And I'm inserting them in this way:
q.setParameter(:subcategory_id0, 1234); q.setParameter(:subcategory_id1, 1234);
And the result is: Caused by: org.hibernate.QueryParameterException: could not locate named parameter [:subcategory_id1]
|