Here's my example:
[*]Categories which have 1-n association to Products (most likely m-n association but that's not important--I don't think)
[*]Categories also have 1-{0..10} association to "Top 10" Products which may or may not be the same as Product association above
This way you could do:
lazy initCode:
Category cat = getCategory(catId);
cat.getProducts(); // to get the 1-n products
cat.getTopTenProducts(); // to get the "Top Ten" products
-or-
eager fetchingCode:
select c from Category c left join fetch c.products p left join fetch c.topTenProducts ttp
My question is: Is it possible to have size-bound associations like this in Hibernate? Ideally, association would be both size-bound and have other additional criteria that defines the association.