<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 18 11:12:04 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-2324/DDC-2324.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-2324] mapOneToMany not working after upgrade to symfony2.1</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2324</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().&lt;/p&gt;

&lt;p&gt;The code used was:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
        /** @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; $metadata \Doctrine\ORM\Mapping\ClassMetadata */
        $metadata = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDoctrine()-&amp;gt;getEntityManager()-&amp;gt;getClassMetadata(&apos;SecretSecretBundle:Deal&apos;);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!array_key_exists(&apos;rolap&apos;, $metadata-&amp;gt;getAssociationMappings())) {
            &lt;span class=&quot;code-comment&quot;&gt;// use a temporary join mapping
&lt;/span&gt;            $metadata-&amp;gt;mapOneToMany(array(
                &apos;targetEntity&apos; =&amp;gt; &apos;Secret\SecretBundle\Entity\RolapDealP1m&apos;,
                &apos;fieldName&apos; =&amp;gt; &apos;rolap&apos;,
                &apos;mappedBy&apos; =&amp;gt; &apos;deal&apos;,
            ));
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class.&lt;/p&gt;

&lt;p&gt;Then, a query using the queryBuilder was created like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$qb=$repo-&amp;gt;createQueryBuilder(&apos;Deal&apos;);
$qb
    -&amp;gt;join(&apos;Deal.rolap&apos;, &apos;Rolap&apos;)
[additional joins]
    -&amp;gt;select(
        array(
            &apos;Deal.number number&apos;,
            &apos;Deal.product productName&apos;,
[additional fields]
        )
    )
[additional where and group by]
;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem occurs, when doing a simple&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$qb-&amp;gt;getQuery()-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned.&lt;br/&gt;
On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Notice: Undefined index: rolap in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2.&lt;/p&gt;

&lt;p&gt;We think there has been a regression when trying to create temporary mappings.&lt;/p&gt;</description>
                <environment>debian 6, php 5.4.10</environment>
            <key id="14643">DDC-2324</key>
            <summary>mapOneToMany not working after upgrade to symfony2.1</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="thomas303">Thomas Mayer</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Feb 2013 14:38:49 +0000</created>
                <updated>Mon, 4 Mar 2013 22:17:57 +0000</updated>
                    <resolved>Mon, 4 Mar 2013 22:17:57 +0000</resolved>
                            <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="19778" author="ocramius" created="Thu, 28 Feb 2013 14:42:56 +0000"  >&lt;p&gt;Please validate the generated mappings with Doctrine\ORM\Tools\SchemaValidator.php&lt;/p&gt;</comment>
                    <comment id="19779" author="thomas303" created="Thu, 28 Feb 2013 15:02:43 +0000"  >&lt;p&gt;Using symfony 2.0 and doctrine 2.2.2, after the mapOneToMany() mapping SchemaValidator returns&lt;br/&gt;
  &apos;Secret\SecretBundle\Entity\Deal&apos; =&amp;gt; &lt;br/&gt;
    array (size=1)&lt;br/&gt;
      0 =&amp;gt; string &apos;The field Secret\SecretBundle\Entity\Deal#rolap is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity Secret\SecretBundle\Entity\RolapDealP1m#deal does not contain the required &apos;inversedBy=rolap&apos; attribute.&apos; (length=271)&lt;/p&gt;

&lt;p&gt;However, this works fine.&lt;/p&gt;

&lt;p&gt;SchemaValidator returns the same when using symfony 2.1/doctrine 2.3.2, which is not working any more when doing the getResult()&lt;/p&gt;</comment>
                    <comment id="19780" author="ocramius" created="Thu, 28 Feb 2013 15:06:17 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=thomas303&quot; class=&quot;user-hover&quot; rel=&quot;thomas303&quot;&gt;Thomas Mayer&lt;/a&gt; are you able to write a failing test case for this one? It may just be an undocumented BC break though.&lt;/p&gt;</comment>
                    <comment id="19781" author="thomas303" created="Thu, 28 Feb 2013 15:14:02 +0000"  >&lt;p&gt;I will try to track it down to a smaller model for the test case. &lt;/p&gt;</comment>
                    <comment id="19799" author="beberlei" created="Mon, 4 Mar 2013 22:17:57 +0000"  >&lt;p&gt;Changing the mapping of entities after loading from a driver is undefined behavior.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>