<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 17:31:50 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/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DDC+AND+resolution+%3D+Unresolved+AND+priority+%3D+Major+ORDER+BY+key+DESC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DDC+AND+resolution+%3D+Unresolved+AND+priority+%3D+Major+ORDER+BY+key+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="254" total="254"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-2463] [GH-675] Implementation for &apos;IsNot&apos;-Comparison</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2463</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of pmattmann:&lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/675&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/675&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;See PR (&lt;a href=&quot;https://github.com/doctrine/collections/pull/11&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/collections/pull/11&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;This is the required implementation for &apos;IsNotNull&apos;-Filters in Collection-Filtering.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14972">DDC-2463</key>
            <summary>[GH-675] Implementation for &apos;IsNot&apos;-Comparison</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="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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 May 2013 11:19:03 +0000</created>
                <updated>Mon, 20 May 2013 11:19:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2461] [GH-673] Namespace based command names</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2461</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of hell0w0rd:&lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/673&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/673&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Symfony console supports auto completion:&lt;br/&gt;
``orm:generate:entities`` could called ``o:g:e``&lt;/p&gt;</description>
                <environment></environment>
            <key id="14969">DDC-2461</key>
            <summary>[GH-673] Namespace based command names</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 May 2013 22:12:50 +0000</created>
                <updated>Fri, 17 May 2013 23:01:44 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20397" author="doctrinebot" created="Fri, 17 May 2013 22:17:25 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-673&amp;#93;&lt;/span&gt; was closed:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/673&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/673&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20398" author="ocramius" created="Fri, 17 May 2013 22:17:42 +0000"  >&lt;p&gt;BC break without advantages&lt;/p&gt;</comment>
                    <comment id="20399" author="doctrinebot" created="Fri, 17 May 2013 22:55:30 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-673&amp;#93;&lt;/span&gt; was reopened:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/673&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/673&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2460] [GH-672] Simplification example</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2460</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of hell0w0rd:&lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/672&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/672&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Remove doctrine class loader, one bootstrap file&lt;/p&gt;</description>
                <environment></environment>
            <key id="14968">DDC-2460</key>
            <summary>[GH-672] Simplification example</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="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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 May 2013 21:46:17 +0000</created>
                <updated>Fri, 17 May 2013 21:46:17 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2456] [GH-669] Fixed generating column names for self referencing entity.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2456</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of hason:&lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/669&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/669&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

</description>
                <environment></environment>
            <key id="14964">DDC-2456</key>
            <summary>[GH-669] Fixed generating column names for self referencing entity.</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="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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 May 2013 10:11:02 +0000</created>
                <updated>Fri, 17 May 2013 10:11:02 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2455] Setting classes in the entity manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2455</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am creating my own bundle in Sf2 which will be used for third libraries, but I need to provide some simple and complex queries from this. &lt;br/&gt;
For simple queries i have no problem because I set the repository with the class from the third library.&lt;br/&gt;
Something like this:&lt;/p&gt;

&lt;p&gt;    $this-&amp;gt;repository = $this-&amp;gt;em-&amp;gt;getRepository($className);&lt;br/&gt;
    $result = $this-&amp;gt;repository&lt;br/&gt;
                -&amp;gt;createQueryBuilder(&quot;c&quot;)&lt;br/&gt;
                -&amp;gt;select(&apos;c, d, e&apos;)&lt;br/&gt;
                -&amp;gt;join(&quot;c.groups&quot;, &quot;d&quot;)&lt;br/&gt;
                -&amp;gt;join(&quot;d.users&quot;, &quot;e&quot;)&lt;br/&gt;
                -&amp;gt;where(&quot;e.id = :userId&quot;)&lt;br/&gt;
                -&amp;gt;setParameter(&quot;userId&quot;, $userId);&lt;/p&gt;

&lt;p&gt;    return $result-&amp;gt;getQuery()-&amp;gt;getResult();&lt;/p&gt;

&lt;p&gt;But when I need complex queries i have to work with the Entity Manager instead of working with the Repository. So tables are named as MyBundle (Group), but not how the third library named (sf_group). As a consequence the SQL throws an error saying that my table does not exist.&lt;br/&gt;
This is how I am trying to retrieve:&lt;/p&gt;

&lt;p&gt;    $query = $this-&amp;gt;em-&amp;gt;createQuery(&quot;SELECT p FROM Groups p&quot;);&lt;/p&gt;

&lt;p&gt;I sent the className as the entity to avoid this. Something like:&lt;/p&gt;

&lt;p&gt;    $query = $this-&amp;gt;em-&amp;gt;createQuery(&quot;SELECT p FROM &quot;.$this-&amp;gt;className.&quot; p&quot;);&lt;/p&gt;

&lt;p&gt;However i need a lot of queries with JOINs, so i would have to change every entity name, which is not convenient.&lt;/p&gt;

&lt;p&gt;What another way could I implemment this?&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14962">DDC-2455</key>
            <summary>Setting classes in the entity manager</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="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="pcastrotigre">Petter Castro</reporter>
                        <labels>
                        <label>entitymanager</label>
                    </labels>
                <created>Thu, 16 May 2013 17:02:30 +0000</created>
                <updated>Thu, 16 May 2013 17:02:30 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2452] Additional `WITH` condition in joins between JTI roots cause invalid SQL to be produced</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2452</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given a simple Joined Table Inheritance like following:&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;
/**
 * @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;) @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;DDC2452Foo&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;DDC2452Bar&quot;&lt;/span&gt;})
 */
class DDC2452Foo
{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
}

/** @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt;) */
class DDC2452Bar &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; DDC2452Foo
{
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Following DQL&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;SELECT foo1 FROM DDC2452Foo foo1 JOIN DDC2452Foo foo2 WITH 1=1&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will produce broken SQL:&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;SELECT
    f0_.id AS id0, f0_.discr AS discr1 
FROM 
    foo f0_ 
LEFT JOIN bar b1_ 
    ON f0_.id = b1_.id 
LEFT JOIN foo f2_ 
LEFT JOIN bar b3_ 
    ON f2_.id = b3_.id 
    ON (1 = 1)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(please note the duplicate `ON` in the SQL)&lt;/p&gt;

&lt;p&gt;That is caused because of the SQL walker producing the JTI filter with already the `ON` clause in it.&lt;/p&gt;

&lt;p&gt;That happens because the JTI join conditions are added in &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/2.4.0-BETA2/lib/Doctrine/ORM/Query/SqlWalker.php#L823-L825&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/2.4.0-BETA2/lib/Doctrine/ORM/Query/SqlWalker.php#L823-L825&lt;/a&gt; (`walkRangeVariableDeclaration`), while the additional defined `WITH` conditions are considered in `walkJoinAssociationDeclaration` later on.&lt;/p&gt;

&lt;p&gt;Added a test case and fix at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/668&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/668&lt;/a&gt;&lt;/p&gt;</description>
                <environment>irrelevant</environment>
            <key id="14958">DDC-2452</key>
            <summary>Additional `WITH` condition in joins between JTI roots cause invalid SQL to be produced</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="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="ocramius">Marco Pivetta</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                        <label>dql</label>
                        <label>sql-walker</label>
                    </labels>
                <created>Thu, 16 May 2013 14:05:48 +0000</created>
                <updated>Thu, 16 May 2013 16:23:40 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2449] Amazon Redshift Support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2449</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice to get doctrine compatible with Amazon Redshift. It uses a Postgres connector but there are some differences. I&apos;m currently facing an issue with the primary id, in Redshift the generation of an id is different from Postgres and so I&apos;m getting errors associated with generating an id.&lt;/p&gt;

&lt;p&gt;Here are some references that might be useful:&lt;br/&gt;
node-orm faced the same issue and seems like they figured it out: &lt;a href=&quot;https://github.com/dresende/node-orm2/issues/39&quot; class=&quot;external-link&quot;&gt;https://github.com/dresende/node-orm2/issues/39&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amazon Manual:&lt;br/&gt;
&lt;a href=&quot;http://awsdocs.s3.amazonaws.com/redshift/latest/redshift-dg.pdf&quot; class=&quot;external-link&quot;&gt;http://awsdocs.s3.amazonaws.com/redshift/latest/redshift-dg.pdf&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Amazon Redshift</environment>
            <key id="14955">DDC-2449</key>
            <summary>Amazon Redshift Support</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="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="kfuchs">Kirill F</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 May 2013 23:08:21 +0000</created>
                <updated>Wed, 15 May 2013 23:09:12 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2448] orm:schema-tool:update reports already updated NUMERIC fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2448</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a table defined in this way:&lt;/p&gt;

&lt;p&gt;CREATE TABLE `my_table` (&lt;br/&gt;
  `id` int(10) NOT NULL AUTO_INCREMENT,&lt;br/&gt;
  `subtotal` decimal(10,2) DEFAULT NULL,&lt;br/&gt;
  PRIMARY KEY (`id`)&lt;br/&gt;
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;&lt;/p&gt;

&lt;p&gt;When I run&lt;br/&gt;
    php doctrine.php  orm:schema-tool:update --dump-sql&lt;/p&gt;

&lt;p&gt;I get&lt;br/&gt;
ALTER TABLE my_table CHANGE subtotal subtotal NUMERIC(10, 2) DEFAULT NULL;&lt;/p&gt;

&lt;p&gt;While of course the field is already updated. The same happens in SQL Server 2008 and Postgres 9.&lt;/p&gt;</description>
                <environment>PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48) &lt;br/&gt;
Mysql version: 5.5.31-0ubuntu0.12.04.1 (Ubuntu)</environment>
            <key id="14948">DDC-2448</key>
            <summary>orm:schema-tool:update reports already updated NUMERIC fields</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="osvi">Francesco Montefoschi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 May 2013 09:09:13 +0000</created>
                <updated>Tue, 14 May 2013 09:09:13 +0000</updated>
                                    <version>2.3.4</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2446] [GH-666] [DDC-2429] Fix xsd definition</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2446</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of FabioBatSilva:&lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/666&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/666&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2429&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2429&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14944">DDC-2446</key>
            <summary>[GH-666] [DDC-2429] Fix xsd definition</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="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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 May 2013 14:14:11 +0000</created>
                <updated>Mon, 13 May 2013 14:14:11 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2445] [GH-665] oo 	Add Null in ScalarExpression </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2445</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of vahid-sohrabloo:&lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/665&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/665&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

</description>
                <environment></environment>
            <key id="14943">DDC-2445</key>
            <summary>[GH-665] oo 	Add Null in ScalarExpression </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="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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Sun, 12 May 2013 10:40:41 +0000</created>
                <updated>Sun, 12 May 2013 10:40:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2444] NULL IN CASE WHEN</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2444</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi&lt;br/&gt;
In DQL when i use NULL  IN  &quot;CASE WHEN&quot; like this&lt;br/&gt;
&quot;AVG(CASE WHEN g.speed &amp;gt; 0 THEN g.speed ELSE NULL END)&quot;&lt;br/&gt;
 Throw this expestion&lt;br/&gt;
Unexpected &apos;NULL&apos;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14941">DDC-2444</key>
            <summary>NULL IN CASE WHEN</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="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="vahid4134">vahid sohrabloo</reporter>
                        <labels>
                    </labels>
                <created>Sun, 12 May 2013 07:56:49 +0000</created>
                <updated>Tue, 14 May 2013 08:21:23 +0000</updated>
                                    <version>2.3.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20376" author="mvrhov" created="Tue, 14 May 2013 08:21:23 +0000"  >&lt;p&gt;We could say a duplicate of: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2208&quot; title=&quot;CASE WHEN ... WHEN doesn&amp;#39;t work&quot;&gt;DDC-2208&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2429] Association-Override Problem in XSD Mapping?</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2429</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;From a mailinglist entry:&lt;/p&gt;

&lt;p&gt;I use Doctrine 2.3 in Symfony 2.1.8&lt;/p&gt;

&lt;p&gt;I&apos;m using association-overrides in the XML format between several entities. Eclipse shows up several errors.&lt;/p&gt;

&lt;p&gt;The first error message is shown in every Doctrine file when I declare the file format as such (for example: &lt;a href=&quot;https://github.com/thewholelifetolearn/Social-Library/blob/master/src/SocialLibrary/ReadBundle/Resources/config/doctrine/GraphicNovel.orm.xml&quot; class=&quot;external-link&quot;&gt;https://github.com/thewholelifetolearn/Social-Library/blob/master/src/SocialLibrary/ReadBundle/Resources/config/doctrine/GraphicNovel.orm.xml&lt;/a&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;
&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt;
&lt;/span&gt;                  xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt;
&lt;/span&gt;                  xsi:schemaLocation=&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping
&lt;/span&gt;                  http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Eclipse shows this error : &lt;br/&gt;
White spaces are required between  publicId and systemId&lt;/p&gt;

&lt;p&gt;The error points to the &quot;doctrine-mapping&quot; line&lt;/p&gt;



&lt;p&gt;The second error comes up when I change the doctype to (file example: &lt;a href=&quot;https://gist.github.com/thewholelifetolearn/5462057&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/thewholelifetolearn/5462057&lt;/a&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;
&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt;
&lt;/span&gt;                  xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt;
&lt;/span&gt;                  xsi:schemaLocation=&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping
&lt;/span&gt;                  https:&lt;span class=&quot;code-comment&quot;&gt;//raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd&quot;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But then this error is shown:&lt;br/&gt;
cvc-complex-type.2.4.b: The content of element &apos;association-overrides&apos; is not complete. One of &apos;&lt;/p&gt;
{&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping&quot;:association-override, WC[##other:&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping&quot;]}
&lt;p&gt;&apos; is expected.&lt;/p&gt;

&lt;p&gt;The error points on &quot;&amp;lt;association-overrides&amp;gt;&quot; in Novel.orm.xml (line 8)&lt;/p&gt;


&lt;p&gt;Could someone explain me the errors that show up? The first error doesn&apos;t seem to disturb Symfony2 but the second messes around the console commands. But it still generates the database.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14831">DDC-2429</key>
            <summary>Association-Override Problem in XSD Mapping?</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="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="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 5 May 2013 16:44:40 +0000</created>
                <updated>Mon, 13 May 2013 16:26:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2424] Removing an inherited entity via a delete cascade constraint does not remove the parent row</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2424</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For a parent class:&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
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Base&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;discr&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;child1&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Child1&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;child2&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Child2&quot;&lt;/span&gt;})
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and simple Child1 &amp;amp; Child2 entities.&lt;/p&gt;

&lt;p&gt;With another entity (let&apos;s call it ExternalEntity) having a bidirectional OneToOne relation owned by Child1:&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 Child1 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base
{
  /**
   * @ORM\OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ExternalEntity&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;xxx&quot;&lt;/span&gt;)
   * @ORM\JoinColumn(onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
   */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; theForeignKey;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Enough for the context.&lt;br/&gt;
The symptoms:&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;$em-&amp;gt;remove(instanceOfExternalEntity);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; removes the ExternalEntity row and the Child1 row. But a dangling row in the Base table is still there for the now inexistent Child1 instance.&lt;/p&gt;

&lt;p&gt;Though, a manual delete of either the associated Child1 OR Base row and then the ExternalEntity works.&lt;/p&gt;

&lt;p&gt;The problem with the cascading deletion of the parent seems to be only present when deleting through a MYSQL cascading delete from another row which has a foreign key on a child. (Not tested with a foreign key on the parent though)&lt;/p&gt;
</description>
                <environment>Mysql 5.1.66 / Symfony 2.2.1</environment>
            <key id="14824">DDC-2424</key>
            <summary>Removing an inherited entity via a delete cascade constraint does not remove the parent row</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="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="xaapyks">Bruno Jacquet</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 May 2013 13:59:55 +0000</created>
                <updated>Mon, 6 May 2013 10:19:39 +0000</updated>
                                    <version>2.3.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20201" author="beberlei" created="Sat, 4 May 2013 10:51:03 +0000"  >&lt;p&gt;Can you show the CREATE TABLE and FOREIGN KEY statements of all the tables involved? It seems the cascade of the foreign keys is not propagated between multiple tables?&lt;/p&gt;</comment>
                    <comment id="20220" author="xaapyks" created="Mon, 6 May 2013 10:09:45 +0000"  >&lt;p&gt;CREATE TABLE Base (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;&lt;br/&gt;
CREATE TABLE Child1 (id INT NOT NULL, foreignKey INT NOT NULL, UNIQUE INDEX UNIQ_179B6E88E992F5A (foreignKey), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;&lt;/p&gt;

&lt;p&gt;ALTER TABLE Child1 ADD CONSTRAINT FK_179B6E88E992F5A FOREIGN KEY (foreignKey) REFERENCES ExternalEntity (id) ON DELETE CASCADE;&lt;br/&gt;
ALTER TABLE Child1 ADD CONSTRAINT FK_179B6E8BF396750 FOREIGN KEY (id) REFERENCES Base (id) ON DELETE CASCADE;&lt;/p&gt;</comment>
                    <comment id="20221" author="xaapyks" created="Mon, 6 May 2013 10:14:48 +0000"  >&lt;p&gt;The problem is that, the SQL model never explicitely tells the DB to delete the corresponding Base when Child1 gets removed. It looks like it is handled by the doctrine entity manager layer and not the actual DB engine (Base has no on delete cascade nor foreign key to its children). &lt;br/&gt;
So only doctrine can add the logic here because it knows the entity schema. But in this case, when it is deleted from another table, it looks like the special treatment is not triggered.&lt;/p&gt;</comment>
                    <comment id="20222" author="xaapyks" created="Mon, 6 May 2013 10:19:39 +0000"  >&lt;p&gt;Maybe using &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;cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;, instead of &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;onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; to force the cascading process to be handled by doctrine would workaround the bug... But I prefer to have my DB do the logic work as much as possible.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2420] [GH-656] [DDC-2235] Fix for using a LEFT JOIN onto an entity with single table inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2420</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of tarnfeld:&lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/656&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/656&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Possible fix for the bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2235&quot; title=&quot;Single table inheritance discriminator in WHERE when using arbitrary join syntax&quot;&gt;&lt;del&gt;DDC-2235&lt;/del&gt;&lt;/a&gt;. I&apos;d love to hear some opinions on whether this is the right way to go about this issue. I&apos;m not particularly familiar with the internals of doctrine so there may be a better solution.&lt;/p&gt;

&lt;p&gt;------&lt;/p&gt;

&lt;p&gt;The issue is when using DQL to perform a left join on an entity using single&lt;br/&gt;
table inheritance, doctrine tries to insert an `IN()` predicate into the `WHERE`&lt;br/&gt;
clause for all of the discriminator values. That makes sense and is valid, so&lt;br/&gt;
it would be wrong to remove that behaviour.&lt;/p&gt;

&lt;p&gt;However when using a &lt;b&gt;left&lt;/b&gt; join having an `IN()` in the main where clause makes&lt;br/&gt;
the `LEFT JOIN` pretty much useless, as it implicitly creates a `WHERE NOT NULL`&lt;br/&gt;
clause. This commit attempts to fix that by including an `OR IS NULL` in the&lt;br/&gt;
query if the join is a `LEFT JOIN`.&lt;/p&gt;

&lt;p&gt;I&apos;ve added some regression tests to ensure this bug never creeps back in. They fail on master (highlighting the bug) and pass after these commits have been applied. I&apos;ve also included a couple of other queries as tests to be sure only this one case has been affected.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14817">DDC-2420</key>
            <summary>[GH-656] [DDC-2235] Fix for using a LEFT JOIN onto an entity with single table inheritance</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="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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Apr 2013 23:09:35 +0000</created>
                <updated>Sun, 28 Apr 2013 23:09:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2411] Null values get reset when rehydrating an already managed entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2411</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Scenario:&lt;/p&gt;

&lt;p&gt;1) You have an entity with a ManyToOne relation (and probably other kinds too, but this is all I have tested) to another entity which is nullable. For example, let&apos;s say you have a Book entity which has an &quot;illustrator&quot; field which refers to a Person entity, representing the person who illustrated the book. If the book is not illustrated then you set the field to null.&lt;/p&gt;

&lt;p&gt;2) You fetch a Book (by ID) which has its illustrator set to a particular Person.&lt;/p&gt;

&lt;p&gt;3) You set that Book&apos;s illustrator to null.&lt;/p&gt;

&lt;p&gt;4) Without flushing, you fetch the Book again, using different criteria: for example, by title. Because entities are Identity Mapped, this will run a query but then locate the same instance in memory, and try to hydrate that instance with the old data it just fetched.&lt;/p&gt;

&lt;p&gt;5) Any fields on the instance that have modified values retain their new values (for example, if we changed the illustrator to a different Person, this would be retained), BUT any fields on the instance which are null get overwritten with the old data (so if we previously set the illustrator to null, without flushing, it would now be reset to the Person value that it had before).&lt;/p&gt;

&lt;p&gt;There seems to be a mistaken assumption here that null values are fields that have not been hydrated, when this is not necessarily the case. Is this the intended behaviour?&lt;/p&gt;

&lt;p&gt;The code that causes this behaviour is here: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/e561f47cb2205565eb873f0643637477bfcfc2ff/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php#L471&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/e561f47cb2205565eb873f0643637477bfcfc2ff/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php#L471&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are wondering why anybody would want to fetch the entity again in step 4, my use case for this is the Symfony Validator (but I presume there could be others).&lt;/p&gt;

&lt;p&gt;If there are any unique constraints (Symfony ones, not Doctrine ones) on the entity, e.g. if we had a unique constraint on the Book title field, then when validating the Book the Symfony Validator would check if there are already any Book entities with the same title as the Book we&apos;re validating. It will find the Book that we are working with, and because entities are identity mapped, it will act upon the same instance, and the situation above occurs.&lt;/p&gt;

&lt;p&gt;Code example:&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;// Create some entities&lt;/p&gt;

&lt;p&gt;$john = new Person();&lt;br/&gt;
$john-&amp;gt;setName(&apos;John Smith&apos;);&lt;/p&gt;

&lt;p&gt;$jane = new Person();&lt;br/&gt;
$jane-&amp;gt;setName(&apos;Jane Jones&apos;);&lt;/p&gt;

&lt;p&gt;$joe = new Person();&lt;br/&gt;
$joe-&amp;gt;setName(&apos;Joe Bloggs&apos;);&lt;/p&gt;

&lt;p&gt;$book = new Book();&lt;br/&gt;
$book-&amp;gt;setId(123);&lt;br/&gt;
$book-&amp;gt;setTitle(&apos;Book Title&apos;);&lt;br/&gt;
$book-&amp;gt;setIllustrator($john);&lt;br/&gt;
$book-&amp;gt;setAuthor($jane);&lt;/p&gt;

&lt;p&gt;$em-&amp;gt;persist($john);&lt;br/&gt;
$em-&amp;gt;persist($jane);&lt;br/&gt;
$em-&amp;gt;persist($joe);&lt;br/&gt;
$em-&amp;gt;persist($book);&lt;br/&gt;
$em-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;// Now let&apos;s try modifying the book&lt;/p&gt;

&lt;p&gt;$book = $bookRepository-&amp;gt;find(123);&lt;br/&gt;
$book-&amp;gt;getIllustrator(); // returns Person &quot;John Smith&quot;&lt;br/&gt;
$book-&amp;gt;getAuthor(); // returns Person &quot;Jane Jones&quot;&lt;/p&gt;

&lt;p&gt;// make some changes&lt;br/&gt;
$book-&amp;gt;setIllustrator(null); // illustrator is now null&lt;br/&gt;
$book-&amp;gt;setAuthor($joe); // author is now &quot;Joe Bloggs&quot;&lt;/p&gt;

&lt;p&gt;// now validate our changes with Symfony Validator&lt;br/&gt;
// note: the same effect can also be observed with&lt;br/&gt;
//     $test = $bookRepository-&amp;gt;findBy(&apos;title&apos;, &apos;Book Title&apos;);&lt;br/&gt;
$validator-&amp;gt;validate($book);&lt;/p&gt;

&lt;p&gt;// what happened to our book??&lt;br/&gt;
$book-&amp;gt;getIllustrator(); // returns Person &quot;John Smith&quot; &amp;lt;- should be null&lt;br/&gt;
$book-&amp;gt;getAuthor(); // returns Person &quot;Joe Bloggs&quot; &amp;lt;- correctly retains the new value&lt;/p&gt;</description>
                <environment></environment>
            <key id="14801">DDC-2411</key>
            <summary>Null values get reset when rehydrating an already managed entity</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="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="sgarner">Simon Garner</reporter>
                        <labels>
                        <label>hydration</label>
                    </labels>
                <created>Tue, 23 Apr 2013 12:37:56 +0000</created>
                <updated>Thu, 9 May 2013 10:31:16 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="20100" author="fabio.bat.silva" created="Wed, 24 Apr 2013 18:48:14 +0000"  >&lt;p&gt;Hi Simon,&lt;/p&gt;

&lt;p&gt;Could you please try to write a &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php&quot; class=&quot;external-link&quot;&gt;failing test case&lt;/a&gt; or paste your entities ?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="20235" author="beberlei" created="Thu, 9 May 2013 10:31:16 +0000"  >&lt;p&gt;Verified by code review that this issue exists, but it will be very tricky to fix, because the null check is there for other reasons as well.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2406] Merging of new detached entities with PrePersist lifecycle callback breaks</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2406</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Merging of new detached entities with PrePersist lifecycle callback breaks:&lt;/p&gt;

&lt;p&gt;Code snippet:&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 A
    {
       /**
        *  @ORM\ManyToOne(targetEntity= ...
        *  @ORM\JoinColumn(name=&quot; ...
        */
        &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $b;
        
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getB()
        {
            &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;b;
        }
        
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setB($b)
        {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b = $b;
        }
        
        /**
         *
         * @ORM\PrePersist
         *
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function onPrePersist()
        {
           &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getB() === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Exception(&apos;B instance must be defined);
           }
           ....
        }
    }
    
    class B 
    {
    }
    
    $a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; A();
    $b = $em-&amp;gt;find(&apos;B&apos;, 1);
    $a-&amp;gt;setB($b);
    $em-&amp;gt;persist($a); &lt;span class=&quot;code-comment&quot;&gt;// works fine as B instance is set
&lt;/span&gt;    $em-&amp;gt;detach($a);
    
    $a = $em-&amp;gt;merge($a) &lt;span class=&quot;code-comment&quot;&gt;// breaks in onPrePersist&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason it happens is that the merge operation is trying to persist a new entity created by uow::newInstance($class) without populating its properties first:&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-comment&quot;&gt;// If there is no ID, it is actually NEW.
&lt;/span&gt;    ....
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $id) {
        $managedCopy = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;newInstance($class);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;persistNew($class, $managedCopy);
    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	....
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This should happen first for the $managedCopy:&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-comment&quot;&gt;// Merge state of $entity into existing (managed) entity
&lt;/span&gt;    foreach ($class-&amp;gt;reflClass-&amp;gt;getProperties() as $prop) {
        ....
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14791">DDC-2406</key>
            <summary>Merging of new detached entities with PrePersist lifecycle callback breaks</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="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="deatheriam">Oleg Namaka</reporter>
                        <labels>
                        <label>merge,</label>
                        <label>prePersist</label>
                    </labels>
                <created>Fri, 19 Apr 2013 17:01:32 +0000</created>
                <updated>Wed, 1 May 2013 12:24:53 +0000</updated>
                                    <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="20123" author="fabio.bat.silva" created="Sun, 28 Apr 2013 20:57:08 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt;, Is this an expected behavior ?&lt;/p&gt;

&lt;p&gt;I mean.. This issue is about dispatch the event before copy the original values into the managed instance. &lt;br/&gt;
But overall, should &lt;b&gt;$em-&amp;gt;detach()&lt;/b&gt; trigger &lt;b&gt;@PrePersist&lt;/b&gt; events ?&lt;/p&gt;</comment>
                    <comment id="20137" author="beberlei" created="Wed, 1 May 2013 08:48:08 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=fabio.bat.silva&quot; class=&quot;user-hover&quot; rel=&quot;fabio.bat.silva&quot;&gt;Fabio B. Silva&lt;/a&gt; he talks about $em-&amp;gt;merge() on a detached entity calling pre persist. This should only happen on a NEW entity, not on a DETACHED one.&lt;/p&gt;</comment>
                    <comment id="20146" author="deatheriam" created="Wed, 1 May 2013 12:22:24 +0000"  >&lt;p&gt;I tend to disagree with the statement above about pre persist that should not happen on a detached entity being merged back in. If this event handler contains a business logic that this entity needs to be checked against and the detached entity was modified before the merge operation in a way that invalidates it in the prePersist than I will end up with the invalid entity in the identity map. If the merge operation calls persist it must run the prePersist event handler as well for consistency.&lt;/p&gt;

&lt;p&gt;If there is a logic that prevents persisting invalid entities why should it bypassed in the merge operation?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2405] Changing strategy generates bad query.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2405</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For (unit, acceptance, functional) testing purpose I need to change the strategy of my GameStuff Entity class.&lt;/p&gt;

&lt;p&gt;In previous version is was using php instruction below, but since doctrine orm 2.3, it doesn&apos;t work anymore.&lt;/p&gt;

&lt;p&gt;$orm-&amp;gt;getClassMetaData(&apos;Entities\GameStuff&apos;)-&amp;gt;setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);&lt;/p&gt;

&lt;p&gt;will trigger:&lt;/p&gt;

&lt;p&gt;Doctrine\DBAL\DBALException: An exception occurred while executing &apos;INSERT INTO vbank_accounts (game_id, updated_at, created_at) VALUES (?, ?, ?)&apos; with params &lt;/p&gt;
{&quot;1&quot;:1000010, &quot;2&quot;:0,&quot;3&quot;:&quot;2013-04-19 17:16:05&quot;,&quot;4&quot;:&quot;2013-04-19 17:16:05&quot;}
&lt;p&gt;:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens&lt;/p&gt;</description>
                <environment></environment>
            <key id="14790">DDC-2405</key>
            <summary>Changing strategy generates bad query.</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gedingun">Van Rotemberg</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Apr 2013 15:33:18 +0000</created>
                <updated>Sun, 21 Apr 2013 14:50:37 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="20070" author="beberlei" created="Sat, 20 Apr 2013 07:46:22 +0000"  >&lt;p&gt;The problem is that changing ClassMetadata after generating it from the cache is not really supported and depends on the Internal State of other classes. Have you tried creating a completly new EntityManager and then directly setting this? It could be that the SQL for the entity was already generated inside Doctrine, with the ID Generator information at IDENTITY_AUTO.&lt;/p&gt;</comment>
                    <comment id="20079" author="gedingun" created="Sun, 21 Apr 2013 11:29:49 +0000"  >&lt;p&gt;&amp;gt; The problem is that changing ClassMetadata after generating it from the cache is not really supported&lt;/p&gt;

&lt;p&gt;Yeah, it is a problem indeed, why set ticket status to resolved ?&lt;br/&gt;
Do you think it&apos;s normal to have a public method that trigger a fatal error ?&lt;/p&gt;

&lt;p&gt;Please fix it or put setIdGeneratorType as private, or AT LEAST add a context exception ...&lt;/p&gt;</comment>
                    <comment id="20080" author="ocramius" created="Sun, 21 Apr 2013 11:49:12 +0000"  >&lt;p&gt;Almost every interaction with metadata outside the `loadClassMetadata` event will cause unexpected problems. I don&apos;t think throwing an exception there helps in any way.&lt;/p&gt;</comment>
                    <comment id="20082" author="gedingun" created="Sun, 21 Apr 2013 14:49:26 +0000"  >&lt;p&gt;@marco pivetta&lt;/p&gt;

&lt;p&gt;The generation of the actual exception comes from DBALException on the query excetion and point a bad generated query (Invalid parameter number),&lt;br/&gt;
when the problem comes from setting ClassMetada, and concerns a problem of cache generated after loadClassMetadata.&lt;/p&gt;

&lt;p&gt;Adding an exception is just the fast way pointing where the problem comes from and that &quot;setting metadata after loadMetadata is not supported anymore&quot;. (It will spare developper&apos;s time that used to set metadata, but also help future contribution)&lt;/p&gt;

&lt;p&gt;&amp;gt; Please fix it or put setIdGeneratorType as private, or AT LEAST add a context exception ...&lt;br/&gt;
Note: BTW, my favorite solution would be to fix it (re-generate cache, or edit cache, or disable cache or whatever)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2401] INDEX BY not working on multiple columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2401</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;According to the docs on this page: &lt;br/&gt;
&lt;a href=&quot;http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#using-index-by&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#using-index-by&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following &quot;multi-dimensional index&quot; should be perfectly possible, with a default hydration mode:&lt;br/&gt;
SELECT b as business, p as product FROM Businesses b INDEX BY b.id JOIN Products p WITH b.id = p.businessid INDEX BY p.id&lt;/p&gt;

&lt;p&gt;However, b.id is completely ignored (it is a numeric primary key).&lt;/p&gt;

&lt;p&gt;I tried to go further, giving 2 products a matching barcode and indexing by barcode and then a (unique, numeric) productid. Only the barcode worked as a key and only one of the products with a matching barcode was selected. I used this query to test:&lt;br/&gt;
SELECT p FROM Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/p&gt;

&lt;p&gt;I also flagged the docs, because I don&apos;t think a userid should/could be starting from 0.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14784">DDC-2401</key>
            <summary>INDEX BY not working on multiple columns</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="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="quintenvk">Quintenvk</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Apr 2013 15:54:58 +0000</created>
                <updated>Thu, 18 Apr 2013 20:17:31 +0000</updated>
                                    <version>2.3.3</version>
                                                <component>Documentation</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20047" author="fabio.bat.silva" created="Thu, 18 Apr 2013 13:41:30 +0000"  >&lt;p&gt;Hi Quintenvk&lt;/p&gt;

&lt;p&gt;Could you please try to write a failing test case ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="20054" author="quintenvk" created="Thu, 18 Apr 2013 18:40:34 +0000"  >&lt;p&gt;I added a testcase. Please note that the database settings are to be configured in Core/simplys/simplys.php, and that the dump is in dummy.sql.&lt;/p&gt;

&lt;p&gt;Apart from that all should run well immediately.&lt;/p&gt;</comment>
                    <comment id="20055" author="quintenvk" created="Thu, 18 Apr 2013 18:42:02 +0000"  >&lt;p&gt;Fabio,&lt;/p&gt;

&lt;p&gt;Please check the zip I just attached. I hope this helps you in finding the problem.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Quinten&lt;/p&gt;</comment>
                    <comment id="20056" author="fabio.bat.silva" created="Thu, 18 Apr 2013 19:28:37 +0000"  >&lt;p&gt;Thanks Quintenvk,&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;SELECT p.barcode, p.id, p.name FROM \core\Simplys\Entity\Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In this DQL you are trying to index by scalar values, &lt;br/&gt;
I think we does not support that, and a single dimensional array is the expected result in this case.&lt;/p&gt;

&lt;p&gt;Also the &lt;a href=&quot;http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#using-index-by&quot; class=&quot;external-link&quot;&gt;INDEX BY&lt;/a&gt; documentations seems wrong to me.&lt;/p&gt;


&lt;p&gt;The given DQL : &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; SELECT u.id, u.status, upper(u.name) nameUpper FROM User u INDEX BY u.idJOIN u.phonenumbers p INDEX BY p.phonenumber &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Show the following result :&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;array
  0 =&amp;gt;
    array
      1 =&amp;gt;
        object(stdClass)[299]
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Doctrine\Tests\Models\CMS\CmsUser&apos; (length=33)
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;id&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1
          ..
      &apos;nameUpper&apos; =&amp;gt; string &apos;ROMANB&apos; (length=6)
  1 =&amp;gt;
    array
      2 =&amp;gt;
        object(stdClass)[298]
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Doctrine\Tests\Models\CMS\CmsUser&apos; (length=33)
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;id&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 2
          ...
      &apos;nameUpper&apos; =&amp;gt; string &apos;JWAGE&apos; (length=5)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which IMHO represents another DQL, something like :&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; SELECT u, p , upper(u.name) nameUpper FROM User u INDEX BY u.id JOIN u.phonenumbers p INDEX BY p.phonenumber&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20057" author="quintenvk" created="Thu, 18 Apr 2013 19:34:33 +0000"  >&lt;p&gt;Thanks for your reply Fabio. &lt;br/&gt;
Do you think there could be alternatives (apart from a foreach-loop) to achieve the expected result?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Quinten&lt;/p&gt;</comment>
                    <comment id="20058" author="fabio.bat.silva" created="Thu, 18 Apr 2013 19:47:06 +0000"  >&lt;p&gt;Not sure if it&apos;s exactly the result you need but you can try &lt;/p&gt;

&lt;p&gt;Something like :&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;SELECT p, b FROM \core\Simplys\Entity\Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or something like :&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;SELECT PARTIAL p.{id, barcode, name}, b.{id, attributesYouNeed} FROM \core\Simplys\Entity\Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And than :&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;
$result = $query-&amp;gt;getArrayResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20059" author="quintenvk" created="Thu, 18 Apr 2013 19:58:55 +0000"  >&lt;p&gt;Both produce the same result as the query I had. I think i&apos;ll move on to loops after a bit more research, too bad it can&apos;t be done (at least for now) though... Would&apos;ve been nice.&lt;/p&gt;

&lt;p&gt;Thanks for your help though!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11524" name="Testcase.zip" size="2020276" author="quintenvk" created="Thu, 18 Apr 2013 18:40:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2390] Remove Parser and SQLWalker dependency on Query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2390</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Query is too powerful to be available in Parser and SQLWalker, because it may lead to accessing data that changes on subsequent runs of a query that is cached.&lt;/p&gt;

&lt;p&gt;Idea is to introduce a MetadataBag that contains only the values that are allowed to be accessed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14759">DDC-2390</key>
            <summary>Remove Parser and SQLWalker dependency on Query</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Apr 2013 19:35:02 +0000</created>
                <updated>Thu, 4 Apr 2013 19:35:02 +0000</updated>
                                                    <fixVersion>2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2385] [GH-640] [Paginator]Add hidden field ordering for postgresql</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2385</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of denkiryokuhatsuden:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/640&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/640&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;In postgresql environment, when some hidden fields are used in orderBy clause,&lt;br/&gt;
they&apos;re not property added because $rsm-&amp;gt;scalarMappings don&apos;t have information about them.&lt;/p&gt;

&lt;p&gt;This change fixes above.&lt;/p&gt;

&lt;p&gt;I&apos;m afraid I&apos;m not sure which branch this will be merged, but anyway here&apos;s a patch.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14750">DDC-2385</key>
            <summary>[GH-640] [Paginator]Add hidden field ordering for postgresql</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Apr 2013 10:01:27 +0000</created>
                <updated>Tue, 2 Apr 2013 10:01:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2374] [GH-634] [WIP] Value objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2374</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of beberlei:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/634&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/634&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;This pull request takes a different approach than GH-265 to implement ValueObjects. Instead of changing most of the code in every layer, we just inline embedded object class metadata into an entities metadata and then use a reflection proxy that looks like &quot;ReflectionProperty&quot; to do the rewiring.&lt;/p&gt;

&lt;p&gt;The idea is inspired from Symfony Forms &apos;property_path&apos; option, where you can write and read values to different parts of an object graph.&lt;/p&gt;

&lt;p&gt;This is a WIP, there have been no further tests made about the consequences of this approach. The implementation is up for discussion.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14731">DDC-2374</key>
            <summary>[GH-634] [WIP] Value objects</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Mar 2013 23:13:41 +0000</created>
                <updated>Sun, 14 Apr 2013 10:18:46 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                            <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10295">DDC-93</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2372] [GH-632] entity generator - ignore trait properties and methods</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2372</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of Padam87:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/632&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/632&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Fixes:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1825&quot; title=&quot;generate entities with traits&quot;&gt;DDC-1825&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2154&quot; title=&quot;Traits and Code Generation&quot;&gt;DDC-2154&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14728">DDC-2372</key>
            <summary>[GH-632] entity generator - ignore trait properties and methods</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Mar 2013 19:54:23 +0000</created>
                <updated>Tue, 26 Mar 2013 19:54:23 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2364] [GH-625] [DDC-2363] Duplicated record with orphanRemoval and proxy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2364</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of mmenozzi:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/625&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/625&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2363&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2363&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14714">DDC-2364</key>
            <summary>[GH-625] [DDC-2363] Duplicated record with orphanRemoval and proxy</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Mar 2013 17:39:26 +0000</created>
                <updated>Fri, 22 Mar 2013 17:39:26 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2363] Duplicated record with orphanRemoval and proxy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2363</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There is a problem that causes duplicate records are created when EntityManager has to remove an entity due to orphanRemoval. The problem occurs only with a double flush and referred object is a proxy.&lt;/p&gt;

&lt;p&gt;I&apos;m trying to submit a pull request for this ticket. Please, stand by.&lt;/p&gt;</description>
                <environment>Tested both Mac OS X and Ubuntu</environment>
            <key id="14713">DDC-2363</key>
            <summary>Duplicated record with orphanRemoval and proxy</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="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="mmenozzi">Manuele Menozzi</reporter>
                        <labels>
                        <label>orphanRemoval</label>
                        <label>proxy</label>
                    </labels>
                <created>Fri, 22 Mar 2013 15:07:11 +0000</created>
                <updated>Fri, 22 Mar 2013 15:07:11 +0000</updated>
                                    <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2354] [GH-617] Wrong UnitOfWork::computeChangeSet()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2354</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of fchris82:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/617&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/617&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Sometimes some fields are Proxy when compute &quot;changeSet&quot;. If it is Proxy, some listeners - example Gedmo sortable listener - belive the value has changed and this leads to chaos.&lt;/p&gt;

&lt;p&gt;I check the $actualValue, if it is Proxy, the value didn&apos;t change.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14698">DDC-2354</key>
            <summary>[GH-617] Wrong UnitOfWork::computeChangeSet()</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 16 Mar 2013 16:18:27 +0000</created>
                <updated>Sat, 16 Mar 2013 16:18:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2352] [GH-615] Update SqlWalker.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2352</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of mikemeier:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/615&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/615&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Always be sure that only a-z characters are used for table alias, otherwise use generic &quot;t&quot; for &quot;table&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14696">DDC-2352</key>
            <summary>[GH-615] Update SqlWalker.php</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Mar 2013 12:53:47 +0000</created>
                <updated>Fri, 15 Mar 2013 12:53:47 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2351] Entity Listener vs. Event Listener</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2351</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Entity Listener and Event Listener don&apos;t get same events. An example is the onFlush event, which Entity Listener doesn&apos;t get. Why are both listeners receiving different events and not same events? &lt;/p&gt;

&lt;p&gt;For consistency I&apos;d like to see that both get same events - if I understand the purpose of Entity Listener correctly: it should be an alternative to Event Listener with same functionality but is bound to an entity. &lt;/p&gt;</description>
                <environment></environment>
            <key id="14695">DDC-2351</key>
            <summary>Entity Listener vs. Event Listener</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="fspillner">Fabian Spillner</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Mar 2013 08:30:12 +0000</created>
                <updated>Fri, 15 Mar 2013 08:45:49 +0000</updated>
                                    <version>Git Master</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19865" author="beberlei" created="Fri, 15 Mar 2013 08:45:49 +0000"  >&lt;p&gt;onFlush and postFlush should be propagated to entity listeners as well&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2339] [GH-605] DDC-2338 Added failing test for composite foreign key persistance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2339</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of alex88:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/605&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/605&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;I&apos;ve added this test regarding ticket &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2338&quot; title=&quot;Entity with composite foreign keys identifiers should be persisted after related entities without exception&quot;&gt;DDC-2338&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14675">DDC-2339</key>
            <summary>[GH-605] DDC-2338 Added failing test for composite foreign key persistance</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Mar 2013 09:40:17 +0000</created>
                <updated>Thu, 9 May 2013 15:23:13 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="20246" author="beberlei" created="Thu, 9 May 2013 15:23:13 +0000"  >&lt;p&gt;This is documented behavior and would just be an improvement&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2337] Allow an entity to use its own persister to take advantage of DB level features if necessary</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2337</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a situation where I wanted a single table to use INSERT DELAYED. Its an audit log table where I expect each http request to generate many inserts for. In an effort to not over tax the system I implemented a custom Entity Persister so that it would work. This obviously doesn&apos;t work with all mapping drivers. However if this is a feature that you think is worth integrating I will fork it on github and complete the implementation alongside any changes/improvements requested...&lt;/p&gt;</description>
                <environment></environment>
            <key id="14672">DDC-2337</key>
            <summary>Allow an entity to use its own persister to take advantage of DB level features if necessary</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="gnat">Nathanael Noblet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Mar 2013 20:17:54 +0000</created>
                <updated>Wed, 6 Mar 2013 20:17:54 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11511" name="persister.patch" size="4366" author="gnat" created="Wed, 6 Mar 2013 20:17:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2321] DbDeploy Support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2321</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;ul&gt;
	&lt;li&gt;DbDeploy Diff Generation&lt;/li&gt;
	&lt;li&gt;Schema Serialization&lt;/li&gt;
	&lt;li&gt;SchemaTool gets new event when diff is applied, then you can update a &quot;stable&quot; schema xml. On Generation new db deploy script, use current schema vs stable schema vom disc.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14640">DDC-2321</key>
            <summary>DbDeploy Support</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Feb 2013 17:50:49 +0000</created>
                <updated>Wed, 27 Feb 2013 17:50:49 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2319] [GH-590] DQL Query: process ArrayCollection values to ease development</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2319</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of michaelperrin:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/590&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/590&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;I added some code to ease &quot;where in&quot; parameter binding.&lt;/p&gt;

&lt;p&gt;As you know, when a where condition is added, the object itself can be passed as a parameter and it&apos;s id is automatically retrieved:&lt;/p&gt;

&lt;p&gt;```php&lt;br/&gt;
$queryBuilder = $this&lt;br/&gt;
    -&amp;gt;where(&apos;model.category = :category&apos;)&lt;br/&gt;
    -&amp;gt;setParameter(&apos;category&apos;, $category)&lt;br/&gt;
;&lt;br/&gt;
```&lt;br/&gt;
Where `$category` is an object.&lt;/p&gt;

&lt;p&gt;But it doesn&apos;t work for collections:&lt;br/&gt;
```php&lt;br/&gt;
$queryBuilder = $this&lt;br/&gt;
    -&amp;gt;where(&apos;model.category IN (:categories)&apos;)&lt;br/&gt;
    -&amp;gt;setParameter(&apos;categories&apos;, $categories)&lt;br/&gt;
;&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;Where categories is an `ArrayCollection` object (retrieved from a many to one relation for instance).&lt;/p&gt;

&lt;p&gt;This doesn&apos;t work in the current version of Doctrine, and my PR solved that.&lt;/p&gt;

&lt;p&gt;So far, the only solution is to do the following:&lt;/p&gt;

&lt;p&gt;```php&lt;br/&gt;
$categoryIds = array();&lt;/p&gt;

&lt;p&gt;foreach ($categories as $category) &lt;/p&gt;
{
    $categoryIds[] = $category-&amp;gt;getId();
}

&lt;p&gt;$queryBuilder = $this&lt;br/&gt;
    -&amp;gt;where(&apos;model.category IN (:category_ids)&apos;)&lt;br/&gt;
    -&amp;gt;setParameter(&apos;category_ids&apos;, $categoryIds)&lt;br/&gt;
;&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;And this is pretty borring when you have to do it several times for several entities.&lt;/p&gt;

&lt;p&gt;Note that I didn&apos;t add any unit test for this feature. Can you explain me where I should add the test?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment></environment>
            <key id="14550">DDC-2319</key>
            <summary>[GH-590] DQL Query: process ArrayCollection values to ease development</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Feb 2013 16:03:47 +0000</created>
                <updated>Sat, 4 May 2013 12:52:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2316] [GH-588] ClassMetadataInfo: use reflection for creating new instance (on PHP &gt;=5.4)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2316</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of Majkl578:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/588&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/588&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;On PHP &amp;gt;=5.4, use proper way for instantiating classes without invoking constructor.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14545">DDC-2316</key>
            <summary>[GH-588] ClassMetadataInfo: use reflection for creating new instance (on PHP &gt;=5.4)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 23 Feb 2013 18:04:25 +0000</created>
                <updated>Sat, 4 May 2013 12:12:14 +0000</updated>
                                                    <fixVersion>3.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="20209" author="beberlei" created="Sat, 4 May 2013 12:12:14 +0000"  >&lt;p&gt;Scheduling this for 3.0, when we move to php 5.4 or higher requirement&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2313] Deep clone for DBAL QueryBuilder</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2313</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is basically a duplicate of another issue I stumbled across lately but cannot find here again. It added a __clone() function to the ORM QueryBuilder to allow this use case:&lt;br/&gt;
Create a base query and derive two different queries from it.&lt;/p&gt;

&lt;p&gt;I adopted the code for the DBAL QueryBuilder which is suffering the same issue (e.g. expressions were not cloned but shared between instances). The code is tested at least for my limited use case.&lt;/p&gt;


&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Deep clone of all expression objects in the SQL parts.&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@return void&lt;br/&gt;
     */&lt;br/&gt;
    public function __clone()&lt;br/&gt;
    {&lt;br/&gt;
        foreach ($this-&amp;gt;sqlParts as $part =&amp;gt; $elements) {&lt;br/&gt;
            if (is_array($this-&amp;gt;sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;$part&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
                foreach ($this-&amp;gt;sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;$part&amp;#93;&lt;/span&gt; as $idx =&amp;gt; $element) 
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {                    if (is_object($element)) {
                        $this-&amp;gt;sqlParts[$part][$idx] = clone $element;
                    }                }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;            } else if (is_object($elements)) &lt;/p&gt;
{
                $this-&amp;gt;sqlParts[$part] = clone $elements;
            }
&lt;p&gt;        }&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;        $params = array();&lt;/p&gt;

&lt;p&gt;        foreach ($this-&amp;gt;params as $param) &lt;/p&gt;
{
            $params[] = clone $param;
        }

&lt;p&gt;        $this-&amp;gt;params = $params;&lt;br/&gt;
    }&lt;/p&gt;</description>
                <environment></environment>
            <key id="14541">DDC-2313</key>
            <summary>Deep clone for DBAL QueryBuilder</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="tcm">Tim Mundt</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Feb 2013 22:33:34 +0000</created>
                <updated>Thu, 21 Feb 2013 22:33:34 +0000</updated>
                                    <version>2.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2305] [GH-584] QueryBuilder::addCriteria improvements</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2305</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of chEbba:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/584&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/584&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;1. Fix problem with different comparisons on the same field in QueryExpressonVisitor (now index value is added).&lt;br/&gt;
2. Add criteria field aliasing. Usually oject criteria has &quot;filed = value&quot; notation while DQL has &quot;alias.field = value&quot;.&lt;br/&gt;
First level fields are added with alias, second+ level fields (object.field, parent.object.field) are truncated to the second level (object.field) without alias. Alias map can be implemented in future.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14499">DDC-2305</key>
            <summary>[GH-584] QueryBuilder::addCriteria improvements</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Feb 2013 17:59:48 +0000</created>
                <updated>Tue, 19 Feb 2013 18:00:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19569" author="beberlei" created="Tue, 19 Feb 2013 18:00:03 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-584&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/584&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/584&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2295] [GH-580] Second cache level POC</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2295</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of FabioBatSilva:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/580&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/580&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Hi guys. &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;


&lt;p&gt;After a look into some implementations I end up with the following solution for the second level cache..&lt;/p&gt;

&lt;p&gt;There is lot of work todo before merge it, but i&apos;d like to get your thoughts before i go any further on this approach.&lt;br/&gt;
I hope my drafts are good enough to explain the idea :&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;Cache strategies&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;ul&gt;
	&lt;li&gt;READ_ONLY (DEFAULT)   : ReadOnly cache can do reads, inserts and deletes, cannot perform updates or employ any locks.&lt;/li&gt;
	&lt;li&gt;NONSTRICT_READ_WRITE  : Nonstrict Read Write Cache doesn&#8217;t employ any locks but can do reads, inserts , updates and deletes.&lt;/li&gt;
	&lt;li&gt;NONSTRICT_READ_WRITE  : Read Write cache employs locks the entity before update/delete.&lt;/li&gt;
&lt;/ul&gt;



&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;classes / interfaces&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;Region&lt;/b&gt;* :&lt;br/&gt;
    Defines a contract for accessing a entity/collection data cache. (Doesn&#8217;t employ any locks)&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;ConcurrentRegion&lt;/b&gt;* :&lt;br/&gt;
    Defines contract for concurrently managed data region. (Locks the data before update/delete.)&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;RegionAccess&lt;/b&gt;* :&lt;br/&gt;
    Defines a contract to access a cache region&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;ConcurrentRegionAccess&lt;/b&gt;* :&lt;br/&gt;
    Defines contract for regions which hold concurrently managed data.&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;CacheKey / EntityCacheKey / CollectionCacheKey/ QueryCacheKey&lt;/b&gt;*:&lt;br/&gt;
    Defines entity / collection key to be stored in the cache region.&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;EntityEntryStructure / CollectionEntryStructure&lt;/b&gt;*&lt;br/&gt;
    Build cache entries and rebuild entities/colection from cache&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;AccessProvider&lt;/b&gt;*&lt;br/&gt;
    Build RegionAccess based on entity / collection cache configuration&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Collection Caching&lt;/p&gt;




&lt;p&gt;The most common use case is to cache entities. But we can also cache relationships.&#160;&lt;br/&gt;
A &#8220;collection cache&#8221; caches the primary keys of entities that are members of a collection (OneToMany/ManyToMany).&#160;&lt;br/&gt;
and each element will be cached into its region.&lt;/p&gt;




&lt;p&gt;Only identifiers will be cached for collection. When a collection is read from the second level cache it will create proxies based on the cached identifiers, if the application needs to access an element, Doctrine will go to the cache to load the element data.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;OPERATIONS&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;INSERT :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;    *********************************************************************************************&lt;br/&gt;
    UnitOfWork#commit&lt;br/&gt;
        Connection#beginTransaction&lt;br/&gt;
        Persister#executeInserts&lt;br/&gt;
        Connection#commit&lt;br/&gt;
        Persister#afterTransactionComplete&lt;br/&gt;
            -&amp;gt; EntityRegionAccessStrategy#afterInsert&lt;br/&gt;
    *********************************************************************************************&lt;br/&gt;
    METHOD      | READ-ONLY             | NONSTRICT-READ-WRITE      | READ-WRITE                |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    afterInsert | add item to the cache | add item to the cache     | add item to the cache     |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;/p&gt;


&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;UPDATE :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;    *********************************************************************************************&lt;br/&gt;
    UnitOfWork#commit&lt;br/&gt;
        Connection#beginTransaction&lt;br/&gt;
        Persister#update&lt;br/&gt;
            -&amp;gt; TransactionalRegionAccess#lockItem&lt;br/&gt;
            -&amp;gt; execute&lt;br/&gt;
        Connection#commit&lt;br/&gt;
        Persister#afterTransactionComplete&lt;br/&gt;
            -&amp;gt; RegionAccess#afterUpdate&lt;br/&gt;
            -&amp;gt; TransactionalRegionAccess#unlockItem&lt;br/&gt;
    *********************************************************************************************&lt;br/&gt;
    METHOD      | READ-ONLY             | NONSTRICT-READ-WRITE      | READ-WRITE                |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    lockItem    |                       |                           | lock item                 |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    afterUpdate | throws exception      | update item cache         | update item cache         |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    unlockItem  |                       |                           | unlock item               |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;/p&gt;


&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;DELETE :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;    *********************************************************************************************&lt;br/&gt;
    UnitOfWork#commit&lt;br/&gt;
        Connection#beginTransaction&lt;br/&gt;
        Persister#delete&lt;br/&gt;
            -&amp;gt; TransactionalRegionAccess#lockItem&lt;br/&gt;
            -&amp;gt; execute&lt;br/&gt;
        Connection#commit&lt;br/&gt;
        Persister#afterTransactionComplete&lt;br/&gt;
            -&amp;gt; RegionAccess#evict&lt;br/&gt;
    *********************************************************************************************&lt;br/&gt;
    METHOD      | READ-ONLY             | NONSTRICT-READ-WRITE      | READ-WRITE                |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    lockItem    |                       |                           | lock item                 |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    evict       | remove item cache     | remove item cache         | remove item cache         |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;/p&gt;


&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;USAGE :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&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;
```php
&amp;lt;?php

/**
 * @Entity
 * @Cache(&lt;span class=&quot;code-quote&quot;&gt;&quot;NONSTRICT_READ_WRITE&quot;&lt;/span&gt;)
 */
class State
{
    /**
     * @Id
     * @GeneratedValue
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * @Column
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;
    /**
     * @Cache()
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Country&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;country_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; $country;
    /**
     * @Cache()
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;City&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;state&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $cities;
}
```

```php
&amp;lt;?php

$em-&amp;gt;persist(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; State($name, $country));
$em-&amp;gt;flush();                                &lt;span class=&quot;code-comment&quot;&gt;// Put into cache
&lt;/span&gt;
$em-&amp;gt;clear();                                &lt;span class=&quot;code-comment&quot;&gt;// Clear entity manager
&lt;/span&gt;
$state   = $em-&amp;gt;find(&apos;Entity\State&apos;, 1);     &lt;span class=&quot;code-comment&quot;&gt;// Retreive item from cache
&lt;/span&gt;$country = $state-&amp;gt;getCountry();             &lt;span class=&quot;code-comment&quot;&gt;// Retreive item from cache
&lt;/span&gt;$cities  = $state-&amp;gt;getCities();              &lt;span class=&quot;code-comment&quot;&gt;// Load from database and put into cache
&lt;/span&gt;
$state-&amp;gt;setName(&lt;span class=&quot;code-quote&quot;&gt;&quot;New Name&quot;&lt;/span&gt;);
$em-&amp;gt;persist($state);
$em-&amp;gt;flush();                                &lt;span class=&quot;code-comment&quot;&gt;// Update item cache
&lt;/span&gt;
$em-&amp;gt;clear();                                &lt;span class=&quot;code-comment&quot;&gt;// Clear entity manager
&lt;/span&gt;
$em-&amp;gt;find(&apos;Entity\State&apos;, 1)-&amp;gt;getCities();   &lt;span class=&quot;code-comment&quot;&gt;// Retreive from cache
&lt;/span&gt;

$em-&amp;gt;getCache()-&amp;gt;containsEntity(&apos;Entity\State&apos;, $state-&amp;gt;getId())  &lt;span class=&quot;code-comment&quot;&gt;// Check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the cache exists
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictEntity(&apos;Entity\State&apos;, $state-&amp;gt;getId());    &lt;span class=&quot;code-comment&quot;&gt;// Remove an entity from cache
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictEntityRegion(&apos;Entity\State&apos;);               &lt;span class=&quot;code-comment&quot;&gt;// Remove all entities from cache
&lt;/span&gt;
$em-&amp;gt;getCache()-&amp;gt;containsCollection(&apos;Entity\State&apos;, &apos;cities&apos;, $state-&amp;gt;getId());   &lt;span class=&quot;code-comment&quot;&gt;// Check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the cache exists        
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictCollection(&apos;Entity\State&apos;, &apos;cities&apos;, $state-&amp;gt;getId());      &lt;span class=&quot;code-comment&quot;&gt;// Remove an entity collection from cache
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictCollectionRegion(&apos;Entity\State&apos;, &apos;cities&apos;);                 &lt;span class=&quot;code-comment&quot;&gt;// Remove all collections from cache
&lt;/span&gt;
```
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;TODO :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
	&lt;li&gt;handle many to many collection&lt;/li&gt;
	&lt;li&gt;handle inheritance&lt;/li&gt;
	&lt;li&gt;remove/add colection items on update&lt;/li&gt;
	&lt;li&gt;improve region tests&lt;/li&gt;
	&lt;li&gt;improve access strategy tests&lt;/li&gt;
	&lt;li&gt;implement xml / yml / php drivers&lt;/li&gt;
	&lt;li&gt;implement transaction region&lt;/li&gt;
	&lt;li&gt;implement transaction  access strategy&lt;/li&gt;
	&lt;li&gt;.... ????&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14481">DDC-2295</key>
            <summary>[GH-580] Second cache level POC</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Feb 2013 01:01:12 +0000</created>
                <updated>Thu, 14 Mar 2013 21:36:42 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2290] Infer custom Types from the field for query parameters</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2290</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using a mapping Type that declares &lt;tt&gt;convertToDatabaseValue&lt;/tt&gt;, the method is not always called in queries.&lt;/p&gt;

&lt;p&gt;Example:&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;
SELECT ... WHERE entity.field = ?1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(with &lt;tt&gt;entity.field&lt;/tt&gt; being of custom type &apos;the_mapping_type&apos;)&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Type::convertToDatabaseValue()&lt;/tt&gt; is correctly called when using:&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;
$query-&amp;gt;setParameter(&apos;1&apos;, &apos;foo&apos;, &apos;the_mapping_type&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But it is not called when using:&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;
$query-&amp;gt;setParameter(&apos;1&apos;, &apos;foo&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which gives a query that returns invalid results.&lt;/p&gt;

&lt;p&gt;Like other mapping types in this situation, there is no reason the type is not inferred automatically from the field.&lt;/p&gt;

&lt;p&gt;I have written a failing test case in Doctrine\Tests\ORM\Functional\TypeValueSqlTest:&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;public&lt;/span&gt; function testQueryParameterWithoutType()
    {
        $entity = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CustomTypeUpperCase();
        $entity-&amp;gt;lowerCaseString = &apos;foo&apos;;

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($entity);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();

        $id = $entity-&amp;gt;id;

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();

        $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;SELECT c.id from Doctrine\Tests\Models\CustomType\CustomTypeUpperCase c where c.lowerCaseString = ?1&apos;);
        $query-&amp;gt;setParameter(&apos;1&apos;, &apos;foo&apos;);

        $result = $query-&amp;gt;getResult();

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertCount(1, $result);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($id, $result[0][&apos;id&apos;]);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14470">DDC-2290</key>
            <summary>Infer custom Types from the field for query parameters</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="mnapoli">Matthieu Napoli</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Feb 2013 11:36:49 +0000</created>
                <updated>Fri, 8 Feb 2013 12:54:06 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19494" author="mnapoli" created="Fri, 8 Feb 2013 11:38:48 +0000"  >&lt;p&gt;See also &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2224&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2224&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19495" author="mnapoli" created="Fri, 8 Feb 2013 12:54:06 +0000"  >&lt;p&gt;The test is in this branch: &lt;a href=&quot;https://github.com/myc-sense/doctrine2/tree/DDC-2290&quot; class=&quot;external-link&quot;&gt;https://github.com/myc-sense/doctrine2/tree/DDC-2290&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2275] [GH-568] Fixed plural variable names to singular when generating add or remove methods for entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2275</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of alexcarol:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/568&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/568&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Changed generateEntityStubMethod so that variable names in add or remove methods are singular too&lt;/p&gt;

&lt;p&gt;Edited tests for EntityGenerator so that variable names are checked too&lt;/p&gt;</description>
                <environment></environment>
            <key id="14454">DDC-2275</key>
            <summary>[GH-568] Fixed plural variable names to singular when generating add or remove methods for entities</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Feb 2013 01:47:46 +0000</created>
                <updated>Mon, 4 Feb 2013 01:47:46 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2264] Add support for custom Oracle SID / Service name in PDO_Oracle driver</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2264</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Some Oracle customer databases are set up having different settings for their &quot;DBNAME&quot; and &quot;SID&quot; / &quot;SERVICE&quot; property. (DBNAME != SID)&lt;/p&gt;

&lt;p&gt;So, hereing it&apos;s currently not possible to connect via the PDO_Oracle driver (Class: Doctrine\DBAL\Driver\PDOOracle\Driver) as it uses the DBNAME value by default as value for SID / SERVICE in the _constructPdoDsn() method. (DBNAME = SID)&lt;/p&gt;

&lt;p&gt;A solution would be to add an additional config param like &quot;servicename&quot; and pass it&apos;s value into _constructPdoDsn().&lt;/p&gt;

&lt;p&gt;An updated version of the method could look like:&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;private function _constructPdoDsn(array $params)&lt;br/&gt;
{&lt;br/&gt;
    $dsn = &apos;oci:&apos;;&lt;br/&gt;
    if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;host&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;host&amp;#39;&amp;#93;&lt;/span&gt; != &apos;&apos;) {&lt;br/&gt;
        $dsn .= &apos;dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)&apos; .&lt;br/&gt;
               &apos;(HOST=&apos; . $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;host&amp;#39;&amp;#93;&lt;/span&gt; . &apos;)&apos;;&lt;/p&gt;

&lt;p&gt;        if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;port&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
            $dsn .= &apos;(PORT=&apos; . $params[&apos;port&apos;] . &apos;)&apos;;
        }
&lt;p&gt; else &lt;/p&gt;
{
            $dsn .= &apos;(PORT=1521)&apos;;
        }

&lt;p&gt;		if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;servicename&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;servicename&amp;#39;&amp;#93;&lt;/span&gt; != &apos;&apos;)&lt;/p&gt;
		{
			$servicename	=	$params[&apos;servicename&apos;];
		}
&lt;p&gt;		else&lt;/p&gt;
		{
			$servicename	=	$params[&apos;dbname&apos;];
		}

&lt;p&gt;        if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;service&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;service&amp;#39;&amp;#93;&lt;/span&gt; == true) &lt;/p&gt;
{
            $dsn .= &apos;))(CONNECT_DATA=(SERVICE_NAME=&apos; . $servicename . &apos;)))&apos;;
        }
&lt;p&gt; else &lt;/p&gt;
{
            $dsn .= &apos;))(CONNECT_DATA=(SID=&apos; . $servicename . &apos;)))&apos;;
        }

&lt;p&gt;    } else &lt;/p&gt;
{
        $dsn .= &apos;dbname=&apos; . $params[&apos;dbname&apos;];
    }

&lt;p&gt;    if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;charset&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
        $dsn .= &apos;;charset=&apos; . $params[&apos;charset&apos;];
    }

&lt;p&gt;    return $dsn;&lt;br/&gt;
}&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;The only workaround for me is right now to use the &quot;standard&quot; PHP OCI / OCI8 functions with the correct SID / Service in it&apos;s DSN.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14430">DDC-2264</key>
            <summary>Add support for custom Oracle SID / Service name in PDO_Oracle driver</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="michl">Michl Schmid</reporter>
                        <labels>
                        <label>oracle</label>
                    </labels>
                <created>Tue, 29 Jan 2013 10:16:55 +0000</created>
                <updated>Tue, 29 Jan 2013 10:16:55 +0000</updated>
                                    <version>2.0</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2254] Exporting and restoring a query.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2254</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When you have a queryBuilder and you want to break it down using getDQLParts, You can&apos;t restore it by looping over the parts and adding them.&lt;/p&gt;

&lt;p&gt;This is what I am doing:&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;
$parts = $qb-&amp;gt;getDQLParts();

&lt;span class=&quot;code-comment&quot;&gt;// save the parts and use them in a different environment.
&lt;/span&gt;
$newQb = $em-&amp;gt;createQueryBuilder();
foreach ($parts as $name =&amp;gt; $part) {
  $newQb-&amp;gt;add($name, $part);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>OSX</environment>
            <key id="14406">DDC-2254</key>
            <summary>Exporting and restoring a query.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="nousefreak">Dries De Peuter</reporter>
                        <labels>
                        <label>dql</label>
                        <label>rebuild</label>
                        <label>restore</label>
                        <label>save</label>
                    </labels>
                <created>Wed, 23 Jan 2013 20:02:34 +0000</created>
                <updated>Sat, 4 May 2013 11:43:53 +0000</updated>
                                    <version>Git Master</version>
                <version>2.3.2</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19363" author="nousefreak" created="Wed, 23 Jan 2013 20:21:11 +0000"  >&lt;p&gt;I wrote a test showing the issue.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/NoUseFreak/doctrine2/commit/8574b79fd3d245532bbe7e310c5cbe083892057a&quot; class=&quot;external-link&quot;&gt;https://github.com/NoUseFreak/doctrine2/commit/8574b79fd3d245532bbe7e310c5cbe083892057a&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20205" author="beberlei" created="Sat, 4 May 2013 11:43:53 +0000"  >&lt;p&gt;This is not a bug, because restoring queries is not yet a feature of the QueryBuilder. Marking as possible improvement for future.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2249] Default value sequence </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2249</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I want to have a column on a table that by default it takes the value from a sequence.&lt;/p&gt;

&lt;p&gt;I&apos;ve tried to do something like this:&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ORM\Column(type=&quot;integer&quot;, unique=&quot;true&quot;)&lt;/li&gt;
	&lt;li&gt;@ORM\GeneratedValue(strategy=&quot;SEQUENCE&quot;)&lt;/li&gt;
	&lt;li&gt;@ORM\SequenceGenerator(sequenceName=&quot;seq_categorias&quot;, initialValue=1, allocationSize=100)&lt;br/&gt;
     */&lt;br/&gt;
    protected $id_categoria;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But this doesn&apos;t work, it creates de sequence but not the link between the table column and the sequence. Is there any possibility to do something like this? Or any autoincrement default value instead?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment>Symfony 2, linux</environment>
            <key id="14394">DDC-2249</key>
            <summary>Default value sequence </summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="mdev">Maria</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jan 2013 18:44:07 +0000</created>
                <updated>Sat, 19 Jan 2013 18:44:07 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2248] Expire result cache functionality not implemented</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2248</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;According to &lt;a href=&quot;https://doctrine-orm.readthedocs.org/en/latest/reference/dql-doctrine-query-language.html?highlight=expireResultCache&quot; class=&quot;external-link&quot;&gt;documentation&lt;/a&gt; expireResultCache, should force cache to update but it&apos;s not working... Why? Because functionality is not implemented. You can set _expireResultCache variable, but there is no place where this variable is being checked.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14393">DDC-2248</key>
            <summary>Expire result cache functionality not implemented</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nazin">Piotr Niziniecki</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jan 2013 17:25:33 +0000</created>
                <updated>Sat, 19 Jan 2013 17:40:44 +0000</updated>
                                    <version>2.3</version>
                <version>2.3.1</version>
                <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19336" author="ocramius" created="Sat, 19 Jan 2013 17:40:44 +0000"  >&lt;p&gt;A cache profile can be set and cleaned. I suppose that `expireResultCache` is an old piece of code that survived the refactoring. Should just be removed and documented accordingly&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2239] Allow dynamic modification of select queries (either filter the AST or query)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2239</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I had built and used the following for doctrine 1: &lt;a href=&quot;http://web.archive.org/web/20110705035547/http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/record-based-retrieval-security-template/en#record-based-retrieval-security-template&quot; class=&quot;external-link&quot;&gt;http://web.archive.org/web/20110705035547/http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/record-based-retrieval-security-template/en#record-based-retrieval-security-template&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;d like to build something similar for D2 based projects.&lt;/p&gt;

&lt;p&gt;ocramius in IRC suggested a bug report/Improvement request. Figured that perhaps a custom event &quot;dql_parse&quot; or &quot;ast_render&quot; passing the AST or Query as a parameter.&lt;/p&gt;

&lt;p&gt;I&apos;m under a tight timeline and am willing to pay for aid/feature implementation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14379">DDC-2239</key>
            <summary>Allow dynamic modification of select queries (either filter the AST or query)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="gnat">Nathanael Noblet</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jan 2013 22:03:46 +0000</created>
                <updated>Fri, 11 Jan 2013 22:03:46 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2223] unable to use scalar function when a scalar expression is expected</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2223</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;the DQL Parser don&apos;t parse properly functions when a ScalarExpression is needed like of all case functions.&lt;/p&gt;

&lt;p&gt;In fact first function token is interpreted as a T_IDENTIFIER and enter on line 1663 of Doctrine\ORM\Query\Parser class. in search of math operator, when not found this case considere that the token is a row element with no consid&#233;ration of the functions procession treated after.&lt;/p&gt;

&lt;p&gt;fix of this bug consist to enclose the line 1672 by a if (!$this-&amp;gt;_isFunction()).&lt;/p&gt;</description>
                <environment>(not affected by this bug)</environment>
            <key id="14349">DDC-2223</key>
            <summary>unable to use scalar function when a scalar expression is expected</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="alexises">Alexis Lameire</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Fri, 4 Jan 2013 13:21:34 +0000</created>
                <updated>Fri, 4 Jan 2013 13:21:34 +0000</updated>
                                    <version>Git Master</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2220] Add joins to Collection Filtering API</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2220</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The recently added collection filtering API only goes half way in achieving a full fledged solution to filter huge collections. It still lacks joins. Look at the next two snippets:&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;
    $criteria = Criteria::create()
        -&amp;gt;where(Criteria::expr()-&amp;gt;eq(&apos;storeId&apos;, $store-&amp;gt;getId()))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category&apos;, 20))
        -&amp;gt;orderBy(array(&apos;popularity&apos; =&amp;gt; &apos;DESC&apos;));
    &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;BrandCategories-&amp;gt;matching($criteria);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This piece of code works but what if there is a need to filter the BrandCategories collection by Categories with some extra criteria:&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;
    $criteria = Criteria::create()
        -&amp;gt;where(Criteria::expr()-&amp;gt;eq(&apos;storeId&apos;, $store-&amp;gt;getId()))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category&apos;, 20))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category.name&apos;, &apos;Electronics&apos;))
        -&amp;gt;orderBy(array(&apos;popularity&apos; =&amp;gt; &apos;DESC&apos;));
    &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;BrandCategories-&amp;gt;matching($criteria);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That would not work.&lt;/p&gt;

&lt;p&gt;Ideally we should have a possibility to join other entities, the Category entity in our case here:&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;
    $criteria = Criteria::create()
        -&amp;gt;where(Criteria::expr()-&amp;gt;eq(&apos;storeId&apos;, $store-&amp;gt;getId()))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category&apos;, 20))
        -&amp;gt;innerJoin(Criteria::expr()-&amp;gt;field(&apos;Category&apos;, &apos;Category&apos;))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category.name&apos;, &apos;Electronics&apos;))
        -&amp;gt;orderBy(array(&apos;popularity&apos; =&amp;gt; &apos;DESC&apos;));
    &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;BrandCategories-&amp;gt;matching($criteria);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What do you think about it, does it make sense to add such functionality?&lt;/p&gt;
</description>
                <environment></environment>
            <key id="14344">DDC-2220</key>
            <summary>Add joins to Collection Filtering API</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="deatheriam">Oleg Namaka</reporter>
                        <labels>
                        <label>api</label>
                        <label>collection</label>
                        <label>filtering</label>
                    </labels>
                <created>Thu, 3 Jan 2013 01:46:59 +0000</created>
                <updated>Thu, 3 Jan 2013 20:21:21 +0000</updated>
                                    <version>2.3.1</version>
                                                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2219] computeChangeSets array_merging for associationMappings problem ?</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2219</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Is this normal that when i call &quot;$changeset = $unitOfWork-&amp;gt;getEntityChangeSet($myObject);&quot;, it only return changes of root Object, all changes in sub collection (OneToMany) are less (not merging in the changeset) ?&lt;/p&gt;

&lt;p&gt;Is there an issue for that?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14343">DDC-2219</key>
            <summary>computeChangeSets array_merging for associationMappings problem ?</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="yohann.poli">yohann.poli</reporter>
                        <labels>
                        <label>unitofwork</label>
                    </labels>
                <created>Wed, 2 Jan 2013 15:42:17 +0000</created>
                <updated>Mon, 7 Jan 2013 08:52:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19207" author="ocramius" created="Wed, 2 Jan 2013 15:44:23 +0000"  >&lt;p&gt;Changesets of collections are computed separately from those of entities.&lt;/p&gt;</comment>
                    <comment id="19208" author="yohann.poli" created="Wed, 2 Jan 2013 16:34:33 +0000"  >&lt;p&gt;Have to call the compute method for each collection of the entity ?&lt;/p&gt;</comment>
                    <comment id="19221" author="beberlei" created="Sun, 6 Jan 2013 09:05:34 +0000"  >&lt;p&gt;Yes you have to, but this kind of operation seems weird. What are you trying to achieve.&lt;/p&gt;</comment>
                    <comment id="19243" author="yohann.poli" created="Mon, 7 Jan 2013 08:52:53 +0000"  >&lt;p&gt;I manage a complex entity who have a collection entity (each entity in this collection have another collection entity) attributes and i need to now if the flush method has &quot;really&quot; execute an update.&lt;/p&gt;

&lt;p&gt;For example if the level 3 entity is update, i have to know in the root entity all changes apply in child...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2217] Return a lazy collection from PersistentCollection::match($criteria)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2217</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In 2.3, &lt;tt&gt;PersistentCollection::match()&lt;/tt&gt; has been implemented by doing the query directly. But sometimes, the only meaningful information about the matched collection would be its length. In this case, it would be great to handle it in the same way than extra lazy collections are handled: the matched collection would be initialized lazily, and could do the count in an extra lazy way (if the original collection was extra lazy).&lt;br/&gt;
This would of course not change anything in the case where the original collection was already initialized.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14341">DDC-2217</key>
            <summary>Return a lazy collection from PersistentCollection::match($criteria)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Dec 2012 14:13:33 +0000</created>
                <updated>Thu, 28 Mar 2013 23:59:52 +0000</updated>
                                                                            <due></due>
                    <votes>4</votes>
                        <watches>3</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2214] extra single quotation in sql when using EntityRepository::findBy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2214</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m using symfony 2.1 with mysql.&lt;/p&gt;

&lt;p&gt;I have following code:&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;
$related = 
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDoctrine()-&amp;gt;getRepository(&apos;MyWebBundle:LineRelated&apos;)
-&amp;gt;findBy(array(&apos;line&apos; =&amp;gt; $lines), array(&apos;count&apos; =&amp;gt; &apos;DESC&apos;), 20);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;that generate the sql 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-sql&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; *
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; line_related t0 
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; t0.line_id IN (&apos;6059&apos;, 126352, &apos;5677&apos;, &apos;6058&apos;) 
ORDER &lt;span class=&quot;code-keyword&quot;&gt;BY&lt;/span&gt; t0.count DESC 
LIMIT 20
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;please notice that the sql has extra single quotation around the number 6059,5677 and 6058. which make the sql very slow.&lt;/p&gt;

&lt;p&gt;I did a test, when using single quotation,the sql takes 300ms,when using without single quotation,the sql takes 1 ms.&lt;/p&gt;


</description>
                <environment></environment>
            <key id="14333">DDC-2214</key>
            <summary>extra single quotation in sql when using EntityRepository::findBy</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="scourgen">scourgen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Dec 2012 07:53:00 +0000</created>
                <updated>Mon, 1 Apr 2013 21:50:27 +0000</updated>
                                                    <fixVersion>2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="19181" author="fabio.bat.silva" created="Wed, 26 Dec 2012 20:34:49 +0000"  >&lt;p&gt;Hi &lt;/p&gt;

&lt;p&gt;Could you please attach your entities or a failing test case ?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19182" author="scourgen" created="Thu, 27 Dec 2012 04:40:42 +0000"  >&lt;p&gt;sure&lt;/p&gt;

&lt;p&gt;LineRelated.php :&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 LineRelated
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
     &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /**
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Line&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;line_related&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;line_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;,nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
     &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $line;
     
    /**
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;line_id_related&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $line_related;

    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;,nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
     &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $count = 0;

###### get/set etc....... #######
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Line.php&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 Line
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
########## blablabla #############

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;my action:&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;public&lt;/span&gt; function right_line_relatedAction($line = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $title=&apos;&#30456;&#20851;&#32447;&#36335;&apos;)
    {

        $lines = $l-&amp;gt;getByUser($user, array());
&lt;span class=&quot;code-comment&quot;&gt;//anyway,$lines is an array,It has several elements,each element is an instance of LineEntity.
&lt;/span&gt;
        $related = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDoctrine()-&amp;gt;getRepository(&apos;MyWebBundle:LineRelated&apos;)-&amp;gt;findBy(array(&apos;line&apos; =&amp;gt; $lines), array(&apos;count&apos; =&amp;gt; &apos;DESC&apos;), 20);
&lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; findBy function generate the sql which is slow.
&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $related;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19184" author="fabio.bat.silva" created="Thu, 27 Dec 2012 19:41:37 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;How did you get this query string ?&lt;/p&gt;

&lt;p&gt;Repository#findBy does not quote the values,  It uses PDO:bindParam.&lt;br/&gt;
so the expected query string should be someting like : &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;
WHERE t0.line_id IN (?, ? ,?) 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I tried to reproduce but in my tests the generated Query binds the parameters as  &quot;PDO::PARAM_INT&quot;.&lt;/p&gt;

&lt;p&gt;I have added a test case. &lt;br/&gt;
Could you please can try to change it and make fails.&lt;/p&gt;


&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19185" author="scourgen" created="Fri, 28 Dec 2012 06:02:41 +0000"  >&lt;p&gt;reproduced :&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;
SELECT t0.id AS id1, t0.line_id_related AS line_id_related2, t0.count AS count3, t0.line_id AS line_id4 FROM line_related t0 WHERE t0.line_id IN (&apos;6059&apos;, 4851, &apos;6068&apos;, 126352, &apos;6060&apos;, &apos;1000000&apos;) ORDER BY t0.count DESC LIMIT 20
Parameters: [[&apos;6059&apos;, 4851, &apos;6068&apos;, 126352, &apos;6060&apos;, &apos;1000000&apos;]] 
[Hide runnable query]
Time: 234.53 ms [   Explain query ]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;let me have a look on what&apos;s going on&lt;/p&gt;</comment>
                    <comment id="19186" author="scourgen" created="Fri, 28 Dec 2012 06:10:15 +0000"  >&lt;p&gt;interesting. I&apos;ve dump(using ladybug_dump) the $lines,and I found out that when the element is a Proxies Object(Object(Proxies&amp;#95;&lt;em&gt;GC&lt;/em&gt;_\My\WebBundle\Entity\Line)),then the id of that Object will be with quoted,when the elememt is an Real Entity,then It will be without quote.&lt;/p&gt;

&lt;p&gt;for example,in my last comment, the parameters is [&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;6059&amp;#39;, 4851, &amp;#39;6068&amp;#39;, 126352, &amp;#39;6060&amp;#39;, &amp;#39;1000000&amp;#39;&amp;#93;&lt;/span&gt;] &lt;br/&gt;
the result of dumping $lines is :&lt;/p&gt;

&lt;p&gt;array(6)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;: object(Proxies&amp;#95;&lt;em&gt;CG&lt;/em&gt;_\Zuo\WebBundle\Entity\Line)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;: object(Zuo\WebBundle\Entity\Line)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;: object(Proxies&amp;#95;&lt;em&gt;CG&lt;/em&gt;_\Zuo\WebBundle\Entity\Line)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt;: object(Zuo\WebBundle\Entity\Line)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;4&amp;#93;&lt;/span&gt;: object(Proxies&amp;#95;&lt;em&gt;CG&lt;/em&gt;_\Zuo\WebBundle\Entity\Line)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;5&amp;#93;&lt;/span&gt;: object(Proxies&amp;#95;&lt;em&gt;CG&lt;/em&gt;_\Zuo\WebBundle\Entity\Line)&lt;/p&gt;

&lt;p&gt;tell me if you need more information. thanks&lt;/p&gt;</comment>
                    <comment id="19188" author="ocramius" created="Fri, 28 Dec 2012 09:16:41 +0000"  >&lt;p&gt;This may be because &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;$_identifier&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; in proxies ( &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/42e83a2716d19eada4f1cd49ece77d5f5229a239/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L383&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/42e83a2716d19eada4f1cd49ece77d5f5229a239/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L383&lt;/a&gt; ) is not necessarily composed by integers. This could be fixed with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DCOM-96&quot; title=&quot;Extract a common ProxyFactory&quot;&gt;&lt;del&gt;DCOM-96&lt;/del&gt;&lt;/a&gt;. I&apos;ll add the tests to my development branch and will ping you back tomorrow &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>
                    <comment id="19190" author="scourgen" created="Fri, 28 Dec 2012 11:02:46 +0000"  >&lt;p&gt;thanks&lt;/p&gt;</comment>
                    <comment id="19236" author="ocramius" created="Sun, 6 Jan 2013 14:24:42 +0000"  >&lt;p&gt;I see what is going on here... But this should not be a problem anyway, since they&apos;re bound anyway as  &quot;PDO::PARAM_INT&quot;, as &lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=fabio.bat.silva&quot; class=&quot;user-hover&quot; rel=&quot;fabio.bat.silva&quot;&gt;Fabio B. Silva&lt;/a&gt; told you.&lt;/p&gt;

&lt;p&gt;That&apos;s only a problem with the logger showing them as string. PDO will handle the conversion before the value hits the DB as far as I know.&lt;/p&gt;</comment>
                    <comment id="19241" author="scourgen" created="Mon, 7 Jan 2013 03:48:30 +0000"  >&lt;p&gt;I can understand your point,but what I don&apos;t really get is that the execute time of sql is very long,that explained the quote should be in the sql,not like what you said,that&apos;s only a problem with the logger.&lt;/p&gt;</comment>
                    <comment id="19242" author="ocramius" created="Mon, 7 Jan 2013 06:56:16 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=scourgen&quot; class=&quot;user-hover&quot; rel=&quot;scourgen&quot;&gt;scourgen&lt;/a&gt; can you profile the difference directly in CLI? What about checking the bound parameter type? Are those values bound as INTs in your case?&lt;/p&gt;</comment>
                    <comment id="19244" author="scourgen" created="Mon, 7 Jan 2013 08:53:28 +0000"  >&lt;p&gt;@ocramius I wish I could, but I was using doctrine2 with symfony2,So It looks like It will takes some time to simulating all environment and settings that could allow me to reproduced the problem.&lt;/p&gt;

&lt;p&gt;but anyway,I will have a try and tell you what happen when I found something.&lt;/p&gt;</comment>
                    <comment id="19245" author="ocramius" created="Mon, 7 Jan 2013 08:58:19 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=scourgen&quot; class=&quot;user-hover&quot; rel=&quot;scourgen&quot;&gt;scourgen&lt;/a&gt; ok, awaiting your reply then&lt;/p&gt;</comment>
                    <comment id="19248" author="scourgen" created="Mon, 7 Jan 2013 17:48:04 +0000"  >&lt;p&gt;I&apos;ve spent some time on playing with native doctrine2. It took me awhile to setup everything. but I just don&apos;t get that how to retrive data with its Proxy ojbect(for example Proxies_CG_\My\WebBundle\Entity\Line).&lt;/p&gt;

&lt;p&gt;I mean the result of &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;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getRepository(&lt;span class=&quot;code-quote&quot;&gt;&quot;something&quot;&lt;/span&gt;)-&amp;gt;findxxx()&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; always return an array of real object. I can&apos;t reproduced the situation(#comment-19186) that happens on symfony2+doctrine2.&lt;/p&gt;

&lt;p&gt;anyway,I can make sure the problem is real exist,Because the execute time of that slow sql from the tool bar of symfony2 is same as I executed it at mysql cli. If the sql shows up on log with quote but running at mysql without quote,the execute time won&apos;t be same(actually It will be much more faster,in my case,20x times,from 2xxms to 10ms).&lt;/p&gt;
</comment>
                    <comment id="19250" author="ocramius" created="Mon, 7 Jan 2013 19:23:52 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=scourgen&quot; class=&quot;user-hover&quot; rel=&quot;scourgen&quot;&gt;scourgen&lt;/a&gt; you can use &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;$em-&amp;gt;getReference($className, $identifier)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; (identifier being a key=&amp;gt;value array) to force proxies.&lt;/p&gt;

&lt;p&gt;Give it a try &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>
                    <comment id="19254" author="scourgen" created="Tue, 8 Jan 2013 04:27:34 +0000"  >&lt;p&gt;looks like I reproduced it.&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;public&lt;/span&gt; function testIssue()
    {   
         $no_used=   $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getRepository(__NAMESPACE__. &apos;\DDC2214Line&apos;)-&amp;gt;findOneById(1);
        $lines=array(
            &lt;span class=&quot;code-comment&quot;&gt;//$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getRepository(__NAMESPACE__. &apos;\DDC2214Line&apos;)-&amp;gt;findOneById(1),
&lt;/span&gt;            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getReference(__NAMESPACE__. &apos;\DDC2214Line&apos;,1),
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getReference(__NAMESPACE__. &apos;\DDC2214Line&apos;,&apos;2&apos;),
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getReference(__NAMESPACE__. &apos;\DDC2214Line&apos;,3),
        );  
        $logger  = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getConnection()-&amp;gt;getConfiguration()-&amp;gt;getSQLLogger();
        $ids     = array_map(function($r){
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $r-&amp;gt;id;
        }, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;relatedList);

        &lt;span class=&quot;code-comment&quot;&gt;//$related = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getRepository(__NAMESPACE__ . &apos;\DDC2214LineRelated&apos;)-&amp;gt;findBy(array(&apos;line&apos; =&amp;gt; $lines), array(&apos;count&apos; =&amp;gt; &apos;DESC&apos;), 20);
&lt;/span&gt;        $related = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;select lr from &apos;.__NAMESPACE__ . &apos;\DDC2214LineRelated lr where lr.id in (:ids)&apos;)-&amp;gt;setParameter(&apos;ids&apos;,$lines)-&amp;gt;getResult();
            
        $query   = end($logger-&amp;gt;queries);
&lt;span class=&quot;code-comment&quot;&gt;//\Doctrine\Common\Util\Debug::dump($query[&apos;params&apos;]);
&lt;/span&gt;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertCount(3, $related);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($ids, $query[&apos;params&apos;][0]);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(\Doctrine\DBAL\Connection::PARAM_INT_ARRAY, $query[&apos;types&apos;][0]);
    }   
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I use MySql Query log to see what&apos;s really happen in database(&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/query-log.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.5/en/query-log.html&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;this is the log from table mysql.general_log&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;
2013-01-08 12:23:44	[root] @ localhost [127.0.0.1]	59	0	Connect	root@localhost on doctrine_tests
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	CREATE TABLE DDC2214Line (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	CREATE TABLE DDC2214LineRelated (id INT AUTO_INCREMENT NOT NULL, line_id INT NOT NULL, count SMALLINT NOT NULL, line_id_related INT NOT NULL, INDEX IDX_D31307994D7B7542 (line_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	ALTER TABLE DDC2214LineRelated ADD CONSTRAINT FK_D31307994D7B7542 FOREIGN KEY (line_id) REFERENCES DDC2214Line (id)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	START TRANSACTION
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	INSERT INTO DDC2214Line (id) VALUES (&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	INSERT INTO DDC2214Line (id) VALUES (&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	INSERT INTO DDC2214Line (id) VALUES (&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	INSERT INTO DDC2214LineRelated (count, line_id_related, line_id) VALUES (1, 1, 1)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	INSERT INTO DDC2214LineRelated (count, line_id_related, line_id) VALUES (2, 2, 2)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	INSERT INTO DDC2214LineRelated (count, line_id_related, line_id) VALUES (3, 3, 3)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	COMMIT
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	SELECT t0.id AS id1 FROM DDC2214Line t0 WHERE t0.id = 1 LIMIT 1
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Query	SELECT d0_.id AS id0, d0_.count AS count1, d0_.line_id_related AS line_id_related2, d0_.line_id AS line_id3 FROM DDC2214LineRelated d0_ WHERE d0_.id IN (1, &apos;2&apos;, 3)
2013-01-08 12:23:44	root[root] @ localhost [127.0.0.1]	59	0	Quit	
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;you can see,in database level,the second parameter of last query but two has quote (  (1, &apos;2&apos;, 3)  )&lt;/p&gt;</comment>
                    <comment id="19410" author="beberlei" created="Fri, 25 Jan 2013 16:25:25 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-247&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/common/pull/247&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/247&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19424" author="beberlei" created="Sat, 26 Jan 2013 23:53:36 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-247&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/common/pull/247&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/247&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11366" name="DDC2214Test.php" size="3004" author="fabio.bat.silva" created="Thu, 27 Dec 2012 19:41:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2213] Paginator does not work with composite primary key entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2213</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Paginator does not work with composed primary key.&lt;/p&gt;

&lt;p&gt;&quot;Single id is not allowed on composite primary key in entity&quot; exception is thrown here &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php#L90&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php#L90&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Only first column values are fetched while retrieving primary keys here&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/Paginator.php#L173&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/Paginator.php#L173&lt;/a&gt;&lt;/p&gt;</description>
                <environment>php 5.4</environment>
            <key id="14332">DDC-2213</key>
            <summary>Paginator does not work with composite primary key entity</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="thestanislav">Stanislav Anisimov</reporter>
                        <labels>
                        <label>composed</label>
                        <label>key</label>
                        <label>paginator</label>
                    </labels>
                <created>Tue, 25 Dec 2012 13:24:27 +0000</created>
                <updated>Wed, 23 Jan 2013 21:20:21 +0000</updated>
                                    <version>2.3.1</version>
                                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="19369" author="ocramius" created="Wed, 23 Jan 2013 21:20:21 +0000"  >&lt;p&gt;Limitation was confused by issue reporter and considered bug&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2210] PHP warning in ProxyFactory when renaming proxy file</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2210</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Getting a PHP Warning: &lt;/p&gt;

&lt;p&gt;&lt;tt&gt;rename(**&lt;b&gt;/models/Proxies&amp;#95;&lt;em&gt;CG&lt;/em&gt;&lt;em&gt;AF_Model_Component_Group.php.50d2dd2c079bb9.35271255,&lt;/b&gt;**/models/Proxies&amp;#95;_CG&lt;/em&gt;_AF_Model_Component_Group.php):&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;in &lt;tt&gt;ProxyFactory&lt;/tt&gt; line 194.&lt;/p&gt;

&lt;p&gt;I haven&apos;t more information in the warning.&lt;/p&gt;

&lt;p&gt;This is the moment when the ProxyFactory writes the proxy to a temporary file and then tries to rename the temp file to the correct file.&lt;/p&gt;

&lt;p&gt;This warning appears randomly, but mostly on pages with lots of concurrent AJAX requests. I guess this happens because several requests try to write the proxy file at the same time. I get this warning but the app works fine.&lt;/p&gt;

&lt;p&gt;This happens in dev environment, on a Windows machine.&lt;/p&gt;


&lt;p&gt;I don&apos;t know why rename generates a warning, it should just return false... The &lt;a href=&quot;http://fr2.php.net/manual/en/function.rename.php&quot; class=&quot;external-link&quot;&gt;doc&lt;/a&gt; doesn&apos;t say anything about warnings (except for long file names, but I checked even with the full path this is around 135 characters, not 255).&lt;/p&gt;</description>
                <environment>Windows</environment>
            <key id="14329">DDC-2210</key>
            <summary>PHP warning in ProxyFactory when renaming proxy file</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="mnapoli">Matthieu Napoli</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Dec 2012 10:02:50 +0000</created>
                <updated>Thu, 28 Mar 2013 15:51:48 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19171" author="beberlei" created="Sat, 22 Dec 2012 12:04:44 +0000"  >&lt;p&gt;Thats why you shouldn&apos;t generate proxies at runtime. The problem happens on windows, because the atomic rename operation doesn&apos;t work as perfectly there as on linux.&lt;/p&gt;

&lt;p&gt;We cannot fix this in Doctrine.&lt;/p&gt;</comment>
                    <comment id="19180" author="mnapoli" created="Mon, 24 Dec 2012 10:38:46 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt; What do you mean &quot;you shouldn&apos;t generate proxies at runtime&quot;? I&apos;m not in production, this is in dev. And I&apos;m using the default configuration.&lt;/p&gt;

&lt;p&gt;What I don&apos;t understand is why will Doctrine regenerate proxies on every request? The warning is reproductible, and even when no PHP entity has been touched.&lt;/p&gt;</comment>
                    <comment id="19183" author="mnapoli" created="Thu, 27 Dec 2012 13:44:22 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt; To simplify my previous message (I don&apos;t want to bury you under questions) I&apos;ll sum it up like that:&lt;/p&gt;

&lt;p&gt;What can I do?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="19772" author="mnapoli" created="Thu, 28 Feb 2013 13:03:37 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt; ping: what can be done?&lt;/p&gt;

&lt;p&gt;Can we suppress the error with &lt;tt&gt;@rename($tmpFileName, $fileName);&lt;/tt&gt; ?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L287&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L287&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can make a PR if you think that&apos;s a valid solution.&lt;/p&gt;</comment>
                    <comment id="19773" author="ocramius" created="Thu, 28 Feb 2013 13:06:43 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=matthieu&quot; class=&quot;user-hover&quot; rel=&quot;matthieu&quot;&gt;Matthieu Napoli&lt;/a&gt; no, if you have warnings, please disable them via ini setting. With error suppression there, we may have further problems identifying more serious issues.&lt;/p&gt;

&lt;p&gt;About proxy generation: that happens EVERY time in dev environments. Generate them once and disable it afterwards.&lt;/p&gt;</comment>
                    <comment id="19774" author="mnapoli" created="Thu, 28 Feb 2013 13:30:13 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=ocramius&quot; class=&quot;user-hover&quot; rel=&quot;ocramius&quot;&gt;Marco Pivetta&lt;/a&gt; OK I can disable the auto generation then (I&apos;ll have to remember to regenerate them when I edit the model).&lt;/p&gt;

&lt;p&gt;Thanks for the feedback&lt;/p&gt;

&lt;p&gt;Is that possible to make those proxies generate only if the entity file has been modified since the last generation? (only asking if can and should be done, I can look for implementing it myself if that&apos;s the case)&lt;/p&gt;</comment>
                    <comment id="19775" author="ocramius" created="Thu, 28 Feb 2013 13:33:19 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=mnapoli&quot; class=&quot;user-hover&quot; rel=&quot;mnapoli&quot;&gt;Matthieu Napoli&lt;/a&gt; that would be very obnoxious when changing entities often. I wouldn&apos;t do that (generating only if not already available)&lt;/p&gt;</comment>
                    <comment id="19776" author="mnapoli" created="Thu, 28 Feb 2013 13:57:38 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=ocramius&quot; class=&quot;user-hover&quot; rel=&quot;ocramius&quot;&gt;Marco Pivetta&lt;/a&gt; Yes but for now they are regenerated at every request when in dev mode (at least with the default configuration &lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html#obtaining-an-entitymanager&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html#obtaining-an-entitymanager&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Which one is worse: generating every proxy class at every request, or generate only those which changed (in dev environment of course, not prod)?&lt;/p&gt;

&lt;p&gt;If neither of these options are good (i.e. auto generation should be disabled), I don&apos;t understand why the docs say to enable auto generation when in dev environment.&lt;/p&gt;</comment>
                    <comment id="19777" author="ocramius" created="Thu, 28 Feb 2013 14:27:35 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=mnapoli&quot; class=&quot;user-hover&quot; rel=&quot;mnapoli&quot;&gt;Matthieu Napoli&lt;/a&gt; that&apos;s because in dev environments you shouldn&apos;t care about that one exception (usually happens when you got concurrent requests). &lt;/p&gt;

&lt;p&gt;It is worse to generate only on changes: that&apos;s a lot of additional checks, variables to keep in memory and additional logic that is not needed.&lt;/p&gt;

&lt;p&gt;Let&apos;s keep it as it is (generating at each request) for dev environments: works fine &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;

&lt;p&gt;Another (eventual) solution for dev environments would be not to write the proxy file, but to eval it.&lt;/p&gt;</comment>
                    <comment id="19782" author="mnapoli" created="Thu, 28 Feb 2013 15:19:31 +0000"  >&lt;p&gt;eval it would be a good solution IMO, no more &quot;woops the directory is not writable&quot; and it&apos;s more neutral for the user filesystem (but not as easy to debug). But OK, I see what you mean, it works let&apos;s keep it that way.&lt;/p&gt;

&lt;p&gt;Actually the problem on my setup is that PHP errors are turned into exceptions, so on an (poorly designed) AJAX treeview (lots of nodes to load =&amp;gt; lots of requests), I end up with some nodes not loaded because of the exception. And it feels weird to either silently log all PHP warnings or silently ignore the specific warning for the rename.&lt;/p&gt;</comment>
                    <comment id="19783" author="ocramius" created="Thu, 28 Feb 2013 15:26:37 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=mnapoli&quot; class=&quot;user-hover&quot; rel=&quot;mnapoli&quot;&gt;Matthieu Napoli&lt;/a&gt; I&apos;d go with `eval` then. Needs refactoring of the abstract proxy factory and of the proxy generator (proxy generator should no longer write files).&lt;/p&gt;</comment>
                    <comment id="19784" author="ocramius" created="Thu, 28 Feb 2013 15:28:30 +0000"  >&lt;p&gt;Re-opening: the proxy factory could directly `eval()` the produced proxy code. The ProxyGenerator should no longer write the generated files to disk automatically.&lt;/p&gt;</comment>
                    <comment id="19901" author="mnapoli" created="Thu, 28 Mar 2013 15:51:48 +0000"  >&lt;p&gt;I&apos;ve opened a PR: &lt;a href=&quot;https://github.com/doctrine/common/pull/269&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/269&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2208] CASE WHEN ... WHEN doesn&apos;t work</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2208</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Having the following part in select DQL throws an exception.&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-sql&quot;&gt;
SUM(CASE
            WHEN c.startDate &amp;lt;= :start THEN c.endDate - :start
            WHEN c.endDate &amp;gt;= :end THEN :end - c.startDate
            ELSE 0
            END) 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;exception:&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;
[Syntax Error] line 0, col 124: Error: Expected Doctrine\ORM\Query\Lexer::T_ELSE, got &apos;-&apos; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It seems that it&apos;s failing inside the second THEN&lt;/p&gt;

&lt;p&gt;This one also seems to fail:&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-sql&quot;&gt;
SUM(CASE
            WHEN c.startDate &amp;lt;= :start THEN (c.endDate - :start)
            WHEN c.endDate &amp;gt;= :end THEN (:end - c.startDate)
            ELSE 0
            END) 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;exception:&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;
[Syntax Error] line 0, col 60: Error: Unexpected &apos;(&apos; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Another one:&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-sql&quot;&gt;
SUM(CASE
                WHEN c.startDate &amp;lt;= :start THEN c.endDate - :start
                WHEN c.endDate &amp;gt;= :end THEN :end - c.startDate
                ELSE 0
                END) = :result &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;exception:&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;
[Syntax Error] line 0, col 60: Error: Expected Doctrine\ORM\Query\Lexer::T_FROM, got &apos;=&apos; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14325">DDC-2208</key>
            <summary>CASE WHEN ... WHEN doesn&apos;t work</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Dec 2012 23:44:17 +0000</created>
                <updated>Tue, 8 Jan 2013 21:07:23 +0000</updated>
                                    <version>2.3.1</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19160" author="mvrhov" created="Thu, 20 Dec 2012 17:19:55 +0000"  >&lt;p&gt;I&apos;ve added two more cases where the parsing fails. Do you want a separate tickets for that?&lt;/p&gt;</comment>
                    <comment id="19161" author="fabio.bat.silva" created="Thu, 20 Dec 2012 17:51:25 +0000"  >&lt;p&gt;Don&apos;t worry, I&apos;ll spend some time over this...&lt;br/&gt;
But I&apos;m not sure about the last one. &lt;/p&gt;</comment>
                    <comment id="19162" author="mvrhov" created="Thu, 20 Dec 2012 18:09:40 +0000"  >&lt;p&gt;The 3rd case seems work just fine as a part of a HAVING clause.&lt;br/&gt;
I haven&apos;t tried it but It might be that it fails with something simpler like SELECT COUNT( * ) = :foo FROM ... or SELECT COUNT( * ) = 2 FROM ...&lt;/p&gt;</comment>
                    <comment id="19259" author="mvrhov" created="Tue, 8 Jan 2013 20:04:28 +0000"  >&lt;p&gt;Fabio I have two more...&lt;br/&gt;
It doesn&apos;t like NULL and subselect after then part&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; 
-&amp;gt;addSelect(&apos;CASE
    WHEN po.quantity IS NULL THEN NULL
    ELSE po.quantity -
            COALESCE(0, (
                SELECT COUNT(rd.product) FROM xxxx rd
                    WHERE (rd.startDate &amp;lt;= :end) AND (rd.endDate &amp;gt;= :start) AND
                        rd.product = c.product)))
    END
    AS po.quantity
&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;:edit replaced with real query &lt;/p&gt;</comment>
                    <comment id="19260" author="mvrhov" created="Tue, 8 Jan 2013 20:13:42 +0000"  >&lt;p&gt;addon: well the subquery part can be full query with joins ....&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2193] Named native query bug?</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2193</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;@NamedNativeQueries is a useful thing, but I have found some problems during my using.&lt;br/&gt;
1&#12289;Normal&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;
 /**
 * @NamedNativeQueries({
 *      @NamedNativeQuery(
 *          name            = &lt;span class=&quot;code-quote&quot;&gt;&quot;fetchMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          resultSetMapping= &lt;span class=&quot;code-quote&quot;&gt;&quot;mappingMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          query            = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT * FROM test &quot;&lt;/span&gt;
 *      )
 * })
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;2&#12289;Error&#65292;cannot connect to the server&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;
 /**
 * @NamedNativeQueries({
 *      @NamedNativeQuery(
 *          name            = &lt;span class=&quot;code-quote&quot;&gt;&quot;fetchMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          resultSetMapping= &lt;span class=&quot;code-quote&quot;&gt;&quot;mappingMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          query            = &quot;SELECT * 
            FROM test &quot;
 *      )
 * })
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;3&#12289;Cannot use alias.The same problem as the second one.&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;
.......
 query            = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a as test FROM test &quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14303">DDC-2193</key>
            <summary>Named native query bug?</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="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dingdangjyz">dingdangjyz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Dec 2012 01:43:00 +0000</created>
                <updated>Mon, 31 Dec 2012 04:02:50 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19125" author="fabio.bat.silva" created="Wed, 12 Dec 2012 13:56:30 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;Doctrine does not change the native query at all&lt;br/&gt;
The problem seems related with database connection.&lt;/p&gt;

&lt;p&gt;Could you provide more details please?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19127" author="dingdangjyz" created="Thu, 13 Dec 2012 01:12:44 +0000"  >&lt;p&gt;Doctrine\Common\Lexer.php&lt;/p&gt;

&lt;p&gt;Hello, after checking&#65292; I found the problem should be here. As long as SQL wrap, or fill in alias, it will be error. It seems to be the preg_split problem?&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;
        $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE;
        $matches = preg_split($regex, $input, -1, $flags);

        foreach ($matches as $match) {
            &lt;span class=&quot;code-comment&quot;&gt;// Must remain before &apos;value&apos; assignment since it can change content
&lt;/span&gt;            $type = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getType($match[0]);

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tokens[] = array(
                &apos;value&apos; =&amp;gt; $match[0],
                &apos;type&apos;  =&amp;gt; $type,
                &apos;position&apos; =&amp;gt; $match[1],
            );
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19128" author="fabio.bat.silva" created="Thu, 13 Dec 2012 10:59:21 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;Could you try to add a failing test case please ?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19133" author="dingdangjyz" created="Fri, 14 Dec 2012 02:06:21 +0000"  >&lt;p&gt;xp php5.3.8 Apache&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;
&amp;lt;?php

namespace Models\Entities;

/**
 * @Entity
 * @Table
 *
 * @NamedNativeQueries({
 *      @NamedNativeQuery(
 *          name             = &lt;span class=&quot;code-quote&quot;&gt;&quot;find-hotel-item&quot;&lt;/span&gt;,
 *          resultSetMapping = &lt;span class=&quot;code-quote&quot;&gt;&quot;mapping-find-item&quot;&lt;/span&gt;,
 *          query            = &quot;SELECT Top 1 VEI_SN AS SN 
            FROM tourmanager.dbo.VEndorInfo vi 
INNER JOIN tourmanager.dbo.VEndorInfo2 vi2 ON 
vi.VEI_SN = vi2.VEI2_VEI_SN LEFT OUTER JOIN tourmanager.dbo.HotelInfo hi 
ON hi.hotelid = vi2.VEI2_VEI_SN INNER JOIN tourmanager.dbo.HotelInfo2 
hi2 ON hi2.hotelid = vi2.VEI2_VEI_SN AND hi2.LGC = 1 &quot;
 *      )
 * })
 *
 * @SqlResultSetMappings({
 *      @SqlResultSetMapping(
 *          name    = &lt;span class=&quot;code-quote&quot;&gt;&quot;mapping-find-item&quot;&lt;/span&gt;,
 *          entities= {
 *              @EntityResult(
 *                  entityClass = &lt;span class=&quot;code-quote&quot;&gt;&quot;HTHotelItem&quot;&lt;/span&gt;,
 *                  fields = {
 *                      @FieldResult(name = &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;,   column=&lt;span class=&quot;code-quote&quot;&gt;&quot;SN&quot;&lt;/span&gt;)
 *                  }
 *              )
 *          }
 *      )
 * })
 *
 */

class HTHotelItem{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
        
    /** @name */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;
    
    /** @city */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city;
    
    /** @url */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $url;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata){
        $metadata-&amp;gt;addNamedNativeQuery(array(
            &apos;name&apos;              =&amp;gt; &apos;find-hotel-item&apos;,
            &apos;query&apos;             =&amp;gt; &apos;SELECT h FROM HTHotelItem h&apos;,
            &apos;resultSetMapping&apos;  =&amp;gt; &apos;\\Models\\Entities\\HTHotelItem&apos;
        ));
    }
    
    function getId(){
        &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;id;
    }
    
    function getName(){
        &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;name;
    }
    
    function getCity(){
        &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;city;
    }
    
    function getUrl(){
        &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;url;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19134" author="dingdangjyz" created="Fri, 14 Dec 2012 07:59:21 +0000"  >&lt;p&gt;@NamedNativeQueries query  &lt;/p&gt;

&lt;p&gt;If we write the long SQL, it will be fault. NO error massage.&lt;br/&gt;
1251 charecter must be wrong.&lt;br/&gt;
I still insist it is the problem of preg_split in &lt;br/&gt;
Doctrine\Common\Lexer.php&lt;/p&gt;</comment>
                    <comment id="19152" author="fabio.bat.silva" created="Sun, 16 Dec 2012 20:50:10 +0000"  >&lt;p&gt;Can&apos;t reproduce,&lt;/p&gt;

&lt;p&gt;Could you try to change the attached test case and make it fail.&lt;/p&gt;


&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19178" author="beberlei" created="Mon, 24 Dec 2012 09:22:16 +0000"  >&lt;p&gt;The Doctrine\Common\Lexer is never used in combination with native queries, only with the Annotation Parser, so i cannot be the preg_split that causes your SQL to be broken. Or do you get annotation errors?&lt;/p&gt;

&lt;p&gt;Also what database are you using? maybe its related to the DBAL sql parsing?&lt;/p&gt;</comment>
                    <comment id="19195" author="dingdangjyz" created="Mon, 31 Dec 2012 04:02:50 +0000"  >&lt;p&gt;I&apos;m sorry my English is too bad. &lt;/p&gt;

&lt;p&gt;I think it&apos;s Doctrine \ is \ Lexer. PHP preg_split the function of the problem in this file.&lt;br/&gt;
My system environment is xp/apache 5.3 + / php_pdo_sqlsrv_53 / mssql2000&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11363" name="DDC2193Test.php" size="2501" author="fabio.bat.silva" created="Sun, 16 Dec 2012 20:48:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2190] findBy() support finding by a single DateTime but not by multiple DateTime</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2190</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The following code works:&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;$repository-&amp;gt;findBy(array(&apos;date&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime()))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but the following code fails as it does not apply the conversion of the &lt;tt&gt;date&lt;/tt&gt; type for each element:&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;$repository-&amp;gt;findBy(array(&apos;date&apos; =&amp;gt; array(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime(), &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime(&apos;tomorrow&apos;)))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14297">DDC-2190</key>
            <summary>findBy() support finding by a single DateTime but not by multiple DateTime</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="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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Dec 2012 17:39:00 +0000</created>
                <updated>Thu, 9 May 2013 12:47:37 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19228" author="beberlei" created="Sun, 6 Jan 2013 09:48:39 +0000"  >&lt;p&gt;This is actually very hard to implement, the problem is that we only have ARRAY constants for PDO::PARAM_INT and PDO::PARAM_STR - all the other types would require special handling.&lt;/p&gt;</comment>
                    <comment id="20241" author="beberlei" created="Thu, 9 May 2013 12:47:37 +0000"  >&lt;p&gt;Attaching failing testcase.&lt;/p&gt;

&lt;p&gt;The idea is to have something like &quot;datetime[]&quot; as type and detect this in the SQLParserUtils of DBAL.&lt;/p&gt;

&lt;p&gt;Another approach would be to convert the values in the ORM already, before passing to the DBAL.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11526" name="DDC2190Test.php" size="569" author="beberlei" created="Thu, 9 May 2013 12:47:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2185] Better explain DQL &quot;WITH&quot; and implications for the collection filtering API</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2185</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Available documentation is a bit thin regarding the &quot;WITH&quot; clause on JOIN expressions. Only a single example is provided in&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WITH seems to allow to only &quot;partially&quot; load a collection, so the collection in memory does not fully represent the associations available in the database.&lt;/p&gt;

&lt;p&gt;The resulting collection is marked as &quot;initialized&quot; and it seems there is no way to tell later on whether/how (with which expression) the collection has been initialized.&lt;/p&gt;

&lt;p&gt;When using the collection filtering API, the &quot;initialized&quot; flag on the collection will lead to in-memory processing. If a collection has been loaded WITH a restricting clause and another filter is applied later, results may not be what one might expect.&lt;/p&gt;

&lt;p&gt;I assume this is by design (no idea how the collection could be &quot;partially&quot; loaded and behave correctly under all conditions), so filing it as a documentation issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14291">DDC-2185</key>
            <summary>Better explain DQL &quot;WITH&quot; and implications for the collection filtering API</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="mpdude">Matthias Pigulla</reporter>
                        <labels>
                        <label>collection</label>
                        <label>documentation</label>
                        <label>dql</label>
                        <label>filtering</label>
                    </labels>
                <created>Tue, 4 Dec 2012 11:35:02 +0000</created>
                <updated>Mon, 17 Dec 2012 14:07:03 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19153" author="mpdude" created="Mon, 17 Dec 2012 14:07:03 +0000"  >&lt;p&gt;An additional observation:&lt;/p&gt;

&lt;p&gt;If you eager-load a collection using WITH, for the resulting entities that collection is marked as initialized as described above.&lt;/p&gt;

&lt;p&gt;Should you happen to come across the same entity during hydration in another (later) context where you explicitly eager load the same association &lt;b&gt;without&lt;/b&gt; the WITH restriction (or with another one), the collection on that (existing) entity won&apos;t be re-initialized and still contains the associated objects found during the first query.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2184] [GH-530] Singular form of generated methods should end with &apos;y&apos; when property ends with &apos;ies&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2184</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In Doctrine 2.3 the &apos;add&apos; and &apos;remove&apos; methods in oneToMany associations have another problem (in earlier versions like 2.2 this worked correct). The singular form is not correctly detected if the property ends with &apos;ies&apos; like &apos;entries&apos; which should be transformed to &apos;entry&apos;.&lt;br/&gt;
I have this YAML definition:&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;
Archive:
  type: entity
  fields:
    id:
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      generator:
        strategy: IDENTITY
  oneToMany:
    entries:
      targetEntity: Entry
      mappedBy: archive
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This generates these methods:&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;public&lt;/span&gt; function addEntrie(\Entry $entries) { ... }
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeEntrie(\Entry $entries) { ... }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Because in the EntityGenerator only the plural &apos;s&apos; is removed. It would be nice if an ending of &apos;ies&apos; could be replaced by &apos;y&apos;. So that we get these methods&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;public&lt;/span&gt; function addEntry(\Entry $entries) { ... }
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeEntry(\Entry $entries) { ... }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;My fork already has the changes &lt;a href=&quot;https://github.com/naitsirch/doctrine-orm2/commit/a3adfccb4927d61da7debae46ed0fff61e4212f8&quot; class=&quot;external-link&quot;&gt;https://github.com/naitsirch/doctrine-orm2/commit/a3adfccb4927d61da7debae46ed0fff61e4212f8&lt;/a&gt;&lt;br/&gt;
I have opened a pull request here &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/530&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/530&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14290">DDC-2184</key>
            <summary>[GH-530] Singular form of generated methods should end with &apos;y&apos; when property ends with &apos;ies&apos;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Dec 2012 09:14:25 +0000</created>
                <updated>Sun, 6 Jan 2013 10:02:11 +0000</updated>
                                    <version>2.3</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19104" author="naitsirch" created="Tue, 4 Dec 2012 09:25:11 +0000"  >&lt;p&gt;Sorry, I accidently clicked on the button &apos;Request Feedback&apos; &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
Now the status has changed to &apos;Awaiting Feedback&apos;&lt;/p&gt;</comment>
                    <comment id="19226" author="beberlei" created="Sun, 6 Jan 2013 09:45:52 +0000"  >&lt;p&gt;Mark as improvement&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="14236">DDC-2150</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="14256">DDC-2160</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2183] Second Level Cache improvements</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2183</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hibernate has a second level cache feature that is much more advanced than Doctrines result cache.&lt;/p&gt;

&lt;p&gt;With NoSQL in-memory databases such as Riak or MongoDB we could need a much more powerful cache to make Doctrine faaaaaasst. This ticket tracks the design and implementation of that feature.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14289">DDC-2183</key>
            <summary>Second Level Cache improvements</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Dec 2012 22:44:09 +0000</created>
                <updated>Mon, 3 Dec 2012 22:44:09 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2170] Decorator base classes for query related objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2170</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;tt&gt;Doctrine\ORM\Query&lt;/tt&gt; should not be directly extendable but it would be nice to decorate query objects and add additional methods. Use cases are e.g. doctrine-fun (see &lt;a href=&quot;https://github.com/lstrojny/doctrine-fun/blob/master/src/Doctrine/Fun/Query.php&quot; class=&quot;external-link&quot;&gt;https://github.com/lstrojny/doctrine-fun/blob/master/src/Doctrine/Fun/Query.php&lt;/a&gt;) or even cases where users want to add domain specific methods. As &lt;tt&gt;Doctrine\ORM\Query&lt;/tt&gt; is final it is not so easy to decorate correctly. I would propose:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Add a new interfaces: &lt;tt&gt;Doctrine\ORM\QueryInterface&lt;/tt&gt; that provides a contract for all methods &lt;tt&gt;Doctrine\ORM\Query&lt;/tt&gt; provides&lt;/li&gt;
	&lt;li&gt;Add a decorator base class &lt;tt&gt;Doctrine\ORM\QueryDecorator&lt;/tt&gt; as an extension point&lt;/li&gt;
	&lt;li&gt;Some for &lt;tt&gt;NativeQuery&lt;/tt&gt; and &lt;tt&gt;QueryBuilder&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14273">DDC-2170</key>
            <summary>Decorator base classes for query related objects</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="lstrojny">Lars Strojny</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Nov 2012 01:30:18 +0000</created>
                <updated>Mon, 26 Nov 2012 01:31:19 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19062" author="lstrojny" created="Mon, 26 Nov 2012 01:31:19 +0000"  >&lt;p&gt;Related:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/524&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/524&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/doctrine/common/pull/229&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/229&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2167] [GH-522] [DDC-2166] Refactor identity hash generation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2167</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of beberlei:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/522&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/522&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;This work prepares for the merge of GH-232, allowing more complex and robust identifier hash generation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14269">DDC-2167</key>
            <summary>[GH-522] [DDC-2166] Refactor identity hash generation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Nov 2012 17:57:03 +0000</created>
                <updated>Wed, 1 May 2013 21:33:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2166] Improve Identifier hashing in IdentiyMap</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2166</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There are currently some drawbacks with identifier hashing:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;They only work on one level for derived keys&lt;/li&gt;
	&lt;li&gt;The code is suspect to high performance requirements&lt;/li&gt;
	&lt;li&gt;Composite Keys might be suspect to weird bugs if they contain spaces.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There is a PR by goetas (&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/232&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/232&lt;/a&gt;) that solves some issues, however adds a performance hit.&lt;/p&gt;

&lt;p&gt;We should move the conditional logic of this code out and use a strategy pattern to improve both performance and robustness of this code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14268">DDC-2166</key>
            <summary>Improve Identifier hashing in IdentiyMap</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Nov 2012 13:38:29 +0000</created>
                <updated>Sun, 25 Nov 2012 13:38:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2154] Traits and Code Generation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2154</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;See &lt;a href=&quot;https://github.com/doctrine/DoctrineBundle/issues/106#issuecomment-10479116&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/DoctrineBundle/issues/106#issuecomment-10479116&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14242">DDC-2154</key>
            <summary>Traits and Code Generation</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Nov 2012 13:11:41 +0000</created>
                <updated>Sun, 18 Nov 2012 13:11:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2147] Custom annotation in MappedSuperclass</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2147</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When you try use custom annotation in mappedsuperclass like here &lt;a href=&quot;http://pastebin.com/YMxKvcLk&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/YMxKvcLk&lt;/a&gt; and then i try get metadata for class i get this error &lt;br/&gt;
Undefined index: fieldName&lt;br/&gt;
ClassMetadataInfo.php  function addInheritedFieldMapping&lt;br/&gt;
Problem is that custom annotation doesnt have fieldName. &lt;br/&gt;
Quick fix is add condition to test if fieldName isset. &lt;/p&gt;</description>
                <environment>Linux 3.6.6-1.fc17.x86_64</environment>
            <key id="14227">DDC-2147</key>
            <summary>Custom annotation in MappedSuperclass</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="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="kluk">kluk</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Nov 2012 07:46:38 +0000</created>
                <updated>Tue, 7 May 2013 21:24:53 +0000</updated>
                                    <version>2.2.1</version>
                                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18988" author="kluk" created="Thu, 15 Nov 2012 09:24:39 +0000"  >&lt;p&gt;error log from orm:validate-schema&lt;/p&gt;</comment>
                    <comment id="19373" author="ocramius" created="Wed, 23 Jan 2013 21:47:56 +0000"  >&lt;p&gt;Copying from pastebin:&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;
use \Doctrine\ORM\Mapping as ORM;
use \xxx\Doctrine\Annotation\Entity as re;
use \xxx\Doctrine\Annotation\Forms as rf;
use \Doctrine\Common\Collections;
 
/**
 * @ORM\Entity
 */
class EventPicture &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \Picture
{
 
    /**
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Event&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;eventPicture&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;FK_Event&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; $event;
 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;
use \Doctrine\ORM\Mapping as ORM;
use \xxx\Doctrine\Annotation\Entity as re;
use \xxx\Doctrine\Annotation\Forms as rf;
use \Doctrine\Common\Collections;
 
/** @ORM\MappedSuperclass */
class Picture &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \xxx\Doctrine\Entity\BaseEntity
{
 
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; type
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
 
    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;,unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     *  @rf\FileUpload(fileSize=&lt;span class=&quot;code-quote&quot;&gt;&quot;php&quot;&lt;/span&gt;,uploadType=&lt;span class=&quot;code-quote&quot;&gt;&quot;local&quot;&lt;/span&gt;,fieldName=&lt;span class=&quot;code-quote&quot;&gt;&quot;link&quot;&lt;/span&gt;,formControl=&lt;span class=&quot;code-quote&quot;&gt;&quot;FileUploadField&quot;&lt;/span&gt;,image=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     *
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $link;
 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=kluk&quot; class=&quot;user-hover&quot; rel=&quot;kluk&quot;&gt;kluk&lt;/a&gt; does this happen also with any other simple custom annotation? For example following:&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;
/**
 * @Annotation 
 * @Target({&lt;span class=&quot;code-quote&quot;&gt;&quot;PROPERTY&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;ANNOTATION&quot;&lt;/span&gt;})
 */
&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; class Entity &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; Annotation
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $value;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19438" author="kluk" created="Wed, 30 Jan 2013 08:28:42 +0000"  >&lt;p&gt;the same error when using simple annotation.&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-none&quot;&gt; 
&amp;lt;?php

use \Doctrine\ORM\Mapping as ORM;
use \xxx\Doctrine\Annotation\Entity as re;
use \xxx\Doctrine\Annotation\Forms as rf;
use \Doctrine\Common\Collections;

/** @ORM\MappedSuperclass */
class Picture extends \xxx\Doctrine\Entity\BaseEntity {

    /**
     * @ORM\Id
     * @ORM\Column(type=&quot;integer&quot;)
     * @ORM\GeneratedValue(strategy=&quot;IDENTITY&quot;)
     * @var type
     */
    protected $id;

   
    /**
     * @ORM\Column(type=&quot;integer&quot;)
     * @rf\SetClass({&quot;class&quot;,&quot;hide&quot;})
     */
    public $value;

    /**
     * @ORM\Column(type=&quot;string&quot;,unique=true, nullable=true)
     * @rf\FileUpload(fileSize=&quot;php&quot;,uploadType=&quot;local&quot;,fieldName=&quot;link&quot;,formControl=&quot;FileUploadField&quot;,image=true)
     *
     */
    protected $link;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;When i remove $value , $picture from class everything goes ok.&lt;br/&gt;
Easy fix for me is change ClassMetadataInfo.&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-none&quot;&gt;
    /**
     * INTERNAL:
     * Adds a field mapping without completing/validating it.
     * This is mainly used to add inherited field mappings to derived classes.
     *
     * @param array $fieldMapping
     *
     * @return void
     */
    public function addInheritedFieldMapping(array $fieldMapping)
    {
        if(isset($fieldMapping[&apos;fieldName&apos;])){
        $this-&amp;gt;fieldMappings[$fieldMapping[&apos;fieldName&apos;]] = $fieldMapping;
        $this-&amp;gt;columnNames[$fieldMapping[&apos;fieldName&apos;]] = $fieldMapping[&apos;columnName&apos;];
        $this-&amp;gt;fieldNames[$fieldMapping[&apos;columnName&apos;]] = $fieldMapping[&apos;fieldName&apos;];
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But i dont know if this fix can break another part of doctrine.&lt;/p&gt;</comment>
                    <comment id="20211" author="beberlei" created="Sat, 4 May 2013 12:31:51 +0000"  >&lt;p&gt;Can you put the code of your annotations online? I can&apos;t seem to understand why this happens.&lt;/p&gt;</comment>
                    <comment id="20226" author="kluk" created="Tue, 7 May 2013 21:24:53 +0000"  >&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt; 
namespace libs\Doctrine\Annotation\Entity;
use Doctrine\Common\Annotations\Annotation;

/** @Annotation */
class CustomMapping &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Annotation
{
    /**
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $className;
    /**
     * 
     * 
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; IQueryable| string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dataSource;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                </comments>
                    <attachments>
                    <attachment id="11349" name="error.log" size="2364" author="kluk" created="Thu, 15 Nov 2012 09:24:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2141] Query should not be final</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2141</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The Query class should not be marked final as this makes it impossible to Mock it.&lt;/p&gt;
</description>
                <environment>All</environment>
            <key id="14219">DDC-2141</key>
            <summary>Query should not be final</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="tarjei">Tarjei Huse</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Nov 2012 09:59:23 +0000</created>
                <updated>Tue, 13 Nov 2012 09:59:23 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2133] Issue with Query::iterate and query mixed results</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2133</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Consider this code:&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;
$dql = &quot;
    SELECT Page, Product.name
    FROM Dlayer\\Entity\\Page Page
    INNER JOIN Page.Product Product
    &quot;;
$q = ($em-&amp;gt;createQuery($dql));
foreach ($q-&amp;gt;iterate() as $entry) {
  $page = $entry[0][0];
  $name = $entry[0][&apos;name&apos;];
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This results with undefined index: &apos;name&apos; for the second entry.&lt;/p&gt;

&lt;p&gt;First result keys are (notice just one array element with index 0):&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;
0
array(2) {
  [0] =&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(0)
  [1] =&amp;gt;
  string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;
} 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but all others are different (notice two array elements with index 0 and the other one that is incrementing):&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;
the second one:
0
array(1) {
  [0] =&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(0)
}
1
array(1) {
  [0] =&amp;gt;
  string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;
} 
the third one:
0
array(1) {
  [0] =&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(0)
}
2
array(1) {
  [0] =&amp;gt;
  string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;
} 

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;What&apos;s wrong with this approach? Is it a bug or mixed results should not be used with the iterate method?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14206">DDC-2133</key>
            <summary>Issue with Query::iterate and query mixed results</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="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="deatheriam">Oleg Namaka</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Nov 2012 01:45:16 +0000</created>
                <updated>Wed, 1 May 2013 21:26:21 +0000</updated>
                                    <version>2.2.1</version>
                                <fixVersion>3.0</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18968" author="beberlei" created="Mon, 12 Nov 2012 14:16:28 +0000"  >&lt;p&gt;This is a known issue that we don&apos;t have found a BC fix for and as I understand &lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=guilhermeblanco&quot; class=&quot;user-hover&quot; rel=&quot;guilhermeblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; requires considerable refactoring. &lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12890">DDC-1314</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2128] [GH-507] Now MetaDataFilter takess also regexp. For example whern you want to</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2128</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of catalinux:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/507&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/507&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;extract metadata if you would filter like this: --filter=&quot;Article&quot;&lt;br/&gt;
would extract also for &quot;ArticleItems&quot; (article_items table). Now you&lt;br/&gt;
can use --filter=&quot;Article$&quot; if you want only that table (articl)&lt;/p&gt;</description>
                <environment></environment>
            <key id="14199">DDC-2128</key>
            <summary>[GH-507] Now MetaDataFilter takess also regexp. For example whern you want to</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Nov 2012 12:46:51 +0000</created>
                <updated>Sun, 6 Jan 2013 10:00:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2119] Problem with inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2119</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I tried to create inheritance entities with save policy table per class.&lt;br/&gt;
Simple fileds was created normally, but a field with ManyToOne type was lost.&lt;/p&gt;

&lt;p&gt;I had found a solution.&lt;/p&gt;

&lt;p&gt;In Doctrine\ORM\Tools\SchemaTool&lt;br/&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;
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _gatherRelationsSql($class, $table, $schema)
    {
        foreach ($class-&amp;gt;associationMappings as $fieldName =&amp;gt; $mapping) {

           &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;])) { // - old version
&lt;/span&gt;
	/**
             * SSW
             * It&apos;s the solution
             */
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;]) &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeNone() &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeTablePerClass() ) {
                &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
            }            

            $foreignClass = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;targetEntity&apos;]);
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But it was enough. In DQL query a simple query was made wrong.&lt;/p&gt;

&lt;p&gt;I had found a solution again.&lt;br/&gt;
In Doctrine\ORM\Query\SqlWalker&lt;br/&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;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function walkSelectExpression($selectExpression)
...

                &lt;span class=&quot;code-comment&quot;&gt;// original =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;])){
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// It&apos;s the solution
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;]) &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeNone() &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeTablePerClass()) {
                    $tableName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;inherited&apos;])-&amp;gt;table[&apos;name&apos;];
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                    $tableName = $class-&amp;gt;table[&apos;name&apos;];
                }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This problems are topical for inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS. &lt;/p&gt;

&lt;p&gt;I don&apos;t know, may be my solutions are wrong. But some programmers want to correctly work with INHERITANCE_TYPE_TABLE_PER_CLASS.&lt;/p&gt;

&lt;p&gt;Sorry for my english.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14189">DDC-2119</key>
            <summary>Problem with inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS </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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sergsw">SergSW</reporter>
                        <labels>
                        <label>dql</label>
                        <label>schematool</label>
                    </labels>
                <created>Sat, 3 Nov 2012 18:57:00 +0000</created>
                <updated>Mon, 8 Apr 2013 20:43:37 +0000</updated>
                                    <version>2.1</version>
                                                <component>DQL</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18924" author="fabio.bat.silva" created="Mon, 5 Nov 2012 22:17:32 +0000"  >&lt;p&gt;Hi SergSW &lt;/p&gt;

&lt;p&gt;Could you try to write a failing test case ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18950" author="sergsw" created="Tue, 6 Nov 2012 23:55:43 +0000"  >&lt;p&gt;SSW/TestBundle with the problem&lt;/p&gt;</comment>
                    <comment id="18951" author="sergsw" created="Wed, 7 Nov 2012 00:06:03 +0000"  >&lt;p&gt;I install the Symfony v2.0.18. and made small TestBundle.&lt;br/&gt;
I made schema database, by CLI &quot;console doctrine:schema:update --force&quot;&lt;br/&gt;
Result: Database schema updated successfully!&lt;br/&gt;
But I saw that I lost a field &apos;user_id&apos; in a table &apos;AttachTree&apos; (see Attach)&lt;/p&gt;</comment>
                    <comment id="18952" author="sergsw" created="Wed, 7 Nov 2012 00:06:32 +0000"  >&lt;p&gt;MySQL dump&lt;/p&gt;</comment>
                    <comment id="18971" author="beberlei" created="Mon, 12 Nov 2012 14:33:25 +0000"  >&lt;p&gt;Adjusted example formatting, don&apos;t apologize for your English, thanks for the report!&lt;/p&gt;</comment>
                    <comment id="19176" author="beberlei" created="Mon, 24 Dec 2012 09:08:14 +0000"  >&lt;p&gt;What version of 2.1 are you using? We don&apos;t actually support 2.1 anymore. Inheritance has always worked as used in hundrets of unit-tests, this changes look quite major a bug to have been missed before. I can&apos;t really explain whats happening here.&lt;/p&gt;</comment>
                    <comment id="19371" author="ocramius" created="Wed, 23 Jan 2013 21:36:22 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=sergsw&quot; class=&quot;user-hover&quot; rel=&quot;sergsw&quot;&gt;SergSW&lt;/a&gt; news?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11345" name="dump.sql" size="4947" author="sergsw" created="Wed, 7 Nov 2012 00:06:32 +0000" />
                    <attachment id="11344" name="SSWTestBundle.rar" size="5526" author="sergsw" created="Tue, 6 Nov 2012 23:55:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2104] BasicEntityPersister::load() doesn&apos;t allow for cache usage</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2104</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;BasicEntityPersister::load() calls:&lt;br/&gt;
$stmt = $this-&amp;gt;_conn-&amp;gt;executeQuery($sql, $params, $types);&lt;br/&gt;
on line 665 of master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php&lt;/p&gt;

&lt;p&gt;The executeQuery function has an optional fourth parameter to pass a QueryCacheProfile variable to use caching on the query.  This is ignored/not implemented by BasicEntityPersister::load()&lt;/p&gt;</description>
                <environment>This is a new feature,  not a bug</environment>
            <key id="14169">DDC-2104</key>
            <summary>BasicEntityPersister::load() doesn&apos;t allow for cache usage</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="dmcfaul">Dan McFaul</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Oct 2012 19:43:26 +0000</created>
                <updated>Mon, 12 Nov 2012 14:51:07 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2102] Make optional SubselectFromClause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2102</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Subselect ::= SimpleSelectClause &lt;span class=&quot;error&quot;&gt;&amp;#91;SubselectFromClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;WhereClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;GroupByClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;HavingClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;OrderByClause&amp;#93;&lt;/span&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14166">DDC-2102</key>
            <summary>Make optional SubselectFromClause</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Oct 2012 11:32:54 +0000</created>
                <updated>Thu, 25 Oct 2012 11:32:54 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2100] Getting Started: Code First PHP fatal error:Call to undefined method Bug::setDescription()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2100</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html&lt;/a&gt;&lt;br/&gt;
in file create_bug.php&lt;br/&gt;
$bug-&amp;gt;setDescription(&quot;Something does not work!&quot;);&lt;br/&gt;
but the class Bug do not have setDescription function.&lt;/p&gt;

&lt;p&gt;ps:&lt;br/&gt;
try find &quot;setDescription&quot; on that page. there is only one .&lt;/p&gt;</description>
                <environment>ubuntu 1204 php5.3.8</environment>
            <key id="14164">DDC-2100</key>
            <summary>Getting Started: Code First PHP fatal error:Call to undefined method Bug::setDescription()</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="bronze1man">bronze1man</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Oct 2012 14:28:15 +0000</created>
                <updated>Wed, 24 Oct 2012 14:30:06 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2093] Doctrine Criteria does not support sorting by relationed field</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2093</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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-none&quot;&gt;
// Here I call Criteria filter
public function getWalletsActive() {
	$criteria = Criteria::create()
		-&amp;gt;where(Criteria::expr()-&amp;gt;eq(&quot;isRemoved&quot;, &quot;0&quot;))
		-&amp;gt;orderBy(array(&quot;currency.id&quot; =&amp;gt; &quot;ASC&quot;));
	return $this-&amp;gt;wallets-&amp;gt;matching($criteria);
}

// Relation
/**
 * @var Currency
 *
 * @ORM\ManyToOne(targetEntity=&quot;Currency&quot;)
 * @ORM\JoinColumns({
 * @ORM\JoinColumn(name=&quot;id_currency&quot;, referencedColumnName=&quot;id&quot;)
 * })
 */
protected $currency;

// File BasicEntityPersister.php
// This cause the problem:
if ( ! isset($this-&amp;gt;_class-&amp;gt;fieldMappings[$fieldName])) {
    throw ORMException::unrecognizedField($fieldName);
}
// There are no relations in $this-&amp;gt;_class-&amp;gt;fieldMappings at all!
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14150">DDC-2093</key>
            <summary>Doctrine Criteria does not support sorting by relationed field</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="nick4fake">Bogdan Yurov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Oct 2012 09:10:02 +0000</created>
                <updated>Sun, 6 Jan 2013 18:29:28 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19237" author="beberlei" created="Sun, 6 Jan 2013 18:29:28 +0000"  >&lt;p&gt;Mark as improvement.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2089] Modify OneToMany to allow unidirectional associations without the need of a JoinTable</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2089</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As I sayd in the title, it would be nice if the ORM layer could permit to map a 1:n association in the db as an unidirectional OneToMany in the classes, without using a JoinTable in the database.&lt;br/&gt;
This would permit us to get rid of the unnecessary database JoinTable, which creates disorder and decreases performance for no valuable reason.&lt;/p&gt;

&lt;p&gt;Is it possible?&lt;/p&gt;</description>
                <environment>Debian Wheezy, Mysql 5.1, Apache2, PHP 5.4</environment>
            <key id="14145">DDC-2089</key>
            <summary>Modify OneToMany to allow unidirectional associations without the need of a JoinTable</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="noise085">Enea Bette</reporter>
                        <labels>
                        <label>onetomany</label>
                        <label>persister</label>
                        <label>unidirectional</label>
                    </labels>
                <created>Fri, 19 Oct 2012 10:11:55 +0000</created>
                <updated>Sun, 16 Dec 2012 17:42:11 +0000</updated>
                                    <version>2.x</version>
                                <fixVersion>2.4</fixVersion>
                <fixVersion>3.0</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19150" author="noise085" created="Sun, 16 Dec 2012 17:42:11 +0000"  >&lt;p&gt;A little up... for inspiration from JPA &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;

&lt;p&gt;&lt;a href=&quot;http://en.wikibooks.org/wiki/Java_Persistence/OneToMany#Undirectional_OneToMany.2C_No_Inverse_ManyToOne.2C_No_Join_Table_.28JPA_2.0_ONLY.29&quot; class=&quot;external-link&quot;&gt;http://en.wikibooks.org/wiki/Java_Persistence/OneToMany#Undirectional_OneToMany.2C_No_Inverse_ManyToOne.2C_No_Join_Table_.28JPA_2.0_ONLY.29&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2087] Select colum Hydration</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2087</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Simple way to select colum&lt;br/&gt;
for example I want select id&apos;s of entity&apos;s to save in cache or in other select query&lt;br/&gt;
Or i vant select one distinct field.&lt;/p&gt;

&lt;p&gt;SELECT u.id FROM User as u&lt;/p&gt;

&lt;p&gt;getResult give&lt;/p&gt;

&lt;p&gt;array( &lt;br/&gt;
0=&amp;gt;array(&apos;id&apos; =&amp;gt; 1),&lt;br/&gt;
1=&amp;gt;array(&apos;id&apos; =&amp;gt; 2),&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;but how can take this&lt;/p&gt;

&lt;p&gt;array( &lt;br/&gt;
0=&amp;gt; 1,&lt;br/&gt;
0=&amp;gt; 2,&lt;br/&gt;
)&lt;/p&gt;</description>
                <environment></environment>
            <key id="14140">DDC-2087</key>
            <summary>Select colum Hydration</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ivan1986">Ivan Borzenkov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Oct 2012 09:47:54 +0000</created>
                <updated>Thu, 18 Oct 2012 09:56:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18848" author="ivan1986" created="Thu, 18 Oct 2012 09:55:04 +0000"  >&lt;p&gt;for example&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/11327798/change-the-getresult-array-key-for-the-primary-key-value&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/11327798/change-the-getresult-array-key-for-the-primary-key-value&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;this code would be good add in library&lt;br/&gt;
(and array key maybe too )&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2078] [GH-479] [WIP][Mapping] Ported some of the yaml driver to use Symfony config</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2078</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of kimhemsoe:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/479&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/479&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Looking for some input. How much validation and normailization should i push to the configuration ? Should i use default values so we can remove alot of lines from the driver ?&lt;/p&gt;

&lt;p&gt;Is the way im allowing to extend the configuration good enough for Gedmo and others (untested)?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14128">DDC-2078</key>
            <summary>[GH-479] [WIP][Mapping] Ported some of the yaml driver to use Symfony config</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Oct 2012 23:46:55 +0000</created>
                <updated>Wed, 1 May 2013 12:57:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2061] Matching Criteria on a PersistentCollection only works on OneToMany associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2061</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;What is needed to make it also work for ManyToMany associations?&lt;/p&gt;

&lt;p&gt;May be a better fallback would be do an ArrayCollection-&amp;gt;matching() instead of just giving a runtime exception?&lt;/p&gt;

&lt;p&gt;Is this something that is difficult to implement?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14107">DDC-2061</key>
            <summary>Matching Criteria on a PersistentCollection only works on OneToMany associations</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="terjeb">Terje Br&#229;ten</reporter>
                        <labels>
                        <label>criteria</label>
                        <label>matching</label>
                    </labels>
                <created>Mon, 8 Oct 2012 20:30:35 +0000</created>
                <updated>Mon, 8 Oct 2012 20:32:21 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>Git Master</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2052] Custom tree walkers are not allowed to add new components to the query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2052</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Custom tree walkers have freedom in modifying the AST but when you try to add a new query component (i.e. new join in walkSelectStatement() ) to the AST then the SqlWalker throws an exception because it does not has the new component in its _queryComponents array. I see two possible ways to resolve this:&lt;br/&gt;
1. Modify the Parser class in order to allow tree walkers to modify queryComponents and pass changed queryComponents to the SqlWalker&lt;br/&gt;
2. Improve SqlWalker so it can extract and prepare needed information about queryComponent based on AST when it does not have them.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14085">DDC-2052</key>
            <summary>Custom tree walkers are not allowed to add new components to the query</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="chives">&#321;ukasz Cybula</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Tue, 2 Oct 2012 13:30:45 +0000</created>
                <updated>Tue, 14 May 2013 18:18:10 +0000</updated>
                                    <version>2.3</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18789" author="beberlei" created="Sat, 6 Oct 2012 09:07:58 +0000"  >&lt;p&gt;Ok this is much more complicated to allow then i thought. The problem is that the QueryComponents are passed by value, as an array, not by reference. That prevents changing them because this change wouldn&apos;t be visible in the output walker.&lt;/p&gt;

&lt;p&gt;I can add a method to allow this in the OutputWalker for now, but generally this requires a bigger refactoring on the Query Components.&lt;/p&gt;</comment>
                    <comment id="18790" author="beberlei" created="Sat, 6 Oct 2012 09:15:39 +0000"  >&lt;p&gt;Added setQueryComponent() in SQL Walker to allow modification in output walker.&lt;/p&gt;</comment>
                    <comment id="18805" author="chives" created="Mon, 8 Oct 2012 10:47:08 +0000"  >&lt;p&gt;I&apos;m afraid that this doesn&apos;t solve the initial problem at all. I&apos;ll try to describe it in more details to show what I mean. Suppose we have two doctrine extensions each of which contain its own tree walker. Each of these tree walkers need to modify AST and add new component to it (joined with some component already existing in the query). The first problem is that each tree walker has its own queryComponents array which is not passed between them, although they not necessary need to use queryComponents - they could use only AST. The second, bigger problem is that the Parser class does not know anything about modifications of queryComponents in tree walkers and cannot pass modified version to the OutputWalker. The goal of submitting this issue was to allow adding new components to the query in tree walkers which is not achievable by your fix. I think it may be the first step in the right direction. Maybe TreeWalkerAdapter should have public method getQueryComponents() which would be used by the Parser to pass modified queryComponents between different tree walkers and finally to the OutputWalker ? This would not break backward compatibility and solve this issue. What do you think about it?&lt;/p&gt;</comment>
                    <comment id="18806" author="chives" created="Mon, 8 Oct 2012 13:43:37 +0000"  >&lt;p&gt;I&apos;ve tried to implement the solution mentioned in previous comment but it&apos;s also not so clean and easy as I thought. Each tree walker (including TreeWalkerChain) would have to implement getQueryComponents() and setQueryComponent($alias, array $component) methods. The same with SqlWalker, so the TreeWalker interface should have these methods, which would break BC in some way (walkers that do not inherit from SqlWalker or TreeWalkerAdapter will fail to compile). So maybe my first solution (PR #464) is not so bad for now? In the future queryComponents could be replaced by a special object or could be passed by a reference to allow modifications.&lt;/p&gt;</comment>
                    <comment id="20247" author="beberlei" created="Thu, 9 May 2013 15:32:15 +0000"  >&lt;p&gt;Marked as improvement as its not a bug.&lt;/p&gt;

&lt;p&gt;A solution might probably implement an object holding all the QueryComponent, implementing ArrayAccess. So that way the state can be shared.&lt;/p&gt;</comment>
                    <comment id="20379" author="ocramius" created="Tue, 14 May 2013 18:02:22 +0000"  >&lt;p&gt;Just hit this while developing an ast walker... Will look into it too since I need it more than soon.&lt;/p&gt;</comment>
                    <comment id="20380" author="ocramius" created="Tue, 14 May 2013 18:17:26 +0000"  >&lt;p&gt;As a VERY UGLY workaround, I used a static variable and a custom sql walker in combination with my AST walker.&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;

namespace Comcom\Versioning\ORM\Query;


use Doctrine\ORM\Query\SqlWalker;

class WorkaroundSqlWalker &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; SqlWalker
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($query, $parserResult, array $queryComponents)
    {
        parent::__construct($query, $parserResult, $queryComponents);

        foreach (VersionWalker::$additionalAliases as $alias =&amp;gt; $value) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setQueryComponent($alias, $value);
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2048] [GH-457] Fixes case when an entity has a relationship with a class with joined inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2048</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of Fran6co:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/457&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/457&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

</description>
                <environment></environment>
            <key id="14080">DDC-2048</key>
            <summary>[GH-457] Fixes case when an entity has a relationship with a class with joined inheritance</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 29 Sep 2012 16:11:00 +0000</created>
                <updated>Sat, 29 Sep 2012 16:11:00 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2043] Extra cache operation in DBAL\Cache\ResultCacheStatement.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2043</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is the closeCursor() method in DBAL\Cache\ResultCacheStatement.php:&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;public&lt;/span&gt; function closeCursor()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;statement-&amp;gt;closeCursor();
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;emptied &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
            $data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;resultCache-&amp;gt;fetch($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cacheKey);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $data) {
                $data = array();
            }
            $data[$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;realKey] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data;

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;resultCache-&amp;gt;save($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cacheKey, $data, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;lifetime);
            unset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We are using Memcache and I noticed an extra GET operation on all cache misses. In the code above I believe the fetch call is not necessary and that the code would do the same without it. &lt;br/&gt;
Also, may I ask why is the SQL used as a key in the cached data?&lt;/p&gt;</description>
                <environment>CentOS, PHP 5.3.10</environment>
            <key id="14069">DDC-2043</key>
            <summary>Extra cache operation in DBAL\Cache\ResultCacheStatement.php</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="bogdan.albei">Bogdan Albei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Sep 2012 11:59:59 +0000</created>
                <updated>Wed, 26 Sep 2012 14:18:04 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18733" author="stof" created="Wed, 26 Sep 2012 14:12:15 +0000"  >&lt;p&gt;The SQL is used as a key because it is what identifies the query which is done (well, the statement and the parameters)&lt;/p&gt;</comment>
                    <comment id="18734" author="bogdan.albei" created="Wed, 26 Sep 2012 14:18:04 +0000"  >&lt;p&gt;The cacheKey already identifies the query(or at least it should). Would we have cases where different queries would want to use the same cache key?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2042] Metadata association overriding : allow to override &apos;targetEntity&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2042</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;While associating object to an descriminated table I wasn&apos;t enable to fix the entityTarget (only one can be set in entity annotation).&lt;/p&gt;

&lt;p&gt;It could be resolve by adding the possibility to override &apos;targetEntity&apos; value in Doctrine\ORM\Mapping\ClassMetadataInfo::ClassMetadataInfo().&lt;/p&gt;

&lt;p&gt;Such as :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if (isset($overrideMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
    $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt; = $overrideMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That would need to add a control on the new targetEntity in Doctrine\ORM\Mapping\ClassMetadataInfo::_validateAndCompleteAssociationMapping().&lt;/p&gt;

&lt;p&gt;Such as :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if ( ! ClassLoader::classExists($mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;) ) {&lt;br/&gt;
throw MappingException::invalidTargetEntityClass($mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;, $this-&amp;gt;name, $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;cro.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14067">DDC-2042</key>
            <summary>Metadata association overriding : allow to override &apos;targetEntity&apos;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="cro">Charles Rouillon</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Sep 2012 08:57:40 +0000</created>
                <updated>Wed, 26 Sep 2012 08:59:38 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2021] Array Data in Member OF</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2021</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi.&lt;br/&gt;
First sorry for my bad english.&lt;br/&gt;
In &lt;br/&gt;
SELECT u.id FROM CmsUser u WHERE :groupId MEMBER OF u.groups&lt;br/&gt;
DQL we can&apos;t use Array of groupId like&lt;/p&gt;</description>
                <environment></environment>
            <key id="14024">DDC-2021</key>
            <summary>Array Data in Member OF</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="vahid4134">vahid sohrabloo</reporter>
                        <labels>
                        <label>array</label>
                        <label>dql</label>
                    </labels>
                <created>Sun, 9 Sep 2012 09:10:02 +0000</created>
                <updated>Sun, 9 Sep 2012 09:10:02 +0000</updated>
                                    <version>2.2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2007] [GH-434] allowed to pass filter objects to the configurator</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2007</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of bamarni:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/434&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/434&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;If &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2004&quot; title=&quot;Allowing objects as filters&quot;&gt;&lt;del&gt;DDC-2004&lt;/del&gt;&lt;/a&gt; gets approved.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14004">DDC-2007</key>
            <summary>[GH-434] allowed to pass filter objects to the configurator</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 31 Aug 2012 13:30:27 +0000</created>
                <updated>Wed, 5 Sep 2012 17:18:24 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2002] [GH-432] Add DBAL\TypeAwareObject type inference.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2002</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of Romain-Geissler:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/432&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/432&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;DBAL allows you to define custom field types for your entities, and those are seamlessly converted from PHP to SQL value. However, you can&apos;t those custom types as parameters without type hinting it :&lt;/p&gt;

&lt;p&gt;```php&lt;br/&gt;
$qb-&amp;gt;select(&apos;e&apos;)&lt;br/&gt;
   -&amp;gt;from(&apos;Entity&apos;, &apos;e&apos;)&lt;br/&gt;
   -&amp;gt;where(&apos;e.customField = :customFieldValue&apos;)&lt;br/&gt;
   -&amp;gt;setParameter(&apos;customFieldValue&apos;,$customFieldValue,$customFieldDBALType);&lt;br/&gt;
   //this third argument is for now compulsory&lt;br/&gt;
:&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;In my case, ``$customFieldValue`` is an object that won&apos;t work well if converted with the default string type. I added a new DBAL interface (see doctrine/dbal#193 ) and tweaked the parameter type inference so that custom values can advertise their DBAL type.&lt;/p&gt;

&lt;p&gt;There is currently no way to dynamically override the parameter type inference logic, this is one design that allows it in some cases. &lt;/p&gt;</description>
                <environment></environment>
            <key id="13997">DDC-2002</key>
            <summary>[GH-432] Add DBAL\TypeAwareObject type inference.</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Aug 2012 16:05:38 +0000</created>
                <updated>Wed, 5 Sep 2012 17:21:34 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18589" author="beberlei" created="Thu, 30 Aug 2012 13:27:31 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-432&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/432&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/432&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1999] Lazy loading doesn&apos;t get the field type when generating sql</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1999</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When calling with lazy loading the Sql generated doesn&apos;t convert the parameters according to their types. After debugging the problem I found that the problem is in the getType($field, $value) function in the BasicEntityPersister as it is it will never be able to return the filed type when called for lazy loading for oneToMany or ManyToMany. I put a quick fix for my self&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;private&lt;/span&gt; function getType($field, $value)
    {

        &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;) {
           &lt;span class=&quot;code-comment&quot;&gt;//here we have original code
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:

            	$type = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
               &lt;span class=&quot;code-comment&quot;&gt;// my fix starts here
&lt;/span&gt;            	$fieldParts = explode(&apos;.&apos;, $field);
            	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (count($fieldParts &amp;gt; 1)) {
	            	foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;associationMappings as $mapping) {
						&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;joinColumnFieldNames&apos;][$fieldParts[1]])) {
							$targetClass  = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;targetEntity&apos;]);

							&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($targetClass-&amp;gt;fieldNames[$fieldParts[1]])) {
								$type = $targetClass-&amp;gt;fieldMappings[$targetClass-&amp;gt;fieldNames[$fieldParts[1]]][&apos;type&apos;];
							}

							&lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
						}
	            	}
            	}
&lt;span class=&quot;code-comment&quot;&gt;//my fix end here
&lt;/span&gt;        }

       &lt;span class=&quot;code-comment&quot;&gt;//here we have original code
&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $type;
    }


&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;i have only added that check in the default case of the switch. I am not sure if that is the most elegant way. I hope that helps and that it will be fixed soon. Thanks for the great work &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;</description>
                <environment></environment>
            <key id="13992">DDC-1999</key>
            <summary>Lazy loading doesn&apos;t get the field type when generating sql</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="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="vigor_bg">victor Velkov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Aug 2012 06:50:27 +0000</created>
                <updated>Wed, 29 Aug 2012 20:15:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18564" author="beberlei" created="Wed, 29 Aug 2012 11:49:20 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=fabio.bat.silva&quot; class=&quot;user-hover&quot; rel=&quot;fabio.bat.silva&quot;&gt;Fabio B. Silva&lt;/a&gt; &lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=guilhermeblanco&quot; class=&quot;user-hover&quot; rel=&quot;guilhermeblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; do we have a current best practice/policy regarding casting of join column types? There are some issues regarding it, this is another one.&lt;/p&gt;</comment>
                    <comment id="18581" author="guilhermeblanco" created="Wed, 29 Aug 2012 20:15:29 +0000"  >&lt;p&gt;We avoid the manual breakdown of path expressions.&lt;br/&gt;
Also, in BasicEntityPersister it is done behind the scenes and can get into weird scenarios. Personally speaking, I don&apos;t see how we can easily fix this issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1996] [GH-429] Ensure a parameter mapping entry exists for InstanceOf DQL expressions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1996</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of craigmarvelley:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/429&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/429&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;This is a possible fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1995&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1995&lt;/a&gt;, in that it resolves the issue for me but I&apos;m afraid I haven&apos;t had time to test it extensively with more complex queries than the use case I gave in that ticket.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br/&gt;
Craig&lt;/p&gt;</description>
                <environment></environment>
            <key id="13983">DDC-1996</key>
            <summary>[GH-429] Ensure a parameter mapping entry exists for InstanceOf DQL expressions</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Aug 2012 14:23:10 +0000</created>
                <updated>Wed, 22 Aug 2012 14:23:10 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1995] &quot;Query Exception: Invalid parameter number: number of bound variables does not match number of tokens&quot; when using an &quot;Instance Of&quot; expression</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1995</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Similar to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1848&quot; class=&quot;external-link&quot;&gt;this issue&lt;/a&gt; I think, but triggered when performing a query on entities modelled with Class Table Inheritance, e.g.&lt;/p&gt;

&lt;p&gt;$qb = $repository-&amp;gt;createQueryBuilder(&apos;entity&apos;);&lt;br/&gt;
$metadata = $em-&amp;gt;getClassMetadata($class);&lt;br/&gt;
$qb-&amp;gt;where(&apos;entity INSTANCE OF :type&apos;)-&amp;gt;setParameter(&apos;type&apos;, $metadata);&lt;br/&gt;
$qb-&amp;gt;getQuery()-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;Seems that there isn&apos;t a corresponding entry in the parameter mapping array for this clause, which triggers the exception at line 254 of Doctrine\ORM\Query:&lt;/p&gt;

&lt;p&gt;if (count($paramMappings) != count($this-&amp;gt;parameters)) &lt;/p&gt;
{
    throw QueryException::invalidParameterNumber();
}</description>
                <environment></environment>
            <key id="13982">DDC-1995</key>
            <summary>&quot;Query Exception: Invalid parameter number: number of bound variables does not match number of tokens&quot; when using an &quot;Instance Of&quot; expression</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="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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Aug 2012 14:13:39 +0000</created>
                <updated>Wed, 29 Aug 2012 11:53:15 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>Git Master</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18532" author="craigmarvelley" created="Wed, 22 Aug 2012 14:24:48 +0000"  >&lt;p&gt;Pull request with a potential fix: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/429&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/429&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18566" author="beberlei" created="Wed, 29 Aug 2012 11:53:15 +0000"  >&lt;p&gt;Assigned to Guilherme&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1991] Add parameter indexBy to EntityRepository-&gt;createQueryBuilder()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1991</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;createQueryBuilder() currently doesn&#8217;t have a parameter to set the third option on the FROM fragment: indexBy. Right now you have to read it, create a new From with the read properties and your desired indexBy value and replace the existing one on the QueryBuilder.&lt;/p&gt;

&lt;p&gt;Should be ten minutes&#8217; work including tests. Thanks a lot!&lt;/p&gt;</description>
                <environment></environment>
            <key id="13977">DDC-1991</key>
            <summary>Add parameter indexBy to EntityRepository-&gt;createQueryBuilder()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="corphi">Philipp Cordes</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Aug 2012 07:52:31 +0000</created>
                <updated>Mon, 20 Aug 2012 07:52:31 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1986] findBy hydration with limit and offset with Oracle database (oci8 driver)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1986</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I tried to use the findBy method with limit and offset parameters against an Oracle database using oci8 driver.&lt;/p&gt;

&lt;p&gt;The query seems to executed successfully but the hydrator fails when hydrating data as there is a DOCTRINE_ROWNUM column appending the &quot;limit&quot; clause.&lt;/p&gt;

&lt;p&gt;Here is the exception thrown :  &quot;Notice: Undefined index: DOCTRINE_ROWNUM in &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 183&quot;&lt;/p&gt;

&lt;p&gt;I was thinking about something like this to fix this issue &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;add an attribute (platformExtraColumns) to the platform class, storing every column added by methods like doModifyLimitQuery&lt;/li&gt;
	&lt;li&gt;check in hydrator method hydrateRowData if the column exists among the extra columns attribute of the custom platform&lt;/li&gt;
	&lt;li&gt;don&apos;t use the column if true&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Maybe there is a better approach, what are your thoughts?&lt;/p&gt;</description>
                <environment>composer.json require :&lt;br/&gt;
&lt;br/&gt;
&amp;quot;php&amp;quot;: &amp;quot;&amp;gt;=5.3.3&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/symfony&amp;quot;: &amp;quot;2.1.*&amp;quot;,&lt;br/&gt;
&amp;quot;doctrine/orm&amp;quot;: &amp;quot;&amp;gt;=2.2.3,&amp;lt;2.4-dev&amp;quot;,&lt;br/&gt;
&amp;quot;doctrine/doctrine-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;twig/extensions&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/assetic-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/swiftmailer-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/monolog-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;sensio/distribution-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;sensio/framework-extra-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;sensio/generator-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;jms/security-extra-bundle&amp;quot;: &amp;quot;1.2.*&amp;quot;,&lt;br/&gt;
&amp;quot;jms/di-extra-bundle&amp;quot;: &amp;quot;1.1.*&amp;quot;,&lt;br/&gt;
&amp;quot;twitter/bootstrap&amp;quot;: &amp;quot;master&amp;quot;,&lt;br/&gt;
&amp;quot;friendsofsymfony/rest-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;doctrine/doctrine-fixtures-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;</environment>
            <key id="13970">DDC-1986</key>
            <summary>findBy hydration with limit and offset with Oracle database (oci8 driver)</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="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="benja-m-1">Benjamin Grandfond</reporter>
                        <labels>
                        <label>oracle</label>
                    </labels>
                <created>Fri, 17 Aug 2012 09:57:38 +0000</created>
                <updated>Tue, 8 Jan 2013 09:33:00 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18524" author="benja-m-1" created="Fri, 17 Aug 2012 10:36:35 +0000"  >&lt;p&gt;I implemented it in my forks :&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/benja-M-1/doctrine2/commit/c8d899b14446accf869ddc0043f4235284375755&quot; class=&quot;external-link&quot;&gt;https://github.com/benja-M-1/doctrine2/commit/c8d899b14446accf869ddc0043f4235284375755&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/benja-M-1/dbal/commit/b9423c8d46a2bcdaa5a1f0b26a9a28259b1e44a2&quot; class=&quot;external-link&quot;&gt;https://github.com/benja-M-1/dbal/commit/b9423c8d46a2bcdaa5a1f0b26a9a28259b1e44a2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It works for me, but I didn&apos;t write unit tests.&lt;/p&gt;</comment>
                    <comment id="18537" author="benja-m-1" created="Fri, 24 Aug 2012 13:12:43 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Did you have time to have a look at this issue?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18538" author="stof" created="Fri, 24 Aug 2012 13:33:52 +0000"  >&lt;p&gt;Please send a pull request when you submit a fix. It is the proper way to submit them for review. When we want to see things waiting for review, we look at the list of pending PRs, not at all comments of the issue tracker to find links in them.&lt;/p&gt;

&lt;p&gt;And I can tell you that this change has a big issue: it introduces a state in the database platform whereas it is currently stateless. This is likely to cause some issues when using more than 1 query (which is a common use case).&lt;/p&gt;</comment>
                    <comment id="18555" author="benja-m-1" created="Wed, 29 Aug 2012 07:38:06 +0000"  >&lt;p&gt;Hi Christophe thank you for your feedback.&lt;/p&gt;

&lt;p&gt;I didn&apos;t send a PR because I wanted someone sharing his thoughts about what I suggested in this current issue. However I don&apos;t really understand the stateless argument, can you explain a bit more?&lt;/p&gt;

&lt;p&gt;Otherwise how would do you proceed to tell Doctrine not to hydrate platform-specific columns?&lt;/p&gt;
</comment>
                    <comment id="18556" author="stof" created="Wed, 29 Aug 2012 08:17:48 +0000"  >&lt;p&gt;If you run several queries, they will be affected by the extra columns of previous requests, which is wrong&lt;/p&gt;</comment>
                    <comment id="18557" author="beberlei" created="Wed, 29 Aug 2012 08:22:43 +0000"  >&lt;p&gt;I think the ObjectHydrator catches this by skipping undefined columns, i think we might just have overoptimized the SimpleObjectHydrator a little bit.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1971] [GH-419] Add ODM embedded-like functionality</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1971</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of djlambert:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/419&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/419&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;This PR adds ODM embedded-like functionality to the ORM.&lt;/p&gt;

&lt;p&gt;Including the new &lt;b&gt;@MappedAssociation&lt;/b&gt; annotation on a field having a one-to-one association adds a discriminator column to the table for storing the class name of a &quot;mapped&quot; entity.&lt;/p&gt;

&lt;p&gt;This allows a class or mapped superclass with a one-to-one identifying association to be extended by additional entities without requiring any code changes (as is required with the discriminator map when using inheritance).&lt;/p&gt;

&lt;p&gt;I apologize if this is the incorrect way to submit a feature request. Currently just the annotation driver has been updated, I wanted to get feedback before continuing with the remaining drivers. Models and tests are included.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13947">DDC-1971</key>
            <summary>[GH-419] Add ODM embedded-like functionality</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Aug 2012 21:41:06 +0000</created>
                <updated>Tue, 14 Aug 2012 21:33:31 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<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>

<item>
            <title>[DDC-1965] Multiple Index fails if index name not specified</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1965</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;@ORM\Table(name=&quot;applications&quot;, indexes={@ORM\Index(name=&quot;csl_idx&quot;, columns=&lt;/p&gt;
{&quot;createdAt&quot;, &quot;status&quot;, &quot;loanType&quot;}), @ORM\Index(name=&quot;s_idx&quot;, columns={&quot;status&quot;}), @ORM\Index(name=&quot;l_idx&quot;, columns={&quot;loanType&quot;})})&lt;br/&gt;
&lt;br/&gt;
the above Annotation creates 3 different indexes BUT when: &lt;br/&gt;
* @ORM\Table(name=&quot;applications&quot;, indexes={@ORM\Index(columns={&quot;createdAt&quot;, &quot;status&quot;, &quot;loanType&quot;}
&lt;p&gt;), @ORM\Index(columns=&lt;/p&gt;
{&quot;status&quot;}
&lt;p&gt;), @ORM\Index(columns=&lt;/p&gt;
{&quot;loanType&quot;}
&lt;p&gt;)})&lt;/p&gt;

&lt;p&gt;index-names not specified Symfony2 schemaUpdate tools shows only the last Index&lt;/p&gt;
</description>
                <environment>Ubuntu 11.04, PHP 5.3.6 with Suhosin-patch, Symfony 2.0.15</environment>
            <key id="13906">DDC-1965</key>
            <summary>Multiple Index fails if index name not specified</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="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="pont">Pont</reporter>
                        <labels>
                        <label>Cli</label>
                    </labels>
                <created>Thu, 2 Aug 2012 07:17:04 +0000</created>
                <updated>Thu, 2 Aug 2012 07:17:04 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1963] Remove by-ref access to changeset in lifecycle event args</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1963</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;UoW currently passes computed changesets to lifecycle event args byref. This has to be changed to force users to use UoW public API to modify changesets instead.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13903">DDC-1963</key>
            <summary>Remove by-ref access to changeset in lifecycle event args</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="ocramius">Marco Pivetta</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Jul 2012 15:45:24 +0000</created>
                <updated>Tue, 31 Jul 2012 15:45:24 +0000</updated>
                                                    <fixVersion>Git Master</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1960] mapping joins in native queries breaks if select columns are starting with columns from joined table</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1960</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using a simple Testcase like in &lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/native-sql.html&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/native-sql.html&lt;/a&gt; there are two Tables:&lt;/p&gt;

&lt;p&gt;*) users:&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;
   Column   |  Type   | Modifiers | Storage  | Description 
------------+---------+-----------+----------+-------------
 u_id       | integer | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | plain    | 
 u_name     | text    | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | extended | 
 address_id | integer | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | plain    | 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;*) address:&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;
  Column  |  Type   | Modifiers | Storage  | Description 
----------+---------+-----------+----------+-------------
 a_id     | integer | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | plain    | 
 a_street | text    | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | extended | 
 a_city   | text    | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | extended | 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;address_id is a foreign key to address;&lt;/p&gt;

&lt;p&gt;Now i created the Entities and setup a native query using ResultSetMappingBuilder:&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;
$rsm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Query\ResultSetMappingBuilder($entityManager);
$rsm-&amp;gt;addRootEntityFromClassMetadata(&apos;MyProject\Entity\Users&apos;, &apos;u&apos;);
$rsm-&amp;gt;addJoinedEntityFromClassMetadata(&apos;MyProject\Entity\Address&apos;, &apos;a&apos;, &apos;u&apos;, &apos;address&apos;);

$query = &apos;
    SELECT
        u.*,
        a.*
    FROM
        users u
    LEFT JOIN address a ON (u.address_id = a.a_id)
&apos;;

/** @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt; \Doctrine\ORM\NativeQuery */
$&lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt; = $entityManager-&amp;gt;createNativeQuery($query, $rsm);

$ret = $&lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt;-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This returns the Entities correctly:&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;
array(2) {
  [0] =&amp;gt;
  class MyProject\Entity\Users#61 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;Smith&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    class MyProject\Entity\Address#63 (4) {
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $street =&amp;gt;
      string(8) &lt;span class=&quot;code-quote&quot;&gt;&quot;Broadway&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city =&amp;gt;
      string(8) &lt;span class=&quot;code-quote&quot;&gt;&quot;New York&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $users =&amp;gt;
      class Doctrine\ORM\PersistentCollection#64 (9) {
        ...
      }
    }
  }
  [1] =&amp;gt;
  class MyProject\Entity\Users#66 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(7) &lt;span class=&quot;code-quote&quot;&gt;&quot;Sherlok&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    class MyProject\Entity\Address#67 (4) {
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $street =&amp;gt;
      string(13) &lt;span class=&quot;code-quote&quot;&gt;&quot;Oxford Street&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city =&amp;gt;
      string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;London&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $users =&amp;gt;
      class Doctrine\ORM\PersistentCollection#68 (9) {
        ...
      }
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;BUT if you change the order of the select columns starting with ones from address you get borked Data:&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;
$query = &apos;
    SELECT
        a.*,
        u.*
    FROM
        users u
    LEFT JOIN address a ON (u.address_id = a.a_id)
&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;
array(2) {
  [0] =&amp;gt;
  class MyProject\Entity\Users#61 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;Smith&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    class MyProject\Entity\Address#63 (4) {
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $street =&amp;gt;
      string(13) &lt;span class=&quot;code-quote&quot;&gt;&quot;Oxford Street&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city =&amp;gt;
      string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;London&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $users =&amp;gt;
      class Doctrine\ORM\PersistentCollection#64 (9) {
        ...
      }
    }
  }
  [1] =&amp;gt;
  class MyProject\Entity\Users#66 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(7) &lt;span class=&quot;code-quote&quot;&gt;&quot;Sherlok&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    NULL
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This happens because the function Doctrine\ORM\Internal\Hydration\AbstractHydrator::_gatherRowData does not consider the Mapping i set up. Instead it just add the columns as they get starting with address ones.&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Internal\Hydration\ObjectHydrator::_hydrateRow then knows the Mapping and ignores the first Address as there is no User to map on, cycling to the next row will then add the address of the second row to the user from the first one.&lt;/p&gt;

&lt;p&gt;There are multiple ways to fix this. One would be to consider the mapping in _gatherRowData, the second to rewrite the _hydrateRow generating the Entities first and then the mapping in a second foreach loop.&lt;/p&gt;

&lt;p&gt;This bugger had me for 2 days until i finally figured it out.&lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;</description>
                <environment>ubuntu kernel 2.6.32-40-server&lt;br/&gt;
php 5.3.10-1ubuntu2ppa6~lucid with Suhosin-Patch (cli)&lt;br/&gt;
apache 2 2.2.14-5ubuntu8.9&lt;br/&gt;
postgres 9.1.4-1~lucid4</environment>
            <key id="13900">DDC-1960</key>
            <summary>mapping joins in native queries breaks if select columns are starting with columns from joined table</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="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="dready">Thomas Subera</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Jul 2012 11:23:21 +0000</created>
                <updated>Wed, 21 Nov 2012 23:48:37 +0000</updated>
                                    <version>2.1.4</version>
                <version>2.1.7</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19022" author="frederes" created="Wed, 21 Nov 2012 23:30:34 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Has same issue with using DQL /createQuery() ! Try all the day to find where was my mistake but seems to be a CRITICAL bug !&lt;br/&gt;
How did you solve this ?&lt;/p&gt;


&lt;p&gt;Doctrine version used : 2.3.1-DEV&lt;/p&gt;

&lt;p&gt;&amp;lt;code&amp;gt;&lt;br/&gt;
$query = $this-&amp;gt;getEntityManager()-&amp;gt;createQuery(&quot;&lt;br/&gt;
            SELECT cc, oc&lt;br/&gt;
            FROM  category cc&lt;br/&gt;
                JOIN cc.offer_category oc&lt;br/&gt;
            WHERE cc.catalog = :catalog_id&lt;br/&gt;
            ORDER BY oc.name ASC&lt;br/&gt;
            &quot;)&lt;br/&gt;
            -&amp;gt;setParameter(&quot;:catalog_id&quot;, $catalog_id)&lt;br/&gt;
            ;&lt;/p&gt;

&lt;p&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;

&lt;p&gt;Problem is that the order of the Aliases (cc, oc) is not considered on building SQL .&lt;br/&gt;
In my case, in the ObjectHydrator::hydrateRowData method :&lt;/p&gt;

&lt;p&gt;$rowData = $this-&amp;gt;gatherRowData($row, $cache, $id, $nonemptyComponents);&lt;/p&gt;

&lt;p&gt;returns &lt;/p&gt;

&lt;p&gt;Array&lt;br/&gt;
(&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;oc&amp;#93;&lt;/span&gt; =&amp;gt; Array&lt;br/&gt;
          (&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; =&amp;gt; 14&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; =&amp;gt; toto&lt;br/&gt;
        )&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;cc&amp;#93;&lt;/span&gt; =&amp;gt; Array&lt;br/&gt;
        (&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;catalog_id&amp;#93;&lt;/span&gt; =&amp;gt; 1&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;offer_category_id&amp;#93;&lt;/span&gt; =&amp;gt; 14&lt;br/&gt;
        )&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;As &quot;oc&quot; is a mapping, on the first loop the $parentAlias is not yet known and so :&lt;br/&gt;
&amp;lt;code&amp;gt;&lt;br/&gt;
if ($this-&amp;gt;_rsm-&amp;gt;isMixed &amp;amp;&amp;amp; isset($this-&amp;gt;_rootAliases&lt;span class=&quot;error&quot;&gt;&amp;#91;$parentAlias&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                    echo &quot;parentObject 1\n&quot;;
                    $first = reset($this-&amp;gt;_resultPointers);
                    $parentObject = $first[key($first)];
                }
&lt;p&gt; else if (isset($this-&amp;gt;_resultPointers&lt;span class=&quot;error&quot;&gt;&amp;#91;$parentAlias&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                    echo $parentAlias.&quot; parentObject 2\n&quot;;
                    $parentObject = $this-&amp;gt;_resultPointers[$parentAlias];
                }
&lt;p&gt; else &lt;/p&gt;
{
                    // HERE : on first loop, for &quot;oc&quot;, parent not yet known so skipped !!!
                    continue;
                }
&lt;p&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;

&lt;p&gt;using a workaround on ObjectHydrator::hydrateRowData like this :&lt;br/&gt;
$rowData = array_reverse($rowData);&lt;/p&gt;

&lt;p&gt;make it work...&lt;/p&gt;

&lt;p&gt;Sorry for my dirty explanation... &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11215" name="testcase.zip" size="5941" author="dready" created="Tue, 31 Jul 2012 11:23:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1957] DB -&gt; Entity: Reverse engeniering with two relations between two tables</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1957</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i use the cli from the symfony 2.1 project to reverse from DB to Entity:&lt;/p&gt;

&lt;p&gt;php app/console doctrine:mapping:convert xml ./src/Acme/StoreBundle/Resources/config/doctrine/metadata/orm --from-database --force&lt;/p&gt;

&lt;p&gt;and i get tis error:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine\ORM\Mapping\MappingException&amp;#93;&lt;/span&gt;&lt;br/&gt;
Property &quot;radUser&quot; in &quot;RadAttribute&quot; was already declared, but it must be declared only once&lt;/p&gt;

&lt;p&gt;so i have a table &quot;radUser&quot; with two m:n relations to the same table &quot;radAttributes&quot;:&lt;/p&gt;

&lt;p&gt;Table radUser:&lt;br/&gt;
check =&amp;gt; radAttributes&lt;br/&gt;
reply =&amp;gt; radAttributes&lt;/p&gt;

&lt;p&gt;so doctrine reverse mapping try to generate the radAttribute entity with two mapping to radUser with the same field name &quot;radUser&quot;, what can i do to prevent this issue ?&lt;/p&gt;</description>
                <environment>windows 7, php 5.3, symfony 2.1</environment>
            <key id="13895">DDC-1957</key>
            <summary>DB -&gt; Entity: Reverse engeniering with two relations between two tables</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="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="skydiablo">sky diablo</reporter>
                        <labels>
                        <label>Cli</label>
                    </labels>
                <created>Sun, 29 Jul 2012 16:13:10 +0000</created>
                <updated>Sun, 29 Jul 2012 16:14:25 +0000</updated>
                                    <version>2.2</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1954] Specialized Batch Insert Mode for the Entity Manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1954</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;While it is already possible to speed up batch inserts by using raw SQL, that has the disadvantage to maintain a separate set of code that needs to be kept in sync with your schema.&lt;/p&gt;

&lt;p&gt;Therefore, it would be nice if the entity manager would provide a special batch insert mode where it can skip the change tracking related features, collection snapshots, etc. This might already be good enough for many people.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13892">DDC-1954</key>
            <summary>Specialized Batch Insert Mode for the Entity Manager</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="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Jul 2012 11:35:32 +0000</created>
                <updated>Sun, 29 Jul 2012 11:35:32 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1947] Update EBNF with arbitrary joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1947</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Arbitrary joins need to be documented in EBNF&lt;/p&gt;</description>
                <environment></environment>
            <key id="13883">DDC-1947</key>
            <summary>Update EBNF with arbitrary joins</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="ocramius">Marco Pivetta</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Jul 2012 12:10:35 +0000</created>
                <updated>Thu, 26 Jul 2012 12:10:35 +0000</updated>
                                    <version>2.3</version>
                <version>Git Master</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1940] Doctrine DQL: erroneous sql generation from dql join with &quot;WITH&quot; or &quot;WHERE&quot; clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1940</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m having big troubles while developing a quietly advanced DQL query for a tiny DMS: The schema: DmsObject is a superclass for which two subclasses exist (document and folder) UserRights and GroupRight (which are associative entities in the db, pointing respectively to user and group tables). User and Group represent (obvious) the dms &quot;actors&quot;.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
SELECT o, ur, gr 
from module\EDMS\business\DmsObject o 
join o.userRights ur 
join o.groupRights gr
WHERE o.ownerUser=ur.user
AND o.ownerGroup=gr.group
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The WHERE condition is WRONG! Doctrine switches the two tables. I&apos;ve already checked the mapping (it&apos;s ok!) and checked also where the fk&apos;s point in the database (ok!).&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
...
LEFT JOIN dms_folder d1_ 
    ON d0_.id = d1_.id 
LEFT JOIN dms_document d2_ 
    ON d0_.id = d2_.id 
INNER JOIN dms_user_object_rights d3_ 
    ON d0_.id = d3_.document_id 
INNER JOIN dms_group_object_rights d4_ 
    ON d0_.id = d4_.document_id 
WHERE d0_.sys_group_owner = d3_.user_id 
    AND d0_.sys_user_owner = d4_.group_id
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This seems to be a bug in the DQL translator.&lt;/p&gt;</description>
                <environment>LAMP, debian squeeze</environment>
            <key id="13875">DDC-1940</key>
            <summary>Doctrine DQL: erroneous sql generation from dql join with &quot;WITH&quot; or &quot;WHERE&quot; clause</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="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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="noise085">Enea Bette</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Jul 2012 11:38:08 +0000</created>
                <updated>Sun, 14 Apr 2013 15:27:06 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>7</watches>
                        <comments>
                    <comment id="18406" author="beberlei" created="Sun, 29 Jul 2012 09:33:35 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=noise085&quot; class=&quot;user-hover&quot; rel=&quot;noise085&quot;&gt;Enea Bette&lt;/a&gt; Can you attach the entities (stripped down to the fields we need here)?&lt;/p&gt;

&lt;p&gt;Can you check guilherme? This looks really weird.&lt;/p&gt;

&lt;p&gt;It should be:&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;
WHERE d0_.sys_user_owner = d3_.user_id AND d0_.sys_group_owner = d4_.group_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="18412" author="guilhermeblanco" created="Sun, 29 Jul 2012 15:49:59 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=noise085&quot; class=&quot;user-hover&quot; rel=&quot;noise085&quot;&gt;Enea Bette&lt;/a&gt; Can you please provide your entities?&lt;br/&gt;
I can try to reproduce the issue, but I need your entities as a base for a failing unit test.&lt;/p&gt;</comment>
                    <comment id="19982" author="hugohenrique" created="Thu, 11 Apr 2013 19:19:22 +0000"  >&lt;p&gt;I&apos;m having a similar problem with the 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;SELECT um, p FROM Ciwwic\AppBundle\Entity\Provider p LEFT JOIN Ciwwic\UserBundle\Entity\UserMeta um WITH um.user = p.id WHERE p.id = 30&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When you run this query DQL she returns an empty array. &lt;br/&gt;
I getting solve my problem by adding WHERE clauses example as:&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;SELECT p, um FROM Ciwwic\AppBundle\Entity\Provider p LEFT JOIN Ciwwic\UserBundle\Entity\UserMeta um WHERE p.id = 30 AND um.user = 30&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20011" author="fabio.bat.silva" created="Sun, 14 Apr 2013 15:27:06 +0000"  >&lt;p&gt;Hi Enea&lt;/p&gt;

&lt;p&gt;If i got it correctly&lt;br/&gt;
Your associations &lt;b&gt;DmsObject#ownerUser&lt;/b&gt; and &lt;b&gt;DmsObject#ownerGroup&lt;/b&gt; are flipped.&lt;br/&gt;
Note that &lt;b&gt;ownerUser&lt;/b&gt; points to &lt;b&gt;sys_group_owner&lt;/b&gt; and &lt;b&gt;ownerGroup&lt;/b&gt; to &lt;b&gt;sys_user_owner&lt;/b&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;/**
 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\User&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_group_owner&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; $ownerUser;
/**
 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\Group&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_user_owner&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; $ownerGroup;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It should be :&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\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\User&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_user_owner&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; $ownerUser;

/**
 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\Group&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_group_owner&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; $ownerGroup;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="14374">DDC-2235</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="11213" name="Entities.rar" size="6730" author="noise085" created="Mon, 30 Jul 2012 07:06:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1938] [GH-406] [WIP] - DCOM-96 - Moving proxy generation and autoloading to common</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1938</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of Ocramius:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/406&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/406&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;This PR is related to doctrine/common#168. &lt;/p&gt;

&lt;p&gt;In this PR, the `ProxyFactory` has been reduced to an object builder and it&apos;s public API has been kept intact (While the proxy `Autoloader` has been moved to doctrine/common). It would be interesting to define what this builder could do with the `ProxyFactory` to get its own customizations introduced.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13872">DDC-1938</key>
            <summary>[GH-406] [WIP] - DCOM-96 - Moving proxy generation and autoloading to common</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 Jul 2012 23:26:43 +0000</created>
                <updated>Sat, 26 Jan 2013 23:53:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19408" author="beberlei" created="Fri, 25 Jan 2013 16:25:23 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-247&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/common/pull/247&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/247&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19422" author="beberlei" created="Sat, 26 Jan 2013 23:53:35 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-247&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/common/pull/247&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/247&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1924] Let SQLFilters know the query type it is being applied to</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1924</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m making an access control system and would like to automatically filter all queries based current user, targetEntity type and query type. Query type is relevant as different permissions are needed by the user for SELECT, UPDATE, DELETE and INSERT queries.&lt;/p&gt;

&lt;p&gt;I can access the first two things in my filter easily enough, but I cannot find a way to have the filter know what type of query the filter is being applied to.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13851">DDC-1924</key>
            <summary>Let SQLFilters know the query type it is being applied to</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="shne">Jan Knudsen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Jul 2012 09:23:12 +0000</created>
                <updated>Fri, 13 Jul 2012 10:59:35 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18301" author="beberlei" created="Fri, 13 Jul 2012 09:42:32 +0000"  >&lt;p&gt;The Filter API only makes sense for SELECT clauses. Doctrine itself does not use DQL to do updates internally, so you need to use other mechanisms (EventListener) to prevent this operations if they are not allowed for a user.&lt;/p&gt;</comment>
                    <comment id="18302" author="shne" created="Fri, 13 Jul 2012 09:51:55 +0000"  >&lt;p&gt;But I can make custom DQL to update rows and would like to automatically filter this too.&lt;/p&gt;

&lt;p&gt;e.g. $em-&amp;gt;createQuery(&quot;UPDATE SomeEntity se SET se.field = &quot;updated!&quot;)-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;The lifecycle events preUpdate etc. are not called when doing custom DQL queries.&lt;/p&gt;

&lt;p&gt;Maybe it is bad practice and discouraged to do updates, inserts and deletes as custom DQL queries, but I would like to ensure that the other people in my organization can&apos;t accidentally bypass the Access Control, even if they make use of such bad practice.&lt;/p&gt;

&lt;p&gt;And if the filter API only makes sense for Select statements, why are filters applied to update/delete/etc. statements too?&lt;/p&gt;</comment>
                    <comment id="18304" author="beberlei" created="Fri, 13 Jul 2012 10:41:38 +0000"  >&lt;p&gt;Well, they are applied to DQL UPDATE/DELETE. But not not UPDATE/DELETE that works through the internals of Doctrine. So yes, you can use it to filter DQL DELETE/UPDATE, but doctrine does not do that internally.&lt;/p&gt;

&lt;p&gt;So you have to have two strategies, a DQL/SQL Filter - and Lifecycle events.&lt;/p&gt;</comment>
                    <comment id="18305" author="shne" created="Fri, 13 Jul 2012 10:59:19 +0000"  >&lt;p&gt;Which is fine by me. I already implemented the checks using lifecycle events before opening this issue. The access control is automatically handled when using the entitymanager and not custom DQL.&lt;/p&gt;

&lt;p&gt;Now I would also like to filter the custom DQL, but currently I can&apos;t, because as originally stated, the filter needs to know which type of query it is being applied to.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1923] Type conversion error with oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1923</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;https://github.com/symfony/symfony/pull/4730&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/pull/4730&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13850">DDC-1923</key>
            <summary>Type conversion error with oracle</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="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="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Jul 2012 10:40:41 +0000</created>
                <updated>Thu, 12 Jul 2012 10:40:41 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1913] Updates for Fedora packaging</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1913</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am packaging the DoctrineDBAL PEAR package for Fedora and would like to have the following updates:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;package.xml role for LICENSE changed from &quot;data&quot; to &quot;doc&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;package.xml role for UPGRADE* changed from &quot;data&quot; to &quot;doc&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;package.xml role for Doctrine/ORM/README.markdown changed from &quot;data&quot; to &quot;doc&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;add some content to Doctrine/ORM/README.markdown (when building RPM this file throws a warning because it is empty)&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;doctrine.bat should only be installed on Windows OS&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Fedora</environment>
            <key id="13830">DDC-1913</key>
            <summary>Updates for Fedora packaging</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="siwinski">Shawn Iwinski</reporter>
                        <labels>
                    </labels>
                <created>Sat, 7 Jul 2012 03:40:25 +0000</created>
                <updated>Sat, 7 Jul 2012 03:56:52 +0000</updated>
                                    <version>2.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1899] [GH-385] set metadata for interface to be able to fetch entites by interface name</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1899</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of Burgov:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/385&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/385&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;using the new ResolveTargetEntity functionality we noticed we needed another feature:&lt;/p&gt;

&lt;p&gt;From the Symfony Bundle defining the interface, we&apos;d like to be able to fetch entities by this very interface name, e.g.:&lt;/p&gt;

&lt;p&gt;``` php&lt;br/&gt;
$em-&amp;gt;find(&apos;Foo\BarBundle\Entity\PersonInterface&apos;, 1);&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;``` php&lt;br/&gt;
$em-&amp;gt;getRepository(&apos;Foo\BarBundle\Entity\PersonInterface&apos;)-&amp;gt;findAll();&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;This PR sets metadata for the interface when metadata for a class is loaded that the interface is configured for&lt;/p&gt;</description>
                <environment></environment>
            <key id="13808">DDC-1899</key>
            <summary>[GH-385] set metadata for interface to be able to fetch entites by interface name</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Jun 2012 10:22:55 +0000</created>
                <updated>Sat, 7 Jul 2012 15:02:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1894] Cannot view Doctrine 2.2 QueryBuilder documentation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1894</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Visiting the following page:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.QueryBuilder.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.QueryBuilder.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;always redirects back to &lt;a href=&quot;http://www.doctrine-project.org/api/orm/2.2/&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/api/orm/2.2/&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Chrome, Firefox, Safari on OS X</environment>
            <key id="13803">DDC-1894</key>
            <summary>Cannot view Doctrine 2.2 QueryBuilder documentation</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dteoh">Douglas Teoh</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jun 2012 06:09:24 +0000</created>
                <updated>Wed, 27 Jun 2012 06:09:24 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1884] leftJoin via composite key part not hydrated if joining table solely consists of identifiers</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1884</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Suppose I have the following entities:
&lt;br class=&quot;atl-forced-newline&quot; /&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;/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver&quot;&lt;/span&gt;)
 */
class Driver
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    
    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=255);
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;
    
    /**
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;DriverRide&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $driverRides;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver_ride&quot;&lt;/span&gt;)
 */
class DriverRide
{
    /**
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Driver&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;driverRides&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver_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;private&lt;/span&gt; $driver;
    
    /**
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Car&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;carRides&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;car&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;brand&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $car;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;car&quot;&lt;/span&gt;)
 */
class Car
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=25)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;NONE&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $brand;
    
    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=255);
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $model;
    
    /**
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;DriverRide&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;car&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $carRides;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And want to query for Cars that a Driver drove in:
&lt;br class=&quot;atl-forced-newline&quot; /&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;$qb = $em-&amp;gt;createQueryBuilder();

$qb-&amp;gt;select(&apos;d, dr, c&apos;)
   -&amp;gt;from(&apos;Driver&apos;, &apos;d&apos;)
   -&amp;gt;leftJoin(&apos;d.driverRides&apos;, &apos;dr&apos;)
   -&amp;gt;leftJoin(&apos;dr.car&apos;, &apos;c&apos;)
   -&amp;gt;where(&apos;d.id = ?1&apos;) /* some Driver id */
   -&amp;gt;getQuery()-&amp;gt;getArrayResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Expected results:&lt;/b&gt;&lt;br/&gt;
I expect to get an array with an index &apos;driverRides&apos; with an array of Cars (depending on the data of course).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Actual result:&lt;/b&gt;&lt;br/&gt;
Just an array with Driver data.&lt;/p&gt;

&lt;p&gt;When I started doing some testing I found out I get a different result when I add a third column to the DriverRide table that isn&apos;t part of the composite primary key.&lt;br/&gt;
Now I did get a &apos;driverRides&apos; array, but with just a single row and not three as I expected to get in my case.&lt;/p&gt;

&lt;p&gt;When I removed the composite key and used an auto-generated id-column, everything worked as expected.&lt;/p&gt;

&lt;p&gt;Some test data you might want to use:&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;INSERT INTO `car` (`brand`, `model`) VALUES
(&apos;BMW&apos;, &apos;7 Series&apos;),
(&apos;Crysler&apos;, &apos;300&apos;),
(&apos;Mercedes&apos;, &apos;C-&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt;&apos;),
(&apos;Volvo&apos;, &apos;XC90&apos;);

INSERT INTO `driver` (`id`, `name`) VALUES
(1, &apos;John Doe&apos;),
(2, &apos;Foo Bar&apos;);

INSERT INTO `driver_ride` (`driver_id`, `car`) VALUES
(1, &apos;Crysler&apos;),
(1, &apos;Mercedes&apos;),
(1, &apos;Volvo&apos;),
(2, &apos;BMW&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>MAMP</environment>
            <key id="13791">DDC-1884</key>
            <summary>leftJoin via composite key part not hydrated if joining table solely consists of identifiers</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="scoolen">Sander Coolen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jun 2012 15:06:08 +0000</created>
                <updated>Thu, 9 May 2013 22:14:27 +0000</updated>
                                    <version>2.2.0-RC1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18195" author="beberlei" created="Thu, 5 Jul 2012 19:11:27 +0000"  >&lt;p&gt;Can you update to at least 2.2.1 and try again, because this fix here &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1652&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1652&lt;/a&gt; look like it could be related to your problem.&lt;/p&gt;</comment>
                    <comment id="18224" author="scoolen" created="Sat, 7 Jul 2012 14:46:47 +0000"  >&lt;p&gt;We&apos;re already using the 2.2.x-dev package. It does look similar to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1652&quot; title=&quot;ArrayHydrator with composite primary key&quot;&gt;&lt;del&gt;DDC-1652&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18241" author="scoolen" created="Sun, 8 Jul 2012 12:34:57 +0000"  >&lt;p&gt;Added testcase on 2.1.x (not the right one unfortunately) branch: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/395&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/395&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;BTW I was adding said testcase on master and got an error similar to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-979&quot; title=&quot;ArrayHydrator::updateResultPointer() must be an array, string given&quot;&gt;&lt;del&gt;DDC-979&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20261" author="beberlei" created="Thu, 9 May 2013 22:14:27 +0000"  >&lt;p&gt;I upgraded the testcase to master locally, and it seems to fail on Array hydration only now, with a notice:&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;Exception: [PHPUnit_Framework_Error] Argument 1 passed to Doctrine\ORM\Internal\Hydration\ArrayHydrator::updateResultPointer() must be of the type array, string given, called in /home/benny/code/php/workspace/doctrine2/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php on line 196 and defined
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I remember fixing something similar for ObjectHydration (which works for your testcases). Will investigate more when I have time.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1882] AbstractQuery#getResultCacheId() should be public to be able to manage the cache</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1882</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The method getResultCacheId of Doctrine\ORM\AbstractQuery should be public.&lt;/p&gt;

&lt;p&gt;I&apos;m trying to customize the cache refresh mechanism to clear previously cached objects in my app.&lt;br/&gt;
To do that I&apos;m adding a prefix to define regions in the cache.&lt;br/&gt;
To be able to set the Id&apos;s correctly (adding region prefixes) I need to get the &quot;normal&quot; hash doctrine were used in the normal scenario (trying to avoid introduce new code).&lt;br/&gt;
That&apos;s why I will prefer the method to be public.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13788">DDC-1882</key>
            <summary>AbstractQuery#getResultCacheId() should be public to be able to manage the cache</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="ignaciolarranaga">Ignacio Larranaga</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jun 2012 17:37:43 +0000</created>
                <updated>Tue, 19 Jun 2012 17:38:39 +0000</updated>
                                    <version>2.1.6</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18099" author="ignaciolarranaga" created="Tue, 19 Jun 2012 17:38:39 +0000"  >&lt;p&gt;Attaching the patch despite is a trivial change.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11198" name="AbstractQuery.patch" size="762" author="ignaciolarranaga" created="Tue, 19 Jun 2012 17:38:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1879] Orphans are neither nulled nor removed when merging a graph of detached entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1879</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging a graph of detached entities, the created entitied are created and the updated entities are updated but the non-present entities (which exist in the database but are not in the graph) are neither removed nor have them their association column nullified.&lt;/p&gt;

&lt;p&gt;Example :&lt;/p&gt;

&lt;p&gt;In my code I have 2 entities : Parent and Child. There is a OneToMany(cascade=&lt;/p&gt;
{&quot;all&quot;}
&lt;p&gt;, orphanRemoval=true) relation defined in Parent.&lt;/p&gt;

&lt;p&gt;In my database I have a Parent row with an id of 1, which has 3 Children with ids 1,2,3.&lt;/p&gt;

&lt;p&gt;When I write the following code, I expect the Parent with id 1 and the Child  with id 2 to be updated, a new Child to be created and the Child with id 1 and 3 to be deleted.&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;
$parent = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Parent(); $parent-&amp;gt;id = 1  &lt;span class=&quot;code-comment&quot;&gt;// detached entity
&lt;/span&gt;$existing_child = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Child(); $child-&amp;gt;id = 2 &lt;span class=&quot;code-comment&quot;&gt;// detached entity
&lt;/span&gt;$new_child = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Child(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; entity
&lt;/span&gt;$dinner-&amp;gt;addChild($existing_child);
$dinner-&amp;gt;addChild($new_child);

$em-&amp;gt;merge($dinner);

$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The objects I expect to be created and updated have the correct behaviour but the old children are not touched, they are still present in the database.&lt;/p&gt;</description>
                <environment>Doctrine 2.2.2&lt;br/&gt;
PHP 5.3.10 with Suhosin-Patch&lt;br/&gt;
mysql  Ver 14.14 Distrib 5.5.15, for osx10.7&lt;br/&gt;
Mac OS X 10.7 Lion</environment>
            <key id="13784">DDC-1879</key>
            <summary>Orphans are neither nulled nor removed when merging a graph of detached entities</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="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="systho">Philippe Van Eerdenbrugghe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Jun 2012 15:56:06 +0000</created>
                <updated>Wed, 23 Jan 2013 22:24:05 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19384" author="ocramius" created="Wed, 23 Jan 2013 22:24:02 +0000"  >&lt;p&gt;I don&apos;t think this is valid. Orphan removal scheduling is handled only when an unit of work is available.&lt;/p&gt;

&lt;p&gt;What&apos;s the state of `$dinner` before your example? Can you `var_dump` it?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1860] Make usage of Composer for CLI optional</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1860</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There&apos;s two problems with current CLI implementation:&lt;/p&gt;

&lt;p&gt; 1 - composer `autoload.php` file is hardcoded, which means that it is making assumptions about where `doctrine/orm` has been installed, and it also makes the assumption that `doctrine/orm` is not the main package.&lt;br/&gt;
 2 - composer is a requirement, while requiring it should just fail silently and allow the end user to use his own autoloading strategy&lt;/p&gt;</description>
                <environment></environment>
            <key id="13763">DDC-1860</key>
            <summary>Make usage of Composer for CLI optional</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jun 2012 09:06:53 +0000</created>
                <updated>Sat, 9 Jun 2012 12:56:33 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18072" author="ocramius" created="Sat, 9 Jun 2012 12:56:33 +0000"  >&lt;p&gt;Merged at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/365&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/365&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1859] Implement console command to convert DQL into object running NativeQuery</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1859</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As per our conversation during SFLive Paris 2012, we should create a command that receives a DQL and exposes back to you a PHP code of an object holding a conversion to NativeQuery, which is faster.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13762">DDC-1859</key>
            <summary>Implement console command to convert DQL into object running NativeQuery</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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jun 2012 10:02:01 +0000</created>
                <updated>Fri, 8 Jun 2012 10:02:01 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1858] LIKE and IS NULL operators not supported in HAVING clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1858</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The LIKE and IS NULL operators are not supported in HAVING clause.&lt;/p&gt;

&lt;p&gt;Work:&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu in (3,6)&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu = 3&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu &amp;gt;= 3&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;Don&apos;t work:&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu LIKE 3&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu IS NULL&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu IS NOT NULL&lt;/p&gt;</description>
                <environment>Win7, Mysql</environment>
            <key id="13760">DDC-1858</key>
            <summary>LIKE and IS NULL operators not supported in HAVING clause</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="abhoryo">PETIT Yoann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Jun 2012 20:04:14 +0000</created>
                <updated>Wed, 20 Mar 2013 16:01:11 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="18053" author="ocramius" created="Fri, 8 Jun 2012 07:00:39 +0000"  >&lt;p&gt;I think this has already been fixed in latest master and 2.1.7. Could you just give it a try and eventually confirm?&lt;/p&gt;</comment>
                    <comment id="18058" author="abhoryo" created="Fri, 8 Jun 2012 07:22:34 +0000"  >&lt;p&gt;Already try with 2.17, 2.20 and 2.2.2. This hasn&apos;t been fixed.&lt;/p&gt;</comment>
                    <comment id="18157" author="bdiang" created="Wed, 4 Jul 2012 08:07:03 +0000"  >&lt;p&gt;I&apos;m also having this issue (2.2.2). Is there any workaround for this?&lt;/p&gt;

&lt;p&gt;Column aliases also are not supported in HAVING clause:&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;select(&apos;p&apos;, &apos;COUNT(p.field) as FieldCount&apos;)
            -&amp;gt;from(&apos;Entity&apos;, &apos;p&apos;)
            -&amp;gt;groupBy(&apos;p.id&apos;)
   -&amp;gt;having(&apos;FieldCount IS NULL&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Above code causes error &quot;FieldCount is not pointing to class&quot; and IS NULL causes &quot;Expected =, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, &amp;gt;, &amp;gt;=, !=, got &apos;IS&apos;&quot;&lt;/p&gt;</comment>
                    <comment id="18575" author="beberlei" created="Wed, 29 Aug 2012 12:59:35 +0000"  >&lt;p&gt;Its not a bug as the EBNF says that this is not possible.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=guilhermeblanco&quot; class=&quot;user-hover&quot; rel=&quot;guilhermeblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; Is this something we should support or not?&lt;/p&gt;</comment>
                    <comment id="18576" author="stof" created="Wed, 29 Aug 2012 13:06:17 +0000"  >&lt;p&gt;Another place where it is not supported is in the CASE clause.&lt;/p&gt;

&lt;p&gt;I would vote +1 for supporting it&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1852] Doctrine\ORM\Tools\SchemaValidator should check validity of lifecycle callbacks</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1852</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The schema validator should analyze mapped lifecycle callbacks and:&lt;/p&gt;

&lt;p&gt; a) if some lifecycle callbacks were defined, but no @HasLifecycleCallbacks annotation/mapping was set, warn the user&lt;br/&gt;
 b) if some lifecycle callbacks were defined, but methods are not public, warn the user&lt;/p&gt;</description>
                <environment></environment>
            <key id="13752">DDC-1852</key>
            <summary>Doctrine\ORM\Tools\SchemaValidator should check validity of lifecycle callbacks</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jun 2012 09:47:12 +0000</created>
                <updated>Thu, 20 Sep 2012 06:20:48 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.4</fixVersion>
                <fixVersion>2.x</fixVersion>
                <fixVersion>Git Master</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18038" author="ocramius" created="Mon, 4 Jun 2012 22:25:23 +0000"  >&lt;p&gt;Existing PR at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/361&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/361&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1840] Create ParameterCollection indexed and implement it on AbstractQuery and QueryBuilder</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1840</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently, method setParameters in AbstractQuery and QueryBuilder only appends new parameters to the list. It should actually override the existing ones.&lt;br/&gt;
To be able to correctly fix this, we need to create a ParameterCollection which we can use/reuse to set/remove/append new parameters.&lt;br/&gt;
These elements should also support parameter types.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13733">DDC-1840</key>
            <summary>Create ParameterCollection indexed and implement it on AbstractQuery and QueryBuilder</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 May 2012 16:57:36 +0000</created>
                <updated>Thu, 20 Sep 2012 06:20:48 +0000</updated>
                                                    <fixVersion>2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17987" author="beberlei" created="Sun, 27 May 2012 08:07:59 +0000"  >&lt;p&gt;Not a bug&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1829] [GH-352] Add the posibility to add a custom Comparator for Schema tool</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1829</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of catacgc:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/352&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/352&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;See catacgc/dbal#153&lt;/p&gt;</description>
                <environment></environment>
            <key id="13716">DDC-1829</key>
            <summary>[GH-352] Add the posibility to add a custom Comparator for Schema tool</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 May 2012 11:31:59 +0000</created>
                <updated>Tue, 22 May 2012 17:47:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1820] [GH-348] [DDC-1819][WIP] Arbitrary object hydrator</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1820</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of marijn:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/348&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/348&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Initial work (in progress) on a test suite for the arbitrary object hydrator, as discussed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1819&quot; title=&quot;Allow ResultSetMapping to be used for objects that are not entities&quot;&gt;DDC-1819&lt;/a&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;. Any tips are appreciated. I&apos;m not too sure what the test suite should and should not cover. &lt;/p&gt;

&lt;p&gt;Other questions I have include:&lt;/p&gt;

&lt;p&gt;1. Should the `HYDRATE_ARBITRARY_OBJECT` constant be added to the `AbstractQuery` class or the `NativeQuery` class? It only makes sense in the former but it might be missed when more constants are added in the future...&lt;br/&gt;
2. Should I use data providers in my tests for the result set data?&lt;br/&gt;
3. Should my tests be added to a `DDC1819` namespace?&lt;br/&gt;
4. Should I add functional tests?&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1819&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1819&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13697">DDC-1820</key>
            <summary>[GH-348] [DDC-1819][WIP] Arbitrary object hydrator</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 May 2012 10:25:15 +0000</created>
                <updated>Sun, 27 May 2012 10:52:38 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1817] Allowing to specify MySQL Collation on Field Basis</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1817</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice to be able to specify which collation to use on a field basis.&lt;/p&gt;

&lt;p&gt;This would for example be useful when you have case-sensitive (utf8_bin), and case-insensitive (utf8_general_ci) values. Right now, this needs to be manually added to migration files (which is ok for projects, but it is not so nice for distributable libraries).&lt;/p&gt;</description>
                <environment></environment>
            <key id="13691">DDC-1817</key>
            <summary>Allowing to specify MySQL Collation on Field Basis</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 May 2012 20:13:01 +0000</created>
                <updated>Tue, 8 May 2012 20:13:01 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1814] Save quoted info in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings[&apos;fieldname&apos;][&apos;quoted&apos;]</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1814</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Similar to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1813&quot; title=&quot;Save column types in ClassMetadataInfo#columnTypes array instead of ClassMetadataInfo#fieldMappings[&amp;#39;type&amp;#39;]&quot;&gt;DDC-1813&lt;/a&gt; I propose saving &apos;quote&apos; status in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldname&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;quoted&amp;#39;&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Otherwise you have quotation info only for fieldColumns and not association columns&lt;/p&gt;</description>
                <environment></environment>
            <key id="13687">DDC-1814</key>
            <summary>Save quoted info in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings[&apos;fieldname&apos;][&apos;quoted&apos;]</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="rivaros">ross neacoders</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 May 2012 11:39:54 +0000</created>
                <updated>Sun, 6 May 2012 11:39:54 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1813] Save column types in ClassMetadataInfo#columnTypes array instead of ClassMetadataInfo#fieldMappings[&apos;type&apos;]</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1813</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Because you save column types in fieldmappings only, type information is not saved for join columns.&lt;/p&gt;

&lt;p&gt;Not having type info for join columns, makes it impossible to do call &apos;convertToPhpValue&apos; on join columns.&lt;/p&gt;

&lt;p&gt;For example see a demo of problem here:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/347&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/347&lt;/a&gt;&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13686">DDC-1813</key>
            <summary>Save column types in ClassMetadataInfo#columnTypes array instead of ClassMetadataInfo#fieldMappings[&apos;type&apos;]</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="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="rivaros">ross neacoders</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 May 2012 11:36:16 +0000</created>
                <updated>Sun, 6 May 2012 11:36:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1812] Modify ResultSetMapping#addMetaResult function definition</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1812</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Give correct names to arguments&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;public&lt;/span&gt; function addMetaResult($alias, $columnName, $fieldName, $isIdentifierColumn = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$alias - should be $tableAlias&lt;br/&gt;
$columnName should be $columnAlias&lt;br/&gt;
$fieldName should be $columnName&lt;/p&gt;

&lt;p&gt;Here are some exmple calls from code:&lt;br/&gt;
AbstractEntityInheritancePersister.php&lt;br/&gt;
79: $this-&amp;gt;_rsm-&amp;gt;addMetaResult(&apos;r&apos;, $columnAlias, $joinColumnName); &lt;br/&gt;
SqlWalker.php&lt;br/&gt;
$this-&amp;gt;_rsm-&amp;gt;addMetaResult($dqlAlias, $columnAlias, $discrColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;); &lt;br/&gt;
$this-&amp;gt;_rsm-&amp;gt;addMetaResult($dqlAlias, $columnAlias, $srcColumn, (isset($assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt; === true)); &lt;br/&gt;
$this-&amp;gt;_rsm-&amp;gt;addMetaResult($dqlAlias, $columnAlias, $srcColumn); &lt;/p&gt;




</description>
                <environment></environment>
            <key id="13685">DDC-1812</key>
            <summary>Modify ResultSetMapping#addMetaResult function definition</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="rivaros">ross neacoders</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 May 2012 11:28:54 +0000</created>
                <updated>Sun, 6 May 2012 11:28:54 +0000</updated>
                                    <version>2.2</version>
                <version>2.2.1</version>
                <version>2.2.2</version>
                <version>Git Master</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1806] DQL with and without fetch join cause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1806</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When running following DQL in newly cleared EntityManager, with the provided entities (see attached archive or gist at &lt;a href=&quot;https://gist.github.com/2473775&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/2473775&lt;/a&gt; ), results in different fetched association:&lt;/p&gt;

&lt;p&gt;DQL without join:&lt;br/&gt;
SELECT a FROM Entity\A a WHERE a.id = :id&lt;/p&gt;

&lt;p&gt;SQL without join:&lt;br/&gt;
SELECT a0_.a_id AS a_id0, a0_.id AS id1 FROM a a0_ WHERE a0_.a_id = ?&lt;/p&gt;

&lt;p&gt;Result without join:&lt;br/&gt;
$query-&amp;gt;getOneOrNullResult()&lt;del&gt;&amp;gt;getB()&lt;/del&gt;&amp;gt;getName(); // &apos;correct&apos;&lt;/p&gt;


&lt;p&gt;DQL with fetch join:&lt;br/&gt;
SELECT a, b FROM Entity\A a LEFT JOIN a.b b WHERE a.id = :id&lt;/p&gt;

&lt;p&gt;SQL with fetch join:&lt;br/&gt;
SELECT a0_.a_id AS a_id0, b1_.id AS id1, b1_.name AS name2, a0_.id AS id3 FROM a a0_ LEFT JOIN b b1_ ON a0_.id = b1_.id WHERE a0_.a_id = ?&lt;/p&gt;

&lt;p&gt;Result with fetch join:&lt;br/&gt;
$query-&amp;gt;getOneOrNullResult()&lt;del&gt;&amp;gt;getB()&lt;/del&gt;&amp;gt;getName(); // &apos;wrong&apos; (different result)&lt;/p&gt;


&lt;p&gt;The problem seems to be strictly related with how the `@JoinColumn` is configured.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13675">DDC-1806</key>
            <summary>DQL with and without fetch join cause</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="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="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 May 2012 21:09:00 +0000</created>
                <updated>Tue, 1 May 2012 21:15:33 +0000</updated>
                                    <version>2.2</version>
                <version>2.2.1</version>
                <version>2.2.2</version>
                <version>Git Master</version>
                                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17900" author="ocramius" created="Tue, 1 May 2012 21:15:32 +0000"  >&lt;p&gt;Attaching failing test from &lt;a href=&quot;https://github.com/Ocramius/doctrine2/compare/DDC-1806&quot; class=&quot;external-link&quot;&gt;https://github.com/Ocramius/doctrine2/compare/DDC-1806&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11188" name="DDC1806Test.php" size="2518" author="ocramius" created="Tue, 1 May 2012 21:15:32 +0000" />
                    <attachment id="11187" name="gist2473775-d202a38fdfb91921ef010df36322fb646561593a.tar.gz" size="19832" author="ocramius" created="Tue, 1 May 2012 21:09:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1803] Paginator usage with a DQL query that is using 2 time the same named binded value failed</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1803</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I use a dql query where I bind a named parameter 2 time in the same query for different joined fields.  The query work but the count query failed saying that there are missing bind variable.&lt;/p&gt;

&lt;p&gt;ex:&lt;br/&gt;
$qb = $this-&amp;gt;getQueryBuilder()&lt;br/&gt;
            -&amp;gt;select(&apos;&lt;br/&gt;
                partial fl.&lt;/p&gt;
{id, title, listing_date, abstract}
&lt;p&gt;,&lt;br/&gt;
                partial fla.&lt;/p&gt;
{id},&lt;br/&gt;
                partial ca.{id}
&lt;p&gt;,&lt;br/&gt;
                partial ds.&lt;/p&gt;
{id}
&lt;p&gt;            &apos;)&lt;br/&gt;
            -&amp;gt;from(&apos;Fo_Listing&apos;, &apos;fl&apos;)&lt;br/&gt;
            -&amp;gt;join(&apos;fl.listing_properties&apos;, &apos;flp&apos;)&lt;br/&gt;
            -&amp;gt;join(&apos;flp.property&apos;, &apos;fp&apos;)&lt;br/&gt;
            -&amp;gt;leftjoin(&apos;fl.listing_assets&apos;, &apos;fla&apos;)&lt;br/&gt;
            -&amp;gt;leftjoin(&apos;fla.asset&apos;, &apos;ca&apos;)&lt;br/&gt;
            -&amp;gt;leftjoin(&apos;ca.ds&apos;, &apos;ds&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;fp.id = :propertyId&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;propertyId&apos;, $id)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fl.object_status_id &amp;lt;&amp;gt; :deleted&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;deleted&apos;, CoRefObjectStatus::DELETE)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fl.publishing_status_id = :published&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;published&apos;, CoRefPublishingStatus::PUBLISHED)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fp.object_status_id &amp;lt;&amp;gt; :deleted&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;deleted&apos;, CoRefObjectStatus::DELETE)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fp.publishing_status_id = :published&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;published&apos;, CoRefPublishingStatus::PUBLISHED)&lt;br/&gt;
            -&amp;gt;add(&apos;orderBy&apos;, &apos;fl.listing_date DESC, fl.published_date DESC&apos;)&lt;br/&gt;
            -&amp;gt;setMaxResults($onTheMarketLimit);&lt;/p&gt;

&lt;p&gt;        $onTheMarket = new Paginator($qb, $fetchJoin = true);&lt;/p&gt;

&lt;p&gt;To make it work, I&apos;ve renamed the second usage of the named variable with a 2 at the end.  deleted2 and published2.&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="13669">DDC-1803</key>
            <summary>Paginator usage with a DQL query that is using 2 time the same named binded value failed</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="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mdrolet">Marc Drolet</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Apr 2012 12:41:44 +0000</created>
                <updated>Fri, 25 Jan 2013 15:29:52 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19385" author="ocramius" created="Wed, 23 Jan 2013 22:27:08 +0000"  >&lt;p&gt;This seems to be quite old. &lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=mdrolet&quot; class=&quot;user-hover&quot; rel=&quot;mdrolet&quot;&gt;Marc Drolet&lt;/a&gt; is it still valid with the latest ORM?&lt;/p&gt;</comment>
                    <comment id="19406" author="mdrolet" created="Fri, 25 Jan 2013 15:27:21 +0000"  >&lt;p&gt;I&apos;ll try to test this problem on an updated version and I&apos;ll let you know.&lt;br/&gt;
The bug entry is also quite old and I&apos;ve a local modified version of the paginator here to make it work with oracle, so it can take some time before I can test this out on the current doctrine version.&lt;/p&gt;</comment>
                    <comment id="19407" author="ocramius" created="Fri, 25 Jan 2013 15:29:48 +0000"  >&lt;p&gt;Ok, marking as awaiting feedback&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1792] [GH-340] add public has() method to filter collection.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1792</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of pjedrzejewski:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/340&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/340&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Sorry if there is any reason why this is not implemented already.&lt;br/&gt;
This is useful when some feature, for example `soft-deleteable` filter may be optional.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13650">DDC-1792</key>
            <summary>[GH-340] add public has() method to filter collection.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Apr 2012 18:03:16 +0000</created>
                <updated>Fri, 4 May 2012 17:58:14 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1787] Fix for JoinedSubclassPersister, multiple inserts with versioning throws an optimistic locking exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1787</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Attached is a small patch for a bug in the file JoinedSubclassPersister.php. When persisting multiple new entities that are subclasses of a baseclass (joined), and having the @Version attribute set, only for the last one a query is run to fetch the new value of the version field. The other one is tested with NULL, and throws an optimistic locking exception.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13644">DDC-1787</key>
            <summary>Fix for JoinedSubclassPersister, multiple inserts with versioning throws an optimistic locking exception</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jack@actinum.nl">Jack van Galen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Apr 2012 19:40:56 +0000</created>
                <updated>Wed, 18 Apr 2012 19:40:56 +0000</updated>
                                    <version>2.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11185" name="JoinedSubclassPersister.php.patch" size="744" author="jack@actinum.nl" created="Wed, 18 Apr 2012 19:40:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1785] Paginator problem with SQL Server around DISTINCT keyword.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1785</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;PDOException: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 10.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Incorrect syntax near the keyword &apos;DISTINCT&apos;. (uncaught exception)&lt;/p&gt;</description>
                <environment></environment>
            <key id="13642">DDC-1785</key>
            <summary>Paginator problem with SQL Server around DISTINCT keyword.</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Apr 2012 08:06:55 +0000</created>
                <updated>Sat, 19 Jan 2013 18:50:37 +0000</updated>
                                    <version>2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18847" author="camason" created="Thu, 18 Oct 2012 08:44:54 +0000"  >&lt;p&gt;There are four major issues with this:&lt;/p&gt;

&lt;p&gt;1: SQLServerPlatform.php modifies the query to prepend &apos;SELECT ROW_NUMBER() OVER ($over)&apos;, which is inserted before the DISTINCT keyword.&lt;/p&gt;

&lt;p&gt;2: The order needs to be placed inside the OVER($over) block. At this point, the regex is using the exact column name rather than the alias, so the outer query cannot ORDER.&lt;/p&gt;

&lt;p&gt;3: The DISTINCT queries select only the ID columns - as OVER() required the sort column to be available in the outer query, IDs alone will not work.&lt;/p&gt;

&lt;p&gt;4: SQL Server cannot DISTINCT on TEXT columns. 2005,2008 and 2012 recommend using VARCHAR(MAX) instead, which does support it. That doesn&apos;t help us with 2003. We work around that with a custom TEXT type that casts as varchar.&lt;/p&gt;

&lt;p&gt;Incidentally, 2012 supports LIMIT, which gets rid of this issue altogether.&lt;/p&gt;

&lt;p&gt;Edit: Added #3&lt;/p&gt;</comment>
                    <comment id="18849" author="camason" created="Thu, 18 Oct 2012 13:31:11 +0000"  >&lt;p&gt;I have a (very hacky) implementation working that uses regexes to correct the query so that it will execute. This also required modification in the ORM paginator, to select all columns instead of just IDs.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/CraigMason/dbal/commit/4ecd018c73e387904f78d81f1d327e34e905c5f1&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/dbal/commit/4ecd018c73e387904f78d81f1d327e34e905c5f1&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/CraigMason/doctrine2/commit/b416d3b2a38495e4435bde872b19fec371fe5657&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/doctrine2/commit/b416d3b2a38495e4435bde872b19fec371fe5657&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is certainly not a patch - more guidance.&lt;/p&gt;

&lt;p&gt;One interesting point... I had to wrap the whole query in a second SELECT *, as the WHERE IN confusingly returns non-distinct rows when part of the first inner query. No idea why this happens, but moving it out one layer makes it operate correctly.&lt;/p&gt;</comment>
                    <comment id="18886" author="camason" created="Thu, 25 Oct 2012 11:35:00 +0000"  >&lt;p&gt;Updated, view all commits for this experimental branch here: &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/CraigMason/dbal/commits/mssql-distinct&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/dbal/commits/mssql-distinct&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18897" author="camason" created="Mon, 29 Oct 2012 20:13:49 +0000"  >&lt;p&gt;This got waaaay too messy with regex alone due to the complicated nesting. As such, I have written the basis of a new SqlWalker class which can be used to create DISTINCT queries based on the root identifiers. It&apos;s not proper DISTINCT support, but it&apos;s a step forward.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/CraigMason/DoctrineSqlServerExtensions&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/DoctrineSqlServerExtensions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve also added a Paginator (which was the original issue I had!)&lt;/p&gt;

&lt;p&gt;The current SqlWalker always sticks the ORDER BY on the end of the query, which just doesn&apos;t work properly with SqlServer. Is a vendor-specific walker breaking the DQL abstraction? Should this type of code be on the Platform object in the DBAL?&lt;/p&gt;

&lt;p&gt;Anyway, this repo fixes our immediate problem, and it would be good to revisit this in a wider context. Hopefully we can get some good SQL server support - there are plenty of other issues to deal with (UTF-8/UCS2, nvarchar etc)&lt;/p&gt;</comment>
                    <comment id="19339" author="beberlei" created="Sat, 19 Jan 2013 18:50:37 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=camason&quot; class=&quot;user-hover&quot; rel=&quot;camason&quot;&gt;Craig Mason&lt;/a&gt; We don&apos;t have an SQL Server expert on the team, so if you want really good support you should join and help us with it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1760] [GH-324] simplified __call method</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1760</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of brikou:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/324&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/324&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

</description>
                <environment></environment>
            <key id="13599">DDC-1760</key>
            <summary>[GH-324] simplified __call method</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Apr 2012 15:34:06 +0000</created>
                <updated>Sat, 7 Apr 2012 07:25:24 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17756" author="beberlei" created="Wed, 4 Apr 2012 19:59:07 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-324&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/324&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/324&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17794" author="beberlei" created="Fri, 6 Apr 2012 13:50:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-324&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/324&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/324&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17820" author="beberlei" created="Sat, 7 Apr 2012 07:21:04 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-324&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/324&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/324&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1756] Allow for master table only models on joined subclass inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1756</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Think of a joined subclass inheritance setup where abstract base class A has many concrete child classes C1 ... CN. For each child class a table necessarily has to created. Yet if there are many child classes not defining any additional fields you will get many &quot;id only&quot; child tables. This leads to unnecessary join and insert overhead on database operations as well as a bunch of quite senseless tables in your schema that need to be maintained.&lt;/p&gt;

&lt;p&gt;While there are already tickets requesting support for mixed inheritance mapping (e.g. &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-138&quot; title=&quot;Allow for mixed inheritance mapping&quot;&gt;DDC-138&lt;/a&gt;) I want to propose another - obviously easy to implement - solution that addresses the &quot;id only table&quot; problem. The basic idea is to extend ClassMetadata by a flag &quot;hasOwnTable&quot; which is true by default and applicable for child classes of a joined subclass tree. Setting this flag to &amp;lt;false&amp;gt; would lead to...&lt;br/&gt;
1.) no child table creation for corresponding model&lt;br/&gt;
2.) no joins to this table while rendering SQL from DQL statements&lt;br/&gt;
3.) no INSERT, UPDATE and DELETE statements for this table in methods executeInserts(), update() and delete() on Doctrine\ORM\Persisters\JoinedSubclassPersister.&lt;/p&gt;

&lt;p&gt;(3) can easily be implemented since the mentioned methods all loop on ClassMetadata::parentClasses. For those classes which set the flag &quot;hasOwnTable&quot; to false the operation will be skipped. On the other hand (2) doesn&apos;t seem to a big deal either. Extending SqlWalker::_generateClassTableInheritanceJoins() by means of a flag test seems to be enough. Of course setting the flag to &amp;lt;false&amp;gt; while defining additional fields on child class level must be rejected.&lt;/p&gt;

&lt;p&gt;If you go for this feature I would be pleased to provide an implementation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13595">DDC-1756</key>
            <summary>Allow for master table only models on joined subclass inheritance</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="markus.woessner">Markus W&#246;&#223;ner</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Apr 2012 11:41:01 +0000</created>
                <updated>Tue, 3 Apr 2012 11:41:01 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1750] [GH-319] [WIP] Added support to Multiple ID Generators</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1750</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of guilhermeblanco:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

</description>
                <environment></environment>
            <key id="13588">DDC-1750</key>
            <summary>[GH-319] [WIP] Added support to Multiple ID Generators</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 1 Apr 2012 16:55:51 +0000</created>
                <updated>Sun, 27 May 2012 17:15:44 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17724" author="beberlei" created="Sun, 1 Apr 2012 20:19:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17725" author="beberlei" created="Sun, 1 Apr 2012 20:48:16 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17726" author="beberlei" created="Mon, 2 Apr 2012 04:21:38 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17730" author="beberlei" created="Mon, 2 Apr 2012 19:15:14 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17733" author="beberlei" created="Tue, 3 Apr 2012 03:42:14 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17734" author="beberlei" created="Tue, 3 Apr 2012 03:55:21 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17752" author="beberlei" created="Wed, 4 Apr 2012 19:59:03 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17787" author="beberlei" created="Fri, 6 Apr 2012 13:50:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17816" author="beberlei" created="Sat, 7 Apr 2012 07:21:04 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1739] [GH-314] [WIP] Doctrine\Common metadata drivers reuse</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1739</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of Ocramius:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;This PR is strictly related with &lt;a href=&quot;https://github.com/doctrine/common/pull/98&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/98&lt;/a&gt; and tests won&apos;t pass until the doctrine-common submodule points to a merged version of it (will do so later, so &lt;b&gt;please don&apos;t merge now&lt;/b&gt; ).&lt;/p&gt;

&lt;p&gt;Basically, I just stripped any code duplicate of what already available in dcom master under Doctrine\Common\Persistence\Mapping\Driver.&lt;/p&gt;

&lt;p&gt;Tests are OK on my environment when using the new commons submodule.&lt;/p&gt;

&lt;p&gt;(This is a cleanup for #263, where I sadly did pull from the remote branch after rebasing)&lt;/p&gt;

&lt;p&gt;Tests are still failing.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13577">DDC-1739</key>
            <summary>[GH-314] [WIP] Doctrine\Common metadata drivers reuse</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Mar 2012 16:10:32 +0000</created>
                <updated>Sat, 7 Apr 2012 07:21:02 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17678" author="beberlei" created="Fri, 30 Mar 2012 17:56:45 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17680" author="beberlei" created="Fri, 30 Mar 2012 19:37:27 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17684" author="beberlei" created="Fri, 30 Mar 2012 19:55:57 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17687" author="beberlei" created="Fri, 30 Mar 2012 20:01:01 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17710" author="beberlei" created="Sun, 1 Apr 2012 09:02:14 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17747" author="beberlei" created="Wed, 4 Apr 2012 19:59:02 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17792" author="beberlei" created="Fri, 6 Apr 2012 13:50:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17809" author="beberlei" created="Sat, 7 Apr 2012 07:21:02 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1738] Allow multiple Generators per class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1738</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should be able to support multiple generators per class.&lt;br/&gt;
When doing partition per table, the partitioned column must be part of PK, which may enter in our limitation.&lt;/p&gt;

&lt;p&gt;Currently we only support 1 generator per class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13576">DDC-1738</key>
            <summary>Allow multiple Generators per class</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Mar 2012 21:54:27 +0000</created>
                <updated>Thu, 20 Sep 2012 06:20:48 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1732] Unserialized non-initialized proxy classes should throw an exception when a method is called</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1732</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When we serialize entities in a session, we often have pointers to uninitialized proxies.&lt;br/&gt;
These proxies have $_entityPersister == null.&lt;/p&gt;

&lt;p&gt;The problem is that if you happen to call by mistake a method on such a proxy, you&apos;re not aware that this is an uninitialized proxy, and the business methods are called, with null values for every property.&lt;/p&gt;

&lt;p&gt;I think the proxy should throw an exception in that case.&lt;br/&gt;
Attached, a patch with the proposed modification.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13568">DDC-1732</key>
            <summary>Unserialized non-initialized proxy classes should throw an exception when a method is called</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="benjamin">Benjamin Morel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Mar 2012 19:29:13 +0000</created>
                <updated>Wed, 28 Mar 2012 19:29:13 +0000</updated>
                                    <version>2.2</version>
                <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                                <attachments>
                    <attachment id="11173" name="ProxyFactory.php.patch" size="679" author="benjamin" created="Wed, 28 Mar 2012 19:29:13 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1729] Translate queries into graphs of value objects (instead of array hydration?)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1729</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In decoupled applications the model layer returns &quot;data-transfer-objects&quot; through the boundary into the controller/view layer. It would make sense to have Doctrine directly generate any data-transfer/value-object from native and dql queries.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13564">DDC-1729</key>
            <summary>Translate queries into graphs of value objects (instead of array hydration?)</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Mar 2012 22:35:35 +0000</created>
                <updated>Sat, 9 Jun 2012 11:26:40 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18067" author="beberlei" created="Sat, 9 Jun 2012 11:26:40 +0000"  >&lt;p&gt;Example:&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;$dql = &quot;SELECT &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CustomerAddressView(c.id, c.name, a.id, a.street, a.number, a.city, a.code)
             FROM Customer c INNER JOIN c.address a WHERE c.id = ?1&quot;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This supersedes &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1819&quot; title=&quot;Allow ResultSetMapping to be used for objects that are not entities&quot;&gt;DDC-1819&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;1. One additional property in ResultSetMapping =&amp;gt; $viewModelClass?&lt;br/&gt;
2. Changes to Parser (new ... syntax)&lt;br/&gt;
3. Changes to sQL Walker?&lt;br/&gt;
4. Changes to Hydration (Only object hydration!)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1728] There is no exact alternative function like MONTH in mysql </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1728</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i am not able to extract only month from the date field using doctrine2 using &apos;MONTH&apos; function&lt;/p&gt;</description>
                <environment>Ubuntu 11.10</environment>
            <key id="13563">DDC-1728</key>
            <summary>There is no exact alternative function like MONTH in mysql </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="sudheeshms1">Sudheesh MS</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Mar 2012 13:44:12 +0000</created>
                <updated>Tue, 27 Mar 2012 13:44:12 +0000</updated>
                                    <version>2.2.0-RC1</version>
                <version>2.2</version>
                <version>2.2.1</version>
                                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1723] Custom ID Generators</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1723</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Allow specify custom id generators, pull request is GH-206&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/206&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/206&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13551">DDC-1723</key>
            <summary>Custom ID Generators</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Mar 2012 21:27:59 +0000</created>
                <updated>Thu, 20 Sep 2012 06:20:48 +0000</updated>
                                                    <fixVersion>2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1721] LIKE clausule should accept functions on the pattern</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1721</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Example:&lt;br/&gt;
SELECT .... WHERE upper(n.title) LIKE upper(:filter)&lt;/p&gt;

&lt;p&gt;should be a valid SQL, now is rejected because the walker only accept a variable or an string expression.&lt;/p&gt;

&lt;p&gt;I&apos;m adding a patch to address this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13548">DDC-1721</key>
            <summary>LIKE clausule should accept functions on the pattern</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="ignaciolarranaga">Ignacio Larranaga</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Mar 2012 17:40:33 +0000</created>
                <updated>Thu, 24 Jan 2013 18:06:45 +0000</updated>
                                    <version>2.1.6</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17625" author="ignaciolarranaga" created="Wed, 21 Mar 2012 19:30:31 +0000"  >&lt;p&gt;Sorry the Parser has to be modified also to allow expressions to be recognized, I&apos;m attaching the necessary patch.&lt;/p&gt;</comment>
                    <comment id="17626" author="beberlei" created="Thu, 22 Mar 2012 19:31:32 +0000"  >&lt;p&gt;I am sure there is a reason why the walker doesn&apos;t accept this such as not all supported vendors allowing functions in right hand side LIKE expressions, but i am not sure about this.&lt;/p&gt;</comment>
                    <comment id="18764" author="darkangel" created="Wed, 3 Oct 2012 09:46:44 +0000"  >&lt;p&gt;This is not possible either:&lt;/p&gt;

&lt;p&gt;WHERE CASE WHEN p.name IS NULL THEN u.username ELSE p.name END LIKE :name&lt;/p&gt;</comment>
                    <comment id="19403" author="thomas303" created="Thu, 24 Jan 2013 18:06:45 +0000"  >&lt;p&gt;In my case it worked when using &quot;=&quot; instead of &quot;LIKE&quot;.&lt;/p&gt;

&lt;p&gt;//works:&lt;br/&gt;
(CASE WHEN (Book.id = BookFrom.id) THEN BookTo.displayName ELSE BookFrom.displayName END) = :name&lt;/p&gt;

&lt;p&gt;//&lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 1217: Error: Expected =, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, &amp;gt;, &amp;gt;=, !=, got &apos;LIKE&apos; &lt;br/&gt;
(CASE WHEN (Book.id = BookFrom.id) THEN BookTo.displayName ELSE BookFrom.displayName END) LIKE :name&lt;/p&gt;

&lt;p&gt;So the LIKE operator only needs to be allowed here.&lt;/p&gt;

&lt;p&gt;I&apos;m wondering which vendor should not be able to handle that:&lt;br/&gt;
The CASE WHEN ... THEN ... END is documented in DQL, and allowed.&lt;br/&gt;
LIKE itself is allowed.&lt;br/&gt;
If an RDBMs cannot use CASE WHEN and LIKE in combination, this would be a strange limitation.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11172" name="Parser.patch" size="847" author="ignaciolarranaga" created="Wed, 21 Mar 2012 19:30:31 +0000" />
                    <attachment id="11171" name="SqlWalker.patch" size="891" author="ignaciolarranaga" created="Wed, 21 Mar 2012 17:40:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1720] SqlWalter private variables should be protected to allow walker extensions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1720</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m attaching a patch with the suggestion.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13547">DDC-1720</key>
            <summary>SqlWalter private variables should be protected to allow walker extensions</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="ignaciolarranaga">Ignacio Larranaga</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Mar 2012 16:44:52 +0000</created>
                <updated>Wed, 21 Mar 2012 16:45:25 +0000</updated>
                                    <version>2.1.6</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11170" name="SqlWalker.patch" size="2632" author="ignaciolarranaga" created="Wed, 21 Mar 2012 16:44:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1714] Prevent inverse side lazy loading owning side of the oneToOne relationsip if owning side&apos;s id is an assosiationKey of inversed side</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1714</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue was originally discussed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-357&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-357&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Say there is User and UserData with oneToOne bidirectional relationship. When we fetch User objects, UserData is lazy loaded right away. &lt;/p&gt;

&lt;p&gt;If we were to set UserData &apos;s id as asssosiationKey of User, then user_id becomes the id of UserData and User object can already know that UserData owning side&apos;s id will equal it&apos;s own User-&amp;gt;id.&lt;/p&gt;

&lt;p&gt;Can this be implemented?&lt;/p&gt;</description>
                <environment></environment>
            <key id="13540">DDC-1714</key>
            <summary>Prevent inverse side lazy loading owning side of the oneToOne relationsip if owning side&apos;s id is an assosiationKey of inversed side</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="dwalter">David</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Mar 2012 23:56:32 +0000</created>
                <updated>Sun, 18 Mar 2012 23:56:32 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1702] EBNF for IN expressions should be updated for 2.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1702</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Following the changes made for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1472&quot; title=&quot;WHERE &amp;lt;&amp;lt;function&amp;gt;&amp;gt; IN ... doesn&amp;#39;t work&quot;&gt;&lt;del&gt;DDC-1472&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1416&quot; title=&quot;bug in simple test with sub query&quot;&gt;&lt;del&gt;DDC-1416&lt;/del&gt;&lt;/a&gt;, the EBNF for InExpression should have been updated. It now takes an ArithmeticExpression instead of a SingleValuePathExpression.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13525">DDC-1702</key>
            <summary>EBNF for IN expressions should be updated for 2.2</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="pschwisow">Patrick Schwisow</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Mar 2012 17:40:48 +0000</created>
                <updated>Tue, 13 Mar 2012 17:45:54 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17563" author="pschwisow" created="Tue, 13 Mar 2012 17:45:54 +0000"  >&lt;p&gt;I marked this as &quot;Major&quot; because this change represents a BC break.  Because EBNF was not updated, I initially believed this to be a bug in ORM and wasted a lot of time debugging Doctrine code before I discovered this change was intentional.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1698] Inconsistent proxy file name &amp; namespace result in __PHP_Incomplete_Class when unserializing entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1698</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Starting with Doctrine 2.2, the Proxy classes have inconsistent naming with their file name, which raises problems with class autoloading.&lt;br/&gt;
For example, a class named &lt;b&gt;Application\Model\User&lt;/b&gt; creates the following proxy class:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Application\Proxy\__CG__\Application\Model\User
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This class is located in the following file:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Application/Proxy/__CG__ApplicationModelUser.php
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But whe we serialize such an entity, then unserialize it in another session, the framework autoloader expects the class to be located in:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Application/Proxy/__CG__/Application/Model/User.php
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But it is not.&lt;br/&gt;
As a result, a __PHP_Incomplete_Class is created instead of the expected proxy class.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure whether this is an intended behavior, but I would assume this is a bug.&lt;/p&gt;</description>
                <environment>Irrelevant</environment>
            <key id="13521">DDC-1698</key>
            <summary>Inconsistent proxy file name &amp; namespace result in __PHP_Incomplete_Class when unserializing entities</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="benjamin">Benjamin Morel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Mar 2012 00:11:42 +0000</created>
                <updated>Sun, 6 Jan 2013 13:18:41 +0000</updated>
                                    <version>2.2</version>
                <version>2.2.1</version>
                                <fixVersion>2.2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17561" author="benjamin" created="Tue, 13 Mar 2012 16:46:38 +0000"  >&lt;p&gt;It looks like there is an even broader problem with the new _&lt;em&gt;CG&lt;/em&gt;_ prefix; the PSR-0 standard for autoloading states that the underscores should be handled this way:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;\namespace\package\Class_Name =&amp;gt; {...}/namespace/package/Class/Name.php
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which means that in the above example, it could even expect the file to be located in:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Application/Proxy///CG///Application/Model/User.php
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;... which is far away from the actual location.&lt;br/&gt;
Upgrade to 2.2 broke this code, for us.&lt;/p&gt;</comment>
                    <comment id="17565" author="beberlei" created="Wed, 14 Mar 2012 18:30:24 +0000"  >&lt;p&gt;Proxy classes do not follow PSR-0. For the case unserializing objects we should provide an extra autoloader i guess.&lt;/p&gt;

&lt;p&gt;See here how symfony does it &lt;a href=&quot;https://github.com/doctrine/DoctrineBundle/blob/master/DoctrineBundle.php#L57&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/DoctrineBundle/blob/master/DoctrineBundle.php#L57&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17566" author="beberlei" created="Wed, 14 Mar 2012 19:12:07 +0000"  >&lt;p&gt;See &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/9b4d60897dfc7e9b165712428539e694ec596c80&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/9b4d60897dfc7e9b165712428539e694ec596c80&lt;/a&gt; and &lt;a href=&quot;https://github.com/doctrine/orm-documentation/commit/01381fae1ff3d4944086c7cfe46721925bf6ca15&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/orm-documentation/commit/01381fae1ff3d4944086c7cfe46721925bf6ca15&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17589" author="benjamin" created="Wed, 14 Mar 2012 22:36:59 +0000"  >&lt;p&gt;Thanks for the quick fix, Benjamin.&lt;br/&gt;
However, I have to admit that I&apos;m not fully happy with the fix, as we (and probably many others) are not using the Doctrine autoloader.&lt;br/&gt;
I supposed that the purpose of PSR-0 was precisely not to be tied to a particular autoloader implementation, and this benefit is lost with this version of Doctrine.&lt;/p&gt;

&lt;p&gt;You mentioned in the doc that the proxies are not PSR-0 compliant &quot;for implementation reasons&quot;; as this was working fine before 2.2, could you please explain what requirement prevents Doctrine from keeping the previous naming convention?&lt;/p&gt;</comment>
                    <comment id="17671" author="beberlei" created="Thu, 29 Mar 2012 09:56:11 +0000"  >&lt;p&gt;In 2.1 the proxies are not PSR-0 compatible themselves, however their class naming is simpler.&lt;/p&gt;

&lt;p&gt;In 2.2 we changed proxy names so that you can derive the original name of the proxy by searching for the _&lt;em&gt;CG&lt;/em&gt;_ flag. This flag obviously contains the __ chars that some PSR autoloaders detect as directory seperators. I agree this is an unfortunate decision, but it was done this way.&lt;/p&gt;

&lt;p&gt;I do think however that we can automatically register the proxy atuoloader (if not yet done)  in EntityManager#create(). This would hide this fact from developers automatically.&lt;/p&gt;</comment>
                    <comment id="18898" author="benjamin" created="Mon, 29 Oct 2012 21:37:00 +0000"  >&lt;p&gt;@Benjamin Eberlei&lt;br/&gt;
In 2.3 we still have to manually call Autoloader::register() before unserializing entities that may contain proxies.&lt;br/&gt;
So EntityManager::create() still doesn&apos;t register it. Is there a plan to add this feature?&lt;/p&gt;</comment>
                    <comment id="19231" author="beberlei" created="Sun, 6 Jan 2013 10:10:22 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=benjamin&quot; class=&quot;user-hover&quot; rel=&quot;benjamin&quot;&gt;Benjamin Morel&lt;/a&gt; Not at the moment, seems too dangerous for me since it might produce race conditions. This should really be done in the bootstrap of the system.&lt;/p&gt;

&lt;p&gt;We need to document this though.&lt;/p&gt;</comment>
                    <comment id="19234" author="benjamin" created="Sun, 6 Jan 2013 13:18:41 +0000"  >&lt;p&gt;Ok, thanks for your answer!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1681] loadRelated() - Method to efficiently load sets of related entities in &quot;sub&quot;-select strategies</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1681</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As per Request of Seldaek &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.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;</description>
                <environment></environment>
            <key id="13496">DDC-1681</key>
            <summary>loadRelated() - Method to efficiently load sets of related entities in &quot;sub&quot;-select strategies</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Mar 2012 20:14:44 +0000</created>
                <updated>Mon, 5 Mar 2012 21:22:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17522" author="seldaek" created="Mon, 5 Mar 2012 20:43:09 +0000"  >&lt;p&gt;Sample:&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;$result = $queryBuilder-&amp;gt;select(&apos;a&apos;)-&amp;gt;from(&apos;User&apos;, &apos;a&apos;)-&amp;gt;getQuery()-&amp;gt;getResult();
$result-&amp;gt;loadRelated(&apos;roles&apos;); &lt;span class=&quot;code-comment&quot;&gt;// loads all a.roles&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Would be the equivalent of:&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;$result = $queryBuilder-&amp;gt;select(&apos;a, r&apos;)-&amp;gt;from(&apos;User&apos;, &apos;a&apos;)-&amp;gt;join(&apos;a.roles&apos;, &apos;r&apos;)-&amp;gt;getQuery()-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Except that the above does one simple query without join, then one WHERE IN query with all ids from the collection.&lt;br/&gt;
The latter obviously does a join and retrieves everything in one - more complex - query.&lt;/p&gt;

&lt;p&gt;Bonus points if you can loadRelated multiple relations at once.&lt;/p&gt;</comment>
                    <comment id="17523" author="stof" created="Mon, 5 Mar 2012 21:09:31 +0000"  >&lt;p&gt;I see an issue here: if you do a WHERE IN with the multiple ids, how do you know which entity the role is related to ?&lt;/p&gt;

&lt;p&gt;and btw, the interface you suggested above would require breaking the BC: ``$result`` is an array right now.&lt;/p&gt;</comment>
                    <comment id="17524" author="seldaek" created="Mon, 5 Mar 2012 21:15:47 +0000"  >&lt;p&gt;The interface is just an example mimicking the way it worked in D1, take it with a grain of salt.&lt;/p&gt;

&lt;p&gt;As for the implementation, if you assume the roles table has a user_id and role column, then you can do WHERE user_id IN (1, 2, 3) and you&apos;ll get back the user ids so you know where to attach them. It might still require some joining in some cases, but the point is to keep the joins out of the main query.&lt;/p&gt;</comment>
                    <comment id="17525" author="guilhermeblanco" created="Mon, 5 Mar 2012 21:22:52 +0000"  >&lt;p&gt;The one to be implemented would be:&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;$result = $queryBuilder-&amp;gt;select(&apos;a&apos;)-&amp;gt;from(&apos;User&apos;, &apos;a&apos;)-&amp;gt;getQuery()-&amp;gt;getResult();
$em-&amp;gt;loadRelated($result, &apos;roles&apos;); &lt;span class=&quot;code-comment&quot;&gt;// loads all a.roles&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason for that is not all the times you have a PersistentCollection. You may have an ArrayCollection too.&lt;br/&gt;
I just don&apos;t know yet how to handle array and ArrayCollection situations, since you may not know which class you&apos;re trying to fetch.&lt;br/&gt;
Maybe I can try to grab the first item of array and retrieve Association information from ClassMetadata retrieved via get_class on first item. That would solve the problem.&lt;/p&gt;

&lt;p&gt;Any other ideas, feel free to give me.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1645] Paths to Annotations classes are not considered</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1645</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, my battle is described here: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/db9c77b6bc000f13&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/db9c77b6bc000f13&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I follow bugtracker tutorial I think that there is an error when working with Annotations, see these examples:&lt;/p&gt;

&lt;p&gt;Start a new bugtracker project as described in tutorial from scratch, create folders and files as tutorial expose, then do following changes:&lt;/p&gt;

&lt;p&gt;1) put Product, Bug, User class files at root level, same level as bootstraps files and create_xxxxx files&lt;br/&gt;
2) Create &apos;entities&apos; folder, but leave it empty.&lt;br/&gt;
3) Create &apos;yaml&apos; and &apos;xml&apos; at root level too and add related files.&lt;br/&gt;
4) Open bootstrap and edit paths to Product, Bug and User class files to read from root files as in 1) so they can be read from scripts.&lt;/p&gt;

&lt;p&gt;1) YAML&lt;br/&gt;
   a) When using YAML as mapping driver you need a path to Setup::createYAMLMetadataConfiguration( ) method, I use this&lt;br/&gt;
         Setup::createYAMLMetadataConfiguration(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/yaml&quot;), $isDevMode);&lt;br/&gt;
        where &quot;yaml&quot; directory is same level as bootstraps and create_xxxxx files are. When executing script to create a product&lt;br/&gt;
        Doctrine work as expected, creating a row inside table correctly.&lt;br/&gt;
   b) If you comment line where class Product is included, the object can&apos;t be found at runtime and will throw an exception as expected.&lt;br/&gt;
   c) With uncommented require Product line, change yaml name folder to anything, and Doctrine throw an exception (MappingException) as expected&lt;/p&gt;

&lt;p&gt;so Setup method path argument is considered correctly, Doctrine engine must know where yaml files for classes are.&lt;/p&gt;

&lt;p&gt;2) XML&lt;br/&gt;
   a) When using XML as mapping driver you need a path to Setup::createXMLMetadataConfiguration( ) method, I use this&lt;br/&gt;
         Setup::createXMLMetadataConfiguration(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/xml&quot;), $isDevMode);&lt;br/&gt;
        where &quot;xml&quot; directory is same level as bootstraps and create_xxxxx files are. When executing script to create a product&lt;br/&gt;
        Doctrine work as expected, creating a row inside table correctly.&lt;br/&gt;
   b) If you comment line where class Product is included, the object can&apos;t be found at runtime and will throw an exception as expected.&lt;br/&gt;
   c) With uncommented require Product line, change xml name folder to anything, and Doctrine throw an exception (MappingException) as expected&lt;/p&gt;

&lt;p&gt;so Setup method path argument is considered correctly again, Doctrine engine must know where xml files for classes are.&lt;/p&gt;

&lt;p&gt;3) Annotations&lt;br/&gt;
   a) When using Annotations as mapping driver you need a path to Setup::createAnnotationsMetadataConfiguration( ) method, I use this&lt;br/&gt;
         Setup::createAnnotationsMetadataConfiguration(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/entities&quot;), $isDevMode);&lt;br/&gt;
        where &quot;entities&quot; directory is same level as bootstraps and create_xxxxx files are (but remember THEY ARE EMPTY). When executing script to create a product&lt;br/&gt;
        Doctrine WORK AS EXPECTED, creating a row inside table correctly and still I don&apos;t know how if THERE IS NO Annotations files.&lt;br/&gt;
   b) If you comment line where class Product is included, the object can&apos;t be found at runtime and will throw an exception as expected.&lt;br/&gt;
   c) With uncommented require Product line, change name folder to anything, and Doctrine WILL NOT throw an exception, continue with execution.&lt;br/&gt;
   d) Copy /Product.php to /entities/Product.php, then comment docblocks from /Product class (using // or delete them). When running script Doctrine throw a MappingException with message: &quot;Class Product is not a valid entity or mapped super class&quot;, when as follow concepts from 1) (yaml) and 2) (xml) it should search docblocks from /entities/Product.php file (path argument from Setup), right?&lt;/p&gt;

&lt;p&gt;so Setup method path argument IS NOT CONSIDERED, Doctrine engine use already defined classes to get Annotations docblocks using php reflexion classes, methods and functions.&lt;/p&gt;

&lt;p&gt;How to deal with this? I mean...&lt;/p&gt;

&lt;p&gt;a) Erase path argument from Setup::createAnnotationMetadataConfiguration methos (and similar functions for Annotations) because is not needed, classes and annotations must be defined before.&lt;br/&gt;
b) Add support to find docblocks from path argument when no valid dockblock is found from class definition, so entities classes can live without docblocks because they are found inside Setup path function argument, as YAML and XML do.&lt;/p&gt;

&lt;p&gt;       I know that is easy to follow tutorial guidelines to develop applications in Annotations point of view, load them before Doctrine script start (with require/include or autoloaders, etc) and will work, but I think that is wrong how tutorial and functional logic are given, so a) and b) are my proposed solutions. I think b) should be right, get dockblocks from a class already defined and if are not defined it follow XML and YAML logic: read metadata from other files.&lt;/p&gt;

&lt;p&gt;Attachment: My bugtracker Netbeans project.&lt;/p&gt;

&lt;p&gt;Sorry by my english &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;</description>
                <environment>openSUSE 12.1 x86, Apache/2.2.21, mysql 5.5.16, PHP 5.3.8 (modules: Core, ctype, curl, date, dom, ereg, filter, gd, hash, http, iconv, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, pcre, PDO, pdo_mysql, pdo_sqlite, Reflection, session, SimpleXML, SPL, SQLite, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zip, zlib )</environment>
            <key id="13432">DDC-1645</key>
            <summary>Paths to Annotations classes are not considered</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="feathersanddown">feathers and down</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Feb 2012 04:54:28 +0000</created>
                <updated>Fri, 10 Feb 2012 04:54:28 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11158" name="bugtracker.zip" size="1764088" author="feathersanddown" created="Fri, 10 Feb 2012 04:54:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1624] Locking CTI doesnt work on SQL Server</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1624</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The WITH Keyowrd is appended to the whole FROM .. JOIN .. block instead of behind the FROM block.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13396">DDC-1624</key>
            <summary>Locking CTI doesnt work on SQL Server</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="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Jan 2012 14:18:18 +0000</created>
                <updated>Thu, 20 Sep 2012 06:20:48 +0000</updated>
                                    <version>2.2</version>
                                <fixVersion>2.4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1621] Add support for FROM Class1 a1 JOIN Class2 a2 WITH cond queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1621</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Check feasibility of this kind of query different from FROM Class1 a1, Class2 a2 to allow arbitrary joins between classes.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13390">DDC-1621</key>
            <summary>Add support for FROM Class1 a1 JOIN Class2 a2 WITH cond queries</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="asm89">Alexander</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Jan 2012 21:17:27 +0000</created>
                <updated>Sun, 30 Dec 2012 20:16:47 +0000</updated>
                                                    <fixVersion>2.4</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19079" author="alex00888" created="Fri, 30 Nov 2012 10:14:47 +0000"  >&lt;p&gt;Hi all!&lt;br/&gt;
Maybe if this task is hard, you could do a simplier variant, &quot;FROM Class1 a1 JOIN a1,a2 WITH a2 INSTANCE OF Class2&quot;?&lt;br/&gt;
Doctrine 2.3 supports it, but in fact, it does not work. I can&apos;t use Class2 fields in query, and Doctrine ignores the INSTANCE OF operator when building a native queries.&lt;br/&gt;
I am working with system where I have many inherited classes with Class Table Inheritance. When I do a JOIN query, it generates native sql query more than 1KB(?!) length, and MySQL freezes for more than 7 minutes (?!) on it. It must join only tables for Class2, but it joins all my 20 tables inherited of my base class &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
I don&apos;t know where to send bugreport &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
It will be very good if I could manually select a joined class to make Doctrine do a better queries.&lt;br/&gt;
Sorry for my english, I am from Moscow.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1605] No documentation about the usage of indexes with YAML and XML</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1605</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am missing documentation about how to handle indexes in YAML and XML definition files. I had to search in the code to learn how to do that.&lt;br/&gt;
Please add some documentation about it.&lt;/p&gt;

&lt;p&gt;This issue is related to #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-160&quot; title=&quot;Index annotation documentation&quot;&gt;&lt;del&gt;DDC-160&lt;/del&gt;&lt;/a&gt; where the reporter asked for documentation about indexes in annotation mapping.&lt;/p&gt;

&lt;p&gt;EDIT:&lt;br/&gt;
Maybe an example how I have done it with YAML would be helpful for others:&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;
User:
  type: entity
  fields:
    id:
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      generator:
        strategy: IDENTITY
    email:
      type: string
      length: 150
      unique: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    active:
      type: &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;
  indexes:
    indexActiveField: { name: idx_user_active, columns: [ active ] }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;indexActiveField&lt;/tt&gt; is the name of the index used by doctrine and &lt;tt&gt;idx_user_active&lt;/tt&gt; is the name of the index in the database. The rest should be clear.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13366">DDC-1605</key>
            <summary>No documentation about the usage of indexes with YAML and XML</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="naitsirch">Christian Stoller</reporter>
                        <labels>
                        <label>documentation</label>
                    </labels>
                <created>Mon, 16 Jan 2012 10:24:00 +0000</created>
                <updated>Mon, 8 Apr 2013 20:29:19 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18738" author="naitsirch" created="Thu, 27 Sep 2012 19:26:58 +0000"  >&lt;p&gt;Hi. I got an email notification that arbuscula has changed the status to &quot;Awaiting Feedback&quot;. Do you need any feedback from me?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1602] Executors for Class Table Inheritance (JOINED) are extremely slow on MySQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1602</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Update and delete executors for Class Table Inheritance (JOINED) are extremely slow on MySQL platform. It is most probably due to use of subselect on the temporary table.&lt;br/&gt;
The slowdown is really significant as the table size increases. As an example, lets have a root entity with one subclass:&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;/**
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;root&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Root&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;a&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;SubA&quot;&lt;/span&gt;})
 */
class Root
{
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @Id
	 * @GeneratedValue
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $xyz;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;/**
 * @Entity
 */
class SubA &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Root
{
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $foo;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now lets perform a simple DQL UPDATE:&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;UPDATE Entities\Root r SET r.xyz = 123 WHERE r.id &amp;gt; ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(note: always the upper half of entries)&lt;br/&gt;
Which creates following SQLs:&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;CREATE TEMPORARY TABLE Root_id_tmp (id INT NOT NULL)
INSERT INTO Root_id_tmp (id) SELECT t0.id FROM Root t0 LEFT JOIN SubA s0_ ON t0.id = s0_.id WHERE t0.id &amp;gt; 25000
UPDATE Root SET xyz = 123 WHERE (id) IN (SELECT id FROM Root_id_tmp)
DROP TEMPORARY TABLE Root_id_tmp
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The time spent on this on MySQL 5.5.17 and PostgreSQL 9.1 is:&lt;/p&gt;

&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; no. of entries &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 500   &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 1000  &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 2500 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 5000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 10000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 20000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 50000 &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; &lt;b&gt;MySQL&lt;/b&gt;             &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.26s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  0.35s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 1.1s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 3.68s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 14.13s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 54.44s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 338s &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; &lt;b&gt;PostgreSQL&lt;/b&gt;   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.10s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.10s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.13s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.15s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.22s   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.35s   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 1.01s &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;p&gt;As you can see, MySQL is drastically slower on even relatively small tables. This currently makes Doctrine unusable for this type of inheritance on MySQL. The solution probably would be to avoid subselect in WHERE clause in Doctrine\ORM\Query\Exec\MultiTableUpdateExecutor and Doctrine\ORM\Query\Exec\MultiTableDeleteExecutor.&lt;/p&gt;

&lt;p&gt;Feel free to try/modify the test script yourself, it&apos;s &lt;a href=&quot;https://github.com/Majkl578/doctrine2-slow-executors&quot; class=&quot;external-link&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
                <environment>Debian, MySQL 5.5.17</environment>
            <key id="13362">DDC-1602</key>
            <summary>Executors for Class Table Inheritance (JOINED) are extremely slow on MySQL</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="majkl578">Michael Moravec</reporter>
                        <labels>
                    </labels>
                <created>Sun, 15 Jan 2012 19:45:05 +0000</created>
                <updated>Wed, 27 Jun 2012 17:57:43 +0000</updated>
                                    <version>2.2-BETA2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17269" author="beberlei" created="Sun, 15 Jan 2012 22:59:14 +0000"  >&lt;p&gt;Its not a bug as it works. The performance drawback of JTI is discussed in the manual &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/inheritance-mapping.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/inheritance-mapping.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Changing this would be an improvement where we would hint if databases prefer subselects or joins for different operations. This would increase complexity of the SQL generation since now we are getting along with just one SQL generation strategy.&lt;/p&gt;</comment>
                    <comment id="17938" author="majkl578" created="Fri, 11 May 2012 11:02:42 +0000"  >&lt;p&gt;Any chance to get this implemented before 2.3?&lt;/p&gt;</comment>
                    <comment id="17939" author="majkl578" created="Fri, 11 May 2012 14:03:31 +0000"  >&lt;p&gt;I&apos;ve made a change in DBAL and ORM code to implement a solution issue. It&apos;s currently more likely a proof of concept.&lt;/p&gt;

&lt;p&gt;With the change, my results are (approximately):&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; no. of entries &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 500   &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 1000  &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 2500 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 5000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 10000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 20000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 50000 &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; &lt;b&gt;MySQL&lt;/b&gt;             &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.17s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  0.19s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.21s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.26s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.27s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.37s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.92s &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;p&gt;Currently only update executor was changed.&lt;br/&gt;
DBAL branch with changes: &lt;a href=&quot;https://github.com/Majkl578/doctrine-dbal/tree/DDC-1602&quot; class=&quot;external-link&quot;&gt;https://github.com/Majkl578/doctrine-dbal/tree/DDC-1602&lt;/a&gt;&lt;br/&gt;
ORM branch with changes: &lt;a href=&quot;https://github.com/Majkl578/doctrine2/tree/DDC-1602&quot; class=&quot;external-link&quot;&gt;https://github.com/Majkl578/doctrine2/tree/DDC-1602&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking forward for your opinions.&lt;/p&gt;</comment>
                    <comment id="18148" author="majkl578" created="Wed, 27 Jun 2012 17:57:43 +0000"  >&lt;p&gt;bump&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1599] OnFlush event in transaction</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1599</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Is there any particular reason why onFlush event is not triggered when the transaction is allready open? &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L290&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L290&lt;/a&gt; It would help a lot developing listeners since this event is the mostly used one and since theres preFlush now it seems a logical solution if onFlush would be a start of transaction in general&lt;/p&gt;</description>
                <environment></environment>
            <key id="13357">DDC-1599</key>
            <summary>OnFlush event in transaction</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gediminasm">Gediminas Morkevicius</reporter>
                        <labels>
                    </labels>
                <created>Sat, 14 Jan 2012 15:51:55 +0000</created>
                <updated>Thu, 20 Sep 2012 06:20:49 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17244" author="beberlei" created="Sat, 14 Jan 2012 16:36:43 +0000"  >&lt;p&gt;onFluish is not the start of a transaction. It has nothing to do with this.&lt;/p&gt;</comment>
                    <comment id="17693" author="ocramius" created="Sat, 31 Mar 2012 02:07:52 +0000"  >&lt;p&gt;Is a third event needed? Or is this to be marked as &quot;won&apos;t fix&quot;?&lt;/p&gt;</comment>
                    <comment id="17695" author="beberlei" created="Sat, 31 Mar 2012 07:14:31 +0000"  >&lt;p&gt;Maybe onBeginTransaction, onCommit and onRollback.&lt;/p&gt;

&lt;p&gt;However since you can start transactions manually using $em-&amp;gt;beginTransaction(), the Flush events are somehwat independent of transactions anyways.&lt;/p&gt;</comment>
                    <comment id="17697" author="gediminasm" created="Sat, 31 Mar 2012 07:41:46 +0000"  >&lt;p&gt;Well, user can start transaction anytime, but the fact is that if we think ORM we do not know nothing about the database. we just persist and flush objects.&lt;/p&gt;

&lt;p&gt;Yes I think these would be very useful, from how I see it, if you use event listeners, is:&lt;/p&gt;

&lt;p&gt;loadClassMetadata: you can apply extra mapping&lt;/p&gt;

&lt;p&gt;onFlush: you can modify entity changesets, or persist recalculate new ones, without triggering the database, since it is not used to begin the database modifications yet.&lt;/p&gt;

&lt;p&gt;onBeginTransaction: could use the database modifications keeping in sync the entity changesets. the thing about this event is that usually in behavioral way atomic updates are required. for example nestedset tree sync lft rgt columns, sortable sync the sort index, materialized path, all these requires atomic updates, and the best place is the start of transaction.&lt;/p&gt;

&lt;p&gt;onCommit: could be useful to execute right before commit, finalizing database modifications could be done.&lt;/p&gt;

&lt;p&gt;onRollback: this one is really something, since if you go far, there might be something like files uploaded during the entity processing, and you may want to remove them if transaction fails.&lt;/p&gt;</comment>
                    <comment id="17958" author="guilhermeblanco" created="Mon, 21 May 2012 02:26:05 +0000"  >&lt;p&gt;This situation was barely documented here: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1443&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1443&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need a better Transaction API that completely fixes the computation of changesets and also allow more fine grained control over Entities and their corresponding information.&lt;/p&gt;

&lt;p&gt;I&apos;d postpone this one until 3.0.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1590] Fix Inheritance in Code-Generation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1590</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="13345">DDC-1590</key>
            <summary>Fix Inheritance in Code-Generation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Jan 2012 14:07:08 +0000</created>
                <updated>Mon, 10 Dec 2012 11:00:40 +0000</updated>
                                                    <fixVersion>2.4</fixVersion>
                                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="19118" author="lukxde" created="Mon, 10 Dec 2012 11:00:31 +0000"  >&lt;p&gt;(I have no Link Privileges, but this one #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1379&quot; title=&quot;Entity Generator Bug with extended classes&quot;&gt;&lt;del&gt;DDC-1379&lt;/del&gt;&lt;/a&gt; is a duplicate with more extent info.)&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="13330">DDC-1579</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1570] GH-243: Add ProxyFactoryInterface to allow custom proxy factories</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1570</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/243&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/243&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;d love to have my custom proxy factory used with ORM, which is not possible at the moment&lt;/p&gt;

&lt;p&gt;(my experimental proxy &lt;a href=&quot;https://github.com/juzna/doctrine2/commit/7822446036201b066e390b2e182cac1dc0c85430&quot; class=&quot;external-link&quot;&gt;https://github.com/juzna/doctrine2/commit/7822446036201b066e390b2e182cac1dc0c85430&lt;/a&gt; and some comments about it &lt;a href=&quot;http://blog.juzna.cz/2011/06/lazy-loading-in-php/&quot; class=&quot;external-link&quot;&gt;http://blog.juzna.cz/2011/06/lazy-loading-in-php/&lt;/a&gt;)&lt;/p&gt;</description>
                <environment></environment>
            <key id="13316">DDC-1570</key>
            <summary>GH-243: Add ProxyFactoryInterface to allow custom proxy factories</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Dec 2011 12:39:03 +0000</created>
                <updated>Wed, 28 Dec 2011 19:49:30 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1564] MySQL Failure when using setFirstResult() and omitting setMaxResults()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1564</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using setFirstResult() and omitting setMaxResults(), MySQL throws an error. This was very confusing for me until I dumped the SQL statements and found out the reason.&lt;/p&gt;

&lt;p&gt;I know that MySQL doesn&apos;t directly support this, their manual says that you should set the second parameter to LIMIT to a very high number (18446744073709551615 in their example).&lt;/p&gt;

&lt;p&gt;I&apos;d recommend that either throwing an error in the specific platform driver or follow the MySQL example.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13308">DDC-1564</key>
            <summary>MySQL Failure when using setFirstResult() and omitting setMaxResults()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Dec 2011 11:47:33 +0000</created>
                <updated>Wed, 28 Dec 2011 08:48:17 +0000</updated>
                                    <version>2.1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17125" author="beberlei" created="Wed, 28 Dec 2011 08:48:17 +0000"  >&lt;p&gt;Changed into improvement, i am not sure how this relates to other databases.&lt;/p&gt;

&lt;p&gt;You can just use this workaround yourself so long.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1563] Result cache for repository queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1563</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Many related &quot;standing data&quot; tables are very static and seldom change. There should be a metadata config to enable result cache for ALL repository operations.&lt;/p&gt;

&lt;p&gt;@entity(resultCache=@cache(ttl=3600))&lt;/p&gt;</description>
                <environment></environment>
            <key id="13307">DDC-1563</key>
            <summary>Result cache for repository queries</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="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Dec 2011 11:22:11 +0000</created>
                <updated>Sun, 26 Aug 2012 19:34:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17103" author="beberlei" created="Sun, 25 Dec 2011 13:01:47 +0000"  >&lt;p&gt;This should directly support cache invalidation through a tag. Each repository gets a key with the current version. The version is one part ofthe actual cache datas key. &lt;/p&gt;

&lt;p&gt;A new cache key version is generated:&lt;/p&gt;

&lt;p&gt;1. When none is found during find operation&lt;br/&gt;
2. When any write operation is done.&lt;/p&gt;

&lt;p&gt;For transaction consisteny the rollback operation in UoW needs to reset cache keys and only after a succesful commit operation the new cache key version should be set.&lt;/p&gt;

&lt;p&gt;We may need begin, commit, rollback events in UoW for this.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1553] JTI Joining root tables could include ON ... AND root.id IS NOT NULL for each root in the inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1553</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Would lead to more optimal queries, while still allowing for LEFT JOIN. Also related to this:&lt;br/&gt;
&lt;a href=&quot;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&quot; class=&quot;external-link&quot;&gt;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13290">DDC-1553</key>
            <summary>JTI Joining root tables could include ON ... AND root.id IS NOT NULL for each root in the inheritance</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="asm89">Alexander</assignee>
                                <reporter username="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Dec 2011 11:21:32 +0000</created>
                <updated>Thu, 22 Dec 2011 11:21:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17085" author="asm89" created="Thu, 22 Dec 2011 11:21:52 +0000"  >&lt;p&gt;Again I can pick this up if this improvement is agreed upon.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1552] JTI Owning table for identifier columns could/should be the entitytable</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1552</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When ordering a JTI entity on id, the generated SQL will use the table of the root entity. This is because the root entity is listed as owner of the field in the _owningTableMap, leading to non-optimal queries.&lt;/p&gt;

&lt;p&gt;More information see:&lt;br/&gt;
&lt;a href=&quot;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&quot; class=&quot;external-link&quot;&gt;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13289">DDC-1552</key>
            <summary>JTI Owning table for identifier columns could/should be the entitytable</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="asm89">Alexander</assignee>
                                <reporter username="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Dec 2011 11:15:52 +0000</created>
                <updated>Thu, 22 Dec 2011 11:36:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17084" author="asm89" created="Thu, 22 Dec 2011 11:17:04 +0000"  >&lt;p&gt;I can pick this up if it&apos;s agreed upon that this could indeed be improved.&lt;/p&gt;</comment>
                    <comment id="17086" author="ocramius" created="Thu, 22 Dec 2011 11:33:06 +0000"  >&lt;p&gt;The problem here is that joining with a JTI causes LEFT JOINS, which don&apos;t perform very well when it comes to sorting the results.&lt;/p&gt;

&lt;p&gt;Just as a quick reference, here&apos;s where &quot;something&quot; should be changed to get this working:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L316&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L316&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the field is part of the primary key, the field used for sorting results should be the one of the table of the entity itself, and not of the root of the CTI.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1551] postFlush event listeners should be able to get a list of all flushed entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1551</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Testing the new Doctrine 2.2 Beta we finally got the postFlush event which is a nice way to handle things after all the DB work has finished. The main problem is that there is no way to get all the flushed entities. In the onFlush event you are able to use the getScheduledEntityUpdates/Inserts/Deletions but as these entities are flushed, those arrays are now empty. To solve this i see 2 aproaches:&lt;/p&gt;

&lt;p&gt;1. Not unseting the array that holds the scheduled entities so the getScheduledEntityUpdates/Inserts/Deletions still have data. Those arrays are reset just before finishing the commit method so maybe unsetting them one by one as they are flushed is not necessary&lt;br/&gt;
2. Unset the arrays but at the same time, fill another &quot;flushedEntities&quot; array with the flushed entities and then be able to get that array with a getFlushedEntities method&lt;/p&gt;

&lt;p&gt;I can make a patch if necessary, just wanted to know if that sounds ok before starting it &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;</description>
                <environment></environment>
            <key id="13287">DDC-1551</key>
            <summary>postFlush event listeners should be able to get a list of all flushed entities</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="acasademont">Albert Casademont</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Dec 2011 11:52:22 +0000</created>
                <updated>Wed, 23 May 2012 19:09:26 +0000</updated>
                                    <version>2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>8</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17971" author="jasper@nerdsweide.nl" created="Wed, 23 May 2012 19:08:43 +0000"  >&lt;p&gt;I agree that Doctrine\ORM\Event\PreFlushEventArgs should contain a record of flushed entities, preferably reachable by entity-insertions/updates/deletions and collection-updates/deletions.&lt;/p&gt;

&lt;p&gt;I have a project (using Doctrine 2.1) which wrapped the flush call in my own. My flush dispatches custom preFlush/postFlush events (as they didn&apos;t exist in Doctrine 2.1), where my postFlushEventArgs does contain such a record. I&apos;ve just upgraded my project to use Doctrine 2.2 and stumbled upon:&lt;/p&gt;

&lt;p&gt;Catchable fatal error: Argument 1 passed to Nw\Event\EntityEvent::postFlush() must be an instance of Nw\Event\Args\PostFlushEventArgs, instance of Doctrine\ORM\Event\PostFlushEventArgs given.&lt;/p&gt;

&lt;p&gt;It seems I&apos;ve now hooked into Doctrine&apos;s postFlush (because I named the events the same way). I have renamed my events to work around this error, but I&apos;d rather see my behavior implemented natively.&lt;/p&gt;

&lt;p&gt;PS: Using Doctrine 2.2.2 to be precise &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>

<item>
            <title>[DDC-1549] GH-232: Recursive check for entity identifiers and hashes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1549</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/232&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/232&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi all!&lt;br/&gt;
This PR will add a better support for entities with association keys.&lt;/p&gt;

&lt;p&gt;getType will check recursively to find a type for the identifier.&lt;br/&gt;
getIndividualValue will search recursively to find the identifier value&lt;/p&gt;

&lt;p&gt;trygetById improved, using a recursive function to find an id value instead of implode functions (that cause exceptions if the identifier is an object and do not implements __toString method).  &lt;/p&gt;
</description>
                <environment></environment>
            <key id="13284">DDC-1549</key>
            <summary>GH-232: Recursive check for entity identifiers and hashes</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Dec 2011 08:26:06 +0000</created>
                <updated>Thu, 22 Mar 2012 22:07:11 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17120" author="beberlei" created="Wed, 28 Dec 2011 08:03:40 +0000"  >&lt;p&gt;Mark as improvement&lt;/p&gt;</comment>
                    <comment id="17630" author="beberlei" created="Thu, 22 Mar 2012 22:07:11 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-232&amp;#93;&lt;/span&gt; was &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/232&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/232&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1543] Support for Mapping Files on Traits</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1543</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;With PHP 5.4 and traits coming we should find a way where you can add xml and yml configurations for a trait and upon loading an entity X, it also loads the trait configuration of this entity.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13277">DDC-1543</key>
            <summary>Support for Mapping Files on Traits</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Dec 2011 17:08:06 +0000</created>
                <updated>Sat, 17 Dec 2011 17:08:06 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1538] GH-217: [BUG] Schema Manager had no way to define extra options</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1538</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/217&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/217&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Schema Manager had no way to define extra options (&quot;comment&quot; option for example). It is possible to add these options via Annotations. After the fix adding `@ORM\Column(type=&quot;string&quot;, options=&lt;/p&gt;
{&quot;comment&quot; = &quot;test&quot;}
&lt;p&gt;)` starts to work producing valid SQL schema with COMMENT output.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13266">DDC-1538</key>
            <summary>GH-217: [BUG] Schema Manager had no way to define extra options</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Dec 2011 16:45:03 +0000</created>
                <updated>Sat, 17 Dec 2011 11:52:55 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1532] PostFlush lifecycle event</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1532</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In some cases, the database-id of the newly created record is needed in some postproccessing steps, like sending an e-mail containing a link to the just created entity. I&apos;ve recently seen the added support for PostFlush, but this is not a lifecycle event. &lt;/p&gt;

&lt;p&gt;class SomeEntityClass{&lt;/p&gt;

&lt;p&gt;    /** @PostFlush */&lt;br/&gt;
    function sendSomeEmail()&lt;/p&gt;
{
        sendEmail(&apos;
            &apos;Hi, you&apos;re new invoice can be found online: http://www.example.com/invoices/invoice_&apos;.$this-&amp;gt;id
        &apos;;
    }

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Perhaps it&apos;s even possible to have multiple PostFlush events, that differentiate between the first time a record is created, and when the record is merely updated.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13257">DDC-1532</key>
            <summary>PostFlush lifecycle event</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="jack@actinum.nl">Jack van Galen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Dec 2011 11:43:26 +0000</created>
                <updated>Wed, 14 Dec 2011 11:13:14 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16985" author="jack@actinum.nl" created="Wed, 14 Dec 2011 11:13:14 +0000"  >&lt;p&gt;Okay, please ignore this issue, as I now see that the @PostPersist does exactly what I need. I was thrown by the name, because to me, the order in which stuff happens is persist -&amp;gt; flush. The ID&apos;s are only known after flush, so i&apos;d expected something like postflush to exist. Sorry.&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1530] HIDDEN values cannot be used in WhereClause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1530</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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;SELECT  u, u.name AS HIDDEN n FROM User u WHERE n = ?1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is broken. Error:&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;SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;sclr16&apos; in &apos;where clause
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On a query like:&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;SELECT s0_.id AS id0, s0_.a AS a1, s0_.b AS b2, s0_.c AS c3, s0_.d AS d4, s0_.e AS e5, s0_.f AS f6, s0_.g AS g7, s0_.h AS h8, s0_.i AS i9, s0_.j AS j10, s0_.k AS k11, s0_.l AS l12, s0_.m AS m13, s0_.n AS n14, s0_.o AS o15, 123456789 AS sclr16, s0_.p AS p17 FROM myEntity s0_ WHERE s0_.a = 1 AND sclr16 &amp;lt;= ? ORDER BY sclr16 ASC 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13254">DDC-1530</key>
            <summary>HIDDEN values cannot be used in WhereClause</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Dec 2011 17:23:37 +0000</created>
                <updated>Wed, 25 Jan 2012 21:40:26 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17068" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:20:23 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                    <comment id="17209" author="craue" created="Mon, 9 Jan 2012 23:45:52 +0000"  >&lt;p&gt;It occurs even if the value is not HIDDEN.&lt;/p&gt;</comment>
                    <comment id="17212" author="beberlei" created="Tue, 10 Jan 2012 10:39:26 +0000"  >&lt;p&gt;@Christian this sounds like a completly different error, please explain why you think this belongs here or open a new ticket.&lt;/p&gt;</comment>
                    <comment id="17213" author="craue" created="Tue, 10 Jan 2012 10:47:38 +0000"  >&lt;p&gt;Benjamin: Because I get exactly the same error message regardless of using HIDDEN. So HIDDEN doesn&apos;t seem to be liable here.&lt;/p&gt;</comment>
                    <comment id="17214" author="beberlei" created="Tue, 10 Jan 2012 11:12:24 +0000"  >&lt;p&gt;Can you paste your DQL and SQL?&lt;/p&gt;</comment>
                    <comment id="17215" author="craue" created="Tue, 10 Jan 2012 12:22:18 +0000"  >&lt;p&gt;Code:&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;$queryBuilder
	-&amp;gt;select(&apos;myEntity, 123456789 AS distance&apos;)
	-&amp;gt;where(&apos;distance &amp;lt;= 10&apos;)
;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;DQL:&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;SELECT myEntity, 123456789 AS distance FROM MyCompany\MyBundle\Entity\MyEntity myEntity WHERE distance &amp;lt;= 10
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;SQL:&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;SELECT s0_.id AS id0, s0_.a AS a1, s0_.b AS b2, s0_.c AS c3, s0_.d AS d4, s0_.e AS e5, s0_.f AS f6, s0_.g AS g7, s0_.h AS h8, s0_.i AS i9, s0_.j AS j10, s0_.k AS k11, s0_.l AS l12, s0_.m AS m13, s0_.n AS n14, s0_.o AS o15, 123456789 AS sclr16, s0_.p AS p17 FROM myEntity s0_ WHERE sclr16 &amp;lt;= 10
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="17217" author="beberlei" created="Wed, 11 Jan 2012 11:33:32 +0000"  >&lt;p&gt;That is expected behavior, ANSI SQL defines SELECT to be evaluated &lt;b&gt;AFTER&lt;/b&gt; WHERE.&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;SELECT 1234 AS foo FROM `test` HAVING foo = 1234
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;DQL has a HAVING clause as well, not sure it works without the group by. Please try.&lt;/p&gt;</comment>
                    <comment id="17320" author="craue" created="Sat, 21 Jan 2012 14:04:28 +0000"  >&lt;p&gt;So we might just close this issue then?&lt;/p&gt;</comment>
                    <comment id="17335" author="beberlei" created="Wed, 25 Jan 2012 21:40:26 +0000"  >&lt;p&gt;Its not a bug, just the error message is supposed to be improved (if possible) in a cheap way.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1513] Missing documentation for using references in Docs</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1513</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am in the process of switching over from Doctrine 2.0.7 to Doctrine 2.1 and one of the major missing components in my entities was the new use of using the mapping entity.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
&amp;lt;?php
namespace My\Project\Entities;
use Doctrine\ORM\Mapping\Entity as ORM;
/**
 * @ORM\Entity(...)
 */
class Something
{
// Doctrine annotations here
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The nessecity for this to be included in the entities is (as far as I can tell) nowhere to be found in the docs, so I am a little curious as to how people are supposed to know. I have also had a look here: &lt;a href=&quot;http://www.doctrine-project.org/blog/doctrine-2-1-beta-release&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/blog/doctrine-2-1-beta-release&lt;/a&gt; and can see no references too it.&lt;/p&gt;

&lt;p&gt;Am I missing something; or is it really just missing from the docs?&lt;/p&gt;</description>
                <environment></environment>
            <key id="13225">DDC-1513</key>
            <summary>Missing documentation for using references in Docs</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="base">Thomas Gray</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Nov 2011 22:37:58 +0000</created>
                <updated>Tue, 29 Nov 2011 08:27:22 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16925" author="ebernhardson" created="Mon, 28 Nov 2011 22:43:56 +0000"  >&lt;p&gt;I also glanced through the docs and didn&apos;t find it.  I would suggest it be added to the Annotations Reference page: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/annotations-reference.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/annotations-reference.html&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16926" author="base" created="Tue, 29 Nov 2011 08:27:22 +0000"  >&lt;p&gt;Ahh, so there are some docs about it; &lt;a href=&quot;http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html&lt;/a&gt; however they do not seem to be that clear; nor well linked too.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1507] State change detection for version incrementation (for optimistic locking) in combination with orphanRemoval</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1507</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As i understand the documentation correctly, orphanRemoval associations have the meaning of a &quot;part of&quot; relationship. In the example (&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#orphan-removal&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#orphan-removal&lt;/a&gt;) the adresses are part of the contact.&lt;/p&gt;

&lt;p&gt;In my opinion we should reason that the state of the adress consists of the states of all nested contacts. As a consequence we should flag the contact as &quot;dirty&quot; when the adresses change.&lt;/p&gt;

&lt;p&gt;This is relevant for optimistic locking scenarios or event handlers. In my application i tried to use optimistic locking for &quot;contacts&quot;, which does not work if i don&apos;t change anything in the contact but only in the nested addresses.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13212">DDC-1507</key>
            <summary>State change detection for version incrementation (for optimistic locking) in combination with orphanRemoval</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="georgwaechter">Georg W&#228;chter</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Nov 2011 11:48:40 +0000</created>
                <updated>Sun, 27 Nov 2011 13:04:57 +0000</updated>
                                    <version>2.1.4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16921" author="beberlei" created="Sun, 27 Nov 2011 08:47:25 +0000"  >&lt;p&gt;This is still only an approvement, you can workaround this and handle is in your domain code.&lt;/p&gt;</comment>
                    <comment id="16922" author="georgwaechter" created="Sun, 27 Nov 2011 13:04:57 +0000"  >&lt;p&gt;Not in all cases. The first problem is that my domain code can&apos;t modify the version property, doctrine seems to block any manipulations to it. So i&apos;m not able to increment the variable myself.&lt;/p&gt;

&lt;p&gt;The only solution is to implement optimistic locking on my own or to add a dummy persistent boolean field that gets inversed by my domain code .. which would trigger the doctrine implementation for the optimistic locking.&lt;/p&gt;

&lt;p&gt;I think it&apos;s clear that the second option shouldn&apos;t be a choice. If doctrine doesn&apos;t handle the overall case exactly it should allow me to increment the version number myself.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1506] Possible Regression with OneToOne relation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1506</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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
 */
class Top
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * @ORM\OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;LevelOne&quot;&lt;/span&gt;, orphanRemoval=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $levelOne;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId()
    {
        &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;id;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setLevelOne(LevelOne $levelOne)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;levelOne = $levelOne;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getLevelOne()
    {
        &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;levelOne;
    }
}

/**
 * @ORM\Entity
 */
class LevelOne
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * @ORM\OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;LevelTwo&quot;&lt;/span&gt;, orphanRemoval=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $levelTwo;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId()
    {
        &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;id;
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setId($id)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id = $id;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setLevelTwo(LevelTwo $levelTwo)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;levelTwo = $levelTwo;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getLevelTwo()
    {
        &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;levelTwo;
    }
}

/**
 * @ORM\Entity
 */
class LevelTwo
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId()
    {
        &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;id;
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setId($id)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id = $id;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;trying to clone objects&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;$top = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Top();
        $top-&amp;gt;setLevelOne(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; LevelOne());
        $top-&amp;gt;getLevelOne()-&amp;gt;setLevelTwo(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; LevelTwo());
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($top);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();
        
        $newTop = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Top();
        $newTop-&amp;gt;setLevelOne(clone $top-&amp;gt;getLevelOne());
        $newTop-&amp;gt;getLevelOne()-&amp;gt;setId(&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
        $newTop-&amp;gt;getLevelOne()-&amp;gt;getLevelTwo()-&amp;gt;setId(&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
        
        var_dump($newTop-&amp;gt;getLevelOne()-&amp;gt;getId());
        var_dump($newTop-&amp;gt;getLevelOne()-&amp;gt;getLevelTwo()-&amp;gt;getId());
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($newTop);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the output is:&lt;br/&gt;
NULL&lt;br/&gt;
NULL&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;PDOException&amp;#93;&lt;/span&gt;                                                                                             &lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1&apos; for key &apos;UNIQ_82A72CD0778BC57F&apos; &lt;br/&gt;
(it duplicates level two entity)&lt;br/&gt;
I worked for a while with entities, in a certain set of entity properties it completely persisted into database, but without relation between level one and level two.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13211">DDC-1506</key>
            <summary>Possible Regression with OneToOne relation</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="13135">DDC-1461</parent>
                        <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="n3b">Maxim</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Nov 2011 10:06:02 +0000</created>
                <updated>Wed, 23 Nov 2011 10:06:02 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1484] GH-162: ProxyFactory creates proxy&apos;s parent structure if it doesn&apos;t exist</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1484</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/162&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/162&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wheeee, nested proxies can be generated without hassle!&lt;/p&gt;</description>
                <environment></environment>
            <key id="13163">DDC-1484</key>
            <summary>GH-162: ProxyFactory creates proxy&apos;s parent structure if it doesn&apos;t exist</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Nov 2011 23:50:39 +0000</created>
                <updated>Tue, 26 Jun 2012 20:40:34 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16802" author="beberlei" created="Sun, 13 Nov 2011 15:47:40 +0000"  >&lt;p&gt;Marked as improvement&lt;/p&gt;</comment>
                    <comment id="18090" author="beberlei" created="Sat, 16 Jun 2012 07:55:43 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-162&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/162&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/162&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18143" author="beberlei" created="Tue, 26 Jun 2012 20:40:33 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-162&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/162&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/162&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1475] Documentation for One-To-Many, Bidirectional Association does not have YAML example</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1475</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When you are looking for a config example for the bidirectional mapping of an one-to-many association you will just find an example with XML, but not with YAML or PHP. It would be nice if somebody could add an example or a link to the bidirectional one-to-one association, because it should be the same, right?&lt;/p&gt;

&lt;p&gt;Here the link to the example: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#one-to-many-bidirectional&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#one-to-many-bidirectional&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13154">DDC-1475</key>
            <summary>Documentation for One-To-Many, Bidirectional Association does not have YAML example</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="naitsirch">Christian Stoller</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Nov 2011 11:33:59 +0000</created>
                <updated>Mon, 7 Nov 2011 11:35:13 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1465] Fetching partial objects doesn&apos;t work if HINT_FORCE_PARTIAL_LOAD is not explicitly used</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1465</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using the DQL &quot;partial&quot; keyword is not enough to get a partial entity as a result.&lt;br/&gt;
The DQL hint HINT_FORCE_PARTIAL_LOAD must be used as well.&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;$q = $em-&amp;gt;createQuery(&apos;SELECT partial r.{id,comment} FROM Entities\Rating r WHERE r.id=3&apos;);
$r = $q-&amp;gt;getResult() /* HYDRATE_OBJECT is the &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; hydration mode */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here, $r contains the full Entity, a SELECT * has been sent&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;$q = $em-&amp;gt;createQuery(&apos;SELECT partial r.{id,comment} FROM Entities\Rating r WHERE r.id=3&apos;);
$q-&amp;gt;setHint(Doctrine\ORM\Query::HINT_FORCE_PARTIAL_LOAD, 1);

$r = $q-&amp;gt;getResult() /* HYDRATE_OBJECT is the &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; hydration mode */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here, $r contains only the selected fields, hence a true partial Entity&lt;/p&gt;</description>
                <environment></environment>
            <key id="13141">DDC-1465</key>
            <summary>Fetching partial objects doesn&apos;t work if HINT_FORCE_PARTIAL_LOAD is not explicitly used</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="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="jpauli">Julien Pauli</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Nov 2011 11:08:02 +0000</created>
                <updated>Fri, 11 Nov 2011 09:28:12 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                            <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11442">DDC-624</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1459] Move DDC-331, DDC-448, DDC-493, DDC-513, DDC-698 Tests into SQLGeneration Testsuite</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1459</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="13131">DDC-1459</key>
            <summary>Move DDC-331, DDC-448, DDC-493, DDC-513, DDC-698 Tests into SQLGeneration Testsuite</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 29 Oct 2011 17:06:43 +0000</created>
                <updated>Wed, 1 Aug 2012 21:04:34 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1450] UnitOfWork Transaction Rollback Support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1450</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The UnitOfWork does not handle the case very well where a rollback is necessary. Can this be optimized?&lt;/p&gt;</description>
                <environment></environment>
            <key id="13122">DDC-1450</key>
            <summary>UnitOfWork Transaction Rollback Support</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Oct 2011 07:51:09 +0000</created>
                <updated>Tue, 20 Dec 2011 22:21:37 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17073" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:37 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1445] Improve error messages</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1445</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Error messages throughout ClassMetadata validation and UnitOfWork cycles can be significantly improved.&lt;/p&gt;

&lt;p&gt;Work is being done on: &lt;a href=&quot;https://github.com/doctrine/doctrine2/tree/ImproveErrorMessages&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/tree/ImproveErrorMessages&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13110">DDC-1445</key>
            <summary>Improve error messages</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 22 Oct 2011 08:48:50 +0000</created>
                <updated>Tue, 20 Dec 2011 22:21:04 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17070" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:04 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1443] Subscribers reachs maximum nesting level when creating association on pre/postPersist with cascade persist</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1443</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Suppose a situation where:&lt;/p&gt;

&lt;p&gt;A -&amp;gt; B&lt;/p&gt;

&lt;p&gt;Where the OneToOne unidirectional association contains cascade persist.&lt;/p&gt;

&lt;p&gt;If I decide to save an entity B that should create an A instance, it goes into maximum nesting level no matter if I track prePersist or postPersist.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13108">DDC-1443</key>
            <summary>Subscribers reachs maximum nesting level when creating association on pre/postPersist with cascade persist</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="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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Oct 2011 16:57:36 +0000</created>
                <updated>Sat, 29 Oct 2011 07:27:24 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16676" author="guilhermeblanco" created="Thu, 20 Oct 2011 18:54:45 +0000"  >&lt;p&gt;Failing test case&lt;/p&gt;</comment>
                    <comment id="16677" author="guilhermeblanco" created="Thu, 20 Oct 2011 20:10:08 +0000"  >&lt;p&gt;Uploading a new version, now passing successfully, but consuming the onFlush event (which should not be ideal).&lt;/p&gt;</comment>
                    <comment id="16720" author="beberlei" created="Sat, 29 Oct 2011 07:27:24 +0000"  >&lt;p&gt;Ah yes, this never worked. The transaction stuff will fix that. You have to use scheduleForInsert() something inside prePersist.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11080" name="DDC1443Test.php" size="3664" author="guilhermeblanco" created="Thu, 20 Oct 2011 20:10:08 +0000" />
                    <attachment id="11079" name="DDC1443Test.php" size="3383" author="guilhermeblanco" created="Thu, 20 Oct 2011 18:54:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1441] Metadata cannot be loaded for not registered proxy objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1441</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We are using several Doctrine managers in our project with the same entity classes and different database tables.&lt;/p&gt;

&lt;p&gt;The problem appears when we are willing to merge entity with lazy associations from one manager to another. The second entity manager instance hasn&apos;t got the proxy object metadata defined yet so it fails with Doctrine\ORM\Mapping\MappingException exception &quot;Class EntityProxy is not a valid entity or mapped super class.&quot;.&lt;/p&gt;

&lt;p&gt;If both entity managers share the proxy objects the problem can be fixed by calling &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;$em-&amp;gt;getProxyFactory()-&amp;gt;getProxy(&apos;Entity&apos;, -1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which will register the entity metadata for the proxy classname as well.&lt;/p&gt;

&lt;p&gt;Still if the proxy configuration differs, there is no fix found without changing the Doctrine ORM code.&lt;/p&gt;

&lt;p&gt;The fix inside the Doctrine would be to detect Proxy classes before loading the metadata and load the metadata for it&apos;s parent class instead. Please see the diff attached with proposed solution.&lt;/p&gt;

&lt;p&gt;Also I think this issue could arise when unserialized entity objects will be merged into the entity manager. I will try creating test case for this.&lt;/p&gt;</description>
                <environment>MySQL, Ubuntu, PHP 5.3.6</environment>
            <key id="13106">DDC-1441</key>
            <summary>Metadata cannot be loaded for not registered proxy objects</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Oct 2011 13:02:43 +0000</created>
                <updated>Thu, 5 Apr 2012 08:39:55 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16913" author="gedrox" created="Thu, 24 Nov 2011 14:45:46 +0000"  >&lt;p&gt;Test case attached.&lt;/p&gt;</comment>
                    <comment id="17768" author="gedrox" created="Thu, 5 Apr 2012 08:39:55 +0000"  >&lt;p&gt;See my pull request in &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/332&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/332&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11116" name="DDC1441Test.php" size="2539" author="gedrox" created="Thu, 24 Nov 2011 14:45:46 +0000" />
                    <attachment id="11077" name="not-loaded-proxy-patch.diff" size="1096" author="gedrox" created="Thu, 20 Oct 2011 13:02:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1438] Add test for DDC-1437</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1438</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Add test for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1437&quot; title=&quot;Strange behavior  with proxied classes,expected to get entity, but returned identifier.&quot;&gt;&lt;del&gt;DDC-1437&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13103">DDC-1438</key>
            <summary>Add test for DDC-1437</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Oct 2011 10:09:29 +0000</created>
                <updated>Wed, 19 Oct 2011 10:09:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1431] Current event system is not flexible enough</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1431</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;According to &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/events.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/events.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Current event system seem to be not as flexible as it could be.&lt;/p&gt;

&lt;p&gt;1. &lt;b&gt;According Lifecycle Events of the entity (marked with @HasLifecycleCallbacks annotation tag)&lt;/b&gt;:&lt;br/&gt;
It would be useful to have access to Entity Manager inside the callbacks. This could be achieved by passing the entity manager as a parameter to all these callbacks. &lt;/p&gt;

&lt;p&gt;Here is the situation:&lt;br/&gt;
I have an entity for a news item. After somehow modifying this entity and before persisting I want to be able to change the inner association of images linked to this news (for example parsed from news body text). From the OO point of view it&apos;s a task of the News entity itself so this should be done a callback. But since inside callback I do not have access to entity manager (to find existing image entities and only if not found creating a new one) I cannot do this.&lt;br/&gt;
This leads to creating a separate event listener which is split from the news entity (and that is not possible, see 2.).&lt;/p&gt;

&lt;p&gt;Passing entity manager to callbacks may improve it&apos;s usefulness.&lt;/p&gt;

&lt;p&gt;2. &lt;b&gt;Currently there is no events to be called before the changes have been computed. And there is no callback to be called after flush has been finished. (preFlush, postFlush)&lt;/b&gt;&lt;br/&gt;
The problem:&lt;br/&gt;
Assume we have a News entity. I want to modify external system (even not written in PHP) via remote call after any change to news being made. This has to be called AFTER the flush has persisted all the changes. Currently the only place to do this is onFlush (which is called before the persisting is done).&lt;br/&gt;
PostPersist, postRemove, postUpdate cannot be used as it&apos;s called after each one entity is modified and we cannot tell when all entites has been processed.&lt;/p&gt;

&lt;p&gt;Also I faced a problem when implementing the event listener for situation 1. If I register the onFlush listener - the entites changeset is already calculated. If I change something according associations I loose this changes. &lt;br/&gt;
If I call $unitOfWork-&amp;gt;computeChangeSet($classMetadata, $entity) or $unitOfWork-&amp;gt;recomputeSingleEntityChangeSet($classMetadata, $entity); I only get the changes being made after previous changeset calculation loosing the initial changes. I think the preFlush could be a lifesaver for this (to be called before computing the changeset for the first time).&lt;/p&gt;


</description>
                <environment>Doctrine 2.1</environment>
            <key id="13096">DDC-1431</key>
            <summary>Current event system is not flexible enough</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="c0ba">Oleg Stepura</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Oct 2011 09:37:45 +0000</created>
                <updated>Tue, 18 Oct 2011 09:40:26 +0000</updated>
                                    <version>2.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
            <subtask id="13119">DDC-1449</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-1429] Add a method to the unit of work that merges any detached entity into UoW without calling SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1429</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is for those that know what they are doing &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.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;</description>
                <environment></environment>
            <key id="13094">DDC-1429</key>
            <summary>Add a method to the unit of work that merges any detached entity into UoW without calling SQL</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Oct 2011 22:05:01 +0000</created>
                <updated>Mon, 17 Oct 2011 22:05:01 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1415] EventListener delegate on entity basis</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1415</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="13080">DDC-1415</key>
            <summary>EventListener delegate on entity basis</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Oct 2011 21:22:28 +0000</created>
                <updated>Tue, 20 Dec 2011 22:22:59 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16970" author="beberlei" created="Mon, 12 Dec 2011 15:46:34 +0000"  >&lt;p&gt;Removed from master, as i dont like the api at all&lt;/p&gt;</comment>
                    <comment id="17077" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:59 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1398] loading one item at a time when indexBy and EXTRA_LAZY fetch mode is used on a collection</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1398</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;collection-&amp;gt;get($key)&lt;/p&gt;

&lt;p&gt;Atm in 2.1.2 this is loading the entire collection. It would be really handy that it would extra lazy load only one item using the association and indexBy fields and given key value (if collection is not initialized and the key havent been loaded yet ofc)&lt;/p&gt;

&lt;p&gt;Am i making sense with this? &lt;/p&gt;</description>
                <environment></environment>
            <key id="13053">DDC-1398</key>
            <summary>loading one item at a time when indexBy and EXTRA_LAZY fetch mode is used on a collection</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="hypno">Reio Piller</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Sep 2011 18:34:38 +0000</created>
                <updated>Sat, 10 Mar 2012 16:30:19 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="17075" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:20 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                    <comment id="17526" author="gcaseres" created="Mon, 5 Mar 2012 22:02:25 +0000"  >&lt;p&gt;Is there any fix for this? i have the same problem.&lt;/p&gt;</comment>
                    <comment id="17544" author="deatheriam" created="Sat, 10 Mar 2012 16:29:38 +0000"  >&lt;p&gt;It makes a perfect sense here, I wish it was possible, it would give us a room for even more optimization. Any input on the issue from the developers?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1393] Skipping tables or columns in database driver or SchemaTool</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1393</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There should be a sane way to skip sources of errors in SchemaTool and the DatabaseDriver.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13040">DDC-1393</key>
            <summary>Skipping tables or columns in database driver or SchemaTool</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Sep 2011 12:23:10 +0000</created>
                <updated>Tue, 20 Dec 2011 22:21:26 +0000</updated>
                                    <version>2.1.1</version>
                <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16502" author="beberlei" created="Sat, 24 Sep 2011 13:17:52 +0000"  >&lt;p&gt;Idea:&lt;/p&gt;

&lt;p&gt;Develop a datastructure of sorts that allows saving information about skipping tables and columns therein when reverse engeneering.&lt;/p&gt;</comment>
                    <comment id="16953" author="guilhermeblanco" created="Fri, 9 Dec 2011 04:48:47 +0000"  >&lt;p&gt;This is not possible unless you take advantage of Topological Sorting to map class dependencies like we do inside of UnitOfWork AFTER creating the ClassMetadata.&lt;/p&gt;

&lt;p&gt;The necessity of having this is mandatory because we can never skip classes that have associations to other ones though FK.&lt;br/&gt;
You may try that, but it doesn&apos;t compensate the effort. I&apos;d rather mark this bug as won&apos;t fix, but I&apos;m leaving for you do that. =)&lt;/p&gt;</comment>
                    <comment id="17072" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:26 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1390]  Lazy loading does not work for the relationships of an entity instance, whose class inherits from another entity class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1390</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Lazy loading does not work for the relationships of an instance of an entity, whose class inherits from another entity class.&lt;/p&gt;

&lt;p&gt;Assume there are two entity classes, A and B, where A inherits from B.&lt;/p&gt;

&lt;p&gt;Now let $a be an instance of A, e. g. the result of &quot;SELECT a FROM \A WHERE a.id = 1&quot;.&lt;/p&gt;

&lt;p&gt;Outputting $a will confirm it is a valid instance of a proxy object inheriting from A.&lt;/p&gt;

&lt;p&gt;Assume that the database row corresponding to $a contains a non-null foreign key that actually links to an existing row in another table, corresponding to another entity instance of a different class.&lt;/p&gt;

&lt;p&gt;Now, $a-&amp;gt;someRelationship will always returns null in this scenario. I assume this is unintended behaviour, because clearly, the other entity should be lazily loaded on accessing it, and there is a value in the database.&lt;/p&gt;

&lt;p&gt;The fetch annotation attribute on that relationship has not been explicitly set, so I assume it is set to the default value, which, according to the docs, should be &quot;lazy&quot;.&lt;/p&gt;

&lt;p&gt;The loading only fails when accessing the relationships of an entity instance, whose class inherits from another entity class. For entity instances, whose classes do not inherit from another entity class, lazy loading of their relationships works as expected.&lt;/p&gt;

&lt;p&gt;I had a look at the proxy objects and verified that they are present and override the __get method with an implementation containing a call to the load() method. Still, the loading won&apos;t work for some reason.&lt;/p&gt;

&lt;p&gt;This could be related to Bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1389&quot; title=&quot;Querying subclass entities using DQL results in broken SQL being generated&quot;&gt;&lt;del&gt;DDC-1389&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1389&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1389&lt;/a&gt;) which also happens exclusively in an inheritance scenario. Maybe the current implementation of inheritance is generally wrong or incomplete.&lt;/p&gt;</description>
                <environment>Debian Linux 6.0, MySQL 5.0.51a</environment>
            <key id="13036">DDC-1390</key>
            <summary> Lazy loading does not work for the relationships of an entity instance, whose class inherits from another entity class</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Sep 2011 17:22:51 +0000</created>
                <updated>Sun, 6 Jan 2013 08:59:31 +0000</updated>
                                    <version>2.1.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16760" author="beberlei" created="Mon, 31 Oct 2011 22:31:10 +0000"  >&lt;p&gt;Did this get fixed with the correction of your data?&lt;/p&gt;</comment>
                    <comment id="16762" author="dalvarez" created="Tue, 1 Nov 2011 06:22:55 +0000"  >&lt;p&gt;No it did not. This issue is completely unrelated to the other one.&lt;/p&gt;

&lt;p&gt;For this, I have manually implemented workarounds, fetching the associations using DQL queries. Lazy loading in the inheritance scenario above still would not work.&lt;/p&gt;</comment>
                    <comment id="16763" author="beberlei" created="Tue, 1 Nov 2011 11:22:56 +0000"  >&lt;p&gt;So A is an entity in a hierachy A -&amp;gt; B, and &quot;someRelationship&quot; is a field on A or on B &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; towards an Entity C that is in an inheritance hierachy or not? &lt;/p&gt;

&lt;p&gt;Could you post parts of the mappings (entity docblock and the relationship)?&lt;/p&gt;</comment>
                    <comment id="16772" author="dalvarez" created="Sun, 6 Nov 2011 17:05:25 +0000"  >&lt;p&gt;Hey, thanks for taking care of this.&lt;/p&gt;

&lt;p&gt;I attached the entities involved in the szenario to this issue.&lt;/p&gt;

&lt;p&gt;I had problems lazy loading entities through the following associations:&lt;/p&gt;

&lt;p&gt;  Run.invoiceCreatorResult&lt;br/&gt;
  Run.commissionNoteCreatorResult&lt;br/&gt;
  Run.consumerInvoiceExporterResult&lt;/p&gt;

&lt;p&gt;as well as&lt;/p&gt;

&lt;p&gt;  InvoiceCreatorResult.dataVersion&lt;br/&gt;
  CommissionNoteCreatorResult.dataVersion&lt;br/&gt;
  ConsumerInvoiceExporterResult.dataVersion&lt;/p&gt;


&lt;p&gt;In this scenario, InvoiceCreatorResult, CommissionNoteCreatorResult and ConsumerInvoiceExporterResult all inherit from Result, which in turn inherits from a mapped superclass DataObject. Run and DataVersion inherit from DataObject directly.&lt;/p&gt;

&lt;p&gt;The associations where lazy loading does not work are associations both to and from the entity classes InvoiceCreatorResult, CommissionNoteCreatorResult and ConsumerInvoiceExporterResult.&lt;/p&gt;</comment>
                    <comment id="16859" author="beberlei" created="Fri, 18 Nov 2011 13:52:28 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Now let $a be an instance of A, e. g. the result of &quot;SELECT a FROM \A WHERE a.id = 1&quot;.&lt;/p&gt;

&lt;p&gt;Outputting $a will confirm it is a valid instance of a proxy object inheriting from A.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Just a short Q on understanding: Why is $a a proxy of A if you select it explicitly?&lt;/p&gt;</comment>
                    <comment id="16861" author="beberlei" created="Fri, 18 Nov 2011 14:21:35 +0000"  >&lt;p&gt;This a working test-case with a model that i believe resembles yours exactly.&lt;/p&gt;

&lt;p&gt;I also put your models into another test and ran schema validation on them, which works out without problems.&lt;/p&gt;

&lt;p&gt;From the workflow with proxies, maybe &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1452&quot; title=&quot;ObjectHydrator bug: hydration of entity with self (cyclic) relation through ref entity&quot;&gt;&lt;del&gt;DDC-1452&lt;/del&gt;&lt;/a&gt; might be related to your issue?&lt;/p&gt;</comment>
                    <comment id="16871" author="dalvarez" created="Fri, 18 Nov 2011 17:47:53 +0000"  >&lt;p&gt;Regarding the proxy question, I just ment the query to be an example to further illustrate the type of $a. It was redundant and unnecessary though and probably misleading. Sorry for that. I did not select anything in the actual scenario. $a is merely some object of type A. No queries are involved.&lt;/p&gt;</comment>
                    <comment id="16873" author="dalvarez" created="Fri, 18 Nov 2011 18:16:24 +0000"  >&lt;p&gt;Have you been able to make the tests fail with the original data provided?&lt;/p&gt;

&lt;p&gt;If not, I could set up a test case and post it.&lt;/p&gt;</comment>
                    <comment id="16874" author="beberlei" created="Fri, 18 Nov 2011 18:38:02 +0000"  >&lt;p&gt;No i only checked the validity of mappings with the original data. If you could setup a testcase that would be really great.&lt;/p&gt;</comment>
                    <comment id="16890" author="dalvarez" created="Sat, 19 Nov 2011 16:05:52 +0000"  >&lt;p&gt;I will set up a test case and upload it. I&apos;ll see if I can do it one of the next evenings.&lt;/p&gt;</comment>
                    <comment id="17011" author="beberlei" created="Sat, 17 Dec 2011 13:26:19 +0000"  >&lt;p&gt;I tried again, also extended &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1390&quot; title=&quot; Lazy loading does not work for the relationships of an entity instance, whose class inherits from another entity class&quot;&gt;DDC-1390&lt;/a&gt;, but it was impossible for me to reproduce this. I ran this against master, 2.1.x and 2.1.1 specifically.&lt;/p&gt;</comment>
                    <comment id="19217" author="dalvarez" created="Sat, 5 Jan 2013 18:42:17 +0000"  >&lt;p&gt;Sorry, I got swamped with work. Now I am working on this dedicatedly, testing against the latest release. Will let you know once I have a testcase.&lt;/p&gt;</comment>
                    <comment id="19218" author="beberlei" created="Sun, 6 Jan 2013 08:59:31 +0000"  >&lt;p&gt;Good to hear, thanks for the persistent work on this.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11100" name="CommissionNoteCreatorResult.php" size="891" author="dalvarez" created="Sun, 6 Nov 2011 16:56:50 +0000" />
                    <attachment id="11101" name="ConsumerInvoiceExporterResult.php" size="353" author="dalvarez" created="Sun, 6 Nov 2011 16:56:50 +0000" />
                    <attachment id="11096" name="DataObject.php" size="1338" author="dalvarez" created="Sun, 6 Nov 2011 16:54:35 +0000" />
                    <attachment id="11102" name="DataVersion.php" size="1314" author="dalvarez" created="Sun, 6 Nov 2011 16:58:35 +0000" />
                    <attachment id="11112" name="DDC1390Test.php" size="2412" author="beberlei" created="Fri, 18 Nov 2011 14:21:35 +0000" />
                    <attachment id="11099" name="InvoiceCreatorResult.php" size="835" author="dalvarez" created="Sun, 6 Nov 2011 16:55:13 +0000" />
                    <attachment id="11098" name="Result.php" size="1669" author="dalvarez" created="Sun, 6 Nov 2011 16:54:35 +0000" />
                    <attachment id="11097" name="Run.php" size="1817" author="dalvarez" created="Sun, 6 Nov 2011 16:54:35 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1380] Standardize proxy class naming</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1380</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;see &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/125&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/125&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13024">DDC-1380</key>
            <summary>Standardize proxy class naming</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Sep 2011 11:14:10 +0000</created>
                <updated>Sun, 18 Sep 2011 11:14:10 +0000</updated>
                                    <version>2.x</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1371] Optimistic Locking using hash column or all columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1371</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We can implement optimistic locking using hash values or other all columns of an entity&lt;/p&gt;</description>
                <environment></environment>
            <key id="13008">DDC-1371</key>
            <summary>Optimistic Locking using hash column or all columns</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Sep 2011 08:32:39 +0000</created>
                <updated>Sat, 10 Sep 2011 08:32:39 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1357] Queries with multiple joins resulting in multiple scalar results for each top level entity only retain one scalar value for each entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1357</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Consider this example:&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;select g.id, u.id, u.status, count(p.phonenumber) numPhones from Group
     * g join g.user u join u.phonenumbers p group by g.id, u.status, u.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;With data:&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;phonenumbers:
    [1, 2, 3, 4, 5, 6]
users:
    [{id: 1, status: developer, phonenumbers: [1, 2]},
     {id: 2, status: developer, phonenumbers: [3]},
     {id: 3, status: developer, phonenumbers: [4, 5, 6]}]
groups:
    [{id: 1, users: [1, 2]]},
     {id:2, users: [3]}]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result currently is:&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;array(
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 1,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 1 },
                object(CmsUser) { &apos;id&apos; =&amp;gt; 2 }
            )
         },
        &apos;numPhones&apos; =&amp;gt; 1
    ),
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 2,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 3 }
            )
        },
        &apos;numPhones&apos; =&amp;gt; 3
    )
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that the first entry contains only one value numPhones =&amp;gt; 1, even though there are two users associated with that group. One of whom has 2 phone numbers and the other has 1.&lt;/p&gt;

&lt;p&gt;The result I would expect is:&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;array(
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 1,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 1 },
                object(CmsUser) { &apos;id&apos; =&amp;gt; 2 }
            )
         },
        &apos;numPhones&apos; =&amp;gt; array(2, 1)
    ),
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 2,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 3 }
            )
        },
        &apos;numPhones&apos; =&amp;gt; array(3)
    )
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The difference is that numPhones for each row now contains an array of the&lt;br/&gt;
scalar values matching the corresponding users.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12991">DDC-1357</key>
            <summary>Queries with multiple joins resulting in multiple scalar results for each top level entity only retain one scalar value for each entity</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="naderman">Nils Adermann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Sep 2011 22:46:17 +0000</created>
                <updated>Thu, 1 Sep 2011 22:50:05 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16410" author="naderman" created="Thu, 1 Sep 2011 22:49:22 +0000"  >&lt;p&gt;You can find a test case for the correct result here: &lt;a href=&quot;https://github.com/naderman/doctrine2/commit/a1ca3d9847cbc514fc951fb0b221b26fe03a6619&quot; class=&quot;external-link&quot;&gt;https://github.com/naderman/doctrine2/commit/a1ca3d9847cbc514fc951fb0b221b26fe03a6619&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1347] Github-PR-110 by shesek: Support NULL in EntityRepository&apos;s magic findBy and findOneBy methods</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1347</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of &lt;/p&gt;
{username}
&lt;p&gt;:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/110&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/110&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;The magic `findBy` and `findOneBy` methods don&apos;t support passing NULL as the value, because &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;we cannot (yet) transform it into IS NULL&amp;quot;&amp;#93;&lt;/span&gt;(&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L207&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L207&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;However, `BasicEntityPersister::_getSelectConditionSQL()` &lt;span class=&quot;error&quot;&gt;&amp;#91;does support that&amp;#93;&lt;/span&gt;(&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L1229&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L1229&lt;/a&gt;). It seems like leftovers from when there was no support for it. I tried it locally (after applying this change) and it does seem to work well.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12968">DDC-1347</key>
            <summary>Github-PR-110 by shesek: Support NULL in EntityRepository&apos;s magic findBy and findOneBy methods</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Aug 2011 18:02:49 +0000</created>
                <updated>Thu, 25 Aug 2011 18:02:49 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1342] Github-PR-109: Remove trailing spaces</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1342</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;alOneh created a pull request on Github: &lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/109&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/109&lt;/a&gt;&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12941">DDC-1342</key>
            <summary>Github-PR-109: Remove trailing spaces</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Aug 2011 14:12:43 +0000</created>
                <updated>Sun, 21 Aug 2011 14:12:43 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1320] Ship Immutable date time with Doctrine Common, use in ORM - Should implement __toString()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1320</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12904">DDC-1320</key>
            <summary>Ship Immutable date time with Doctrine Common, use in ORM - Should implement __toString()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 6 Aug 2011 17:05:04 +0000</created>
                <updated>Mon, 31 Oct 2011 19:16:21 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16745" author="beberlei" created="Mon, 31 Oct 2011 19:16:21 +0000"  >&lt;p&gt;Has to be pushed back as immutable date time cannot be implemented in userland that well.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="12896">DDC-1316</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1308] Add cache for transient information and invalidation for ClassMetadata</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1308</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Two different things have to be improved in the caching:&lt;/p&gt;

&lt;p&gt;1. The information isTransient() has to be moved to the ClassMetadataFactory and cached there.&lt;br/&gt;
2. The information getAllClassMetadataNames() can be cached&lt;br/&gt;
3. A debug/development mode should be introduced, leading to filemtime caching and checks so that you can use ApcCache and such in development.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12882">DDC-1308</key>
            <summary>Add cache for transient information and invalidation for ClassMetadata</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 31 Jul 2011 18:45:24 +0000</created>
                <updated>Tue, 20 Dec 2011 22:20:51 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17069" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:20:51 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1285] Select by multiple ids</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1285</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;How do you look at adding findByIds(array $ids) to EntityManager and UnitOfWork? This would allow fetching multiple entities from a database at one request and would be very useful for caching - there would be even some kind of IdentityMap kept in memcached or any other caching engine, that supports multiple id retrieval: i&apos;ve been using such an architecture in multiple projects and it turned out to be very effective. There were two basic methods - findIdsByFilter(array $filter) and findEntitiesByIds(array $ids). The latter one had a caching proxy, replicating entities to a cache storage. If this idea proceeds - I&apos;d be glad to cover it with more details.&lt;/p&gt;

&lt;p&gt;This topic on StackOverflow could also help:&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/276709/design-pattern-for-memcached-data-caching&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/276709/design-pattern-for-memcached-data-caching&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12842">DDC-1285</key>
            <summary>Select by multiple ids</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="serge.smertin">Serge Smertin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Jul 2011 12:30:34 +0000</created>
                <updated>Fri, 11 Jan 2013 01:13:32 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17071" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:15 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1270] Incorrect  QueryBuilder example</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1270</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the QueryBuilder section of the documentation (&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/query-builder.html#the-expr-class&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/query-builder.html#the-expr-class&lt;/a&gt;) there&apos;s an example with statements like&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;expr()-&amp;gt;select(&apos;u&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;But this doesn&apos;t work anymore.&lt;/p&gt;

</description>
                <environment></environment>
            <key id="12814">DDC-1270</key>
            <summary>Incorrect  QueryBuilder example</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="a.bogomazov">Alex Bogomazov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jul 2011 13:50:30 +0000</created>
                <updated>Mon, 11 Jul 2011 17:49:28 +0000</updated>
                                    <version>2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16149" author="mridgway" created="Mon, 11 Jul 2011 17:49:28 +0000"  >&lt;p&gt;PR at &lt;a href=&quot;https://github.com/doctrine/orm-documentation/pull/35&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/orm-documentation/pull/35&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1269] Unexpected behavior while using association on a non primary key field</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1269</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We have association on non primary key. Something 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;Entities\Payment:
  type: entity
  table: payments
  fields:
    id: 
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      generator:
        strategy: IDENTITY
[-- skipped --]
  manyToOne:
    order:
      targetEntity: Entities\Order
      inversedBy: payments
      joinColumn:
        name: scode
        referencedColumnName: scode
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;Entities\Order:
  type: entity
  table: h_orders
  fields:
    id:
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      generator:
        strategy: IDENTITY
    scode:
      type: integer
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
[-- skipped --]
  oneToMany:
    payments:
      targetEntity: Entities\Payment
      mappedBy: order
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I try to fetch Order from Payment with lazy loading I receive empty Order object with null properties. If I use eager fetching Order object is valid.&lt;br/&gt;
SQL generated for lazy loading seems to be valid, so I suppose the problem is in mapping result to the object. At the same time lazy loading works fine with 2.0.6 version.&lt;/p&gt;




&lt;p&gt;Another problem appears while persisting new Payment. &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;$payment = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entities\Payment();
...
$order = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;getRepository(&apos;\Entities\Order&apos;)-&amp;gt;find(46320);
$payment-&amp;gt;setOrder($order);
$order-&amp;gt;addPayments($payment);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($payment);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I get this error: Fatal error: Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1048 Column &apos;scode&apos; cannot be null&apos; in /usr/share/php/Doctrine/DBAL/Statement.php:131&lt;/p&gt;

&lt;p&gt;I found issue which is still open and looks like mine &amp;#8211; &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1114&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1114&lt;/a&gt;. What do you think about this? &lt;/p&gt;</description>
                <environment></environment>
            <key id="12813">DDC-1269</key>
            <summary>Unexpected behavior while using association on a non primary key field</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="saniok">Alexandr Torchenko</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jul 2011 13:03:18 +0000</created>
                <updated>Wed, 13 Jul 2011 13:26:20 +0000</updated>
                                    <version>2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16153" author="beberlei" created="Tue, 12 Jul 2011 20:26:04 +0000"  >&lt;p&gt;Formatting, please add a second ticket for the second issue.&lt;/p&gt;</comment>
                    <comment id="16154" author="beberlei" created="Tue, 12 Jul 2011 20:40:11 +0000"  >&lt;p&gt;I don&apos;t think its supported to use a non primary id for foreign key matching. I cant tell for sure though since i wasnt responsible to design this part of the Doctrine code. I would strongly suggest not to do this.&lt;/p&gt;</comment>
                    <comment id="16156" author="beberlei" created="Tue, 12 Jul 2011 20:42:09 +0000"  >&lt;p&gt;Marked as improvement. The problem is we cannot detect this invalid mapping, so no exception is thrown during compilation of the mappings,&lt;/p&gt;</comment>
                    <comment id="16157" author="beberlei" created="Tue, 12 Jul 2011 20:45:23 +0000"  >&lt;p&gt;This kind of mapping error is already acknowledged by the schema-validator console task.&lt;/p&gt;</comment>
                    <comment id="16169" author="saniok" created="Wed, 13 Jul 2011 13:20:02 +0000"  >&lt;p&gt;Should I create second ticket?&lt;/p&gt;

&lt;p&gt;Please confirm that I understood correctly. Should we avoid such mapping as it is considered as invalid.&lt;/p&gt;</comment>
                    <comment id="16170" author="beberlei" created="Wed, 13 Jul 2011 13:26:20 +0000"  >&lt;p&gt;Yes, it will not work at all. You dont need to create the second ticket as that error steams from the mapping error.&lt;/p&gt;

&lt;p&gt;You will see an error message when calling ./doctrine orm:schema:validate with this mapping.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12563">DDC-1114</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1264] Add more math related DQL funcs (trig, round, stuff?)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1264</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12808">DDC-1264</key>
            <summary>Add more math related DQL funcs (trig, round, stuff?)</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jul 2011 22:22:04 +0000</created>
                <updated>Sat, 9 Jul 2011 22:22:04 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1263] @ManyToOne Arbitrary References</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1263</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Could it be possible to allow for arbitrary many to one entities through a &quot;class + id&quot; construct as join columns?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12807">DDC-1263</key>
            <summary>@ManyToOne Arbitrary References</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jul 2011 22:17:25 +0000</created>
                <updated>Sat, 9 Jul 2011 22:17:25 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1262] Have proxies copy docblocks aswell</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1262</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Whenever a Proxy is generated it does not copy the docblocks.&lt;/p&gt;

&lt;p&gt;This means when you do something like &quot;$refl = new ReflectionObject($proxy)&quot; you might be in trouble.&lt;/p&gt;

&lt;p&gt;However if we add docblocks then we have to make sure that proxies do not magically appear as entities by throwing an exception in the AnnotationDriver.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12805">DDC-1262</key>
            <summary>Have proxies copy docblocks aswell</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jul 2011 12:29:21 +0000</created>
                <updated>Sat, 9 Jul 2011 12:29:21 +0000</updated>
                                    <version>2.0.6</version>
                <version>2.1</version>
                <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1259] Atomic creation of Proxy files</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1259</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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;From 265e5086ea51ebcafc73f91abc64334d17e2f416 Mon Sep 17 00:00:00 2001
From: Karsten Dambekalns &amp;lt;karsten@typo3.org&amp;gt;
Date: Wed, 25 May 2011 12:11:55 +0200
Subject: [PATCH 4/5] Use temporary file and rename &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; proxy class creation

Instead of a simple file_put_contents() the proxy class code is written to a
temporary file and renamed to the &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; filename. This allows file access even
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; only allowed by the directory permission.
---
 lib/Doctrine/ORM/Proxy/ProxyFactory.php |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
index f0cf19c..b2d42fb 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php
+++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -152,7 +152,15 @@ class ProxyFactory
 
         $file = str_replace($placeholders, $replacements, $file);
 
-        file_put_contents($fileName, $file, LOCK_EX);
+        $temporaryFileName = $fileName . uniqid( ) . &apos;.temp&apos;;
+        $result = file_put_contents( $temporaryFileName, $file );
+
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($result === FALSE) &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \RuntimeException(&apos;The temporary proxy class file &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos; . $temporaryFileName . &apos;&quot;&lt;/span&gt; could not be written.&apos;);
+        $i = 0;
+        &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt;(!rename( $temporaryFileName, $fileName ) &amp;amp;&amp;amp; $i &amp;lt; 5) {
+            $i++;
+        }
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($result === FALSE) &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \RuntimeException(&apos;The proxy class file &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos; . $fileName . &apos;&quot;&lt;/span&gt; could not be written.&apos;);
     }
 
     /**
-- 
1.7.4.1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12802">DDC-1259</key>
            <summary>Atomic creation of Proxy files</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jul 2011 13:29:04 +0000</created>
                <updated>Sat, 9 Jul 2011 19:44:50 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16134" author="beberlei" created="Sat, 9 Jul 2011 19:44:50 +0000"  >&lt;p&gt;Nette Framework uses a safe stream: &lt;a href=&quot;https://github.com/nette/nette/blob/master/Nette/Utils/SafeStream.php&quot; class=&quot;external-link&quot;&gt;https://github.com/nette/nette/blob/master/Nette/Utils/SafeStream.php&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1235] Provide fluent interfaces in stub methods</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1235</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Or maybe some template-files could be provided for all stubs.&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;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; $_setMethodTemplate =
&apos;/**
 * &amp;lt;description&amp;gt;
 *
 * @param &amp;lt;variableType&amp;gt;$&amp;lt;variableName&amp;gt;
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function &amp;lt;methodName&amp;gt;(&amp;lt;methodTypeHint&amp;gt;$&amp;lt;variableName&amp;gt;)
{
&amp;lt;spaces&amp;gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;&amp;lt;fieldName&amp;gt; = $&amp;lt;variableName&amp;gt;;

&amp;lt;spaces&amp;gt;&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;lt;/spaces&amp;gt;
}&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment></environment>
            <key id="12757">DDC-1235</key>
            <summary>Provide fluent interfaces in stub methods</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="h-andreas">Andreas H&#246;rnicke</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Jun 2011 07:58:16 +0000</created>
                <updated>Mon, 29 Oct 2012 09:18:11 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18895" author="stof" created="Mon, 29 Oct 2012 09:18:11 +0000"  >&lt;p&gt;@beberlei this should be closed as it is the case since 2.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1229] generate entity interactive dialog: id column</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1229</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;according to Stof, this bug &lt;a href=&quot;https://github.com/sensio/SensioGeneratorBundle/issues/21&quot; class=&quot;external-link&quot;&gt;https://github.com/sensio/SensioGeneratorBundle/issues/21&lt;/a&gt; comes from the doctrine tools implementation:&lt;/p&gt;


&lt;p&gt;in the dialog, i first specified that i want a field id of type integer. the result was&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine\ORM\Mapping\MappingException&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Duplicate definition of column &apos;id&apos; on entity &apos;Liip\DemoBundle\Entity\Event&apos; in a field or discriminator column mapping.&lt;/p&gt;

&lt;p&gt;and no file was created.&lt;/p&gt;

&lt;p&gt;The dialog should tell me i can not create a field named id. (Or better ask first if i want my id column named id or something else.)&lt;/p&gt;

&lt;p&gt;It would be nice if it would write some file even if its not valid, with a warning on top. As it is, i lost all my work of specifying fields. (Luckily was just playing around)&lt;/p&gt;</description>
                <environment></environment>
            <key id="12751">DDC-1229</key>
            <summary>generate entity interactive dialog: id column</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="dbu">David Buchmann</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Jun 2011 07:06:45 +0000</created>
                <updated>Tue, 28 Jun 2011 19:42:25 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16092" author="beberlei" created="Tue, 28 Jun 2011 19:42:25 +0000"  >&lt;p&gt;not a bug, its a feature (though a dumb one). Improvement in a next version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1219] Remove dependancy on Collection interface in Domain Objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1219</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes.&lt;br/&gt;
I &apos;m not talking about PersistentCollection here, fully aware of that being tied into Doctrine, but those are injected, this is all about code dependency on ArrayCollection.&lt;/p&gt;


&lt;p&gt;Seems like some of the UnitOfWork code is cable of handling other types of arrays, like:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    // If $actualData[$name] is not a Collection then use an ArrayCollection.
    if ( ! $actualData[$name] instanceof Collection) {
        $actualData[$name] = new ArrayCollection($actualData[$name]);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But in __cascade* functions this is not the case in all but two:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    if ($relatedEntities instanceof Collection) {
        if ($relatedEntities instanceof PersistentCollection) {
            // Unwrap so that foreach() does not initialize
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;2 however have:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    if (($relatedEntities instanceof Collection || is_array($relatedEntities))) {
        if ($relatedEntities instanceof PersistentCollection) {
            // Unwrap so that foreach() does not initialize
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Would it be an idea to do &quot;instanceof Traversable&quot; instead of &quot; instanceof Collection&quot;? &lt;/p&gt;</description>
                <environment></environment>
            <key id="12730">DDC-1219</key>
            <summary>Remove dependancy on Collection interface in Domain Objects</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="anderom">Andr&#233; R.</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jun 2011 11:13:39 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                    <version>2.1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16035" author="anderom" created="Tue, 21 Jun 2011 11:21:07 +0000"  >&lt;p&gt;Note: If the fist code block is always performed before the last 2 blocks then there is no issue here, just a need to make it more clear in Doc that this is possible but that you should not rely custom implementation as PersistentCollection will be injected when loaded from db.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1217] Use the DBAL ReservedKeywordsValidator in orm:validate-schema</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1217</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DBAL provides a ReservedKeywordsValidator to check whether a word is reserved. But this tool is not used by the ORM when validating the schema. It would be useful to use it to avoid WTF from users getting a PDOException when creating their schema because of this.&lt;br/&gt;
The other solution if you don&apos;t want to add this in orm:validate-schema would be to create a dedicated command.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12727">DDC-1217</key>
            <summary>Use the DBAL ReservedKeywordsValidator in orm:validate-schema</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Jun 2011 22:04:34 +0000</created>
                <updated>Mon, 20 Jun 2011 22:04:34 +0000</updated>
                                    <version>2.0.6</version>
                <version>Git Master</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1216] A way to mark an entity to always use result cache. Like @UseResultCache class annotation.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1216</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;So that even associations, find(), findBy() etc will be affected. Very useful for entities that are being used on every request.&lt;/p&gt;

&lt;p&gt;Is that thinkable?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12726">DDC-1216</key>
            <summary>A way to mark an entity to always use result cache. Like @UseResultCache class annotation.</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="hypno">Reio Piller</reporter>
                        <labels>
                    </labels>
                <created>Sun, 19 Jun 2011 12:49:04 +0000</created>
                <updated>Fri, 6 Apr 2012 13:07:25 +0000</updated>
                                    <version>2.x</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17780" author="holtkamp" created="Fri, 6 Apr 2012 13:07:25 +0000"  >&lt;p&gt;During development, I tried to have the out-of-the-box ORM layer handle as much of the queries as possible, essentially I used the Repository functions a lot: &lt;/p&gt;

&lt;p&gt;For example, having a specific Repository extend the Doctrine EntityRepository and do something like:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
    public function findByName($name)
    {
        $criteria = array(&apos;_name&apos; =&amp;gt; $name);
        return parent::findBy($criteria);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Now all functionality is developed, I am optimizing performance and I find myself having to refer my Repository to my DAO layer which uses DQL, so I can enable the DQL Result Cache...&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
    public function findByName($name)
    {
       //Use the DAO so we can enable DQL ResultSet caching
        return $this-&amp;gt;_getDao()-&amp;gt;loadByName($name);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;It would be nice to be able to configure &apos;DQL Result Cache = on&apos; on Repository level as well...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1201] DQL Example about count(*) related entity is wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1201</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL Example about count&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; related entity is wrong&lt;/p&gt;</description>
                <environment></environment>
            <key id="12706">DDC-1201</key>
            <summary>DQL Example about count(*) related entity is wrong</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Jun 2011 13:31:19 +0000</created>
                <updated>Mon, 10 Oct 2011 10:00:44 +0000</updated>
                                    <version>2.1.1</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16568" author="gedrox" created="Mon, 10 Oct 2011 10:00:18 +0000"  >&lt;p&gt;Also similar DQL in documentation URL &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results&lt;/a&gt; fails parsing stage:&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;$dql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT u, &apos;some scalar string&apos;, count(u.groups) AS num FROM User u JOIN u.groups g GROUP BY u.id&quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with error&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;  [Doctrine\ORM\Query\QueryException]                                                                                                                         
  [Semantical Error] line 0, col 40 near &apos;localizations)&apos;: Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected. 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Should be &quot;count(g.id)&quot; instead of &quot;count(u.groups)&quot;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1200] Derived Id Generator</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1200</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For usage with the foreign key as primary key features described in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; a derived id generator would be tons of useful. It is essentially a post generate id generator (sort of late pre insert though) assigned generator.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12705">DDC-1200</key>
            <summary>Derived Id Generator</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Jun 2011 20:46:56 +0000</created>
                <updated>Wed, 9 Nov 2011 21:41:30 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="16788" author="yourwebmaker" created="Wed, 9 Nov 2011 21:41:30 +0000"  >&lt;p&gt;When this will be fixed?&lt;/p&gt;

&lt;p&gt;I think this is related to &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/7e1cfa9c4c99af31&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/7e1cfa9c4c99af31&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12891">DDC-1315</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1197] Proxies should handle variable argument lists</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1197</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is a contingency issue for &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/60&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/60&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&quot;Fix to allow for proxy generated classes to respect methods in parent which may use func_get_args internally. Previously they would be passed nothing and thus fail. Also reduces need to build up argumentString. &quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12699">DDC-1197</key>
            <summary>Proxies should handle variable argument lists</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 5 Jun 2011 08:52:14 +0000</created>
                <updated>Sun, 5 Jun 2011 08:52:14 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1180] Indexed Associations: foreign key (association) cannot be used as indexBy field</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1180</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am trying to index a collection by its entity&apos;s column which is also a foreign key (association). It seems to me that it is not possible at the moment.&lt;/p&gt;

&lt;p&gt;For example:&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;/**
 * @Entity
 */
class Hotel
{

    &lt;span class=&quot;code-comment&quot;&gt;// $id column and other stuff
&lt;/span&gt;
    /**
     * @oneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Booking&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;hotel&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;room&quot;&lt;/span&gt;)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Booking[]
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $bookings;
}

/**
 * @Entity
 */
class Booking
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Hotel
     *
     * @Id 
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Hotel&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;bookings&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;hotel_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;private&lt;/span&gt; $hotel;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Room
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Room&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;room_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;private&lt;/span&gt; $room;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Only possible workaround I found is to define another (plain) entity&apos;s property mapped to the same table column and index by it:&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;/**
 * @Entity
 */
class Hotel
{

    &lt;span class=&quot;code-comment&quot;&gt;// $id column and other stuff
&lt;/span&gt;
    /**
     * @oneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Booking&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;hotel&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;roomId&quot;&lt;/span&gt;)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Booking[]
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $bookings;
}

/**
 * @Entity
 */
class Booking
{
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Room
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Room&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;room_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;private&lt;/span&gt; $room;
    
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $roomId
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;room_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $roomId;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Wouldn&apos;t it be easy to support it?&lt;/p&gt;</description>
                <environment>Using Doctrine ORM 2.1.0BETA1</environment>
            <key id="12679">DDC-1180</key>
            <summary>Indexed Associations: foreign key (association) cannot be used as indexBy field</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="sobotka">Petr Sobotka</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 May 2011 21:44:28 +0000</created>
                <updated>Sat, 2 Mar 2013 12:24:58 +0000</updated>
                                    <version>2.1</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15921" author="beberlei" created="Sun, 5 Jun 2011 12:36:53 +0000"  >&lt;p&gt;It is not so easy to implement from the first gimplse and it is not a bug but an improvement/feature request.&lt;/p&gt;</comment>
                    <comment id="19792" author="benjamin" created="Sat, 2 Mar 2013 12:24:58 +0000"  >&lt;p&gt;Related PR: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/204&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/204&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1178] Have access to &quot;original&quot; metadata in events subscribed to loadClassMetadata</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1178</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you subscribe to loadClassMetadata you will usually modify the metadata for some classes.&lt;br/&gt;
The problem is, that that data has to be loaded from somewhere. But later down the chain you can&apos;t get to it. Now data specific to what you need in your loadClassMetadata  would ideally reside in the same location.&lt;br/&gt;
If we take for example a file, than all data for a specific entity is in the same file.&lt;/p&gt;

&lt;p&gt;My proposal would be to add function get(Original|Raw)MappingData into interface Doctrine\ORM\Mapping\Driver\Driver which would either return raw data or data in a object specific for that Driver or null if it doesn&apos;t make sense for that driver. Please note, that when loading from e.g XmlDriver we should return simplexmlnode or dom node as loadClassMetadata  should be in its own namespace and not pollute the Doctrine one.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12676">DDC-1178</key>
            <summary>Have access to &quot;original&quot; metadata in events subscribed to loadClassMetadata</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="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 May 2011 17:56:21 +0000</created>
                <updated>Fri, 27 May 2011 18:31:28 +0000</updated>
                                    <version>2.x</version>
                                <fixVersion>2.x</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15892" author="gediminasm" created="Fri, 27 May 2011 18:31:28 +0000"  >&lt;p&gt;Sounds logic, each driver would expect NULL or data (wrapped specifically for the driver used)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1164] doctrine:schema:update --force == doctrine:schema:create</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1164</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine:schema:update --force is the same as doctrine:schema:create.&lt;/p&gt;

&lt;p&gt;Under the hood, this may not be true, but they basically accomplish the same task. Schema:create should be removed, as it is redundant. &lt;/p&gt;

&lt;p&gt;Just look at django, one command to update db:&lt;/p&gt;

&lt;p&gt;./manage.py syncdb&lt;/p&gt;

&lt;p&gt;Not saying that django gets everything correct, but the one command to synchronize the database is consistent. doctrine:schema:update should be smart enough to do all of the work, instead of relying on the redundant doctrine:schema:create.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12657">DDC-1164</key>
            <summary>doctrine:schema:update --force == doctrine:schema:create</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="xaav">Geoff</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 May 2011 23:37:51 +0000</created>
                <updated>Fri, 20 May 2011 23:37:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1154] Proxies should take convention while loading *ToOne associations to reduce 1 extra query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1154</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Read the IRC log:&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;[2:38pm] guilhermeblanco: beberlei: ping
[2:38pm] guilhermeblanco: I&apos;m curious about a feature &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; Doctrine supports
[2:38pm] guilhermeblanco: &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; on a proxy:
[2:38pm] guilhermeblanco: $proxy-&amp;gt;getOneToOneAssoc()
[2:39pm] guilhermeblanco: shouldn&apos;t Doctrine already populate the assoc entity?
[2:39pm] guilhermeblanco: it would be an &lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join
[2:39pm] beberlei: how would doctrine know it needs it?
[2:39pm] guilhermeblanco: beberlei: it always repass the ClassMetadata to Persister
[2:40pm] guilhermeblanco: so all needed item is to also pass the fieldname/assocname
[2:40pm] beberlei: but how would doctrine know getOneToOneASsoc() really returns &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; assoc
[2:40pm] beberlei: it could contain any logic
[2:40pm] guilhermeblanco: it wouldn&apos;t... but as soon as we trigger __load($fieldName)
[2:40pm] guilhermeblanco: we know that we could populate not only the Proxy, but also assoc
[2:40pm] beberlei: by convention?
[2:40pm] guilhermeblanco: ya
[2:41pm] beberlei: sounds good, can you open a ticket?
[2:41pm] guilhermeblanco: getUser() would trigger __load(&apos;user&apos;)
[2:41pm] guilhermeblanco: sure!
[2:41pm] guilhermeblanco: I&apos;ll pastie &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; as content... it would be awesome to have
[2:41pm] guilhermeblanco: I see a lot of queries here that could be optimized 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12642">DDC-1154</key>
            <summary>Proxies should take convention while loading *ToOne associations to reduce 1 extra query</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 May 2011 17:58:37 +0000</created>
                <updated>Tue, 17 May 2011 17:58:37 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1149] Optimize OneToMany and ManyToMany without join</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1149</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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; 
/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt;)
 */
class User {

    /**
     * @Column
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $user_id;

    /**
     * @Column
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $email;

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Language&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;,fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $languages;

}

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_languages&quot;&lt;/span&gt;)
 */
class Language {

    /**
     * @Column
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $user_language_id;

    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;languages&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $user;

    /**
     * @Column
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $user_id;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;$users = $em-&amp;gt;getRepository(&apos;User&apos;)-&amp;gt;findAll();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Result:&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;SELECT t0.user_id AS user_id1, t0.email AS email2 FROM users t0
SELECT t0.user_language_id AS user_language_id1, t0.user_id AS user_id2, t0.user_id AS user_id3 FROM user_languages t0 WHERE t0.user_id = ?
array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.user_language_id AS user_language_id1, t0.user_id AS user_id2, t0.user_id AS user_id3 FROM user_languages t0 WHERE t0.user_id = ?
array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.user_language_id AS user_language_id1, t0.user_id AS user_id2, t0.user_id AS user_id3 FROM user_languages t0 WHERE t0.user_id = ?
array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}

...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Need result:&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;SELECT t0.user_id AS user_id1, t0.email AS email2 FROM users t0
SELECT u0_.user_language_id AS user_language_id0, u0_.user_id AS user_id1, u0_.user_id AS user_id2 FROM user_languages u0_ WHERE u0_.user_id IN (1, 2, 3)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12634">DDC-1149</key>
            <summary>Optimize OneToMany and ManyToMany without join</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="morfi">Andrey Kolyshkin</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 May 2011 09:01:18 +0000</created>
                <updated>Sat, 30 Mar 2013 19:18:40 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>5</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="15827" author="beberlei" created="Thu, 12 May 2011 09:58:46 +0000"  >&lt;p&gt;Sure you are on git master? this should be optimized already with fetch=EAGER&lt;/p&gt;</comment>
                    <comment id="15828" author="morfi" created="Thu, 12 May 2011 11:15:22 +0000"  >&lt;p&gt;Attach test file&lt;/p&gt;

&lt;p&gt;I run&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;git clone git:&lt;span class=&quot;code-comment&quot;&gt;//github.com/doctrine/doctrine2.git
&lt;/span&gt;git clone git:&lt;span class=&quot;code-comment&quot;&gt;//github.com/doctrine/common.git
&lt;/span&gt;git clone git:&lt;span class=&quot;code-comment&quot;&gt;//github.com/doctrine/dbal.git&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and run testDoctrine.php&lt;/p&gt;

&lt;p&gt;Result&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;
SELECT t0.user_id AS user_id1 FROM users t0

SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?

array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?

array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?

array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16571" author="guilhermeblanco" created="Mon, 10 Oct 2011 17:44:07 +0000"  >&lt;p&gt;Please instead of using fetch=&quot;EAGER&quot;, please use fetch=&quot;EXTRA_LAZY&quot;. It would fix your issue.&lt;br/&gt;
I have successfully tested this situation in 2.2-DEV and it works like a charm. =)&lt;/p&gt;</comment>
                    <comment id="19895" author="fludimir" created="Mon, 25 Mar 2013 20:39:03 +0000"  >&lt;p&gt;Doctrine ORM 2.3.3  (Symfony2.2) - using LAZY or EXTRA_LAZY fetch mode there are only one query for:&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;$users = $em-&amp;gt;getRepository(&apos;User&apos;)-&amp;gt;findAll();&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but additional &lt;b&gt;users_count&lt;/b&gt; queries for&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;foreach($users as $user) $user-&amp;gt;languages-&amp;gt;toArray()&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And if use fetch EAGER - for some reason there are &lt;b&gt;2 x users_count&lt;/b&gt; queries , ie each 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;SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;with unique user_id executed twice&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10991" name="testDoctrine.php" size="1544" author="morfi" created="Thu, 12 May 2011 11:15:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1144] How insert a AES_ENCRYPT value in a table field</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1144</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi there,&lt;br/&gt;
I&apos;m trying to insert an encrypted data:&lt;/p&gt;

&lt;p&gt;Because &apos;&quot;INSERT statements are not allowed in DQL, ....&quot; i processed like this:&lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
...&lt;br/&gt;
// controller&lt;br/&gt;
$membre = new \Entity\TMembre();&lt;br/&gt;
$membre-&amp;gt;setPassword($password);&lt;br/&gt;
$em-&amp;gt;persist($membre);&lt;br/&gt;
$em-&amp;gt;flush();&lt;br/&gt;
...&lt;br/&gt;
?&amp;gt;&lt;br/&gt;
//entity&lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
namespace Entity;&lt;br/&gt;
/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;TMembre&lt;br/&gt;
 *&lt;/li&gt;
	&lt;li&gt;@Table(name=&quot;t_membre&quot;)&lt;/li&gt;
	&lt;li&gt;@Entity(repositoryClass=&quot;Repository\TMembreRepository&quot;)&lt;br/&gt;
 */&lt;br/&gt;
class TMembre&lt;br/&gt;
{&lt;br/&gt;
    /**&lt;/li&gt;
	&lt;li&gt;Set password     *&lt;/li&gt;
	&lt;li&gt;@param string $password     */&lt;br/&gt;
    public function setPassword($password)
    {
    	$this-&amp;gt;email = &quot;AES_ENCRYPT(&apos;&quot;.$email.&quot;&apos;,&apos;&quot;._MYSQL_CRYPT.&quot;&apos;)&quot;; =&amp;gt; insert this entire string without executing encryption
    	$this-&amp;gt;email = new \Doctrine\ORM\Query\Expr\Func(&quot;AES_ENCRYPT&quot;,array(&quot;&apos;&quot;.$email.&quot;&apos;&quot;,&quot;&apos;&quot;._MYSQL_CRYPT.&quot;&apos;&quot;)); =&amp;gt; does not work
    }
&lt;p&gt;}&lt;br/&gt;
?&amp;gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;How can i do ?&lt;br/&gt;
Add this method to Doctrine\ORM\Query\Expr class ?&lt;/p&gt;

&lt;p&gt;/**&lt;br/&gt;
    public function aesEncrypt($value)&lt;/p&gt;
    {
       return &quot;AES_ENCRYPT(&apos;&quot;.$value.&quot;&apos;,&apos;&quot;._MYSQL_CRYPT.&quot;&apos;)&quot;
    }

&lt;p&gt;Best regards&lt;/p&gt;

&lt;p&gt;David&lt;/p&gt;</description>
                <environment>Win XP, MySql5, Php5.3, ZendFramework 1.11.4</environment>
            <key id="12626">DDC-1144</key>
            <summary>How insert a AES_ENCRYPT value in a table field</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="dquintard">dquintard</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 May 2011 19:58:28 +0000</created>
                <updated>Tue, 10 May 2011 19:58:28 +0000</updated>
                                    <version>2.0.4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1143] deprecated or missing method, $cacheDriver-&gt;setManageCacheIds(true);</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1143</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/caching.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/caching.html&lt;/a&gt;&lt;br/&gt;
mentions $cacheDriver-&amp;gt;setManageCacheIds(true);.&lt;br/&gt;
But method absent from V 2.04, possibly just needs a version note next to it.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12625">DDC-1143</key>
            <summary>deprecated or missing method, $cacheDriver-&gt;setManageCacheIds(true);</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="raiz">raiz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 May 2011 13:27:47 +0000</created>
                <updated>Tue, 10 May 2011 13:27:47 +0000</updated>
                                    <version>2.0.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1137] SchemaTool#getUpdateSchemaSql() does not respect database identifier in table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1137</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given two databases, &apos;foo&apos; and &apos;bar&apos;, with entities in /Entities/Foo/ annotated as follows:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/**
 * Test
 *
 * @Table(name=&quot;foo.test&quot;)
 * @Entity
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Create an EntityManager instance with &lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$connectionOptions = array( 
    &apos;dbname&apos; =&amp;gt; &apos;Foo&apos;, 
    &apos;driver&apos; =&amp;gt; &apos;pdo_mysql&apos;, 
    &amp;lt;..etc..&amp;gt;
);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Use EntityManager#getClassMetaData( &quot;Entities\\Foo&lt;br class=&quot;atl-forced-newline&quot; /&gt;Test&quot; ) to pass to SchemaTool#createSchema() and Doctrine appropriately creates a database table foo.test&lt;/p&gt;

&lt;p&gt;Use EntityManager#getClassMetaData( &quot;Entities\\Foo&lt;br class=&quot;atl-forced-newline&quot; /&gt;Test&quot; ) to pass to SchemaTool#updateSchema() and Doctrine fails with Exception&lt;br/&gt;
-&amp;gt; SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;test&apos; already exists&lt;/p&gt;

&lt;p&gt;Inserting&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;die( print_r( $fromSchema, 1 ) . print_r( $toSchema, 1 ) . print_r( $schemaDiff, 1 ) );&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;into Doctrine/ORM/Tools/SchemaTool.php line 632 shows $fromSchema outputs&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[_tables:protected] =&amp;gt; Array
        (
            [test]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but $toSchema outputs&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[_tables:protected] =&amp;gt; Array
        (
            [foo.test]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which causes $schemaDiff to output&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[newTables] =&amp;gt; Array
        (
            [foo.test]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In summary, Doctrine/DBAL/Schema/Comparator considers foo.test a new table, because Doctrine/DBAL/Schema/AbstractSchemaManager lists its table as &quot;test&quot; rather than &quot;foo.test&quot;. &lt;/p&gt;
</description>
                <environment>Linux 2.6.18-194.32.1.el5.centos.plus x86_64 GNU/Linux&lt;br/&gt;
</environment>
            <key id="12614">DDC-1137</key>
            <summary>SchemaTool#getUpdateSchemaSql() does not respect database identifier in table names</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="hlomas">Hugh Lomas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 May 2011 17:23:11 +0000</created>
                <updated>Sat, 14 May 2011 10:10:20 +0000</updated>
                                    <version>2.0.4</version>
                                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15808" author="hlomas" created="Thu, 5 May 2011 18:37:09 +0000"  >&lt;p&gt;It seems that changing AbstractSchemaManager.php to the following corrected the issue for me, however I am not sure of any repercussions that may arise as a result, being unfamiliar with the codebase.&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine/DBAL/Schema/AbstractSchemaManager.php line 228&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;return new Table( $tableName, $columns, $indexes, $foreignKeys, false, array());&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine/DBAL/Schema/AbstractSchemaManager.php line 228&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;return new Table( &lt;font color=&quot;green&quot;&gt;$this-&amp;gt;_conn-&amp;gt;getDatabase() . &quot;.&quot; . &lt;/font&gt; $tableName, $columns, $indexes, $foreignKeys, false, array());&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    <comment id="15850" author="beberlei" created="Sat, 14 May 2011 10:10:09 +0000"  >&lt;p&gt;Multi databases are not supported by schema manager and schema tool yet.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1106] Wrong inversedBy in example</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1106</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;on page &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html&lt;/a&gt;&lt;br/&gt;
section :  8.1. Association Example Entities, first example. Please see the .jpg in attachement(it explains clearly what I think is an error)&lt;br/&gt;
Regards.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12547">DDC-1106</key>
            <summary>Wrong inversedBy in example</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="cristobal">cristobal castro</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Apr 2011 20:09:29 +0000</created>
                <updated>Thu, 7 Apr 2011 20:09:29 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10967" name="screen-shot.zip" size="200671" author="cristobal" created="Thu, 7 Apr 2011 20:09:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1099] Tutorial :: Getting started code sample entity manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1099</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;see pull request 24 on github.com&lt;/p&gt;</description>
                <environment></environment>
            <key id="12529">DDC-1099</key>
            <summary>Tutorial :: Getting started code sample entity manager</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Apr 2011 05:53:22 +0000</created>
                <updated>Mon, 11 Jul 2011 17:44:40 +0000</updated>
                                    <version>Git Master</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16148" author="mridgway" created="Mon, 11 Jul 2011 17:44:40 +0000"  >&lt;p&gt;This issue should be closed: &lt;a href=&quot;https://github.com/doctrine/orm-documentation/pull/24&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/orm-documentation/pull/24&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1089] Annotations reference examples are inaccurate and confusing</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1089</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In chapter 19 of the reference guide some coding examples seem to be inaccurate or incorrect. Especially when it comes to the bidirectional many-to-many associations, this might be confusing.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
The code fragment on &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-manytomany&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-manytomany&lt;/a&gt; has the following issues:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;it does not include class declarations although the collections associated are both mentioned. It should be clear to which target entity they belong and therefore their classes should be declared.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;from the context it seems that the associated classes should probably be User and Group, and the owning side is User. So the association should probably be inversed by &apos;users&apos;, although the example mentions &apos;features&apos;.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the mapping for the inverse side maps a collection called $features, although this should probably be $users. Also the class declaration for the Group class is missing.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Some other code fragments in chapter 19 have similar issues. I think they could easily be replaced by the examples from the earlier chapters, like for the bidirectional man-to-many association the example from chapter 5:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#many-to-many-bidirectional&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#many-to-many-bidirectional&lt;/a&gt;&lt;/p&gt;</description>
                <environment>N.A.</environment>
            <key id="12515">DDC-1089</key>
            <summary>Annotations reference examples are inaccurate and confusing</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="mvl">Maarten van Leeuwen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Mar 2011 05:38:14 +0000</created>
                <updated>Wed, 30 Mar 2011 06:00:37 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1088] Description for SequenceGenerator annotation options is wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1088</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On paragraph 4.8.1.1 SequenceGenerator, the correct example should be:&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;br/&gt;
class User {&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Id&lt;/li&gt;
	&lt;li&gt;@GeneratedValue(strategy=&quot;SEQUENCE&quot;)&lt;/li&gt;
	&lt;li&gt;@SequenceGenerator(sequenceName=&quot;tablename_seq&quot;, initialValue=1, allocationSize=100)&lt;br/&gt;
     */&lt;br/&gt;
    protected $id = null;&lt;br/&gt;
}&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>N/A</environment>
            <key id="12514">DDC-1088</key>
            <summary>Description for SequenceGenerator annotation options is wrong</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="iksela">Alexandre Mathieu</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Mar 2011 04:55:17 +0000</created>
                <updated>Wed, 30 Mar 2011 04:55:17 +0000</updated>
                                    <version>2.x</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1072] Private property mapping can cause issues, suggest changing to protected</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1072</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The documentation recommends using private variables in entities. This can be problematic on entities with relations when using caching drivers as the proxy objects cannot access private variables and so the caching driver can throw notices like &lt;/p&gt;

&lt;p&gt;...apc_store(): &quot;_id&quot; returned as member variable from __sleep() but &lt;br/&gt;
does not exist in ... &lt;/p&gt;

&lt;p&gt;Making member variables protected resolves this issue when caching is enabled.&lt;/p&gt;

&lt;p&gt;This information would be helpful on the documentation so others can be made aware of this issue. We spent a few days trying to debug the issue before understanding exactly what was going on.&lt;/p&gt;</description>
                <environment>not applicable</environment>
            <key id="12474">DDC-1072</key>
            <summary>Private property mapping can cause issues, suggest changing to protected</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="kevbradwick">Kevin Bradwick</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Mar 2011 12:59:02 +0000</created>
                <updated>Thu, 17 Mar 2011 12:59:02 +0000</updated>
                                    <version>2.0.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1038] there are tabs in the code base</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1038</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;a quick search through the ORM code base finds quite a few tabs. other doctrine projects there might also be some, though in common i only found some inside the LGPL license file.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12397">DDC-1038</key>
            <summary>there are tabs in the code base</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 11:34:41 +0000</created>
                <updated>Wed, 16 Feb 2011 11:34:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1032] ensure the dateformat Y-m-d gets used by the MsSQL-Server 2005</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1032</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;To ensure that the MsSQL-Server 2005 (and maybe higher) uses the format that is specified in the MsSqlPlatform class (Y-m-d)&lt;br/&gt;
set it via &apos;SET DATEFORMAT ymd&apos; .&lt;/p&gt;

&lt;p&gt;This should be done directly after the connection has be opened.&lt;/p&gt;</description>
                <environment>php5.3.5; MsSQL-Server 2005; W2K8; Apache2; MS pdo_sqlsrv_ts_vc6 driver</environment>
            <key id="12386">DDC-1032</key>
            <summary>ensure the dateformat Y-m-d gets used by the MsSQL-Server 2005</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12379">DDC-1028</parent>
                        <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="le_shatai">Martin Weise</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Feb 2011 11:09:21 +0000</created>
                <updated>Mon, 14 Feb 2011 11:10:57 +0000</updated>
                                    <version>2.0.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15306" author="le_shatai" created="Mon, 14 Feb 2011 11:10:57 +0000"  >&lt;p&gt;Issue created as wished from Juozas Kaziukenas.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1025] Please repalce &apos;Doctrine\XXX\YYY&apos; with &apos;\Doctrine\XXX\YYY&apos; in code and document</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1025</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It will help us use the namespace and code autocomplete in some IDE.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12370">DDC-1025</key>
            <summary>Please repalce &apos;Doctrine\XXX\YYY&apos; with &apos;\Doctrine\XXX\YYY&apos; in code and document</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="wsyb">ben yan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Feb 2011 21:33:28 +0000</created>
                <updated>Tue, 13 Dec 2011 20:41:16 +0000</updated>
                                    <version>2.0.1</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>7</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="15717" author="matthieu" created="Fri, 8 Apr 2011 17:51:14 +0000"  >&lt;p&gt;Hi, do you have any more information about this ?&lt;/p&gt;

&lt;p&gt;I&apos;m confused because the php documentation uses the Doctrine\XXX way, and everywhere I&apos;ve seen, it is used like that.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="15718" author="k-fish" created="Mon, 11 Apr 2011 04:41:27 +0000"  >&lt;p&gt;The issue is simple and logical. &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;

&lt;p&gt;When an IDE (I am using PhpStorm and it does it like this) sees a namespace in a file, upon seeing namespaces afterwards, it sees them as absolute if they have a leading backslash, or relative when it does not. This affects the resolution of classes for type navigation, code inspection, ...  The same rules as for actual PHP code should be used within comments.&lt;/p&gt;

&lt;p&gt;Here is an example:&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;namespace Foo;

class Bar {

  /**
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Baz
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $baz;

  /**
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \Quux
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $quux;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The IDE will think $baz is \Foo\Baz and $quux will be seen as being \Quux. Now if you have some reference to Doctrine here, and it was relative, the IDE would assume it&apos;s \Foo\Doctrine\...&lt;/p&gt;</comment>
                    <comment id="15719" author="beberlei" created="Mon, 11 Apr 2011 04:57:42 +0000"  >&lt;p&gt;Well yes, but since all our code examples have no leading namespace argument this means the code is in the default namespace, making Doctrine\XXX\YY a relative namespace that is actually valid.&lt;/p&gt;</comment>
                    <comment id="15720" author="k-fish" created="Mon, 11 Apr 2011 05:46:52 +0000"  >&lt;p&gt;Yes, but the source code docblocks are what is meant here as far as I am concerned.&lt;/p&gt;</comment>
                    <comment id="15838" author="morfi" created="Fri, 13 May 2011 11:08:57 +0000"  >&lt;p&gt;Example (Entitymanager.php):&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;namespace Doctrine\ORM;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and&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;/**
  * The used Configuration.
  *
  * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Doctrine\ORM\Configuration
  */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $config;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result:&lt;br/&gt;
&lt;b&gt;Doctrine\ORM\Doctrine\ORM\Configuration&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Should be:&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;/**
  * The used Configuration.
  *
  * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Configuration
  */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $config;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or&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;/**
  * The used Configuration.
  *
  * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \Doctrine\ORM\Configuration
  */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $config;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15887" author="mvrhov" created="Fri, 27 May 2011 09:36:15 +0000"  >&lt;p&gt;Why don&apos;t you take this to the PhpStorm tracker as it surely is a bug in IDE?&lt;/p&gt;</comment>
                    <comment id="15888" author="k-fish" created="Fri, 27 May 2011 12:43:39 +0000"  >&lt;p&gt;Miha, what makes you think it&apos;s an IDE bug? In a class in namespace Foo another class named Bar is \Foo\Bar, but \Bar is \Bar. Why is it a bug if the IDE follows the namespace resolution rules?&lt;/p&gt;
</comment>
                    <comment id="16146" author="mridgway" created="Mon, 11 Jul 2011 17:34:05 +0000"  >&lt;p&gt;The issue is that PHPStorm and NetBeans have different class resolution rules. I also use PHPStorm and most of Doctrine does not resolve auto-completion correctly because of this issue.&lt;/p&gt;

&lt;p&gt;I&apos;d be willing to work on this if it would be accepted.&lt;/p&gt;</comment>
                    <comment id="16535" author="andrewmackrodt" created="Thu, 29 Sep 2011 11:58:52 +0000"  >&lt;p&gt;I&apos;ve been evaluating PhpStorm and also came across this issue; I believe the problem is due to Doctrine rather than being a bug with the IDE although it would be nice if PhpStorm would assume namespaces are absolute if they&apos;re not resolved upon an initial lookup.&lt;/p&gt;

&lt;p&gt;I created a quick c# app to append the beginning forward slash to any @var or @return attributes within Doctrine&apos;s source. It&apos;s working for me with Doctrine 2.1.2 and PhpStorm (IntelliJ): &lt;a href=&quot;http://pastebin.com/4HxiWvJA&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/4HxiWvJA&lt;/a&gt; - hopefully this will be of use for anyone else using these IDEs;. Note: the application doesn&apos;t detect multiple line annotations although the only one I&apos;m aware of is the getAST method in Doctrine\ORM\Query.php.&lt;/p&gt;</comment>
                    <comment id="16978" author="beberlei" created="Tue, 13 Dec 2011 20:41:09 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-215&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/215&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/215&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16979" author="beberlei" created="Tue, 13 Dec 2011 20:41:16 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-216&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/216&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/216&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1016] Example code does not reflect real code</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1016</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#entity-state&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#entity-state&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the switch cases all the UnitOfWork constants are invalid.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
UnitOfWork::NEW instead of being UnitOfWork::STATE_NEW&lt;/p&gt;</description>
                <environment>Website</environment>
            <key id="12355">DDC-1016</key>
            <summary>Example code does not reflect real code</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="thoth">thoth</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Feb 2011 17:10:50 +0000</created>
                <updated>Thu, 3 Feb 2011 17:10:50 +0000</updated>
                                    <version>2.0.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1011] Finding out if a model is persist</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1011</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;To find out if a model is persist, is missing in the documentation of doctrine 2.&lt;/p&gt;

&lt;p&gt;To become the state of an model you must call the entitymanager-&amp;gt;getUnitOfWork()-&amp;gt;getEntityState(model) &lt;/p&gt;</description>
                <environment></environment>
            <key id="12345">DDC-1011</key>
            <summary>Finding out if a model is persist</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="ronny.deter@erento.com">Ronny Deter</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 03:57:24 +0000</created>
                <updated>Wed, 2 Feb 2011 03:57:24 +0000</updated>
                                    <version>2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-999] DQL always needs a FROM clause, should be changed</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-999</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sometimes a developer needs to issue a query without a FROM clause. This especially occurs using the QueryBuilder, when you may or may not have a table to select from, but call a stored procedure always.&lt;/p&gt;

&lt;p&gt;Example:&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;$query = $em&amp;gt;createQuery(&apos;SELECT (1+1)&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above query fails because the lexer expects T_FROM. If you replace (1+1) with a stored procedure, this example makes more sense.&lt;/p&gt;

&lt;p&gt;One might argue about that you should use DBAL directly, but I disagree, because it always can happen that you end up in a situation 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 = $em-&amp;gt;createQueryBuilder();

$qb-&amp;gt;select(&lt;span class=&quot;code-quote&quot;&gt;&quot;SOMEFANCYPROCEDURE()&quot;&lt;/span&gt;);

&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($condition) {
  $qb = $qb-&amp;gt;from(&lt;span class=&quot;code-quote&quot;&gt;&quot;additionalTable t&quot;&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12319">DDC-999</key>
            <summary>DQL always needs a FROM clause, should be changed</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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Jan 2011 20:25:54 +0000</created>
                <updated>Sun, 23 Jan 2011 20:26:34 +0000</updated>
                                    <version>2.0</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-998] Code example for custom AST functions incorrect</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-998</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language&lt;/a&gt; the code example is slightly incorrect.&lt;/p&gt;

&lt;p&gt;Mistakes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Lexer::T_ABS doesn&apos;t exist anymore, I assume Lexer::T_IDENTIFIER is what one wants to use&lt;/li&gt;
	&lt;li&gt;Missing use for \Doctrine\ORM\Query\Lexer&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Additionally, the section should tell the user that he best has a look at lib/Doctrine/ORM/Query/AST/Functions/* to learn how to write custom functions. It also could be noted that stored procedures can be called with custom functions.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12318">DDC-998</key>
            <summary>Code example for custom AST functions incorrect</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Jan 2011 19:46:54 +0000</created>
                <updated>Sun, 23 Jan 2011 19:46:54 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-993] Cookbook: Overriding the ID Generator during a database migration</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-993</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you need to override the ID Generator, e.g. during a migration, you can do that in your migration script as follows:&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Overriding the ID generator&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;$em-&amp;gt;getClassMetadata(&apos;foo\bar\Entity&apos;)-&amp;gt;setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());&lt;br/&gt;
$em-&amp;gt;getClassMetadata(&apos;foo\bar\Entity&apos;)-&amp;gt;setIdGeneratorType(constant(&apos;Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE&apos;));&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Make sure that both calls equal to the same generator type. You can now modify the @Id fields in your entities. Additionally, make sure that you set the IdGenerator &lt;b&gt;after&lt;/b&gt; you created the database using e.g. SchemaTool-&amp;gt;create().&lt;/p&gt;</description>
                <environment></environment>
            <key id="12311">DDC-993</key>
            <summary>Cookbook: Overriding the ID Generator during a database migration</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Jan 2011 13:33:27 +0000</created>
                <updated>Sun, 28 Oct 2012 15:33:51 +0000</updated>
                                    <version>2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18892" author="kosen" created="Sat, 27 Oct 2012 21:36:37 +0000"  >&lt;p&gt;Hi, this doesn&apos;t seem to work for me. I have written a small database export / import utility. As long as I use the automatic ID generation, everything works flawlessly, but I&apos;m trying to preserve the existing IDs. I do exactly what you&apos;ve suggested in your post. It works for @OneToOne relations, but I get the following error messages when persisting entities that are parts of @ManyToOne relations:&lt;br/&gt;
Notice: Undefined index: &lt;span class=&quot;error&quot;&gt;&amp;#91;....&amp;#93;&lt;/span&gt; in &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;Doctrine/ORM/UnitOfWork.php on line 2655&lt;br/&gt;
I&apos;m using version 2.2.2&lt;br/&gt;
Am I doing something wrong?&lt;/p&gt;</comment>
                    <comment id="18894" author="kosen" created="Sun, 28 Oct 2012 15:33:51 +0000"  >&lt;p&gt;Never mind. I&apos;ve upgraded to Doctrine 2.3.0 and it works as expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-972] MySql MyISAM support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-972</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We can not set MySql Engine for MyISAM. MySqlPlatform has a _getCreateTableSQL where you can pass some options with the engine param.&lt;br/&gt;
Not able to set it up from yml, xml or annotation schema.&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12284">DDC-972</key>
            <summary>MySql MyISAM support</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="nisnardi">nicolas isnardi</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Jan 2011 18:25:07 +0000</created>
                <updated>Fri, 13 Jul 2012 09:53:50 +0000</updated>
                                    <version>2.0</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="15866" author="cedrictailly" created="Thu, 19 May 2011 10:55:00 +0000"  >&lt;p&gt;I have the same problem and I didn&apos;t found documentation to select the engine for a given table.&lt;/p&gt;

&lt;p&gt;I tried to understand the code by myself and made modifications of my Doctrine v2.0.5, perhaps this is not the best one but here is a beginning of a solution :&lt;/p&gt;

&lt;p&gt;-------------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;@ ORM\Mapping\Driver\DoctrineAnnotations.php:100&lt;/p&gt;

&lt;p&gt;  final class Table extends Annotation &lt;/p&gt;
{
      public $name;
      public $schema;
      public $indexes;
      public $uniqueConstraints;
      public $engine;
  }

&lt;p&gt;@ ORM\Mapping\Driver\AnnotationDriver.php:144&lt;/p&gt;

&lt;p&gt;  $primaryTable = array(&lt;br/&gt;
      &apos;name&apos; =&amp;gt; $tableAnnot-&amp;gt;name,&lt;br/&gt;
      &apos;schema&apos; =&amp;gt; $tableAnnot-&amp;gt;schema,&lt;br/&gt;
      &apos;engine&apos; =&amp;gt; $tableAnnot-&amp;gt;engine&lt;br/&gt;
  );&lt;/p&gt;

&lt;p&gt;@ ORM\Tools\SchemaTool.php:133&lt;/p&gt;

&lt;p&gt;  $table = $schema-&amp;gt;createTable($class-&amp;gt;getQuotedTableName($this-&amp;gt;_platform));&lt;/p&gt;

&lt;p&gt;  if ( isset($class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;) )&lt;br/&gt;
    $table-&amp;gt;addOption(&quot;engine&quot;,$class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;-------------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;...and to define for instance the MyISAM engine in annotations :&lt;/p&gt;

&lt;p&gt;  /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Entity&lt;/li&gt;
	&lt;li&gt;@Table(engine=&quot;MyISAM&quot;)&lt;br/&gt;
   */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Because there is no foreign key on MyISAM tables, there are still problems on the schema creation/update when Doctrine executes the corresponding &quot;alter table&quot; SQL commands.&lt;/p&gt;</comment>
                    <comment id="18298" author="gabrielnn77" created="Thu, 12 Jul 2012 13:34:20 +0000"  >&lt;p&gt;in Doctrine 2.2.2 will be&lt;/p&gt;

&lt;p&gt;Doctrine/ORM/Tools/SchemaTool.php-149-                  ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Tools/SchemaTool.php-150-                  if ( isset($class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;) )&lt;br/&gt;
Doctrine/ORM/Tools/SchemaTool.php-151-                          $table-&amp;gt;addOption(&quot;engine&quot;,$class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
Doctrine/ORM/Tools/SchemaTool.php-152-                  ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;Doctrine/ORM/Mapping/ClassMetadataInfo.php-1719-                ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Mapping/ClassMetadataInfo.php-1720-                if (isset($table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;engine&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
Doctrine/ORM/Mapping/ClassMetadataInfo.php-1721-                        $this-&amp;gt;table[&apos;engine&apos;] = $table[&apos;engine&apos;];
Doctrine/ORM/Mapping/ClassMetadataInfo.php-1722-                }
&lt;p&gt;Doctrine/ORM/Mapping/ClassMetadataInfo.php-1723-                ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;Doctrine/ORM/Mapping/Table.php-42-      ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Mapping/Table.php-43-      /** @var string */&lt;br/&gt;
Doctrine/ORM/Mapping/Table.php-44-    public $engine;&lt;br/&gt;
Doctrine/ORM/Mapping/Table.php-45-      ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;Doctrine/ORM/Mapping/Driver/AnnotationDriver.php-181-                   ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Mapping/Driver/AnnotationDriver.php-182-                   $primaryTable&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;engine&amp;#39;&amp;#93;&lt;/span&gt; = $tableAnnot-&amp;gt;engine;&lt;br/&gt;
Doctrine/ORM/Mapping/Driver/AnnotationDriver.php-183-                   ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;i found a problem in ManyToMany relations, the intermediate table will be InnoDB&lt;/p&gt;</comment>
                    <comment id="18299" author="beberlei" created="Fri, 13 Jul 2012 08:23:21 +0000"  >&lt;p&gt;You can do all tables as MyISAM already through metadata using @Table(options=&lt;/p&gt;
{&quot;engine&quot;: &quot;MyISAM&quot;}
&lt;p&gt;) except Many-To-Many Join Tables. But you could create a listener to the &quot;postSchemaGenerate&quot; event and accept the schema instance there, modify everything accordingly.&lt;/p&gt;</comment>
                    <comment id="18300" author="stof" created="Fri, 13 Jul 2012 08:50:47 +0000"  >&lt;p&gt;should we add the support of the options for the @JoinTable annotation ?&lt;/p&gt;</comment>
                    <comment id="18303" author="beberlei" created="Fri, 13 Jul 2012 09:53:50 +0000"  >&lt;p&gt;Yes, that is probably what this ticket boils down to &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>

<item>
            <title>[DDC-952] Several features to batch eager selects more efficently</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-952</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This ticket aggregates several strategies to optimize batching of eager selects.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12257">DDC-952</key>
            <summary>Several features to batch eager selects more efficently</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Dec 2010 18:14:21 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15074" author="beberlei" created="Fri, 31 Dec 2010 06:47:18 +0000"  >&lt;p&gt;Requirements for batching of eager loads:&lt;/p&gt;

&lt;p&gt;1. Since we are using an IN() query for this we can only support this feature for entities that have a single column primary key.&lt;br/&gt;
2. If we want to support composite keys we need to build it as WHERE ( (id1 = ? AND id2 = ?) OR (id1 = ? AND id2 = ?)) but this is currently not possible with the way how internally the $criteria array is used.&lt;/p&gt;</comment>
                    <comment id="15075" author="beberlei" created="Fri, 31 Dec 2010 07:38:56 +0000"  >&lt;p&gt;Next item to think about: What if an exception or event breaks the flow and &quot;triggerEagerLoads()&quot; is never called?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
            <subtask id="10197">DDC-53</subtask>
            <subtask id="11731">DDC-733</subtask>
            <subtask id="11736">DDC-734</subtask>
            <subtask id="12076">DDC-865</subtask>
            <subtask id="12249">DDC-914</subtask>
            <subtask id="12269">DDC-963</subtask>
            <subtask id="12453">DDC-1060</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-948] incorrect link from the types page to known vendor issues</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-948</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/types.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/types.html&lt;/a&gt; links to &lt;a href=&quot;http://www.doctrine-project.org/docs/dbal/2.0/en/known-vendor-issues&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/dbal/2.0/en/known-vendor-issues&lt;/a&gt; instead of &lt;a href=&quot;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/known-vendor-issues.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/known-vendor-issues.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also noticed that the documentation still says &quot;Doctrine DBAL v2.0.0-BETA4 documentation&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12253">DDC-948</key>
            <summary>incorrect link from the types page to known vendor issues</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sat, 25 Dec 2010 07:23:30 +0000</created>
                <updated>Sat, 25 Dec 2010 07:35:23 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15016" author="lsmith" created="Sat, 25 Dec 2010 07:35:23 +0000"  >&lt;p&gt;err sorry .. this is of course a DBAL doc issue not and ORM issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-947] Optmize Code-Generation Strategies</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-947</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should optimize code-generation somehow.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12251">DDC-947</key>
            <summary>Optmize Code-Generation Strategies</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Dec 2010 06:22:17 +0000</created>
                <updated>Tue, 29 Mar 2011 14:38:48 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15630" author="beberlei" created="Tue, 29 Mar 2011 14:38:48 +0000"  >&lt;p&gt;Descheduled to 2.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-946] Evaluate optional use of igbinary for serialization</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-946</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Igbinary is supposed to be faster and better than serialize/unserialize(). We should check if its relevant for us (metadata and query caching for example):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/phadej/igbinary&quot; class=&quot;external-link&quot;&gt;https://github.com/phadej/igbinary&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12246">DDC-946</key>
            <summary>Evaluate optional use of igbinary for serialization</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Dec 2010 12:13:01 +0000</created>
                <updated>Wed, 22 Dec 2010 12:17:56 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14997" author="beberlei" created="Wed, 22 Dec 2010 12:17:56 +0000"  >&lt;p&gt;&lt;a href=&quot;http://ilia.ws/archives/211-Igbinary,-The-great-serializer.html#extended&quot; class=&quot;external-link&quot;&gt;http://ilia.ws/archives/211-Igbinary,-The-great-serializer.html#extended&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-930] A table cannot have more than one many to many relationship with the same table when using reverse engineer</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-930</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is caused by taking the join column name as the identifier while generating a property name for annotation. The mapping driver detects that the same property is already defined and ends the convert process. A little bit smarter approach for me was to take the local table name. But this assumes a specific style of join table naming convention.&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass()&lt;/p&gt;

&lt;p&gt;Replace:&lt;/p&gt;

&lt;p&gt;$associationMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt; = Inflector::camelize(str_replace(&apos;_id&apos;, &apos;&apos;, strtolower(current($otherFk-&amp;gt;getColumns()))));&lt;/p&gt;

&lt;p&gt;With:&lt;/p&gt;

&lt;p&gt;$name = explode(&quot;_&quot;,$myFk-&amp;gt;getLocalTableName());&lt;br/&gt;
if (count($name) &amp;gt; 1)&lt;br/&gt;
{&lt;br/&gt;
	array_shift($name);&lt;br/&gt;
}&lt;br/&gt;
$name = implode(&quot;_&quot;, $name);&lt;/p&gt;

&lt;p&gt;                    $associationMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt; = Inflector::camelize(str_replace(&apos;_id&apos;, &apos;&apos;, strtolower($name)));&lt;/p&gt;


&lt;p&gt;Maybe to switch to this behavior with an additional option?&lt;/p&gt;</description>
                <environment>FreeBSD, PostgreSQL 8.4</environment>
            <key id="12225">DDC-930</key>
            <summary>A table cannot have more than one many to many relationship with the same table when using reverse engineer</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="teuzz">Jiri Helmich</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Dec 2010 02:52:49 +0000</created>
                <updated>Mon, 13 Dec 2010 02:52:49 +0000</updated>
                                    <version>2.0-RC2</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-923] Add note about DateTime Query Parameter Type Hint</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-923</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12215">DDC-923</key>
            <summary>Add note about DateTime Query Parameter Type Hint</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Dec 2010 03:11:43 +0000</created>
                <updated>Fri, 10 Dec 2010 03:11:43 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-919] subselect</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-919</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i&apos;d like to see more example in documentation with this subselects&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;23:08&amp;#93;&lt;/span&gt; &amp;lt;beberlei&amp;gt; can you open a tciket on jira? then i dont forget to do that when i have time&lt;/p&gt;</description>
                <environment></environment>
            <key id="12208">DDC-919</key>
            <summary>subselect</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="mungiu">Mungiu Dragos</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2010 16:16:56 +0000</created>
                <updated>Sun, 20 Mar 2011 13:45:51 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15543" author="lopezdonaque" created="Sun, 20 Mar 2011 13:45:51 +0000"  >&lt;p&gt;Subselect as columns or FROM clause should have mor examples.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-896] Use PDepend for Code-Generation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-896</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Our current code-generation tool has many shortcomings and due to its hard to test nature also many (known and unknown) bugs, as well as high maintenance.&lt;/p&gt;

&lt;p&gt;Since people are overusing this tool and I am sort of annoyed by how much time goes into this we should rewrite this in a two-step procedure:&lt;/p&gt;

&lt;p&gt;1. Move code into Common so we can share it between ORM, Mongo and CouchDB.&lt;br/&gt;
2. Use PDepend to read an entities source file (it generates an AST) and modify the AST with the required changes.&lt;/p&gt;

&lt;p&gt;This gives us the advantage of having to maintaining less code for this stuff.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12169">DDC-896</key>
            <summary>Use PDepend for Code-Generation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 27 Nov 2010 13:51:06 +0000</created>
                <updated>Sat, 27 Nov 2010 13:51:19 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-851] Automerge of detached entities passed to doctrine</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-851</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is a feature request.&lt;/p&gt;

&lt;p&gt;Currently it is not possible to assign a detached entity to a relationship. You have to manually &quot;merge&quot; it, and only then you are able to assign it to relationships of managed objects.&lt;/p&gt;

&lt;p&gt;This can become complicated to do. The way it is now, when assigning an entity to a relationship in a process using a large number of entities, the entity&apos;s state needs to be checked and the entity possibly merged - all in userland code. This adds a level of complexity and potential for errors, while it could be solved transparently and elegantly within the ORM. There are ways to implement it in userland code, too, with moderate effort (see below), but this does not change the fact that responsibility for implementing a purely technical feature is delegated to the user, who could be spending his time much better writing business code. And if the user actually implements it, it will clutter the application with non-problem-domain code.&lt;/p&gt;

&lt;p&gt;To keep things simple, I propose Doctrine be extended to simply auto-merge any detached entities passed to it. That would save the programmer the manual tracking of object states and merge() calls.&lt;/p&gt;

&lt;p&gt;This would be especially handy when using cascades, as keeping track of deep object graphs in userland code would duplicate substantial ORM functionality.&lt;/p&gt;

&lt;p&gt;In programs that work with massive amounts of data, it is practically impossible to keep all entities managed due to resource constraints (see e.g. the batch processing patterns documented in the Doctrine 2 reference at &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/batch-processing/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/batch-processing/en&lt;/a&gt;). In a situation like that, one would probably simply flush and clear the entity manager regularly. Doctrine 2 currently forces the user to manually &quot;merge&quot; all persistent objects he/she still holds references to and wants to assign e.g. to other newly created persistable objects. I can not think of any reason why Doctrine 2 should not be able to do it automatically.&lt;/p&gt;


&lt;p&gt;Below is another comment originally attached to the GitHub proposal, containing a userland implementation of the feature as a temporary fix, for whoever cares.&lt;/p&gt;

&lt;p&gt;Here is a userland implementation for the functionality I am proposing, though I feel it is technical clutter that belongs into the ORM. Changing doctrine to be able to auto-merge unmanaged entities would be ideal. I thought I&apos;d share this, for use as long as Doctrine 2 does not provide equivalent functionality. The implementation assumes all entities inherit from a base class (named &quot;YourEntityBaseClass here&quot;) and intercepts the assignment to ToOne-relationships in a __set() method provided in that base class. For ToMany-relationships we extend ArrayCollection to intercept calls to add() and set() to accomplish the same.&lt;/p&gt;

&lt;p&gt;As an alternative to defining a __set() method in a base class you could also implement the interception by changing any mutator methods you define in your entities. But that would bloat your code quickly as you define more and more relationship attributes on your entities.&lt;/p&gt;

&lt;p&gt;The following __set() method implementation relies on reflection to parse the DocBlock-Comment with the Annotation and determine whether or not the property to be set is a ToOne-relationship.&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;public&lt;/span&gt; function __set($name, &amp;amp;$value) {
      
      $reflectionClass = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ReflectionClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
      
      $property = $reflectionClass-&amp;gt;getProperty($name);

      &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (   self::isToOneRelationship($property)
          &amp;amp;&amp;amp; $value !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
            
         $value = self::mergeIfDetached($value);
      }
      
      $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name = $value;
   }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following is an implementation of mergeIfDetached(), that assumes there is a __get defined on the entity, to be able to access the protected mapped properties.&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;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function mergeIfDetached(YourEntityBaseClass $dataObject) {

   $doctrineEntityManager = DB::getDoctrineEntityManager();

   &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($doctrineEntityManager-&amp;gt;getUnitOfWork()-&amp;gt;getEntityState($dataObject) == \Doctrine\ORM\UnitOfWork::STATE_DETACHED) {
       
      $dataObject = $doctrineEntityManager-&amp;gt;merge($dataObject);
   }

   &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $dataObject;
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For your purposes, consider DB to be just a class holding a reference to the Doctrine entity manager.&lt;/p&gt;

&lt;p&gt;Here are the helper methods for the reflection:&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;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function isToOneRelationship(ReflectionProperty $property) {

      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; self::matchDoctrineAnnotation($property, self::$doctrineToOneRelationshipAnnotation);
   }

   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function matchDoctrineAnnotation(ReflectionProperty $property, $pattern) {
      
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; preg_match(&apos;/\@&apos; . $pattern . &apos;/&apos;, $property-&amp;gt;getDocComment()) != 0;
   }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the drop-in-replacement class for use with ToMany-Relationships. It uses the static reloadIfDetached method defined in the entity base class:&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;
use Doctrine\Common\Collections\ArrayCollection;


class Collection &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ArrayCollection {
   
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function set($key, $value) {
       
       $value = YourEntityBaseClass::mergeIfDetached($value);
       
       parent::set($key, $value);
    }


    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function add($value) {
       
       $value = YourEntityBaseClass::mergeIfDetached($value);
       
       &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parent::add($value);
    }
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This approach keeps the amount of unnecessary code to a minimum, so that merges are not scattered throughout the problem-domain code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12049">DDC-851</key>
            <summary>Automerge of detached entities passed to doctrine</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Sun, 31 Oct 2010 22:52:26 +0000</created>
                <updated>Thu, 30 Dec 2010 05:55:17 +0000</updated>
                                    <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15057" author="dalvarez" created="Wed, 29 Dec 2010 18:53:03 +0000"  >&lt;p&gt;I have to note that the code I listed above turned out to be broken. There is nothing that guarantees that a data object just merged will not become detached again after being merged on assignment, unless the object is immediately persisted afterwards.&lt;/p&gt;

&lt;p&gt;The correct solution would be to merge all data objects found through relationships for a given data object, right from the persistence manager, immediately before calling persist() on the data object.&lt;/p&gt;

&lt;p&gt;I am currently using this solution (save() saves a data object safely for use within long-running batch jobs):&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;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function save(DataObject $dataObject) {
      
      self::mergeRelatedDataObjectsIfDetached($dataObject);
      
      self::$doctrineEntityManager-&amp;gt;persist($dataObject);
   }
   

   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function merge(DataObject $dataObject) {
      
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; self::$doctrineEntityManager-&amp;gt;merge($dataObject);
   }


  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function mergeRelatedDataObjectsIfDetached(DataObject $dataObject) {
      
      $reflectionClass = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ReflectionClass($dataObject);
      
      $properties = $reflectionClass-&amp;gt;getProperties();
      
      foreach ($properties as $property) {

         $propertyName = $property-&amp;gt;getName();
         
         $propertyValue = $dataObject-&amp;gt;__get($propertyName);
         
         
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (MetadataReader::isToOneRelationship($property)) {
            
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (   $propertyValue !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
                &amp;amp;&amp;amp; ! $propertyValue &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy
                &amp;amp;&amp;amp; self::isDetached($propertyValue)) {
               
               $relatedDataObject = self::merge($propertyValue);
               
               $dataObject-&amp;gt;__set($propertyName, $relatedDataObject);
            }
         }
         &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (MetadataReader::isToManyRelationship($property)) {
               
               $relatedDataObjects = $propertyValue-&amp;gt;toArray();
               
               foreach ($relatedDataObjects as $index =&amp;gt; $relatedDataObject) {
                  
                  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $relatedDataObject &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy
                      &amp;amp;&amp;amp; self::isDetached($relatedDataObject)) {
                     
                     $relatedDataObject = self::merge($relatedDataObject);
                     
                     
                     &lt;span class=&quot;code-comment&quot;&gt;// Replace the entry in the collection with the merged copy.
&lt;/span&gt;                     
                     $propertyValue-&amp;gt;set($index, $relatedDataObject);
                  }
               }
            }
         }
      }
   }
   
   
   &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function isDetached(DataObject $dataObject) {
      
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; self::$doctrineEntityManager-&amp;gt;getUnitOfWork()-&amp;gt;getEntityState($dataObject) == UnitOfWork::STATE_DETACHED;
   }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;I still wish there would be an automerge feature, kind of Hibernate&apos;s &quot;update&quot;.&lt;/p&gt;</comment>
                    <comment id="15058" author="dalvarez" created="Wed, 29 Dec 2010 18:55:14 +0000"  >&lt;p&gt;Wrapped the code sections into proper code blocks...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-821] Consider adding Query-Join as another join method for DQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-821</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Some ORM systems support an alternative to fetch-join queries, called a &quot;query-join&quot;.  See &lt;a href=&quot;http://www.avaje.org/ebean/introquery_joinquery.html&quot; class=&quot;external-link&quot;&gt;http://www.avaje.org/ebean/introquery_joinquery.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A query-join accomplishes the same as a fetch-join (hydrating a larger object graph across all associations types) but executes more than one SQL query in sequence in order to hydrate the requested portions of the graph in a result set.  The first query retrieves data from the base entity/table and the next queries retrieve the data for the requested associations.&lt;/p&gt;

&lt;p&gt;In some cases this approach is more efficient to a fetch-join:&lt;/p&gt;

&lt;p&gt;(1) &lt;b&gt;No data duplication in the SQL result&lt;/b&gt; as occurs in a fetch-join on to-many associations.  Instead, this data is loaded through a second query.  This saves network traffic, memory and general overhead in hydrating the returned results.  In the case where large TEXT data is included in result sets, the savings here may be substantial.&lt;/p&gt;

&lt;p&gt;(2) &lt;b&gt;setFirstResult() and setMaxResult() are again effective (for pagination)&lt;/b&gt; and more importantly more efficient on these query-joins.  The current DoctrineExtension solution to enable pagination on fetch-joins requires a series of queries to determine the target primary keys of the root entity of the query.  The primary key lookup query requires DISTINCT or GROUP BY &amp;#8211; which often triggers filesorts, temporary tables, etc (at least on MySQL) and greatly slows down the query.  Query joins would not require this. &lt;/p&gt;

&lt;p&gt;Possible implementation example:&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-comment&quot;&gt;// existing fetch-join
&lt;/span&gt;$query = $em-&amp;gt;createQuery(&apos;SELECT c, o FROM Customers c JOIN c.orders o&apos;);
$query-&amp;gt;setFirstResult(10)-&amp;gt;setMaxResult(20); &lt;span class=&quot;code-comment&quot;&gt;// doesn&apos;t &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; what you&apos;d hope it would &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt;, no ability to use &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; pagination
&lt;/span&gt;$customersAndOrders = $query-&amp;gt;getResult(); &lt;span class=&quot;code-comment&quot;&gt;// array of Customer objects with Orders hydrated
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// proposed query-join
&lt;/span&gt;$query = $em-&amp;gt;createQuery(&apos;SELECT c, o FROM Customers c QUERY JOIN c.orders o&apos;);
$query-&amp;gt;setFirstResult(10)-&amp;gt;setMaxResult(20); &lt;span class=&quot;code-comment&quot;&gt;// now works &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; pagination
&lt;/span&gt;$customersAndOrders = $query-&amp;gt;getResult(); &lt;span class=&quot;code-comment&quot;&gt;// array of Customer objects with Orders hyrdated
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; would execute a series of queries -- i.e. in SQL
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// SELECT ... FROM customers LIMIT 10, 20
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// SELECT ... FROM orders WHERE customer_id IN (.....)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and/or,  could there be a way to trigger a &quot;query-join&quot; against an existing array of entities?  for example&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;$query = $em-&amp;gt;createQuery(&apos;SELECT c FROM Customers c&apos;); &lt;span class=&quot;code-comment&quot;&gt;// single query to fetch customers
&lt;/span&gt;$customers = $query-&amp;gt;getResult(); &lt;span class=&quot;code-comment&quot;&gt;// array of Customer objects
&lt;/span&gt;$em-&amp;gt;join($customers, &apos;orders&apos;); &lt;span class=&quot;code-comment&quot;&gt;// fetch and hydrate the &apos;orders&apos; association on each Customer using a single query&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Perhaps at some point in the future Doctrine/DBAL could even make use of asynchronous queries (i.e. mysqlnd supports this) to allow these query-joins to run in parallel and the result would be more efficient paginated resultsets.&lt;/p&gt;

&lt;p&gt;Thoughts/feedback?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11962">DDC-821</key>
            <summary>Consider adding Query-Join as another join method for DQL</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Sep 2010 15:14:23 +0000</created>
                <updated>Wed, 29 Dec 2010 00:49:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14494" author="beberlei" created="Thu, 30 Sep 2010 03:50:53 +0000"  >&lt;p&gt;There is another approach for this using several subqueries to build an IN clause, the Paginator extension supports this: &lt;a href=&quot;http://github.com/beberlei/DoctrineExtensions&quot; class=&quot;external-link&quot;&gt;http://github.com/beberlei/DoctrineExtensions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I rather go the extension approach than changing the DQL for this feature.&lt;/p&gt;</comment>
                    <comment id="14497" author="beberlei" created="Thu, 30 Sep 2010 04:31:13 +0000"  >&lt;p&gt;I just saw your second example, that is rather cool though and gets +1 from me.&lt;/p&gt;

&lt;p&gt;I had the same idea for &quot;not initialized proxies&quot;, i.e.&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;$em-&amp;gt;getUnitOfWork()-&amp;gt;initializeProxies(&apos;Customer&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15051" author="mjh_ca" created="Wed, 29 Dec 2010 00:49:46 +0000"  >&lt;p&gt;Second example is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-734&quot; title=&quot;Possibility to fetch all outstanding proxies of an Entity&quot;&gt;&lt;del&gt;DDC-734&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-813] Validate Schema should complain on bi-directional relationships with mapped superclasses</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-813</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;@ManyToOne and @OneToOne on mapped superclasses have to be unidirectional. The Schema Validator should verify this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11948">DDC-813</key>
            <summary>Validate Schema should complain on bi-directional relationships with mapped superclasses</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Sep 2010 18:13:26 +0000</created>
                <updated>Mon, 29 Oct 2012 09:13:47 +0000</updated>
                                    <version>2.0-BETA4</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-810] Issue with detaching entities and updating when using change notification</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-810</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;More information coming soon. Attaching a test case&lt;/p&gt;</description>
                <environment></environment>
            <key id="11931">DDC-810</key>
            <summary>Issue with detaching entities and updating when using change notification</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Sep 2010 12:43:08 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                    <version>2.0-BETA4</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14415" author="beberlei" created="Mon, 20 Sep 2010 05:09:49 +0000"  >&lt;p&gt;From reading the issue i know what the bug is, indeed this sucks.&lt;/p&gt;</comment>
                    <comment id="14487" author="romanb" created="Tue, 28 Sep 2010 16:27:00 +0000"  >&lt;p&gt;@Jon: Any more information coming?&lt;/p&gt;

&lt;p&gt;@Benjamin: Can you summarize the essence of the issue shortly?&lt;/p&gt;</comment>
                    <comment id="14489" author="beberlei" created="Wed, 29 Sep 2010 03:02:12 +0000"  >&lt;p&gt;@Roman: The UnitOfWork (may) still be pushed as a listener into that entity, and still recieve noticies of update. Which may throw notices because the oid hashes are removed everywhere. Additionally you cant serialize the thing because you still got the UoW inside there.&lt;/p&gt;</comment>
                    <comment id="14524" author="jwage" created="Mon, 4 Oct 2010 19:48:17 +0000"  >&lt;p&gt;I don&apos;t have anymore information currently. The issue was relayed to me. I will try and find some more information and report back.&lt;/p&gt;</comment>
                    <comment id="15669" author="beberlei" created="Sun, 3 Apr 2011 14:38:51 +0000"  >&lt;p&gt;There is no way to &quot;fix&quot; this issue, i am turning it into a feature request. There needs to be a &quot;postDetach&quot; event that is triggered where the developer can detach the change notification objects.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10804" name="DDC810Test.php" size="4266" author="jwage" created="Fri, 17 Sep 2010 12:43:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-803] Create subselect queries within join statements</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-803</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="11919">DDC-803</key>
            <summary>Create subselect queries within join statements</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="martijn">Martijn Evers</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Sep 2010 08:58:51 +0000</created>
                <updated>Tue, 14 Sep 2010 08:58:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-785] Post-Post-Persist event</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-785</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;postPersist/postUpdate events are triggered in the middle of a unitOfWork, and querying the DB in such events causes infinite loops. Doctrine attempts to flush the entity manager before running any query, which triggers flushing of entities, and postPersist/postUpdate events are triggered again.&lt;/p&gt;

&lt;p&gt;I did not checked, but the flush() before each query may be a performance problem too, if doctrine has to determine what has changed, depending on the changetracking policy.&lt;/p&gt;

&lt;p&gt;Also, it would be great if postPersist / postUpdate events were triggered after all entities have been persisted. It looks like that entities are flushed by groups of same &apos;type&apos;, and that events for a type are triggered once all of the elements of that group have been flushed, potentially before entities of an other type have been flushed : postPersist / postUpdate events are triggered while some other entities are still not flushed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11874">DDC-785</key>
            <summary>Post-Post-Persist event</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="arnaud-lb">arnaud-lb</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Sep 2010 16:08:16 +0000</created>
                <updated>Fri, 14 Jan 2011 03:11:48 +0000</updated>
                                    <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14250" author="beberlei" created="Fri, 3 Sep 2010 03:10:08 +0000"  >&lt;p&gt;That is documented and for perfomance reasons we cannot move the preUpdate/postUpdate/prePersist/postPersist events to other locations inside the UnitOfWork.&lt;/p&gt;

&lt;p&gt;There is an onFlush event that allows for more flexibility and is triggered before any update/insert/delete is done by the UnitOfWork.&lt;/p&gt;
</comment>
                    <comment id="14274" author="arnaud-lb" created="Sat, 4 Sep 2010 08:09:58 +0000"  >&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;I understand that. Is there any chance of getting some onPostFlush or similar, which would be triggered like onFlush, but after all update/insert/delete ? Or just some post-something event which is allowed to issue db queries.&lt;/p&gt;</comment>
                    <comment id="14458" author="gediminasm" created="Fri, 24 Sep 2010 10:02:13 +0000"  >&lt;p&gt;onFlush you can store your entity for furher processing and on postPersist you can check if there are no more insertions and process the entity if it needs additional query&lt;br/&gt;
I have faced all these issues and you can check &lt;a href=&quot;http://github.com/l3pp4rd/DoctrineExtensions/tree/master/lib/DoctrineExtensions/Translatable/&quot; class=&quot;external-link&quot;&gt;http://github.com/l3pp4rd/DoctrineExtensions/tree/master/lib/DoctrineExtensions/Translatable/&lt;/a&gt;&lt;br/&gt;
for a solution to your problem&lt;/p&gt;</comment>
                    <comment id="15140" author="gediminasm" created="Fri, 14 Jan 2011 03:11:48 +0000"  >&lt;p&gt;I think this issue should be closed since the main reason of opening it was the possibility to execute additional queries when inserts were pending in unit of work. In current release it does not cause a flush during an additional query execution anymore.  &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-779] Doctrine\ORM\Configuration should be immutable after construction of EntityManager</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-779</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the Doctrine\ORM\Configuration instance is not immutable after construction of the EM, which can lead to funny behavior when changing essential dependencies such as caches or others.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11850">DDC-779</key>
            <summary>Doctrine\ORM\Configuration should be immutable after construction of EntityManager</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Aug 2010 16:23:27 +0000</created>
                <updated>Mon, 30 Aug 2010 16:23:27 +0000</updated>
                                    <version>2.0-BETA3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-776] Persisters use a fixed &quot;SELECT&quot; SQL statements</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-776</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am currently trying to work with BINARY columns with Doctrine 2 and MSSQL. In order to get my Entities working I had to create a custom Mapping Type for Binary columns. All went well in this case and I&apos;ve got it running.&lt;/p&gt;

&lt;p&gt;The problem arises when I am attempting to use Associative mapping (OneToOne/ManyToMany). The problem is, in order to do a select for an SQL column, I had to create a DQL function called &quot;CONVERT&quot; so that I use WHERE statements:&lt;/p&gt;

&lt;p&gt;            return $this-&amp;gt;createQueryBuilder(&apos;u&apos;)&lt;br/&gt;
                -&amp;gt;where(&quot;u.id = CONVERT(&apos;binary&apos;, :id, 1)&quot;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;id&apos;, $id)&lt;br/&gt;
                -&amp;gt;getQuery()&lt;br/&gt;
                -&amp;gt;getSingleResult();&lt;/p&gt;

&lt;p&gt;As you see, I must do this in order to get a result.&lt;/p&gt;

&lt;p&gt;However, when I&apos;m using associative mapping; this is what it does:&lt;/p&gt;

&lt;p&gt;        return &apos;SELECT &apos; . $this-&amp;gt;_getSelectColumnListSQL() &lt;br/&gt;
             . &apos; FROM &apos; . $this-&amp;gt;_class-&amp;gt;getQuotedTableName($this-&amp;gt;_platform) . &apos; &apos;&lt;br/&gt;
             . $this-&amp;gt;_getSQLTableAlias($this-&amp;gt;_class-&amp;gt;name)&lt;br/&gt;
             . $joinSql&lt;br/&gt;
             . ($conditionSql ? &apos; WHERE &apos; . $conditionSql : &apos;&apos;)&lt;br/&gt;
             . $orderBySql &lt;br/&gt;
             . $lockSql;&lt;/p&gt;

&lt;p&gt;As you can see, its some what hard coded and I cannot change it without changing the actual code in &lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister.php&lt;/p&gt;

&lt;p&gt;So, I would first like to know if there was maybe a way you could allow us to customize the SELECT statement that the persisters use - or maybe (though I&apos;m not sure how this will be done) make them use user-defined repository functions?&lt;/p&gt;

&lt;p&gt;Like $myRepo-&amp;gt;find($identifier)&lt;/p&gt;

&lt;p&gt;Not entirely sure if I explained this properly and I do realize my circumstance is highly odd - but this does seem like a limitation and because of this I cannot use associative mapping.&lt;/p&gt;</description>
                <environment>Windows 7, Apache 2.2, MSSQL Server, PHP 5.3.3</environment>
            <key id="11845">DDC-776</key>
            <summary>Persisters use a fixed &quot;SELECT&quot; SQL statements</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="aarondm">Aaron DM</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Aug 2010 13:52:27 +0000</created>
                <updated>Tue, 23 Apr 2013 12:09:39 +0000</updated>
                                    <version>2.0-BETA3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="20094" author="locs" created="Tue, 23 Apr 2013 12:09:39 +0000"  >&lt;p&gt;Hi, i try to make my custom type for binary field in MSSQL.&lt;br/&gt;
I don&apos;t find own, can you please show me your custom type binary?&lt;br/&gt;
Thks a lot.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-769] Disabling discriminator column in WHERE clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-769</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Per default Doctrine 2 adds an IN(...)-part to the query when hydrating an entity where a discriminator column is defined. While this makes sense as a default behavior, it would be pretty helpful if one could disable the WHERE-clause for discriminator columns alltogether for performance optimization.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11830">DDC-769</key>
            <summary>Disabling discriminator column in WHERE clause</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="lstrojny">Lars Strojny</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Aug 2010 10:41:56 +0000</created>
                <updated>Tue, 7 Sep 2010 06:49:13 +0000</updated>
                                    <version>2.0-BETA3</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14094" author="romanb" created="Thu, 26 Aug 2010 12:39:43 +0000"  >&lt;p&gt;That would obviously produce wrong results. Maybe you can elaborate more with an example.&lt;/p&gt;</comment>
                    <comment id="14299" author="lstrojny" created="Tue, 7 Sep 2010 06:49:13 +0000"  >&lt;p&gt;I use ENUM(&quot;foo&quot;,&quot;bar&quot;) as discriminator columns. That means, the column will contain the right values out of the box, no further result set limiting required with WHERE.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-763] Cascade merge on associated entities can insert too many rows through &quot;Persistence by Reachability&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-763</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I think that the UnitOfWork needs to maintain a map of spl_object_hash($newEntity)-&amp;gt;$managedEntity for entities that were persisted via reachability during a merge.  doMerge should then only call persistNew if the original entity has not already been persisted (if it has already been persisted it should merge the managed entity from the map).  The map should be maintained until a flush() or until the UnitOfWork is cleared.  The reasoning is as follows.&lt;/p&gt;

&lt;p&gt;Imagine we have a simple doctor object with no associations:&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;$doctor = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctor();
$em-&amp;gt;persist($doctor);
$em-&amp;gt;persist($doctor);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After the first persist() $doctor is MANAGED so the second persist has no effect and this results in a single Doctor row.&lt;/p&gt;

&lt;p&gt;If we do the same thing using merge and persistence by reachability:&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;$doctor = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctor();
$em-&amp;gt;merge($doctor);
$em-&amp;gt;merge($doctor);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;we get 2 Doctor rows being added.&lt;/p&gt;

&lt;p&gt;Obviously in this particular case we should use the return value from the first merge() as the parameter of the second merge which would give correct behaviour.&lt;/p&gt;

&lt;p&gt;However, now imagine one Doctor has many Patients and many Patients have one Doctor, all the associations have cascade merge enabled, and further assume that $d1 (Doctor id=1) is already in the database.  We now attempt to create two patients and assign them to the existing doctor:&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;$d1= &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctor(); $d1-&amp;gt;id = 1; &lt;span class=&quot;code-comment&quot;&gt;// This is a DETACHED entity
&lt;/span&gt;
$p1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Patient();
$p2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Patient();

$d1-&amp;gt;patients-&amp;gt;add($p1); $p1-&amp;gt;doctor = $d1;
$d1-&amp;gt;patients-&amp;gt;add($p2); $p2-&amp;gt;doctor = $d1;

$em-&amp;gt;merge($p1);
$em-&amp;gt;merge($p2);

$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This actually results in 4 rows being added to the &apos;patients&apos; table instead of 2, I think because $p1 and $p2 are getting persisted both as the root objects and then again from the patient-&amp;gt;doctor-&amp;gt;patients array.  Since the cascade merging happens internally we can&apos;t replace the array contents with the managed return values without walking through the object graph (in which case there is no point in using cascade merge in the first place).  Maintaining a map in UnitOfWork will allow doMerge to ensure it doesn&apos;t persist the same entities twice.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure, but this might be relevant for cascade persist too.&lt;/p&gt;

&lt;p&gt;P.S. Another bug report on this can be found at &lt;a href=&quot;http://code.google.com/p/flextrine2/issues/detail?id=32&quot; class=&quot;external-link&quot;&gt;http://code.google.com/p/flextrine2/issues/detail?id=32&lt;/a&gt; (it basically says the same thing with different entities).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11812">DDC-763</key>
            <summary>Cascade merge on associated entities can insert too many rows through &quot;Persistence by Reachability&quot;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Aug 2010 05:55:30 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14135" author="beberlei" created="Sun, 29 Aug 2010 04:59:05 +0000"  >&lt;p&gt;@Roman A possible fix for this in my opinion is another map in UnitOfWork $mergedEntities = array(); and a patch 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;diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index 242d84b..1d0d8b3 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -1340,6 +1340,10 @@ class UnitOfWork &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; PropertyChangedListener
             &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;; &lt;span class=&quot;code-comment&quot;&gt;// Prevent infinite recursion
&lt;/span&gt;         }
 
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;mergedEntities[$oid])) {
+            &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;mergedEntities[$oid];
+        }
+
         $visited[$oid] = $entity; &lt;span class=&quot;code-comment&quot;&gt;// mark visited
&lt;/span&gt; 
         $class = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;getClassMetadata(get_class($entity));
@@ -1468,6 +1472,8 @@ class UnitOfWork &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; PropertyChangedListener
 
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cascadeMerge($entity, $managedCopy, $visited);
 
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;mergedEntities[$oid] = $managedCopy;
+
         &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $managedCopy;
     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14139" author="ccapndave" created="Sun, 29 Aug 2010 05:38:51 +0000"  >&lt;p&gt;I have tested this patch with my application and it fixes the problem in all my relevant test cases apart from one.  The test case that&apos;s failing is one that persists a bi-directional many to many relationship, so the associations interweave with each other (if you know what I mean).&lt;/p&gt;

&lt;p&gt;I wonder if perhaps doMerge need to continue cascading even if it finds an item in $this-&amp;gt;mergedEntities&lt;/p&gt;

&lt;p&gt;This is the Flextrine code that fails - it results in no entries in movie_artist.  This might also be related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-758&quot; title=&quot;When merging many to many entites back into the repository changes to the associations are not respected&quot;&gt;&lt;del&gt;DDC-758&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;m1 = new Movie();&lt;br/&gt;
m1.title = &quot;Movie 1&quot;;&lt;/p&gt;

&lt;p&gt;m2 = new Movie();&lt;br/&gt;
m2.title = &quot;Movie 2&quot;;&lt;/p&gt;

&lt;p&gt;a1 = new Artist();&lt;br/&gt;
a1.name = &quot;Artist 1&quot;;&lt;/p&gt;

&lt;p&gt;a2 = new Artist();&lt;br/&gt;
a2.name = &quot;Artist 2&quot;;&lt;/p&gt;

&lt;p&gt;m1.artists.addItem(a1); a1.movies.addItem(m1);&lt;br/&gt;
m1.artists.addItem(a2); a2.movies.addItem(m1);&lt;/p&gt;

&lt;p&gt;m2.artists.addItem(a1); a1.movies.addItem(m2);&lt;br/&gt;
m2.artists.addItem(a2); a2.movies.addItem(m2);&lt;/p&gt;

&lt;p&gt;// These translate to cascade merges on the server &lt;br/&gt;
em.persist(m1);&lt;br/&gt;
em.persist(m2);&lt;br/&gt;
em.persist(a1);&lt;br/&gt;
em.persist(a2);&lt;/p&gt;

&lt;p&gt;// Now flush&lt;br/&gt;
em.flush();&lt;/p&gt;</comment>
                    <comment id="14140" author="ccapndave" created="Sun, 29 Aug 2010 05:40:26 +0000"  >&lt;p&gt;P.S. This test passes if I translate em.persist() to $em-&amp;gt;persist() (not cascading) on the server instead of translating it to a cascade merge; not sure if that helps&lt;/p&gt;</comment>
                    <comment id="14149" author="romanb" created="Mon, 30 Aug 2010 06:17:09 +0000"  >&lt;p&gt;I&apos;d really like to avoid introducing an additional instance variable just to solve this issue but I did not find the time yet to really look into it.&lt;/p&gt;

&lt;p&gt;Does someone have a unit test for this already and can attach it to the issue? &lt;/p&gt;</comment>
                    <comment id="14198" author="romanb" created="Tue, 31 Aug 2010 14:56:58 +0000"  >&lt;p&gt;Rescheduling for RC1.&lt;/p&gt;</comment>
                    <comment id="14356" author="ccapndave" created="Mon, 13 Sep 2010 07:27:17 +0000"  >&lt;p&gt;Here is a functional test case containing three tests:&lt;/p&gt;

&lt;p&gt;testMultiMerge tests basic merging of two new entities, checking that only a single entity ends up in the database.  This passes with Benjamin&apos;s patch.&lt;/p&gt;

&lt;p&gt;testMultiCascadeMerge tests the more complex case of merging a OneToMany association. This also passes with Benjamin&apos;s patch.&lt;/p&gt;

&lt;p&gt;testManyToManyPersistByReachability tests the ManyToMany case described above and this fails with Benjamin&apos;s patch, probably because doMerge doesn&apos;t cascade down entities that it has already merged and some ManyToMany associations are being ignored.  Its a bit hard to be certain what is causing this as even without Benjamin&apos;s patch this test would fail due to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-758&quot; title=&quot;When merging many to many entites back into the repository changes to the associations are not respected&quot;&gt;&lt;del&gt;DDC-758&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="14397" author="beberlei" created="Wed, 15 Sep 2010 16:38:30 +0000"  >&lt;p&gt;@Roman i thought about this issue, its not possible without that additional map of merged entities. There is no way we can get that information from other sources. &lt;/p&gt;

&lt;p&gt;Problem is rather that the use-case probably only applies in mass-merging scenarios and client-server serialization.&lt;/p&gt;</comment>
                    <comment id="14442" author="ccapndave" created="Tue, 21 Sep 2010 19:48:39 +0000"  >&lt;p&gt;Added another failing test case - adding the same entity from different ends of a many to many bi-directional association to check that there isn&apos;t an integrity constraint violation caused by Doctrine trying to add the same row twice.&lt;/p&gt;</comment>
                    <comment id="14443" author="ccapndave" created="Tue, 21 Sep 2010 20:14:42 +0000"  >&lt;p&gt;Attached a patch for this issue.&lt;/p&gt;</comment>
                    <comment id="14444" author="beberlei" created="Wed, 22 Sep 2010 03:13:36 +0000"  >&lt;p&gt;can you comment why all the additionall stuff is necessary compared to my patch?&lt;/p&gt;</comment>
                    <comment id="14445" author="ccapndave" created="Wed, 22 Sep 2010 06:05:40 +0000"  >&lt;p&gt;It fixes the two additional test cases - testManyToManyPersistByReachability and testManyToManyDuplicatePersistByReachability.&lt;/p&gt;

&lt;p&gt;testManyToManyPersistByReachability was failing with your original patch because there are ManyToMany cases where an entity may have already been merged, but its still necessary to add it to an association and continue to cascade.  Running the following with the original patch will miss out some of the associations.&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;$m1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Movie();
$m1-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Movie 1&quot;&lt;/span&gt;;

$m2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Movie();
$m2-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Movie 2&quot;&lt;/span&gt;;

$a1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Artist();
$a1-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Artist 1&quot;&lt;/span&gt;;

$a2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Artist();
$a2-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Artist 2&quot;&lt;/span&gt;;

$m1-&amp;gt;artists-&amp;gt;add($a1); $a1-&amp;gt;movies-&amp;gt;add($m1);
$m1-&amp;gt;artists-&amp;gt;add($a2); $a2-&amp;gt;movies-&amp;gt;add($m1);
$m2-&amp;gt;artists-&amp;gt;add($a1); $a1-&amp;gt;movies-&amp;gt;add($m2);
$m2-&amp;gt;artists-&amp;gt;add($a2); $a2-&amp;gt;movies-&amp;gt;add($m2);

$em-&amp;gt;merge($a1);
$em-&amp;gt;merge($a2);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The other change in my patch is to protect against this case.  It ensures that the following code doesn&apos;t add the same entity twice to a collection.&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;$em-&amp;gt;merge($m1);
$em-&amp;gt;merge($m2);
$em-&amp;gt;merge($a2);
$em-&amp;gt;merge($a2);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14627" author="beberlei" created="Sun, 31 Oct 2010 02:19:03 +0000"  >&lt;p&gt;I am not sure if the issue here is rather multiple calls to merge that contain different parts of the same object-graph.&lt;/p&gt;

&lt;p&gt;There should be a very simple fix for this, call -&amp;gt;clear() after each merge.&lt;/p&gt;

&lt;p&gt;I am not sure if this patch drags us into a blackhole of issues with merging.&lt;/p&gt;</comment>
                    <comment id="14649" author="ccapndave" created="Sun, 31 Oct 2010 08:48:37 +0000"  >&lt;p&gt;Calling -&amp;gt;clear() and -&amp;gt;flush() after each merge is a workaround for the simple case, but unless I am misunderstanding I don&apos;t think its a solution for cases where the merging is happening automatically in cascadeMerge.  I&apos;ve actually encountered this issue in another project and scenario to do with creating REST APIs and merging JSON objects into entities, and applying the patch fixed it so a) I think this issue might be a more common that we first thought and b) the patch basically seems to work (plus it doesn&apos;t introduce any failing cases in the existing test suite).  I can actually still find one edge case to do with cascading merging interlinked many to many associations that this doesn&apos;t fix, but I was planning to open that as a new ticket after this   My feeling is that the current merge already has issues and this definitely improves it.&lt;/p&gt;</comment>
                    <comment id="14652" author="beberlei" created="Mon, 1 Nov 2010 02:45:36 +0000"  >&lt;p&gt;It cannot happen inside a single merge, single merges use the $visited to avoid infinite recursions, each entity can only be merged once inside a single merge operation.&lt;/p&gt;</comment>
                    <comment id="14713" author="beberlei" created="Wed, 10 Nov 2010 17:50:54 +0000"  >&lt;p&gt;Added a note into the documentation about using EntityManager#clear between merging of entities which share subgraphs and cascade merge.&lt;/p&gt;

&lt;p&gt;Handling this issue in UnitOfwork will be declared an improvement, not a bug anymore and be scheduled for later releases. The required changes to the core are to dangerous and big.&lt;/p&gt;</comment>
                    <comment id="14714" author="ccapndave" created="Thu, 11 Nov 2010 03:49:15 +0000"  >&lt;p&gt;Where in the docs is that?&lt;/p&gt;

&lt;p&gt;Just to summarize, the equivalent operation to having multiple merges and a single flush is to call merge followed by flush each time, with the whole thing surrounded by a transaction?  Does this have a big impact on performance?&lt;/p&gt;</comment>
                    <comment id="14715" author="ccapndave" created="Thu, 11 Nov 2010 04:49:18 +0000"  >&lt;p&gt;Ben - even given the decision not to implement this (and I do understand your thinking, as it is a major change), is there any reason not to implement the bit that ensures that the same entity isn&apos;t added to a collection twice during a merge?  I can&apos;t think of a situation where this should be allowed, and I have a use case where I get &apos;DUPLICATE KEY&apos; errors if this isn&apos;t there.&lt;/p&gt;

&lt;p&gt;Please see attached patch.&lt;/p&gt;</comment>
                    <comment id="14716" author="beberlei" created="Thu, 11 Nov 2010 06:35:37 +0000"  >&lt;p&gt;What bit of that huge patch is that? Can you extract it into another ticket if thats possible?&lt;/p&gt;</comment>
                    <comment id="14717" author="beberlei" created="Thu, 11 Nov 2010 06:36:52 +0000"  >&lt;p&gt;I added it to &quot;Working with Objects&quot; and the descripton of Merge. Its not yet live on the site.&lt;/p&gt;

&lt;p&gt;Using this current workaround has a performance impact, since more SELECT statements have to be issued against the database. &lt;/p&gt;</comment>
                    <comment id="14718" author="ccapndave" created="Thu, 11 Nov 2010 08:30:42 +0000"  >&lt;p&gt;Apologies for not being clear - only the 3rd patch (multipleaddmerge.diff) is relevant to the &apos;DUPLICATE KEY&apos; error I am now talking about, but I&apos;ll put it in a nother ticket if you prefer.&lt;/p&gt;</comment>
                    <comment id="14719" author="beberlei" created="Thu, 11 Nov 2010 08:35:47 +0000"  >&lt;p&gt;please add a new ticket, patch looks good.&lt;/p&gt;</comment>
                    <comment id="14720" author="ccapndave" created="Thu, 11 Nov 2010 08:51:11 +0000"  >&lt;p&gt;Created as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-875&quot; title=&quot;Merge can sometimes add the same entity twice into a collection&quot;&gt;&lt;del&gt;DDC-875&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10812" name="0149-DDC-763.patch" size="16017" author="ccapndave" created="Tue, 21 Sep 2010 20:14:42 +0000" />
                    <attachment id="10811" name="DDC763Test.php" size="6795" author="ccapndave" created="Tue, 21 Sep 2010 19:48:39 +0000" />
                    <attachment id="10858" name="multipleaddmerge.diff" size="1161" author="ccapndave" created="Thu, 11 Nov 2010 04:49:18 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-726] DQL should deal correctly with composite primary keys</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-726</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL should deal correctly with composite primary keys:&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;SELECT u FROM User u WHERE u.CompositeAssocEntity = ?1

Should be converted to:

SELECT ... FROM users u WHERE (u.cae_id1, u.cae_id2) = (?, ?) &lt;span class=&quot;code-comment&quot;&gt;// or something similar&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It  also supports IN expressions:&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;SELECT u FROM User u WHERE u.CompositeAssocEntity IN (?1, ?2)

Should be converted to:

SELECT ... FROM users u WHERE (u.cae_id1, u.cae_id2) IN ((?, ?), (?, ?)) &lt;span class=&quot;code-comment&quot;&gt;// or something similar&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;MySQL, SQLite and PgSQL works smoothly.&lt;br/&gt;
Need to check out MSSQL, Oracle and DB2.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11696">DDC-726</key>
            <summary>DQL should deal correctly with composite primary keys</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Jul 2010 14:21:48 +0000</created>
                <updated>Tue, 4 Oct 2011 04:55:25 +0000</updated>
                                                                    <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                            <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12655">DDC-1162</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-717] Do not use files when using proxy autogeneration</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-717</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Proxy classes are generated in less than 1ms for me. I prefer to not have a &quot;build&quot; step to reducing loading time by a milisecond, so I use autogenerate.&lt;/p&gt;

&lt;p&gt;For users like me, wouldn&apos;t it be nicer if we wouldn&apos;t even have to configure a proxy dir and those files were never written (since they&apos;re not read more than once anyway)?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11676">DDC-717</key>
            <summary>Do not use files when using proxy autogeneration</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jakajancar">Jaka Jancar</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Jul 2010 17:52:55 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:47 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13668" author="jakajancar" created="Thu, 22 Jul 2010 18:32:00 +0000"  >&lt;p&gt;This very minimal patch removes the use of these temporary files:&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;--- library/Doctrine/ORM/Proxy/ProxyFactory.php	(revision 2)
+++ library/Doctrine/ORM/Proxy/ProxyFactory.php	(working copy)
@@ -78,9 +78,8 @@
         $fqn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyNamespace . &apos;\\&apos; . $proxyClassName;
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_autoGenerate &amp;amp;&amp;amp; ! class_exists($fqn, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
-            $fileName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . &apos;.php&apos;;
-            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
-            require $fileName;
+            $file = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, self::$_proxyClassTemplate);
+            eval(&apos;?&amp;gt;&apos;.$file);
         }
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getMetadataFactory()-&amp;gt;hasMetadataFor($fqn)) {
@@ -144,6 +143,9 @@
 
         $file = str_replace($placeholders, $replacements, $file);
 
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($fileName === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
+            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $file;
+
         file_put_contents($fileName, $file);
     }
 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13671" author="beberlei" created="Fri, 23 Jul 2010 03:14:30 +0000"  >&lt;p&gt;The proxy dir is used for the &quot;doctrine orm:generate-proxies&quot; command in the case of &quot;autogenerate= false&quot;, so you need to define it anyways.&lt;/p&gt;

&lt;p&gt;You have to use proxies, the option is not for Proxy yes/no. If you have autogenerate=false and doctrine requires a proxy for a use case but can&apos;t find it you will get a fatal error.&lt;/p&gt;</comment>
                    <comment id="13672" author="beberlei" created="Fri, 23 Jul 2010 03:15:54 +0000"  >&lt;p&gt;I just saw the eval() keyword, ieeks &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; It could maybe be a convenience option for those that don&apos;t want to use proxy direcotiries, however i am not sure.&lt;/p&gt;</comment>
                    <comment id="13675" author="jakajancar" created="Fri, 23 Jul 2010 03:22:32 +0000"  >&lt;p&gt;eval() is no different than writing code to a file and using require().&lt;/p&gt;

&lt;p&gt;When using runtime-generated proxies, there are no benefits (that I know of) from writing them to a file. The disadvantages are:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;slower because of write disk access&lt;/li&gt;
	&lt;li&gt;has problems with high concurrency, unless special care is taken (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-716&quot; title=&quot;Proxy autogeneration fails with concurrent requests&quot;&gt;&lt;del&gt;DDC-716&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;potentially has permission problems if code is executed by different users (e.g. nobody for a daemon and www-data for http)&lt;/li&gt;
	&lt;li&gt;requires setup of a writable directory&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is a nicer patch, which makes _generateProxyClass() return a string, just like other _generate* methods:&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;--- library/Doctrine/ORM/Proxy/ProxyFactory.php	(revision 2)
+++ library/Doctrine/ORM/Proxy/ProxyFactory.php	(working copy)
@@ -78,9 +78,8 @@
         $fqn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyNamespace . &apos;\\&apos; . $proxyClassName;
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_autoGenerate &amp;amp;&amp;amp; ! class_exists($fqn, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
-            $fileName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . &apos;.php&apos;;
-            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
-            require $fileName;
+            $code = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName);
+            eval($code);
         }
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getMetadataFactory()-&amp;gt;hasMetadataFor($fqn)) {
@@ -107,19 +106,19 @@
         foreach ($classes as $class) {
             $proxyClassName = str_replace(&apos;\\&apos;, &apos;&apos;, $class-&amp;gt;name) . &apos;Proxy&apos;;
             $proxyFileName = $proxyDir . $proxyClassName . &apos;.php&apos;;
-            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($class, $proxyClassName, $proxyFileName, self::$_proxyClassTemplate);
+            $code = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($class, $proxyClassName);
+            file_put_contents($proxyFileName, &lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;?php\n&quot;&lt;/span&gt; . $code);
         }
     }
 
     /**
      * Generates a proxy class file.
      *
-     * @param $class
-     * @param $originalClassName
+     * @param ClassMetadata $class
      * @param $proxyClassName
-     * @param $file The path of the file to write to.
+     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string The code of the generated methods.
      */
-    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _generateProxyClass($class, $proxyClassName, $fileName, $file)
+    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _generateProxyClass(ClassMetadata $class, $proxyClassName)
     {
         $methods = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateMethods($class);
         $sleepImpl = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateSleep($class);
@@ -142,9 +141,9 @@
             $methods, $sleepImpl
         );
 
-        $file = str_replace($placeholders, $replacements, $file);
+        $file = str_replace($placeholders, $replacements, self::$_proxyClassTemplate);
 
-        file_put_contents($fileName, $file);
+        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $file;
     }
 
     /**
@@ -244,8 +243,7 @@
 
     /** Proxy class code template */
     &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; $_proxyClassTemplate =
-&apos;&amp;lt;?php
-
+&apos;
 namespace &amp;lt;namespace&amp;gt;;
 
 /**
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13679" author="beberlei" created="Sat, 24 Jul 2010 06:21:53 +0000"  >&lt;p&gt;Scheduled usage of eval() for 2.1, if the following conditions exist:&lt;/p&gt;

&lt;p&gt;1. Autogenerate is set to TRUE&lt;br/&gt;
2. No Proxy Directory is configured.&lt;/p&gt;</comment>
                    <comment id="13681" author="jakajancar" created="Sat, 24 Jul 2010 06:26:14 +0000"  >&lt;p&gt;Great, this is even better. This way you can have 1) autogenerated in ram-only, 2) autogenerated in files and 3) pregenerated.&lt;/p&gt;

&lt;p&gt;And the minimal amount of config needed to get up and running is reduced, which is always nice.&lt;/p&gt;</comment>
                    <comment id="13682" author="beberlei" created="Sat, 24 Jul 2010 06:34:49 +0000"  >&lt;p&gt;you should know though, eval is dead slow. It generates the necessary proxies on EACH request and that cannot be cached in APC.&lt;/p&gt;</comment>
                    <comment id="13684" author="jakajancar" created="Sat, 24 Jul 2010 06:46:26 +0000"  >&lt;p&gt;It&apos;s no slower than current autogeneration (file_put_contents+require). TBH, I don&apos;t know why anyone would want to use that over eval(), but I don&apos;t mind it being there.&lt;/p&gt;

&lt;p&gt;Pre-generation is, of course, a different thing. Seems like a valid tradeoff to offer: build/a bit of config/better perfomance vs. no build/no config/potentially slower.&lt;/p&gt;</comment>
                    <comment id="13685" author="beberlei" created="Sat, 24 Jul 2010 07:52:39 +0000"  >&lt;p&gt;Yes, that is because file_put_contents + require is a development only strategy. The manual clearly states that autogenerate has to be false in production.&lt;/p&gt;</comment>
                    <comment id="13933" author="romanb" created="Thu, 12 Aug 2010 09:39:12 +0000"  >&lt;p&gt;Using eval() instead of producing and requiring the file in the case of enabled auto-generation of proxy classes sounds like a good improvement for 2.1 to make proxies more transparent during deveopment and for anyone for whom performance is no issue.&lt;/p&gt;

&lt;p&gt;I&apos;m increasing the priority as I think it is easy to implement for 2.1 and a good enhancement.&lt;/p&gt;</comment>
                    <comment id="15243" author="k-fish" created="Wed, 9 Feb 2011 04:09:51 +0000"  >&lt;p&gt;A note on why having the proxies written to a file can be useful even with autogenerate being on: it makes it really easy to check the proxy code being generated. I use that a lot currently.&lt;/p&gt;

&lt;p&gt;The solution suggested, giving three possibilities is cool, though.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-688] Original Entity Data gets overridden by the change set</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-688</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When changing data in an entity, the UnitOfWork will call computeChangeSet on a flush event. If there is a changeset, the original data ($this-&amp;gt;_originalEntityData) gets overridden by the new data. However, the _originalEntityData should hold the original data, that was present at the time the entity was reconstituted from the database. This does no longer hold now.&lt;/p&gt;

&lt;p&gt;I think this can simply be fixed by commenting this line, however I do not know of any consequences this may bring with it:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;_originalEntityData&lt;span class=&quot;error&quot;&gt;&amp;#91;$oid&amp;#93;&lt;/span&gt; = $actualData; (in computeChangeSet, after if( $changeSet ));&lt;/p&gt;

&lt;p&gt;Anyway, I ran into this problem while trying to retrieve the original data at the onFlush event of an update.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6; PHP 5.3.2; MySQL 5.1.44</environment>
            <key id="11618">DDC-688</key>
            <summary>Original Entity Data gets overridden by the change set</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="jasper">Jasper Kuperus</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 17:42:36 +0000</created>
                <updated>Tue, 28 Dec 2010 06:38:22 +0000</updated>
                                    <version>2.0-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13855" author="romanb" created="Sun, 8 Aug 2010 09:17:56 +0000"  >&lt;p&gt;This is actually currently expected. You can not get access to the original data in the onFlush event right now. I&apos;m not saying that this will never be possible but it is simply the way it works at the moment.&lt;/p&gt;</comment>
                    <comment id="14937" author="jasper" created="Wed, 8 Dec 2010 18:11:56 +0000"  >&lt;p&gt;Does this mean that it is currently impossible to implement a Versionable mechanism using snapshots?&lt;/p&gt;</comment>
                    <comment id="14938" author="beberlei" created="Thu, 9 Dec 2010 03:44:31 +0000"  >&lt;p&gt;You can hold a map of them yourself if your listener also implements the &quot;postLoad&quot; event:&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;$entity = $args-&amp;gt;getentity();
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;originalData[spl_object_hash($entity)] = $args-&amp;gt;getEntityManager()-&amp;gt;getUnitOfWork()-&amp;gt;getOriginalData($entity);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15041" author="beberlei" created="Tue, 28 Dec 2010 06:38:22 +0000"  >&lt;p&gt;Changed into possible improvement for the future&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-687] Add New Entity Attribute &quot;idGetter&quot; to allow accessing the ID without triggering lazy-load</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-687</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Often people present us with the use-case that they want to access the ID of a proxy without loading it.&lt;/p&gt;

&lt;p&gt;This has lead to several ugly solutions like mapping the ID to an object and as a foreign key field. There currently exists a simple solution for 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;$id = $em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($entity-&amp;gt;getRelatedProxy());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However we could add a new property here called &quot;idGetter&quot; that would take the name of a method.&lt;/p&gt;

&lt;p&gt;During Proxy Generation then this method is created with magic functionality that:&lt;/p&gt;

&lt;p&gt;1. In case of Single Primary Key returns the single value&lt;br/&gt;
2. In case of Composite Primary Key returns an array of the values in their UoW internal order&lt;br/&gt;
3. Throw an Exception if the method does not exist on the original object&lt;/p&gt;</description>
                <environment></environment>
            <key id="11617">DDC-687</key>
            <summary>Add New Entity Attribute &quot;idGetter&quot; to allow accessing the ID without triggering lazy-load</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 15:00:21 +0000</created>
                <updated>Tue, 25 Jan 2011 08:23:14 +0000</updated>
                                    <version>2.0-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15183" author="stefanklug" created="Tue, 25 Jan 2011 07:26:53 +0000"  >&lt;p&gt;What about an @IdGetter annotation. A function instrumented like this would not trigger the lazy load within the proxy.&lt;/p&gt;

&lt;p&gt;Something like&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 Entity {
    /** @Id **/
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

    /** @IdGetter **/
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
       &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;id;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;would then result in the proxy implementation&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 EntityProxy &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Entity {
  
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;__isInitialized__) {
            &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;_identifier;
         } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
             &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parent::getId();
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;After reading the original post I realized that it proposed nearly the same thing. Nevertheless I&apos;ll leave it here for clarity. I still think that an annotation on a function would be better, than an annotation which gets the function name as a parameter.&lt;/p&gt;

&lt;p&gt;Regards Stefan&lt;/p&gt;</comment>
                    <comment id="15184" author="beberlei" created="Tue, 25 Jan 2011 08:23:14 +0000"  >&lt;p&gt;$this-&amp;gt;_identifier is an array.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-683] EntityManager#lock() on unitialized proxy coudl be optimized</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-683</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you call lock() on an unitiialized proxy, it would be possible to combine the fetch and lock in one operation. Is this feasible from a technical / workflow perspsective?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11611">DDC-683</key>
            <summary>EntityManager#lock() on unitialized proxy coudl be optimized</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 17:57:37 +0000</created>
                <updated>Wed, 21 Jul 2010 17:33:56 +0000</updated>
                                    <version>2.0-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13651" author="beberlei" created="Wed, 21 Jul 2010 17:33:56 +0000"  >&lt;p&gt;Ok this is what refresh() with LOCK support is actually needed for:&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;public&lt;/span&gt; function lock($entity, $lockMode, $lockVersion = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getEntityState($entity) != self::STATE_MANAGED) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; InvalidArgumentException(&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity is not MANAGED.&quot;&lt;/span&gt;);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($entity &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy &amp;amp;&amp;amp; $entity-&amp;gt;__isInitialized__) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;refresh(....); &lt;span class=&quot;code-comment&quot;&gt;// with LOCK!
&lt;/span&gt;        }
        ...
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11609">DDC-681</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-682] ORACLE CHARSET DOCUMENTATION</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-682</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Openning an Oracle Database with Doctrine and Symfony doesn&apos;t  support by default utf8 charset.&lt;/p&gt;

&lt;p&gt;To support it, it is necessary to specify charset=AL32UTF8 in the dsn of the database in config/databases.yml.  Analogous to the example shown at&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/d0d22145d8bdc83&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/d0d22145d8bdc83&lt;/a&gt;&lt;br/&gt;
however we have been able to use it fully only with the oracle driver (instead of oci), for example:&lt;/p&gt;

&lt;p&gt;oracle:dbname=//192.168.2.9:1521/nomina_dev;charset=AL32UTF8 &lt;/p&gt;

&lt;p&gt;Documentation by Alexia Vel&#225;squez (alexia.velasquez@hotmail.es, Vladimir T&#224;mara (vtamara@pasosdeJesus.org) and Fernando Guerrero &lt;/p&gt;</description>
                <environment>ORACLE  db  SYMFONY </environment>
            <key id="11610">DDC-682</key>
            <summary>ORACLE CHARSET DOCUMENTATION</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 13:55:31 +0000</created>
                <updated>Sat, 10 Jul 2010 13:55:31 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-678] OneToMany/OneToOne + onDelete=CASCADE may corrupt UoW.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-678</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;OneToMany/OneToOne associations together with an onDelete=CASCADE schema generation hint on the @JoinColumn and appropriate foreign key constraints can potentially result in a corrupt UoW if the associated objects are already managed. We need to add tests for such scenarios and settle on a well-defined behavior in such cases.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11606">DDC-678</key>
            <summary>OneToMany/OneToOne + onDelete=CASCADE may corrupt UoW.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 07:07:01 +0000</created>
                <updated>Sun, 5 Jun 2011 15:15:44 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14646" author="beberlei" created="Sun, 31 Oct 2010 07:18:22 +0000"  >&lt;p&gt;I think to preserve the semantics the following has to happen:&lt;/p&gt;

&lt;p&gt;&quot;on-delete&quot; =&amp;gt; &quot;cascade&quot; has to implicitly set cascade = remove. This hurts performance of course vs just using the on-delete, however it won&apos;t corrupt the UoW.&lt;/p&gt;</comment>
                    <comment id="15093" author="beberlei" created="Sun, 2 Jan 2011 05:21:14 +0000"  >&lt;p&gt;Not entirely would it hurt performance, you could check if on-delete =&amp;gt; cascade is set. If this is the case you wouldnt need to do an explicit remove using the UnitOfWorks cascade.&lt;/p&gt;</comment>
                    <comment id="15944" author="beberlei" created="Sun, 5 Jun 2011 15:15:44 +0000"  >&lt;p&gt;Changed to improvement&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-676] Find a way to test serialize/unserialize of all ClassMetadata properties in isolation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-676</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should find a way, using PHPUnit Data Providers or anything else, to check the serialize/unserialize of every property in the ClassMetadata instance, since errors here can be very subtle but dangerous.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11604">DDC-676</key>
            <summary>Find a way to test serialize/unserialize of all ClassMetadata properties in isolation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 05:26:20 +0000</created>
                <updated>Sun, 29 Aug 2010 05:05:50 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-668] add upsert support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-668</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Didnt find anything in the docs on this. Is D2 capable of doing an UPSERT &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; in case I am trying to persist an object that may or may not have been saved previously. Different RDBMS support different syntax for this case. Like MySQL has INSERT .. ON DUPLICATE KEY UPDATE (or even INSERT IGNORE) while the SQL standard defines a MERGE syntax which seems to be gaining support. Of course you can always fallback to a SELECT FOR UPDATE (or if you want to be hacky an INSERT which catches duplicate key violations .. but probably not a good idea since many RDBMS rollback on a failure inside a transaction).&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Upsert&quot; class=&quot;external-link&quot;&gt;http://en.wikipedia.org/wiki/Upsert&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See also &lt;a href=&quot;http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011&quot; class=&quot;external-link&quot;&gt;http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011&lt;/a&gt; asking for MERGE support&lt;/p&gt;

&lt;p&gt;Ideally there would be a way to define on a model or model instance level if merge logic should be applied.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11585">DDC-668</key>
            <summary>add upsert support</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="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Jul 2010 17:20:19 +0000</created>
                <updated>Tue, 20 Dec 2011 22:22:01 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="13543" author="robertb" created="Fri, 9 Jul 2010 01:16:50 +0000"  >&lt;p&gt;Doctrine_Record defines a replace() method. &lt;/p&gt;

&lt;p&gt;In the MySQL Doctrine implementation, however, it is not the same as INSERT .. ON DUPLICATE KEY UPDATE. The replace() method implemented in Doctrine_Connection_Mysql uses the REPLACE INTO syntax, which is a DELETE and then INSERT when the key exists. This is fine, except for tables that use auto-increment fields. The delete-then-insert operation yields a new auto-incremented value, whereas INSERT .. ON DUPLICTATE KEY UPDATE would not.&lt;/p&gt;</comment>
                    <comment id="13544" author="lsmith" created="Fri, 9 Jul 2010 02:34:53 +0000"  >&lt;p&gt;MySQL (and SQLite) REPLACE is a no go. It causes way too much disc I/O and worse yet totally screws up the on disk data structures because of the deleting.&lt;/p&gt;</comment>
                    <comment id="16238" author="beberlei" created="Sun, 31 Jul 2011 08:48:13 +0000"  >&lt;p&gt;Scheduled for 2.2&lt;/p&gt;</comment>
                    <comment id="16239" author="beberlei" created="Sun, 31 Jul 2011 09:09:56 +0000"  >&lt;p&gt;Evaluating this makes me sad, except MySQL support for this is rather non-existant, and the oracle merge is aiming at batch operations.&lt;/p&gt;</comment>
                    <comment id="16681" author="beberlei" created="Sat, 22 Oct 2011 11:08:32 +0000"  >&lt;p&gt;Should this be done with&lt;/p&gt;

&lt;p&gt;1. Select first, then insert&lt;br/&gt;
2. Catch and evaluate exception then update&lt;/p&gt;

&lt;p&gt;I am leaning towards 1.&lt;/p&gt;</comment>
                    <comment id="17074" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:01 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-667] Lock Timeout Query Hint for DQL Queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-667</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;After the implementation of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-178&quot; title=&quot;Query Hint for LOCK mechanisms plus support in $em-&amp;gt;find()&quot;&gt;&lt;del&gt;DDC-178&lt;/del&gt;&lt;/a&gt; there is now only outstanding the support for locking queries based on a given timeout.&lt;/p&gt;

&lt;p&gt;This will be a DQL query feature only and be available via a query hint:&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;$query-&amp;gt;setHint(Query::LOCK_TIMEOUT, $timeoutMs);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It will be only working on Oracle.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11583">DDC-667</key>
            <summary>Lock Timeout Query Hint for DQL Queries</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Jul 2010 08:40:43 +0000</created>
                <updated>Thu, 16 Sep 2010 15:20:18 +0000</updated>
                                    <version>2.0-BETA2</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14157" author="romanb" created="Mon, 30 Aug 2010 06:32:49 +0000"  >&lt;p&gt;If this is to be implemented for 2.0, it needs to happen for RC1, therefore rescheduling to RC1. Feel free to reschedule to 2.x if necessary.&lt;/p&gt;</comment>
                    <comment id="14407" author="beberlei" created="Thu, 16 Sep 2010 15:20:18 +0000"  >&lt;p&gt;Only oracle supports lock timeouts and no other vendor seems to plan to support it. I move to 2.x, but i guess this would rather be an issue of user extension.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-658] Reverse engineering with Oracle (DBDriver and Associations as Identifier)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-658</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am playing with reverse engineering with Oracle and I have some problems:&lt;/p&gt;

&lt;p&gt;My schema:&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;drop table PHONE_NUMBER;
drop table CUSTOMER;

create table CUSTOMER (
   CUSTOMER_ID             NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   CUSTOMER_LASTNAME       VARCHAR2(50)                    not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   CUSTOMER_MODIFIED       DATE,
   constraint PK_CUSTOMER primary key (CUSTOMER_ID)
         using index
       tablespace TBS_INDEX
       storage
       (
           initial 100K
           next 100K
       )
)
storage
(
    initial 100K
    next 100K
)
tablespace TBS_DATA;

create table PHONE_NUMBER (
   PHONE_NUMBER_ID         NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   CUSTOMER_ID             NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   PHONE_NUMBER            VARCHAR2(50)                    not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   PHONE_NUMBERMODIFIED    DATE,
   constraint PK_PHONE_NUMBER primary key (PHONE_NUMBER_ID, CUSTOMER_ID)
         using index
       tablespace TBS_INDEX
       storage
       (
           initial 100K
           next 100K
       )
)
storage
(
    initial 100K
    next 100K
)
tablespace TBS_DATA;

alter table PHONE_NUMBER
   add constraint PHONE_NUMBER__CUSTOMER foreign key (CUSTOMER_ID)
      references CUSTOMER (CUSTOMER_ID);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I obtain &quot;Fatal error: Uncaught exception &apos;Doctrine\ORM\Mapping\MappingException&apos; with message &apos;Property &quot;customerId&quot; in &quot;PhoneNumber&quot; was already declared, but it must be declared only once&apos;&quot;&lt;/p&gt;

&lt;p&gt;It&apos;s because a foreign key is a component of the primary key.&lt;/p&gt;</description>
                <environment>Ubuntu 10.04 + Oracle 11g Entreprise + PHP 5.3.2 + Doctrine2 Git (up-to-date) </environment>
            <key id="11559">DDC-658</key>
            <summary>Reverse engineering with Oracle (DBDriver and Associations as Identifier)</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10344">DDC-117</parent>
                        <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="mikaelkael">Mickael Perraud</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Jun 2010 10:48:25 +0000</created>
                <updated>Sun, 11 Dec 2011 05:39:00 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13435" author="mikaelkael" created="Mon, 28 Jun 2010 04:44:25 +0000"  >&lt;p&gt;This is the continuation of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-616&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-616&lt;/a&gt;. Only the schema is different.&lt;/p&gt;</comment>
                    <comment id="13436" author="beberlei" created="Mon, 28 Jun 2010 04:52:22 +0000"  >&lt;p&gt;just for understanding this scenario:&lt;/p&gt;

&lt;p&gt;Is this a One-To-One relation and the TABLE_TEST2 &quot;inherits&quot; the primary key from its parent TABLE_TEST1?&lt;/p&gt;

&lt;p&gt;If yes, this construct is not yet supported by Doctrine 2, we still need to include an ID-Generator that supports this kind of schema.&lt;/p&gt;</comment>
                    <comment id="13437" author="mikaelkael" created="Mon, 28 Jun 2010 05:42:41 +0000"  >&lt;p&gt;Change for a more understandable use case. Note that it&apos;s not my real use case and that I work on legacy database on which I can&apos;t change the structure.&lt;/p&gt;</comment>
                    <comment id="15083" author="beberlei" created="Sat, 1 Jan 2011 15:50:02 +0000"  >&lt;p&gt;updated the issue topic to get a better grasp of what needs to be done here.&lt;/p&gt;</comment>
                    <comment id="15966" author="waldo2188" created="Thu, 9 Jun 2011 14:26:50 +0000"  >&lt;p&gt;I have the same error with Mysql whit the same condition.&lt;/p&gt;</comment>
                    <comment id="16923" author="beberlei" created="Mon, 28 Nov 2011 12:11:09 +0000"  >&lt;p&gt;More details on the work to be done:&lt;/p&gt;

&lt;p&gt;The relevant code is in Doctrine/ORM/Mapping/Driver/DatabaseDriver.php only.&lt;/p&gt;

&lt;p&gt;The idea is currently many-to-many tables are detected by checking that the table has foreign keys on all the primary key columns (no additional columns!)&lt;/p&gt;

&lt;p&gt;Now with the 2.1 feature of foreign key/primary key entities this is not necessarily true anymore. You can have the primary keys being foreign keys BUT have additional columns that are not part of the primary key. This has to be detected.&lt;/p&gt;

&lt;p&gt;If a foreign key-primary-key entity is found that has additional columns a ClassMetadata has to be created and the associations have to be created with the &quot;id&quot; =&amp;gt; true flag in mapManyToOne().&lt;/p&gt;</comment>
                    <comment id="16962" author="scott459" created="Sun, 11 Dec 2011 05:39:00 +0000"  >&lt;p&gt;For what it&apos;s worth, I&apos;m getting this error when I have a PK that is a single column and not a FK.&lt;/p&gt;

&lt;p&gt;  PRIMARY KEY (`id`),&lt;br/&gt;
  UNIQUE KEY `cycle_station_id` (`cycle`,`station_id`),&lt;br/&gt;
  KEY `station_id_idx` (`station_id`),&lt;br/&gt;
  KEY `readings` (`readings`),&lt;br/&gt;
  KEY `source` (`source`),&lt;br/&gt;
  KEY `temperature_min_max` (`temperature_max`,`temperature_min`),&lt;br/&gt;
  KEY `station_id_cycle` (`station_id`,`cycle`,`updated_at`),&lt;br/&gt;
  CONSTRAINT `compiled_1_station_id_stations_id` FOREIGN KEY (`station_id`) REFERENCES `stations` (`id`),&lt;br/&gt;
  CONSTRAINT `compiled_1_station_id_stations_id_1` FOREIGN KEY (`station_id`) REFERENCES `stations` (`id`) ON DELETE CASCADE&lt;br/&gt;
) ENGINE=InnoDB AUTO_INCREMENT=160833690 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-624] Partial object query that leaves out an association to avoid loading it fetches the association anyway.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-624</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Assuming:&lt;/p&gt;

&lt;p&gt;Customer &amp;lt;onetoone&amp;gt; Cart&lt;/p&gt;

&lt;p&gt;where Cart is the owning side.&lt;/p&gt;

&lt;p&gt;Since the association from Customer to Cart can not be lazy, it would make sense to leave out the association in a query to avoid loading the carts 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;select partial c.{id,name, ... anything except cart} from Customer c&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But this is ignored and the carts of all customers are fetched anyway. Query::HINT_FORCE_PARTIAL_LOAD is an alternative solution, however it has the disadvantage that it disables lazy-loading for &lt;b&gt;all&lt;/b&gt; queried objects. If partial querying would honor associations this would allow more fine-grained control.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11442">DDC-624</key>
            <summary>Partial object query that leaves out an association to avoid loading it fetches the association anyway.</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="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="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Jun 2010 12:13:06 +0000</created>
                <updated>Fri, 11 Nov 2011 09:28:13 +0000</updated>
                                    <version>2.0-BETA1</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="14085" author="romanb" created="Thu, 26 Aug 2010 08:06:33 +0000"  >&lt;p&gt;Might need to be pushed back to a 2.0.x / 2.x.x bugfix release. Not clear yet.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="13141">DDC-1465</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-586] Repo does not find &quot;unflushed&quot; object</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-586</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The problem is this:&lt;/p&gt;

&lt;p&gt;$bar = new \entity\content\ContentTag();&lt;br/&gt;
$bar-&amp;gt;setName(&apos;bar&apos;);&lt;br/&gt;
$em-&amp;gt;persist($bar);&lt;/p&gt;

&lt;p&gt;$existingTag = $em-&amp;gt;getRepository(&apos;entity\content\ContentTag&apos;)-&amp;gt;findOneByName(&apos;bar&apos;);&lt;/p&gt;

&lt;p&gt;Seeing as in EntityRepository &quot;find()&quot; queries the Unit of Work first, and &quot;findBy()&quot; goes directly to the persister, only remotely stored objects will be found. Now if I want a tag object to attach related tags, it would have to query by name to see if an object already exist, BUT it wont find one as the UoW has not been committed, resulting in a new one being created, ultimately resulting in a PDO error on the unique name constraint.&lt;/p&gt;

&lt;p&gt;This can be &quot;solved&quot; by inserting a flush, but it is impossible to know whether a flush is required, without knowledge of what comes next. I.e. for one part to know it has to flush, it has to know another wants to fetch an object you just created.&lt;/p&gt;

&lt;p&gt;This causes an unacceptable amount of coupling.&lt;/p&gt;

&lt;p&gt;Somehow the repo will have to be able execute DQL against the objects in the UoW.  This does not have to be full support (straight away), but it should fail (throw an exception) if the possibility exists that the UoW contains items that are excluded (e.g. the operation is not supported and the UoW still contains items).&lt;/p&gt;

&lt;p&gt;For right now, this means the EntityManager should throw an exception if DQL is executed on the type when the UoW is not empty. Until the time that the EntityManager can query the UoW using DQL. The alternative would be to &quot;flush&quot; before every operation that goes to the database for data.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11358">DDC-586</key>
            <summary>Repo does not find &quot;unflushed&quot; object</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="jkleijn">John Kleijn</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 May 2010 05:04:34 +0000</created>
                <updated>Thu, 26 Aug 2010 08:01:27 +0000</updated>
                                    <version>2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12946" author="romanb" created="Fri, 14 May 2010 07:04:31 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;you mention a good point, however, this currently only affects findBy queries made through a repository. A DQL query already triggers a flush when there are pending insertions but this still has its own problems. First of, querying against the objects in the UoW is not a viable solution in my eyes.&lt;/p&gt;

&lt;p&gt;For a regular find() (by identifier) the situation is clear anyway, you &lt;b&gt;must&lt;/b&gt; flush prior to a lookup on an entity you previously persisted in the same request because, by definition, generated primary key values are only guaranteed to be available after the next flush.&lt;/p&gt;

&lt;p&gt;Automatic flushing if the UoW has pending inserts (new objects) and a query is executed (either through DQL or a repository) currently has its own set of problems, namely that it is still subject to infinite recursion if such a query is triggered in an event (listener) that executes during commit of a UoW, and secondly, that it will easily lead to double-flushes that cause unnecessary overhead (currently a flush() even if nothing needs to be done is not free because the UoW actually has to check whether nothing needs to be done). Both of these problems could be addressed with some sort of flags, but the question still is whether its not better to flush manually in the first place.&lt;br/&gt;
That would mean, in your example, you should flush after persisting the new objects, irrespectively of what code comes next, you persisted (a) new object(s) and you want to make sure these are fully available to the rest of the script.&lt;/p&gt;</comment>
                    <comment id="12947" author="romanb" created="Fri, 14 May 2010 07:13:00 +0000"  >&lt;p&gt;Furthermore, automatic flushing when there is no transaction active is probably also not a great idea, as it may split a single unit of work (that was supposed to be atomic) into 2 without the user knowing about it. So auto-flushing should better only happen when a transaction is active (i.e. explicit transaction demarcation is used).&lt;/p&gt;</comment>
                    <comment id="12948" author="jkleijn" created="Fri, 14 May 2010 07:27:40 +0000"  >&lt;p&gt;That would mean, in every example, you should flush after persisting new objects, period. If I flush in some cases and not in others, I&apos;m asking for issues that may not be caught by tests. It&apos;s an inconsistency that I personally am not comfortable with.&lt;/p&gt;

&lt;p&gt;Could be that I&apos;m overlooking something, I&apos;ve just started playing with D2.&lt;/p&gt;

&lt;p&gt;Why is querying against registered objects not viable? It&apos;s not easy, granted, but it doesn&apos;t seem impossible. There should probably be a layer between the UoW and the &quot;persisters&quot; (Data Mappers?).&lt;/p&gt;

&lt;p&gt;RE: the UoW double flush: state management on the UoW as a whole should prevent that. i.e. after a commit the whole UoW is clean? Just a suggestion, as I said, still getting my bearings.&lt;/p&gt;

&lt;p&gt;On a side note I just want to say that what I&apos;ve seen so far, for the better part, pleases me greatly. Kudos.&lt;/p&gt;</comment>
                    <comment id="12949" author="romanb" created="Fri, 14 May 2010 08:16:03 +0000"  >&lt;p&gt;@&quot;That would mean, in every example, you should flush after persisting new objects, period.&quot;&lt;/p&gt;

&lt;p&gt;Yes, if you want the objects to be visible to queries in the same request. Generally, you should flush when you complete a unit of work and that is usually not the whole request (but can be).&lt;/p&gt;

&lt;p&gt;I don&apos;t want to &quot;query&quot; against registered objects because it is a) not easy b) likely a lot of code and c) very likely error-prone. And in addition I don&apos;t see this helping with solving any inconsistency. If you want to use find() you have to flush anyway because you can not find() without having the identifier in the first place, which is only available after a flush.&lt;/p&gt;

&lt;p&gt;@RE: the UoW double flush:&lt;/p&gt;

&lt;p&gt;Yes, like I said, it can be done but it is a compromise. Having a &quot;clean/dirty&quot; flag &lt;b&gt;in addition&lt;/b&gt; to calculating the changesets of the work to do (which implicitly tells us whether the UoW is dirty) adds more code and more potential for errors. Forget to update the flag in one location and you get flushes that don&apos;t do anything, because the flag was not updated. A dirty-flag for the UoW is not really required for proper working. It is similar to the approach of maintaining a separate counter for the number of elements in a collection implementation: can make many size/count requests faster but complicates the internal implementation and increases the likelihood for errors (and lock contention for the counter in a thread-safe/concurrent implementation, an interesting case where performance goes against scalability, but I digress and that does not apply to php obviously). That said, I am not strongly opposed to doing this.&lt;/p&gt;

&lt;p&gt;If you&apos;re interested in how this is specified by &quot;big brother&quot;, take a look at section 3.8.7 of the JPA 2 specification. Shortly, with the default behavior it requires the implementation to ensure that unflushed changes are visible to queries which can be achieved by flushing these to the database automatically but &lt;b&gt;only&lt;/b&gt; if a transaction is active, otherwise the implementation must not flush to the database. There is alternatively also a &quot;MANUAL&quot; flush mode, in that case the effect of updates made to entities in the UoW upon queries is unspecified. We do not have different flush modes anymore, however, in Doctrine.&lt;/p&gt;

&lt;p&gt;So I see two possible ways to go here:&lt;/p&gt;

&lt;p&gt;1) More effort, more code, (really better?)&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Maintaining a dirty flag in the UoW (this could be done anyway at some point, even if 2) is chosen)&lt;/li&gt;
	&lt;li&gt;Maintaining a flag to avoid infinite recursion triggered from events within a UoW commit/flush&lt;/li&gt;
	&lt;li&gt;Flushing automatically when querying while there are pending inserts &lt;b&gt;and a transaction is active&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;2) No effort, less code&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Removing the current auto-flush on DQL queries which is still subject to infinite recursion&lt;/li&gt;
	&lt;li&gt;No automatic flushes, anywhere (less magic, so to speak?)&lt;/li&gt;
	&lt;li&gt;Clearly documenting that new, unflushed entities are not visible in subsequent queries issued in the same request, and if this is desired, a flush should be issued.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;That&apos;s how I see it. Now we need some votes and volunteers for the implementation &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; Personally, I am not sure yet about which version I prefer, 2) does not sound too bad for me.&lt;/p&gt;
</comment>
                    <comment id="12950" author="romanb" created="Fri, 14 May 2010 08:20:18 +0000"  >&lt;p&gt;In Nr. 1) the case with the infinite recursion may actually be more problematic. I think you simply &lt;b&gt;can not see&lt;/b&gt; unflushed new objects in queries made &lt;b&gt;during&lt;/b&gt; a UoW commit.&lt;/p&gt;</comment>
                    <comment id="12956" author="jkleijn" created="Fri, 14 May 2010 10:47:17 +0000"  >&lt;p&gt;When there&apos;s no in-memory objects inclusion, I&apos;d say 2) as well. Again, I have no idea how this is implemented currently, but I would prefer something like this:&lt;/p&gt;

&lt;p&gt;$repo-&amp;gt;start();&lt;/p&gt;

&lt;p&gt;$repo-&amp;gt;register($object);&lt;/p&gt;

&lt;p&gt;$repo-&amp;gt;commit();&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Commit instead of flush: &quot;flush&quot; has little semantic value IMO, &quot;commit&quot; leaves no questions: you&apos;re committing your changes (which implies that they are not, before)&lt;/li&gt;
	&lt;li&gt;Operating on the repo leaves no question to what you are committing: changes of the associated type and relations configured to cascade, made after start()&lt;/li&gt;
	&lt;li&gt;Register instead of persist: &quot;persist&quot; is misleading as the object is not immediately persisted, and as my example shows, may not be.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The way I see it &quot;start&quot; would create a UoW associated with the repo, &quot;commit&quot; would calculate changes and write (the enitity manager would make sure references in other UoWs are removed).&lt;/p&gt;

&lt;p&gt;Because the way it is currently implemented (or so it seems), it&apos;s unclear when to flush and when not to flush, and unclear what I&apos;m flushing at any one point in the code (because it is not locally isolated). If I have to decide whether to flush in some bit of client code, I am apparently making an assumption about the target entity, i.e. coupling.&lt;/p&gt;

&lt;p&gt;I know, you already went beta, so it&apos;s unlikely you would consider such a large change, but anyway, for your consideration.&lt;/p&gt;

&lt;p&gt;Finally, I realize I&apos;m borderline nagging now as you&apos;ve made it clear you see nothing it, but a Repository (as in the PoEAA pattern, p 322) may provide a method of fetching native in-memory objects using criteria, acting as a &quot;buffer&quot; between code and database. The Repository in D2 does effectively nothing but delegate to the UoW (or mostly to the underlying persister). Ref PoEAA 327 for an example of an in-memory strategy. As a final point of critique, the Repository does not always seem to be used as entry point for data requests, which is the whole point of the pattern. Most of what&apos;s in EntityManager, should be in EntityRepository (&quot;manager&quot; is a bit to abstract a concept to expect clear responsibilities anyway). EntityManager::find() delegates to EntityRepository, but pretty much everything else is the other way around. EntityManager would be better off named DataGateway, as that accurately describes its intended function.&lt;/p&gt;

&lt;p&gt;I admit, it would be very difficult to use DQL on in memory objects, but it would be far superior and if it work lead to much more predictable behaviour. It&apos;s the ONLY way the data store is ever going to be truly transparent. A few examples (DQL from the docs):&lt;/p&gt;

&lt;p&gt;SELECT &lt;br/&gt;
u, &lt;br/&gt;
UPPER(u.name) nameUpper &lt;br/&gt;
FROM MyProject\Model\User u&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Fetch everything from the db&lt;/li&gt;
	&lt;li&gt;Select all objects from the User UoW&lt;/li&gt;
	&lt;li&gt;Iterate over the in memory ones and &lt;b&gt;modify&lt;/b&gt; the name property to upper case&lt;/li&gt;
	&lt;li&gt;Merge the results and return&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;SELECT u FROM User u WHERE u.id = ?1 OR u.nickname LIKE ?2 ORDER BY u.surname DESC&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Execute against database&lt;/li&gt;
	&lt;li&gt;Iterate over the User UoW, indexing by &quot;surname&quot;, adding items that match the criteria&lt;/li&gt;
	&lt;li&gt;Merge the results and return&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;With joins it could get more complex, provided you want to intelligently merge results into existing objects. Question is whether that is really needed, but there&apos;s obviously a performance benefit. Actually this may already be implemented.&lt;/p&gt;

&lt;p&gt;I suspect there are edge cases, rooted in DQL still being based on SQL, but in theory it should be possible. Likely you would still want to do start(), and delegate to the driver to start an actual transaction to prevent inconsistent reads... The only way to find out if it&apos;s truly feasible is to to try it, I think.&lt;/p&gt;

&lt;p&gt;Ramble, ramble, ramble, I&apos;m done. &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; I know I seem critical, but it&apos;s positive critique, I love the direction you went with D2.&lt;/p&gt;</comment>
                    <comment id="12957" author="romanb" created="Fri, 14 May 2010 11:26:45 +0000"  >&lt;p&gt;Maybe I was not clear, with approach Nr.1 there would be in-memory objects inclusion (of new objects), in fact, there always is, due to the identity map. When you query for objects and some of them are already in memory, these are used, not again reconstructed.&lt;/p&gt;

&lt;p&gt;The EntityRepository provided by Doctrine is just a convenient mechanism for writing your own repositories. There are many different understandings for what a repository is, you can make it whatever you want it to be. Is a PoEAA repository the same as a DDD repository? Anyway, the repository could be stripped of the project, it is optional, the state management is handled by the EntityManager and UnitOfWork. These are the core components. I agree that the delegation from EntityManager#find to the repository is suboptimal in this regard and should be the other way around.&lt;/p&gt;

&lt;p&gt;Now to your question: &quot;When should I flush?&quot;. Generally, you should flush at the end of a transaction, which in turn is a unit of work. That means, use explicit transaction demarcation. begin() ... flush() commit(). I&apos;ve added some control abstractions recently that should make this even easier. I can only recommend to explicitly demarcate your transaction boundaries. As you probably know, you can not talk to your database outside of a transaction anyway. The default behavior (flush() wrapping all its stuff in a transaction) is for convenience mostly and so as not to alienate or confuse people even more who are used to autocommit mode.&lt;/p&gt;

&lt;p&gt;Concerning the naming, we mostly stick with the JPA specification and I, for one, really like the naming and I don&apos;t want to invent new names. PoEAA is far more abstract (and the examples far too specific) than what is specified in JPA, so I recommend giving that a read. The patterns in PoEAA obviously and intentionally leave a lot of room for different variants of implementation and also leave open a lot of open questions (many of the difficult questions especially, it is for a reason that the author recommends using an existing tool instead of writing your own). In my opinion it is just not feasible to query in-memory objects in a generic way, all the examples in PoEAA do not have generic but rather concrete code examples, which is obviously a lot easier. The feasible strategy, and that is what we do, is to do in-memory lookups only when querying by PK, otherwise the query is executed and afterwards nevertheless any objects reused that are already in memory (based on the PK) and not reconstructed. This is the approach we use.&lt;/p&gt;

&lt;p&gt;Thanks for your input, I do see that you are an experienced fellow in object-relational persistence, maybe we can see you as a committer some day? &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>
                    <comment id="12958" author="romanb" created="Fri, 14 May 2010 11:35:43 +0000"  >&lt;p&gt;@ &quot;SELECT u, UPPER(u.name) nameUpper FROM MyProject\Model\User u&quot;&lt;/p&gt;

&lt;p&gt;This selects all users and their names in uppercase, the uppercase names are scalar values, the users are not modified! Scalar values are separate from objects.&lt;/p&gt;

&lt;p&gt;@ &quot;... and unclear what I&apos;m flushing at any one point in the code&quot;&lt;/p&gt;

&lt;p&gt;flush() means: Synchronize the in-memory state of my objects with the database, making any changes that are only in-memory persistent. Nothing more, nothing less.&lt;/p&gt;

&lt;p&gt;Again, objects are always reused based on the identity map and the state that is in-memory prevails, unless you use refresh() or execute a query with the Query::HINT_REFRESH query hint. All objects you fetch from DQL, be it as a root object or as a joined association, are first looked up in-memory (but after the SQL query has been issued!).&lt;/p&gt;

&lt;p&gt;Maybe we have been talking past each other here, what I refer to as not feasible is querying the in-memory objects first in some way, even before the SQL query. This is just too complicated and error-prone, except for the simple case of a PK lookup and that is where we do it already.&lt;/p&gt;</comment>
                    <comment id="12959" author="jkleijn" created="Fri, 14 May 2010 12:11:07 +0000"  >&lt;p&gt;&amp;gt; Scalar values are separate from objects.&lt;/p&gt;

&lt;p&gt;Right. Bad example.&lt;/p&gt;

&lt;p&gt;&amp;gt; flush() means: Synchronize the in-memory state of my objects with the database, making any changes that are only in-memory persistent. Nothing more, nothing less.&lt;/p&gt;

&lt;p&gt;I realize that it means that, but commit() would be more obvious.&lt;/p&gt;

&lt;p&gt;&amp;gt; Maybe we have been talking past each other here, what I refer to as not feasible is querying the in-memory objects first in some way, even before the SQL query. This is just too complicated and error-prone, except for the simple case of a PK lookup and that is where we do it already.&lt;/p&gt;

&lt;p&gt;Fair enough, you don&apos;t think it&apos;s feasible, so we&apos;ll keep it at that. Maybe I&apos;ll give it a shot some time.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-585] Create a coding standards document</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-585</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We need a new coding standards document for Doctrine 2.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11353">DDC-585</key>
            <summary>Create a coding standards document</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 May 2010 06:42:33 +0000</created>
                <updated>Mon, 11 Feb 2013 17:04:20 +0000</updated>
                                                    <fixVersion>2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19435" author="benjamin" created="Tue, 29 Jan 2013 13:12:04 +0000"  >&lt;p&gt;Has there been any work on a coding standards document yet?&lt;br/&gt;
I&apos;m currently working on fixing documentation on this project, and it might be a good time to define a standard.&lt;br/&gt;
I&apos;ve started compiling a few recommendations based on various feedbacks I&apos;ve got in my pull requests, and I can post them here.&lt;br/&gt;
Please let me know if there have been previous attempts so far!&lt;/p&gt;</comment>
                    <comment id="19436" author="ocramius" created="Tue, 29 Jan 2013 13:20:58 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=benjamin&quot; class=&quot;user-hover&quot; rel=&quot;benjamin&quot;&gt;Benjamin Morel&lt;/a&gt; &lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=guiblanco&quot; class=&quot;user-hover&quot; rel=&quot;guiblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; may have a CS ruleset, but it&apos;s not ready yet. Perfect timing btw, we really need to automate this to avoid having all these useless CS fix comments in pull requests&lt;/p&gt;</comment>
                    <comment id="19437" author="benjamin" created="Tue, 29 Jan 2013 14:00:43 +0000"  >&lt;p&gt;Ok, I&apos;ll post my document here once ready, and &lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=guiblanco&quot; class=&quot;user-hover&quot; rel=&quot;guiblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; will be able to compare it with his ruleset!&lt;/p&gt;</comment>
                    <comment id="19443" author="benjamin" created="Wed, 30 Jan 2013 20:35:35 +0000"  >&lt;p&gt;Here is a first draft: &lt;a href=&quot;https://gist.github.com/4676670&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/4676670&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please comment!&lt;/p&gt;</comment>
                    <comment id="19531" author="benjamin" created="Mon, 11 Feb 2013 17:03:41 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=guiblanco&quot; class=&quot;user-hover&quot; rel=&quot;guiblanco&quot;&gt;Guilherme Blanco&lt;/a&gt;, if you don&apos;t have time to compare your ruleset with my draft, maybe you could publish your current ruleset so that others can have a look?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-536] Remove the _ prefix from private and protected members</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-536</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The reasoning is simple: The prefix &quot;_&quot; is usually either used for easier distinction of instance variables from other, i.e. local variables, instead of always using &quot;this.&quot; (often seen in C#), or it is used to signal that a member is not meant to be accessed from outside of the class when the language does not have visibility modifiers (PHP4).&lt;/p&gt;

&lt;p&gt;Since you always have to use &quot;$this-&amp;gt;&quot; in PHP5+ when accessing instance members and there are visibility modifiers, the &quot;_&quot; is largely superfluous and just makes the verbose OO code even more verbose.&lt;/p&gt;

&lt;p&gt;Maybe the following find/replace steps will do the job almost completely:&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-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_&quot;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $&quot;&lt;/span&gt;
&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_&quot;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $&quot;&lt;/span&gt;
&lt;span class=&quot;code-quote&quot;&gt;&quot;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_&quot;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11261">DDC-536</key>
            <summary>Remove the _ prefix from private and protected members</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Apr 2010 09:26:24 +0000</created>
                <updated>Fri, 19 Nov 2010 00:00:39 +0000</updated>
                                                    <fixVersion>2.0</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12761" author="beberlei" created="Tue, 27 Apr 2010 05:50:39 +0000"  >&lt;p&gt;i just found a possible BC issue with this.&lt;/p&gt;

&lt;p&gt;EntityRepository is allowed to be extended by us, it has several variables that are underscore prefixed. How to proceed in this case?&lt;/p&gt;</comment>
                    <comment id="12762" author="romanb" created="Tue, 27 Apr 2010 05:56:06 +0000"  >&lt;p&gt;I know but its not really a problem I think. We should just decide whether we make them private in the first place and provide getters instead (which would have avoided this problem in the first place).&lt;/p&gt;</comment>
                    <comment id="12763" author="romanb" created="Tue, 27 Apr 2010 05:56:59 +0000"  >&lt;p&gt;Leaving the prefixes on the repository class only is also an option... but I dont think thats necessary.&lt;/p&gt;</comment>
                    <comment id="12764" author="beberlei" created="Tue, 27 Apr 2010 06:28:59 +0000"  >&lt;p&gt;can we commit getters for Beta 1 then? We could give everyone a period until Beta 2 to fix their code and then make the change.&lt;/p&gt;

&lt;p&gt;EntityRepository is the only class that is meant to be userland extendable to my knowledge, so this should be the only problem to adress&lt;/p&gt;</comment>
                    <comment id="12766" author="romanb" created="Tue, 27 Apr 2010 09:25:21 +0000"  >&lt;p&gt;Yes, you can add getters and commit right away if you want. Plus adding a note on the upgrade document that direct access of these properties is deprecated.&lt;/p&gt;</comment>
                    <comment id="12767" author="romanb" created="Tue, 27 Apr 2010 09:26:22 +0000"  >&lt;p&gt;Persisters will be also extensible some day in userland but they need more polish for that, I&apos;ve already started with it &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>
                    <comment id="14785" author="johnnypeck" created="Fri, 19 Nov 2010 00:00:39 +0000"  >&lt;p&gt;Is this still planned? Searching the code base finds this is not being implemented. It would be a good idea to implement the change sooner than later if it will be done at all.  Also, +1 for the change. It makes complete sense.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-349] Add support for specifying precedence in joins in DQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-349</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This request is in followup to my doctrine-user message &quot;Doctrine 2.0: Nested joins&apos;.&lt;br/&gt;
I am a bit surprised by the responses in that defining precedences in joins by placing parenthesis around join expressions is not well-known. Although not in the original SQL92 specification it is a major and important feature offered by all the RDBMS&apos;s that Doctrine 2 supports, and oftenly performs better than using subselects or alike. Doctrine 1 did not support it, but imho Doctrine 2 should support it to be a mature allround ORM.&lt;/p&gt;

&lt;p&gt;As a short example the following is a SQL statement with a nested join, where the nesting is absolutely necessary to return only a&apos;s together with either both b&apos;s and c&apos;s or no b&apos;s and c&apos;s at all:&lt;/p&gt;

&lt;p&gt;SELECT *&lt;br/&gt;
  FROM a A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    b B&lt;br/&gt;
    INNER JOIN c C ON C.b_id = B.id&lt;br/&gt;
  ) ON B.a_id = A.id&lt;/p&gt;

&lt;p&gt;In order for Doctrine 2 to support this the BNF should be something like:&lt;br/&gt;
Join ::= [&quot;LEFT&quot; &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;OUTER&amp;quot;&amp;#93;&lt;/span&gt; | &quot;INNER&quot;] &quot;JOIN&quot; ( &quot;(&quot; JoinAssociationPathExpression &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;AS&amp;quot;&amp;#93;&lt;/span&gt; AliasIdentificationVariable Join &quot;)&quot; | JoinAssociationPathExpression &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;AS&amp;quot;&amp;#93;&lt;/span&gt; AliasIdentificationVariable ) &lt;span class=&quot;error&quot;&gt;&amp;#91;(&amp;quot;ON&amp;quot; | &amp;quot;WITH&amp;quot;) ConditionalExpression&amp;#93;&lt;/span&gt;&lt;br/&gt;
instead of the current:&lt;br/&gt;
Join ::= [&quot;LEFT&quot; &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;OUTER&amp;quot;&amp;#93;&lt;/span&gt; | &quot;INNER&quot;] &quot;JOIN&quot; JoinAssociationPathExpression &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;AS&amp;quot;&amp;#93;&lt;/span&gt; AliasIdentificationVariable &lt;span class=&quot;error&quot;&gt;&amp;#91;(&amp;quot;ON&amp;quot; | &amp;quot;WITH&amp;quot;) ConditionalExpression&amp;#93;&lt;/span&gt; &lt;/p&gt;

&lt;p&gt;This would allow DQL like:&lt;/p&gt;

&lt;p&gt;SELECT A, B, C&lt;br/&gt;
  FROM a A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    A.b B&lt;br/&gt;
    INNER JOIN B.c C&lt;br/&gt;
  ) WITH B.something = &apos;value&apos; AND C.something = &apos;othervalue&apos;&lt;/p&gt;

&lt;p&gt;What further needs to be done is that the DQL parser loosly couples the ConditionalExpression to any of the previously parsed JoinAssociationPathExpression&apos;s instead of tieing it explicitely to the JoinAssociationPathExpression that preceedes it according to the old BNF notation. The new BNF should however not require any changes to the hydrator. Therefore I have the feeling that improving the DQL parser for nested joins does not require extensive work, while the benefit of running these kind of queries is considerable.&lt;/p&gt;

&lt;p&gt;As an extra substantiation here are links to (BNF) FROM clause documentations of the RDBMS&apos;s that Doctrine 2 supports, they all show support for nested joins:&lt;br/&gt;
MySQL: &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/join.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/join.html&lt;/a&gt;&lt;br/&gt;
PostgreSQL: &lt;a href=&quot;http://www.postgresql.org/docs/8.4/interactive/sql-select.html#SQL-FROM&quot; class=&quot;external-link&quot;&gt;http://www.postgresql.org/docs/8.4/interactive/sql-select.html#SQL-FROM&lt;/a&gt; and &lt;a href=&quot;http://www.postgresql.org/docs/8.1/interactive/explicit-joins.html&quot; class=&quot;external-link&quot;&gt;http://www.postgresql.org/docs/8.1/interactive/explicit-joins.html&lt;/a&gt;&lt;br/&gt;
MSSQL: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms177634.aspx&quot; class=&quot;external-link&quot;&gt;http://msdn.microsoft.com/en-us/library/ms177634.aspx&lt;/a&gt;&lt;br/&gt;
Oracle: &lt;a href=&quot;http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_10002.htm#CHDDCHGF&quot; class=&quot;external-link&quot;&gt;http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_10002.htm#CHDDCHGF&lt;/a&gt;&lt;br/&gt;
SQLite: &lt;a href=&quot;http://www.sqlite.org/syntaxdiagrams.html#single-source&quot; class=&quot;external-link&quot;&gt;http://www.sqlite.org/syntaxdiagrams.html#single-source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I surely hope you will consider implementing this improvement because it would save me and others from the hassle of writing raw SQL queries or executing multiple (thus slow) queries in DQL for doing the same. Thanks anyway for the great product so far!&lt;/p&gt;</description>
                <environment></environment>
            <key id="10915">DDC-349</key>
            <summary>Add support for specifying precedence in joins in DQL</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="dennis.verspuij">Dennis Verspuij</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Feb 2010 09:52:45 +0000</created>
                <updated>Wed, 1 May 2013 18:46:53 +0000</updated>
                                    <version>2.0-ALPHA4</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12650" author="guilhermeblanco" created="Tue, 13 Apr 2010 00:04:10 +0000"  >&lt;p&gt;This seems to be a valid issue to me.&lt;/p&gt;

&lt;p&gt;This implementation is the actual solution to associations retrieval that are inherited (type joined).&lt;/p&gt;

&lt;p&gt;Example:&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;/** Joined */
class Base {}

class Foo &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base {}

class Bar {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $foo;
}

&lt;span class=&quot;code-comment&quot;&gt;// This causes the CTI to link as INNER JOIN, which makes the result become 0
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// il &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; you have no Foo&apos;s defined (although it should ignore &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;)
&lt;/span&gt;$q = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;SELECT b, f FROM Bar b LEFT JOIN b.foo f&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12654" author="romanb" created="Tue, 13 Apr 2010 04:40:05 +0000"  >&lt;p&gt;Yes, this is a possible solution for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-512&quot; title=&quot;LEFT JOIN of extended null entity cause empty result [testcase included]&quot;&gt;&lt;del&gt;DDC-512&lt;/del&gt;&lt;/a&gt; but on the &lt;b&gt;SQL level&lt;/b&gt;. I still don&apos;t see this as appropriate for DQL, it just doesnt make sense to me, DQL joins object associations, there is no precedence.&lt;/p&gt;</comment>
                    <comment id="12656" author="romanb" created="Tue, 13 Apr 2010 05:46:00 +0000"  >&lt;p&gt;So, no, this has nothing to do with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-512&quot; title=&quot;LEFT JOIN of extended null entity cause empty result [testcase included]&quot;&gt;&lt;del&gt;DDC-512&lt;/del&gt;&lt;/a&gt;. &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-512&quot; title=&quot;LEFT JOIN of extended null entity cause empty result [testcase included]&quot;&gt;&lt;del&gt;DDC-512&lt;/del&gt;&lt;/a&gt; can even be fixed differently as outlined in my comments there.&lt;/p&gt;</comment>
                    <comment id="12657" author="romanb" created="Tue, 13 Apr 2010 05:52:20 +0000"  >&lt;p&gt;On a side note I would still like to know/see the following for this issue:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Some realisitic DQL examples where this feature would be essential, i.e. there is no other way to do it.&lt;br/&gt;
   This also means explaining what the impact on the resulting object graph is and why it makes sense.&lt;/li&gt;
	&lt;li&gt;Which other ORMs support this on the OQL/Criteria level?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So far, my stance on this issue is:&lt;/p&gt;

&lt;p&gt; 1) It doesnt make sense (semantically) in DQL&lt;br/&gt;
 2) Its rarely needed&lt;br/&gt;
 3) When you really need it you can use a NativeQuery anyway and use this nesting in SQL, where it probably belongs and makes more sense&lt;br/&gt;
 4) It would (unnecessarily) complicate DQL&lt;/p&gt;

&lt;p&gt;Thus I am currently leaning towards &quot;Wont fix&quot; for this issue.&lt;/p&gt;</comment>
                    <comment id="12662" author="dennis.verspuij" created="Tue, 13 Apr 2010 13:53:13 +0000"  >&lt;p&gt;Hi Roman. I understand your doubts, and I have been breaking my head over&lt;br/&gt;
creating a realistic example the last few hours that would hopefully convince&lt;br/&gt;
you for implementing this feature. But actually I cannot find one that you wouldn&apos;t&lt;br/&gt;
consider to be trivial. I do have a number of very complex optimized queries written&lt;br/&gt;
for sportskickoff dot com (using Doctrine 1.2) but they are probably hard to understand&lt;br/&gt;
because they may not be selfdescribing. Below is one example literally ripped from&lt;br/&gt;
the application. Still they often can be broken down to my example query in this&lt;br/&gt;
ticket&apos;s description, but applied grouping, additional other joins on the root component&lt;br/&gt;
and/or other criteria made them impossible to rewrite using subselects or choosing&lt;br/&gt;
another root component. Most often they just performed way best using the nested&lt;br/&gt;
syntax and saved me a number of additional queries.&lt;/p&gt;

&lt;p&gt;SELECT A.id, A.username, A.balance, COALESCE(SUM(B.stake), 0) AS sumstake, COUNT(B.id) AS nrbets&lt;br/&gt;
FROM account A&lt;br/&gt;
LEFT JOIN (&lt;br/&gt;
  bet B&lt;br/&gt;
  INNER JOIN game G ON G.id = :GAMEID AND B.timestampcompletion BETWEEN G.timestampstart AND G.timestampend&lt;br/&gt;
) ON B.accountid = A.id AND B.timestampcompletion IS NOT NULL&lt;br/&gt;
WHERE A.Status &amp;amp; :ACTIVEORDISQUALIFIED = :ACTIVE&lt;br/&gt;
GROUP BY A.id, A.username, A.balance&lt;br/&gt;
ORDER BY A.balance DESC, sumstake ASC, nrbets ASC, A.username ASC&lt;/p&gt;

&lt;p&gt;But let&apos;s put it another way. I would also like this feature to be supported in DQL&lt;br/&gt;
because I just do not want to use native queries. Why would I want to use native&lt;br/&gt;
queries if it can be done using DQL? In DQL I work with class names and field&lt;br/&gt;
names, and they may differ from the underlying table and column names. Doctrine&lt;br/&gt;
takes care of that mapping based on my schema/annotations and I do not&lt;br/&gt;
have to &quot;know&quot; these mappings. In native queries I suddenly do have to &quot;know&quot;&lt;br/&gt;
these mappings. I use Doctrine because it makes my application portable and&lt;br/&gt;
enables me to work with my database in an OOP way like I do in my model,&lt;br/&gt;
abstracting things. The need for native queries partly reverts the benefits Doctrine&lt;br/&gt;
offers in the first place.&lt;/p&gt;

&lt;p&gt;Btw, I recall to have successfully used the nested join syntax in HQL (.NET Hibernate)&lt;br/&gt;
but I cannot find examples on the web or a BNF notation.&lt;/p&gt;

&lt;p&gt;Furthermore, in reply to your stances:&lt;br/&gt;
1) It indeed doesnt make sense (semantically) in DQL, it only makes the result&lt;br/&gt;
  set different, but not the way data is hydrated into objects;&lt;br/&gt;
2) Its indeed rarely needed for inserting, updating and populating basic lists but&lt;br/&gt;
  it allows you to better select what combinations of associated rows are joined&lt;br/&gt;
  and which not in more optimized queries without having to use native queries,&lt;br/&gt;
  or because they perform better than using subseletcs and alike.&lt;br/&gt;
3) Not having to use native queries is just an extra reason for using Doctrine and&lt;br/&gt;
  maintains the abstraction the ORM provides througout on&apos;es whole application&lt;br/&gt;
4) Why would it complicate DQL, if people do not know about or understand&lt;br/&gt;
  the feature it wouldn&apos;t matter because not using parenthesises is the default&lt;br/&gt;
  way to specify joins?&lt;/p&gt;

&lt;p&gt;Well, this is it, can&apos;t find any more words to promote and make you enthusiastic.... lol.&lt;/p&gt;</comment>
                    <comment id="12663" author="dennis.verspuij" created="Tue, 13 Apr 2010 17:48:39 +0000"  >&lt;p&gt;Ok, I have not given up yet... &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;, here&apos;s a &quot;stupid&quot; example.&lt;/p&gt;

&lt;p&gt;Imagine a book store that sells books of various authors and keeps track of those sales.&lt;br/&gt;
Let&apos;s say you would have an admin page that lists all authors, and for each author&lt;br/&gt;
its also shows the books and their sales dates since january 1st, but only for those&lt;br/&gt;
books that were actually sold and contain an A in its name. An optimized SQL query&lt;br/&gt;
to fetch all the information at once would be something like:&lt;/p&gt;

&lt;p&gt;SELECT A.&lt;b&gt;, B.&lt;/b&gt;, S.*&lt;br/&gt;
  FROM author A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    book B&lt;br/&gt;
    INNER JOIN sale S ON S.book_id = B.id AND S.dt &amp;gt;= &apos;2010-01-01&apos;&lt;br/&gt;
  ) ON B.author_id = A.id AND A.name LIKE &apos;%A%&apos;&lt;/p&gt;

&lt;p&gt;In DQL it would then be something like:&lt;/p&gt;

&lt;p&gt;SELECT A.&lt;b&gt;, B.&lt;/b&gt;, S.*&lt;br/&gt;
  FROM author A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    book B&lt;br/&gt;
    INNER JOIN sale S WITH S.dt &amp;gt;= &apos;2010-01-01&apos;&lt;br/&gt;
  ) WITH A.name LIKE &apos;%A%&apos;&lt;/p&gt;

&lt;p&gt;If the database would contain thousands of books, but sales for just a&lt;br/&gt;
few books, this will definitely perform better than using subselects.&lt;br/&gt;
Off course one would like to fetch array graphs instead of objects for&lt;br/&gt;
further optimization, but this hopefully shows my point.&lt;/p&gt;

&lt;p&gt;I have attached a test casefor a similar query, though without the additional&lt;br/&gt;
join constraints for clarity. I surely hope you can consider it.&lt;/p&gt;

&lt;p&gt;One last note, you shouldn&apos;t be afraid that nesting joins is not in the&lt;br/&gt;
ansi SQL spec. Select queries are about record sets and products&lt;br/&gt;
between these sets, tables are just the basic means of providing record&lt;br/&gt;
sets to the query. This is an important terminological difference to think about.&lt;br/&gt;
Specifying precedence with parenthesis around joins is a logical and&lt;br/&gt;
natural evolution of the ansi sql standard. For example views are a good&lt;br/&gt;
proof of this concept, I could define book B INNER JOIN sale S as a view&lt;br/&gt;
and LEFT JOIN that to authors to get effectively the same result&lt;br/&gt;
set as the above example. The database server would internally perform the&lt;br/&gt;
same query (though may additionally take indexes on the view into account).&lt;br/&gt;
That said, rdbm&apos;s that support this syntax would certainly never drop the&lt;br/&gt;
feature, as its not a feature but just plain logical and smart querying!&lt;/p&gt;

&lt;p&gt;P.S. I had a hard time finding out how to run the test cases, I could not find&lt;br/&gt;
it in the Doctrine 2 documentation, development wiki, cookbook or any other&lt;br/&gt;
place, while finally it was as easy as running phpunit  Doctrine_Tests_AllTests&lt;br/&gt;
from within the tests/ directory, or just phpunit  Doctrine_Tests_ORM_Functional_Ticket_DDC349Test&lt;br/&gt;
for my test. Could you please add some info about this somewhere, it might&lt;br/&gt;
save others some googling.&lt;/p&gt;</comment>
                    <comment id="12664" author="dennis.verspuij" created="Tue, 13 Apr 2010 17:50:11 +0000"  >&lt;p&gt;Test case as SVN patch using a parenthesized join.&lt;br/&gt;
Just remove the parenthesises from the query to have it fail...&lt;/p&gt;</comment>
                    <comment id="13083" author="romanb" created="Sat, 29 May 2010 06:37:17 +0000"  >&lt;p&gt;@&quot;The need for native queries partly reverts the benefits Doctrine offers in the first place.&quot;&lt;/p&gt;

&lt;p&gt;That is something I hugely disagree with. Neither SQL abstraction, nor database vendor independence is the main purpose of an ORM like Doctrine 2.&lt;br/&gt;
It is the &lt;b&gt;state management of your objects, the transparent change tracking, lazy-loading and synchronization of the object state with the database state&lt;/b&gt; and nothing of this gets lost when using native queries.&lt;/p&gt;

&lt;p&gt;We could rip out DQL and any other querying mechanism except a basic find() (and lazy-loading, of course), only providing the native query facility and even only supporting MySQL and would still retain all the core ORM functionality.&lt;/p&gt;

&lt;p&gt;NativeQuery is one of the best and core &quot;features&quot; of the project. It is even the &lt;b&gt;foundation&lt;/b&gt; for DQL. A DQL query is nothing more than an additional (beautiful) abstraction but what comes out is a native query + a ResultSetMapping, the same thing you can build yourself in the first place, &lt;b&gt;even using the mapping metadata to construct the query&lt;/b&gt;. Nothing forces you to hardcode table and column names in native queries if you don&apos;t want that. Just use the mapping metadata, DQL does the same.&lt;/p&gt;

&lt;p&gt;SQL abstraction and database vendor independence is icing on the cake, not the heart of the ORM.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12797">DDC-1256</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10569" name="DDC349Test.patch" size="5354" author="dennis.verspuij" created="Tue, 13 Apr 2010 17:50:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-298] Allow Entity to hold a collection of a single primitive type</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-298</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sometimes you want to save arbitrary information for an entity using a key -&amp;gt; value array-structure. JPA supports this by means of the @ElementCollection annotation with allows to specify HashMaps for example.&lt;/p&gt;

&lt;p&gt;I propose a new AssocationMapping called &quot;ElementMapping&quot; / &quot;ElementCollection&quot; and annotations (options):&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;ElementCollection
+ elementTable
+ keyType
+ keyLength
+ keyColumnDefinition
+ valueType
+ valueLength
+ valueColumnDefinition
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The key and value definitions are necessary for converting and schema generation.&lt;/p&gt;

&lt;p&gt;The implementation would make use of the PersistentCollection at all times and work as any other persistent collection just with primitive types.&lt;/p&gt;

&lt;p&gt;Restrictions for a first implementation:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Only available as a Lazy-Load Collection, no hydration with the source entity&lt;/li&gt;
	&lt;li&gt;Can&apos;t be used in queries alike &quot;entity.colname.key = ?1&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Use-Case:&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;$entity-&amp;gt;options[&apos;foo&apos;] = &apos;bar&apos;;
$entity-&amp;gt;options[&apos;bar&apos;] = &apos;baz&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This could be done for 2.0 imho, adding the necessary changes and optimizations could then be scheduled for 2.1&lt;/p&gt;</description>
                <environment></environment>
            <key id="10829">DDC-298</key>
            <summary>Allow Entity to hold a collection of a single primitive type</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Feb 2010 22:54:51 +0000</created>
                <updated>Fri, 24 Dec 2010 05:05:59 +0000</updated>
                                    <version>2.1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="11585" author="beberlei" created="Tue, 2 Feb 2010 22:57:00 +0000"  >&lt;p&gt;In this implementation Schema-Tool would generate a table:&lt;/p&gt;

&lt;p&gt;elementTable (entity_id-1, ..., entity_id-n, key, value) and using the Platform Type Generation of keyType and valueType&lt;/p&gt;</comment>
                    <comment id="11586" author="beberlei" created="Tue, 2 Feb 2010 23:04:43 +0000"  >&lt;p&gt;Column Names should be Change-able also since there could be people who name their primary keys &quot;key&quot; and &quot;value&quot; o_O&lt;/p&gt;</comment>
                    <comment id="11587" author="beberlei" created="Tue, 2 Feb 2010 23:05:43 +0000"  >&lt;p&gt;Ordering could be implemented on top of this using the @OrderColumn JPA implementation by adding another column to the table with a numeric order that will be &quot;order by&quot;&apos;d on select time.&lt;/p&gt;</comment>
                    <comment id="15009" author="beberlei" created="Fri, 24 Dec 2010 05:05:59 +0000"  >&lt;p&gt;Pushed back&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-265] Possibility for Nested Inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-265</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be great if Doctrine had the possibility to define a further inharitance in a subclass.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
There is a class DataObject managing things like created- and lastedit-&lt;br/&gt;
timestamps, archiving objects before updates, ...&lt;br/&gt;
One of the sub-objects is Content.&lt;br/&gt;
There are several types of content.&lt;br/&gt;
Written directly to a database field, read from a textfile on server,&lt;br/&gt;
executed php file on server, loaded from another server via xmlrpc and&lt;br/&gt;
so on. &lt;/p&gt;

&lt;p&gt;I&apos;d like to use a single table inheritance to map all information of&lt;br/&gt;
the different content objects in one table.&lt;br/&gt;
If I understand the model right the only alternate solution would be&lt;br/&gt;
to write each single content object to the discriminator map of&lt;br/&gt;
DataObject. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10756">DDC-265</key>
            <summary>Possibility for Nested Inheritance</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="quest">Michael F&#252;rmann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Jan 2010 06:27:37 +0000</created>
                <updated>Wed, 16 Jan 2013 08:16:23 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11437" author="beberlei" created="Thu, 21 Jan 2010 09:30:09 +0000"  >&lt;p&gt;The DataObject you describe is a no-go for Doctrine 2. Its just a very bad practice.&lt;/p&gt;

&lt;p&gt;Inheritance Mapping is for REAL inheritance only, otherwise you shouldnt go with a relational database in the first place.&lt;/p&gt;

&lt;p&gt;You should use the Event system for such changes, it offers you roughly the same possibilities and keeps you from having to use inheritance mapping. You could still create an abstract data object and define the fields that will be used in each &quot;implementation&quot; and then in events do something like:&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;if&lt;/span&gt; ($entity &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; DataObject) {
     $entity-&amp;gt;updated();
     $archiver-&amp;gt;makeSnapshot($entity);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12380" author="jwage" created="Sat, 20 Mar 2010 01:54:15 +0000"  >&lt;p&gt;With this patch I think you could setup a nice similar model where you can introduce new children of this parent class and have it added to the discriminator map from the child instead of having to modify the parents mapping information.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-447&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-447&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="10399">DDC-138</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-213] Persist order of collections</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-213</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A Collection is like a php array, an ordered map. Hence there should be the possibility to persist this order.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10620">DDC-213</key>
            <summary>Persist order of collections</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Dec 2009 17:40:38 +0000</created>
                <updated>Tue, 16 Oct 2012 07:43:02 +0000</updated>
                                    <version>2.0</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>10</votes>
                        <watches>8</watches>
                        <comments>
                    <comment id="13042" author="shurakai" created="Fri, 21 May 2010 19:50:28 +0000"  >&lt;p&gt;Roman, I&apos;d like to do this one as I have currently a use case for this. Do you have any idea of how to do this? What I&apos;m wondering is whether it is possible to implement this without user intervention. (This would simply mean &quot;store the entities as they were added&quot;). But this would need another column in DB that we&apos;d have to add within oneToMany / manyToMany relationships, but in this case one could save a serialized array holding &quot;entityId =&amp;gt; position&quot; key / value pairs.&lt;/p&gt;

&lt;p&gt;Afterwards, one could easily rebuild / reorder the collection via $collection-&amp;gt;set($entity, $order&lt;span class=&quot;error&quot;&gt;&amp;#91;$entity-&amp;gt;identifier&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;If you&apos;ve got another thought about this, please don&apos;t hesitate to point me into the right direction!&lt;/p&gt;</comment>
                    <comment id="13043" author="beberlei" created="Sat, 22 May 2010 02:54:25 +0000"  >&lt;p&gt;this won&apos;t be implemented until 2.1, since its a pretty complex feature. &lt;/p&gt;

&lt;p&gt;Changes are probably required in:&lt;/p&gt;

&lt;p&gt;1. CollectionPersister - Add a new collection persister that takes the position into account&lt;br/&gt;
2. SchemaTool - Add a &apos;col_position&apos; column to either the many-to-many or the one-to-many tables.&lt;br/&gt;
3. EntityPersister - Use and extend current order-by support to make the sorting happen&lt;/p&gt;

&lt;p&gt;You can implement this already though with some performance hit in update scenarios. If you use the ORDER BY support and implement an API around your entity that abstracts those changes and always sets a &quot;position&quot; field on the many entity that is supposed to be sorted.&lt;/p&gt;</comment>
                    <comment id="13044" author="romanb" created="Sat, 22 May 2010 05:35:48 +0000"  >&lt;p&gt;I don&apos;t think we necessarily need a new collection persister. Simply adjusting the ManyToManyPersister to be able to deal with it might be sufficient.&lt;/p&gt;

&lt;p&gt;For OneToMany, that is always persisted from the &quot;many&quot; side, thus there is no collection persister, we would need to adjust the normal persisters.&lt;/p&gt;

&lt;p&gt;They key element for the user should be a new annotation (or corresponding xml/yaml element) @OrderColumn. By default the order should not be persistent, only when an @OrderColumn annotation is present. The name of the order column can have a default, i.e. &quot;position&quot;. Thus this enhancement of persisting the order should be fully backwards compatible.&lt;/p&gt;</comment>
                    <comment id="13045" author="romanb" created="Sat, 22 May 2010 05:41:07 +0000"  >&lt;p&gt;On another note, the getInsertDiff/getDeleteDiff methods of PersistentCollection should already be &quot;ready&quot; for this. That is, when an element in the collection changed only its position, this is already tracked as a change. However the ManyToManyPersister issues no &quot;UPDATE&quot; queries, it simply deletes and inserts. A position change may be more effectively persisted with an UPDATE.&lt;/p&gt;</comment>
                    <comment id="14493" author="beberlei" created="Thu, 30 Sep 2010 03:23:11 +0000"  >&lt;p&gt;From a mailinglist entry, required check/changepoints:&lt;/p&gt;

&lt;p&gt;1. ClassMetadata of Many-To-Many associations have to be extended to publish the required datastructure to the ORM.&lt;br/&gt;
2. All Metadata Mapping Drivers have to be extended&lt;br/&gt;
3. Persisters\ManyToManyCollectionPersister has to be extended to save the key in the many to many table if desired by the user.&lt;br/&gt;
4. Schema-Tool has to be extended to create the additional column.&lt;br/&gt;
5. PersistentCollection has to be extended so that lazy loading of collections with additional key works.&lt;br/&gt;
6. Array- and ObjectHydrator have to be extended to allow fetch join of collections with key column.&lt;br/&gt;
7. Discuss wheather to support this for One-To-Many also with the key-column on the many side. This is much more tricky internally though.&lt;/p&gt;</comment>
                    <comment id="15006" author="beberlei" created="Fri, 24 Dec 2010 04:48:03 +0000"  >&lt;p&gt;Push back to 2.x, we will have support for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-250&quot; title=&quot;ArrayCollection Key Column @indexBy&quot;&gt;&lt;del&gt;DDC-250&lt;/del&gt;&lt;/a&gt; first and for this at a later release.&lt;/p&gt;</comment>
                    <comment id="17377" author="armetiz" created="Tue, 7 Feb 2012 17:25:33 +0000"  >&lt;p&gt;Hi there,&lt;br/&gt;
I&apos;m looking for this feature.&lt;/p&gt;

&lt;p&gt;Benjamin Eberlei said that : &quot;You can implement this already&quot;, but I don&apos;t understand the &quot;how to&quot;.&lt;/p&gt;

&lt;p&gt;Also,&lt;br/&gt;
The problem should be solve if RDBMS had a &quot;natural&quot; order. An order based on item position inside table.&lt;/p&gt;

&lt;p&gt;To get this feature without any change on Doctrine, I have remplace the PK defined by the target &amp;amp; mapped field identifier. The new PK is a new field with type &quot;integer&quot; and with auto-increment enable.&lt;br/&gt;
In this configuration, Doctrine use the &quot;natural&quot; order of the RDBMS. And I can change order of my item inside Collection and persist it.&lt;/p&gt;

&lt;p&gt;It&apos;s an very bad solution, but It work before an official support.&lt;/p&gt;

&lt;p&gt;Waiting for advices, and solutions,&lt;/p&gt;

&lt;p&gt;Thomas.&lt;/p&gt;</comment>
                    <comment id="17379" author="armetiz" created="Wed, 8 Feb 2012 10:41:00 +0000"  >&lt;p&gt;Answering to Benjamin Eberlei on the &quot;7. Discuss wheather to support this for One-To-Many also with the key-column on the many side. This is much more tricky internally though.&quot;.&lt;/p&gt;

&lt;p&gt;I think that for One-To-Many relations, if user want to store the collection order, Doctrine can store the One-To-Many as Many-To-Many with a &quot;model&quot; limitation. &lt;br/&gt;
In that case, if storing order collection for Many-To-Many work, it should work for One-To-Many.&lt;/p&gt;

&lt;p&gt;What do you think about it ?&lt;/p&gt;</comment>
                    <comment id="17486" author="ndm" created="Wed, 29 Feb 2012 05:41:55 +0000"  >&lt;p&gt;I think that it must be possible to have two keys ordering : the order isn&apos;t obligatory reversible.&lt;/p&gt;

&lt;p&gt;For exemple  with user and group : &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;You can order groups for one user : with preference by exemple, or importance.&lt;/li&gt;
	&lt;li&gt;And  with a different order,  users for a group : rank by example.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And maybe more, if you decide to add multi-order : an user show group by his rank in it, if his rank is identical, the order is make by love preference, and after by the importance given by the user (not necessary a number, if we imagine filter on them).&lt;/p&gt;

&lt;p&gt;So a default order can be choice with parametized fields and could be : &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; 
@ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;)
...
@JoinFields ( rank: { type: &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;} , preference:{type:&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;}, importance:{type: string, length: 40} )
@OrderByJoinFields({&lt;span class=&quot;code-quote&quot;&gt;&quot;rank&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;preference&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;importance&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt; } )
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;In this case the order must be optional and would be clean if another order appears in the same scope (DQL...). And manytomany became virtual entities act as other entities except they don&apos;t appears permetting in the same time a better conception.&lt;/p&gt;

&lt;p&gt;So if the solution take in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-181&quot; class=&quot;external-link&quot;&gt;DDC-181&lt;/a&gt; will become the only solution. This would a good idea to document this. Because, this seems to me a very important point.&lt;/p&gt;

&lt;p&gt;My last point is &lt;b&gt;even an unique ordering field&lt;/b&gt; created in the join table will be a &lt;b&gt;big and usefull improvement&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Thank a lot for your beautiful work.&lt;/b&gt;&lt;/p&gt;</comment>
                    <comment id="17487" author="armetiz" created="Wed, 29 Feb 2012 07:05:59 +0000"  >&lt;p&gt;In my point of view, a collection can be order in a single way only.&lt;br/&gt;
If you want to add more than one order between User &amp;amp; Group, it&apos;s a new collection, a new relation.&lt;br/&gt;
Like : &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;User.memberOf() : Group[]&lt;/li&gt;
	&lt;li&gt;Group.members() : User[]&lt;/li&gt;
	&lt;li&gt;Group.importantMembers() : User[]&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And it&apos;s your role to keep a consistency between members &amp;amp; importantMembers array.&lt;/p&gt;

&lt;p&gt;Because ManyToMany join table is the reflection of a state of an ArrayCollection. It&apos;s not a usefull feature to be able to store all of the state of an ArrayCollection, even the order of this Array. It&apos;s just a normal feature that is really missing &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/tongue.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;

&lt;p&gt;Thomas.&lt;/p&gt;</comment>
                    <comment id="17488" author="ndm" created="Wed, 29 Feb 2012 10:14:27 +0000"  >&lt;p&gt;I don&apos;t think:&lt;/p&gt;

&lt;p&gt;If you have three collection, you &lt;b&gt;duplicate one relation 3 times&lt;/b&gt; and it&apos;s easy in consequence &lt;b&gt;to lost the data integrity and unicity&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;By example :&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Thomas have rank 10 in Admin&lt;/li&gt;
	&lt;li&gt;Thomas think the admin group has importance noted 3 on all of his groups.&lt;/li&gt;
	&lt;li&gt;If a responsable of admin group decide to delete Thomas from it.&lt;/li&gt;
	&lt;li&gt;Thomas, in his ordered list of groups, think always to be in group admin.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So in my idea, the &lt;b&gt;many to many relation&lt;/b&gt; isn&apos;t just an array collection, but &lt;b&gt;should be an virtual entity&lt;/b&gt;. In UML or in Merise method this is a common problem to have a parametized relation. I think an orm should just implement this.&lt;/p&gt;
</comment>
                    <comment id="17489" author="armetiz" created="Wed, 29 Feb 2012 10:43:59 +0000"  >&lt;p&gt;Hum,&lt;br/&gt;
I agree with you.. In a SQL Schema, it&apos;s a good choice to add many fields in a ManyToMany join table to description &quot;order&quot;.&lt;/p&gt;</comment>
                    <comment id="17535" author="armetiz" created="Wed, 7 Mar 2012 15:12:35 +0000"  >&lt;p&gt;I just want to add a piece of Doctrine ORM Document : &lt;/p&gt;

&lt;p&gt;&quot;When working with collections, keep in mind that a Collection is essentially an &lt;b&gt;ordered map&lt;/b&gt; (just like a PHP array). That is why the remove operation accepts an index/key. removeElement is a separate method that has O ( n) complexity using array_search, where n is the size of the map.&quot;&lt;/p&gt;</comment>
                    <comment id="17636" author="armetiz" created="Fri, 23 Mar 2012 09:45:13 +0000"  >&lt;p&gt;Hi there,&lt;br/&gt;
After several discussions. on IRC, I have changed my point of view.&lt;/p&gt;

&lt;p&gt;Doctrine Documentation says : &quot;When working with collections, keep in mind that a Collection is essentially an ordered map (just like a PHP array)&quot;.&lt;br/&gt;
So, I think that Doctrine have to be able to store or not the order of a Collection. By adding a new field on the Joined table to store the position of each elements.&lt;/p&gt;

&lt;p&gt;But I not agree with @Nicolas. Because in his case, he&apos;s talking about Association Class : &lt;a href=&quot;http://etutorials.org/Programming/UML/Chapter+6.+Class+Diagrams+Advanced+Concepts/Association+Class/&quot; class=&quot;external-link&quot;&gt;http://etutorials.org/Programming/UML/Chapter+6.+Class+Diagrams+Advanced+Concepts/Association+Class/&lt;/a&gt;&lt;br/&gt;
Because he&apos;s talking of a business logic, he&apos;s talking of a dedicated Entity class.&lt;/p&gt;

&lt;p&gt;What do you think about it ?&lt;/p&gt;

&lt;p&gt;Thomas;&lt;/p&gt;
</comment>
                    <comment id="18593" author="armetiz" created="Fri, 31 Aug 2012 13:43:00 +0000"  >&lt;p&gt;Any news ? &lt;/p&gt;</comment>
                    <comment id="18841" author="mnapoli" created="Tue, 16 Oct 2012 07:43:02 +0000"  >&lt;p&gt;Hi, any news on this?&lt;/p&gt;

&lt;p&gt;If I may add any info to this feature request, maybe something like JPA/Hibernate could be a good start?&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;http://docs.oracle.com/javaee/6/api/javax/persistence/OrderColumn.html&quot; class=&quot;external-link&quot;&gt;http://docs.oracle.com/javaee/6/api/javax/persistence/OrderColumn.html&lt;/a&gt; or &lt;a href=&quot;http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections.html#collections-indexed&quot; class=&quot;external-link&quot;&gt;http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections.html#collections-indexed&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The idea in Hibernate is that you persist the order of the list in an extra column. This column is not a field of the entity however.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="10523">DDC-181</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10718">DDC-250</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-138] Allow for mixed inheritance mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-138</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Requesting implementation of mixed inheritance mapping (class table inheritance and single table inheritance).&lt;/p&gt;

&lt;p&gt;This would be especially handy when the difference between certain classes is only &quot;implementational&quot; (i.e. a subclass only functions differently/implements abstract methods and does not specify any additional fields). Using class table inheritance would result in tables only containing an id column.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10399">DDC-138</key>
            <summary>Allow for mixed inheritance mapping</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="reinier.kip">Reinier Kip</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Nov 2009 15:55:19 +0000</created>
                <updated>Fri, 24 Dec 2010 04:54:34 +0000</updated>
                                                                    <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                            <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="10756">DDC-265</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-128] Consider adding EntityManager#link/unlink methods for direct association manipulation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-128</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A problem when working with collection-valued associations is that almost all operations except add($obj) require the collection to become initialized in order for the operation to be performed properly. While this is all correct and beautiful OO-wise it may be problematic at times with regards to performance. Hence we might want to consider to provide some convenient methods along the lines of link/unlink (name suggestions?) which allow more direct, less OO collection manipulation. Such methods obviously would bypass the normal object lifecycle and the changes done through these methods will not be reflected in the in-memory objects and collections, unless the user keeps them in-synch himself.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10362">DDC-128</key>
            <summary>Consider adding EntityManager#link/unlink methods for direct association manipulation</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sat, 7 Nov 2009 13:31:39 +0000</created>
                <updated>Wed, 29 Dec 2010 06:32:36 +0000</updated>
                                    <version>2.0-ALPHA2</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="11174" author="beberlei" created="Fri, 11 Dec 2009 13:48:10 +0000"  >&lt;p&gt;Questions&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;I suppose link and unlinked entities would then handled by UnitOfwork commit also?&lt;/li&gt;
	&lt;li&gt;Since the collection is not initialized, one does not know upfront if the action will be successful, what happens if:
	&lt;ul&gt;
		&lt;li&gt;an entity is linked with a collection, although they are already connected.&lt;/li&gt;
		&lt;li&gt;an entity is unlinked from a collection it is not in.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Regarding the naming, i like link/unlink.&lt;/p&gt;
</comment>
                    <comment id="11211" author="romanb" created="Thu, 17 Dec 2009 13:56:23 +0000"  >&lt;p&gt;What do you mean by &quot;handled by UnitOfWork commit&quot; ? Whether the SQL is &quot;scheduled&quot; or executed immediately? Interesting question.&lt;br/&gt;
Scheduling would probably be better but also more difficult.&lt;/p&gt;

&lt;p&gt;As far as usage is concerned, I currently imagine it as follows:&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-comment&quot;&gt;// EntityManager#link($sourceObj, $field, $targetObj)
&lt;/span&gt;$user = $em-&amp;gt;getReference($userId); &lt;span class=&quot;code-comment&quot;&gt;// $userId probably from request parameters
&lt;/span&gt;$address = $em-&amp;gt;getReference($addressId); &lt;span class=&quot;code-comment&quot;&gt;// $addressId probably from request parameters
&lt;/span&gt;$em-&amp;gt;link($user, &apos;addresses&apos;, $address);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&quot;What happens if: an entity is linked with a collection, although they are already connected.&quot;&lt;/p&gt;

&lt;p&gt;Probably an SQL error which results in an exception from the driver. Depends on the database constraints though.&lt;/p&gt;

&lt;p&gt;&quot;What happens if: an entity is unlinked from a collection it is not in&quot;&lt;/p&gt;

&lt;p&gt;Probably nothing, at least not from the SQL side. An exception could be thrown from Doctrine itself if the update affected 0 rows.&lt;/p&gt;

&lt;p&gt;Thanks for these initial questions. Thats definitely food for thought. Keep it coming.&lt;/p&gt;</comment>
                    <comment id="14080" author="romanb" created="Thu, 26 Aug 2010 08:00:25 +0000"  >&lt;p&gt;Pushed back.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11277">DDC-546</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-93] It would be nice if we could have support for ValueObjects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-93</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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 User {
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $address;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $city;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $state;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We could have:&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 User {
	/**
	 * @Component(class=&lt;span class=&quot;code-quote&quot;&gt;&quot;Address&quot;&lt;/span&gt;)
	 */
	 &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $address;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It would my life a lot easier....&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;&lt;a name=&quot;Notesforimplementation&quot;&gt;&lt;/a&gt;Notes for implementation&lt;/h2&gt;

&lt;p&gt;Value objects can come in two forms: &lt;/p&gt;

&lt;p&gt;a) as embedded value objects&lt;br/&gt;
b) as collections of value objects&lt;/p&gt;

&lt;p&gt;An implementation should concentrate on a) first. The following things all concentrate on a).&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;DQLSupport&quot;&gt;&lt;/a&gt;DQL Support&lt;/h3&gt;

&lt;p&gt;&lt;b&gt;Conditions:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;1. &quot;select f from Foo f where f.embedded.value = ?1&quot; (setParameter(1, $scalarValue))&lt;br/&gt;
2. &quot;select f from Foo f where f.embedded = ?1&quot; (setParameter(1, $embeddedValueObject))&lt;/p&gt;

&lt;p&gt;At least Nr.1 &lt;b&gt;must&lt;/b&gt; be possible in a first implementation.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Selecting:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;1. &quot;select f from Foo f&quot; must explode embedded value objects in the SQL SELECT clause.&lt;br/&gt;
2. &quot;select f.embedded from Foo f&quot; must explode the columns of the embedded object in the SQL SELECT clause.&lt;/p&gt;

&lt;p&gt;At least Nr. 1 &lt;b&gt;must&lt;/b&gt; be possible in a first implementation, obviously.&lt;/p&gt;

&lt;p&gt;Components affected (among others): Parser, SqlWalker, ...&lt;/p&gt;


&lt;h3&gt;&lt;a name=&quot;Persisters&quot;&gt;&lt;/a&gt;Persisters&lt;/h3&gt;

&lt;p&gt;The persisters need to take embedded value objects into account when persisting as well as loading entities.&lt;/p&gt;

&lt;p&gt;Components affected (among others): Persisters, UnitOfWork, ...&lt;/p&gt;


&lt;h3&gt;&lt;a name=&quot;Metadata&quot;&gt;&lt;/a&gt;Metadata&lt;/h3&gt;

&lt;p&gt;ClassMetadataInfo needs to be extended with a field (probably an array) that contains the mappings of embedded values.&lt;br/&gt;
New annotations as well as XML/YAML elements are needed.&lt;/p&gt;

&lt;p&gt;Components affected (among others): ClassMetadataInfo, AnnotationDriver, YamlDriver, XmlDriver, doctrine-mapping.xsd, ...&lt;/p&gt;


&lt;h3&gt;&lt;a name=&quot;ChangeTracking&quot;&gt;&lt;/a&gt;Change Tracking&lt;/h3&gt;

&lt;p&gt;If value objects are supposed to be immutable this is easy and might require no or few changes. If, however, we want to track changes in mutable value objects it might get more complicated.&lt;/p&gt;

&lt;p&gt;Components affected (among others): UnitOfWork, ...&lt;/p&gt;

</description>
                <environment></environment>
            <key id="10295">DDC-93</key>
            <summary>It would be nice if we could have support for ValueObjects</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="ablock">Avi Block</reporter>
                        <labels>
                    </labels>
                <created>Sun, 1 Nov 2009 14:27:35 +0000</created>
                <updated>Sun, 14 Apr 2013 10:18:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>37</votes>
                        <watches>31</watches>
                        <comments>
                    <comment id="10511" author="beberlei" created="Thu, 5 Nov 2009 13:06:26 +0000"  >&lt;p&gt;formated snippets nicely&lt;/p&gt;</comment>
                    <comment id="11150" author="trashofmasters" created="Wed, 9 Dec 2009 17:59:53 +0000"  >&lt;p&gt;I need this feature too.&lt;/p&gt;

&lt;p&gt;But I would suggest using the same annotation used by JPA&lt;/p&gt;

&lt;p&gt;@Embeddable&lt;/p&gt;

&lt;p&gt;+1&lt;/p&gt;</comment>
                    <comment id="11215" author="alan" created="Thu, 17 Dec 2009 19:07:36 +0000"  >&lt;p&gt;You should also take into consideration different storage strategies of ValueObjects.&lt;/p&gt;

&lt;p&gt;Martin Fowler points out -  in &#8222;PoEAA&quot;  - two approaches: &lt;a href=&quot;http://martinfowler.com/eaaCatalog/embeddedValue.html&quot; class=&quot;external-link&quot;&gt;Embedded Value (which is the one presented above)&lt;/a&gt; and &lt;a href=&quot;http://martinfowler.com/eaaCatalog/serializedLOB.html&quot; class=&quot;external-link&quot;&gt;Serialized LOB&lt;/a&gt; .&lt;br/&gt;
Both have their pros and cons, that&apos;s why Doctrine2 should give developers choice of selecting the fittest solution.&lt;/p&gt;</comment>
                    <comment id="11216" author="ablock" created="Thu, 17 Dec 2009 19:09:27 +0000"  >&lt;p&gt;Of course technically we can similate a serialized LOB with a new Doctrine 2 type.&lt;/p&gt;</comment>
                    <comment id="11217" author="alan" created="Thu, 17 Dec 2009 19:44:31 +0000"  >&lt;p&gt;I don&apos;t like that idea - Its so not generic.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;VO as a pattern&lt;/b&gt; is important building block of &lt;em&gt;domain model&lt;/em&gt;, which clearly indicates that &lt;b&gt;VO as a feature of Doctrine2&lt;/b&gt; should be tailor-made.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;To anyone of dev-team reading this issue: without VOs Doctrine is not yet DDD-ready, please hurry &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>
                    <comment id="11230" author="romanb" created="Fri, 18 Dec 2009 13:58:19 +0000"  >&lt;p&gt;Serialized LOB is not very useful IMHO and has lots of problems (many mentioned in PoEEA already).&lt;/p&gt;

&lt;p&gt;@Alan: I appreciate your nice reminder and I&apos;m sure you mean it in a friendly way, but please keep in mind that noone is paid to work on this project. It all happens in free/spare time and the current state of the project already consumed at least 1 1/2 years spending many hours weekly on this project from me alone. Not to speak of the others.&lt;/p&gt;

&lt;p&gt;Thus, there is no point in demanding something or telling us to hurry. The best way to get a feature in is to provide a (&lt;b&gt;good&lt;/b&gt;) patch that we find worth including.&lt;/p&gt;

&lt;p&gt;I started to add notes to this issue to collect all the things that need to be done for this feature.&lt;/p&gt;

&lt;p&gt;In the meantime, its not too hard/ugly to get a half-way decent embedded value yourself:&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;/** @Entity @HasLifecycleCallbacks */
class Foo {
    &lt;span class=&quot;code-comment&quot;&gt;// annotations not shown
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $embedded;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $value1; &lt;span class=&quot;code-comment&quot;&gt;// never reveal to &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $value2; &lt;span class=&quot;code-comment&quot;&gt;// never reveal to &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyw