休眠:找不到命名参数 []

Hibernate : could not locate named parameter [ ]

我遇到以下错误:

could not locate named parameter [ ]

我的密码是

 String[] params = {"PARAM1","PARAM2"}
Query query = session.createQuery("select paramValue from Table where paramName in (:PARAMS) order by FIELD (paramName, :PARAMS)");

query.setParameterList(" ", params);

谁能帮我解决这个问题?

您必须命名参数

query.setParameterList("PARAMS", params);

可以看到报错信息中的空白...