I'm trying to work out how to eager load the customers in the following HQL query:
select order.Customer
from Order as order
where order.Id in
(
select itemId
from BadItem as badItem
where (badItemType = :itemType) and (badItem.Date >= :yesterday)
)
There's the usual many-to-one relationship between orders and customers.
I'd like to do this is in the query, as opposed to the mapping, if possible - as in a "join fetch..."
Maybe the query would be refactored as a join and I'm having a mental block.
Any ideas?