0

休止状態のサブクエリにパラメータを渡すにはどうすればよいですか? 私はこれを試していますが、クエリに :currentDate が明確に示されていても、:currentDate が (...[query]...) の名前付きパラメーターとして存在しないという例外が発生します

クエリは次のようになります

createQuery
(
    "from mymodel where someid = :modelId and otherKey not in 
    ( select c.otherKey from someOtherTable c where c.updateDate = :currentDate )"
)
.setLong(":modelId", someLongValue)
.setDate(":currentDate", new Date())
.list()
4

1 に答える 1

2

パラメータを設定するときはコロンを使用しないでください。

q.setDate("currentDate", new Date());
于 2011-08-06T03:39:02.387 に答える