这是我的hbm配置,需要在其中添加AND子句以对此进行过滤。
<set name="maintenanceLineItems_" lazy="false">
<meta attribute="scope-set">protected</meta>
<meta attribute="scope-get">protected</meta>
<key column="PARENT_ENTITLEMENT_ID"/>
<one-to-many class="com.flexnet.operations.bizobjects.MaintenanceItemDO"/>
</set>
现在查询为:
select
maintenanc0_.ID as col_0_0_
from OPS_MAINTENANCE_ITEM maintenanc0_
inner join
OPS_ENTITLEMENT_ORDER entitlemen1_
on maintenanc0_.PARENT_ENTITLEMENT_ID=entitlemen1_.ID
where
entitlemen1_.ID=?
and maintenanc0_.STATUS<>?
and maintenanc0_.TENANT_ID=?
但是我需要像这样的查询:
select
maintenanc0_.ID as col_0_0_
from OPS_MAINTENANCE_ITEM maintenanc0_
inner join
OPS_ENTITLEMENT_ORDER entitlemen1_
on maintenanc0_.PARENT_ENTITLEMENT_ID=entitlemen1_.ID and entitlemen1_.TENANT_ID=?
where
entitlemen1_.ID=?
and maintenanc0_.STATUS<>?
and maintenanc0_.TENANT_ID=?