我有一个变量喜欢long[] ids = [10, 11],我试图像这样触发查询:
Query query2 = session.createQuery("update Employee e SET e.isLatest = false where e.id not in (:ids)");
query2.setParameter("ids", ids);
query2.executeUpdate();
Run Code Online (Sandbox Code Playgroud)
但我得到的错误就像
org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint <> character varying
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)
如何在NOT IN参数中传递数组变量?或者有没有其他方法来处理这样的查询?
| 归档时间: |
|
| 查看次数: |
21623 次 |
| 最近记录: |