SQLContainer with multiple filters

Hi!

when using more than one filter with the SQLContainer addon each time a filter is added, a new query is fired. Can I somehow first collect a bunch of filters and set them at once to reduce db calls?

public void addFilter(Filter filter) {
        if (filter == null) {
            return;
        }
        if (!propertyIds.contains(filter.getColumn())) {
            throw new IllegalArgumentException(
                    "The column given for sorting does not exist in this container.");
        }
        filters.add(filter);
        refresh(); // <- this is my problem probably
}

This would be nice for example: public void addFilters(List<Filter> listFilters) { if (listFilters == null) { return; } filters.clear(); for (Filter filter : listFilters) { if (!propertyIds.contains(filter.getColumn())) { throw new IllegalArgumentException( "The column given for sorting does not exist in this container."); } filters.add(filter); } refresh(); } or am I missing something?
Overriding SQLContainer for this won’t work because of missing access to the filter array.

Thanks in advance!

is this worthy of an enhancement ticket?

Vaadin 6.6 will have a new filtering API (there also exists a branch of the SQLContainer that already supports it) that lets you use composite filters.

You could then create a filter like And(conditionA, Or(conditionB, conditionC), conditionD) and apply that in one operation. Removing old filters is still a separate operation.