<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sun May 19 05:57:23 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-1970/DDC-1970.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-1970] DiscriminatorMap recursion when using self-reference</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1970</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;ve ran into a problem with self-referencing entity. When fetching an entity, recursion occurs, fetching every related entity defined by ManyToOne relation&lt;br/&gt;
(in this example $sponsor), ignoring LAZY or EXTRA_LAZY fetch mode - it executes numerous queries.&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;
/**
 * @ORM\Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Acme\Bundle\UserBundle\Entity\Repository\UserRepository&quot;&lt;/span&gt;)
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;f_user&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;user_person&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;UserPerson&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;user_company&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;UserCompany&quot;&lt;/span&gt;})
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class UserBase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; FOSUser

/* .... */

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; UserBase
     *
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserBase&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;sponsor&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $referrals;

    /**
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserBase&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;referrals&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sponsor_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $sponsor;

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13942">DDC-1970</key>
            <summary>DiscriminatorMap recursion when using self-reference</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="kolah">Krzysztof Kolasiak</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Aug 2012 18:54:11 +0000</created>
                <updated>Fri, 10 May 2013 15:29:53 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18504" author="asm89" created="Tue, 14 Aug 2012 20:17:31 +0000"  >&lt;p&gt;I have changed this into a feature request because you have hit the limitations of using inheritance and self referencing entities.&lt;/p&gt;

&lt;p&gt;Doctrine2 cannot currently lazy load UserBase#$sponsor because we don&apos;t know which proxy we have to insert. It can either be UserPerson or UserCompany. In order to know this Doctrine2 &lt;em&gt;has&lt;/em&gt; to query the actual object to determine its type. The current strategy is then to load the actual entity because we have all data anyway.&lt;/p&gt;

&lt;p&gt;In order to implement this feature we need to insert a proxy instead of the actual entity. If we do that there should be no recursion happening.&lt;/p&gt;</comment>
                    <comment id="19577" author="ocramius" created="Thu, 21 Feb 2013 09:55:30 +0000"  >&lt;p&gt;Reduced priority&lt;/p&gt;</comment>
                    <comment id="20266" author="notprathap" created="Fri, 10 May 2013 15:29:53 +0000"  >&lt;p&gt;It&apos;d be great if this is a configurable option.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>