I'm a little curious about why you want this behaviour. You won't be significantly reducing data traffic between your application and the database, as Hibernate typically finds the count of Object B instances and sets up a single proxy for lazy loading - so memory shouldn't be an issue either.
Are you going to be performing any updates on the retrieved instances of Object A? If so, you will also need to consider how to not effect the relationship with the Object B instances on update, but still effecting them if there is going to be deletion of Object A instances (since you've mentioned that the Object B instances belong to the Object A instances).
--
Stephen Souness
(PS: Sorry for having more questions than answers at this point)
|