에 대한 연관에이 주어최대 절전 모드 기준이 포함 된 나는 이런 식으로 뭔가 보이는 Hibernate 매핑이 테이블
<class name="MyEntity">
<set name="scalarSet" table="(select fk, scalar_value from other_table)">
<key column="fk"/>
<property column="scalar_value" type="long"/>
</set>
</class
, 내가 MyEntity.scalarSet 같은 그 값을 조회 할 방법을 (인 세트)는 다른 컬렉션에 있습니다. 같은
뭔가 :
criteria.add(Restrictions.in("scalarSet", targetList));
[편집] 은 또한 Restriction.sqlRestriction (..)를 시도했습니다. 내가 사용하는 SQL 쿼리가이 같은 것입니다 :
"1 == (select fk, scalar_value from other_table where fk = {alias}.id and scalar_value in ({expanding?})"
식에서 '{? 확장}'쉼표로 구분 된 물음표에 의해 대체된다 (targetList.size에 따라()).
하지만 난 그냥지고 있어요
에 의해 발생 : org.hibernate.MappingException : 귀하의 세트 모음이 아닌 협회
고맙다. 최대 절전 모드의 소스를 해킹 한 후, 이것이 결국 내가했던 일이다. –