I would like to fetch a group of Bids in a way that populates their Item. The hoped-for result would allow me to invoke bid.getItem().getDescription() on a given item without Hibernate issuing an additional select statement.
What I'm asking for is basically the inverse of the eager fetching strategy discussed in section 7.3.2. Instead of Items with their Bid collections initialized, I want Bids with their Item initialized.
On the face of it, you'd think that a simple inner join would do the trick here. You'd even think that eagerly fetching the items' category would be possible and would perform well, since that would just require another inner join.
But in "Hibernate in Action" as well as in the hibernate reference, I've only seen eager fecting done with outer joins. Is it possible to do this kind of eager fetching with Hiberante?
|