0

我正在尝试为Rental具有多对任意关联的HQL 编写PaymentTypes

from rental 
where not exists(
    from PaymentTypes pt where pt.Owner = :rental and type = 'Visa'
)

Owner是任何关联,其中OwnerIdisrental.IdOwnerType = 'Rental'

不幸的是,我不能SetEntity用作预取租金然后打电话SetEntity会非常昂贵。

4

1 回答 1

0

为什么不尝试像这样的动态查询

from rental where not exists(from PaymentTypes pt where pt.Owner.id = " + rental.id + " and type = 'Visa')
于 2013-02-26T09:53:57.677 回答