I agree on the raw-sql-in-your-application point.<p>I prefer simple rowmapping to ORM making your queries for you any day. On previous java project, all the SQL was actually in XML files that were loaded by the repositories by which they were used. Debugging that was much easier (especially when it came to performance issues) than having an ORM because there was no ORM to reason (and possibly be wrong) about.<p>As far as cutting down on repetition with queries, I found that using some higher order functions (essentially templating, at that point) would clear that right up.