Hibernate命名查询参数

Hibernate命名查询参数,hibernate,named,Hibernate,Named,我对命名查询参数有问题。我的质询如下: <sql-query name="getCustomer"> <![CDATA[ select * from customer where customerId=:custId and billId in ( :billIdList ) ]]> </sql-query> 我正在设置所有参数,但在:billIdList中有问题每当我设置此参数时,我都会得到一个空的客户列表。My:billIdList采用字符

我对命名查询参数有问题。我的质询如下:

<sql-query name="getCustomer">
<![CDATA[
     select * from customer where customerId=:custId and billId in ( :billIdList )
]]>
</sql-query>

我正在设置所有参数,但在:billIdList中有问题每当我设置此参数时,我都会得到一个空的客户列表。My:billIdList采用字符串形式,例如:5,6,7,9。数据库中的数据也包含上述值。当我编写查询时,它工作得很好 在程序中它自己


请帮助我。

对于具有多个值的参数,您需要使用Hibernate的
查询接口的
设置参数列表()
方法:

query.setParameterList("billIdList", new int[] {5,6,7,9});