I usually utilize a service layer between my controller and DAO objects.
An example DAO would look like this:
This is pretty simple. In fact, I could make it simpler by using an example object.
However, if I want to add 'cross context' functionality or different operators it becomes troublesome and results in lots of code duplication.
Writing a full blown query API would be nice, but would be an arduous task.
What tools /
patterns are others using to approach this problem?