我想像这样创建NamedQuery:
@NamedQuery(name = Advertisement.getBySubcategoryList, query = "From Advertisement where subcategoryId IN (:subcategoryId) order by :sort :order "),
但是在IDE上我看到错误,我无法在参数:: sort:order
之后设置参数您知道如何创建此查询吗?
由于
堆栈跟踪:
ERROR: org.hibernate.internal.SessionFactoryImpl - HHH000177: Error in named query: Advertisement.getBySubcategoryList
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: : near line 1, column 101 [From org.ogloszenia.app.domain.Advertisement where subcategoryId IN (:subcategoryId) order by :sort :order ]