Details
Description
Result:
PDOException: SQLSTATE[HY000]: General error: 1 no such column: e2_.owner_id
Generated SQL:
SELECT c0_.id AS id0, c0_.createdAt AS createdAt1, c0_.updatedAt AS updatedAt2, c0_.title AS title3, c0_.color AS color4, c0_.owner_id AS owner_id5 FROM calendar c0_ INNER JOIN user u1_ ON e2_.owner_id = u1_.id WHERE u1_.username = 'bot'
Notice how the table alias "e2" does not existm yet is used in the join clause.
Meta:
/**
- @ManyToOne(targetEntity="User")
- @JoinColumn(name="owner_id", referencedColumnName="id")
* - @var User
*/
DQL:
SELECT c FROM Calendar c JOIN c.owner u WHERE u.username = 'bot'
A workaround would be appreciated.
Thanks!
I've had a similar issue with multiple levels of MappedSuperclasses. It works in RC1, fails in 2.0 stable on non-existent table aliases. Don't have time to do a full bug report right now.