mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1225: Invalid SQL generated (extra comma) when joining to entity with composite PK #1537
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jun 23, 2011).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user darkangel:
$qb->from('Tournaments*Model*StageBracketTeamRegistration', 'r') ->innerJoin('r.teamSelection', 'ts') ->innerJoin('ts.players', 'tsp') ->select('r, ts, tsp') ->where('r.stageBracket = ?1') ->andWhere('r.opponentIsReserve = false') ->orderBy('r.registrationDateTime') ->setParameter(1, $bracket);Generates:
SELECT s0*.id AS id0, s0_.opponent_is_reserve AS opponent_is_reserve1, s0_.opponent_checked_in AS opponent_checked_in2, s0_.registration_date_time AS registration_date_time3, t1_.id AS id4,, s0_.type AS type5, s0_.stage_bracket_id AS stage_bracket_id6, s2_.team_selection_id AS team_selection_id7, t1_.team_id AS team_id8, t3_.team_selection_id AS team_selection_id9, t3_.player_id AS player*id10 FROM stage*bracket_team_registrations s2* INNER JOIN stage*bracket_registrations s0_ ON s2_.id = s0*.id INNER JOIN team*selections t1_ ON s2_.team_selection_id = t1*.id INNER JOIN team*selection_players t3_ ON t1_.id = t3_.team_selection*id WHERE s0*.stage_bracket_id = 22 AND s0_.opponent_is*reserve = 0 ORDER BY s0*.registration_date*time ASCNote the 2nd comma after "t1_.id AS id4". TeamSelectionPlayer uses a composite PK. I have attached the relevant entity classes.