Josh [Eichorn] argued at the time that dealing directly with the database was a better option. [...] His argument won me over, and until this past week I've viewed that as probably the most sane way to go. [...] Now, what started out as the simplest solution has morphed into this unrecognizable mishmash of SQL, code and convention.
He points out some of the issues that this sort of approach can bring up and how the Repository patten can help to make it a bit more manageable. It makes it simple to add the parameters needed for the query (via filters).