<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 09:46:10 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-2221/DDC-2221.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-2221] In YAML, joinColumn names are ignored in One to Many and Many To One relationships</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2221</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Using the Doctrine2 tutorial example, I created YAML mapping for the Bug entity:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;config/yaml/Bug.dcm.yml&lt;br/&gt;
Bug:&lt;br/&gt;
  type: entity&lt;br/&gt;
  table: bugs&lt;br/&gt;
  id:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer&lt;br/&gt;
      generator:&lt;br/&gt;
        strategy: AUTO&lt;br/&gt;
  fields:&lt;br/&gt;
    description:&lt;br/&gt;
      type: text&lt;br/&gt;
    created:&lt;br/&gt;
      type: datetime&lt;br/&gt;
    status:&lt;br/&gt;
      type: string&lt;br/&gt;
  manyToOne:&lt;br/&gt;
    reporter:&lt;br/&gt;
      targetEntity: User&lt;br/&gt;
      inversedBy: reportedBugs&lt;br/&gt;
      joinColumm:&lt;br/&gt;
        name: reporterId&lt;br/&gt;
        referencedColumnName: id&lt;br/&gt;
    engineer:&lt;br/&gt;
      targetEntity: User&lt;br/&gt;
      inversedBy: assignedBugs&lt;br/&gt;
      joinColumm:&lt;br/&gt;
        name: engineerId&lt;br/&gt;
        referencedColumnName: id&lt;br/&gt;
  manyToMany:&lt;br/&gt;
    products:&lt;br/&gt;
      targetEntity: Product&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I then tried to run list_bugs:&lt;/p&gt;




&lt;p&gt;&amp;lt;?php&lt;br/&gt;
// list_bugs.php&lt;br/&gt;
require_once &quot;bootstrap.php&quot;;&lt;/p&gt;

&lt;p&gt;$dql = &quot;SELECT b, e, r FROM Bug b JOIN b.engineer e JOIN b.reporter r ORDER BY b.created DESC&quot;;&lt;/p&gt;

&lt;p&gt;$query = $em-&amp;gt;createQuery($dql);&lt;br/&gt;
$query-&amp;gt;setMaxResults(30);&lt;br/&gt;
$bugs = $query-&amp;gt;getResult();&lt;/p&gt;

&lt;p&gt;foreach($bugs AS $bug) {&lt;br/&gt;
        echo $bug-&amp;gt;getDescription().&quot; - &quot;.$bug-&amp;gt;getCreated()-&amp;gt;format(&apos;d.m.Y&apos;).&quot;\n&quot;;&lt;br/&gt;
        echo &quot;    Reported by: &quot;.$bug-&amp;gt;getReporter()-&amp;gt;name.&quot;\n&quot;;&lt;br/&gt;
        echo &quot;    Assigned to: &quot;.$bug-&amp;gt;getEngineer()-&amp;gt;name.&quot;\n&quot;;&lt;br/&gt;
        foreach($bug-&amp;gt;getProducts() AS $product) &lt;/p&gt;
{
                echo &quot;    Platform: &quot;.$product-&amp;gt;getName().&quot;\n&quot;;
        }
&lt;p&gt;        echo &quot;\n&quot;;&lt;/p&gt;


&lt;p&gt;However, I get this error message:&lt;/p&gt;

&lt;p&gt;PHP Fatal error:  Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;b0_.reporter_id&apos; in &apos;field list&apos;&apos; in /Library/WebServer/Documents/DoctrineTutorial/Doctrine/DBAL/Connection.php:646&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 /Library/WebServer/Documents/DoctrineTutorial/Doctrine/DBAL/Connection.php(646): PDO-&amp;gt;query(&apos;SELECT b0_.id A...&apos;)&lt;br/&gt;
#1 /Library/WebServer/Documents/DoctrineTutorial/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(46): Doctrine\DBAL\Connection-&amp;gt;executeQuery(&apos;SELECT b0_.id A...&apos;, Array, Array, NULL)&lt;br/&gt;
#2 /Library/WebServer/Documents/DoctrineTutorial/Doctrine/ORM/Query.php(264): Doctrine\ORM\Query\Exec\SingleSelectExecutor-&amp;gt;execute(Object(Doctrine\DBAL\Connection), Array, Array)&lt;br/&gt;
#3 /Library/WebServer/Documents/DoctrineTutorial/Doctrine/ORM/AbstractQuery.php(737): Doctrine\ORM\Query-&amp;gt;_doExecute()&lt;/p&gt;</description>
                <environment></environment>
            <key id="14345">DDC-2221</key>
            <summary>In YAML, joinColumn names are ignored in One to Many and Many To One relationships</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="schow">Shu Chow</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Jan 2013 08:09:31 +0000</created>
                <updated>Thu, 3 Jan 2013 14:11:11 +0000</updated>
                    <resolved>Thu, 3 Jan 2013 08:44:02 +0000</resolved>
                            <version>2.3.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19209" author="ocramius" created="Thu, 3 Jan 2013 08:43:48 +0000"  >&lt;p&gt;It&apos;s &quot;joinColumn&quot;, not &quot;joinColumm&quot;&lt;/p&gt;</comment>
                    <comment id="19210" author="schow" created="Thu, 3 Jan 2013 13:55:05 +0000"  >&lt;p&gt;...And that is why I should not be working on this when I&apos;m barely awake.  Sorry.&lt;/p&gt;</comment>
                    <comment id="19211" author="ocramius" created="Thu, 3 Jan 2013 14:11:11 +0000"  >&lt;p&gt;No prob &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>