2011-08-06 3 views
0

최대 절전 모드에서 하위 쿼리에 매개 변수를 전달하려면 어떻게해야합니까? 나는 이것을 시도하고 있지만 다음과 같은 예외가 발생한다. currentDate는 (... [query] ...)의 명명 된 매개 변수로 존재하지 않는다. 비록 쿼리가 currentDate를 명시하더라도 :최대 절전 모드의 하위 쿼리에 명명 된 매개 변수

쿼리는

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()); 
관련 문제