Having the following classes:
Code:
class SaleItem {}
class ProductSaleItem : public SaleItem {}
class SubtotalSaleItem : public SaleItem {}
class ItemCancellation : public SaleItem
{
SaleItem CancelledItem { get ... }
}
when using a joint subclass mapping, I want to do this basic SQL query:
Code:
select * from ITEMCANCELLATION i inner join PRODUCTSALEITEM p on i.CANCELLEDITEM = p.ID
So I want all ItemCancellations, that refer to a ProductSaleItem.
In HQL this can be done like this :
Code:
select from ItemCancellation i, ProductSaleItem p where i.CancelledItem = p.Id
But how can this be done with a Criteria query (without using sub queries)?
Tobias