[DDC-2221] In YAML, joinColumn names are ignored in One to Many and Many To One relationships Created: 03/Jan/13 Updated: 03/Jan/13 Resolved: 03/Jan/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.3.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Shu Chow | Assignee: | Marco Pivetta |
| Resolution: | Invalid | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When using YAML configuration to define 1:M, M:1 relationships, the joinColumn.name entry is ignored and Doctrine tries to use the default *_id convention. Using the Doctrine2 tutorial example, I created YAML mapping for the Bug entity:
I then tried to run list_bugs: <?php $dql = "SELECT b, e, r FROM Bug b JOIN b.engineer e JOIN b.reporter r ORDER BY b.created DESC"; $query = $em->createQuery($dql); foreach($bugs AS $bug) { echo "\n"; However, I get this error message: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'b0_.reporter_id' in 'field list'' in /Library/WebServer/Documents/DoctrineTutorial/Doctrine/DBAL/Connection.php:646 |
| Comments |
| Comment by Marco Pivetta [ 03/Jan/13 ] |
|
It's "joinColumn", not "joinColumm" |
| Comment by Shu Chow [ 03/Jan/13 ] |
|
...And that is why I should not be working on this when I'm barely awake. Sorry. |
| Comment by Marco Pivetta [ 03/Jan/13 ] |
|
No prob |