It is worth to mention that Doctrine 2 also allows you to handwrite your SQL instead of extending the DQL parser. Extending DQL is sort of an advanced extension point. You can map arbitrary SQL to ...