<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 06:32:53 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/MODM-145/MODM-145.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>[MODM-145] QueryBuilder references() to does not support references on embedded objects&apos; fields</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-145</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I noticed that the &lt;tt&gt;references()&lt;/tt&gt; method does not support fields on embedded objects, as the argument to the preceding &lt;tt&gt;field()&lt;/tt&gt; method will be passed into &lt;tt&gt;getFieldMapping()&lt;/tt&gt; and trigger an exception. I suppose a solution would require multiple calls to &lt;tt&gt;getFieldMapping()&lt;/tt&gt; in order to dive into the embedded object&apos;s class metadata.&lt;/p&gt;

&lt;p&gt;To demonstrate, below is an example of a &lt;tt&gt;UserRepository&lt;/tt&gt; class. The &lt;tt&gt;User&lt;/tt&gt; document contains an &lt;tt&gt;embeddedObject&lt;/tt&gt; that itself references another &lt;tt&gt;User&lt;/tt&gt;:&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;class UserRepository &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; DocumentRepository
{ 
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function findByEmbeddedObjectReference(User $user)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createQueryBuilder()
            -&amp;gt;field(&apos;embeddedObject.user.$id&apos;)-&amp;gt;equals($user-&amp;gt;getId())
&lt;span class=&quot;code-comment&quot;&gt;//          -&amp;gt;field(&apos;embeddedObject.user&apos;)-&amp;gt;references($user)
&lt;/span&gt;            -&amp;gt;getQuery()
            -&amp;gt;execute();
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using &lt;tt&gt;field()/equals()&lt;/tt&gt; works fine as an alternative to &lt;tt&gt;references()&lt;/tt&gt;, so there is no urgent need for this feature.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12661">MODM-145</key>
            <summary>QueryBuilder references() to does not support references on embedded objects&apos; fields</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jmikola">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 May 2011 16:22:55 +0000</created>
                <updated>Tue, 25 Oct 2011 13:56:55 +0000</updated>
                                                                    <component>Query Builder</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16696" author="neekobus" created="Tue, 25 Oct 2011 13:55:13 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;It seems that we have a problem with the temporary solution proposed :&lt;br/&gt;
Doctrine remove the &quot;$id&quot; part in our query : &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;   obj-&amp;gt;field(&apos;embedded.referenced.$id&apos;)-&amp;gt;equals($reference-&amp;gt;getId())
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;will generate the query without &quot;$id&quot;. &lt;br/&gt;
There is no problem when the reference is directly in the requested object.&lt;/p&gt;

&lt;p&gt;Did someone experience this issue ?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>