Jira issue originally created by user @ocramius:
Currently, QueryBuilder allows assembling broken DQL like
SELECT u FROM User u JOIN u.posts p JOIN u.logs p
SELECT u FROM User u JOIN u.posts u
It may be interesting if we either replace DQL parts by associating them to their alias.
Another solution, since [~asm89] noted that it is a dumb string builder, is to throw exceptions early to disallow broken DQL generation (such as in the second case).
It may also be useful to allow giving insights about the currently existing joined aliases.
public function hasJoinedAlias($alias);
Comment created by @ocramius:
Attaching failing test case
The query builder should not worry about validity of produced DQL
Issue was closed with resolution "Won't Fix"