내가 many-to-one 연관 관계는 hbm.xml 이와 같이 설정이 연관되지 않은 :대일 HQL 질의를 최대 절전 모드,
<many-to-one name="gigVenue"
class="blah.blah.xxx" fetch="select"
lazy="no-proxy" not-null="true" >
<column name="N_VENUE_ID" precision="18" scale="0" not-null="true" />
</many-to-one>
내가 사용하고 진정한 게으른 로딩을하기위한 계측.
하지만 다른 테이블의 값인 개체를 포함해야하는 속성은 null로 남겨 둡니다. 최대 절전 모드로 생성되는 다른 테이블의 값의 개체를 볼 수는 있지만.
누구든지이 문제에 대해 통찰력을 갖고 있습니까?
갱신 :
from Gig g inner join fetch g.gigVenue gv where g.artistId = :artistId and (g.territoryId = -1 or g.territoryId = :territoryId) order by g.gigDatetime desc
<set name="gigs" inverse="true" lazy="true" table="DSP_GIG" fetch="select">
<key>
<column name="N_VENUE_ID" precision="18" scale="0" not-null="true" />
</key>
<one-to-many class="blah.blah.Gig" />
</set>
실제 쿼리와 두 번째 매핑을 게시 할 수 있습니까? – ChssPly76