fix for incorrect query building in Repositories.

fix for incorrect query building in Repositories If ```$value``` is array.