sosandstrom/mardao — pull request #9 by mattiaslevin (2013-02-27 07:33:36+00:00)
Title: queryIterable and queryIterableKeys now have an overloaded method that take a collection of filters

I ran into issues when I needed to create a variable number of filters depending on input parameters. If product id was provider use that as filter, if answer state was provided, user that as filter.

There is no easy way to create a dynamic number of filters in a single method and call a method that take a variable number of filter arguments (I need to make a dedicated call for each combination).

I added a new queryIterable and queryIterableKeys method that takes a Collection of filters. The change should be backwards compatible. Unit tests run and passing.

Could consider make this change to other methods that take variable length of filter parameters, I only did to these two methods.

Another option should maybe to allow the variable length method take filters set to null. Today this will cause a null pointer exception when preparing the query. You can check if the filter is null and then disregard. This will work as well and is a smaller change.

/Mattias