Hi!
A time ago I created this issue. The problem is this:
When using lazy extra and enabling filters affecting the collection, the
size() and isEmpty() methods are not applying the filters when the
collection proxy isn't initialized.
So, enabling filters and accessing a collection marked as lazy extra (the
filters applying to it), the methods size() and isEmpty() returns
differents values:
- if the proxy is initialized, the methods access the real filtered
collection.
- if the proxy is not initialized, the methods fire a separated select
count(*) ignoring the filters.
I´ve attached a test case.
I'm wondering if this scenario breaks the idea of not fetching the
collection if is not really needed (for lazy extra collections) or, we can
add on the fly the filters conditions to the select count(*) in order to
avoid fetching it.
What do you think?
Regards. Hernán.