Hibernate NamedQuery有两个参数

时间:2015-02-13 09:46:52

标签: java hibernate

我想像这样创建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 ]

0 个答案:

没有答案