2011-08-06 15 views
0

hibernateのサブクエリにパラメータを渡すにはどうすればよいですか?私はこれをしようとしているが、私は例外が発生します:currentDateは、(... [クエリ] ...)の名前付きパラメータとして存在しない場合でも、クエリは明らかに:currentDateそれにhibernateのサブクエリ内の名前付きパラメータ

クエリは

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() 

答えて

1

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

q.setDate("currentDate", new Date()); 
関連する問題