DarkCloud wrote:
Just pondering what Hibernate/NHibernate users think of filtering an in-memory collection?
Filtering in memory is actually not the most brilliant idea. It sounds ok at first glance, but on having inspected it more thoroughly, i got that filtering in memory would produce more headache than pleasure.
I'm still though wondering what is the preffered way to filter association collections with ICriteria like API?
one workaround instead of using session.CreateFilter()
Code:
kittens = s.Filter( cat.kittens, "name like 'joe');
would be to use the same ICriteria statements, and add aditional filtering to filter cat
Code:
criteria.Add(Expression.Like("Name", "Joe"));
crtieria.Add(Expression.Equals("KittenMother", mother));
What do you think about this hack (it does not look like the right thing to do...)?