我有很多-to-one关联设置这样,在你hml.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>
,我使用仪器做真正的懒加载。
但是,当我运行一个hql查询与另一个表的内部联合提取时,应该包含另一个表的值的对象的属性保留为空。即使我可以看到其他表的值由hibernate创建的对象。
有没有人有任何洞察到这个问题?
更新:
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 2009-08-06 07:06:39