我有以下proprtyNHibernate的:有条件加载计算列
<property name="Allocated" type="decimal" formula="(select sum(a.AllocationAmount) from Allocation a where a.TransactionId = TransactionId)" />
这会将已分配给它的工作精美发票交易的金额。
但是,大多数情况下我并不关心这个数量。有没有办法有条件地加载这个计算列?或者有没有办法将这个计算列添加到HQL/Critera中,这样我就可以将它作为我运行的特定查询的一部分?