这是:
class Unit
{
public Position ManagerPosition;
}
<sql-query name="GetUnits" read-only="true">
<query-param name="UserGroupId" type="int"/>
<query-param name="RelevantToDate" type="datetime"/>
<query-param name="ParentUnitId" type="int"/>
<return class="Unit" />
...
</sql-query>
<sql-query name="GetPositions" read-only="true">
<query-param name="UserGroupId" type="int"/>
<query-param name="RelevantToDate" type="datetime"/>
<query-param name="UnitId" type="int"/>
<query-param name="ManagersOnly" type="bool"/>
<return class="Position" />
...
</sql-query>
<>Units and Positions are in separate table, but bothfiled by 用户组(和RelevantDate(适当查询参数)。 由于财产的复杂性,这些财产没有直接绘制到表格中。
试图做的是获得一份名单,列出Units,并附上一份Position,该名单的国旗为IsManager。
I ve tried to do it by return-join - no success. I ve tried to do it by
<return class="Unit">
<return-property name="ManagerialPosition" column="position"/>
</return>
and
<return alias="position" class="Position">
但国家自由党说,它能够形成一系列系统。 反对设立一系列股。
what is better way to solve my problem? thanks in advance!
较好的方法是:
- call a parameterized query for Position from Unit query.
- parse a resultset of a combined query to get Unit and Position properties