NHibernate fetch ="join"映射属性似乎不起作用

Mic*_*per 4 nhibernate nhibernate-mapping

用NH映射字典.声明如下:

<hibernate-mapping ...
    <map 
        name="CostsByRole" 
        table="JobAccountingSnapshotCosts"
        lazy="false" 
        fetch="join" 
        access="nosetter.camelcase-underscore">
            <key column="SnapshotId" />
            <index column="RoleCode" type="String" />
            <element column="Amount" type="Decimal" />
    </map>
</hibernate-mapping>
Run Code Online (Sandbox Code Playgroud)

我期待生成一个SQL查询,但我得到两个:选择实际对象,然后选择字典的内容.

有任何想法吗?

Ami*_*rge 6

HQL查询不考虑映射中为fetch设置的值.您需要在每个HQL查询中专门指定它们.它应该是设计的.fetch属性值仅由Criteria查询和Load/Get使用.