I have a class Employees that has a collection of class Address, and also a collection of class Groups. When I query for Employees, since I can outer join fetch only one collection, I fetch the collection of Address. Once I get the list of Employees, I want to lazy initialize the collection Groups - but for this collection, I want to apply a filter "myFilter" (the filter is to get only selected group lazy initialized). If I do enableFilter("myFilter") and set the proper parameter, then do employees.getGroups(), it initializes all groups. In my mapping, I have the filter applied both for the collection Groups and the Group class. My question is - is it possible to get a filtered collection while doing lazy initialization? If yes/no how else can I get a filtered collection for the list of Employees I get?
|