View the raw sql created by Doctrine
For debugging you might want to see the final native query constructed by doctrine
$raw_sql = $query->getSQL();
the raw_sql variable would contain the sql constructed from entity objecs.
Single id is not allowed on composite primary key in entity Doctrine error