【发布时间】:2011-09-28 22:03:08
【问题描述】:
例如,我有这个查询
select cat from Cat cat where cat.id in :ids
我想将 ID 设置为列表 (1,2,3,4,5,6,17,19)。
此代码不起作用
session.createQuery("select cat from Cat cat where cat.id in :ids")
.setParameter("ids", new Long[]{1,2,3,4,5})
因此,我希望有像id in (1,2,3,4) 这样的 SQL 查询
【问题讨论】: