Failed to create query - maxClauseCount is set to 1024

Look at this solution, similar to your problem.