<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 18 19:05:23 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DDC+AND+status+%3D+Resolved+ORDER+BY+priority+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+status+%3D+Resolved+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1000" total="1686"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-844] Call to undefined function Doctrine\ORM\Query\ctype_alpha() in Doctrine/ORM/Query/Lexer.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-844</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;we&apos;re trying to get our code to run on OpenWRT; for now inside a vmware environment.&lt;br/&gt;
You can find our code here:&lt;br/&gt;
&lt;a href=&quot;http://github.com/volkszaehler/volkszaehler.org&quot; class=&quot;external-link&quot;&gt;http://github.com/volkszaehler/volkszaehler.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;accessing this url&lt;br/&gt;
&lt;a href=&quot;http://192.168.189.179/backend/index.php/data/a301d8d0-903b-11df-94bb-d943d061b6a8.json&quot; class=&quot;external-link&quot;&gt;http://192.168.189.179/backend/index.php/data/a301d8d0-903b-11df-94bb-d943d061b6a8.json&lt;/a&gt;&lt;br/&gt;
we get:&lt;/p&gt;

&lt;p&gt;&quot;Fatal error: Call to undefined function Doctrine\ORM\Query\ctype_alpha() in /www/doctrine/doctrine/lib/Doctrine/ORM/Query/Lexer.php on line 158&quot;&lt;/p&gt;

&lt;p&gt;our debug output (&quot;&amp;amp;debug=5&quot; appended to URL) looks like this:&lt;br/&gt;
{&quot;source&quot;:&quot;volkszaehler.org&quot;,&quot;version&quot;:0.2,&quot;component&quot;:&quot;backend&quot;,&quot;exception&quot;:{&quot;type&quot;:&quot;Exception&quot;,&quot;message&quot;:&quot;Unknown format: json&amp;amp;debug=5&quot;,&quot;code&quot;:0}}&lt;/p&gt;

&lt;p&gt;Thanks in advance!&lt;/p&gt;

&lt;p&gt;Regards, J.&lt;/p&gt;</description>
                <environment>OpenWRT/x86 within vmware fusion&lt;br/&gt;
OpenWRT backfire 10.03&lt;br/&gt;
lighttpd - 1.4.26-2&lt;br/&gt;
php5 - 5.3.1-3&lt;br/&gt;
php5-cgi - 5.3.1-3&lt;br/&gt;
php5-mod-json - 5.3.1-3&lt;br/&gt;
php5-mod-pdo - 5.3.1-3&lt;br/&gt;
php5-mod-pdo-pgsql - 5.3.1-3&lt;br/&gt;
php5-mod-pgsql - 5.3.1-3&lt;br/&gt;
pgsql-server - 8.3.3-2</environment>
            <key id="12024">DDC-844</key>
            <summary>Call to undefined function Doctrine\ORM\Query\ctype_alpha() in Doctrine/ORM/Query/Lexer.php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="justinotherguy">Justin Otherguy</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Oct 2010 18:57:00 +0000</created>
                <updated>Wed, 20 Oct 2010 19:31:42 +0000</updated>
                    <resolved>Wed, 20 Oct 2010 19:31:42 +0000</resolved>
                            <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14590" author="justinotherguy" created="Wed, 20 Oct 2010 19:31:42 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;seems package php5-mod-ctype was missing.&lt;/p&gt;

&lt;p&gt;It&apos;s working now...&lt;/p&gt;

&lt;p&gt;Thanks anyway!&lt;/p&gt;

&lt;p&gt;Keep up the good work - looking forward to the final version &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;Regards, J.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1251] EntityGenerator uses non-existing constant T_AMPERSAND</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1251</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As per &lt;a href=&quot;http://www.php.net/manual/en/tokens.php&quot; class=&quot;external-link&quot;&gt;http://www.php.net/manual/en/tokens.php&lt;/a&gt; - the T_AMPERSAND token does not exist. I&apos;m not sure what was the intent, but the entity generator fails on the 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;            $elems = array_map(function($el) {
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $el;
            }, $elems);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Due to the way notices are handled in Symfony, this basically stops the execution of the generator entirely. Not so great.&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;  [ErrorException]                                                                                            
  Notice: Use of undefined constant T_AMPERSAND - assumed &apos;T_AMPERSAND&apos; in ./vendor/doctrine/lib/Doctrine/ORM/Tools/EntityGenerator.php line 454
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Commenting out the offending line makes it work fine though, so I think it&apos;s just choking while expecting a function that takes args by reference or something.&lt;/p&gt;</description>
                <environment>Irrelevant</environment>
            <key id="12791">DDC-1251</key>
            <summary>EntityGenerator uses non-existing constant T_AMPERSAND</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="seldaek">Jordi Boggiano</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jul 2011 15:45:46 +0000</created>
                <updated>Sat, 9 Jul 2011 12:57:33 +0000</updated>
                    <resolved>Sat, 9 Jul 2011 12:57:33 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16131" author="beberlei" created="Sat, 9 Jul 2011 12:57:33 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1231] In ObjectHydrator-&gt;_getEntity(...) looking for the discriminator should be in uppercase</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1231</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On line 204:&lt;br/&gt;
$discrColumn = $this-&amp;gt;_rsm-&amp;gt;metaMappings[$this-&amp;gt;_rsm-&amp;gt;discriminatorColumns&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt;];&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;_rsm-&amp;gt;discriminatorColumns&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt; is in lowercase, whereas $this-&amp;gt;_rsm-&amp;gt;metaMappings[$this-&amp;gt;_rsm-&amp;gt;discriminatorColumns&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt;] is in uppercase.&lt;/p&gt;

&lt;p&gt;$discrColumn cannot be assigned.&lt;/p&gt;

&lt;p&gt;A simple fix could be:&lt;br/&gt;
$discrColumn = $this-&amp;gt;_rsm-&amp;gt;metaMappings[strtoupper($this-&amp;gt;_rsm-&amp;gt;discriminatorColumns&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt;)];&lt;/p&gt;</description>
                <environment></environment>
            <key id="12753">DDC-1231</key>
            <summary>In ObjectHydrator-&gt;_getEntity(...) looking for the discriminator should be in uppercase</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="iksela">Alexandre Mathieu</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Jun 2011 11:58:13 +0000</created>
                <updated>Tue, 28 Jun 2011 19:41:01 +0000</updated>
                    <resolved>Tue, 28 Jun 2011 19:41:01 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16077" author="beberlei" created="Mon, 27 Jun 2011 12:14:09 +0000"  >&lt;p&gt;What version of the code are you using? I fixed this problem yesterday on git master.&lt;/p&gt;</comment>
                    <comment id="16079" author="iksela" created="Mon, 27 Jun 2011 12:25:41 +0000"  >&lt;p&gt;2.1.0RC1 downloaded this morning from the website.&lt;/p&gt;</comment>
                    <comment id="16081" author="beberlei" created="Mon, 27 Jun 2011 12:41:30 +0000"  >&lt;p&gt;ah yes, please update to Git Master then or wait for the RC2 release happening this week.&lt;/p&gt;</comment>
                    <comment id="16091" author="beberlei" created="Tue, 28 Jun 2011 19:41:01 +0000"  >&lt;p&gt;This was fixed on master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1186] Proxy Objects are incompatible with Serialization</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1186</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Lazy-loading users is impossible atm if you want to serialize them at some point, and they are using private member variables.&lt;/p&gt;

&lt;p&gt;My suggestion is to check whether the proxied class implements the Serializable interface, and in these cases instead of implementing a __sleep method, a serialize/unserialize method should be implemented instead.&lt;/p&gt;

&lt;p&gt;Something like:&lt;/p&gt;

&lt;p&gt;    public function serialize()&lt;/p&gt;
    {
        return serialize(array($this-&amp;gt;__isInitialized__, parent::serialize()));
    }

&lt;p&gt;    public function unserialize($str)&lt;/p&gt;
    {
        list($this-&amp;gt;__initialized__, $parentStr) = unserialize($str);
        parent::unserialize($parentStr);
    }

&lt;p&gt;At the moment, this makes Doctrine Proxy objects incompatible with the Symfony Security component, and if possible it should be fixed for the 2.1 release. If you need help on this, let me know.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12686">DDC-1186</key>
            <summary>Proxy Objects are incompatible with Serialization</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Jun 2011 11:48:34 +0000</created>
                <updated>Wed, 1 Jun 2011 16:51:21 +0000</updated>
                    <resolved>Wed, 1 Jun 2011 16:51:21 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15897" author="johannes" created="Wed, 1 Jun 2011 16:51:21 +0000"  >&lt;p&gt;Closing this, not sure what I was debugging there, the problem is a Symfony one &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-1176] Error on proxy loading with foreign Key</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1176</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Look at this thread:&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/2a03a6aea43428d6&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/2a03a6aea43428d6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This entity class configuration:&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 IndividualsStatus
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Individuals
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Individuals&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers&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;refresh&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals_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; $individuals;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Diagnosers
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Diagnosers&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals&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;refresh&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers_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; $diagnosers;

    /**
    * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; smallint $status
    *
    * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;status_individuals&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;)
    */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $statusIndividuals;

    [...]
}

class Individuals
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Users
     *
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Users&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;detach&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;}, orphanRemoval=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $users;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Advertisements
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Advertisements&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $advertisements;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; IndividualsStatus
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;IndividualsStatus&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
     * @joinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals_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; $diagnosers;

  [...]
}

class Diagnosers
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Users
     *
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Users&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-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $users;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Pros
     *
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Pros&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-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pros_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $pros;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Reports
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Reports&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&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;private&lt;/span&gt; $reports;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; IndividualsStatus
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;IndividualsStatus&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
     * @joinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers_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; $individuals;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that in individuals, the relation called &quot;Diagnosers&quot; refered to IndividualsStatus entity.&lt;br/&gt;
Note that in diagnosers, the relation called &quot;Individuals&quot; refered to IndividualsStatus entity.&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;When I execute &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; DQL request:
   $qb-&amp;gt;select(array(&apos;i&apos;, &apos;iss&apos;, &apos;u&apos;)) 
           -&amp;gt;from(&apos;IndividualsStatus&apos;, &apos;iss&apos;) 
           -&amp;gt;join(&apos;iss.individuals&apos;, &apos;i&apos;) 
           -&amp;gt;join(&apos;i.users&apos;, &apos;u&apos;) 
           -&amp;gt;where(&apos;iss.diagnosers = ?1&apos;) 
           -&amp;gt;andWhere(&apos;iss.individuals = ?2&apos;) 
           -&amp;gt;setParameters(array(1 =&amp;gt; $idDiag, 2 =&amp;gt; $id)); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I retrieve an IndividualsStatus entity:&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;object(stdClass)[149] 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;IndividualsStatus&apos; (length=37) 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;individuals&apos; =&amp;gt; 
    object(stdClass)[148] 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Individuals&apos; (length=31) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;reference&apos; =&amp;gt; string &apos;451&apos; (length=3) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;maxAdvertisements&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;role&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 2 
      &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; 8 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;users&apos; =&amp;gt; string &apos;Users&apos; (length=25) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;advertisements&apos; =&amp;gt; string &apos;Array(0)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;diagnosers&apos; =&amp;gt; string &apos;Array(1)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;ownedReports&apos; =&amp;gt; string &apos;Array(0)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;reports&apos; =&amp;gt; string &apos;Array(0)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;_em&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;diagnosers&apos; =&amp;gt; 
    object(stdClass)[154] 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Proxies 
\OpengroupeEntitiesDiagnosersProxy&apos; (length=61) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;id&apos; =&amp;gt; string &apos;19&apos; (length=2) 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;statusIndividuals&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;_em&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now i want to access to the &quot;Diagnosers&quot; relation of the Individuals:&lt;br/&gt;
\Doctrine\Common\Util\Debug::dump($individualsStatus-&amp;gt;getIndividuals()-&amp;gt;getDiagnosers()); &lt;/p&gt;

&lt;p&gt;In my database, this individuals got 2 diagnosers attached, but only 1 is dumped.&lt;br/&gt;
For getting the 2, i have to select the Diagnosers relation into my Dql request:&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(array(&apos;i&apos;, &apos;iss&apos;, &apos;u&apos;, &apos;d&apos;)) 
           -&amp;gt;from(&apos;IndividualsStatus&apos;, &apos;iss&apos;) 
           -&amp;gt;join(&apos;iss.individuals&apos;, &apos;i&apos;) 
           -&amp;gt;join(&apos;i.diagnosers&apos;, &apos;d&apos;) 
           -&amp;gt;join(&apos;i.users&apos;, &apos;u&apos;) 
           -&amp;gt;where(&apos;iss.diagnosers = ?1&apos;) 
           -&amp;gt;andWhere(&apos;iss.individuals = ?2&apos;) 
           -&amp;gt;setParameters(array(1 =&amp;gt; $idDiag, 2 =&amp;gt; $id)); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then if i do \Doctrine\Common\Util\Debug::dump($individualsStatus-&amp;gt;getIndividuals()-&amp;gt;getDiagnosers())&lt;br/&gt;
I have my 2 diagnosers display.&lt;/p&gt;
</description>
                <environment>Doctrine 2.1Beta</environment>
            <key id="12674">DDC-1176</key>
            <summary>Error on proxy loading with foreign Key</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="benoit">Jonathan Clus</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 May 2011 10:34:32 +0000</created>
                <updated>Sat, 11 Jun 2011 07:46:20 +0000</updated>
                    <resolved>Sat, 11 Jun 2011 07:46:20 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15889" author="benoit" created="Fri, 27 May 2011 13:11:10 +0000"  >&lt;p&gt;I test something more simple with the same entiies:&lt;/p&gt;

&lt;p&gt;$diagnosers = $em-&amp;gt;getRepository(&apos;Diagnosers&apos;)-&amp;gt;find(19);&lt;br/&gt;
$listDiag = $diagnosers-&amp;gt;getIndividuals();&lt;/p&gt;

&lt;p&gt;In my database, the Diagnoser(19) got 20 individualsStatus(remember the relation called &quot;Individuals&quot; in &quot;Diagnosers&quot; return &quot;IndividualsStatus&quot; entities)&lt;br/&gt;
So this function return only 1 individualStatus(minor id in bdd).&lt;/p&gt;

&lt;p&gt;I am completly blocked in my developpement. Did my entity annotation for the relation is bad ?&lt;/p&gt;</comment>
                    <comment id="15918" author="beberlei" created="Sun, 5 Jun 2011 11:53:10 +0000"  >&lt;p&gt;Formatting&lt;/p&gt;</comment>
                    <comment id="15919" author="beberlei" created="Sun, 5 Jun 2011 12:01:02 +0000"  >&lt;p&gt;This issue is related to foreign key identifiers, not using them will solve the problem. Your annotations are good.&lt;/p&gt;

&lt;p&gt;However I fixed an issue of this kind some weeks ago. Are you using the Download of 2.1 Beta? Can you try to update to the latest version on Git?&lt;/p&gt;</comment>
                    <comment id="15920" author="beberlei" created="Sun, 5 Jun 2011 12:20:46 +0000"  >&lt;p&gt;Yes just seeing i fixed the bug AFTER releasing BEta 1. Please upgrade and verify!&lt;/p&gt;</comment>
                    <comment id="15974" author="beberlei" created="Sat, 11 Jun 2011 07:46:20 +0000"  >&lt;p&gt;Resolved&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1051] Generated SQL Query Missing Table/Join Constraint leading to SQL Syntax Error</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1051</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;SELECT u, uc, ur&lt;br/&gt;
FROM ARN\EntityBundle\Entity\Users u&lt;br/&gt;
INNER JOIN u.contact_info uc&lt;br/&gt;
INNER JOIN u.user_roles ur&lt;br/&gt;
WHERE u.username = :username&lt;/p&gt;

&lt;p&gt;Generates the following SQL Query&lt;/p&gt;

&lt;p&gt;SELECT u0_.user_id AS user_id0, u0_.username AS username1, u0_.password AS password2, u0_.contact_info_id AS contact_info_id3, u0_.user_active AS user_active4, u0_.user_date AS user_date5, u0_.office_id AS office_id6, u0_.superuser AS superuser7, c1_.contact_info_id AS contact_info_id8, c1_.first_name AS first_name9, c1_.last_name AS last_name10, c1_.address AS address11, c1_.city_id AS city_id12, c1_.zip AS zip13, c1_.email AS email14, u2_.user_role_id AS user_role_id15, u2_.role AS role16, u0_.contact_info_id AS contact_info_id17, c1_.city_id AS city_id18 FROM users u0_ INNER JOIN contact_info c1_ ON u0_.contact_info_id = c1_.contact_info_id INNER JOIN WHERE u0_.user_id = ?&apos;)&lt;/p&gt;

&lt;p&gt;Notice the &quot;INNER JOIN WHERE&quot;, this is the problem.&lt;/p&gt;

&lt;p&gt;The mapping is as follows:&lt;/p&gt;

&lt;p&gt;Users-&amp;gt;user_roles&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@orm:OneToMany(targetEntity=&quot;UserRoles&quot;, mappedBy=&quot;user&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    protected $user_roles;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;UserRoles-&amp;gt;user&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ManyToOne(targetEntity=&quot;Users&quot;, inversedBy=&quot;user_roles&quot;)&lt;/li&gt;
	&lt;li&gt;@JoinColumn(name=&quot;user_id&quot;, referencedColumnName=&quot;user_id&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    protected $user;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Let me know if you need any more information.  Happy to help.  Thanks.&lt;/p&gt;
</description>
                <environment>RedHat Enterprise, PHP 5.3.4, Symfony2 (Sandbox PR7)</environment>
            <key id="12437">DDC-1051</key>
            <summary>Generated SQL Query Missing Table/Join Constraint leading to SQL Syntax Error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="webb.roger">Roger Webb</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Feb 2011 14:24:20 +0000</created>
                <updated>Mon, 28 Feb 2011 15:55:05 +0000</updated>
                    <resolved>Mon, 28 Feb 2011 15:55:05 +0000</resolved>
                            <version>2.0</version>
                                                <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15417" author="webb.roger" created="Mon, 28 Feb 2011 15:55:05 +0000"  >&lt;p&gt;Problem was due to a missing &quot;orm:&quot; prefix for symfony annotations.  Thanks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1453] YamlDriver calls Yaml::parse(), but only Yaml::load() exists</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1453</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As the subject says, this cannot work. Reported to me through &lt;a href=&quot;http://forge.typo3.org/issues/31212&quot; class=&quot;external-link&quot;&gt;http://forge.typo3.org/issues/31212&lt;/a&gt;. Looking at &lt;a href=&quot;https://github.com/fabpot/yaml/blame/master/lib/sfYaml.php&quot; class=&quot;external-link&quot;&gt;https://github.com/fabpot/yaml/blame/master/lib/sfYaml.php&lt;/a&gt; it even seems there never was a parse() method.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13125">DDC-1453</key>
            <summary>YamlDriver calls Yaml::parse(), but only Yaml::load() exists</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="k-fish">Karsten Dambekalns</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 Oct 2011 11:12:29 +0000</created>
                <updated>Tue, 25 Oct 2011 16:43:33 +0000</updated>
                    <resolved>Tue, 25 Oct 2011 13:04:37 +0000</resolved>
                            <version>2.2</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16695" author="beberlei" created="Tue, 25 Oct 2011 13:04:31 +0000"  >&lt;p&gt;You are using the oldest possible version of YAML component, please use the right one: &lt;a href=&quot;https://github.com/symfony/yaml&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/yaml&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16698" author="k-fish" created="Tue, 25 Oct 2011 16:31:54 +0000"  >&lt;p&gt;Heh, why on earth is the one we use then showing a last update in June 2011? I think all this forking on github is confusing... :/&lt;/p&gt;

&lt;p&gt;Anyway, thanks for the pointer! &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;PS: source of the confusion is &lt;a href=&quot;http://components.symfony-project.org/yaml/installation&quot; class=&quot;external-link&quot;&gt;http://components.symfony-project.org/yaml/installation&lt;/a&gt;, which points to &lt;a href=&quot;https://github.com/fabpot/yaml&quot; class=&quot;external-link&quot;&gt;https://github.com/fabpot/yaml&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1410] leftJoin with condition WITH &amp; Object Hydratation problem.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1410</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Here an example of a simple QueryBuilder :&lt;/p&gt;

&lt;p&gt;$queryBuilder	= $entityManager-&amp;gt;createQueryBuilder();&lt;br/&gt;
$queryBuilder-&amp;gt;select ( &quot;player, options&quot; );&lt;br/&gt;
$queryBuilder-&amp;gt;from ( &quot;Player_Model_Entity_Player&quot;, &quot;player&quot;);&lt;br/&gt;
$queryBuilder-&amp;gt;where (&quot;player.idPlayer = 12&quot;);&lt;br/&gt;
$queryBuilder-&amp;gt;leftJoin (&quot;player.options&quot;, &quot;options&quot;, &quot;WITH&quot;, &quot;options.enabled = :enabled&quot;);&lt;br/&gt;
$queryBuilder-&amp;gt;setParameter (&quot;enabled&quot;, 1);&lt;/p&gt;


&lt;p&gt;OptionA &amp;amp; OptionB &amp;amp; OptionC three entities.&lt;br/&gt;
User case :&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;OptionA.enabled = 1 &amp;amp; OptionB.enabled = 1 &amp;amp; OptionC.enabled = 1 : OK - All options are return.&lt;/li&gt;
	&lt;li&gt;OptionA.enabled = 1 &amp;amp; OptionB.enabled = 0 &amp;amp; OptionC.enabled = 0 : OK - only optionA is return.&lt;/li&gt;
	&lt;li&gt;OptionA.enabled = 1 &amp;amp; OptionB.enabled = 0 &amp;amp; OptionC.enabled = 1 : OK - only optionA &amp;amp; optionC is return.&lt;/li&gt;
	&lt;li&gt;OptionA.enabled = 0 &amp;amp; OptionB.enabled = 1 &amp;amp; OptionC.enabled = 1 : KO - no option return.&lt;/li&gt;
	&lt;li&gt;OptionA.enabled = 0 &amp;amp; OptionB.enabled = 0 &amp;amp; OptionC.enabled = 0 : OK - no option return.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I have test on OneToMany configuration and I have not problem. The problem only appear with ManyToMany relationships.&lt;/p&gt;

&lt;p&gt;The problem seems to be on hydratation. The data return on SQL command seems to be correct. &lt;/p&gt;</description>
                <environment>Debian 5 dotdeb&lt;br/&gt;
PHP 5.3&lt;br/&gt;
MySQL 5.0&lt;br/&gt;
Apache 2.2</environment>
            <key id="13075">DDC-1410</key>
            <summary>leftJoin with condition WITH &amp; Object Hydratation problem.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Oct 2011 14:37:33 +0000</created>
                <updated>Thu, 7 Jun 2012 23:56:49 +0000</updated>
                    <resolved>Fri, 28 Oct 2011 21:47:48 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16669" author="armetiz" created="Thu, 20 Oct 2011 13:25:32 +0000"  >&lt;p&gt;I have made some other search about it.&lt;/p&gt;

&lt;p&gt;On the queryBuilder described above, I was using getSingleResult / getResult.&lt;br/&gt;
When I&apos;m using getScalarResult I can see data of every options.&lt;/p&gt;

&lt;p&gt;Here the scalar 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(3) {
  [0]=&amp;gt;
  array(21) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;player_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_id&quot;&lt;/span&gt;]=&amp;gt;
    NULL
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_enabled&quot;&lt;/span&gt;]=&amp;gt;
    NULL
  }
  [1]=&amp;gt;
  array(21) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;player_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_enabled&quot;&lt;/span&gt;]=&amp;gt;
    bool(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
  }
  [2]=&amp;gt;
  array(21) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;player_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(4)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_enabled&quot;&lt;/span&gt;]=&amp;gt;
    bool(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Do you have any clue ?&lt;/p&gt;</comment>
                    <comment id="16673" author="armetiz" created="Thu, 20 Oct 2011 14:58:24 +0000"  >&lt;p&gt;I think I have find the problem.&lt;/p&gt;

&lt;p&gt;See patch.&lt;br/&gt;
I have test the modification, it seem to be okay.&lt;/p&gt;

&lt;p&gt;In the 2.1.2 version, If the first related object wasn&apos;t a &quot;nonemptyComponents&quot;, the ObjectHydrator initialized the collection by a specific way.&lt;/p&gt;</comment>
                    <comment id="16674" author="armetiz" created="Thu, 20 Oct 2011 14:59:38 +0000"  >&lt;p&gt;It&apos;s a patch for Doctrine/ORM/Internal/Hydration/ObjectHydrator.php version 2.1.2.&lt;/p&gt;</comment>
                    <comment id="16675" author="armetiz" created="Thu, 20 Oct 2011 15:42:38 +0000"  >&lt;p&gt;I have add a correction on Github : &lt;a href=&quot;https://github.com/armetiz/doctrine2/commit/42d507632fd27a23220c38bb867b611c3caaab8e&quot; class=&quot;external-link&quot;&gt;https://github.com/armetiz/doctrine2/commit/42d507632fd27a23220c38bb867b611c3caaab8e&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16693" author="beberlei" created="Tue, 25 Oct 2011 06:48:53 +0000"  >&lt;p&gt;Thanks for digging into that, I will evaluate this issue&lt;/p&gt;</comment>
                    <comment id="16694" author="armetiz" created="Tue, 25 Oct 2011 09:32:53 +0000"  >&lt;p&gt;No problem, It was blocking for me.&lt;br/&gt;
But I don&apos;t understand why this bug doesn&apos;t appear to other users. Because of that, I&apos;m wondering if it&apos;s a real bug or a miss configuration on my app.&lt;/p&gt;

&lt;p&gt;To be sure, the best will be to create a new test, but I&apos;m not really familiar to create ORM test case.. &lt;/p&gt;

&lt;p&gt;Thomas.&lt;/p&gt;</comment>
                    <comment id="16699" author="beberlei" created="Tue, 25 Oct 2011 18:59:39 +0000"  >&lt;p&gt;can you post your mappings?&lt;/p&gt;</comment>
                    <comment id="16701" author="armetiz" created="Wed, 26 Oct 2011 09:39:00 +0000"  >&lt;p&gt;PlayerEntity :&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;	&amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;PlayerEntity&quot;&lt;/span&gt;&amp;gt;
		&amp;lt;many-to-many field=&lt;span class=&quot;code-quote&quot;&gt;&quot;options&quot;&lt;/span&gt; target-entity=&lt;span class=&quot;code-quote&quot;&gt;&quot;OptionEntity&quot;&lt;/span&gt; mapped-by=&lt;span class=&quot;code-quote&quot;&gt;&quot;players&quot;&lt;/span&gt; /&amp;gt;
	&amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;gt;
{/code}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br/&gt;
&amp;lt;doctrine-mapping xmlns=&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;br/&gt;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br/&gt;
      xsi:schemaLocation=&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping&lt;br/&gt;
                    &lt;a href=&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot; class=&quot;external-link&quot;&gt;http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&lt;/a&gt;&quot; &amp;gt;&lt;br/&gt;
	&amp;lt;entity name=&quot;OptionEntity&quot; table=&quot;options&quot;&amp;gt;		&lt;br/&gt;
		&amp;lt;many-to-many field=&quot;players&quot; target-entity=&quot;PlayerEntity&quot; inversed-by=&quot;options&quot;&amp;gt;&lt;br/&gt;
			&amp;lt;cascade&amp;gt;&lt;br/&gt;
				&amp;lt;cascade-merge /&amp;gt;&lt;br/&gt;
			&amp;lt;/cascade&amp;gt;&lt;br/&gt;
			&amp;lt;join-table name=&quot;compo_option_player&quot; /&amp;gt;&lt;br/&gt;
		&amp;lt;/many-to-many&amp;gt;&lt;br/&gt;
	&amp;lt;/entity&amp;gt;&lt;br/&gt;
&amp;lt;/doctrine-mapping&amp;gt;&lt;/p&gt;
{/code}

&lt;p&gt;I have post all the mapping, but it&apos;s Doctrine compliant.&lt;br/&gt;
PlayerEntity extends PlayerBaseEntity, and Option is a standalone Entity.&lt;br/&gt;
All define an auto generated identifier.&lt;br/&gt;
The join table is correctly configured.&lt;/p&gt;

&lt;p&gt;Do you need this mapping to create tests ?&lt;br/&gt;
To sum-up, this is a simply ManyToMany relation between an inheritance Entity &amp;amp; a simple Entity.&lt;/p&gt;

&lt;p&gt;Do you need any else ?&lt;/p&gt;

&lt;p&gt;Thomas.&lt;/p&gt;</comment>
                    <comment id="16713" author="beberlei" created="Fri, 28 Oct 2011 21:47:48 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                    <comment id="16782" author="beberlei" created="Tue, 8 Nov 2011 23:50:41 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-161&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/161&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/161&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18051" author="beberlei" created="Thu, 7 Jun 2012 18:51:50 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-161&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/161&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/161&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18052" author="beberlei" created="Thu, 7 Jun 2012 23:56:49 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-161&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/161&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/161&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11078" name="ObjectHydrator_DDC-1410_v1.patch" size="1127" author="armetiz" created="Thu, 20 Oct 2011 14:59:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1360] Reserved words escaping fails when using multiple reserved words</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1360</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Everything works fine when I use the &lt;tt&gt;@Table&lt;/tt&gt; annotation like this: &lt;tt&gt;@Table(name=&quot;`user`&quot;)&lt;/tt&gt;. But when the &lt;tt&gt;user&lt;/tt&gt; table is in the &lt;tt&gt;user&lt;/tt&gt; schema and I try to use the annotion in this way: &lt;tt&gt;@Table(name=&quot;`user`.`user`&quot;)&lt;/tt&gt; &#8212; everything falls apart.&lt;/p&gt;

&lt;p&gt;A quick look into the code showed that it checks if the table name starts with &lt;tt&gt;`&lt;/tt&gt;, and if it does, it sets the &lt;tt&gt;quoted&lt;/tt&gt; parameter to &lt;tt&gt;true&lt;/tt&gt; and removes the &lt;tt&gt;`&lt;/tt&gt; characters on the both sides. So, if I quote the both words like &lt;tt&gt;@Table(name=&quot;`user`.`user`&quot;)&lt;/tt&gt;, the table name becomes &lt;tt&gt;&quot;user`.`user&quot;&lt;/tt&gt; and it, of course, fails. If I quote it just like &lt;tt&gt;@Table(name=&quot;`user.user`&quot;)&lt;/tt&gt;, the table name becomes &lt;tt&gt;&quot;user.user&quot;&lt;/tt&gt;, which fails too.&lt;/p&gt;

&lt;p&gt;If Doctrine allows to escape the reserved words, it should take into account this kind of usage as well.&lt;/p&gt;</description>
                <environment>Linux, PostgreSQL</environment>
            <key id="12994">DDC-1360</key>
            <summary>Reserved words escaping fails when using multiple reserved words</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="elnur">Elnur Abdurrakhimov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 3 Sep 2011 07:51:45 +0000</created>
                <updated>Tue, 3 Jan 2012 21:51:56 +0000</updated>
                    <resolved>Sat, 31 Dec 2011 10:22:59 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.2-BETA2</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16434" author="guilhermeblanco" created="Mon, 5 Sep 2011 05:38:30 +0000"  >&lt;p&gt;By now, it&apos;s currently impossible to do cross database joins in an easy way.&lt;br/&gt;
We have planned it through the schema support in @Table.&lt;/p&gt;

&lt;p&gt;I&apos;ll be working on this support for 2.2, but until there, my only recommendation is to not use a keyword as a table name.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="16436" author="elnur" created="Mon, 5 Sep 2011 08:10:36 +0000"  >&lt;p&gt;It&apos;s not cross database; it&apos;s just &lt;tt&gt;schema.table&lt;/tt&gt; in PostgreSQL. It works when not using reserved words, but fails with them.&lt;/p&gt;</comment>
                    <comment id="16716" author="beberlei" created="Fri, 28 Oct 2011 22:37:56 +0000"  >&lt;p&gt;How much of this ticket does your commit from some weeks ago cover guilherme?&lt;/p&gt;</comment>
                    <comment id="16849" author="beberlei" created="Wed, 16 Nov 2011 22:49:12 +0000"  >&lt;p&gt;Fixed for 2.2&lt;/p&gt;</comment>
                    <comment id="17082" author="elnur" created="Wed, 21 Dec 2011 18:16:56 +0000"  >&lt;p&gt;It still doesn&apos;t work. Tried on &lt;tt&gt;master&lt;/tt&gt;.&lt;/p&gt;</comment>
                    <comment id="17083" author="beberlei" created="Wed, 21 Dec 2011 23:00:16 +0000"  >&lt;p&gt;what kind of error do you get?&lt;/p&gt;</comment>
                    <comment id="17130" author="beberlei" created="Wed, 28 Dec 2011 18:31:09 +0000"  >&lt;p&gt;could reproduce the problem with table names and sequence names.&lt;/p&gt;</comment>
                    <comment id="17131" author="beberlei" created="Wed, 28 Dec 2011 19:31:02 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                    <comment id="17150" author="elnur" created="Thu, 29 Dec 2011 22:46:47 +0000"  >&lt;p&gt;I&apos;ve just got fresh clones of &lt;tt&gt;doctrine-doctrine2&lt;/tt&gt;, &lt;tt&gt;doctrine-dbal&lt;/tt&gt; and &lt;tt&gt;doctrine-common&lt;/tt&gt; &#8212; all on their &lt;tt&gt;master&lt;/tt&gt; branches.&lt;/p&gt;

&lt;p&gt;My entity has this 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-java&quot;&gt;@ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`user`.`user`&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m getting the following 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;SQLSTATE[42P01]: Undefined table: 7 ERROR: relation &lt;span class=&quot;code-quote&quot;&gt;&quot;user.user&quot;&lt;/span&gt; 
does not exist LINE 1: ... is_private9,
u0_.created_at AS created_at10 FROM &quot;user.user... 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So, it&apos;s translating &lt;tt&gt;`user`.`user`&lt;/tt&gt; to &lt;tt&gt;&quot;user.user&quot;&lt;/tt&gt;, while it should be &lt;tt&gt;&quot;user&quot;.&quot;user&quot;&lt;/tt&gt;.&lt;/p&gt;</comment>
                    <comment id="17151" author="elnur" created="Thu, 29 Dec 2011 22:58:24 +0000"  >&lt;p&gt;What changed is that earlier &lt;tt&gt;`user`.`user`&lt;/tt&gt; was translated to &lt;tt&gt;&quot;user`.`user&quot;&lt;/tt&gt;, while now it&apos;s translated to &lt;tt&gt;&quot;user.user&quot;&lt;/tt&gt;, but should be to &lt;tt&gt;&quot;user&quot;.&quot;user&quot;&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I saw the commit related to this ticket (&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/959a68694e5827a74ad5b8c8216996ffff6196ba&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/959a68694e5827a74ad5b8c8216996ffff6196ba&lt;/a&gt;) and I want to note that I&apos;m getting this error &lt;em&gt;not&lt;/em&gt; when creating a table, but when &lt;em&gt;querying&lt;/em&gt; it. I don&apos;t use Doctrine for creating tables anyway &#8212; I do it via plain SQL.&lt;/p&gt;</comment>
                    <comment id="17157" author="beberlei" created="Sat, 31 Dec 2011 10:22:59 +0000"  >&lt;p&gt;I keep trying until i fixed this, now with a commit into DBAL: &lt;a href=&quot;https://github.com/doctrine/dbal/commit/4cb8a99b65fb08e01fbc02cf9c0e07255e3f8463&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/commit/4cb8a99b65fb08e01fbc02cf9c0e07255e3f8463&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Will be included in Beta 2&lt;/p&gt;</comment>
                    <comment id="17161" author="elnur" created="Sat, 31 Dec 2011 13:03:06 +0000"  >&lt;p&gt;Now &lt;tt&gt;`user`.user&lt;/tt&gt;, &lt;tt&gt;`user`.`user`&lt;/tt&gt; and &lt;tt&gt;`user.user`&lt;/tt&gt; get escaped properly, ending up as &lt;tt&gt;&quot;user&quot;.&quot;user&quot;&lt;/tt&gt;. Interestingly enough, even only the beginning tick like in &lt;tt&gt;`user.user&lt;/tt&gt; ends up as &lt;tt&gt;&quot;user&quot;.&quot;user&quot;&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;user.`user`&lt;/tt&gt;, though, results in &lt;tt&gt;user.`user`&lt;/tt&gt; &#8212; that is, nothing gets escaped. I don&apos;t think this is a big deal, because if I can escape both schema and table name parts, then I won&apos;t run into problems. I&apos;m pointing this out in case it was intended to affect the escaping too.&lt;/p&gt;

&lt;p&gt;Good job, thanks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1341] MultiTableUpdateExecutor does not bind parameters properly</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1341</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, I found really annoing bug in multi table update executor, it doesn&apos;t bind parameters properly. I have following structure of entities (afaik not really important, bug should appear with any class inheritance structure)&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;type&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;NodeEntity&quot;&lt;/span&gt;, forum = &lt;span class=&quot;code-quote&quot;&gt;&quot;ForumEntity&quot;&lt;/span&gt;})
*/
class NodeEntity
{
  &lt;span class=&quot;code-comment&quot;&gt;// ... some params
&lt;/span&gt;}

/**
* @entity
*/
class ForumEntity
{
/**
* @manyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Author&quot;&lt;/span&gt;)
*/
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $lastPostAuthor;


/**
* @column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;)
*/
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $tLastPost;
&lt;span class=&quot;code-comment&quot;&gt;// ... some params
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And I&apos;m trying to run following 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;$qb = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;createQueryBuilder()
			-&amp;gt;update(&apos;ForumEntity&apos;, &apos;f&apos;)
			-&amp;gt;set(&apos;f.nPosts&apos;, &apos;f.nPosts + 1&apos;)
			-&amp;gt;set(&apos;f.tLastPost&apos;, &apos;:tLastPost&apos;)-&amp;gt;setParameter(&apos;tLastPost&apos;, $post-&amp;gt;getTCreation()) &lt;span class=&quot;code-comment&quot;&gt;// $post-&amp;gt;getTCreation() returns an instance of DateTime
&lt;/span&gt;			-&amp;gt;set(&apos;f.lastPostAuthor&apos;, &apos;:author&apos;)-&amp;gt;setParameter(&apos;author&apos;, $post-&amp;gt;getAuthor()) &lt;span class=&quot;code-comment&quot;&gt;// $post-&amp;gt;getAuthor() returns an instance of AuthorEntity
&lt;/span&gt;
			-&amp;gt;where(&apos;f.lft &amp;lt;= :left&apos;)-&amp;gt;setParameter(&apos;left&apos;, $forum-&amp;gt;getLft())
			-&amp;gt;andWhere(&apos;f.rgt &amp;gt;= :right&apos;)-&amp;gt;setParameter(&apos;right&apos;, $forum-&amp;gt;getRgt())
			-&amp;gt;andWhere(&apos;f.root = :root&apos;)-&amp;gt;setParameter(&apos;root&apos;, $forum-&amp;gt;getRoot());

		$qb-&amp;gt;getQuery()-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which fails with &quot;recoverable error&quot;, because Doctrine tries to convert value of parameter &apos;right&apos; to datetime. I have learned why it does so, it is because of line 157 in already mentioned MultiTableUpdateExecutor - while parameters for the insert query are sliced of parameters from update clause, their types are not. And that is a bit problematic.&lt;/p&gt;

&lt;p&gt;But that is not the only problem, if you look at line 161, the update query receives parameters as they were binded to QueryBuilder, so when I bind there an object, the update query receives the object instead of his identificator. That leads to error like &quot;object ... could not be converted to string&quot;. And also, the update query does not receive any information about type of parameters, but I&apos;m not sure if that is also a bug.&lt;/p&gt;

&lt;p&gt;I&apos;m not a native english speaker so if I explain things chaotically, just say so please, I&apos;ll try better &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="12939">DDC-1341</key>
            <summary>MultiTableUpdateExecutor does not bind parameters properly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="pave.kucera">Pavel Ku&#269;era</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Aug 2011 09:58:54 +0000</created>
                <updated>Sun, 28 Aug 2011 19:50:41 +0000</updated>
                    <resolved>Sun, 28 Aug 2011 16:45:16 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16395" author="beberlei" created="Sun, 28 Aug 2011 14:42:23 +0000"  >&lt;p&gt;Assigned to Guilherme&lt;/p&gt;</comment>
                    <comment id="16396" author="guilhermeblanco" created="Sun, 28 Aug 2011 16:45:16 +0000"  >&lt;p&gt;Fixed since this commit: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/e7f471ef3e1ffa5e180623115a45f423572549e4&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/e7f471ef3e1ffa5e180623115a45f423572549e4&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16397" author="beberlei" created="Sun, 28 Aug 2011 19:50:41 +0000"  >&lt;p&gt;Merged into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1302] orphan-removal does not work in XML</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1302</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The check for $oneToManyElement-&amp;gt;&lt;/p&gt;
{&apos;orphan-removal&apos;}
&lt;p&gt; returns false, the right check would be $oneToManyElement&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orphan-removal&amp;#39;&amp;#93;&lt;/span&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12867">DDC-1302</key>
            <summary>orphan-removal does not work in XML</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Jul 2011 09:09:13 +0000</created>
                <updated>Sun, 31 Jul 2011 09:38:52 +0000</updated>
                    <resolved>Sun, 31 Jul 2011 09:38:52 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16242" author="beberlei" created="Sun, 31 Jul 2011 09:38:52 +0000"  >&lt;p&gt;Fixed and merged into 2.0.x and 2.1.x branches.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2073] PersistentCollection::matching() always returns empty collection, when passed criteria&apos;s expression is created using ExpressionBuilder::isNull()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2073</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This happens because expression created by ExpressionBuilder::isNull() is wrongly translated to SQL using &apos;=&apos; operator instead of &apos;IS NULL&apos;.&lt;/p&gt;

&lt;p&gt;If the collection is already loaded, result is as expected.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14123">DDC-2073</key>
            <summary>PersistentCollection::matching() always returns empty collection, when passed criteria&apos;s expression is created using ExpressionBuilder::isNull()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="pauci">Pavol Kirschbaum</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Oct 2012 12:57:46 +0000</created>
                <updated>Mon, 12 Nov 2012 14:07:01 +0000</updated>
                    <resolved>Mon, 12 Nov 2012 14:07:01 +0000</resolved>
                            <version>2.3</version>
                                <fixVersion>2.3.1</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18946" author="mnapoli" created="Tue, 6 Nov 2012 14:21:13 +0000"  >&lt;p&gt;Pull request: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/508&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/508&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1961] BC Break: Explicit parameter type definitions are discarded when using AbstractQuery::setParameter</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1961</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In 2.2.x it was possible to explicitly specify a type of a parameter in query. In code below, I used a Type::DATE to explicitly say that it should be converted to date type rather than datetime. In 2.3-RC1, it is completely ignored.&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;// $query &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; AbstractQuery
&lt;/span&gt;$query-&amp;gt;setParameter(&apos;day&apos;, $date, Type::DATE)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Pull request: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/416&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/416&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13901">DDC-1961</key>
            <summary>BC Break: Explicit parameter type definitions are discarded when using AbstractQuery::setParameter</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="majkl578">Michael Moravec</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Jul 2012 14:28:16 +0000</created>
                <updated>Tue, 31 Jul 2012 20:44:33 +0000</updated>
                    <resolved>Tue, 31 Jul 2012 20:44:33 +0000</resolved>
                            <version>2.3</version>
                                <fixVersion>2.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18422" author="beberlei" created="Tue, 31 Jul 2012 20:44:33 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1668] bug with reading cached annotations in Annotation driver</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1668</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I had a problem with Class Table Inheritance on first call of a child entity it was working but if call another child in another instance it was not joining with the parent class. After some debugging i found the problem it was not detecting the annotation that is a parent entity to be joined in Doctrine\ORM\Mapping\Driver\AnnotationDriver when the function on line 479 isTransient($className) is called. So after more debugging i found the problem it is in &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;is_int(key($classAnnotations))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Looks like that after it is cached in and then the cache is read when it returns the array of annotations for the entity class the keys are returned as strings not as integer and if the key is &apos;0&apos; the the value that is_int returns is NULL so the check &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; ($classAnnotations &amp;amp;&amp;amp; is_int(key($classAnnotations))) 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;fails and it does not foreach the the array of annotations. &lt;br/&gt;
Also i found that you are making that check in a couple of places so I maid a quick fix for my self in the Doctrine\Common\Annotations\CachedReader which is if annotations are found that are cached before returning them i call array_values &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;// Attempt to grab data from cache
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (($data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cache-&amp;gt;fetch($cacheKey)) !== &lt;span class=&quot;code-keyword&quot;&gt;false&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;debug || $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;isCacheFresh($cacheKey, $class)) {
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; array_values($data);
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I am using APC cache.  &lt;/p&gt;</description>
                <environment></environment>
            <key id="13477">DDC-1668</key>
            <summary>bug with reading cached annotations in Annotation driver</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="vigor_bg">victor Velkov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Feb 2012 15:04:59 +0000</created>
                <updated>Sat, 3 Mar 2012 21:25:54 +0000</updated>
                    <resolved>Sat, 3 Mar 2012 21:25:54 +0000</resolved>
                            <version>2.2</version>
                                <fixVersion>2.2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17509" author="beberlei" created="Sat, 3 Mar 2012 21:25:54 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1620] Partial merge of PR261</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1620</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The PR261 &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; has two commits, but only one (the first one) was merged to 2.1 and 2.2&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;https://github.com/doctrine/doctrine2/pull/261&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/261&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13387">DDC-1620</key>
            <summary>Partial merge of PR261</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Jan 2012 11:43:03 +0000</created>
                <updated>Wed, 25 Jan 2012 22:29:59 +0000</updated>
                    <resolved>Wed, 25 Jan 2012 21:39:04 +0000</resolved>
                            <version>2.1</version>
                <version>2.1.1</version>
                <version>2.1.2</version>
                <version>2.1.3</version>
                <version>2.1.4</version>
                <version>2.1.5</version>
                <version>2.2-BETA1</version>
                <version>2.2-BETA2</version>
                <version>2.2.0-RC1</version>
                                <fixVersion>2.1.6</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17334" author="beberlei" created="Wed, 25 Jan 2012 21:39:04 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                    <comment id="17337" author="mvrhov" created="Wed, 25 Jan 2012 22:22:37 +0000"  >&lt;p&gt;Hm github is still saying that this is not in 2.2 branch....&lt;/p&gt;</comment>
                    <comment id="17338" author="beberlei" created="Wed, 25 Jan 2012 22:29:05 +0000"  >&lt;p&gt;Cherrypick&lt;/p&gt;</comment>
                    <comment id="17339" author="beberlei" created="Wed, 25 Jan 2012 22:29:59 +0000"  >&lt;p&gt;ah no, now its up. thanks&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1607] Entity with eager loaded association is not found when association is null</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1607</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Two entities: A and B&lt;/p&gt;

&lt;p&gt;A:&lt;br/&gt;
id PRIMARY&lt;br/&gt;
b NULLABLE&lt;/p&gt;

&lt;p&gt;B:&lt;br/&gt;
id PRIMARY&lt;/p&gt;

&lt;p&gt;Situation: A.b is null and set to eager loading (with fetch=&quot;EAGER&quot;), find(id) is called for object A&lt;/p&gt;

&lt;p&gt;Actual Behaviour: The record from A is not found (probably due to an INNER JOIN being used).&lt;/p&gt;

&lt;p&gt;Expected behaviour: Entity A is loaded with b set to null (like during lazy loading).&lt;/p&gt;</description>
                <environment></environment>
            <key id="13368">DDC-1607</key>
            <summary>Entity with eager loaded association is not found when association is null</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mkoonstra">Marcel Koonstra</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Jan 2012 15:17:34 +0000</created>
                <updated>Sat, 21 Jan 2012 13:05:47 +0000</updated>
                    <resolved>Sat, 21 Jan 2012 13:05:47 +0000</resolved>
                            <version>2.2-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17298" author="guilhermeblanco" created="Wed, 18 Jan 2012 06:14:59 +0000"  >&lt;p&gt;Increasing priority&lt;/p&gt;</comment>
                    <comment id="17299" author="guilhermeblanco" created="Wed, 18 Jan 2012 15:25:29 +0000"  >&lt;p&gt;It seems to be associated with this commit:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/68663fac4b5619643b8a140d6bbe7031e4fa2ad5#comments&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/68663fac4b5619643b8a140d6bbe7031e4fa2ad5#comments&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17300" author="guilhermeblanco" created="Wed, 18 Jan 2012 15:26:05 +0000"  >&lt;p&gt;Since it&apos;s a crash between versions, I&apos;m increasing priority and also marking as regression.&lt;/p&gt;</comment>
                    <comment id="17301" author="beberlei" created="Wed, 18 Jan 2012 18:58:34 +0000"  >&lt;p&gt;A blocker indeed, reschedulding RC1 release until this is fixed.&lt;/p&gt;</comment>
                    <comment id="17306" author="beberlei" created="Wed, 18 Jan 2012 21:23:21 +0000"  >&lt;p&gt;Can you show us the mappings, specifically how you map A#b? Are you setting nullable=false on the join columns?&lt;/p&gt;

&lt;p&gt;You problem could be related to:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/180&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/180&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/182/files&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/182/files&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17307" author="guilhermeblanco" created="Thu, 19 Jan 2012 04:23:12 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I was unable to reproduce your issue with the comments you made so far.&lt;br/&gt;
Are you able to modify the attached test file into a failure state that represents your problem?&lt;/p&gt;

&lt;p&gt;It may be easier for us to track down your problem after that.&lt;/p&gt;</comment>
                    <comment id="17309" author="mkoonstra" created="Thu, 19 Jan 2012 08:54:47 +0000"  >&lt;p&gt;Trying the test case on master, but can&apos;t seem to be able to reproduce the bug (same goes for the actual problem case)&lt;/p&gt;

&lt;p&gt;Maybe some code has changed allready? I will investigate further if I can reproduce the bug in master.&lt;/p&gt;</comment>
                    <comment id="17316" author="beberlei" created="Sat, 21 Jan 2012 13:05:47 +0000"  >&lt;p&gt;Closing as invalid, please reopen if you can reproduce, but it seems this is fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11153" name="DDC1607Test.php" size="1155" author="guilhermeblanco" created="Thu, 19 Jan 2012 04:23:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1587] Foreign key as Primary does not work as intended</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1587</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;In first time, sorry for my bad english.&lt;/p&gt;

&lt;p&gt;The feature Foreign key as Primary does not work as intended.&lt;/p&gt;

&lt;p&gt;The CLI tool report an error on validating mapping:&lt;br/&gt;
&lt;b&gt;The referenced column name &apos;pk_agent&apos; does not have a corresponding field with this column name on the class &apos;BddP\Model\Entity\Sd\Contact&apos;.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;If I run the application, many features works: querying, entity population.&lt;br/&gt;
But for persist a new Agent without associated entities for OneToOne; the ORM report :&lt;br/&gt;
&lt;b&gt;PDOException: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23502&amp;#93;&lt;/span&gt;: Not null violation on &quot;pk&quot; column&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;And If I comment all OneToOne, the persist work.&lt;/p&gt;

&lt;p&gt;Thank you in advance for your response.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Agent.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;BddP\Model\Entity\Repository\Sd\Agent&quot;&lt;/span&gt;)
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;agent&quot;&lt;/span&gt;)
 */
class Agent &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; AEntity
{
    /**
     * Agent ID
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
     *
     * @Id
     * @GeneratedValue
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&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; $pk;
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; BddP\Model\Entity\Sd\Contact
     *
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;BddP\Model\Entity\Sd\Contact&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;remove,merge,detach&quot;&lt;/span&gt;}, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;agent&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk_agent&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $contact;

    [...]

}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Contact.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;contact&quot;&lt;/span&gt;)
 */
class Contact &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; AEntity
{
    /**
     * The agent
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; BddP\Model\Entity\Sd\Agent
     *
     * @Id
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;BddP\Model\Entity\Sd\Agent&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;contact&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk_agent&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $agent;

    [...]

}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13341">DDC-1587</key>
            <summary>Foreign key as Primary does not work as intended</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="presteus">Presteus</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Jan 2012 17:29:46 +0000</created>
                <updated>Tue, 17 Jan 2012 03:33:05 +0000</updated>
                    <resolved>Tue, 17 Jan 2012 03:33:05 +0000</resolved>
                            <version>2.1.5</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17175" author="presteus" created="Sun, 8 Jan 2012 17:40:08 +0000"  >&lt;p&gt;In addition,&lt;br/&gt;
1. The generated SQL from CLI tool is correct.&lt;br/&gt;
2. I think the problem is located when the associated entity request the Primary Key.&lt;/p&gt;</comment>
                    <comment id="17178" author="presteus" created="Sun, 8 Jan 2012 21:17:54 +0000"  >&lt;p&gt;After some dumping. I found a strange state :&lt;/p&gt;

&lt;p&gt;BasicEntityPersister : $this-&amp;gt;_getInsertSQL() returns&lt;br/&gt;
&lt;b&gt;INSERT INTO agent (pk, name, firstname, birthday, email, address, city, postcode, phone, mobile) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;And the PK parameter in $insertData has null value &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
  &apos;agent&apos; =&amp;gt; 
    array
      &apos;pk&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;name&apos; =&amp;gt; string &apos;XXX&apos; (length=7)
      &apos;firstname&apos; =&amp;gt; string &apos;YYY&apos; (length=8)
      &apos;birthday&apos; =&amp;gt; 
        object(DateTime)[283]
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;date&apos; =&amp;gt; string &apos;1970-01-01 00:00:00&apos; (length=19)
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;timezone_type&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 3
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;timezone&apos; =&amp;gt; string &apos;Europe/Paris&apos; (length=12)
      &apos;email&apos; =&amp;gt; string &apos;email@domain.tdl&apos; (length=16)
      &apos;address&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;city&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;postcode&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;phone&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;mobile&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But the variable $idGen constains the right value...&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;object(Doctrine\ORM\Id\SequenceGenerator)[335]
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &apos;_allocationSize&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &apos;_sequenceName&apos; =&amp;gt; string &apos;agent_pk_seq&apos; (length=12)
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &apos;_nextValue&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 451
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &apos;_maxValue&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 451&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What have I misunderstood?&lt;/p&gt;</comment>
                    <comment id="17179" author="presteus" created="Sun, 8 Jan 2012 23:15:52 +0000"  >&lt;p&gt;After some test, other entity do not reproduce this error.&lt;/p&gt;

&lt;p&gt;So the only one reason for this bug: The mapping is incorrect.&lt;/p&gt;

&lt;p&gt;And I find... This annotation &lt;b&gt;@JoinColumn(name=&quot;pk_agent&quot;, referencedColumnName=&quot;pk&quot;)&lt;/b&gt; add a foreign key on agent primary key.&lt;/p&gt;

&lt;p&gt;But in the documentation the default value are `id` for PK and `table_id`for FK.&lt;/p&gt;

&lt;p&gt;Then my question is still open: &lt;em&gt;What have I misunderstood?&lt;/em&gt;&lt;/p&gt;</comment>
                    <comment id="17226" author="guilhermeblanco" created="Fri, 13 Jan 2012 04:42:07 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Can you please try to wrap your issue into a test case?&lt;br/&gt;
I could not reproduce here.&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;</comment>
                    <comment id="17248" author="beberlei" created="Sun, 15 Jan 2012 12:35:19 +0000"  >&lt;p&gt;First, schema validator had a bug that reported this errors in mapping although it was correct.&lt;/p&gt;

&lt;p&gt;Second, I think your mapping is wrong. In this case you cannot have a bidirectional OneToOne.&lt;/p&gt;</comment>
                    <comment id="17254" author="presteus" created="Sun, 15 Jan 2012 14:29:55 +0000"  >&lt;p&gt;Thanks for our response and your time, especially Guilherme for my no response.&lt;/p&gt;

&lt;p&gt;I&apos;m right with you Benjamin, it is my responsability to determinate wich field do not need to create a FK...&lt;/p&gt;

&lt;p&gt;This is the point of my misunderstood.&lt;/p&gt;
</comment>
                    <comment id="17289" author="presteus" created="Mon, 16 Jan 2012 22:15:06 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I reopen this issue because the problem still alive, not totally the same but it&apos;s a side effect due to the removal of the @JoinColumn.&lt;/p&gt;

&lt;p&gt;Without the annotation my Agent do not retrieve the Identifier &lt;b&gt;if and only if the Identifier have all fields with null value&lt;/b&gt; (except PK of course).&lt;br/&gt;
With the annotation my Agent retrieve the Identifier but the valide-schema returns:&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;[Mapping]  FAIL - The entity-class &apos;Entity\Agent&apos; mapping is invalid:
* The referenced column name &apos;pk_agent&apos; does not have a corresponding field with &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; column name on the class &apos;Entity\Identifier&apos;.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And the dump for schema-tool returns&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;ALTER TABLE agent ADD CONSTRAINT FK_268B9C9DB486D3D9 FOREIGN KEY (pk) REFERENCES identifier(pk_agent) NOT DEFERRABLE INITIALLY IMMEDIATE;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For the moment, I do not trace inside the core of framework but i think the problem turn around the @JoinColum and custom name for primary key.&lt;/p&gt;

&lt;p&gt;If i do not use the join colum, how the framework retrieve pk name ?&lt;br/&gt;
But if I provide the join column, Doctrine create a FK (without considering mapping error).&lt;/p&gt;</comment>
                    <comment id="17290" author="presteus" created="Mon, 16 Jan 2012 22:16:29 +0000"  >&lt;p&gt;Basic Agent and Identifier entities.&lt;/p&gt;</comment>
                    <comment id="17291" author="guilhermeblanco" created="Tue, 17 Jan 2012 03:33:05 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I added coverage for your issue in master.&lt;br/&gt;
It seems the issue have been addressed already. Are you able to upgrade?&lt;/p&gt;

&lt;p&gt;Commit reference: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/0f070448367f90dffb81225c680ef9b3490a3f0a&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/0f070448367f90dffb81225c680ef9b3490a3f0a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;@beberlei He&apos;s still able to make a bidirectional association, there&apos;s not restriction for that code-wise.&lt;/p&gt;

&lt;p&gt;Closing the issue as invalid, since recent versions have already addressed the issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11150" name="AgentDdc1587.php" size="3166" author="presteus" created="Mon, 16 Jan 2012 22:16:29 +0000" />
                    <attachment id="11151" name="IdentifierDdc1587.php" size="2852" author="presteus" created="Mon, 16 Jan 2012 22:16:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1509] Issue when merging entity with several associations to inherited classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1509</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging entity with several associations to inherited classes update data gathering is broken after first inheritance processing because $entity variable is overwritten with another object.&lt;/p&gt;

&lt;p&gt;The problem is in the line&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/08716d9f72996bab8c71a8cc8bda72d3925e8fb1#commitcomment-741698&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/08716d9f72996bab8c71a8cc8bda72d3925e8fb1#commitcomment-741698&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test case will be attached shortly,&lt;/p&gt;</description>
                <environment></environment>
            <key id="13214">DDC-1509</key>
            <summary>Issue when merging entity with several associations to inherited classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Nov 2011 16:46:58 +0000</created>
                <updated>Thu, 15 Dec 2011 14:21:38 +0000</updated>
                    <resolved>Wed, 23 Nov 2011 19:54:07 +0000</resolved>
                            <version>2.1.3</version>
                <version>Git Master</version>
                                <fixVersion>2.1.4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16909" author="beberlei" created="Wed, 23 Nov 2011 16:57:32 +0000"  >&lt;p&gt;Raised to blocker.&lt;/p&gt;

&lt;p&gt;I will fix that tonight and release a new ORM 2.1.* branch.&lt;/p&gt;</comment>
                    <comment id="16911" author="beberlei" created="Wed, 23 Nov 2011 19:54:07 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="16989" author="wmoussel" created="Thu, 15 Dec 2011 14:05:19 +0000"  >&lt;p&gt;Hey I have something similar with one-to-one, can you tell me which git commit this relates to so I can investigate?&lt;/p&gt;

&lt;p&gt;And i think it worked fine on 2.1.3 and not anymore&lt;/p&gt;</comment>
                    <comment id="16990" author="gedrox" created="Thu, 15 Dec 2011 14:21:38 +0000"  >&lt;p&gt;It&apos;s &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/80fae20f749f8db95156e333c430780a0717002f&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/80fae20f749f8db95156e333c430780a0717002f&lt;/a&gt; I guess.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11115" name="DDC1509Test.php" size="3068" author="gedrox" created="Wed, 23 Nov 2011 16:50:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1492] Fatall error: Cannot use object as array in ORM\Internal\Hydration\ObjectHydrator.php on line 314</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1492</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;My entities&lt;/p&gt;

&lt;p&gt;event &lt;br/&gt;
eveht.event_area_id=event_area.id (1:1)&lt;br/&gt;
event_area.event_id=event.id (1:1)&lt;br/&gt;
event_area.area.id=area.id (one area has many event_area&apos;s)&lt;br/&gt;
area.parent_id=area_id (hierarchial)&lt;br/&gt;
event.author_id=user.id (one user has many events)&lt;/p&gt;

&lt;p&gt;area - STI: District/City/Region/Country/etc.&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
	r, ra, a, ap, au, DATE(r.eventTime) AS event_date
FROM OloloEventsBundle:Event r
	LEFT JOIN r.eventArea ra
		LEFT JOIN ra.area a
			LEFT JOIN a.parent ap
	INNER JOIN r.author au WHERE r.eventTime &amp;lt;= :r_eventtime AND ra.area IN(:ra_area)
GROUP BY r
ORDER BY event_date DESC
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This DQL caused an error &quot;Cannot use object of type District as array in ORM\Internal\Hydration\ObjectHydrator.php on line 314&quot;. When I&apos;m removing `ap` friom fetching - it works. Mapping are correct - there are many other places where it works correctly.&lt;/p&gt;</description>
                <environment>Symfony2, Doctrine 2.1.1 (also bug present on 2.1.3-dev - latest revison of 2.1.x branch)</environment>
            <key id="13184">DDC-1492</key>
            <summary>Fatall error: Cannot use object as array in ORM\Internal\Hydration\ObjectHydrator.php on line 314</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="koc">Konstantin</reporter>
                        <labels>
                    </labels>
                <created>Sun, 13 Nov 2011 21:51:04 +0000</created>
                <updated>Tue, 15 Nov 2011 03:10:16 +0000</updated>
                    <resolved>Tue, 15 Nov 2011 03:10:16 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16813" author="beberlei" created="Sun, 13 Nov 2011 22:23:08 +0000"  >&lt;p&gt;On 2.1.1 line 314 is a &quot;}&quot;. Can you restate the line and add a stack trace if possible (xdebug or phpunit can help there).&lt;/p&gt;</comment>
                    <comment id="16814" author="koc" created="Sun, 13 Nov 2011 22:33:33 +0000"  >&lt;p&gt;Sorry, line was changed cause I&apos;ve updated to 2.1.3-dev.&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;( ! ) Fatal error: Cannot use object of type Ololo\Bundle\TerritorialBundle\Entity\District as array in Z:\home\dev\Ololo\code\vendors\Doctrine\Orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 308
Call Stack
#	Time	Memory	Function	Location
1	0.0006	333520	{main}( )	..\index_dev.php:0
2	0.0254	1435584	Symfony\Component\HttpKernel\Kernel-&amp;gt;handle( )	..\index_dev.php:20
3	0.2454	3634168	Symfony\Bundle\FrameworkBundle\HttpKernel-&amp;gt;handle( )	..\Kernel.php:171
4	0.2454	3634576	Symfony\Component\HttpKernel\HttpKernel-&amp;gt;handle( )	..\HttpKernel.php:44
5	0.2454	3634576	Symfony\Component\HttpKernel\HttpKernel-&amp;gt;handleRaw( )	..\HttpKernel.php:71
6	0.3589	5534264	call_user_func_array ( )	..\HttpKernel.php:117
7	0.3590	5534448	Ololo\Bundle\DistrictsBundle\Controller\DistrictController-&amp;gt;EventsPastAction( )	..\HttpKernel.php:0
8	1.1606	13782464	Ololo\Bundle\EventsBundle\Entity\EventRepository-&amp;gt;getPastEventsByAreasIds( )	..\DistrictController.php:145
9	1.1607	13783520	Ololo\Bundle\EventsBundle\Entity\EventRepository-&amp;gt;getEventsSliceBySpecification( )	..\EventRepository.php:385
10	1.2010	14224216	Doctrine\ORM\AbstractQuery-&amp;gt;getResult( )	..\EventRepository.php:477
11	1.2010	14224368	Doctrine\ORM\AbstractQuery-&amp;gt;execute( )	..\AbstractQuery.php:392
12	3.3409	14781264	Doctrine\ORM\Internal\Hydration\AbstractHydrator-&amp;gt;hydrateAll( )	..\AbstractQuery.php:594
13	3.3412	14785824	Doctrine\ORM\Internal\Hydration\ObjectHydrator-&amp;gt;_hydrateAll( )	..\AbstractHydrator.php:99
14	3.3413	14798576	Doctrine\ORM\Internal\Hydration\ObjectHydrator-&amp;gt;_hydrateRow( )	..\ObjectHydrator.php:140
&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;                    $parentObject = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_resultPointers[$parentAlias][key($first)]; &lt;span class=&quot;code-comment&quot;&gt;// trouble here, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_resultPointers[$parentAlias] is object of District&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16818" author="guilhermeblanco" created="Mon, 14 Nov 2011 04:15:21 +0000"  >&lt;p&gt;Hi.&lt;/p&gt;

&lt;p&gt;If you change this line:&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;$parentObject = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_resultPointers[$parentAlias][key($first)];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To 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;$parentObject = $first[key($first)];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Does it work for you?&lt;/p&gt;</comment>
                    <comment id="16819" author="koc" created="Mon, 14 Nov 2011 08:53:21 +0000"  >&lt;p&gt;yes, with this line of code this query works.&lt;/p&gt;</comment>
                    <comment id="16831" author="guilhermeblanco" created="Tue, 15 Nov 2011 03:10:16 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/77e076f1fdbe24fdb2f5a1fb1842c0b9cb7d95a4&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/77e076f1fdbe24fdb2f5a1fb1842c0b9cb7d95a4&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This issue was fixed in master.&lt;br/&gt;
I requested Benjamin to merge this with 2.1 branch.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1871] Create a relation between two Entities in different EntityManager</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1871</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I&apos;m working on a Symfony based CMS for a  game server. The game server use two databases (the `auth` database and `characters` database) and i&apos;ve created a new one for the CMS named `site`.&lt;/p&gt;

&lt;p&gt;Currently my News entity must have a relation with the Account entity but the News entity come from the Site EntityManager (who manage the `site` database) and the Account entity come from the Auth EntityManager (who manage the `auth` database).&lt;/p&gt;

&lt;p&gt;So, when I prompt the command &quot;php app/console doctrine:schema:update --em=&quot;site&quot; --force&quot; I got the error   &quot;Class Eluna\MemberBundle\Entity\Account is not a valid entity or mapped super class.&quot; But if I join an entity who is in the same EntityManager it work perfectly.&lt;/p&gt;

&lt;p&gt;My 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-none&quot;&gt;    /**
     * @var object $author
     *
     * @ORM\ManyToOne(targetEntity=&quot;Eluna\MemberBundle\Entity\Account&quot;)
     * @ORM\JoinColumn(name=&quot;author&quot;, referencedColumnName=&quot;id&quot;)
     */
    private $author;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Symfony2 with Doctrine2 using MySQL</environment>
            <key id="13775">DDC-1871</key>
            <summary>Create a relation between two Entities in different EntityManager</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="tibec">Tibec</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jun 2012 09:40:26 +0000</created>
                <updated>Sat, 16 Jun 2012 21:27:59 +0000</updated>
                    <resolved>Sat, 16 Jun 2012 21:27:59 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18091" author="beberlei" created="Sat, 16 Jun 2012 21:27:59 +0000"  >&lt;p&gt;Unless the entities are in the same database server (MySQL) but just in different databses you can use the syntax &quot;database.table&quot; in the @Table. Otherwise there is no nice solution, you have to save the foreign key manually in an integer column and maybe use an event listener to fetch a proxy of the related object. But that has to be coded manually.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1824] Native Query fail</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1824</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I keep getting an error while I&apos;m trying to perfom an native query. &lt;br/&gt;
If there is no result then everything is fine and I don&apos;t get any errors.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Notice: Undefined index: id in C:\xampp\htdocs\Symfony\vendor\doctrine\lib\Doctrine\ORM\UnitOfWork.php line 1949&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-none&quot;&gt; 
$sql = &quot;SELECT q.question FROM question q WHERE MATCH (q.question) AGAINST (?)&quot;;

$rsm = new \Doctrine\ORM\Query\ResultSetMapping;
$rsm-&amp;gt;addEntityResult(&apos;WWMGameBundle:Question&apos;, &apos;q&apos;);
$rsm-&amp;gt;addFieldResult(&apos;q&apos;, &apos;question&apos;, &apos;question&apos;);

$em = $this-&amp;gt;getDoctrine()-&amp;gt;getEntityManager();
$query = $em-&amp;gt;createNativeQuery($sql, $rsm);
$query-&amp;gt;setParameter(1, $request-&amp;gt;request-&amp;gt;get(&apos;q&apos;));

$search = $query-&amp;gt;getResult();
&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-none&quot;&gt; 
/**
* WWM\Entity\Question
*
* @ORM\Entity(repositoryClass=&quot;WWM\Entity\QuestionsRepository&quot;)
* @ORM\Table(name=&quot;question&quot;)
*/
class Question
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name=&quot;id&quot;, type=&quot;integer&quot;, nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy=&quot;IDENTITY&quot;)
     */
    private $id;

    /**
     * @var integer $level
     *
     * @ORM\Column(name=&quot;level&quot;, type=&quot;integer&quot;, nullable=false)
     */
    private $level;

    /**
     * @var string $question
     *
     * @ORM\Column(name=&quot;question&quot;, type=&quot;string&quot;, length=255, nullable=false)
     */
    private $question;



    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this-&amp;gt;id;
    }

    /**
     * Set level
     *
     * @param integer $level
     */
    public function setLevel($level)
    {
        $this-&amp;gt;level = $level;
    }

    /**
     * Get level
     *
     * @return integer
     */
    public function getLevel()
    {
        return $this-&amp;gt;level;
    }

    /**
     * Set question
     *
     * @param string $question
     */
    public function setQuestion($question)
    {
        $this-&amp;gt;question = $question;
    }

    /**
     * Get question
     *
     * @return string
     */
    public function getQuestion()
    {
        return $this-&amp;gt;question;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>XAMPP on Windows 7&lt;br/&gt;
Doctrine in Combination with Symfony</environment>
            <key id="13707">DDC-1824</key>
            <summary>Native Query fail</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mowee">Moritz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 May 2012 16:40:57 +0000</created>
                <updated>Sun, 27 May 2012 13:31:06 +0000</updated>
                    <resolved>Sun, 27 May 2012 07:42:39 +0000</resolved>
                            <version>2.1.6</version>
                                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17948" author="beberlei" created="Thu, 17 May 2012 21:39:23 +0000"  >&lt;p&gt;You have to add the id as field aswell using $rsm-&amp;gt;addFieldResult()&lt;/p&gt;</comment>
                    <comment id="17949" author="mowee" created="Thu, 17 May 2012 21:44:32 +0000"  >&lt;p&gt;It doesn&apos;t matter if I use the id as well. I keep getting the same error message:&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;$sql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT q.question FROM question q WHERE MATCH (q.question) AGAINST (?)&quot;&lt;/span&gt;;

$rsm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Query\ResultSetMapping;
$rsm-&amp;gt;addEntityResult(&apos;WWMGameBundle:Question&apos;, &apos;q&apos;);
$rsm-&amp;gt;addFieldResult(&apos;q&apos;, &apos;question&apos;, &apos;question&apos;);
$rsm-&amp;gt;addFieldResult(&apos;q&apos;, &apos;id&apos;, &apos;id&apos;);

$em = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDoctrine()-&amp;gt;getEntityManager();
$query = $em-&amp;gt;createNativeQuery($sql, $rsm);
$query-&amp;gt;setParameter(1, $request-&amp;gt;request-&amp;gt;get(&apos;q&apos;));

$search = $query-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="17957" author="mowee" created="Sun, 20 May 2012 22:53:57 +0000"  >&lt;p&gt;It doesn&apos;t matter if I use the id as well. I keep getting the same error message.&lt;/p&gt;</comment>
                    <comment id="17983" author="beberlei" created="Sun, 27 May 2012 07:42:39 +0000"  >&lt;p&gt;Do you want to fetch the whole Question Entity? Or just the question as string? Since you only do q.question i suppose using a scalar result instead of the entity 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;$sql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT q.question FROM question q WHERE MATCH (q.question) AGAINST (?)&quot;&lt;/span&gt;;

$rsm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Query\ResultSetMapping;
$rsm-&amp;gt;addScalarResult(&apos;question&apos;, &apos;question&apos;);

$em = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDoctrine()-&amp;gt;getEntityManager();
$query = $em-&amp;gt;createNativeQuery($sql, $rsm);
$query-&amp;gt;setParameter(1, $request-&amp;gt;request-&amp;gt;get(&apos;q&apos;));

$search = $query-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However if you want the whole entity, then you have to fetch the ID from sql 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;$sql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT q.id, q.question FROM question q WHERE MATCH (q.question) AGAINST (?)&quot;&lt;/span&gt;;

$rsm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Query\ResultSetMapping;
$rsm-&amp;gt;addEntityResult(&apos;WWMGameBundle:Question&apos;, &apos;q&apos;);
$rsm-&amp;gt;addFieldResult(&apos;q&apos;, &apos;question&apos;, &apos;question&apos;);
$rsm-&amp;gt;addFieldResult(&apos;q&apos;, &apos;id&apos;, &apos;id&apos;);

$em = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDoctrine()-&amp;gt;getEntityManager();
$query = $em-&amp;gt;createNativeQuery($sql, $rsm);
$query-&amp;gt;setParameter(1, $request-&amp;gt;request-&amp;gt;get(&apos;q&apos;));

$search = $query-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="18002" author="mowee" created="Sun, 27 May 2012 13:31:06 +0000"  >&lt;p&gt;Now it works perfectly fine. Thank you &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-1784] Error on generate entities: &apos;Attribute &quot;allocationSize&quot; of @ORM\SequenceGenerator&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1784</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When I generated my entities on version 2.2.2 through &quot;orm:convert-mapping&quot;, the sequence has a value &apos; allocationSize=&quot;1&quot;, initialValue=&quot;1&quot; &apos; with quotes. &lt;/p&gt;

&lt;p&gt;So I received an error: &lt;/p&gt;

&lt;p&gt;Attribute &quot;allocationSize&quot; of @ORM\SequenceGenerator declared on property entities\Test::$id expects a&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/thumbs_down.gif&quot; height=&quot;19&quot; width=&quot;19&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; integer, but got string. &lt;/p&gt;

&lt;p&gt;To fix, I removed the quotes. is It a bug?&lt;/p&gt;

&lt;p&gt;Part of entity generated:&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@var integer $id&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@ORM\Column(name=&quot;id&quot;, type=&quot;integer&quot;, precision=0, scale=0, nullable=false, unique=false)&lt;/li&gt;
	&lt;li&gt;@ORM\Id&lt;/li&gt;
	&lt;li&gt;@ORM\GeneratedValue(strategy=&quot;SEQUENCE&quot;)&lt;/li&gt;
	&lt;li&gt;@ORM\SequenceGenerator(sequenceName=&quot;test_id_seq&quot;, allocationSize=&quot;1&quot;, initialValue=&quot;1&quot;) /* SEE QUOTES ON allocationSize=&quot;1&quot;, initialValue=&quot;1&quot; */&lt;br/&gt;
     */&lt;br/&gt;
    private $id;&lt;/li&gt;
&lt;/ul&gt;

</description>
                <environment></environment>
            <key id="13641">DDC-1784</key>
            <summary>Error on generate entities: &apos;Attribute &quot;allocationSize&quot; of @ORM\SequenceGenerator&apos;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="augustoximenes">Augusto Ximenes de Souza</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Apr 2012 02:45:43 +0000</created>
                <updated>Sun, 27 May 2012 17:14:22 +0000</updated>
                    <resolved>Fri, 20 Apr 2012 01:40:47 +0000</resolved>
                            <version>2.2.2</version>
                                <fixVersion>2.2.3</fixVersion>
                <fixVersion>2.3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17862" author="augustoximenes" created="Wed, 18 Apr 2012 02:55:18 +0000"  >&lt;p&gt;I think the problem is on the line 1037 to 1042 of Class Doctrine \ ORM \ Tools \ EntityGenerator:&lt;/p&gt;

&lt;p&gt;                    if (isset($metadata-&amp;gt;sequenceGeneratorDefinition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;allocationSize&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                        $sequenceGenerator[] = &apos;allocationSize=&quot;&apos; . $metadata-&amp;gt;sequenceGeneratorDefinition[&apos;allocationSize&apos;] . &apos;&quot;&apos;;
                    }

&lt;p&gt;                    if (isset($metadata-&amp;gt;sequenceGeneratorDefinition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;initialValue&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                        $sequenceGenerator[] = &apos;initialValue=&quot;&apos; . $metadata-&amp;gt;sequenceGeneratorDefinition[&apos;initialValue&apos;] . &apos;&quot;&apos;;
                    }

&lt;p&gt;Replace to:&lt;/p&gt;

&lt;p&gt;                    if (isset($metadata-&amp;gt;sequenceGeneratorDefinition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;allocationSize&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                        $sequenceGenerator[] = &apos;allocationSize=&apos; . $metadata-&amp;gt;sequenceGeneratorDefinition[&apos;allocationSize&apos;];
                    }

&lt;p&gt;                    if (isset($metadata-&amp;gt;sequenceGeneratorDefinition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;initialValue&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                        $sequenceGenerator[] = &apos;initialValue=&apos; . $metadata-&amp;gt;sequenceGeneratorDefinition[&apos;initialValue&apos;];
                    }</comment>
                    <comment id="17873" author="fabio.bat.silva" created="Fri, 20 Apr 2012 01:40:46 +0000"  >&lt;p&gt;Fixed by : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/d5d47222c1dc5ea97ebd8f4c68834fbe4abeb238&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/d5d47222c1dc5ea97ebd8f4c68834fbe4abeb238&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18016" author="beberlei" created="Sun, 27 May 2012 17:14:22 +0000"  >&lt;p&gt;Merged into 2.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2199] Yaml driver does not take into account field @Version attribute</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2199</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Even if field has version: true attribute, Yaml driver does not set class metadata isVersioned and versionField properties. As a result optimistic lock cannot be used.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14312">DDC-2199</key>
            <summary>Yaml driver does not take into account field @Version attribute</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ggalakhov">Georgy Galakhov</reporter>
                        <labels>
                        <label>mapping</label>
                        <label>yaml</label>
                    </labels>
                <created>Fri, 14 Dec 2012 17:30:57 +0000</created>
                <updated>Sun, 16 Dec 2012 12:01:03 +0000</updated>
                    <resolved>Sun, 16 Dec 2012 12:01:03 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.3.2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19140" author="beberlei" created="Sun, 16 Dec 2012 12:01:03 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1063] Yaml mapping driver cant find Symfony/Component/Yaml/Yaml.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1063</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As of the release of Doctrine ORM 2.0.2 I cannot seem to be able to use the Yaml mapping driver.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;PHP Warning:  require(/usr/share/php/Doctrine/Symfony/Component/Yaml/Yaml.php): failed to open stream: No such file or directory in /usr/share/php/Doctrine/Common/ClassLoader.php on line 148&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I do have the Doctrine 2.0.2 packages installed, here&apos;s the output from my console:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Installed packages, channel pear.doctrine-project.org:&lt;br/&gt;
======================================================&lt;br/&gt;
Package                Version State&lt;br/&gt;
DoctrineCommon         2.0.1   stable&lt;br/&gt;
DoctrineDBAL           2.0.2   stable&lt;br/&gt;
DoctrineORM            2.0.2   stable&lt;br/&gt;
DoctrineSymfonyConsole 2.0.2   stable&lt;br/&gt;
DoctrineSymfonyYaml    2.0.2   stable&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;It is all up to date, so I am not missing anything.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;root@nikola-pc:/usr/share/php# pear upgrade-all&lt;br/&gt;
Nothing to upgrade-all&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Navigating to the /usr/share/php folder, where the PEAR and all other stuff is located I can&apos;t seem to find the Yaml.php file, which should be distributed by some of the newly formed packages.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;root@nikola-pc:/usr/share/php# find -iname &apos;yaml*&apos;&lt;br/&gt;
./Doctrine/ORM/Mapping/Driver/YamlDriver.php&lt;br/&gt;
./Doctrine/ORM/Tools/Export/Driver/YamlExporter.php&lt;br/&gt;
./.registry/.channel.pear.symfony-project.com/yaml.reg&lt;br/&gt;
./data/DoctrineSymfonyYaml/Doctrine/Symfony/Component/Yaml&lt;br/&gt;
./PHPUnit/Extensions/Database/DataSet/YamlDataSet.php&lt;br/&gt;
./PHPUnit/Extensions/Database/DataSet/Persistors/Yaml.php&lt;br/&gt;
./PHPUnit/Extensions/Database/DataSet/Specs/Yaml.php&lt;br/&gt;
./SymfonyComponents/YAML&lt;/p&gt;&lt;/blockquote&gt;

&lt;blockquote&gt;
&lt;p&gt;root@nikola-pc:/usr/share/php# find -iname &apos;yaml.php&apos;&lt;br/&gt;
./PHPUnit/Extensions/Database/DataSet/Persistors/Yaml.php&lt;br/&gt;
./PHPUnit/Extensions/Database/DataSet/Specs/Yaml.php&lt;br/&gt;
root@nikola-pc:/usr/share/php# &lt;/p&gt;&lt;/blockquote&gt;

&lt;blockquote&gt;
&lt;p&gt;root@nikola-pc:/usr/share/php/data/DoctrineSymfonyYaml# find&lt;br/&gt;
.&lt;br/&gt;
./LICENSE&lt;br/&gt;
./Doctrine&lt;br/&gt;
./Doctrine/Symfony&lt;br/&gt;
./Doctrine/Symfony/Component&lt;br/&gt;
./Doctrine/Symfony/Component/Yaml&lt;br/&gt;
./Doctrine/Symfony/Component/Yaml/LICENSE&lt;br/&gt;
./bin&lt;br/&gt;
./bin/doctrine.bat&lt;br/&gt;
./bin/doctrine&lt;br/&gt;
root@nikola-pc:/usr/share/php/data/DoctrineSymfonyYaml#&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Please advise me what the possible solution would be in this case?&lt;/p&gt;</description>
                <environment>Ubuntu 10.10; PHP 5.3;</environment>
            <key id="12460">DDC-1063</key>
            <summary>Yaml mapping driver cant find Symfony/Component/Yaml/Yaml.php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nikola.petkanski">Nikola Petkanski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Mar 2011 09:05:17 +0000</created>
                <updated>Mon, 14 Mar 2011 05:51:06 +0000</updated>
                    <resolved>Mon, 14 Mar 2011 05:51:07 +0000</resolved>
                            <version>2.0.2</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15484" author="beberlei" created="Thu, 10 Mar 2011 03:09:10 +0000"  >&lt;p&gt;What Files are in the ./Doctrine/Symfony/Component/YAML Directory? Only LICENSE? Then maybe my build failed somehow.&lt;/p&gt;</comment>
                    <comment id="15486" author="nikola.petkanski" created="Thu, 10 Mar 2011 05:14:49 +0000"  >&lt;p&gt;Yes, only the LICENSE file is present.&lt;/p&gt;

&lt;blockquote&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;root@nikola-pc:~# ls -lha /usr/share/php/data/DoctrineSymfonyYaml/Doctrine/Symfony/Component/Yaml/
total 12K
drwxr-xr-x 2 root root 4.0K 2011-03-07 14:21 .
drwxr-xr-x 3 root root 4.0K 2011-03-07 14:21 ..
-rw-r--r-- 1 root root 1.1K 2011-03-07 14:21 LICENSE
root@nikola-pc:~# 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;P.S It would be nice for the documentation to be updated with recommendations on how to setup the autoloader for versions 2.0.2+.&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/configuration.html#additional-symfony-components&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/configuration.html#additional-symfony-components&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15490" author="beberlei" created="Sun, 13 Mar 2011 03:54:02 +0000"  >&lt;p&gt;It works for me, i have installed DoctrineSYmfonyYaml on another machine and it contains all the relevant contents.&lt;/p&gt;

&lt;p&gt;Have you tried uninstall and install the package again?&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;pear uninstall doctrine/DoctrineSymfonyYaml
pear install doctrine/Doctrine/SymfonyYaml
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15494" author="nikola.petkanski" created="Mon, 14 Mar 2011 05:21:54 +0000"  >&lt;p&gt;I cannot understand the commands you&apos;ve gave me - utilizing phpunit to uninstall PEAR component? Really?&lt;/p&gt;

&lt;p&gt;Anyway.. I&apos;ve tried to uninstall and re-install, but it does not seem to be fixed.&lt;/p&gt;

&lt;p&gt;Please, check the output from my console and inform me if I am doing something wrong.&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;root@nikola-pc:~# pear list -a | grep Doctrine
DoctrineCommon         2.0.1   stable
DoctrineDBAL           2.0.2   stable
DoctrineORM            2.0.2   stable
DoctrineSymfonyConsole 2.0.2   stable
DoctrineSymfonyYaml    2.0.2   stable
&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;root@nikola-pc:~# pear uninstall Doctrine/DoctrineSymfonyYaml 
doctrine/DoctrineSymfonyYaml (version &amp;gt;= 2.0.0) is required by installed &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine/DoctrineORM&quot;&lt;/span&gt;
doctrine/DoctrineSymfonyYaml cannot be uninstalled, other installed packages depend on &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;
&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;root@nikola-pc:~# pear uninstall Doctrine/DoctrineORM
uninstall ok: channel:&lt;span class=&quot;code-comment&quot;&gt;//pear.doctrine-project.org/DoctrineORM-2.0.2&lt;/span&gt;
&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;root@nikola-pc:~# pear list -a | grep Doctrine
DoctrineCommon         2.0.1   stable
DoctrineDBAL           2.0.2   stable
DoctrineSymfonyConsole 2.0.2   stable
DoctrineSymfonyYaml    2.0.2   stable
&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;root@nikola-pc:~# pear uninstall Doctrine/DoctrineSymfonyYaml 
uninstall ok: channel:&lt;span class=&quot;code-comment&quot;&gt;//pear.doctrine-project.org/DoctrineSymfonyYaml-2.0.2
&lt;/span&gt;root@nikola-pc:~# pear list -a | grep Doctrine
DoctrineCommon         2.0.1   stable
DoctrineDBAL           2.0.2   stable
DoctrineSymfonyConsole 2.0.2   stable
&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;root@nikola-pc:~# pear upgrade-all
Nothing to upgrade-all
&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;root@nikola-pc:~# pear update-channels
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;components.ez.no&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;components.ez.no&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;doc.php.net&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;doc.php.net&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.doctrine-project.org&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.doctrine-project.org&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.pdepend.org&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.pdepend.org&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.phing.info&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.phing.info&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.php.net&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.php.net&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.phpunit.de&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.phpunit.de&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.symfony-project.com&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pear.symfony-project.com&quot;&lt;/span&gt; is up to date
Updating channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pecl.php.net&quot;&lt;/span&gt;
Channel &lt;span class=&quot;code-quote&quot;&gt;&quot;pecl.php.net&quot;&lt;/span&gt; is up to date
&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;root@nikola-pc:~# pear install Doctrine/DoctrineORM
downloading DoctrineORM-2.0.2.tgz ...
Starting to download DoctrineORM-2.0.2.tgz (194,608 bytes)
.........................................done: 194,608 bytes
downloading DoctrineSymfonyYaml-2.0.2.tgz ...
Starting to download DoctrineSymfonyYaml-2.0.2.tgz (19,883 bytes)
...done: 19,883 bytes
install ok: channel:&lt;span class=&quot;code-comment&quot;&gt;//pear.doctrine-project.org/DoctrineSymfonyYaml-2.0.2
&lt;/span&gt;install ok: channel:&lt;span class=&quot;code-comment&quot;&gt;//pear.doctrine-project.org/DoctrineORM-2.0.2&lt;/span&gt;
&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;root@nikola-pc:~# ls -lha /usr/share/php/data/DoctrineSymfonyYaml/Doctrine/Symfony/Component/Yaml/
total 12K
drwxr-xr-x 2 root root 4.0K 2011-03-14 11:15 .
drwxr-xr-x 3 root root 4.0K 2011-03-14 11:15 ..
-rw-r--r-- 1 root root 1.1K 2011-03-14 11:15 LICENSE
root@nikola-pc:~# 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15495" author="nikola.petkanski" created="Mon, 14 Mar 2011 05:31:41 +0000"  >&lt;p&gt;It seems to be fixed. Perhaps you&apos;ve fixed the package and during my uninstall-install it was set properly.&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;root@nikola-pc:/usr/share/php# find -iname &apos;yaml.php&apos;
./Doctrine/Symfony/Component/Yaml/Yaml.php
./PHPUnit/Extensions/Database/DataSet/Persistors/Yaml.php
./PHPUnit/Extensions/Database/DataSet/Specs/Yaml.php
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks for fixing it up &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;P.S I was having the same issue with the symfony console, but re-installing the ORM and the DBAL packages helped.&lt;/p&gt;</comment>
                    <comment id="15496" author="beberlei" created="Mon, 14 Mar 2011 05:49:22 +0000"  >&lt;p&gt;lol, i got confsued.  I meant &quot;pear&quot; of course. Fixed my previous comment.&lt;/p&gt;</comment>
                    <comment id="15497" author="beberlei" created="Mon, 14 Mar 2011 05:50:54 +0000"  >&lt;p&gt;I had the packages built wrong right after the 2.0.2 release, but only for 2-4 hours. After that they were complete. Good it works for you now, sorry for the difficulties &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-1695] SQLs for PostgreSQL case sensite tables/fields are wrongly generated</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1695</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The SQLs for case sensitive schemas in postgreSQL are wronly generated.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
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;CREATE TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;News&quot;&lt;/span&gt; (
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdNews&quot;&lt;/span&gt; serial NOT NULL,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdUser&quot;&lt;/span&gt; bigint NOT NULL,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdLanguage&quot;&lt;/span&gt; integer NOT NULL,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdCondition&quot;&lt;/span&gt; integer,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdHealthProvider&quot;&lt;/span&gt; integer,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdSpeciality&quot;&lt;/span&gt; integer,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdMedicineType&quot;&lt;/span&gt; integer,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdTreatment&quot;&lt;/span&gt; integer,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;Title&quot;&lt;/span&gt; character varying,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;SmallText&quot;&lt;/span&gt; character varying,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;LongText&quot;&lt;/span&gt; character varying,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;PublishDate&quot;&lt;/span&gt; timestamp with time zone,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;IdxNews&quot;&lt;/span&gt; tsvector,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;Highlight&quot;&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; NOT NULL DEFAULT &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;Order&quot;&lt;/span&gt; integer NOT NULL DEFAULT 0,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;Deleted&quot;&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; NOT NULL DEFAULT &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;Active&quot;&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; NOT NULL DEFAULT &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;UpdateToHighlighted&quot;&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; DEFAULT &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
  CONSTRAINT &lt;span class=&quot;code-quote&quot;&gt;&quot;News_pkey&quot;&lt;/span&gt; PRIMARY KEY (&lt;span class=&quot;code-quote&quot;&gt;&quot;IdNews&quot;&lt;/span&gt; ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Object (I added quotes trying to generate the SQLs quoted.:&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 GlobalTreatments\ApplicationBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;News&quot;&lt;/span&gt;&quot;&quot;)
 * @ORM\Entity
 */
class News
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idNews
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdNews&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
     * @ORM\SequenceGenerator(sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;News_IdNews_seq&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, allocationSize=&quot;&lt;/span&gt;1&lt;span class=&quot;code-quote&quot;&gt;&quot;, initialValue=&quot;&lt;/span&gt;1&quot;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idNews;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; bigint $iduser
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdUser&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;bigint&quot;, 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; $idUser;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idLanguage
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdLanguage&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, 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; $idLanguage;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idCondition
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdCondition&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idCondition;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idHealthProvider
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdHealthProvider&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idHealthProvider;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idSpeciality
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdSpeciality&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idSpeciality;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idMedicineType
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdMedicineType&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idMedicineType;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idTreatment
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdTreatment&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idTreatment;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $title
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;Title&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;string&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $title;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $smallText
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;SmallText&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;string&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $smallText;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $longText
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;LongText&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;string&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $longText;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; datetimetz $publishDate
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;PublishDate&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;datetimetz&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $publishDate;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; tsvector $idxNews
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdxNews&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;tsvector&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idxNews;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; $highlight
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;Highlight&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;, 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; $highlight;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $order
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;Order&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;integer&quot;, 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; $order;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; $deleted
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;Deleted&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;, 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; $deleted;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; $active
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;Active&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;, 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; $active;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; $updateToHighlighted
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;UpdateToHighlighted&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, type=&quot;&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $updateToHighlighted;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; condition
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Condition&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdCondition&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, referencedColumnName=&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;IdCondition&quot;&lt;/span&gt;&quot;&quot;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $condition;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; healthProvider
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;HealthProvider&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdHealthProvider&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, referencedColumnName=&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;IdHealthProvider&quot;&lt;/span&gt;&quot;&quot;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $healthProvider;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; language
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Language&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdLanguage&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, referencedColumnName=&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;IdLanguage&quot;&lt;/span&gt;&quot;&quot;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $language;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; medicineType
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;MedicineType&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdMedicineType&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, referencedColumnName=&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;IdMedicineType&quot;&lt;/span&gt;&quot;&quot;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $medicineType;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; speciality
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Speciality&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdSpeciality&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, referencedColumnName=&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;IdSpeciality&quot;&lt;/span&gt;&quot;&quot;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $speciality;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; treatment
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Treatment&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdTreatment&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, referencedColumnName=&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;IdTreatment&quot;&lt;/span&gt;&quot;&quot;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $treatment;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; user
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;&quot;IdUser&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, referencedColumnName=&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;IdUser&quot;&lt;/span&gt;&quot;&quot;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $user;

    ....

}
&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;&apos;SELECT n.smallText, n.publishDate &apos; .
&apos;FROM News n &apos; .
	&apos;INNER JOIN n.language la &apos; .
&apos;WHERE la.languageCode = :languageCode &apos; .
&apos;ORDER BY n.publishDate DESC&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Generated 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 &lt;span class=&quot;code-quote&quot;&gt;&quot;0_.&quot;&lt;/span&gt;SmallText&lt;span class=&quot;code-quote&quot;&gt;&quot; AS &quot;&lt;/span&gt;SmallText&lt;span class=&quot;code-quote&quot;&gt;&quot;0, &quot;&lt;/span&gt;0_.&lt;span class=&quot;code-quote&quot;&gt;&quot;PublishDate&quot;&lt;/span&gt; AS &lt;span class=&quot;code-quote&quot;&gt;&quot;PublishDate&quot;&lt;/span&gt;1 FROM &lt;span class=&quot;code-quote&quot;&gt;&quot;News&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;0_ INNER JOIN &quot;&lt;/span&gt;Language&lt;span class=&quot;code-quote&quot;&gt;&quot; &quot;&lt;/span&gt;1_ ON &lt;span class=&quot;code-quote&quot;&gt;&quot;0_.&quot;&lt;/span&gt;IdLanguage&lt;span class=&quot;code-quote&quot;&gt;&quot; = &quot;&lt;/span&gt;1_.&lt;span class=&quot;code-quote&quot;&gt;&quot;IdLanguage&quot;&lt;/span&gt; WHERE &lt;span class=&quot;code-quote&quot;&gt;&quot;1_.&quot;&lt;/span&gt;LanguageCode&lt;span class=&quot;code-quote&quot;&gt;&quot; = ? ORDER BY &quot;&lt;/span&gt;0_.&lt;span class=&quot;code-quote&quot;&gt;&quot;PublishDate&quot;&lt;/span&gt; DESC LIMIT 6
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Notice there are unmattched &quot; in the SQL.&lt;/p&gt;</description>
                <environment>PostgreSQL 9.x, Symfony 2</environment>
            <key id="13513">DDC-1695</key>
            <summary>SQLs for PostgreSQL case sensite tables/fields are wrongly generated</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ignaciolarranaga">Ignacio Larranaga</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Mar 2012 03:08:19 +0000</created>
                <updated>Sun, 11 Mar 2012 22:34:37 +0000</updated>
                    <resolved>Sun, 11 Mar 2012 22:34:37 +0000</resolved>
                            <version>2.1.6</version>
                                <fixVersion>2.1.7</fixVersion>
                <fixVersion>2.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17538" author="ignaciolarranaga" created="Fri, 9 Mar 2012 03:09:09 +0000"  >&lt;p&gt;If there is another approach to specify the table/column names are case sensitive in PGSQL please let me know.&lt;/p&gt;</comment>
                    <comment id="17539" author="ignaciolarranaga" created="Fri, 9 Mar 2012 03:50:20 +0000"  >&lt;p&gt;Just to comment. I also tried the normal quoting.&lt;/p&gt;

&lt;p&gt;Example: @ORM\Column(name=&quot;`IdNews`&quot;, type=&quot;integer&quot;, nullable=false)&lt;/p&gt;

&lt;p&gt;And does not work too because of the same reason.&lt;/p&gt;</comment>
                    <comment id="17540" author="ignaciolarranaga" created="Fri, 9 Mar 2012 05:40:25 +0000"  >&lt;p&gt;Hi, I generate this patch and seems to be working for me (at least what I&apos;m testing right now).&lt;/p&gt;

&lt;p&gt;I used &#180; to quote tables and single attributes (not relationships) and the SQLs are correctly generated.&lt;/p&gt;</comment>
                    <comment id="17542" author="ignaciolarranaga" created="Fri, 9 Mar 2012 15:00:06 +0000"  >&lt;p&gt;Adding a new patch for another files I need to change.&lt;/p&gt;</comment>
                    <comment id="17553" author="beberlei" created="Sun, 11 Mar 2012 22:09:22 +0000"  >&lt;p&gt;Formatted code&lt;/p&gt;</comment>
                    <comment id="17554" author="beberlei" created="Sun, 11 Mar 2012 22:34:37 +0000"  >&lt;p&gt;Fixed and merged into 2.1.x and 2.2 branches&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11169" name="doctrine-2.1.6.patch" size="4479" author="ignaciolarranaga" created="Fri, 9 Mar 2012 15:00:06 +0000" />
                    <attachment id="11168" name="SqlWalker.patch" size="2410" author="ignaciolarranaga" created="Fri, 9 Mar 2012 05:40:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-231] YAML isn&apos;t persisting correcty</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-231</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m have some problems when I try to persist..&lt;br/&gt;
I&apos;ve created these classes:&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 Customer
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $users;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;users = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
    }
}

class User
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $customer;
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then I make the mappers with YAML&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;Ciutat\DomainModel\Customer:
  type: entity
  table: customer
  fields:
    id:
      type: integer
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      generator:
        strategy: auto
      sequenceGenerator:
        sequenceName: customer_id_seq
        allocationSize: 1
        initialValue: 1
  oneToMany:
    users:
      targetEntity: User
      mappedBy: customer
      cascade: cascadePersist

Ciutat\DomainModel\User:
  type: entity
  table: user1
  fields:
    id:
      type: integer
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      generator:
        strategy: auto
      sequenceGenerator:
        sequenceName: user1_id_seq
        allocationSize: 1
        initialValue: 1
  manyToOne:
    customer:
      targetEntity: Customer
      joinColumn:
        name: customerId
        referencedColumnName: id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And when I try to persist some 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;$costumer = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\Customer();
$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\User();
$user2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\User();
$user3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\User();

$costumer-&amp;gt;users-&amp;gt;add($user);
$costumer-&amp;gt;users-&amp;gt;add($user2);
$costumer-&amp;gt;users-&amp;gt;add($user3);
    
$em-&amp;gt;persist($costumer);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the result in my database is not what I think it must be expected&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 * from customer;
 id 
----
  1

elect * from user1;
 id | customerid 
----+------------
  1 |           
  2 |           
  3 |           

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I would like to know if have some mistake with my code or is there a problem with YAML? &apos;cause I think there should be some data on &apos;customerId&apos;, don&apos;t I ?&lt;/p&gt;
</description>
                <environment>Ubuntu 9.04 - &lt;br/&gt;
PHP 5.3.1-0.dotdeb.0 with Suhosin-Patch (cli) (built: Nov 28 2009 13:18:25) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH&lt;br/&gt;
-&lt;br/&gt;
PostgreSQL 8.3</environment>
            <key id="10668">DDC-231</key>
            <summary>YAML isn&apos;t persisting correcty</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hgirardi">Henrique Girardi dos Santos</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Dec 2009 12:44:11 +0000</created>
                <updated>Wed, 30 Dec 2009 16:43:15 +0000</updated>
                    <resolved>Wed, 30 Dec 2009 13:09:22 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11305" author="romanb" created="Wed, 30 Dec 2009 13:09:22 +0000"  >&lt;p&gt;This is expected behavior. You must maintain the bidirectional association properly. Doctrine only looks at the &quot;owning side&quot; of a bidirectional association. In the case of a bidirectional one-to-many, like in your case, the owning side is always the many-side. Since you only add the elements to the collection, but dont set the customer property pointing back to the customer, the association does not exist for Doctrine.&lt;/p&gt;

&lt;p&gt;Change your code to:&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;$costumer = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\Customer();
$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\User();
$user2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\User();
$user3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DomainModel\User();

$costumer-&amp;gt;users-&amp;gt;add($user);
$user-&amp;gt;customer = $costumer;
$costumer-&amp;gt;users-&amp;gt;add($user2);
$user2-&amp;gt;customer = $costumer;
$costumer-&amp;gt;users-&amp;gt;add($user3);
$user3-&amp;gt;customer = $costumer;

$em-&amp;gt;persist($costumer);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;And it should work.&lt;/p&gt;

&lt;p&gt;Please read this section carefully: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/association-mapping#owning-side-and-inverse-side&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/association-mapping#owning-side-and-inverse-side&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Its a simple, yet essential concept to understand.&lt;/p&gt;

&lt;p&gt;Hope that helps.&lt;/p&gt;</comment>
                    <comment id="11306" author="hgirardi" created="Wed, 30 Dec 2009 15:34:07 +0000"  >&lt;p&gt;I did this way sometime ago but I thought I was a mistake mine..but I see i was correct..&lt;br/&gt;
I created a prePersist method where I did it automatic and a postPersist to unset after that, cause I dont see any another reason to keep all my object customer inside the User class if inside Customer I have a User collection, so I know which Users belong to Customer..&lt;/p&gt;

&lt;p&gt;why I need to set &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;oneToMany:
    users:
      targetEntity: User
      mappedBy: customer
      cascade: cascadePersist
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;in Customer?? I thought if I set the target and the mappedBy it would be enough..can&apos;t it be automatic? Or it&apos;s impossible?&lt;/p&gt;</comment>
                    <comment id="11307" author="romanb" created="Wed, 30 Dec 2009 16:33:29 +0000"  >&lt;p&gt;You dont need prePersist or postPersist. You just need to maintain your bidirectional associations properly. This is nothing doctrine specific, basic OOP.&lt;/p&gt;

&lt;p&gt;And it is not automatic because this would break transparency. Its not the task of the ORM to fix your broken associations. Then your object model is suddenly broken without the persistence layer.&lt;/p&gt;

&lt;p&gt;If you want a &lt;b&gt;unidirectional&lt;/b&gt; one-to-many, you must map it through a join table. Its all in the documentation.&lt;/p&gt;

&lt;p&gt;The behavior is very consistent and predictable (compared to what D1 does, for example...)&lt;/p&gt;</comment>
                    <comment id="11308" author="hgirardi" created="Wed, 30 Dec 2009 16:43:15 +0000"  >&lt;p&gt;I know I dont need prePersist or postPersist, It was just my choice, I just created them to make it automaticaly..&lt;br/&gt;
and I don&apos;t want a unidirectional..there&apos;s no reason to have another table to join them..&lt;br/&gt;
but now I understood why it&apos;s not automatic..&lt;/p&gt;

&lt;p&gt;thanks man!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-188] Collections are not hydrated properly</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-188</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The following example has &lt;b&gt;User&lt;/b&gt; and &lt;b&gt;Address&lt;/b&gt; entities, where &lt;b&gt;User&lt;/b&gt; has many &lt;b&gt;Addresses&lt;/b&gt; (ArrayCollection).&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pastebin.com/f1f065cb0&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/f1f065cb0&lt;/a&gt;&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;$u = $em-&amp;gt;find(&apos;Entity\User&apos;, $id);
$addresses = $u-&amp;gt;getAddresses();
foreach ($addresses as $a) { }  // This line breaks!
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The script runs until the foreach loop, then it breaks with a fatal error:&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;PHP Notice:  Undefined variable: owningAssoc in /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/Persist
ers/StandardEntityPersister.php on line 545
PHP Fatal error:  Uncaught exception &apos;Doctrine\ORM\ORMException&apos; with message &apos;Unrecognized field: user
Id&apos; in /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/ORMException.php:14
Stack trace:
#0 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php(660): Doctrin
e\ORM\ORMException::unrecognizedField(&apos;userId&apos;)
#1 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php(545): Doctrin
e\ORM\Persisters\StandardEntityPersister-&amp;gt;_getSelectEntitiesSql(Array, NULL)
#2 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/Mapping/OneToManyMapping.php(133): Doctrine\ORM\Pers
isters\StandardEntityPersister-&amp;gt;loadOneToManyCollection(Array, Object(Doctrine\ORM\PersistentCollection
))
#3 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/PersistentCollection.php(244): Doctrine\ORM\Mapping\
OneToManyMapping-&amp;gt;load(Object(Entity\User), Object(Doctrine\ORM\PersistentCollection), Object(Doctrine\
ORM\EntityManager))
#4 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/PersistentCollection.php(549): Doc in /home/kaiser/d
octrine/doctrine/lib/Doctrine/ORM/ORMException.php on line 14
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I uncomment the user creation code in my pastebin example (i.e. create User, Address first), it works as expected (assumingly because everything is in the EM already).&lt;/p&gt;

&lt;p&gt;So this bug probably breaks all select-only use cases with collections (which makes it a Blocker in my opinion).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10545">DDC-188</key>
            <summary>Collections are not hydrated properly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 10:39:46 +0000</created>
                <updated>Wed, 2 Dec 2009 11:53:17 +0000</updated>
                    <resolved>Wed, 2 Dec 2009 11:53:17 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10966" author="romanb" created="Wed, 2 Dec 2009 10:56:04 +0000"  >&lt;p&gt;Hm, this is dubious as this is directly and indirectly tested all over the place.&lt;/p&gt;

&lt;p&gt;I was unable to reproduce it as of yet. Will keep you updated.&lt;/p&gt;</comment>
                    <comment id="10967" author="romanb" created="Wed, 2 Dec 2009 11:00:09 +0000"  >&lt;p&gt;Are you sure you dont have local modifications? The notice looks suspicious and _getSelectEntitiesSql(Array, NULL) does not look correct either. The association should be passed in.&lt;/p&gt;
</comment>
                    <comment id="10968" author="romanb" created="Wed, 2 Dec 2009 11:02:11 +0000"  >&lt;p&gt;Your patch in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-162&quot; title=&quot;sqlLogger does not log everything&quot;&gt;&lt;del&gt;DDC-162&lt;/del&gt;&lt;/a&gt; is what breaks it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-25] Boolean type does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-25</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The boolean type does not work. The method used by BooleanType does not exist. It should probably use getBooleanTypedeclarationSql(array $field).&lt;/p&gt;

&lt;p&gt;In Doctrine\DBAL\Types\BooleanType:&lt;/p&gt;

&lt;p&gt;OLD:&lt;br/&gt;
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)&lt;br/&gt;
{&lt;br/&gt;
        return $platform-&amp;gt;getBooleanDeclarationSql();&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;NEW:&lt;br/&gt;
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)&lt;br/&gt;
{&lt;br/&gt;
        return $platform-&amp;gt;getBooleanTypeDeclarationSql($fieldDeclaration);&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment></environment>
            <key id="10129">DDC-25</key>
            <summary>Boolean type does not work</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Oct 2009 09:45:32 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:43 +0000</updated>
                    <resolved>Thu, 1 Oct 2009 10:36:01 +0000</resolved>
                                            <fixVersion>2.0-ALPHA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10152" author="romanb" created="Thu, 1 Oct 2009 10:36:01 +0000"  >&lt;p&gt;Just checked and this has already been fixed in HEAD and is therefore already fixed for the next release.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-491] Quoting Patch completly wrecked OCI8 support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-491</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The quoting issue broke the OCI8 Driver, there is a fatal because of changes in the interface, and fixting that there are 160 test-failures&lt;/p&gt;</description>
                <environment></environment>
            <key id="11167">DDC-491</key>
            <summary>Quoting Patch completly wrecked OCI8 support</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Apr 2010 11:46:24 +0000</created>
                <updated>Fri, 2 Apr 2010 11:58:16 +0000</updated>
                    <resolved>Fri, 2 Apr 2010 11:58:16 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12557" author="beberlei" created="Fri, 2 Apr 2010 11:48:31 +0000"  >&lt;p&gt;Failure is always 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;164) Doctrine\Tests\ORM\Functional\Ticket\Ticket2481Test::testEmptyInsert
Exception: [PHPUnit_Framework_Error_Warning] Invalid argument supplied &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; foreach()

With queries:
4. SQL: &apos;INSERT INTO ticket_2481_products (id) VALUES (?)&apos; Params: &apos;1&apos;
3. SQL: &apos;SELECT ticket_2481_products_id_seq.nextval FROM DUAL&apos; Params: 
2. SQL: &apos;CREATE SEQUENCE ticket_2481_products_id_seq START WITH 1 MINVALUE 1 INCREMENT BY 10&apos; Params: 

Trace:
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php:138
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/DBAL/Statement.php:130
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:187
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/UnitOfWork.php:698
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/UnitOfWork.php:291
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/EntityManager.php:281
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php:27
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12558" author="beberlei" created="Fri, 2 Apr 2010 11:58:16 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-427] DoctrineException.php is an empty file!</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-427</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://svn.doctrine-project.org/trunk/lib/Doctrine/Common/DoctrineException.php&quot; class=&quot;external-link&quot;&gt;http://svn.doctrine-project.org/trunk/lib/Doctrine/Common/DoctrineException.php&lt;/a&gt; is an empty file after rev 7313. in rev 7312 it is ok.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11063">DDC-427</key>
            <summary>DoctrineException.php is an empty file!</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="marioman">Mario Weidler</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Mar 2010 08:58:19 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:34 +0000</updated>
                    <resolved>Tue, 16 Mar 2010 09:05:14 +0000</resolved>
                                                            <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12275" author="romanb" created="Tue, 16 Mar 2010 09:05:14 +0000"  >&lt;p&gt;It is removed now. Thanks for the notice.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-309] ReflectionException when using AbstractQuery::iterate()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-309</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When I use two Queries and iterate() over the results, the second one fails with a PHP Fatal error (ReflectionException). It has a strange message (&apos;Class  does not exist&apos;). &lt;br/&gt;
This happens with any two different entities. The error seems to occur when next() is called (directly or via foreach) and the objects are being created. &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;$q = $em-&amp;gt;createQuery(&apos;SELECT c FROM Entity\Country c&apos;);
$q-&amp;gt;iterate()-&amp;gt;next();

$q = $em-&amp;gt;createQuery(&apos;SELECT u FROM Entity\User u&apos;);
$q-&amp;gt;iterate()-&amp;gt;next(); // FAILS
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Entities:&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/816374&quot; class=&quot;external-link&quot;&gt;http://pastie.org/816374&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example code:&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/816377&quot; class=&quot;external-link&quot;&gt;http://pastie.org/816377&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10854">DDC-309</key>
            <summary>ReflectionException when using AbstractQuery::iterate()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Feb 2010 10:17:51 +0000</created>
                <updated>Tue, 9 Feb 2010 14:59:31 +0000</updated>
                    <resolved>Tue, 9 Feb 2010 14:59:31 +0000</resolved>
                                            <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11641" author="beberlei" created="Tue, 9 Feb 2010 14:38:56 +0000"  >&lt;p&gt;It seems IterableResult does not support two iterators at once, because it re-uses the hydrator for both queries - effectivly deleting the information from the previous query and destroying the call.&lt;/p&gt;</comment>
                    <comment id="11642" author="beberlei" created="Tue, 9 Feb 2010 14:43:03 +0000"  >&lt;p&gt;Suggested patch&lt;/p&gt;</comment>
                    <comment id="11643" author="beberlei" created="Tue, 9 Feb 2010 14:59:31 +0000"  >&lt;p&gt;Fixed! &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>
                    <attachment id="10358" name="ddc309.patch" size="4083" author="beberlei" created="Tue, 9 Feb 2010 14:43:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-765] \Symfony\Components renamed to \Symfony\Component (singular) ... refactoring unfinished. console cannot be invoked</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-765</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I pulled from github the whole thing, but still stuck with sandbox:&lt;/p&gt;

&lt;p&gt;\doctrine\tools\sandbox&amp;gt;php doctrine.php&lt;br/&gt;
.PHP Warning:  require(doctrine\lib\vendor\Symfony\Components\Console\Helper\Helper.php): failed to open st&lt;br/&gt;
ream: No such file or directory in C:\Inetpub\wwwroot\BugTrackerORM\doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php&lt;br/&gt;
on line 148&lt;br/&gt;
PHP Stack trace:&lt;br/&gt;
PHP   1. &lt;/p&gt;
{main}
&lt;p&gt;() ..... doctrine\tools\sandbox\doctrine.php:0&lt;br/&gt;
PHP   2. require() .... doctrine\tools\sandbox\doctrine.php:21&lt;br/&gt;
PHP   3. Doctrine\Common\ClassLoader-&amp;gt;loadClass() ... doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\C&lt;br/&gt;
lassLoader.php:0&lt;br/&gt;
PHP   4. require() ... doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php:148&lt;br/&gt;
PHP   5. Doctrine\Common\ClassLoader-&amp;gt;loadClass() C:\Inetpub\wwwroot\BugTrackerORM\doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\C&lt;br/&gt;
lassLoader.php:0&lt;/p&gt;

&lt;p&gt;Warning: require(.... doctrine\lib\vendor\Symfony\Components\Console\Helper\Helper.php): failed to open stream:&lt;br/&gt;
No such file or directory in.... doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php on lin&lt;br/&gt;
e 148&lt;/p&gt;

&lt;p&gt;well, it seams that at some stage Symfony\Components got renamed to Symfony\Coponet:&lt;/p&gt;

&lt;p&gt;$ git log Component&lt;br/&gt;
commit 4a9f36800e3f55bc2cf61033573e1103594b4742&lt;br/&gt;
Author: S&amp;lt;C3&amp;gt;&amp;lt;A9&amp;gt;bastien HOUZE &amp;lt;sebastienhouze@mbash.livebox.home&amp;gt;&lt;br/&gt;
Date:   Mon Aug 23 08:21:41 2010 +0200&lt;br/&gt;
    Symfony/Components renamed into Symfony/Component&lt;/p&gt;

&lt;p&gt;When I copied Component into Componets I got:&lt;br/&gt;
.PHP Fatal error:  Cannot redeclare class Symfony\Component\Console\Helper\Helper in doctrine\lib\vendor\Sy&lt;br/&gt;
mfony\Components\Console\Helper\Helper.php on line 21&lt;/p&gt;</description>
                <environment>winXP, PHP 5.3.3 </environment>
            <key id="11821">DDC-765</key>
            <summary>\Symfony\Components renamed to \Symfony\Component (singular) ... refactoring unfinished. console cannot be invoked</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nad2000">Radomirs Cirskis</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 03:08:53 +0000</created>
                <updated>Mon, 30 Aug 2010 22:55:13 +0000</updated>
                    <resolved>Sun, 29 Aug 2010 04:34:01 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14115" author="nicokaiser" created="Fri, 27 Aug 2010 11:39:36 +0000"  >&lt;p&gt;Same for me, even worse, despite git submodule dependencies, the submodules (and their submodules) have different versions of &quot;Components&quot; vs. &quot;Component&quot;, so the CLI is broken now.&lt;/p&gt;</comment>
                    <comment id="14134" author="beberlei" created="Sun, 29 Aug 2010 04:32:56 +0000"  >&lt;p&gt;Yes this sucks, unfortunately for ORM depending on DBAL Beta 3 we cannot easily change this.&lt;/p&gt;

&lt;p&gt;Workaround until the next release of DBAL is uncommenting the following two lines  instantiating DBAL Commands from your doctrine.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;$cli-&amp;gt;addCommands(array(
    &lt;span class=&quot;code-comment&quot;&gt;// DBAL Commands
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For the next release this week this will be resolved.&lt;/p&gt;</comment>
                    <comment id="14185" author="codewench" created="Mon, 30 Aug 2010 22:55:13 +0000"  >&lt;p&gt;I came across this issue today. I installed Doctrine via PEAR and had to do a few things to get the sandbox example working, which might help as a workaround until the next release:&lt;/p&gt;

&lt;p&gt;1. make sure the PEAR directory is part of your php.ini include path&lt;br/&gt;
2. move the Symfony directory from &apos;PEAR/Doctrine/Symfony&apos; to &apos;PEAR/Symfony&apos;&lt;br/&gt;
3. update the paths to Doctrine &amp;amp; Symfony inside &apos;tools/sandbox/doctrine.php&apos; &amp;amp; &apos;tools/sandbox/cli-config.php&apos;&lt;/p&gt;

&lt;p&gt;I can now work with the sandbox examples.&lt;/p&gt;

&lt;p&gt;As a reference, this is what my cli-config.php source looks like now: (sorry for the unformatted code &amp;lt;pre&amp;gt; tag &amp;amp; &lt;span class=&quot;error&quot;&gt;&amp;#91;code&amp;#93;&lt;/span&gt; weren&apos;t recognized.)&lt;/p&gt;

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

&lt;p&gt;require_once &apos;Doctrine/Common/ClassLoader.php&apos;;&lt;/p&gt;

&lt;p&gt;$classLoader = new \Doctrine\Common\ClassLoader(&apos;Doctrine\ORM&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Doctrine/ORM&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Doctrine\DBAL&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Doctrine/DBAL&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Doctrine\Common&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Doctrine/Common&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Symfony&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Symfony&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Entities&apos;, _&lt;em&gt;DIR&lt;/em&gt;_);&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Proxies&apos;, _&lt;em&gt;DIR&lt;/em&gt;_);&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;/p&gt;

&lt;p&gt;$config = new \Doctrine\ORM\Configuration();&lt;br/&gt;
$config-&amp;gt;setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);&lt;br/&gt;
$driverImpl = $config-&amp;gt;newDefaultAnnotationDriver(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/Entities&quot;));&lt;br/&gt;
$config-&amp;gt;setMetadataDriverImpl($driverImpl);&lt;/p&gt;

&lt;p&gt;$config-&amp;gt;setProxyDir(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;/Proxies&apos;);&lt;br/&gt;
$config-&amp;gt;setProxyNamespace(&apos;Proxies&apos;);&lt;/p&gt;

&lt;p&gt;$connectionOptions = array(&lt;br/&gt;
    &apos;driver&apos; =&amp;gt; &apos;pdo_sqlite&apos;,&lt;br/&gt;
    &apos;path&apos; =&amp;gt; &apos;database.sqlite&apos;&lt;br/&gt;
);&lt;/p&gt;

&lt;p&gt;$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);&lt;/p&gt;

&lt;p&gt;$helpers = array(&lt;br/&gt;
    &apos;db&apos; =&amp;gt; new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em-&amp;gt;getConnection()),&lt;br/&gt;
    &apos;em&apos; =&amp;gt; new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)&lt;br/&gt;
);&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-714] Fix of DDC-167 creates FatalError when persisting a new entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-714</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The resolution of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-167&quot; title=&quot;New method: EntityManager#getPartialReference&quot;&gt;&lt;del&gt;DDC-167&lt;/del&gt;&lt;/a&gt; introduced a new problem in UnitOfWork on line 612 (function persistNew()) as well - when I try to save an entity, I get an Exception from my error handler (who captues php errors):&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;ErrorException with Argument 2 passed to Doctrine\ORM\Mapping\ClassMetadata::setIdentifierValues() must be an array, integer given, called in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php on line 612 and defined
Backtrace: #0: Doctrine\ORM\Mapping\ClassMetadata-&amp;gt;setIdentifierValues at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:612
#1: Doctrine\ORM\UnitOfWork-&amp;gt;persistNew at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:1247
#2: Doctrine\ORM\UnitOfWork-&amp;gt;doPersist at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:1210
#3: Doctrine\ORM\UnitOfWork-&amp;gt;persist at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/EntityManager.php:438
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The relevant code in UoW 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;            $idValue = $idGen-&amp;gt;generate($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em, $entity);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $idGen &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; \Doctrine\ORM\Id\AssignedGenerator) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityIdentifiers[$oid] = array($class-&amp;gt;identifier[0] =&amp;gt; $idValue);
                $class-&amp;gt;setIdentifierValues($entity, $idValue);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We&apos;re using the SequenceGenerator&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;@SequenceGenerator(allocationSize=1,sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;address_id_seq&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which doesn&apos;t return an array, so the array typehint fails and generates an error.&lt;/p&gt;

&lt;p&gt;The fix, which worked for me, is attached.&lt;/p&gt;</description>
                <environment>Debian 5 (64bit), Postgresql 8.3, ZendServer 5.0.2, PHP 5.3.2, Doctrine-HEAD</environment>
            <key id="11670">DDC-714</key>
            <summary>Fix of DDC-167 creates FatalError when persisting a new entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mzach">Michael Zach</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Jul 2010 08:13:40 +0000</created>
                <updated>Sun, 25 Jul 2010 10:35:58 +0000</updated>
                    <resolved>Sun, 25 Jul 2010 10:35:58 +0000</resolved>
                            <version>2.0-BETA3</version>
                <version>2.0-BETA4</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13692" author="beberlei" created="Sun, 25 Jul 2010 10:28:08 +0000"  >&lt;p&gt;This bug also leads to about 400 test failures in the Postgres ORM Testsuite &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="13693" author="beberlei" created="Sun, 25 Jul 2010 10:35:58 +0000"  >&lt;p&gt;Fixed! Thanks for reporting.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10704" name="uow.diff" size="775" author="mzach" created="Thu, 22 Jul 2010 08:13:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-646] Missing inclusion of namespace</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-646</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand.php requires that you include the following namespace &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\Tools\EntityGenerator,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;else the following error is thrown&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;PHP Warning:  require(Doctrine/ORM/Tools/Console/Command/EntityGenerator.php): failed to open stream: No such file or directory in /usr/local/zend/share/pear/Doctrine/Common/&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;.php on line 148
PHP Fatal error:  require(): Failed opening required &apos;Doctrine/ORM/Tools/Console/Command/EntityGenerator.php&apos; (include_path=&apos;/Users/antoine/Sites/startaeget-3.3/application/library:.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear&apos;) in /usr/local/zend/share/pear/Doctrine/Common/&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;.php on line 148
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11525">DDC-646</key>
            <summary>Missing inclusion of namespace</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="mac_nibblet">Antoine Hedgecock</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jun 2010 16:47:47 +0000</created>
                <updated>Sat, 19 Jun 2010 18:28:51 +0000</updated>
                    <resolved>Sat, 19 Jun 2010 18:28:51 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13372" author="beberlei" created="Sat, 19 Jun 2010 18:28:51 +0000"  >&lt;p&gt;fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2328] [GH-597] use the extended proxy interface in the same namespace</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2328</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 MDrollette:&lt;/p&gt;

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

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

&lt;p&gt;Fix for this error:&lt;/p&gt;

&lt;p&gt;    FatalErrorException: Compile Error: Cannot use Doctrine\Common\Proxy\Proxy as Proxy because the name is already in use in .../vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php line 26&lt;/p&gt;</description>
                <environment></environment>
            <key id="14651">DDC-2328</key>
            <summary>[GH-597] use the extended proxy interface in the same namespace</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Mar 2013 17:49:41 +0000</created>
                <updated>Sun, 3 Mar 2013 20:11:16 +0000</updated>
                    <resolved>Sun, 3 Mar 2013 20:11:16 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19796" author="ocramius" created="Sun, 3 Mar 2013 02:32:55 +0000"  >&lt;p&gt;Marking as blocker - has to go in before 2.4&lt;/p&gt;</comment>
                    <comment id="19797" author="beberlei" created="Sun, 3 Mar 2013 17:14:36 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-597&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/597&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/597&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19798" author="ocramius" created="Sun, 3 Mar 2013 20:11:16 +0000"  >&lt;p&gt;merged&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2229] Undefined method</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2229</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There is an undefined method called in Doctrine\ORM\Query\SqlWalker&lt;/p&gt;

&lt;p&gt;Fatal error: Call to undefined method Doctrine\ORM\Query\AST\PathExpression::isSimpleArithmeticExpression() in vendor\doctrine\orm\lib\Doctrine\ORM\Query\SqlWalker.php on line 2091&lt;/p&gt;</description>
                <environment></environment>
            <key id="14366">DDC-2229</key>
            <summary>Undefined method</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jan 2013 14:55:56 +0000</created>
                <updated>Mon, 22 Apr 2013 11:17:53 +0000</updated>
                    <resolved>Mon, 8 Apr 2013 20:26:25 +0000</resolved>
                            <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="19294" author="fabio.bat.silva" created="Sat, 12 Jan 2013 21:01:00 +0000"  >&lt;p&gt;Hi Karma&lt;/p&gt;

&lt;p&gt;Could you provide the failing DQL ?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19334" author="drak" created="Fri, 18 Jan 2013 15:57:03 +0000"  >&lt;p&gt;It&apos;s generating SQL from a Doctrine Collection in a proxy class. Here is a link to the example: &lt;a href=&quot;https://github.com/zikula/core/pull/674#discussion_r2696186&quot; class=&quot;external-link&quot;&gt;https://github.com/zikula/core/pull/674#discussion_r2696186&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The SQL being generated is &lt;/p&gt;

&lt;p&gt;    `SELECT t0.name AS name1, t0.value AS value2, t0.user_id AS user_id3 FROM users_attributes t0 WHERE t0.user_id = ?`&lt;/p&gt;

&lt;p&gt;The ? should be the value 2, but for some reason it&apos;s not being added. I&apos;ve checked the files in the stack-trace below and the right values are entering into the process, just the wrong SQL seems to be generated.&lt;/p&gt;

&lt;p&gt;Exception Trace&lt;br/&gt;
#0 Exception thrown in C:\xampp\htdocs\core13\src\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php, line 47.&lt;br/&gt;
#1 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php(1599): Doctrine\DBAL\Connection-&amp;gt;executeQuery(&apos;SELECT t0.name ...&apos;, Array, Array)&lt;br/&gt;
#2 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php(1558): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;getOneToManyStatement(Array, Object(Users\Entity\User))&lt;br/&gt;
#3 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php(2673): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;loadOneToManyCollection(Array, Object(Users\Entity\User), Object(Doctrine\ORM\PersistentCollection))&lt;br/&gt;
#4 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\PersistentCollection.php(224): Doctrine\ORM\UnitOfWork-&amp;gt;loadCollection(Object(Doctrine\ORM\PersistentCollection))&lt;br/&gt;
#5 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\PersistentCollection.php(576): Doctrine\ORM\PersistentCollection-&amp;gt;initialize()&lt;br/&gt;
#6 C:\xampp\htdocs\core13\src\lib\util\UserUtil.php(1152): Doctrine\ORM\PersistentCollection-&amp;gt;getIterator()&lt;br/&gt;
#7 C:\xampp\htdocs\core13\src\lib\util\UserUtil.php(2007): UserUtil::getVars(&apos;admin&apos;, false, &apos;uname&apos;, false)&lt;/p&gt;</comment>
                    <comment id="19346" author="fabio.bat.silva" created="Sun, 20 Jan 2013 12:03:07 +0000"  >&lt;p&gt;Hi Drak,&lt;/p&gt;

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

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19518" author="asm89" created="Sun, 10 Feb 2013 11:48:17 +0000"  >&lt;p&gt;ping! &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="19541" author="hussdl" created="Thu, 14 Feb 2013 17:53:57 +0000"  >&lt;p&gt;&lt;tt&gt;SqlWalker::walkInExpression()&lt;/tt&gt; does this:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$sql = $this-&amp;gt;walkArithmeticExpression($inExpr-&amp;gt;expression)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;However, &lt;tt&gt;$inExpr-&amp;gt;expression&lt;/tt&gt; could be an instance of &lt;tt&gt;PathExpression&lt;/tt&gt;. The grammar allows this 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-sql&quot;&gt;InExpression             ::= SingleValuedPathExpression [&lt;span class=&quot;code-quote&quot;&gt;&quot;NOT&quot;&lt;/span&gt;] &lt;span class=&quot;code-quote&quot;&gt;&quot;IN&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;(&quot;&lt;/span&gt; (InParameter {&lt;span class=&quot;code-quote&quot;&gt;&quot;,&quot;&lt;/span&gt; InParameter}* | Subselect) &lt;span class=&quot;code-quote&quot;&gt;&quot;)&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;PathExpression&lt;/tt&gt; and &lt;tt&gt;ArithmeticExpression&lt;/tt&gt; both extend &lt;tt&gt;Node&lt;/tt&gt;, but a &lt;tt&gt;PathExpression&lt;/tt&gt; is not an &lt;tt&gt;ArithmeticExpression&lt;/tt&gt;, and therefore it has no method &lt;tt&gt;isSimpleArithmeticExpression&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;If you still need a failing test case, I&apos;ll write one when I get home from work.&lt;/p&gt;</comment>
                    <comment id="19542" author="fabio.bat.silva" created="Thu, 14 Feb 2013 18:21:38 +0000"  >&lt;p&gt;Please Daniel Huss, A test case will be very useful..&lt;/p&gt;</comment>
                    <comment id="19544" author="hussdl" created="Fri, 15 Feb 2013 14:17:36 +0000"  >&lt;p&gt;failing test case&lt;/p&gt;</comment>
                    <comment id="19927" author="hussdl" created="Tue, 2 Apr 2013 10:02:11 +0000"  >&lt;p&gt;Bug still present in release 2.3.3&lt;/p&gt;

&lt;p&gt;Is someone taking care of this? It seems easy enough to fix.&lt;/p&gt;</comment>
                    <comment id="19928" author="ocramius" created="Tue, 2 Apr 2013 10:06:25 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=hussdl&quot; class=&quot;user-hover&quot; rel=&quot;hussdl&quot;&gt;Daniel Huss&lt;/a&gt; you can open a PR with the attached patch + test. Can you do it or should I take care of it?&lt;/p&gt;</comment>
                    <comment id="19931" author="hussdl" created="Tue, 2 Apr 2013 12:55:35 +0000"  >&lt;p&gt;Please take care of it for me this time. I&apos;d rather avoid the git setup until I have a significant contribution to make.&lt;/p&gt;</comment>
                    <comment id="19963" author="beberlei" created="Mon, 8 Apr 2013 20:26:25 +0000"  >&lt;p&gt;This is invalid, you need to set the path expression differently, this is pseudo 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;
&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArtihmeticExpression(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SimpleArithmeticExpression(arithmeticsTerms =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PathExpression)));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20088" author="hussdl" created="Mon, 22 Apr 2013 11:17:53 +0000"  >&lt;p&gt;Could this be bug in the DQL grammar, then? If I&apos;m not mistaken, the resolution of an InExpression cannot involve an ArithmeticPrimary non-terminal. I find the correct solution as shown by Benjamin Eberlei to be quite astonishing, since a path expression like &quot;alias.field&quot; is not something I&apos;d associate with the term &quot;arithmetic&quot;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11521" name="SqlWalker.patch" size="707" author="hussdl" created="Tue, 2 Apr 2013 10:02:11 +0000" />
                    <attachment id="11378" name="SqlWalkerTest.php" size="1348" author="hussdl" created="Fri, 15 Feb 2013 14:17:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-842] spl_object_hash tries to get hash from array - fails</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-842</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a model which looks 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;&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; A
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $collectionB = array(); &lt;span class=&quot;code-comment&quot;&gt;// Holds many &lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; B instances
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $collectionC = array(); &lt;span class=&quot;code-comment&quot;&gt;// Holds many &lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; C instances
&lt;/span&gt;
&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; B
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $classC; &lt;span class=&quot;code-comment&quot;&gt;// Holds one &lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; C instance
&lt;/span&gt;
&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; C
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $attributes; &lt;span class=&quot;code-comment&quot;&gt;// Holds many attributes which are stored in another entitty with SINGLE_TABLE discriminator&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I try to persist my object to the database, Doctrine causes this 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;Message: spl_object_hash() expects parameter 1 to be object, array given
File: C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\UnitOfWork.php
Line: 2043
Trace:

#0 [internal function]: PHPUnit_Util_ErrorHandler::handleError(2, &apos;spl_object_hash...&apos;, &apos;C:\Users\Sebast...&apos;, 2043, Array)
#1 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\UnitOfWork.php(2043): spl_object_hash(Array)
#2 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\Persisters\ManyToManyPersister.php(110): Doctrine\ORM\UnitOfWork-&amp;gt;getEntityIdentifier(Array)
#3 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\Persisters\ManyToManyPersister.php(92): Doctrine\ORM\Persisters\ManyToManyPersister-&amp;gt;_collectJoinTableColumnParameters(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Doctrine\ORM\PersistentCollection), Array)
#4 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\Persisters\AbstractCollectionPersister.php(124): Doctrine\ORM\Persisters\ManyToManyPersister-&amp;gt;_getInsertRowSQLParameters(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Doctrine\ORM\PersistentCollection), Array)
#5 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\Persisters\AbstractCollectionPersister.php(104): Doctrine\ORM\Persisters\AbstractCollectionPersister-&amp;gt;insertRows(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Doctrine\ORM\PersistentCollection))
#6 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\UnitOfWork.php(303): Doctrine\ORM\Persisters\AbstractCollectionPersister-&amp;gt;update(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Doctrine\ORM\PersistentCollection))
#7 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Doctrine\ORM\EntityManager.php(320): Doctrine\ORM\UnitOfWork-&amp;gt;commit()
#8 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_models\trunk\library\App\Model\Service\Dao\Doctrine.php(26): Doctrine\ORM\EntityManager-&amp;gt;flush()
#9 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_models\trunk\library\App\Model\Service\Abstract.php(54): App_Model_Service_Dao_Doctrine-&amp;gt;save(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(App_Model_Ticket))
#10 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_models\trunk\library\App\Model\Abstract.php(264): App_Model_Service_Abstract-&amp;gt;save(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(App_Model_Ticket))
#11 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_models\trunk\library\App\Model\Ticket.php(75): App_Model_Abstract-&amp;gt;save()
#12 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\application\controllers\TicketController.php(69): App_Model_Ticket-&amp;gt;save()
#13 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Zend\Controller\Action.php(513): TicketController-&amp;gt;putAction()
#14 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action-&amp;gt;dispatch(&apos;putAction&apos;)
#15 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Zend_Controller_Request_HttpTestCase), &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Zend_Controller_Response_HttpTestCase))
#16 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\library\Zend\Test\PHPUnit\ControllerTestCase.php(199): Zend_Controller_Front-&amp;gt;dispatch()
#17 C:\Users\Sebastian Hoitz\Documents\Entwicklung\kt_api\trunk\tests\application\controllers\TicketControllerTest.php(220): Zend_Test_PHPUnit_ControllerTestCase-&amp;gt;dispatch(&apos;/ticket/1&apos;)
#18 [internal function]: TicketControllerTest-&amp;gt;testUpdateTicketWithoutInvolvedContactsDoesNotCauseException()
#19 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\Framework\TestCase.php(769): ReflectionMethod-&amp;gt;invokeArgs(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(TicketControllerTest), Array)
#20 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\Framework\TestCase.php(659): PHPUnit_Framework_TestCase-&amp;gt;runTest()
#21 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\Framework\TestResult.php(617): PHPUnit_Framework_TestCase-&amp;gt;runBare()
#22 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\Framework\TestCase.php(607): PHPUnit_Framework_TestResult-&amp;gt;run(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(TicketControllerTest))
#23 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\Framework\TestSuite.php(751): PHPUnit_Framework_TestCase-&amp;gt;run(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(PHPUnit_Framework_TestResult))
#24 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\Framework\TestSuite.php(727): PHPUnit_Framework_TestSuite-&amp;gt;runTest(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(TicketControllerTest), &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(PHPUnit_Framework_TestResult))
#25 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\Framework\TestSuite.php(687): PHPUnit_Framework_TestSuite-&amp;gt;run(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(PHPUnit_Framework_TestResult), &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, Array, Array, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
#26 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\TextUI\TestRunner.php(305): PHPUnit_Framework_TestSuite-&amp;gt;run(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(PHPUnit_Framework_TestResult), &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, Array, Array, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
#27 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\TextUI\Command.php(188): PHPUnit_TextUI_TestRunner-&amp;gt;doRun(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(PHPUnit_Framework_TestSuite), Array)
#28 C:\Program Files (x86)\PHP\PEAR\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command-&amp;gt;run(Array, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
#29 C:\Program Files (x86)\PHP\PEAR\phpunit(53): PHPUnit_TextUI_Command::main()
#30 {main}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I assume that this might happen, because of the Class B holding one Class C, and Class A also holding some Class C instances.&lt;/p&gt;

&lt;p&gt;Those are, in some cases, the same. So when a new Class B is added, together with a new Class C, this new Class C is also added to Class A.&lt;br/&gt;
And somehow internally the already persisted Class C (Class B is getting persisted first) transforms the Class C instance into an array, and Doctrine can&apos;t save it anymore.&lt;/p&gt;

&lt;p&gt;This is my guess of what happens. When I skip adding all the Class C instances to Class A, I don&apos;t get this error.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12017">DDC-842</key>
            <summary>spl_object_hash tries to get hash from array - fails</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="sebastian.hoitz">Sebastian Hoitz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 12:03:10 +0000</created>
                <updated>Sun, 24 Oct 2010 11:20:46 +0000</updated>
                    <resolved>Sun, 24 Oct 2010 11:20:46 +0000</resolved>
                            <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14580" author="mjh_ca" created="Tue, 19 Oct 2010 19:33:32 +0000"  >&lt;p&gt;Do you get the same error if the collections are defined as ArrayCollections instead of PHP arrays ?  Not sure if it is supported to use pure PHP arrays for collections.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en#collections&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en#collections&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;/** @Entity */
class A {
   /* ... */
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;collectionB = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection;
   }

   /** @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;B&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;a&quot;&lt;/span&gt;) */
   &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $collectionB;
}

/** @Entity */
class B {
    /* ... */
    /** @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;A&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;collectionB&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $a;
}  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14591" author="sebastian.hoitz" created="Thu, 21 Oct 2010 10:14:03 +0000"  >&lt;p&gt;I change the definition inside of my constructor method to ArrayCollection.&lt;/p&gt;

&lt;p&gt;It&apos;s just that I write array() when I define the properties to that it&apos;s easier for the developers to tell which properties are collections or not.&lt;/p&gt;

&lt;p&gt;So they actually are ArrayCollections.&lt;/p&gt;</comment>
                    <comment id="14596" author="shurakai" created="Fri, 22 Oct 2010 19:55:55 +0000"  >&lt;p&gt;Please post your entity mappings and some code.&lt;/p&gt;

&lt;p&gt;It would be highly appreciated if you could also provide a test case so that we can confirm easily. Thank you!&lt;/p&gt;</comment>
                    <comment id="14599" author="sebastian.hoitz" created="Sun, 24 Oct 2010 11:20:15 +0000"  >&lt;p&gt;This was a very stupid issue on my side which I wasn&apos;t even thinking about:&lt;/p&gt;

&lt;p&gt;I have my own &quot;ModelCollection&quot; class in which I store my models. This class extends Doctrines ArrayCollection class and overwrites the toArray function. It changed its behavior so that the toArray was called recursively also on all child elements.&lt;br/&gt;
This caused the PersistentCollection to return an array on the getInsertDiff method.&lt;/p&gt;

&lt;p&gt;Long story short: Maybe we should think about making the toArray method on the ArrayCollection class final, since Doctrines ORM relies on its behavior.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-832] Not quoted class name when updating entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-832</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When trying to update an entity which have a reserved name. Doctrine doesn&apos;t quoted its name.&lt;/p&gt;

&lt;p&gt;On Doctrine\ORM\Persisters\BasicEntityPersister, _updateTable, $tableName  is directly used to create the sql. We may use $this-&amp;gt;_class-&amp;gt;getQuotedTableName($this-&amp;gt;_platform) instead ?&lt;/p&gt;

&lt;p&gt;I&apos;m going to propose a merge for that on github.&lt;/p&gt;</description>
                <environment>postgresql 8.4 php 5.3.2</environment>
            <key id="11986">DDC-832</key>
            <summary>Not quoted class name when updating entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="needle">Paul Fariello</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Oct 2010 13:53:14 +0000</created>
                <updated>Sat, 30 Oct 2010 13:34:32 +0000</updated>
                    <resolved>Sat, 30 Oct 2010 13:34:32 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14546" author="needle" created="Fri, 8 Oct 2010 04:30:58 +0000"  >&lt;p&gt;Here is a test case&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Mapping&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-xml&quot;&gt;&lt;span class=&quot;code-tag&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;&lt;/span&gt;
&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;xmlns:xsi&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; xsi:schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Like&quot;&lt;/span&gt; table=&lt;span class=&quot;code-quote&quot;&gt;&quot;`like`&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;id name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;generator strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;sequence-generator sequence-name=&lt;span class=&quot;code-quote&quot;&gt;&quot;like_id_seq&quot;&lt;/span&gt; allocation-size=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; initial-value=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;

        &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/entity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/doctrine-mapping&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;SQL&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;CREATE TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;like&quot;&lt;/span&gt;
(
  id serial NOT NULL,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt; character varying,
  CONSTRAINT like_pkey PRIMARY KEY (id)
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Class&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Like {

  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;  $value;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Test case&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$entity = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Like();
$entity-&amp;gt;value = &apos;toto&apos;;

$doctrineEntityManager-&amp;gt;persist($entity);
$doctrineEntityManager-&amp;gt;flush();

$entity-&amp;gt;value = &apos;tata&apos;;
$doctrineEntityManager-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14614" author="beberlei" created="Sat, 30 Oct 2010 02:50:13 +0000"  >&lt;p&gt;This issue partly depends on &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-57&quot; title=&quot;Handling of Quoted Elements&quot;&gt;DBAL-57&lt;/a&gt; (otherwise the testsuite keeps failing)&lt;/p&gt;</comment>
                    <comment id="14622" author="beberlei" created="Sat, 30 Oct 2010 13:04:12 +0000"  >&lt;p&gt;There is really no simple fix for this issue, your proposed one breaks joined table inheritance.&lt;/p&gt;</comment>
                    <comment id="14623" author="beberlei" created="Sat, 30 Oct 2010 13:34:32 +0000"  >&lt;p&gt;Found a way! fixed.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="12043">DBAL-57</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-827] Class Table Inheritance is broken when child classes have the same properties</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-827</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I create one Superclass and several Subclasses. The subclasses have properties with the same name (but as I also want to have Subclasses without these properties, this is the only elegant construction), in this example &quot;name&quot;.&lt;/p&gt;

&lt;p&gt;Now when I select the Superclass, I get all Subclass entities, but the &quot;name&quot; property is not hydrated 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;&amp;lt;?php

namespace Entities;

/**
 * @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;type&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
 * @DiscriminatorMap({ &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Subclass1&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Subclass2&quot;&lt;/span&gt; })
 */
class Superclass
{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
}

/** @Entity */
class Subclass1 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Superclass
{
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
}

/** @Entity */
class Subclass2 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Superclass
{
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
}

/* */

$sub1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Subclass1;
$sub1-&amp;gt;name = &apos;sub1name&apos;;
$em-&amp;gt;persist($sub1);

$sub2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Subclass2;
$sub2-&amp;gt;name = &apos;sub2name&apos;;
$em-&amp;gt;persist($sub2);

$em-&amp;gt;flush();
$em-&amp;gt;clear();

$query = $em-&amp;gt;createQuery(&apos;SELECT s FROM Entities\Superclass s&apos;);
foreach ($query-&amp;gt;execute() as $s) {
	echo &apos;name = &apos; . $s-&amp;gt;name . PHP_EOL;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Output:&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;name = sub2name
name = 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The SQL however seems correct, both&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/warning.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &quot;name&quot; columns are selected. This seems to be a bug in hydration.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11979">DDC-827</key>
            <summary>Class Table Inheritance is broken when child classes have the same properties</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Oct 2010 08:34:10 +0000</created>
                <updated>Fri, 5 Nov 2010 12:28:57 +0000</updated>
                    <resolved>Wed, 6 Oct 2010 09:19:45 +0000</resolved>
                            <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14537" author="beberlei" created="Wed, 6 Oct 2010 09:19:37 +0000"  >&lt;p&gt;Quoting from the Docs, chapter &quot;Architecture&quot; on the requirements of entities (and inheritance):&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;Any two entity classes in a class hierarchy that inherit directly or indirectly from one another must not have a mapped property with the same name. That is, &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; B inherits from A then B must not have a mapped field with the same name as an already mapped field that is inherited from A.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14670" author="literal" created="Fri, 5 Nov 2010 12:10:44 +0000"  >&lt;p&gt;Please reopen this issue. I can can confirm it and Benjamin&apos;s reason for rejecting it is invalid.&lt;/p&gt;

&lt;p&gt;The two classes in the example are in neither directly nor indirectly inheriting from one another. They just happen to be siblings, i. e. they have the same superclass.&lt;/p&gt;

&lt;p&gt;And to pre-empt the argument: It is not always bad design to have two classes in a hierarchy that have an identically named property. At least as long as PHP does not allow for horizontal re-use via traits or such.&lt;/p&gt;

&lt;p&gt;Take this scenario:&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; 
SuperClass
|
+- SubClassA
|  +- SubSubClass1
|  +- SubSubClass2
|
+- SubClassB
   +- SubSubClass3
   +- SubSubClass4
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now if the need arises to have a property &apos;foo&apos; on both SubSubClass1 and SubSubClass4, and &apos;foo&apos; shall not be part of the top-most super class, because it makes no sense in any of the other classes, then we unfortunately have to repeat ourselves or employ some bad magic which certainly cannot be mapped with Doctrine anyway.&lt;/p&gt;</comment>
                    <comment id="14671" author="beberlei" created="Fri, 5 Nov 2010 12:28:57 +0000"  >&lt;p&gt;There is another open issue that handles this issue. Its indeed a bug.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-824] EntityManager::remove($entity), EntityManager::flush() does not remove the entity from DB</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-824</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/* 
 * @Entity
 * @Table(indexes={@Index(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;, columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;})})
 */
class ProductAttribute
{

    /**
     * ID
     * 
     * @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;var&lt;/span&gt; integer
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * Name
     *
     * @Column
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;
    /**
     * Values
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ProductAttributeValue&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;attribute&quot;&lt;/span&gt;)
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; array
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $values;

    /**
     * Gets ID
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; integer 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;
    }

    /**
     * Sets ID
     *
     * @param integer $id ID
     *
     * @&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 setId($id = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id = $id;
    }

    /**
     * Gets name
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string Name
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; 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;
    }

    /**
     * Sets name
     *
     * @param string $name Name
     *
     * @&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 setName($name = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $name;
    }

    /**
     * Gets product attribute values
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; array Product attribute values
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getValues()
    {
        &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;values;
    }

    /**
     * Adds product attribute value
     *
     * @param ProductAttributeValue $value Product attribute value
     * 
     * @&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 addValue(ProductAttributeValue $value)
    {
        $value-&amp;gt;setAttribute($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;values[] = $value;
    }

}

$attribute = $em-&amp;gt;find(&apos;ProductAttribute&apos;, 1);
$em-&amp;gt;remove($attribute);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The upper code won&apos;t remove the entity from the database.... Corresponding DQL (DELETE ProductAttribute a WHERE a.id = 1) will remove it from the database...&lt;/p&gt;</description>
                <environment>PgSQL 8.4, current Doctrine 2 from Git</environment>
            <key id="11975">DDC-824</key>
            <summary>EntityManager::remove($entity), EntityManager::flush() does not remove the entity from DB</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="petr_motejlek">Petr Motejlek</reporter>
                        <labels>
                    </labels>
                <created>Sat, 2 Oct 2010 13:28:24 +0000</created>
                <updated>Fri, 5 Nov 2010 03:25:03 +0000</updated>
                    <resolved>Fri, 5 Nov 2010 03:25:03 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14520" author="petr_motejlek" created="Sun, 3 Oct 2010 16:31:31 +0000"  >&lt;p&gt;I just found out, that when I have an entity containing a *ToMany column with cascade=&lt;/p&gt;
{&quot;remove&quot;}
&lt;p&gt; set, all the entities are removed, except for the one...&lt;/p&gt;</comment>
                    <comment id="14633" author="beberlei" created="Sun, 31 Oct 2010 02:57:20 +0000"  >&lt;p&gt;I cannot reproduce this issue. Can you try to build a reproducible test-case? Have a look at tests/Doctrine/Tests/ORM/Functional/Ticket/* and build a test-case like this one 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;&amp;lt;?php

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\Models\CMS\CmsGroup;

require_once __DIR__ . &apos;/../../../TestInit.php&apos;;

class DDC824Test &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \Doctrine\Tests\OrmFunctionalTestCase
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;useModelSet(&apos;cms&apos;);
        parent::setUp();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testRemoveWithCascade()
    {
        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CmsUser();
        $user-&amp;gt;username = &lt;span class=&quot;code-quote&quot;&gt;&quot;beberlei&quot;&lt;/span&gt;;
        $user-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Benjamin&quot;&lt;/span&gt;;
        $user-&amp;gt;status = &lt;span class=&quot;code-quote&quot;&gt;&quot;active&quot;&lt;/span&gt;;

        $phone1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Tests\Models\CMS\CmsPhonenumber();
        $phone1-&amp;gt;phonenumber = &lt;span class=&quot;code-quote&quot;&gt;&quot;1234&quot;&lt;/span&gt;;
        $phone2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Tests\Models\CMS\CmsPhonenumber();
        $phone2-&amp;gt;phonenumber = &lt;span class=&quot;code-quote&quot;&gt;&quot;1235&quot;&lt;/span&gt;;

        $user-&amp;gt;addPhonenumber($phone1);
        $user-&amp;gt;addPhonenumber($phone2);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($user);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();

        $user = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;find(get_class($user), $user-&amp;gt;id);
        $phone1 = $user-&amp;gt;phonenumbers[0];
        $phone2 = $user-&amp;gt;phonenumbers[1];

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertTrue($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($user));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertTrue($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($phone1));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertTrue($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($phone2));

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;remove($user);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertFalse($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($user));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertFalse($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($phone1));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertFalse($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($phone2));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14667" author="petr_motejlek" created="Thu, 4 Nov 2010 16:39:27 +0000"  >&lt;p&gt;I found out that I cannot reproduce the same behaviour with different project of mine either. It seems there&apos;s simply something rotten inside the one. I&apos;ll try investigating it a bit farther, but I think you can close this issue for now. Thanks for your time &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;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-809] ArrayHydrator and ObjectHydrator return different result sets for the same query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-809</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have many to many relation for 2 entities. &lt;/p&gt;

&lt;p&gt;ArrayHydrator and ObjectHydrator return different result sets for the same query. Because of some reasons ObjectHydrator mises 2 records. &lt;/p&gt;

&lt;p&gt;Code snippet and SQL to create database structure:&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 TABLE IF NOT EXISTS `specification_value_test` (
  `specification_value_id` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`specification_value_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=96058 ;

INSERT INTO `specification_value_test` (`specification_value_id`) VALUES
(94506),
(94526),
(94564),
(94589),
(94593),
(94606),
(94607),
(94609),
(94711),
(94712),
(94780);


CREATE TABLE IF NOT EXISTS `variant_specification_value_test` (
  `variant_id` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  `specification_value_id` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  PRIMARY KEY (`variant_id`,`specification_value_id`),
  KEY `specification_value_id` (`specification_value_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `variant_specification_value_test` (`variant_id`, `specification_value_id`) VALUES
(545208, 94506),
(545209, 94506),
(545208, 94526),
(545209, 94526),
(545208, 94564),
(545209, 94564),
(545209, 94589),
(545209, 94593),
(545208, 94606),
(545209, 94606),
(545208, 94607),
(545209, 94607),
(545208, 94609),
(545209, 94609),
(545208, 94711),
(545208, 94712),
(545208, 94780),
(545209, 94780);

CREATE TABLE IF NOT EXISTS `variant_test` (
  `variant_id` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`variant_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT AUTO_INCREMENT=545210 ;

INSERT INTO `variant_test` (`variant_id`) VALUES
(545208),
(545209);
&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;/**
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;variant_test&quot;&lt;/span&gt;)
 * @Entity
 */
class Variant &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base
{
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;variant_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @Id
     * @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; $variantId;
    
    /**
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;SpecificationValue&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;Variants&quot;&lt;/span&gt;)
     * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;variant_specification_value_test&quot;&lt;/span&gt;,
     *   joinColumns={
     *     @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;variant_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;variant_id&quot;&lt;/span&gt;)
     *   },
     *   inverseJoinColumns={
     *     @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification_value_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification_value_id&quot;&lt;/span&gt;)
     *   }
     * )
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $SpecificationValues;
}

/**
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification_value_test&quot;&lt;/span&gt;)
 * @Entity
 */
class SpecificationValue
{
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification_value_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @Id
     * @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; $specificationValueId;
    
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Variant
     *
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Variant&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SpecificationValues&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $Variants;
}



$result = $em-&amp;gt;createQueryBuilder()
    -&amp;gt;select(&apos;Variant, SpecificationValue&apos;)
    -&amp;gt;from(&apos;Variant&apos;, &apos;Variant&apos;)
    -&amp;gt;leftJoin(&apos;Variant.SpecificationValues&apos;, &apos;SpecificationValue&apos;)
    -&amp;gt;getQuery()
    -&amp;gt;getResult();
	
&lt;span class=&quot;code-comment&quot;&gt;// returns 9 specification values &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; first variant and 7 specification values &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; second variant
&lt;/span&gt;\Doctrine\Common\Util\Debug($result, 4);

$em-&amp;gt;createQueryBuilder()
    -&amp;gt;select(&apos;Variant, SpecificationValue&apos;)
    -&amp;gt;from(&apos;Variant&apos;, &apos;Variant&apos;)
    -&amp;gt;leftJoin(&apos;Variant.SpecificationValues&apos;, &apos;SpecificationValue&apos;)
    -&amp;gt;getQuery()
    -&amp;gt;getArrayResult();

&lt;span class=&quot;code-comment&quot;&gt;// returns 9 specification values &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; first variant and 9 specification values &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; second variant
&lt;/span&gt;\Doctrine\Common\Util\Debug($result);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu 8.04.3, php 5.3.3, mysql 5.1</environment>
            <key id="11929">DDC-809</key>
            <summary>ArrayHydrator and ObjectHydrator return different result sets for the same query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="wizardz">Andriy Savchenko</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Sep 2010 15:36:02 +0000</created>
                <updated>Mon, 20 Sep 2010 18:33:23 +0000</updated>
                    <resolved>Mon, 20 Sep 2010 18:33:23 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14416" author="beberlei" created="Mon, 20 Sep 2010 05:14:00 +0000"  >&lt;p&gt;Fixed formatting&lt;/p&gt;</comment>
                    <comment id="14424" author="beberlei" created="Mon, 20 Sep 2010 16:24:25 +0000"  >&lt;p&gt;Verified and updated priority, has to be in RC1&lt;/p&gt;</comment>
                    <comment id="14425" author="beberlei" created="Mon, 20 Sep 2010 18:33:23 +0000"  >&lt;p&gt;Fixed the issue, thank you very much for reporting &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-1274] there is no way to set collate of the table charset !</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1274</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i searched a lot for this&lt;/p&gt;

&lt;p&gt;there is no way to set the collate of table fields to for ex. utf8_persian_ci in doctrine settings&lt;/p&gt;</description>
                <environment>zend frame work 1.10 with doctrine orm 2 and dbal</environment>
            <key id="12819">DDC-1274</key>
            <summary>there is no way to set collate of the table charset !</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="placebo">sina miandashti</reporter>
                        <labels>
                        <label>charset</label>
                        <label>collate</label>
                        <label>collation</label>
                        <label>mysql</label>
                    </labels>
                <created>Wed, 13 Jul 2011 07:08:07 +0000</created>
                <updated>Mon, 12 Nov 2012 16:54:22 +0000</updated>
                    <resolved>Wed, 13 Jul 2011 17:06:20 +0000</resolved>
                            <version>2.0.6</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16171" author="beberlei" created="Wed, 13 Jul 2011 17:06:20 +0000"  >&lt;p&gt;This is not a supported feature, if you set the collation in the CREATE DATABASE statement this will inherit to all fields automatically.&lt;/p&gt;</comment>
                    <comment id="18972" author="williamk" created="Mon, 12 Nov 2012 16:53:08 +0000"  >&lt;p&gt;Actually Doctrine 2.3.0 does not allow inheritance. Please look at Issue #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2139&quot; title=&quot;Table collate/charset doesn&amp;#39;t inherits from database&quot;&gt;&lt;del&gt;DDC-2139&lt;/del&gt;&lt;/a&gt; . At least, if there&apos;s an option to set a global default collation (wich I didn&apos;t find), the problem will occurs every time a table of string/varchar field was created by Symfony2 Doctrine Command.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1254] EntityGenerator does not respect Class Inheritance properly</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1254</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, &lt;br/&gt;
as mentioned here &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-904&quot; title=&quot;No identifier/primary key specified for Entity with inheritance&quot;&gt;&lt;del&gt;DDC-904&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://github.com/symfony/symfony/issues/1550#&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/issues/1550#&lt;/a&gt; and &lt;a href=&quot;https://github.com/stof/StofDoctrineExtensionsBundle/issues/47&quot; class=&quot;external-link&quot;&gt;https://github.com/stof/StofDoctrineExtensionsBundle/issues/47&lt;/a&gt;&lt;br/&gt;
The Doctrine2 EntityGenerator does not respect inheritance of Models correctly, especially when inheriting the primary field from an abstract base class as done by Symfony2&apos;s StofDoctrineExtensionsBundle.&lt;/p&gt;

&lt;p&gt;This is extremly annoying since it renders the generator unusable when aforementioned bundle is active. It always fails with this message:&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;No identifier/primary key specified for Entity &apos;Stof\DoctrineExtensionsBundle\Entity\Translation&apos;. Every Entity must have an&lt;br/&gt;
identifier/primary key.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-904&quot; title=&quot;No identifier/primary key specified for Entity with inheritance&quot;&gt;&lt;del&gt;DDC-904&lt;/del&gt;&lt;/a&gt; mentioned this should be fixed, but this is not true: bug is still found in latest Symfony2 git.&lt;br/&gt;
The docs only refer to using a single mapping format inside a bundle, but this does not work. Stof... uses xml mappings and it does not matter if i use yml or annotiations in a different bundle - the above error is still present.&lt;/p&gt;</description>
                <environment>Symfony2 RC4, PHP 5.3., Fedora 15</environment>
            <key id="12795">DDC-1254</key>
            <summary>EntityGenerator does not respect Class Inheritance properly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Jul 2011 13:43:52 +0000</created>
                <updated>Thu, 14 Jul 2011 16:31:34 +0000</updated>
                    <resolved>Tue, 12 Jul 2011 21:49:14 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16144" author="venimus" created="Mon, 11 Jul 2011 12:22:37 +0000"  >&lt;p&gt;I already reported this issue, but it was not fixed &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1177&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1177&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16161" author="beberlei" created="Tue, 12 Jul 2011 21:49:14 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;

&lt;p&gt;@venimius: You didn&apos;t say a word about EntityGenerator in your ticket, which was the critical information that helped me solve this issue.&lt;/p&gt;</comment>
                    <comment id="16167" author="bigbadbassman" created="Wed, 13 Jul 2011 06:31:59 +0000"  >&lt;p&gt;THANKS!&lt;/p&gt;</comment>
                    <comment id="16173" author="venimus" created="Thu, 14 Jul 2011 16:31:34 +0000"  >&lt;p&gt;@Benajmin, sorry but wasn&apos;t sure where is the problem i thought it might be me, that is why i simply stated that it is a schema-tool problem. &lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="12770">DDC-1243</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1225] Invalid SQL generated (extra comma) when joining to entity with composite PK</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1225</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;            $qb-&amp;gt;from(&apos;Tournaments_Model_StageBracketTeamRegistration&apos;, &apos;r&apos;)
               -&amp;gt;innerJoin(&apos;r.teamSelection&apos;, &apos;ts&apos;)
               -&amp;gt;innerJoin(&apos;ts.players&apos;, &apos;tsp&apos;)
               -&amp;gt;select(&apos;r, ts, tsp&apos;)
               -&amp;gt;where(&apos;r.stageBracket = ?1&apos;)
               -&amp;gt;andWhere(&apos;r.opponentIsReserve = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&apos;)
               -&amp;gt;orderBy(&apos;r.registrationDateTime&apos;)
               -&amp;gt;setParameter(1, $bracket);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Generates:&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_.opponent_is_reserve AS opponent_is_reserve1, s0_.opponent_checked_in AS opponent_checked_in2, s0_.registration_date_time AS registration_date_time3, t1_.id AS id4,, s0_.type AS type5, s0_.stage_bracket_id AS stage_bracket_id6, s2_.team_selection_id AS team_selection_id7, t1_.team_id AS team_id8, t3_.team_selection_id AS team_selection_id9, t3_.player_id AS player_id10
FROM stage_bracket_team_registrations s2_
INNER JOIN stage_bracket_registrations s0_ ON s2_.id = s0_.id
INNER JOIN team_selections t1_ ON s2_.team_selection_id = t1_.id
INNER JOIN team_selection_players t3_ ON t1_.id = t3_.team_selection_id
WHERE s0_.stage_bracket_id = 22 AND s0_.opponent_is_reserve = 0
ORDER BY s0_.registration_date_time ASC&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note the 2nd comma after &quot;t1_.id AS id4&quot;. TeamSelectionPlayer uses a composite PK. I have attached the relevant entity classes.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12744">DDC-1225</key>
            <summary>Invalid SQL generated (extra comma) when joining to entity with composite PK</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="darkangel">Glen Ainscow</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Jun 2011 16:15:08 +0000</created>
                <updated>Mon, 29 Aug 2011 19:56:26 +0000</updated>
                    <resolved>Mon, 15 Aug 2011 15:47:42 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.2</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16228" author="beberlei" created="Thu, 28 Jul 2011 21:31:08 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="16312" author="darkangel" created="Fri, 12 Aug 2011 19:40:45 +0000"  >&lt;p&gt;Where can I find the changeset? Would it be easy for me to apply the changes to 2.1.0?&lt;/p&gt;</comment>
                    <comment id="16313" author="darkangel" created="Fri, 12 Aug 2011 20:32:41 +0000"  >&lt;p&gt;No worries, found the changes here: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/196632978cf39bc3914e14739767cb5b72a8df9d&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/196632978cf39bc3914e14739767cb5b72a8df9d&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16315" author="darkangel" created="Sat, 13 Aug 2011 18:59:10 +0000"  >&lt;p&gt;This is still an issue:
&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-&amp;gt;from(&apos;Tournaments_Model_StageBracketRegisteredPlayer&apos;, &apos;p&apos;)
               -&amp;gt;select(&apos;p&apos;)
               -&amp;gt;where(&apos;p.stageBracket = ?1&apos;)
               -&amp;gt;andWhere(&apos;p.player = ?2&apos;)
               -&amp;gt;setParameter(1, $bracket)
               -&amp;gt;setParameter(2, $player)
               -&amp;gt;getQuery()
               -&amp;gt;getOneOrNullResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Results in:&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_.stage_bracket_id AS stage_bracket_id0, s0_.player_id AS player_id1, s0_.game_account_id AS game_account_id2 FROM stage_bracket_registered_players s0_ WHERE s0_.stage_bracket_id = 14 AND s0_.player_id = 5
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16319" author="guilhermeblanco" created="Sun, 14 Aug 2011 03:03:26 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I attempted to create a failing test case for this issue, but either the provided entities are not enough or the issue is not reproducible anymore (it was already fixed in latest 2.2-DEV).&lt;/p&gt;

&lt;p&gt;Could you please try to compile everything into a test case?&lt;/p&gt;


&lt;p&gt;Cheers, &lt;/p&gt;</comment>
                    <comment id="16335" author="darkangel" created="Mon, 15 Aug 2011 07:50:12 +0000"  >&lt;p&gt;Hi Guilherme,&lt;/p&gt;

&lt;p&gt;I&apos;ll attach 2 simple entities for testing. You can run the following query:
&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-&amp;gt;from(&apos;App_Model_TestEntity1&apos;, &apos;te1&apos;)
           -&amp;gt;select(&apos;te1&apos;)
           -&amp;gt;where(&apos;te1.testEntity2 = ?1&apos;)
           -&amp;gt;setParameter(1, 0)
           -&amp;gt;getQuery()
           -&amp;gt;getOneOrNullResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m running this against 2.1.0 + &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/196632978cf39bc3914e14739767cb5b72a8df9d&quot; class=&quot;external-link&quot;&gt;this&lt;/a&gt; change.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="16340" author="guilhermeblanco" created="Mon, 15 Aug 2011 15:47:42 +0000"  >&lt;p&gt;Fixed in this commit &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/6857134f36097187ab2f0d932f4f1d9ffab12854&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/6857134f36097187ab2f0d932f4f1d9ffab12854&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for the report!&lt;/p&gt;</comment>
                    <comment id="16399" author="beberlei" created="Mon, 29 Aug 2011 19:56:14 +0000"  >&lt;p&gt;Merged into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11048" name="models.zip" size="646" author="darkangel" created="Mon, 15 Aug 2011 07:51:24 +0000" />
                    <attachment id="11016" name="models.zip" size="2010" author="darkangel" created="Thu, 23 Jun 2011 16:15:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1204] Single Table Inheritance - Columns of one hierarchy are dropped</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1204</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the following example, the columns of the classes B, C, D are not in the database schema. Only those of the classes A and 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;/**
 * @ORM\Entity
 * @ORM\Table(name = &lt;span class=&quot;code-quote&quot;&gt;&quot;a&quot;&lt;/span&gt;)
 * @ORM\ChangeTrackingPolicy(&lt;span class=&quot;code-quote&quot;&gt;&quot;DEFERRED_EXPLICIT&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&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;, length=20)
 * @ORM\DiscriminatorMap({
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;C&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;d&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;D&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;e&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;E&quot;&lt;/span&gt;
 * })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class A { }

/**
 * @ORM\Entity
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class B &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; A { }

/**
 * @ORM\Entity
 */
class C &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; B { }

/**
 * @ORM\Entity
 */
class D &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; B { }

/**
 * @ORM\Entity
 */
class E &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; A { }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12709">DDC-1204</key>
            <summary>Single Table Inheritance - Columns of one hierarchy are dropped</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Jun 2011 07:41:44 +0000</created>
                <updated>Wed, 15 Jun 2011 20:27:53 +0000</updated>
                    <resolved>Wed, 15 Jun 2011 20:27:53 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15977" author="johannes" created="Mon, 13 Jun 2011 08:13:17 +0000"  >&lt;p&gt;The problem here is that class B is not part of the discriminator map which was necessary due to issue #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1203&quot; title=&quot;Single Table Inheritance - Discriminator Column is not populated&quot;&gt;&lt;del&gt;DDC-1203&lt;/del&gt;&lt;/a&gt;. So, once that is resolved this can likely be closed as well.&lt;/p&gt;</comment>
                    <comment id="15991" author="beberlei" created="Wed, 15 Jun 2011 20:27:53 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1203] Single Table Inheritance - Discriminator Column is not populated</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1203</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the following class inheritance; if I have the mapped super class in there, the discriminator column is not populated; if I remove it, it is correctly set.&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;a&quot;&lt;/span&gt;)
 * @ORM\ChangeTrackingPolicy(&lt;span class=&quot;code-quote&quot;&gt;&quot;DEFERRED_EXPLICIT&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&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;, length=20)
 * @ORM\DiscriminatorMap({
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;C&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;d&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;D&quot;&lt;/span&gt;
 * })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class A { }

/**
 * @ORM\MappedSuperClass
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class B &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; A { }

/**
 * @ORM\Entity
 */
class C &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; B { }

/**
 * @ORM\Entity
 */
class D &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; B { }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12708">DDC-1203</key>
            <summary>Single Table Inheritance - Discriminator Column is not populated</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 12 Jun 2011 19:58:17 +0000</created>
                <updated>Thu, 30 Jun 2011 18:58:33 +0000</updated>
                    <resolved>Sat, 18 Jun 2011 18:55:25 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16009" author="beberlei" created="Sat, 18 Jun 2011 18:55:25 +0000"  >&lt;p&gt;This was fixed or something.&lt;/p&gt;</comment>
                    <comment id="16100" author="codingrobot" created="Thu, 30 Jun 2011 16:45:03 +0000"  >&lt;p&gt;The following hierarchy doesn&apos;t work after commit 5ff44b5ec75f6d716ec3.&lt;/p&gt;

&lt;p&gt;The thrown exception is:&lt;br/&gt;
&apos;Entity\AbstractMaschine&apos; has to be part of the descriminator map of &apos;Entity\Inventory&apos;&lt;/p&gt;

&lt;p&gt;Inventory is just a plain abstract class which contains the @Id field and a few methods used by all subclasses.&lt;/p&gt;</comment>
                    <comment id="16101" author="beberlei" created="Thu, 30 Jun 2011 17:52:14 +0000"  >&lt;p&gt;Yes, please add it to the discriminator map, it is necessary for internal algorithms that this class is in the map.&lt;/p&gt;</comment>
                    <comment id="16102" author="beberlei" created="Thu, 30 Jun 2011 18:58:33 +0000"  >&lt;p&gt;Ok this has been changed, its not necessary for abstract classes anymore.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11020" name="graph.jpg" size="21325" author="codingrobot" created="Thu, 30 Jun 2011 16:45:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1190] Update the doctrine mapping schma in such way it will allow extending the final xml with data from different vendors</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1190</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;ve already made a PR&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/64&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/64&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12691">DDC-1190</key>
            <summary>Update the doctrine mapping schma in such way it will allow extending the final xml with data from different vendors</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Jun 2011 07:24:45 +0000</created>
                <updated>Wed, 15 Jun 2011 20:48:06 +0000</updated>
                    <resolved>Wed, 15 Jun 2011 20:48:06 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15992" author="beberlei" created="Wed, 15 Jun 2011 20:48:06 +0000"  >&lt;p&gt;This was implemented.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1163] entity persister gets superclasses&apos; metadata for proxied subclass entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1163</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using class table inheritance:&lt;/p&gt;

&lt;p&gt;When a proxy for a subclass-entity is registered at the unit of work and another entity, which references that entities&apos; superclass, is added or removed, the employed entity persister gets/uses the superclasses&apos; metadata.&lt;/p&gt;

&lt;p&gt;If the change-set of the referenced entity contains fields only defined in the subclass, the persister will create bogus SQL because it has no column names or data types: &lt;tt&gt;UPDATE table SET = ? WHERE id = ?&lt;/tt&gt;&lt;/p&gt;


&lt;p&gt;The attached test case is stand-alone, creating an SQLite in-memory DB (sorry, I&apos;m not familiar with your test suite).&lt;/p&gt;

&lt;p&gt;Only the path to Doctrine must be adapted at the top of &apos;run_test.php&apos;.&lt;br/&gt;
The file &apos;SubclassPropertyBugTest.php&apos; also contains a more detailed description.&lt;/p&gt;</description>
                <environment>PHP 5.3.6 on Debian Lenny &amp;amp; WinXP, PostgreSQL 8.4 &amp;amp; SQLite 3</environment>
            <key id="12656">DDC-1163</key>
            <summary>entity persister gets superclasses&apos; metadata for proxied subclass entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="literal">Stan Imbt</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 May 2011 22:15:56 +0000</created>
                <updated>Sun, 5 Jun 2011 14:27:34 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 14:27:34 +0000</resolved>
                            <version>2.0.3</version>
                <version>2.0.4</version>
                <version>2.0.5</version>
                                <fixVersion>2.0.6</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15932" author="beberlei" created="Sun, 5 Jun 2011 13:48:51 +0000"  >&lt;p&gt;Verified on 2.0.5, interestingly this bug seems to have vanished in 2.1 / master. I will investigate whats wrong.&lt;/p&gt;</comment>
                    <comment id="15934" author="beberlei" created="Sun, 5 Jun 2011 14:22:11 +0000"  >&lt;p&gt;Found the problem and fixed it. Very nasty timing error with inheritance and a false check.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10994" name="testcase.zip" size="5144" author="literal" created="Fri, 20 May 2011 22:15:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1113] getCommitOrder misses some relations when used with Inheritance and self-referencing field</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1113</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Let&apos;s assume we have an Entity class &quot;ParentClass&quot;, which uses a single table inheritance with child classes &quot;ChildOne&quot; and &quot;ChildTwo&quot;.&lt;br/&gt;
&quot;ParentClass&quot; also have one-to-one unidirectional association with &quot;FooBar&quot; class named &quot;foobar&quot;, and a self-referencing association called &quot;parent&quot; &lt;/p&gt;

&lt;p&gt;We construct entity of &quot;ChildOne&quot; type, filling &quot;foobar&quot; link with new FooBar object. The same action is made for entity of &quot;ChildTwo&quot; type. &lt;br/&gt;
Entity of &quot;ChildOne&quot; type is persisted and flushed.&lt;/p&gt;

&lt;p&gt;At this point getCommitOrder builds a commit order. ChildOne &amp;lt;---&amp;gt; FooBar link appears in dependency graph because of &quot;foobar&quot; association. &lt;br/&gt;
While processing assocs it reveals &quot;parent&quot; assoc in parent class and builds following links in dependency graph:&lt;br/&gt;
ChildOne &amp;lt;---&amp;gt; ChildOne&lt;br/&gt;
ChildOne &amp;lt;---&amp;gt; ChildTwo&lt;/p&gt;

&lt;p&gt;After that &quot;ChildTwo&quot; entity is persisted and flushed. At this point commit calculator thinks it already have &quot;ChildTwo&quot; in it&apos;s storage so no assoc calculation are made for &quot;childTwo&quot; class&lt;/p&gt;

&lt;p&gt;If we attemp to delete &quot;ChildTwo&quot; class flush() will fail because of missing link &quot;ChildTwo &amp;lt;-----&amp;gt; Foobar&quot; assoc&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12557">DDC-1113</key>
            <summary>getCommitOrder misses some relations when used with Inheritance and self-referencing field</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="xanf">Illya Klymov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Apr 2011 13:01:20 +0000</created>
                <updated>Sat, 27 Aug 2011 18:47:03 +0000</updated>
                    <resolved>Sat, 27 Aug 2011 18:47:03 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15725" author="xanf" created="Tue, 12 Apr 2011 15:45:54 +0000"  >&lt;p&gt;I&apos;ve opened pull request &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/47&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/47&lt;/a&gt; with my fix to this issue. I&apos;m new to doctrine development so feel free to make any suggestions how to improve it&lt;/p&gt;</comment>
                    <comment id="16217" author="beberlei" created="Tue, 26 Jul 2011 21:36:29 +0000"  >&lt;p&gt;Increased priority, i should really look at this one soon!&lt;/p&gt;</comment>
                    <comment id="16285" author="beberlei" created="Sat, 6 Aug 2011 19:47:26 +0000"  >&lt;p&gt;The test with this pull request does not fail even without the applied patch.&lt;/p&gt;</comment>
                    <comment id="16286" author="beberlei" created="Sat, 6 Aug 2011 19:56:06 +0000"  >&lt;p&gt;sorry my bad, ran this with SQLite (Which has no FKs)&lt;/p&gt;</comment>
                    <comment id="16388" author="beberlei" created="Sat, 27 Aug 2011 18:47:03 +0000"  >&lt;p&gt;Fixed, simplifed a bit since one part was not necessary and this hits performance quite significantly&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1105] Unable to persist entities implemented using Class Table Inheritance(CTI) strategy across multiple database tables</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1105</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>
&lt;p&gt;I have 2 classes, a Parent class, Person and a Child class Employee using Class Table Inheritance mapping strategy. The classes&apos; corresponding tables exist in 2 separate database: Person table exists in database: dbOne and Employee table is in dbTwo.&lt;/p&gt;

&lt;p&gt;The classes are like:&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Entity&lt;/li&gt;
	&lt;li&gt;@InheritanceType(&quot;JOINED&quot;)&lt;/li&gt;
	&lt;li&gt;@DiscriminatorColumn(name=&quot;discr&quot;, type=&quot;string&quot;)&lt;/li&gt;
	&lt;li&gt;@DiscriminatorMap(
{&quot;person&quot; = &quot;Person&quot;, &quot;employee&quot; = &quot;Employee&quot;}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;@Table(name=&quot;Person&quot;)&lt;br/&gt;
 */&lt;br/&gt;
class Person&lt;br/&gt;
{&lt;br/&gt;
and the child class&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Entity&lt;/li&gt;
	&lt;li&gt;@Table(name=&quot;Employee&quot;)&lt;br/&gt;
 */&lt;br/&gt;
class Employee extends Person&lt;br/&gt;
{&lt;br/&gt;
The schema for the Employee table looks like so:&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;CREATE TABLE Employee (&lt;br/&gt;
    id INT NOT NULL,&lt;br/&gt;
    department VARCHAR(50) NOT NULL,&lt;br/&gt;
    PRIMARY KEY(id)&lt;br/&gt;
) ENGINE = InnoDB;&lt;br/&gt;
ALTER TABLE Employee ADD FOREIGN KEY (id) REFERENCES  dbOne.Person(id) ON DELETE CASCADE&lt;/p&gt;

&lt;p&gt;where the reference table name is prefixed with the database name.&lt;/p&gt;

&lt;p&gt;The main problem is that when I call&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;entityManager-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;On Person object, it flags an error:&lt;/p&gt;

&lt;p&gt;Message: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S02&amp;#93;&lt;/span&gt;: Base table or view not found: 1146 Table &apos;dbOne.Employee&apos; doesn&apos;t exist . Apparently, the expectation is for the base class to persist its instance and be able to automatically persist the sub class as well. This problem is absent when the tables are in the same database- which indicates that the CTI structure expects the entity tables to be within the same database. The reverse is true if I call the entity manager (for dbTwo) to save an Employee object. &lt;/p&gt;

&lt;p&gt;Is there a workaround for this bug/feature?&lt;/p&gt;
</description>
                <environment>zend framework, Doctrine 2, Apache, MySQL, Windows</environment>
            <key id="12544">DDC-1105</key>
            <summary>Unable to persist entities implemented using Class Table Inheritance(CTI) strategy across multiple database tables</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ire.ogunsina">Ire Ogunsina</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Apr 2011 08:58:57 +0000</created>
                <updated>Sun, 1 May 2011 04:43:04 +0000</updated>
                    <resolved>Sun, 1 May 2011 04:43:04 +0000</resolved>
                                                            <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15709" author="ire.ogunsina" created="Thu, 7 Apr 2011 10:16:48 +0000"  >&lt;p&gt;It appears that ORM technologies are limited in their ability to generate SQL queries that interrogate multiple databases in a single SQL statement (unit of work). This largely may be due to the fact that the entity manager is restricted to one database. This limitation may be responsible for this behavior.&lt;/p&gt;</comment>
                    <comment id="15788" author="beberlei" created="Sun, 1 May 2011 04:43:04 +0000"  >&lt;p&gt;Yes, the EntityManager is focused on one database, not multiple.&lt;/p&gt;

&lt;p&gt;There are two workarounds:&lt;/p&gt;

&lt;p&gt;1. @Table(name=&quot;dbOne.foo&quot;)&lt;br/&gt;
2. Create a View in the database.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1047] Combining explicit join syntax with multiple from-clause argument-list entries will generate broken SQL on MySQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1047</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using explicit join syntax, MySQL requires the from-clause argument-list to have either only one entry, or, if it contains multiple entries, it requires that the complete argument-list be surrounded by parantheses. Currently, Doctrine 2 does not respect this requirement when compiling DQL statements, and produces broken SQL in some situations.&lt;/p&gt;

&lt;p&gt;Consider the following example of a legitimate DQL 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 vendorListXMLRow
                        FROM \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\vendorListXML\VendorListXMLRow vendorListXMLRow,
                             \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\parameterListXML\ParameterListXMLRow parameterListXMLRow
       			        JOIN vendorListXMLRow.vendorListXML vendorListXML
       			        JOIN vendorListXML.inputComponentDataVersion vendorListXMLInputComponentDataVersion
                        JOIN parameterListXMLRow.parameterListXML parameterListXML
       			        JOIN parameterListXML.inputComponentDataVersion parameterListXMLInputComponentDataVersion
                       WHERE :dataVersion MEMBER OF vendorListXMLInputComponentDataVersion.dataVersions
                         AND vendorListXMLRow.ID = parameterListXMLRow.WERT
                         AND :dataVersion MEMBER OF parameterListXMLInputComponentDataVersion.dataVersions
                         AND parameterListXMLRow.ID = :parameterID
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will be compiled down to:&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 v0_.ID AS ID0, v0_.DEBITORENSAMMELKONTENLISTEN_DATEINAME AS DEBITORENSAMMELKONTENLISTEN_DATEINAME1, v0_.RECHNUNGS_KONFIGURATION_DATEINAME AS RECHNUNGS_KONFIGURATION_DATEINAME2, v0_.RECHNUNGS_LAYOUT_DATEINAME AS RECHNUNGS_LAYOUT_DATEINAME3, v0_.dbID AS dbID4, v0_.vendorListXML_dbID AS vendorListXML_dbID5
FROM VendorListXMLRow v0_, ParameterListXMLRow p1_
INNER JOIN VendorListXML v2_ ON v0_.vendorListXML_dbID = v2_.dbID LEFT JOIN VersionedDataObject v3_ ON v2_.dbID = v3_.dbID INNER JOIN InputComponentDataVersion i4_ ON v3_.inputComponentDataVersion_dbID = i4_.dbID INNER JOIN ParameterListXML p5_ ON p1_.parameterListXML_dbID = p5_.dbID
LEFT JOIN VersionedDataObject v6_ ON p5_.dbID = v6_.dbID
INNER JOIN InputComponentDataVersion i7_ ON v6_.inputComponentDataVersion_dbID = i7_.dbID
WHERE EXISTS
 (SELECT 1 FROM DataVersion_inputComponentDataVersions d8_ INNER JOIN DataVersion d9_ ON d8_.inputComponentDataVersion_dbID = d9_.dbID WHERE d8_.dataVersion_dbID = i4_.dbID AND d9_.dbID = &apos;1&apos;) AND v0_.ID = p1_.WERT AND EXISTS
 (SELECT 1 FROM DataVersion_inputComponentDataVersions d8_ INNER JOIN DataVersion d9_ ON d8_.inputComponentDataVersion_dbID = d9_.dbID WHERE d8_.dataVersion_dbID = i7_.dbID AND d9_.dbID = &apos;1&apos;) AND p1_.ID = &apos;Mandant zur Zuordnung von Analogauftr&#195;&#164;gen&apos; LIMIT 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This SQL query can&apos;t be executed, because MySQL will complain. The error message is &quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;v0_.vendorListXML_dbID&apos; in &apos;on clause&quot;.&lt;/p&gt;

&lt;p&gt;The resulting error gives no sensible error message, and is a pain to debug, because obviously, the column mentioned &lt;em&gt;does&lt;/em&gt; exist. The real cause of the error is that MySQL will cease to correctly interpret the aliases given, as long as parantheses not are used. I acknowledge that the MySQL behavior is downright stupid. This might well be considered a bug in MySQL, but unfortunately, the parantheses are documented in their syntax docs (&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;), though I could not find any official statement regarding the use.&lt;/p&gt;

&lt;p&gt;Fortunately it is easy to patch Doctrine to support it.&lt;/p&gt;


&lt;p&gt;Now, let&apos;s add parantheses around the from clause argument list of the generated SQL statement:&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 v0_.ID AS ID0, v0_.DEBITORENSAMMELKONTENLISTEN_DATEINAME AS DEBITORENSAMMELKONTENLISTEN_DATEINAME1, v0_.RECHNUNGS_KONFIGURATION_DATEINAME AS RECHNUNGS_KONFIGURATION_DATEINAME2, v0_.RECHNUNGS_LAYOUT_DATEINAME AS RECHNUNGS_LAYOUT_DATEINAME3, v0_.dbID AS dbID4, v0_.vendorListXML_dbID AS vendorListXML_dbID5
 FROM (VendorListXMLRow v0_, ParameterListXMLRow p1_) 
INNER JOIN VendorListXML v2_ ON v0_.vendorListXML_dbID = v2_.dbID LEFT JOIN VersionedDataObject v3_ ON v2_.dbID = v3_.dbID
INNER JOIN InputComponentDataVersion i4_ ON v3_.inputComponentDataVersion_dbID = i4_.dbID INNER JOIN ParameterListXML p5_ ON p1_.parameterListXML_dbID = p5_.dbID 
LEFT JOIN VersionedDataObject v6_ ON p5_.dbID = v6_.dbID
INNER JOIN InputComponentDataVersion i7_ ON v6_.inputComponentDataVersion_dbID = i7_.dbID
WHERE EXISTS 
(SELECT 1 FROM DataVersion_inputComponentDataVersions d8_ INNER JOIN DataVersion d9_ ON d8_.inputComponentDataVersion_dbID = d9_.dbID WHERE d8_.dataVersion_dbID = i4_.dbID AND d9_.dbID = &apos;1&apos;) AND v0_.ID = p1_.WERT AND EXISTS
 (SELECT 1 FROM DataVersion_inputComponentDataVersions d8_ INNER JOIN DataVersion d9_ ON d8_.inputComponentDataVersion_dbID = d9_.dbID WHERE d8_.dataVersion_dbID = i7_.dbID AND d9_.dbID = &apos;1&apos;) AND p1_.ID = &apos;Mandant zur Zuordnung von Analogauftr&#195;&#164;gen&apos; LIMIT 1&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This works without complaints.&lt;/p&gt;

&lt;p&gt;The example query is a bit peculiar in that it uses both explicit join syntax and various from-clause entries. But according to DQL&apos;s EBNF definition, there is nothing that should prevent Doctrine 2 users from doing it. And it must work this way, because anyway else it would be impossible to specify join criteria that are no declared relationships (using explicit join-syntax only), and the other way around (using from-clause entries only, i. e. no explicit join syntax, and specifying the join conditions in the where clause) makes it impossible to join on foreign keys. Hence, under such circumstances, combining both approaches is a requirement if joins should be fully expressive.&lt;/p&gt;

&lt;p&gt;It is possible to completely work around these issues by sticking to a single from-clause entry, using explicit join syntax, and adding all further joins that require non-foreign-key join expressions into correlated subqueries. However, this is not straightforward and forces users into a workaround for what joins are intended for in the first place.&lt;/p&gt;


&lt;p&gt;This scenario is annoying, because if you were to suppress that use case completely, the EBNF would have to be significantly rewritten (and it would be the wrong thing to do IMO anyway).&lt;/p&gt;

&lt;p&gt;I believe the most straightforward solution is to &lt;em&gt;always&lt;/em&gt; add parantheses around the from-clause argument-list for the MySQL dialect.&lt;/p&gt;


&lt;p&gt;I found this web page, which might be worth reading to get an understanding of the problem, as it describes the exact same issue (though with Hibernate):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.thinkplexx.com/learn/article/db/quer/joinwhere&quot; class=&quot;external-link&quot;&gt;http://www.thinkplexx.com/learn/article/db/quer/joinwhere&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12429">DDC-1047</key>
            <summary>Combining explicit join syntax with multiple from-clause argument-list entries will generate broken SQL on MySQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 Feb 2011 11:21:46 +0000</created>
                <updated>Thu, 29 Sep 2011 23:06:59 +0000</updated>
                    <resolved>Thu, 29 Sep 2011 23:03:04 +0000</resolved>
                            <version>2.0.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15396" author="dalvarez" created="Sat, 26 Feb 2011 13:26:32 +0000"  >&lt;p&gt;Here&apos;s a patched Doctrine\ORM\Query\SqlWalker that implements the additional parantheses around the from-clause argument-list.&lt;/p&gt;

&lt;p&gt;Consider this prototype quality, for testing and verification purposes. I am sure it could be implemented more cleanly.&lt;/p&gt;

&lt;p&gt;I have not yet taken the time to get the big picture of where this can be sustainably implemented in Doctrine 2 (specially being probably MySQL-specific), but I needed this to work quickly, so this is a first shot at it.&lt;/p&gt;</comment>
                    <comment id="15423" author="beberlei" created="Tue, 1 Mar 2011 17:40:40 +0000"  >&lt;p&gt;Fixed formating&lt;/p&gt;</comment>
                    <comment id="15424" author="dalvarez" created="Tue, 1 Mar 2011 17:45:14 +0000"  >&lt;p&gt;It actually seems to be an SQL 2003 compliance thing.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bugs.mysql.com/bug.php?id=13551&quot; class=&quot;external-link&quot;&gt;http://bugs.mysql.com/bug.php?id=13551&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See post from 8 Oct 2005 12:12.&lt;/p&gt;</comment>
                    <comment id="15425" author="dalvarez" created="Tue, 1 Mar 2011 17:56:00 +0000"  >&lt;p&gt;It&apos;s becoming even worse since the problem is actually more general. Consider this 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 wpomOrder.documentDate, wpomOrder.documentID,
                                SUM(orderLine.value), SUM(orderLine.totalValue), SUM(orderLine.purchaseValue), SUM(orderLine.totalPurchaseValue)
                           FROM \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\webProductionOrderManager\WPOMOrder wpomOrder,
                                \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\webProductionOrderManager\XMLDocument xmlDocument
                           JOIN wpomOrder.inputComponentDataVersion webProductionOrderManagerInputComponentDataVersion
                           JOIN wpomOrder.orderLines orderLine
                          WHERE :dataVersion MEMBER OF webProductionOrderManagerInputComponentDataVersion.dataVersions
                            AND wpomOrder.destinationOutlet = :outlet
                            AND xmlDocument.wpomOrder = wpomOrder
                            AND wpomOrder.orderCreatorListXMLRow IN (SELECT orderCreatorListXMLRow
                                                                       FROM \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\orderCreatorListXML\OrderCreatorListXMLRow orderCreatorListXMLRow
                                                                       JOIN orderCreatorListXMLRow.orderCreatorListXML orderCreatorListXML
                                                                       JOIN orderCreatorListXML.inputComponentDataVersion orderCreatorListXMLInputComponentDataVersion
                                                                      WHERE :dataVersion MEMBER OF orderCreatorListXMLInputComponentDataVersion.dataVersions
                                                                        AND orderCreatorListXMLRow.ABRECHNUNGSTYP = \&apos;&apos; . self::$creatorModeInvoices . &apos;\&apos;)
                          
                          ORDER BY wpomOrder.documentDate
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I do not want to bother you with the details of this data model. Suffices to say that WPOMOrder inherits from VersionedDataObject.&lt;/p&gt;

&lt;p&gt;This will be compiled down to:&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 w0_.documentDate AS documentDate0, w0_.documentID AS documentID1, SUM(o1_.value) AS sclr2, SUM(o1_.totalValue) AS sclr3, SUM(o1_.purchaseValue) AS sclr4, SUM(o1_.totalPurchaseValue) AS sclr5
 FROM (WPOMOrder w0_) INNER JOIN VersionedDataObject v2_ ON w0_.dbID = v2_.dbID, XMLDocument x3_ INNER JOIN Document d4_ ON x3_.dbID = d4_.dbID
 INNER JOIN InputComponentDataVersion i5_ ON v2_.inputComponentDataVersion_dbID = i5_.dbID INNER JOIN OrderLine o1_ ON w0_.dbID = o1_.wpomOrder_dbID
 WHERE EXISTS (SELECT 1 FROM DataVersion_inputComponentDataVersions d6_ INNER JOIN DataVersion d7_ ON d6_.inputComponentDataVersion_dbID = d7_.dbID WHERE d6_.dataVersion_dbID = i5_.dbID AND d7_.dbID = &apos;1&apos;) AND
 w0_.destinationOutlet_dbID = &apos;1&apos; AND d4_.wpomOrder_dbID = v2_.dbID AND w0_.orderCreatorListXMLRow_dbID IN (SELECT o8_.dbID FROM OrderCreatorListXMLRow o8_ INNER JOIN OrderCreatorListXML o9_ ON o8_.orderCreatorListXML_dbID = o9_.dbID LEFT JOIN VersionedDataObject v10_ ON o9_.dbID = v10_.dbID INNER JOIN InputComponentDataVersion i11_ ON v10_.inputComponentDataVersion_dbID = i11_.dbID
 WHERE EXISTS (SELECT 1 FROM DataVersion_inputComponentDataVersions d6_ INNER JOIN DataVersion d7_ ON d6_.inputComponentDataVersion_dbID = d7_.dbID WHERE d6_.dataVersion_dbID = i11_.dbID AND d7_.dbID = &apos;1&apos;) AND o8_.ABRECHNUNGSTYP = &apos;Rechnungen&apos;)
 ORDER BY w0_.documentDate ASC
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;... which introduces ambiguity, because the inheritance is inserted before the second FROM-clause entry is added. Which means, the &quot;first shot&quot; fix I attached will not work for this case.&lt;/p&gt;

&lt;p&gt;The solution would have to make sure that this kind of ambiguity on SQL 2003-compliant systems is generally eliminated from the generated queries, by proper use of parantheses in all situations.&lt;/p&gt;</comment>
                    <comment id="15427" author="dalvarez" created="Tue, 1 Mar 2011 18:47:10 +0000"  >&lt;p&gt;Note that the second example runs on the patched SQLWalker, which still does not cover the inheritance declaration properly.&lt;br/&gt;
Without the patch, it would already produce wrong SQL in the first example, of course.&lt;/p&gt;</comment>
                    <comment id="15429" author="dalvarez" created="Tue, 1 Mar 2011 19:00:19 +0000"  >&lt;p&gt;The query shown above needlessly queries the entity XMLDocument, which, fortunately, is no longer needed in this use case. This being fixed, to me it is no blocker bug, but there are cases where inheritance will actually be used in conjunction with multiple from-clause entries, and I am pretty sure such scenarios will arise, so I leave this query here in the comments to illustrate the problem.&lt;/p&gt;</comment>
                    <comment id="15513" author="dalvarez" created="Sat, 19 Mar 2011 09:49:34 +0000"  >&lt;p&gt;Increased priority to critical.&lt;/p&gt;

&lt;p&gt;Mind you, this bug causes Doctrine to regularly generate broken queries on MySQL. Without my local patch, it would be unusable for my use case.&lt;/p&gt;

&lt;p&gt;I believe a fix for this would be crucial. Doctrine absolutely needs to generate SQL 2003 compatible FROM clauses.&lt;/p&gt;</comment>
                    <comment id="15514" author="dalvarez" created="Sat, 19 Mar 2011 09:54:12 +0000"  >&lt;p&gt;Attached new patched SQLWalker, now extended to add parantheses around FROM clauses within subqueries. Again, this is prototype quality, but it apparently fixes the problem.&lt;/p&gt;</comment>
                    <comment id="15518" author="dalvarez" created="Sat, 19 Mar 2011 21:33:29 +0000"  >&lt;p&gt;Increased priority to blocker.&lt;/p&gt;

&lt;p&gt;Now I have a query that relies on multiple FROM-clause argument-list entries, combined with JOIN expressions, that relies on an inheritance join as well. This is the type of query I described in my comment from 01/Mar/11 05:56 PM. In such a case, Doctrine 2 will generate invalid code leading to the following MySQL Server Error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt; in &apos;on clause.&lt;/p&gt;

&lt;p&gt;The column mentioned exists, though, MySQL Server just can not properly understand the aliases given, because the generated query is ambiguous, and MySQL Server is smart enough to complain about it.&lt;/p&gt;

&lt;p&gt;A quick fix would be to generally move inheritance join expressions past the regular FROM-clause entries, and use proper parantheses around the list of regular (i . e. non-join table-reference) FROM-clause argument-list entries.&lt;/p&gt;

&lt;p&gt;Please fix this ASAP. This is fundamental.&lt;/p&gt;</comment>
                    <comment id="15519" author="beberlei" created="Sun, 20 Mar 2011 05:16:02 +0000"  >&lt;p&gt;This fails on PostgreSQL aswell, not on SQLite however. I cant run Oracle currently as my machine with that is broken.&lt;/p&gt;

&lt;p&gt;The problem here is twofold:&lt;/p&gt;

&lt;p&gt;1. Joins generated for inheritance hierachies have to always be wrapped in parenthesis.&lt;br/&gt;
2. Support for explicit parenthesis in FROM and JOIN has to be supported.&lt;/p&gt;

&lt;p&gt;Support for SQL 2003 is not about magic parenthis work magically for use-case 2, it should just be possible to do: &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 FROM (Doctrine\Tests\Models\Company\CompanyPerson p, Doctrine\Tests\Models\Company\CompanyEmployee s)
JOIN p.spouse s2
WHERE p.spouse = s.id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15523" author="beberlei" created="Sun, 20 Mar 2011 05:43:59 +0000"  >&lt;p&gt;It is already possible to do 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 p FROM Doctrine\Tests\Models\Company\CompanyPerson p
JOIN p.spouse s2, Doctrine\Tests\Models\Company\CompanyEmployee s
WHERE p.spouse = s.id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15524" author="beberlei" created="Sun, 20 Mar 2011 06:48:19 +0000"  >&lt;p&gt;Just tested a bit, it is not even possible to do automatic parenthesis around inheritance hierachies as the aliases go out of scope for the WHERE clause, in PostgreSQL there are other scoping errors with your patch. This all has to be explicit, which makes a fix for this more complicated.&lt;/p&gt;</comment>
                    <comment id="15525" author="beberlei" created="Sun, 20 Mar 2011 06:50:56 +0000"  >&lt;p&gt;Wrapped SQL Codes new, very annoying that they dont overflow (Jira annoyances)&lt;/p&gt;</comment>
                    <comment id="15526" author="beberlei" created="Sun, 20 Mar 2011 06:58:02 +0000"  >&lt;p&gt;Changed back to critical, this is not a blocker, you can always use Native SQL to get around limitations of DQL. Its not pretty, but its not a blocker to usage, given that you can rearrange the FROM and JOIN clauses one of your issues should be solved by existing code, only the inheritance persists (not sure if that not goes away also).&lt;/p&gt;
</comment>
                    <comment id="15536" author="dalvarez" created="Sun, 20 Mar 2011 11:16:55 +0000"  >&lt;p&gt;Thanks for taking care.&lt;/p&gt;

&lt;p&gt;This way you should never have to deal with blockers, just by providing a way to directly use PDO, which you always should be able to use directly anyway. &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;

&lt;p&gt;My query is quite complex because I had to replicate certain sections to compensate for the lack of support for CASE expressions. So it would be a pain to translate it to SQL, not even talking of maintaining it. But yes, technically nothing is really a blocker, though it is fair to say that workarounds can be impractical.&lt;/p&gt;

&lt;p&gt;I will have a try at the solution you proposed in your comment from 20/Mar/11 05:43 AM. The basic parantheses problem is solved by the local SQLWalker patch. But it does not cover the inheritance join, which gets generated right amid the regular FROM-clause entries, instead of at the end with the other JOIN expressions, thus generating broken SQL.&lt;br/&gt;
So a sustainable fix would have to fix the inheritance join problem. My guess is it would help to handle the JOIN expression of the inheritance join the same way as other JOIN expressions, and render the statements for both after the regular FROM-clause entries.&lt;/p&gt;</comment>
                    <comment id="15539" author="beberlei" created="Sun, 20 Mar 2011 11:41:10 +0000"  >&lt;p&gt;The complexity of this query does not stem from the select clause, but from the query and matching logic. That is not much more complicated in plain sql than in DQL. The complexity of using NativeSQL over DQL is imho complex fetch join or inheritance scenarios.&lt;/p&gt;

&lt;p&gt;I consider something a blocker only if its a bug that has no temporary workaround.&lt;/p&gt;

&lt;p&gt;Your SQL Walker patch breaks the testsuite (not the sql generation queries, but real functional tests), so i cannot apply it.&lt;/p&gt;

&lt;p&gt;Inheritance i think cannot just be put to the end of all from clauses, i&apos;d rather have explicit mechanisms such 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;FROM (InheritedEntity) a
FROM (InheritedEntity a JOIN a.related b)
FROM (InheritedEntity a, OtherEntity b) JOIN a.related c
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I also have to check how JPQL or HQL solves this issue.&lt;/p&gt;</comment>
                    <comment id="15545" author="dalvarez" created="Sun, 20 Mar 2011 16:15:39 +0000"  >&lt;p&gt;Hey, you have not seen the query yet... &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;

&lt;p&gt;But yes, I agree it would be possible, though annoying, to write any query in plain-SQL.&lt;/p&gt;

&lt;p&gt;The &quot;patch&quot; is just a prototype, to illustrate the issue. For me it works. It could be, of course, that it breaks some other feature my application does not use.&lt;/p&gt;


&lt;p&gt;As for the inheritance joins, I do not yet understand why they should be handled differently than any other joins. The RDBMS should be agnostic to the reason a join is done, it just knows the basic mechanism, which should be the same.&lt;/p&gt;</comment>
                    <comment id="15565" author="dalvarez" created="Mon, 21 Mar 2011 17:17:49 +0000"  >&lt;p&gt;Changed affected Version to 2.0.2. Actually, 2.0.3 is affected too, but I cannot select it.&lt;/p&gt;</comment>
                    <comment id="15566" author="dalvarez" created="Mon, 21 Mar 2011 17:27:48 +0000"  >&lt;p&gt;Same SQLWalker first-shot concept patch, now based on Version 2.0.3&lt;/p&gt;</comment>
                    <comment id="15567" author="dalvarez" created="Mon, 21 Mar 2011 17:36:28 +0000"  >&lt;p&gt;Ben,&lt;/p&gt;

&lt;p&gt;is it possible to just generate the code for the inheritance joins at the end of the FROM clause?&lt;/p&gt;

&lt;p&gt;Combined with always adding parantheses around the list of regular FROM clause entries, I believe, this could very well solve the problem. And it could turn out to be just a little manageable change.&lt;br/&gt;
There would not be any need for explicitly adding parantheses then, from a user-programmer perspective.&lt;/p&gt;</comment>
                    <comment id="15570" author="dalvarez" created="Tue, 22 Mar 2011 09:00:20 +0000"  >&lt;p&gt;I uploaded a new SQLWalker.&lt;/p&gt;

&lt;p&gt;This is a first shot at handling inheritance joins just like regular joins (generating an expression after the non-join table references, rather than between them). On MySQL 5.0, the patched code seems to generate valid SQL for all the use cases of my application.&lt;/p&gt;

&lt;p&gt;Could you please run the unit tests against it, to see if the changes break anything?&lt;/p&gt;</comment>
                    <comment id="15575" author="dalvarez" created="Thu, 24 Mar 2011 06:38:56 +0000"  >&lt;p&gt;I just gave the patched SQLWalker a try on PostgreSQL 8.4, and it did not work. PostgreSQL would complain about syntax errors, as the parantheses are not expected. I will see later this day if PostgreSQL requires the additional parantheses at all. Maybe on PostgreSQL the queries work fine without the parantheses in the first place. Given that PostgreSQL complains about syntax errors when provided with the additional parantheses, this is to be expected, but I will let you know as soon as I know for sure.&lt;/p&gt;</comment>
                    <comment id="15603" author="dalvarez" created="Mon, 28 Mar 2011 06:50:17 +0000"  >&lt;p&gt;Sorry for the late update. I had to fix a RDBMS-dependent UTF-8 issue in my application before being able to fully test the relevant queries with PostgreSQL&lt;/p&gt;

&lt;p&gt;Now that I did, PostgreSQL seems to have the same problem like MySQL Server.&lt;/p&gt;

&lt;p&gt;Take this DQL query 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;SELECT vendorListXMLRow
  FROM \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\vendorListXML\VendorListXMLRow vendorListXMLRow,
       \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\parameterListXML\ParameterListXMLRow parameterListXMLRow
  JOIN vendorListXMLRow.vendorListXML vendorListXML
  JOIN vendorListXML.inputComponentDataVersion vendorListXMLInputComponentDataVersion
  JOIN parameterListXMLRow.parameterListXML parameterListXML
  JOIN parameterListXML.inputComponentDataVersion parameterListXMLInputComponentDataVersion
  WHERE :dataVersion MEMBER OF vendorListXMLInputComponentDataVersion.dataVersions
    AND vendorListXMLRow.ID = parameterListXMLRow.WERT
    AND :dataVersion MEMBER OF parameterListXMLInputComponentDataVersion.dataVersions
    AND parameterListXMLRow.ID = :parameterID
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On PostgreSQL 8.4.7, it will get compiled down to:&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 v0_.ID AS ID0, v0_.DEBITORENSAMMELKONTENLISTEN_DATEINAME AS DEBITORENSAMMELKONTENLISTEN_DATEINAME1,
       v0_.RECHNUNGSKONFIGURATIONS_DATEINAME_INLAND AS RECHNUNGSKONFIGURATIONS_DATEINAME_INLAND2,
       v0_.RECHNUNGSKONFIGURATIONS_DATEINAME_AUSLAND AS RECHNUNGSKONFIGURATIONS_DATEINAME_AUSLAND3,
       v0_.dbID AS dbID4,
       v0_.vendorListXML_dbID AS vendorListXML_dbID5
  FROM VendorListXMLRow v0_, ParameterListXMLRow p1_
 INNER JOIN VendorListXML v2_ ON v0_.vendorListXML_dbID = v2_.dbID
  LEFT JOIN VersionedDataObject v3_ ON v2_.dbID = v3_.dbID
 INNER JOIN InputComponentDataVersion i4_ ON v3_.inputComponentDataVersion_dbID = i4_.dbID
 INNER JOIN ParameterListXML p5_ ON p1_.parameterListXML_dbID = p5_.dbID
  LEFT JOIN VersionedDataObject v6_ ON p5_.dbID = v6_.dbID
 INNER JOIN InputComponentDataVersion i7_ ON v6_.inputComponentDataVersion_dbID = i7_.dbID
 WHERE EXISTS (SELECT 1 FROM DataVersion_inputComponentDataVersions d8_ 
                INNER JOIN DataVersion d9_ ON d8_.inputComponentDataVersion_dbID = d9_.dbID
                WHERE d8_.dataVersion_dbID = i4_.dbID
                  AND d9_.dbID = $1)
   AND v0_.ID = p1_.WERT
   AND EXISTS (SELECT 1 FROM DataVersion_inputComponentDataVersions d8_
                INNER JOIN DataVersion d9_ ON d8_.inputComponentDataVersion_dbID = d9_.dbID
                WHERE d8_.dataVersion_dbID = i7_.dbID
                  AND d9_.dbID = $2)
   AND p1_.ID = $3 LIMIT 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;... which will not work, because v0 can not be referenced by the first JOIN expression.&lt;/p&gt;

&lt;p&gt;Here is the 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;2011-03-28 12:17:03 CEST ERROR:  invalid reference to FROM-clause entry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; table &lt;span class=&quot;code-quote&quot;&gt;&quot;v0_&quot;&lt;/span&gt; at character 440
2011-03-28 12:17:03 CEST HINT:  There is an entry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; table &lt;span class=&quot;code-quote&quot;&gt;&quot;v0_&quot;&lt;/span&gt;, but it cannot be referenced from &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; part of the query.
2011-03-28 12:17:03 CEST STATEMENT: [same as above]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Adding parantheses around the non-join FROM clause argument-list entries the way it worked for MySQL 5.0 will not work here. PostgreSQL will complain about a syntax 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;ERROR:  syntax error at or near &lt;span class=&quot;code-quote&quot;&gt;&quot;, &quot;&lt;/span&gt; LINE 6:    FROM (VendorListXMLRow v0_, ParameterListXMLRow p1_)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So the bottom line is that the problem does exist on PostgreSQL as well, but the quick fix that apparently worked for MySQL 5.0 will not work here.&lt;/p&gt;</comment>
                    <comment id="15604" author="dalvarez" created="Mon, 28 Mar 2011 07:20:13 +0000"  >&lt;p&gt;Note that PostgreSQL claims very specific compliance with the relevant packages of the SQL 2008 standard, while the MySQL documentation is, as usual, broadly inaccurate and amateurish about that topic. It does not matter here, if version 5.0 or 5.1 of MySQL is concerned.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.postgresql.org/docs/8.4/static/features.html&quot; class=&quot;external-link&quot;&gt;http://www.postgresql.org/docs/8.4/static/features.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/standards.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/standards.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When in doubt, I would suggest to simply aim for SQL 2008 compliance (as later versions of the standard supersede the older ones), so as to not risk optimizing for MySQL peculiarities rather than for general compatibility. This should make it possible to define a single level of compliance, independent of the specific RDBMS.&lt;/p&gt;</comment>
                    <comment id="15605" author="dalvarez" created="Mon, 28 Mar 2011 07:24:04 +0000"  >&lt;p&gt;Removed long PostgreSQL log line...&lt;/p&gt;</comment>
                    <comment id="15653" author="dalvarez" created="Sat, 2 Apr 2011 14:44:49 +0000"  >&lt;p&gt;Are you still with me?&lt;/p&gt;</comment>
                    <comment id="15654" author="beberlei" created="Sat, 2 Apr 2011 15:09:35 +0000"  >&lt;p&gt;I am just super busy right now. Doing my best..&lt;/p&gt;</comment>
                    <comment id="15656" author="dalvarez" created="Sun, 3 Apr 2011 08:51:22 +0000"  >&lt;p&gt;OK!&lt;/p&gt;</comment>
                    <comment id="15670" author="beberlei" created="Sun, 3 Apr 2011 16:02:22 +0000"  >&lt;p&gt;Hm, just tried a little bit. What about:&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/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php
index a14987e..0fb3e80 100644
--- a/lib/Doctrine/ORM/Query/SqlWalker.php
+++ b/lib/Doctrine/ORM/Query/SqlWalker.php
@@ -621,11 +621,15 @@ class SqlWalker &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; TreeWalker
             $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_rootAliases[] = $dqlAlias;
 
             $class = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($rangeDecl-&amp;gt;abstractSchemaName);
+            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($class-&amp;gt;isInheritanceTypeJoined()) {
+                $sql .= &apos;(&apos;;
+            }
+
             $sql .= $class-&amp;gt;getQuotedTableName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_platform) . &apos; &apos;
                   . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getSQLTableAlias($class-&amp;gt;table[&apos;name&apos;], $dqlAlias);
 
             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($class-&amp;gt;isInheritanceTypeJoined()) {
-                $sql .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateClassTableInheritanceJoins($class, $dqlAlias);
+                $sql .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateClassTableInheritanceJoins($class, $dqlAlias).&apos;)&apos;;
             }
 
             foreach ($identificationVariableDecl-&amp;gt;joinVariableDeclarations as $joinVarDecl) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15671" author="beberlei" created="Sun, 3 Apr 2011 16:25:57 +0000"  >&lt;p&gt;I think this query will work for you without any changes to the SQLWalker:&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 vendorListXMLRow
FROM
    \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\vendorListXML\VendorListXMLRow vendorListXMLRow
        JOIN vendorListXMLRow.vendorListXML vendorListXML
        JOIN vendorListXML.inputComponentDataVersion vendorListXMLInputComponentDataVersion,
    \persistentData\model\&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;\parameterListXML\ParameterListXMLRow parameterListXMLRow
        JOIN parameterListXMLRow.parameterListXML parameterListXML
        JOIN parameterListXML.inputComponentDataVersion parameterListXMLInputComponentDataVersion
WHERE :dataVersion MEMBER OF vendorListXMLInputComponentDataVersion.dataVersions
 AND vendorListXMLRow.ID = parameterListXMLRow.WERT
 AND :dataVersion MEMBER OF parameterListXMLInputComponentDataVersion.dataVersions
 AND parameterListXMLRow.ID = :parameterID
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15675" author="dalvarez" created="Mon, 4 Apr 2011 05:34:18 +0000"  >&lt;p&gt;Hey thanks, I&apos;ll try doing it that way.&lt;/p&gt;

&lt;p&gt;Right now everything works fine with the local patch, at least on MySQL 5.0.&lt;/p&gt;

&lt;p&gt;As for PostgreSQL, I will give it a run in a spare minute and let you know.&lt;/p&gt;</comment>
                    <comment id="16248" author="beberlei" created="Sun, 31 Jul 2011 10:14:34 +0000"  >&lt;p&gt;Any feedback on this issue?&lt;/p&gt;</comment>
                    <comment id="16256" author="dalvarez" created="Mon, 1 Aug 2011 02:42:56 +0000"  >&lt;p&gt;I have not yet managed to change and test the queries of the application, because it is a major change affecting lots of complex queries that span literally several dozen pages each (we had to emulate the unsupported CASE statements with conditional logic and joins, which multiplied the lines of code in many queries).&lt;br/&gt;
I have postponed changing the queries until next week, when I will upgrade the application to Doctrine 2.1 after finishing some due tasks. Afterwards I will run the application code with changed queries according to the pattern described in your comment above, and let you know. I will give it a try on PostgreSQL then, too. Last time I checked, my local patch did not work on PostgreSQL. I hope the rewritten queries will.&lt;/p&gt;</comment>
                    <comment id="16283" author="beberlei" created="Sat, 6 Aug 2011 18:44:27 +0000"  >&lt;p&gt;I think your local patch is not necessary, you have to order the from and join clauses correctly (as required when writing SQL itself). This problem is &quot;handled&quot; by DQL by delegating the error handling to the SQL level as we don&apos;t evaluate semantical errors of SQL in DQL.&lt;/p&gt;</comment>
                    <comment id="16291" author="dalvarez" created="Sun, 7 Aug 2011 11:56:18 +0000"  >&lt;p&gt;Sure, with the latest version it could work that way. I&apos;ll try, as I said.&lt;/p&gt;

&lt;p&gt;The local SQLWalker patch was just a temporary measure. I hope it will become unnecessary after rewriting the queries the way you proposed.&lt;/p&gt;</comment>
                    <comment id="16496" author="dalvarez" created="Mon, 19 Sep 2011 16:08:13 +0000"  >&lt;p&gt;Sorry for the delay. I am now upgrading to Doctrine 2.1 and rewriting the application&apos;s queries according to the way you explained. I will let you know about results within the next couple of days, after performing test runs based on the reworked queries.&lt;/p&gt;</comment>
                    <comment id="16498" author="dalvarez" created="Thu, 22 Sep 2011 14:23:15 +0000"  >&lt;p&gt;I rewrote all queries to match the basic form you showed in your comment from April, 3rd.&lt;/p&gt;

&lt;p&gt;Using the basic form&lt;/p&gt;

&lt;p&gt;SELECT x&lt;br/&gt;
FROM drivingTable1 alias1&lt;br/&gt;
JOIN alias1.otherTable1 alias2,&lt;br/&gt;
drivingTable 2 alias3&lt;br/&gt;
JOIN alias3.otherTable2 alias4&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;the queries now work on MySQL Server without any local modifications of Doctrine 2.&lt;/p&gt;

&lt;p&gt;I tested it with MySQL Server version 5.0.51a, and Doctrine version 2.1.1.&lt;/p&gt;

&lt;p&gt;So far everything seems to be good.&lt;/p&gt;

&lt;p&gt;I will try it on PostgreSQL, too, and let you know about that.&lt;/p&gt;</comment>
                    <comment id="16537" author="dalvarez" created="Thu, 29 Sep 2011 23:02:20 +0000"  >&lt;p&gt;I tried a complex sample query on PostgreSQL using the same join syntax, and it worked like a charm.&lt;/p&gt;

&lt;p&gt;I&apos;ll close the issue as fixed.&lt;/p&gt;

&lt;p&gt;Thanks a lot.&lt;/p&gt;</comment>
                    <comment id="16538" author="dalvarez" created="Thu, 29 Sep 2011 23:06:59 +0000"  >&lt;p&gt;Issue closed.&lt;/p&gt;

&lt;p&gt;I don&apos;t know about the DQL validation part, though. The fact that DQL can or could compile to something that is not valid SQL could be considered symptomatic of a bug by itself. Don&apos;t know about the state of that, maybe it&apos;s more robust by now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10957" name="SQLWalker for Doctrine 2.03, always generating join expressions at the end of the FROM clause.php" size="74878" author="dalvarez" created="Tue, 22 Mar 2011 09:00:20 +0000" />
                    <attachment id="10956" name="SQLWalker.php" size="74093" author="dalvarez" created="Mon, 21 Mar 2011 17:27:48 +0000" />
                    <attachment id="10955" name="SqlWalker.php" size="71847" author="dalvarez" created="Sat, 19 Mar 2011 09:54:12 +0000" />
                    <attachment id="10947" name="SqlWalker.php" size="71229" author="dalvarez" created="Sat, 26 Feb 2011 13:26:32 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1041] UnitOfWork tryGetById method is always called with the rootEntityName</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1041</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;My problem : i have a class table inheritance, with only 3 class, one abstract and two concrete.&lt;br/&gt;
says AbstractClass, ConcretClassA and ConcreteClassB&lt;br/&gt;
All three are declared with @entity&lt;/p&gt;

&lt;p&gt;if i already have in my identity map the ConcretClassA with id = 1&lt;br/&gt;
when i do an entityManager-&amp;gt;find(&apos;ConcreteClassB&apos;, 1) the identityMap returns me the ConcretClassA with id = 1&lt;br/&gt;
that&apos;s not correct !&lt;br/&gt;
it should return a null value instead&lt;/p&gt;

&lt;p&gt;That&apos;s because the entityRepository (and all the other doctrine class) call the UnitOfWork tryGetById with the rootEntityName, which in my case is AbstractClass.&lt;br/&gt;
See the first line of the entityRepository&apos;s find method :&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;getUnitOfWork()-&amp;gt;tryGetById($id, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;rootEntityName)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;if i change this line to :&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;getUnitOfWork()-&amp;gt;tryGetById($id, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;name)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the find method return the expected null value.&lt;/p&gt;

&lt;p&gt;So, why the UnitOfWork tryGetById method is always called with the rootEntityName ?&lt;/p&gt;</description>
                <environment>LAMP</environment>
            <key id="12418">DDC-1041</key>
            <summary>UnitOfWork tryGetById method is always called with the rootEntityName</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dreddy">Couragier S&#233;bastien</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Feb 2011 07:03:55 +0000</created>
                <updated>Fri, 4 Mar 2011 15:56:45 +0000</updated>
                    <resolved>Fri, 4 Mar 2011 15:56:45 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15376" author="beberlei" created="Fri, 25 Feb 2011 18:18:08 +0000"  >&lt;p&gt;The identity map HAS to work by root entity name.&lt;/p&gt;

&lt;p&gt;Otherwise think of an inheritance hierachy A &lt;del&gt;&amp;gt; B. Then both $em&lt;/del&gt;&amp;gt;find(&apos;A&apos;, 1); and $em-&amp;gt;find(&apos;B&apos;, 1); should return the same instance.&lt;/p&gt;

&lt;p&gt;If this does not hold you are screwed.&lt;/p&gt;

&lt;p&gt;Your problem is more subtle, i am not sure what the expected behavior should be here.&lt;/p&gt;</comment>
                    <comment id="15404" author="dreddy" created="Mon, 28 Feb 2011 03:51:08 +0000"  >&lt;p&gt;In my sense, the client code should exactly knows the inheritance hierachy, and exactly know what it wants too, so if it asks for an &apos;A&apos; instance, you can&apos;t return a &apos;B&apos; instance, although A inherit from B.&lt;/p&gt;</comment>
                    <comment id="15408" author="beberlei" created="Mon, 28 Feb 2011 05:32:34 +0000"  >&lt;p&gt;I agree with you except for the last sentence part. &lt;/p&gt;

&lt;p&gt;If A-&amp;gt;B and you query for B with Id 1 it should treturn an A if it exists. But if B-&amp;gt;C and A-&amp;gt;C then find(A) should only ever return As or Cs never, Bs.&lt;/p&gt;</comment>
                    <comment id="15411" author="dreddy" created="Mon, 28 Feb 2011 06:25:59 +0000"  >&lt;p&gt;I agree.&lt;br/&gt;
Perhaps my problem is more specific to the  class table inheritance strategy with an abstract class at the top of it.&lt;br/&gt;
Here&apos;s my identityMap&apos;s dump (with my first comment inheritance example) at the time the problem occurs :&lt;/p&gt;

&lt;p&gt;&apos;AbstractClass&apos; =&amp;gt;&lt;br/&gt;
    array&lt;br/&gt;
      1 =&amp;gt; string &apos;ConcretClassA&apos;&lt;br/&gt;
      2 =&amp;gt; string &apos;ConcretClassA&apos;&lt;br/&gt;
      3 =&amp;gt; string &apos;ConcretClassA&apos;&lt;br/&gt;
      367 =&amp;gt; string &apos;ConcretClassB&apos;&lt;br/&gt;
      368 =&amp;gt; string &apos;ConcretClassB&apos;&lt;br/&gt;
      369 =&amp;gt; string &apos;ConcretClassB&apos;&lt;/p&gt;

&lt;p&gt;And, at this time, in my code, i would like to know if the id 1 is a ConcretClassB. If the id 1 is a ConcretClassA, i must throw an exception.&lt;br/&gt;
So, how could i test if the id 1 is a ConcretClassB or not, if the find(&apos;ConcretClassB&apos;, 1) method returns me the ConcretClassA 1 ?&lt;/p&gt;

&lt;p&gt;thx for your help&lt;/p&gt;</comment>
                    <comment id="15412" author="beberlei" created="Mon, 28 Feb 2011 06:31:57 +0000"  >&lt;p&gt;Cant you just check instanceof?&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;$a = $em-&amp;gt;find(&apos;ConcretClassA&apos;, $aId);
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($a &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; ConcretClassB) {
   &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();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15413" author="dreddy" created="Mon, 28 Feb 2011 06:48:09 +0000"  >&lt;p&gt;Of course i can.&lt;br/&gt;
But i thought Doctrine should already have to do this check internally for us. Because we must now be very careful with the find method&apos;s returns...&lt;/p&gt;

&lt;p&gt;Nevermind, i don&apos;t have all the uses case Doctrine have to handle with inheritance in mind; so if you say it is to the client code to check, and it is a completely normal behavior, then it&apos;s okay for me.&lt;/p&gt;</comment>
                    <comment id="15416" author="beberlei" created="Mon, 28 Feb 2011 13:19:12 +0000"  >&lt;p&gt;i will change this behavior in the future, i am just making suggestions for you to fix it now. Using instanceof will also be forwards compatible since &quot;null instanceof Class&quot; is always false.&lt;/p&gt;

&lt;p&gt;In any case the level of having to be careful is the same, using null instead of an object can get you into troubles aswell.&lt;/p&gt;</comment>
                    <comment id="15437" author="dreddy" created="Thu, 3 Mar 2011 12:08:51 +0000"  >&lt;p&gt;Perhaps throw a \Doctrine\ORM\EntityNotFoundException would be a better option than return a null value ?&lt;/p&gt;</comment>
                    <comment id="15450" author="beberlei" created="Fri, 4 Mar 2011 15:56:45 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1033] Cloned proxies show unexpected behavior when initialized</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1033</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When a proxy has been loaded and is cloned before being initialized, it will behave unexpectedly.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;_load()&lt;/tt&gt; in the proxy starts a chain of method calls that end up loading the data and putting it into the proxy being in the identity map inside UoW. Now the registered proxy will be updated, but the cloned copy will of course not be changed - except it will behave as if it was initialized. This leads (at least in my case) to changes not being picked up after &lt;tt&gt;merge()&lt;/tt&gt; has been called.&lt;/p&gt;

&lt;p&gt;In my case I could work around this if I could ask the proxy to initialize itself (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-733&quot; title=&quot;Implement a way of forcing a PersistentCollection to initialize itself&quot;&gt;&lt;del&gt;DDC-733&lt;/del&gt;&lt;/a&gt;). More transparent would be a &lt;tt&gt;__clone()&lt;/tt&gt; method in the proxy that initializes the proxy. This might also be related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-18&quot; title=&quot;Track proxy objects in the identity map?&quot;&gt;&lt;del&gt;DDC-18&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12387">DDC-1033</key>
            <summary>Cloned proxies show unexpected behavior when initialized</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="k-fish">Karsten Dambekalns</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Feb 2011 11:18:00 +0000</created>
                <updated>Sat, 26 Feb 2011 06:50:17 +0000</updated>
                    <resolved>Sat, 26 Feb 2011 06:50:17 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15339" author="beberlei" created="Fri, 18 Feb 2011 16:12:13 +0000"  >&lt;p&gt;This issue is rather tricky, since __clone is called AFTER the actual clone, on the CLONED object. What we need is before the clone on the original object. This is pretty problematic to solve, i have to wrap my head around it.&lt;/p&gt;</comment>
                    <comment id="15384" author="beberlei" created="Sat, 26 Feb 2011 06:50:17 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1026] Doctrine Cache</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1026</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I find a problem with doctrine cache key.&lt;/p&gt;

&lt;p&gt;It use a namespace and key to save the value and never use the namespace to get it.&lt;/p&gt;

&lt;p&gt;I checked that on AbstractQuery::getResultCacheId().&lt;/p&gt;

&lt;p&gt;AbstractCache::save &lt;del&gt;&amp;gt; use $this&lt;/del&gt;&amp;gt;_getNamespacedId($id)&lt;/p&gt;</description>
                <environment></environment>
            <key id="12371">DDC-1026</key>
            <summary>Doctrine Cache</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="garfield-fr">Bertrand Zuchuat</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Feb 2011 10:14:51 +0000</created>
                <updated>Fri, 25 Feb 2011 18:42:01 +0000</updated>
                    <resolved>Fri, 25 Feb 2011 18:42:01 +0000</resolved>
                            <version>2.0.1</version>
                <version>2.0.2</version>
                                <fixVersion>2.0.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15278" author="beberlei" created="Sat, 12 Feb 2011 11:01:37 +0000"  >&lt;p&gt;AbstractQuery::getResultCacheId() does not append the namespace. The Cache functions fetch() and contains() do.&lt;/p&gt;</comment>
                    <comment id="15367" author="awoods" created="Thu, 24 Feb 2011 11:29:25 +0000"  >&lt;p&gt;Actually, I think ALL result caching may be broken since the fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-892&quot; title=&quot;Caches can potentially return false positives due to use of MD5 hash codes as keys. A classic.&quot;&gt;&lt;del&gt;DDC-892&lt;/del&gt;&lt;/a&gt; landed. The code is expecting to fetch an array from the cache with an element in it thats key is $id. Presumably, this is to cater for cases where the hash clashes for different ids. However, the query result is not being inserted into the cache in this format!&lt;/p&gt;

&lt;p&gt;This patch should fix the issue.&lt;/p&gt;

&lt;p&gt;There&apos;s still a less serious issue - and that&apos;s that if there are two ids with clashing hashes that are being called repeatedly in quick succession, they&apos;re going to keep displacing each other from the cache. An alternative patch could bundle both ids them into the same cache entry:&lt;/p&gt;

&lt;p&gt;if ($cached === false)&lt;br/&gt;
    $cached = array();&lt;br/&gt;
$cached&lt;span class=&quot;error&quot;&gt;&amp;#91;$id&amp;#93;&lt;/span&gt; = $result;&lt;br/&gt;
$cacheDriver-&amp;gt;save($id, $cached, $this-&amp;gt;_resultCacheTTL);&lt;/p&gt;

&lt;p&gt;However, I think displacing is better than running the risk of having a TTL that is too long be applied as the result of a clash!&lt;/p&gt;

&lt;p&gt;EDIT: I&apos;m also wondering why $hash isn&apos;t used as the cache key. It looks like the intention was that it should be, but it isn&apos;t..&lt;/p&gt;</comment>
                    <comment id="15377" author="beberlei" created="Fri, 25 Feb 2011 18:42:01 +0000"  >&lt;p&gt;Fixed, the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-892&quot; title=&quot;Caches can potentially return false positives due to use of MD5 hash codes as keys. A classic.&quot;&gt;&lt;del&gt;DDC-892&lt;/del&gt;&lt;/a&gt; patch was pretty borked. This does now work&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10939" name="AbstractQuery.php.patch" size="464" author="garfield-fr" created="Sun, 13 Feb 2011 16:21:23 +0000" />
                    <attachment id="10938" name="apctest.tgz" size="15819" author="garfield-fr" created="Sun, 13 Feb 2011 07:42:30 +0000" />
                    <attachment id="10944" name="yay-caching-works-again.patch" size="564" author="awoods" created="Thu, 24 Feb 2011 11:29:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-982] Make SQLWalker::getSQLTableAlias() more unique with dql aliases</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-982</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;getSqlTableAlias: $tableName .= $dqlAlias;&lt;/p&gt;

&lt;p&gt;say there is a guy who has two tables &quot;user&quot; and &quot;users&quot; and he does SELECT * FROM User s&lt;/p&gt;</description>
                <environment></environment>
            <key id="12297">DDC-982</key>
            <summary>Make SQLWalker::getSQLTableAlias() more unique with dql aliases</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 Jan 2011 14:53:36 +0000</created>
                <updated>Sun, 20 Feb 2011 03:00:48 +0000</updated>
                    <resolved>Sun, 20 Feb 2011 03:00:48 +0000</resolved>
                            <version>2.0</version>
                <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15346" author="guilhermeblanco" created="Sat, 19 Feb 2011 23:32:37 +0000"  >&lt;p&gt;Fixed in trunk&lt;/p&gt;</comment>
                    <comment id="15349" author="beberlei" created="Sun, 20 Feb 2011 03:00:32 +0000"  >&lt;p&gt;Reopened, because i cant change variables in a closed vs a resolved ticket anymore.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-978] Many-To-Many relations are removed after Flush()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-978</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Let&apos;s say we have three entities: User, Channel, and Log&lt;/p&gt;

&lt;p&gt;Every time a User is created or updated, Channels are assigned to a Many-To-Many collection.&lt;br/&gt;
This action gets logged in the Log entity.&lt;/p&gt;

&lt;p&gt;I have reproduced the bug in the Doctrine sandbox (see attachment). It&apos;s a fully working example.&lt;br/&gt;
This is a summary:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This works&lt;/b&gt;&lt;/div&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;// Fetch two channels in an array
&lt;/span&gt;$channels = .......

&lt;span class=&quot;code-comment&quot;&gt;// create a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; user and assign channels
&lt;/span&gt;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;FooBar&apos;);
$user-&amp;gt;setChannels($channels);

&lt;span class=&quot;code-comment&quot;&gt;//save the user
&lt;/span&gt;$em-&amp;gt;persist($user);
$em-&amp;gt;flush();

&lt;span class=&quot;code-comment&quot;&gt;// log it
&lt;/span&gt;$log = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Log();
$log-&amp;gt;setMessage(&apos;User created with two channels&apos;);
$log-&amp;gt;setItem($user);

$em-&amp;gt;persist($log);
$em-&amp;gt;flush();
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This also works&lt;/b&gt;&lt;/div&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;// Fetch two channels in an array
&lt;/span&gt;$channels = .......

&lt;span class=&quot;code-comment&quot;&gt;// fetch an existing user, *change something to the user*, and assign channels
&lt;/span&gt;$user = .............
$user-&amp;gt;setName(&apos;Gaz&apos;);
$user-&amp;gt;setChannels($channels);

&lt;span class=&quot;code-comment&quot;&gt;//save the user
&lt;/span&gt;$em-&amp;gt;persist($user);
$em-&amp;gt;flush();

&lt;span class=&quot;code-comment&quot;&gt;// log it
&lt;/span&gt;$log = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Log();
$log-&amp;gt;setMessage(&apos;User created with two channels&apos;);
$log-&amp;gt;setItem($user);

$em-&amp;gt;persist($log);
$em-&amp;gt;flush();
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This does not work (channels are removed)&lt;/b&gt;&lt;/div&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;// Fetch two channels in an array
&lt;/span&gt;$channels = .......

&lt;span class=&quot;code-comment&quot;&gt;// fetch an existing user and only assign channels, change nothing &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
&lt;/span&gt;$user = .............
$user-&amp;gt;setChannels($channels);

&lt;span class=&quot;code-comment&quot;&gt;//save the user
&lt;/span&gt;$em-&amp;gt;persist($user);
$em-&amp;gt;flush();

&lt;span class=&quot;code-comment&quot;&gt;// log it
&lt;/span&gt;$log = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Log();
$log-&amp;gt;setMessage(&apos;User created with two channels&apos;);
$log-&amp;gt;setItem($user);

$em-&amp;gt;persist($log);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This last piece of code generates following SQL code (summarized): &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;DELETE FROM user_channels WHERE userId = 1
INSERT INTO user_channels (userId, channelId) VALUES (1, 2);
DELETE FROM user_channels WHERE userId = 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you remove the &lt;em&gt;$em-&amp;gt;flush()&lt;/em&gt; after &lt;em&gt;$em-&amp;gt;persist($user);&lt;/em&gt; in the last example, the code works (channels are persisted).&lt;/p&gt;

&lt;p&gt;I did not have this problem with Doctrine2 Alpha4.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12292">DDC-978</key>
            <summary>Many-To-Many relations are removed after Flush()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="slasher">Thomas G.</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Jan 2011 03:57:21 +0000</created>
                <updated>Sun, 23 Jan 2011 09:41:26 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 09:41:26 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15126" author="beberlei" created="Wed, 12 Jan 2011 04:53:25 +0000"  >&lt;p&gt;What do you do in &quot;setChannels&quot;? Do you completly overwrite the previous content of the association variable &quot;User::$channels&quot; ?&lt;/p&gt;</comment>
                    <comment id="15127" author="slasher" created="Wed, 12 Jan 2011 05:00:39 +0000"  >&lt;p&gt;I have reproduced the bug in a fully working example. See attachment. Just read instructions in comment and execute each step seperately.&lt;/p&gt;

&lt;p&gt;But yes, I overwrite the previous content of the association variable &quot;User::$channels&quot; with a Doctrine ArrayCollection.
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;User Entity&lt;/b&gt;&lt;/div&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
{
    /**
     * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @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;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=50) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;

    /**
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Channel&quot;&lt;/span&gt;)
     * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users_channels&quot;&lt;/span&gt;,
     *          joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;userId&quot;&lt;/span&gt;,
                referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)},
     *          inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;channelId&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;var&lt;/span&gt; ArrayCollection
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $channels;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct(){
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;channels = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
    }

    &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 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;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setName($name)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $name;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getChannels() {
        &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;channels;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setChannels($channels) {
        $channels =  &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection($channels);
       
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;channels = $channels;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15166" author="beberlei" created="Sun, 23 Jan 2011 09:41:26 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12298">DDC-983</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10907" name="sandbox.rar" size="622254" author="slasher" created="Wed, 12 Jan 2011 03:57:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-973] Undefined indexes of $tableColumn in MySqlSchemaManager.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-973</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I wanna setup my Doctrine system by running the following PHP code:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;require_once &apos;config.inc.php&apos;;&lt;br/&gt;
$schemaTool = new \Doctrine\ORM\Tools\SchemaTool($em);&lt;/p&gt;

&lt;p&gt;$metadata = $em-&amp;gt;getMetadataFactory()-&amp;gt;getAllMetadata();&lt;/p&gt;

&lt;p&gt;$schemaTool-&amp;gt;updateSchema($metadata);&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;But I get the following error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Notice: Undefined index: type in XXX/Doctrine/DBAL/Schema/MySqlSchemaManager.php on line 90&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine\DBAL\DBALException&apos; with message &apos;Unknown database type requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.&apos; in XXX/Doctrine/DBAL/Platforms/AbstractPlatform.php:192 Stack trace: #0 XXX/Doctrine/DBAL/Schema/MySqlSchemaManager.php(109): Doctrine\DBAL\Platforms\AbstractPlatform-&amp;gt;getDoctrineTypeMapping(false) #1 XXX/Doctrine/DBAL/Schema/AbstractSchemaManager.php(624): Doctrine\DBAL\Schema\MySqlSchemaManager-&amp;gt;_getPortableTableColumnDefinition(Array) #2 XXX/Doctrine/DBAL/Schema/AbstractSchemaManager.php(152): Doctrine\DBAL\Schema\AbstractSchemaManager-&amp;gt;_getPortableTableColumnList(Array) #3 XXX/Doctrine/DBAL/Schema/AbstractSchemaManager.php(222): Doctrine\DBAL\Schem in XXX/Doctrine/DBAL/Platforms/AbstractPlatform.php on line 192&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;I edited MySqlSchemaManager.php by adding print_r($tableColumn); just behind line 90, so the code looks like:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;        $tableColumn = array_change_key_case($tableColumn, CASE_LOWER);&lt;/p&gt;

&lt;p&gt;        $dbType = strtolower($tableColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
print_r($tableColumn);        &lt;br/&gt;
        $dbType = strtok($dbType, &apos;(), &apos;);&lt;/p&gt;&lt;/blockquote&gt; 
&lt;p&gt;and PHP returns the values of the array correctly:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Array&lt;br/&gt;
(&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;field&amp;#93;&lt;/span&gt; = ar_namespace&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;type&amp;#93;&lt;/span&gt; = int(11)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;null&amp;#93;&lt;/span&gt; = NO&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;key&amp;#93;&lt;/span&gt; = MUL&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;default&amp;#93;&lt;/span&gt; = 0&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;extra&amp;#93;&lt;/span&gt; =&lt;/p&gt;

&lt;p&gt;)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I also tried echo $tableColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt;; without success (result is an additional &quot;Notice: Undefined index: type&quot;)&lt;/p&gt;</description>
                <environment>PHP Version 6.0.0-dev&lt;br/&gt;
System 	Linux infong 2.4 #1 SMP Wed Nov 4 21:12:12 UTC 2009 i686 GNU/Linux&lt;br/&gt;
Build Date 	Mar 12 2010 17:51:30&lt;br/&gt;
&lt;br/&gt;
MySQL version 	5.0.91-log</environment>
            <key id="12287">DDC-973</key>
            <summary>Undefined indexes of $tableColumn in MySqlSchemaManager.php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="michaelspiller">Michael Spiller</reporter>
                        <labels>
                    </labels>
                <created>Sun, 9 Jan 2011 10:14:18 +0000</created>
                <updated>Sun, 31 Jul 2011 10:07:42 +0000</updated>
                    <resolved>Sun, 31 Jul 2011 10:07:42 +0000</resolved>
                            <version>2.0</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15161" author="beberlei" created="Sun, 23 Jan 2011 05:27:32 +0000"  >&lt;p&gt;Can you verify the same fails on PHP 5.3.*? This seems very weird having the key in $tableColumn print_r and direct access failing. I can&apos;t explain it.&lt;/p&gt;

&lt;p&gt;Why are you using php 6-dev anyways? It has been squased and deleted several months ago already.&lt;/p&gt;</comment>
                    <comment id="16246" author="beberlei" created="Sun, 31 Jul 2011 10:07:42 +0000"  >&lt;p&gt;No feedback was given on this issue, closing.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-963] @OneToOne inverse side executes queries even if object is in IdentityMap</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-963</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12269">DDC-963</key>
            <summary>@OneToOne inverse side executes queries even if object is in IdentityMap</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12257">DDC-952</parent>
                        <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 31 Dec 2010 04:35:33 +0000</created>
                <updated>Wed, 16 Mar 2011 18:34:28 +0000</updated>
                    <resolved>Wed, 16 Mar 2011 18:34:28 +0000</resolved>
                            <version>2.0</version>
                <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15503" author="beberlei" created="Wed, 16 Mar 2011 18:34:28 +0000"  >&lt;p&gt;Merged&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-942] Query getSingleResult throws inappropiate exceptions.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-942</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently when using the Query object or QueryBuilder there is no easy way to get the first found result with doing a lot of work. The method that seems to be for this purpose is getSingleResult but it throws an exception if no records are found and if there is more than one record found another Exception is thrown. This behavior is different than the ODM\MongoDB where null is returned. &lt;/p&gt;</description>
                <environment></environment>
            <key id="12239">DDC-942</key>
            <summary>Query getSingleResult throws inappropiate exceptions.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="henrikbjorn">Henrik Bjornskov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Dec 2010 12:53:34 +0000</created>
                <updated>Tue, 18 Jan 2011 15:27:31 +0000</updated>
                    <resolved>Fri, 17 Dec 2010 15:19:17 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                <version>2.0-ALPHA3</version>
                <version>2.0-ALPHA4</version>
                <version>2.0-BETA1</version>
                <version>2.0-BETA2</version>
                <version>2.0-BETA3</version>
                <version>2.0-BETA4</version>
                <version>2.0-RC1</version>
                <version>2.0-RC2</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14978" author="romanb" created="Fri, 17 Dec 2010 15:19:16 +0000"  >&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;$items = $q-&amp;gt;getResult();
$item = $items[0]; &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; you&apos;re sure there is one...
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// php 5.4?
&lt;/span&gt;$item = $q-&amp;gt;getResult()[0];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The strict behavior of getSingleResult() is correct and desired. See the API documentation. It is for the cases where you know you want a single result and there is exactly a single result, and where everything else is an error. Getting the first object of a list of 0..* results is a different use-case and easily achieved as shown above.&lt;/p&gt;

&lt;p&gt;ps. I don&apos;t really care how it is in the ODM as this behavior has been specified in the ORM long before that. Returning null in that case is definitely not a good thing to do imho.&lt;/p&gt;</comment>
                    <comment id="15128" author="lsmith" created="Wed, 12 Jan 2011 14:24:38 +0000"  >&lt;p&gt;well .. there is also a use case for getting a single entity or null without an exception. note the key here is that i do not know that there will be a result and that my code doesnt explode if there is no result. as a result most of my repositories end up having a method for this purpose.&lt;/p&gt;

&lt;p&gt;    protected function getOneResult(\Doctrine\ORM\Query $query)&lt;/p&gt;
    {
        $result = $query-&amp;gt;getResult();
        return isset($result[0]) ? $result[0] : null;
    }</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
            <subtask id="12309">DDC-991</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-933] EntityManager#lock doesn&apos;t work with Class Table Inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-933</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It produces a notice &quot;E_NOTICE Undefined variable: idColumns Doctrine\ORM\Persisters\JoinedSubclassPersister.php : 366&quot; and results in an incorrect SQL&lt;/p&gt;</description>
                <environment></environment>
            <key id="12229">DDC-933</key>
            <summary>EntityManager#lock doesn&apos;t work with Class Table Inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="a.bogomazov">Alex Bogomazov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Dec 2010 11:49:14 +0000</created>
                <updated>Tue, 14 Dec 2010 17:27:11 +0000</updated>
                    <resolved>Tue, 14 Dec 2010 17:27:11 +0000</resolved>
                            <version>2.0-RC2</version>
                                <fixVersion>2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14966" author="beberlei" created="Tue, 14 Dec 2010 17:27:11 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-921] QueryBuilder: Defining a &quot;WHERE IN (...)&quot; constraint using QueryBuilder::expr()-&gt;in() doesn&apos;t allow parameter binding for array of values</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-921</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Following statement issues Doctrine\ORM\Query\QueryException:&lt;/p&gt;

&lt;p&gt;$qb = new Doctrine\ORM\QueryBuilder($em);&lt;br/&gt;
$qb&lt;br/&gt;
-&amp;gt;select(&apos;u&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;Entities\User&apos;, &apos;u&apos;)&lt;br/&gt;
&lt;del&gt;&amp;gt;where($qb&lt;/del&gt;&amp;gt;expr()-&amp;gt;in(&apos;u.name&apos;, array(&apos;?1&apos;, &apos;?2&apos;)))&lt;br/&gt;
-&amp;gt;setParameters(array(1 =&amp;gt; &apos;Hans&apos;, 2 =&amp;gt; &apos;Lieselotte&apos;))&lt;br/&gt;
&lt;del&gt;&amp;gt;getQuery()&lt;/del&gt;&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Query\QueryException: &quot;Invalid parameter number: number of bound variables does not match number of tokens.&quot;&lt;/p&gt;

&lt;p&gt;$qb-&amp;gt;getDql() will return &quot;SELECT u FROM Entities\User u WHERE u.name IN(&apos;?1&apos;, &apos;?2&apos;)&quot;&lt;br/&gt;
As you can see placeholder variables are quoted due to Doctrine\ORM\Query\Expr::in($x, $y) which expects $y to be an array of Expr\Literal instances. Otherwise it will quote given strings. I can&apos;t think that doing something like...&lt;/p&gt;

&lt;p&gt;$qb-&amp;gt;where($qb-&amp;gt;expr()-&amp;gt;in(&apos;u.name&apos;, array(new Expr\Literal(&apos;?1&apos;), new Expr\Literal(&apos;?2&apos;))))&lt;/p&gt;

&lt;p&gt;... is very convenient syntax. Is it?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12210">DDC-921</key>
            <summary>QueryBuilder: Defining a &quot;WHERE IN (...)&quot; constraint using QueryBuilder::expr()-&gt;in() doesn&apos;t allow parameter binding for array of values</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</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>Thu, 9 Dec 2010 10:00:49 +0000</created>
                <updated>Fri, 10 Dec 2010 19:07:27 +0000</updated>
                    <resolved>Fri, 10 Dec 2010 19:07:27 +0000</resolved>
                            <version>2.0-RC1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14950" author="beberlei" created="Fri, 10 Dec 2010 19:07:01 +0000"  >&lt;p&gt;You are supposed to put real values in there. There is currently no support for variable parameter lists in combination with IN. You would have to build these kind of queries using a helper function.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-918] Remove UnitOfWork-&gt;flush() in Query-&gt;doExecute()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-918</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should remove UnitOfWork-&amp;gt;flush() inside the Query class and document clearly the adverse effects that can happen.&lt;/p&gt;

&lt;p&gt;Its much better peformance wise this way around and people shouldn&apos;t get into trouble.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12207">DDC-918</key>
            <summary>Remove UnitOfWork-&gt;flush() in Query-&gt;doExecute()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2010 14:57:48 +0000</created>
                <updated>Fri, 10 Dec 2010 19:05:53 +0000</updated>
                    <resolved>Fri, 10 Dec 2010 19:05:53 +0000</resolved>
                                            <fixVersion>2.0-RC2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14949" author="beberlei" created="Fri, 10 Dec 2010 19:05:53 +0000"  >&lt;p&gt;Changed and noted in the new ReST branch of the docs that will go live before release.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-892] Caches can potentially return false positives due to use of MD5 hash codes as keys. A classic.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-892</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I was just checking the execution path for efficiency and bumped into this block of code in /Doctrine/ORM/AbstracQuery.php,&lt;br/&gt;
starting on line 560:&lt;/p&gt;

&lt;p&gt;    protected function _getResultCacheId()&lt;br/&gt;
    {&lt;br/&gt;
        if ($this-&amp;gt;_resultCacheId) &lt;/p&gt;
{
            return $this-&amp;gt;_resultCacheId;
        }
&lt;p&gt; else &lt;/p&gt;
{
            $sql = $this-&amp;gt;getSql();
            ksort($this-&amp;gt;_hints);
            return md5(implode(&quot;;&quot;, (array)$sql) . var_export($this-&amp;gt;_params, true) .
                var_export($this-&amp;gt;_hints, true).&quot;&amp;amp;hydrationMode=&quot;.$this-&amp;gt;_hydrationMode);
        }
&lt;p&gt;    }&lt;/p&gt;


&lt;p&gt;Of course, MD5 hashes can never be guaranteed to be unique, so this block of the doExecute-Method&lt;br/&gt;
starting on line 508 can return false positives and thus break the user&apos;s assumptions about the ORM&apos;s behavior:&lt;/p&gt;

&lt;p&gt;        // Check result cache&lt;br/&gt;
        if ($this-&amp;gt;_useResultCache &amp;amp;&amp;amp; $cacheDriver = $this-&amp;gt;getResultCacheDriver()) {&lt;br/&gt;
            $id = $this-&amp;gt;_getResultCacheId();&lt;br/&gt;
            $cached = $this-&amp;gt;_expireResultCache ? false : $cacheDriver-&amp;gt;fetch($id);&lt;/p&gt;

&lt;p&gt;            if ($cached === false) &lt;/p&gt;
{
                // Cache miss.
                $stmt = $this-&amp;gt;_doExecute();

                $result = $this-&amp;gt;_em-&amp;gt;getHydrator($this-&amp;gt;_hydrationMode)-&amp;gt;hydrateAll(
                        $stmt, $this-&amp;gt;_resultSetMapping, $this-&amp;gt;_hints
                        );

                $cacheDriver-&amp;gt;save($id, $result, $this-&amp;gt;_resultCacheTTL);

                return $result;
            }
&lt;p&gt; else &lt;/p&gt;
{
                // Cache hit.
                return $cached;
            }
&lt;p&gt;        }&lt;/p&gt;

&lt;p&gt;It is not likely to happen, but possible. Rely on it a couple of million times in a production system, and one day, eventually, it will fail&lt;br/&gt;
and hell will break loose.&lt;/p&gt;

&lt;p&gt;I think it is prohibitive to try to save memory by giving up correctness. If your program does not work, it&apos;s simply broken and there is no need to tune it unless you fix it functionally.&lt;/p&gt;

&lt;p&gt;The only safe solution would be to use a non-lossy hash (i. e. compression) method, if any. Plain query text would do fine too.&lt;/p&gt;

&lt;p&gt;Unless you expect the user to anticipate false positives, i. e.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12160">DDC-892</key>
            <summary>Caches can potentially return false positives due to use of MD5 hash codes as keys. A classic.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2010 14:00:10 +0000</created>
                <updated>Sun, 23 Jan 2011 14:55:26 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 14:55:26 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15018" author="dalvarez" created="Sat, 25 Dec 2010 13:27:38 +0000"  >&lt;p&gt;Has anyone taken note of this one?&lt;/p&gt;

&lt;p&gt;As it seems, this critical bug has been sitting here for a month, untouched, and apparently even made it into the final release.&lt;/p&gt;

&lt;p&gt;I would offer to fix it myself, but as the fix would consist in removing just one or two MD5 hash method calls, and it would probably have to be validated anyway by a core developer, there is actually not much technical effort I could save you.&lt;/p&gt;

&lt;p&gt;Just a reminder, thanks for your time.&lt;/p&gt;</comment>
                    <comment id="15019" author="beberlei" created="Mon, 27 Dec 2010 03:52:41 +0000"  >&lt;p&gt;The problem is rather that cache keys have a limited length depending on the cache driver.I know that Memcache limits at 255, have to look at the others.&lt;/p&gt;

&lt;p&gt;Plain Text is not a solution, but we could build a range of several md5 or sha1 hashes to reduce the risk of false/positives even more.&lt;/p&gt;</comment>
                    <comment id="15056" author="dalvarez" created="Wed, 29 Dec 2010 18:36:59 +0000"  >&lt;p&gt;Hey Ben,&lt;/p&gt;

&lt;p&gt;thanks for taking care.&lt;/p&gt;

&lt;p&gt;I see the point about the length limitation. Still, I believe is a bad thing to subject correctness to probability considerations. Merely making it more unlikely to happen would only procrastinate a definite solution. Staying with a solution that relies on hash values being unique, is gambling with the probability of software systems malfunctioning randomly for no apparent reason, which is not a desirable outcome.&lt;/p&gt;

&lt;p&gt;I figured out an alternate approach that IMO solves the length limit issue, while, to my knowledge, being correct. This is my first shot at it. But right now I do not see why this, or something like it, should not be feasible.&lt;/p&gt;

&lt;p&gt;You could keep on indexing by MD5 hash value (just to guarantee an upper bound on the key length and circumvent the limits regarding the maximum key length). I think MD5 does that part quite well. But instead of just storing the value, store a map, mapping all of the original full-length keys that resolve to that common MD5 hash value to their individual values. In almost all but a few very rare cases, this map will have exactly one entry. Therefore in almost all cases, all that is retrieved from the cache is the value, plus the original key, enclosed in a map wrapper object. Needless to say, this map can be optimized for one entry. It could even be a list, with only a few bytes overhead. This solution would be almost as fast for read accesses as the most na&#239;ve cache implementation, but still work in cases where keys resolve to the same hash value.&lt;/p&gt;

&lt;p&gt;The details are easy:&lt;/p&gt;

&lt;p&gt;Fetching: Fetch the cache entry (the map) by the key&apos;s MD5 hash value. Then, look the correct value up in the map using the full-length key. Remember this is not any expensive operation. The map contains almost always exactly one value.&lt;/p&gt;

&lt;p&gt;Creating: Fetch the cache entry (the map) by the key&apos;s MD5 hash value. If there is no cache entry at all, create a new map with a single entry in it and store it into the cache. If there is an entry, get the map, add the new entry to it using the full-length key and the value, and store the map back into the cache using the key&apos;s MD5 hash value. Adding a value to the map would also replace any existing entry for the full-length key in case it is already present in the map.&lt;/p&gt;

&lt;p&gt;Deleting: Fetch the cache entry (the map) by the key&apos;s MD5 hash value. Then, use the full-length key to delete the corresponding value from the map. If the map is empty after removing the entry (and it will be almost always), delete the whole cache entry using the key&apos;s MD5 hash value.&lt;/p&gt;

&lt;p&gt;This technique is correct always, and gives almost no overhead for reads. For writes and deletes, you have to fetch first, so there is an overhead, but right now I can&apos;t come up with anything faster&lt;br/&gt;
that isn&apos;t broken.&lt;/p&gt;

&lt;p&gt;An optimization would be implementing an additional direct full-key mapping, too, for those cache providers supporting arbitrary length keys. This could give slightly better write performance when arbitrary-length keys are supported, as there would not be any map to be read in case of writing and deleting, just a direct cache operation.&lt;/p&gt;</comment>
                    <comment id="15061" author="beberlei" created="Thu, 30 Dec 2010 07:51:56 +0000"  >&lt;p&gt;The unhashed key could potentially be very large, which could lead to problems with the value limit of the caches. Plus the unhashed value relies on print_r(), thus on whitespace formatting which i wouldn&apos;t call exactly reliable.&lt;/p&gt;

&lt;p&gt;We need to find a better solution to fix this &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="15085" author="dalvarez" created="Sat, 1 Jan 2011 16:37:36 +0000"  >&lt;p&gt;As for the size limit on cached values, I think it is an independent problem, because any value size limit applies in any case, whether or not you implement unique keys or not. Currently, it also applies e. g. to query results, for which an upper size limit can not be guaranteed in general. Consequently, a strategy for handling such a limit is required anyway. &lt;/p&gt;

&lt;p&gt;The na&#239;ve solution for handling the value size limit would be to simply not cache any values with a total size larger than the value size limit of the respective cache. As the value size limit should actually be reasonably large (memcached e.g. has a default limit of 1 MB), and the limitation is inherent to the cache, this should be perfectly plausible, because it is the caches key functionality that imposes the limit, not Doctrine. I believe the na&#239;ve solution is on-the-spot here, and would recommend to strictly opt against taking further measures (like splitting cache entries into buckets) to work around the problem. Working around this limit should have been implemented in the respective cache in the first place, not in Doctrine, as it concerns the caches key functionality. IMO the ORM should not duplicate cache functionality, rather use it in a proper way. &lt;/p&gt;

&lt;p&gt;But after all, this is an unrelated problem, and it does not affect the point of this bug in any way. &lt;/p&gt;

&lt;p&gt;As for the reliance on print_r: If you consider it to be non-deterministic (producing different output formattings for identical objects) it would be broken (possibly by design). That being said, I do not believe print_r() is non-deterministic by design, though the exact workings of it might not be formally specified. The formatting in the return value string should not introduce ambiguity into the representations of otherwise unique values, and neither produce different values for identical objects. As long as these conditions are met, you should be safe using it for generating cache keys. If not, use something that does fit. This is a mere implementation issue, anyway. You could also strip whitespaces (provided this does not affect uniqueness), to eliminate the whitespace factor. &lt;/p&gt;

&lt;p&gt;If cache size efficiency of stored values is an issue, you could be well-advised to support compressing cache values (losslessly, of course) as an option. &lt;/p&gt;</comment>
                    <comment id="15109" author="beberlei" created="Wed, 5 Jan 2011 12:36:37 +0000"  >&lt;p&gt;Ok, the common recommendation to avoid cache collisions is using a multitude of different hashes and combine them, or use a very large hash.&lt;/p&gt;

&lt;p&gt;So the best solution here is probably to switch to a cache key that has &quot;sha1 + md5 + crc32&quot; of the input and if ext/hash is installed use something much more  powerful like sha256.&lt;/p&gt;</comment>
                    <comment id="15110" author="dalvarez" created="Wed, 5 Jan 2011 17:21:18 +0000"  >&lt;p&gt;That &quot;recommendation&quot; you are referring to might be just the common practice of using a combination of various hash values to increase the accuracy of ensuring data integrity and authenticity (e.g. by providing various different hash values for downloaded files). IMO this practice is feasible only for purposes like those, and can not be relied on if what you want to do is obtain correct results on cache lookups. While a change in hash value means that the file has definitely been modified (compared to the original) it does not imply e. g. that various modified files that have the same hash value have actually the same modified content.&lt;/p&gt;

&lt;p&gt;What you are trying to do could be used in situations where a Bloom Filter (&lt;a href=&quot;http://en.wikipedia.org/wiki/Bloom_filter&quot; class=&quot;external-link&quot;&gt;http://en.wikipedia.org/wiki/Bloom_filter&lt;/a&gt;) could be appropriately used, which is basically such a combination of various hashes. This could perfectly be used to determine whether there is a high chance that a specific value is in the cache. Such information could be useful to optimize disk accesses or costly requests to remote caches. Bloom filters are used e.g. in the Squid Caching HTTP Proxy, but certainly not for keying, rather for cache digests (read: &quot;is it likely that this key is in the cache?&quot;). This is not the case with the Doctrine 2 caches - these should better be 100% reliable.&lt;/p&gt;

&lt;p&gt;Increasing the number or size of hash values will just decrease the probability of a crash, but will not ultimately fix the problem (unless you make the hash values include all original information, but that would be pointless in the first place). And that something is unlikely to happen does not mean it will necessarily take a long time to actually happen. It could as well break an application tomorrow.&lt;/p&gt;

&lt;p&gt;Seriously, I do not know of any theoretically backed recommendation that tolerates wrong results when correctness is expected. There are a couple of approximation techniques appropriate in situations where false positives are anticipated, but I believe no such technique would be an appropriate solution for your situation, simply because no one expects the programming contract to imply having to anticipate false positives.&lt;/p&gt;

&lt;p&gt;But of course, various hashes would still be better than one, though still worth a bug. Personally I would always opt for correctness. Do as you like.&lt;/p&gt;</comment>
                    <comment id="15175" author="beberlei" created="Sun, 23 Jan 2011 14:55:26 +0000"  >&lt;p&gt;Implemented separate chaining to avoid hash key collisions.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1458] Issue with tracking entity changes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1458</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Flushing at point #2 has no effect (outputs int(1)), flushing at point #1 works as expected (outputs int(5)).&lt;br/&gt;
this issue comes only when i trying to set boolean value on managed assotiated entity&lt;/p&gt;

&lt;p&gt;upd. same issue with datetime 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;/**
 * @ORM\Entity
 */
class TestEntity
{
    /**
     * @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\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; $value;
    /**
     * @ORM\OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;TestAdditionalEntity&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;entity&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; $additional;
}

/**
 * @ORM\Entity
 */
class TestAdditionalEntity
{
    /**
     * @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;TestEntity&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;additional&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $entity;
    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $bool;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;bool = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    }
}

$test = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \TestEntity();
$test-&amp;gt;setValue(1);
$test-&amp;gt;setAdditional(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \TestAdditionalEntity());

$em-&amp;gt;persist($test);
$em-&amp;gt;flush();
$em-&amp;gt;clear();

$test = $em-&amp;gt;getRepository(&apos;Bundle:TestEntity&apos;)-&amp;gt;find(1);
$test-&amp;gt;setValue(5);

&lt;span class=&quot;code-comment&quot;&gt;// point #1
&lt;/span&gt;$test-&amp;gt;getAdditional()-&amp;gt;setBool(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
&lt;span class=&quot;code-comment&quot;&gt;// point #2
&lt;/span&gt;
$em-&amp;gt;flush();

var_dump($test-&amp;gt;getValue());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>linux/ubuntu, nginx, php-cgi, symfony framework</environment>
            <key id="13130">DDC-1458</key>
            <summary>Issue with tracking entity changes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="asm89">Alexander</assignee>
                                <reporter username="n3b">Maxim</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Oct 2011 23:56:56 +0000</created>
                <updated>Fri, 11 Nov 2011 07:20:15 +0000</updated>
                    <resolved>Thu, 10 Nov 2011 15:21:24 +0000</resolved>
                            <version>2.1</version>
                <version>2.1.2</version>
                                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16777" author="asm89" created="Tue, 8 Nov 2011 21:20:28 +0000"  >&lt;p&gt;Looking into this.&lt;/p&gt;</comment>
                    <comment id="16787" author="beberlei" created="Wed, 9 Nov 2011 20:41:46 +0000"  >&lt;p&gt;formatting&lt;/p&gt;</comment>
                    <comment id="16789" author="asm89" created="Thu, 10 Nov 2011 15:21:24 +0000"  >&lt;p&gt;Fixed in master:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/187&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/187&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16790" author="beberlei" created="Fri, 11 Nov 2011 07:20:14 +0000"  >&lt;p&gt;Merged into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1452] ObjectHydrator bug: hydration of entity with self (cyclic) relation through ref entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1452</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;ObjectHydrator has bug in hydrate entities with relation to entity of this same class throught reference entity. Example Model:&lt;/p&gt;

&lt;p&gt;EntityA&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;id&lt;/li&gt;
	&lt;li&gt;title (string)&lt;/li&gt;
	&lt;li&gt;entitiesB (annotation: @ORM\OneToMany(targetEntity=&quot;EntityB&quot;, mappedBy=&quot;entityAFrom&quot;))&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;EntityB&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;id&lt;/li&gt;
	&lt;li&gt;entityAFrom (annotation: @ORM\ManyToOne(targetEntity=&quot;EntityA&quot;, inversedBy=&quot;entitiesB&quot;))&lt;/li&gt;
	&lt;li&gt;entityATo (annotation: @ORM\ManyToOne(targetEntity=&quot;EntityA&quot;))&lt;/li&gt;
	&lt;li&gt;type (string)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Scenario:&lt;/p&gt;

&lt;p&gt;Execution of dql query &apos;SELECT a, b, ba FROM EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba&apos;  with max results set to &quot;1&quot; and data in database:&lt;/p&gt;

&lt;p&gt;EntityATable:&lt;br/&gt;
id | title&lt;br/&gt;
1 | a&lt;br/&gt;
2 | b&lt;/p&gt;

&lt;p&gt;EntityBTable:&lt;br/&gt;
id | entityAFromId | entityAToId | type&lt;br/&gt;
1 | 1 | 2 | type&lt;/p&gt;

&lt;p&gt;Resume:&lt;/p&gt;

&lt;p&gt;I expected collection of EntityA object (size=1 becouse I set max results to 1) with hydrated entitiesB collection (size=1 becouse in db is only 1 record) and hydrated entityTo object. entitiesB property of entityTo object should be empty PersistCollection (ready to lazy load) but is null...&lt;/p&gt;

&lt;p&gt;I can provide TestCase for this issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13124">DDC-1452</key>
            <summary>ObjectHydrator bug: hydration of entity with self (cyclic) relation through ref entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="psliwa">Piotr &#346;liwa</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Oct 2011 20:15:37 +0000</created>
                <updated>Tue, 15 Nov 2011 17:48:23 +0000</updated>
                    <resolved>Mon, 14 Nov 2011 22:37:45 +0000</resolved>
                            <version>2.1</version>
                <version>2.1.1</version>
                <version>2.1.2</version>
                                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16714" author="beberlei" created="Fri, 28 Oct 2011 22:24:26 +0000"  >&lt;p&gt;Attached a working testcase.&lt;/p&gt;

&lt;p&gt;Please put it into tests/Doctrine/Tests/ORM/Functional/Ticket and 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;phpunit --group DDC-1452
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Please make that test fail from your perspective, i think it reproduces your test-case exactly.&lt;/p&gt;</comment>
                    <comment id="16717" author="psliwa" created="Sat, 29 Oct 2011 00:26:06 +0000"  >&lt;p&gt;Ok, I have fixed testcase to situation that I was talking about. &lt;/p&gt;

&lt;p&gt;I have hardly debuged this issue, problem is in ObjectHydrator::_getEntity() method. This method delegates to UnitOfWork::createEntity() and passes $hints array. In $hints array, data about fetching associations is stored. In situation when one entity is joined throught two different associations (as in this testcase, first time DDC1452EntityA is used in from clause, second time in join clause) hydrator &quot;minds&quot; that objects from second association have have loaded association that is connecting entities of the same type. In testcase this is &quot;entitiesB&quot; association of &quot;ba&quot; aliased entity. That occurs, becouse $hints&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fetched&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;Namespace\DDC1452EntityA&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;entitiesB&amp;#39;&amp;#93;&lt;/span&gt; has already been set on true while hydrating DDC1452EntityA objects from &quot;FROM&quot; clause. If in testcase had not been set limit for results, then this test would have to pass, becouse second object of DDC1452EntityA ($a2) would have to be load propertly as entity from &quot;FROM&quot; clause.&lt;/p&gt;</comment>
                    <comment id="16719" author="beberlei" created="Sat, 29 Oct 2011 07:18:14 +0000"  >&lt;p&gt;The explaination makes sense. I will dig into it.&lt;/p&gt;</comment>
                    <comment id="16828" author="beberlei" created="Mon, 14 Nov 2011 22:37:45 +0000"  >&lt;p&gt;This is fixed, but only in master. The code change necessary was pretty serious so i dont want to merge it into the stable branch without more people testing it.&lt;/p&gt;</comment>
                    <comment id="16839" author="psliwa" created="Tue, 15 Nov 2011 17:48:23 +0000"  >&lt;p&gt;Great job, thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11092" name="DDC1452Test.php" size="2265" author="psliwa" created="Sat, 29 Oct 2011 00:26:06 +0000" />
                    <attachment id="11091" name="DDC1452Test.php" size="1851" author="beberlei" created="Fri, 28 Oct 2011 22:24:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1440] Doctrine2 is not able to manage correctly a FK based on a unique string which is not a PK on its table</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1440</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine2 is not able to manage correctly a FK based on a unique string which is not a PK on its table. Tables are created successfully but data is not managed properly. I&apos;m attaching some Entities and Fixture files in order to test 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>Any GNU/Linux OS (Linux x61090t_05 2.6.32-71.29.1.el6.x86_64 #1 SMP Mon Jun 27 19:49:27 BST 2011 x86_64 x86_64 x86_64 GNU/Linux)</environment>
            <key id="13105">DDC-1440</key>
            <summary>Doctrine2 is not able to manage correctly a FK based on a unique string which is not a PK on its table</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sibok">Pau Peris</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Oct 2011 08:41:18 +0000</created>
                <updated>Mon, 31 Oct 2011 22:15:28 +0000</updated>
                    <resolved>Mon, 31 Oct 2011 22:15:28 +0000</resolved>
                            <version>Git Master</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16667" author="beberlei" created="Thu, 20 Oct 2011 09:11:13 +0000"  >&lt;p&gt;Could you run &quot;doctrine.php orm:validate-schema&quot; ? I think this will give you an error that this is not possible. Doctrine can only work with foreign keys through primary keys. A workaround for this is making doctrine belive that the unique field is the identifier and that the real id field is just a regular field.&lt;/p&gt;</comment>
                    <comment id="16668" author="sibok" created="Thu, 20 Oct 2011 10:24:40 +0000"  >&lt;p&gt;Hi, i&apos;m using doctrine2 through symfony2 and it does not provide the command to validate the schema. I think it was removed some time ago. Could you explain a liitle bit how to accomplish your workaround? Right now i&apos;ve done sme workarounds to avoid that issue but i think it&apos;s a feature which is used very often.&lt;br/&gt;
Thanks a lot &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;PD: Entities and fixtures are working fine.&lt;/p&gt;</comment>
                    <comment id="16705" author="beberlei" created="Thu, 27 Oct 2011 22:39:10 +0000"  >&lt;p&gt;You can re-add the command by just adding a plain command into your own bundle that extends from doctrines validate schema and extend the &quot;execute&quot; method to inject the EntityManager from the DIC correctly.&lt;/p&gt;</comment>
                    <comment id="16759" author="beberlei" created="Mon, 31 Oct 2011 22:15:28 +0000"  >&lt;p&gt;This is an invalid mapping.&lt;/p&gt;

&lt;p&gt;You can only map join-columns of associations to primary keys.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11073" name="Permission.php" size="1460" author="sibok" created="Thu, 20 Oct 2011 08:41:18 +0000" />
                    <attachment id="11075" name="permission_1308995187.php" size="1938" author="sibok" created="Thu, 20 Oct 2011 08:41:18 +0000" />
                    <attachment id="11074" name="User.php" size="1716" author="sibok" created="Thu, 20 Oct 2011 08:41:18 +0000" />
                    <attachment id="11076" name="user_1308995187.php" size="1850" author="sibok" created="Thu, 20 Oct 2011 08:41:41 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1436] Problems with identity map on self-referencing</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1436</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
 * @Orm\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;tt_content&quot;&lt;/span&gt;)
 */
class Page
{
	/**
	 * @Orm\Id
	 * @Orm\GeneratedValue
	 * @Orm\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, name=&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; $id;

	/**
	 * @Orm\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Page&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;children&quot;&lt;/span&gt;)
	 * @Orm\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pid&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; $parent;

	/** @Orm\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Page&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;parent&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $children;

	/** @Orm\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;page_title&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $title;
}

$id = 5;

&lt;span class=&quot;code-comment&quot;&gt;// step 1 
&lt;/span&gt;$page = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;
	-&amp;gt;getEntityManager(&apos;read&apos;)
	-&amp;gt;createQuery(&apos;
		SELECT p, parent
		FROM OloloContentBundle:Page p
			LEFT JOIN p.parent parent
		WHERE p.id = :id
	&apos;)
	-&amp;gt;setParameter(&apos;id&apos;, $id)
	-&amp;gt;getOneOrNullResult();

&lt;span class=&quot;code-comment&quot;&gt;// step 2
&lt;/span&gt;$page = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getEntityManager(&apos;read&apos;)-&amp;gt;find(&apos;OloloContentBundle:Page&apos;, $id);
var_dump($page-&amp;gt;getParent()-&amp;gt;getParent()); &lt;span class=&quot;code-comment&quot;&gt;// expected instance of Page, but got &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I added one more fetch join for parent then I got Page.&lt;/p&gt;</description>
                <environment>Symfony2</environment>
            <key id="13101">DDC-1436</key>
            <summary>Problems with identity map on self-referencing</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="koc">Konstantin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Oct 2011 22:44:26 +0000</created>
                <updated>Fri, 18 Nov 2011 14:02:03 +0000</updated>
                    <resolved>Fri, 18 Nov 2011 13:04:35 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16829" author="beberlei" created="Mon, 14 Nov 2011 22:39:58 +0000"  >&lt;p&gt;Can you test against master again? I made a fix in context of &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; that i think could solve this issue.&lt;/p&gt;</comment>
                    <comment id="16833" author="koc" created="Tue, 15 Nov 2011 09:12:35 +0000"  >&lt;p&gt;I will do it&lt;/p&gt;</comment>
                    <comment id="16838" author="koc" created="Tue, 15 Nov 2011 15:48:49 +0000"  >&lt;p&gt;I cann&apos;t run master branch on current env (Symfony 2.0.2).&lt;/p&gt;

&lt;p&gt;MappingException: The association mapping &apos;eventArea&apos; misses the &apos;targetEntity&apos; attribute, but targetEntity present. Can you merge fix into 2.1.x branch?&lt;/p&gt;</comment>
                    <comment id="16854" author="beberlei" created="Fri, 18 Nov 2011 12:16:44 +0000"  >&lt;p&gt;I am not sure this fix is mergable in 2.1, also it is a rather complex change that i don&apos;t want to merge back to the stable branch for stability reasons.&lt;/p&gt;

&lt;p&gt;Let me try to reproduce this in a test and then go further from there.&lt;/p&gt;</comment>
                    <comment id="16855" author="beberlei" created="Fri, 18 Nov 2011 12:28:10 +0000"  >&lt;p&gt;&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; is indeed the same bug as this one and the fix works.&lt;/p&gt;</comment>
                    <comment id="16856" author="beberlei" created="Fri, 18 Nov 2011 12:55:42 +0000"  >&lt;p&gt;I cant merge this as with the latest refactorings it gives hundrets of conflicts, but will re-apply manually.&lt;/p&gt;</comment>
                    <comment id="16857" author="beberlei" created="Fri, 18 Nov 2011 13:04:35 +0000"  >&lt;p&gt;Backported and fixed in 2.1.x&lt;/p&gt;</comment>
                    <comment id="16860" author="koc" created="Fri, 18 Nov 2011 14:02:03 +0000"  >&lt;p&gt;Thank you very much, Benjamin!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1414] UnitOfWork#getCommitOrder() does not add dependencies for all related classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1414</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;getCommitOrder() does not add dependencies for all related classes. This causes database-level exceptions in certain cases, as insertion order can be calculated incorrectly, and foreign key constraints fail.&lt;/p&gt;

&lt;p&gt;An example case in pseudocode:&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;A: ManyToOne to B, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
B: ManyToOne to C, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
C: no owning relations

a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; A()
em-&amp;gt;persist(a)
em-&amp;gt;flush()     &lt;span class=&quot;code-comment&quot;&gt;// does CommitOrderCalculator-&amp;gt;addClass(B), but does not add B&apos;s dependency to C
&lt;/span&gt;
c = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; C()
b = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; B(c)

em-&amp;gt;persist(c)
em-&amp;gt;persist(b)
em-&amp;gt;flush()     &lt;span class=&quot;code-comment&quot;&gt;// CommitOrderCalculator-&amp;gt;hasClass(B) == &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, dependencies not added, foreign key constraint fails&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Suggested fix against master:&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;diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index ea516f3..991acac 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -853,6 +853,7 @@ class UnitOfWork implements PropertyChangedListener
                     $targetClass = $this-&amp;gt;em-&amp;gt;getClassMetadata($assoc[&apos;targetEntity&apos;]);
                     if ( ! $calc-&amp;gt;hasClass($targetClass-&amp;gt;name)) {
                         $calc-&amp;gt;addClass($targetClass);
+                        $newNodes[] = $targetClass;
                     }
                     $calc-&amp;gt;addDependency($targetClass, $class);
                     // If the target class has mapped subclasses,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This $newNodes[] push is done for all new classes in $entityChangeSet (above) and $targetClass-&amp;gt;subClasses (below), but not for $targetClass itself. I&apos;m assuming this is a bug, not by design.&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="13079">DDC-1414</key>
            <summary>UnitOfWork#getCommitOrder() does not add dependencies for all related classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="pmahanen">Petri Mahanen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Oct 2011 16:03:17 +0000</created>
                <updated>Sat, 15 Oct 2011 15:49:28 +0000</updated>
                    <resolved>Sat, 15 Oct 2011 15:48:17 +0000</resolved>
                            <version>2.1.2</version>
                <version>Git Master</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16593" author="beberlei" created="Sat, 15 Oct 2011 15:48:17 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1402] Huge performance leak in SingleTablePersister</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1402</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;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;/**
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&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;person&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Person&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;employee&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Employee&quot;&lt;/span&gt;})
 */
class Person
{
    /** @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; $id;
}

/**
 * @Entity
 */
class Employee &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Person
{
    /** @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; $a;
    /** @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; $b;
    /** @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; $c;
    /** @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; $d;
    /** @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; $e;
    /** @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; $f;
    /** @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; $g;
    /** @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; $h;
}

foreach (range(0, 20) as $i) {
    $time = microtime(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
    foreach (range(1, 100) as $j) {
        $id = ($i * 100) + $j;
        $entityManager-&amp;gt;find(&apos;Person&apos;, $id);
    }
    printf(&lt;span class=&quot;code-quote&quot;&gt;&quot;%4d ==&amp;gt; %f\n&quot;&lt;/span&gt;, $id, microtime(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;) - $time);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will 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; 100 ==&amp;gt; 0.461275
 200 ==&amp;gt; 1.128404
 300 ==&amp;gt; 1.823122
 400 ==&amp;gt; 2.521054
 500 ==&amp;gt; 3.232034
 600 ==&amp;gt; 3.950081
 700 ==&amp;gt; 4.648849
 800 ==&amp;gt; 5.380236
 900 ==&amp;gt; 6.080108
1000 ==&amp;gt; 6.807214
1100 ==&amp;gt; 7.519942
1200 ==&amp;gt; 8.238971
1300 ==&amp;gt; 8.951686
1400 ==&amp;gt; 9.648996
1500 ==&amp;gt; 10.370053
1600 ==&amp;gt; 11.069523
1700 ==&amp;gt; 11.791530
1800 ==&amp;gt; 12.481427
1900 ==&amp;gt; 13.190570
2000 ==&amp;gt; 13.902810
2100 ==&amp;gt; 14.671100
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the first and last SELECT queries 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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; t0.id AS id1, discr, t0.a AS a2, t0.b AS b3, t0.c AS c4, t0.d AS d5, t0.e AS e6, t0.f AS f7, t0.g AS g8, t0.h AS h9 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Person t0 &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; t0.id = 1 AND t0.discr IN (&apos;person&apos;, &apos;employee&apos;)

...

&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; t0.id AS id1, discr, t0.a AS a16794, t0.b AS b16795, t0.c AS c16796, t0.d AS d16797, t0.e AS e16798, t0.f AS f16799, t0.g AS g16800, t0.h AS h16801 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Person t0 &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; t0.id = 2100 AND t0.discr IN (&apos;person&apos;, &apos;employee&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Last 100 SELECT queries take more than 14 seconds to execute! (&lt;b&gt;table is empty&lt;/b&gt;)&lt;/li&gt;
	&lt;li&gt;Filed as a bug because a real life scenario caused major performance leak and memory usage when attempting to do 6000 calls to find().&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Analysis:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Calls to &lt;b&gt;SingleTablePersister::_getSelectColumnListSQL()&lt;/b&gt; do not use &lt;b&gt;BasicEntityPersister::$_selectColumnListSql&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;This generates a lot of calls to &lt;b&gt;_getSelectColumnSQL()&lt;/b&gt; (See last SELECT query with alias counter up to 16800)&lt;/li&gt;
	&lt;li&gt;This generates a lot of calls to &lt;b&gt;addFieldResult()&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;And this fills up pretty quickly &lt;b&gt;ResultSetMapping::$declaringClasses&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;To finally put a huge burden on &lt;b&gt;SimpleObjectHydrator::_prepare()&lt;/b&gt; where it iterates on &lt;b&gt;$this-&amp;gt;_rsm-&amp;gt;declaringClasses&lt;/b&gt; and calls &lt;b&gt;getClassMetadata()&lt;/b&gt; for each one!&lt;/li&gt;
	&lt;li&gt;And all that, including &lt;b&gt;_prepare()&lt;/b&gt;, is executed for each SELECT, even though none of them find any result (the table is empty).&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I fixed my project using the following patch:&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;diff --git a/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php b/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php
index f910a8e..78b27cb 100644
--- a/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php
+++ b/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php
@@ -41,6 +41,15 @@ class SingleTablePersister extends AbstractEntityInheritancePersister
     /** {@inheritdoc} */
     protected function _getSelectColumnListSQL()
     {
+        /** @see BasicEntityPersister::_getSelectColumnListSQL() */
+        if ($this-&amp;gt;_selectColumnListSql !== null) {
+            return $this-&amp;gt;_selectColumnListSql;
+        }
+
+        #####
+        #####
+        #####
+
         $columnList = parent::_getSelectColumnListSQL();
 
         // Append discriminator column
@@ -74,7 +83,13 @@ class SingleTablePersister extends AbstractEntityInheritancePersister
             }
         }
 
-        return $columnList;
+        #####
+        #####
+        #####
+
+        /** @see BasicEntityPersister::_getSelectColumnListSQL() */
+        $this-&amp;gt;_selectColumnListSql = $columnList;
+        return $this-&amp;gt;_selectColumnListSql;
     }
 
     /** {@inheritdoc} */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I do not know if this patch is safe for everybody.&lt;/p&gt;

&lt;p&gt;But, well, you can easily reproduce the problem and analyze the phenomenon using a profiler on the sample code provided.&lt;/p&gt;

&lt;p&gt;Thanks for this great piece of software. I hope this will help you find and fix the bug.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13057">DDC-1402</key>
            <summary>Huge performance leak in SingleTablePersister</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sb_demarque">Sylvain Bernier</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Oct 2011 18:18:39 +0000</created>
                <updated>Mon, 10 Oct 2011 15:55:50 +0000</updated>
                    <resolved>Mon, 10 Oct 2011 15:55:50 +0000</resolved>
                            <version>2.1</version>
                <version>2.1.1</version>
                <version>2.1.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16569" author="beberlei" created="Mon, 10 Oct 2011 15:55:42 +0000"  >&lt;p&gt;good catch, thank you very much!&lt;/p&gt;

&lt;p&gt;fixed and merged back into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11068" name="doctrine-orm-2.1.0-SingleTablePersister.patch" size="1202" author="sb_demarque" created="Tue, 4 Oct 2011 18:18:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1396] [APC Cache] &quot;clear-cache&quot; commands do not work with cli </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1396</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Commands for clear-cache:result, clear-cache:query, clear-cache:metadata do not work with cli and APC Cache&lt;/p&gt;

&lt;p&gt;Revert some correction not tested by guilhermeblanco by adding&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; ($cacheDriver &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; \Doctrine\Common\Cache\ApcCache)
{
    &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \LogicException(&lt;span class=&quot;code-quote&quot;&gt;&quot;Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.&quot;&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>in php.ini&lt;br/&gt;
apc.enable_cli = 1</environment>
            <key id="13048">DDC-1396</key>
            <summary>[APC Cache] &quot;clear-cache&quot; commands do not work with cli </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="jforet">J&#233;r&#244;me For&#234;t</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Sep 2011 15:41:57 +0000</created>
                <updated>Mon, 3 Oct 2011 04:24:31 +0000</updated>
                    <resolved>Mon, 3 Oct 2011 04:24:31 +0000</resolved>
                                            <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16543" author="guilhermeblanco" created="Mon, 3 Oct 2011 04:24:31 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/8efae0b232210b27200f2709e7fcb24c7f02c5de&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/8efae0b232210b27200f2709e7fcb24c7f02c5de&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for the report. =)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1367] Include path not passed to ClassLoader when autoloading Doctrine library from directory</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1367</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The bug is in ORM\Tools\Setup.php in the function registerAutoloadDirectory($directory), specificially the following line:&lt;/p&gt;

&lt;p&gt;$loader = new ClassLoader(&quot;Doctrine&quot;);&lt;/p&gt;

&lt;p&gt;Which should actually be:&lt;/p&gt;

&lt;p&gt;$loader = new ClassLoader(&quot;Doctrine&quot;, $directory);&lt;/p&gt;

&lt;p&gt;As it stands the actual directory location is not being passed to the ClassLoader while attempting to autoload the Doctrine from that specified directory. Under certain circumstances this causes loading to completely fail (although in cases where this function is being called from a parent directory to Doctrine this seems to go unnoticed - perhaps why this was not picked up sooner?)&lt;/p&gt;</description>
                <environment>Found while trying to write a Doctrine 2.1 module for Kohana.</environment>
            <key id="13004">DDC-1367</key>
            <summary>Include path not passed to ClassLoader when autoloading Doctrine library from directory</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="vanit">Lucas Brown</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Sep 2011 00:02:19 +0000</created>
                <updated>Sun, 25 Sep 2011 14:41:43 +0000</updated>
                    <resolved>Sun, 25 Sep 2011 14:41:43 +0000</resolved>
                            <version>2.1</version>
                <version>2.1.1</version>
                <version>Git Master</version>
                                <fixVersion>2.1.2</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16508" author="beberlei" created="Sun, 25 Sep 2011 14:41:43 +0000"  >&lt;p&gt;Fixed and merged into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1346] Error when referencing aliased sub-select in where clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1346</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Example:
&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-&amp;gt;addSelect(&apos;(SELECT COUNT(tp2) FROM TeamPlayer tp2 WHERE tp2.team = t) AS test&apos;);

$qb-&amp;gt;andWhere(&apos;test &amp;gt; 3&apos;);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Semantical Error&amp;#93;&lt;/span&gt; line 0, col 186 near &apos;test &amp;gt; 3 ORDER&apos;: Error: &apos;test&apos; does not point to a Class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12967">DDC-1346</key>
            <summary>Error when referencing aliased sub-select in where clause</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="darkangel">Glen Ainscow</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Aug 2011 17:40:55 +0000</created>
                <updated>Mon, 31 Oct 2011 20:56:50 +0000</updated>
                    <resolved>Mon, 5 Sep 2011 06:11:49 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16381" author="beberlei" created="Sat, 27 Aug 2011 11:33:11 +0000"  >&lt;p&gt;Assigned to Guilherme&lt;/p&gt;</comment>
                    <comment id="16435" author="guilhermeblanco" created="Mon, 5 Sep 2011 06:11:49 +0000"  >&lt;p&gt;Fixed since commit &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/6bbf2d9da35aa8ce500f26d671a135a00870e33a&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/6bbf2d9da35aa8ce500f26d671a135a00870e33a&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16504" author="beberlei" created="Sun, 25 Sep 2011 13:12:35 +0000"  >&lt;p&gt;Merged into 2.1&lt;/p&gt;</comment>
                    <comment id="16752" author="beberlei" created="Mon, 31 Oct 2011 20:56:50 +0000"  >&lt;p&gt;Merged into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1300] Can&apos;t fetch entities from IdentityMap when using a foreign keys as identifiers</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1300</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given the follow SQL structure:&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 TABLE `foo` (
  `fooID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL AUTO_INCREMENT,
  `fooReference` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`fooID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT=&apos;module=bug&apos;;

CREATE TABLE `fooLocale` (
  `fooID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  `locale` varchar(5) NOT NULL DEFAULT &apos;&apos;,
  `title` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`fooID`,`locale`),
  KEY `fk_foo2` (`fooID`),
  CONSTRAINT `fk_table1_foo2` FOREIGN KEY (`fooID`) REFERENCES `foo` (`fooID`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=&apos;module=bug&apos;;

INSERT INTO `foo` (`fooID`, `fooReference`)
VALUES
	(1, &apos;foo1&apos;);

INSERT INTO `fooLocale` (`fooID`, `locale`, `title`)
VALUES
	(1, &apos;en_GB&apos;, &apos;Foo title test&apos;);

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and the following models:&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;

/**
 * Model &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; foo
 *
 * @category Application
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt; Bug
 * @subpackage Model
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class Bug_Model_Foo
{
	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer fooID
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&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;)
	 * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
	 * @ORM\Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooID = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string fooReference
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooReference&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, length=45)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooReference = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bug_Model_FooLocale&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_foo&quot;&lt;/span&gt;,
	 * cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooLocaleRefFoo = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * Constructor
	 *
	 * @param array|Zend_Config|&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; $options
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Bug_Model_Foo
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($options = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooLocaleRefFoo = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
	}

}
&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;

/**
 * Model &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; fooLocale
 *
 * @category Application
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt; Bug
 * @subpackage Model
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooLocale&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class Bug_Model_FooLocale
{
	/**
	 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bug_Model_Foo&quot;&lt;/span&gt;)
	 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&quot;&lt;/span&gt;)
	 * @ORM\Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_foo = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string locale
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;locale&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, length=5)
	 * @ORM\Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_locale = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string title
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;title&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, length=150)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_title = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Execute the following DQL 2 times:&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 = $entityManager-&amp;gt;createQuery(&apos;
			SELECT 
				f, fl 
			FROM 
				Bug_Model_Foo f 
			JOIN 
				f._fooLocaleRefFoo fl&apos;);
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $query-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first time, you won&apos;t have any issues.&lt;br/&gt;
The second time, when the data will be fetched from the identityMap, you won&apos;t find it because there is something wrong with the identities and you will get the following warning&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;( ! ) Notice: Undefined index: _foo in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/vhost/core/htdocs/externals/Doctrine/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php on line 217
Call Stack
#	Time	Memory	Function	Location
1	0.0002	337752	{main}( )	../index.php:0
2	0.0848	7268724	Zend_Application-&amp;gt;run( )	../index.php:26
3	0.0848	7268724	Zend_Application_Bootstrap_Bootstrap-&amp;gt;run( )	../Application.php:366
4	0.0850	7268796	Zend_Controller_Front-&amp;gt;dispatch( )	../Bootstrap.php:97
5	0.0908	7900416	Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch( )	../Front.php:954
6	0.0967	8209564	Zend_Controller_Action-&amp;gt;dispatch( )	../Standard.php:295
7	0.0967	8213912	Bug_IndexController-&amp;gt;indexAction( )	../Action.php:513
8	0.1936	11391900	Bug_Service_Bug-&amp;gt;getFooLocaleList( )	../IndexController.php:35
9	0.1936	11394088	Doctrine\ORM\AbstractQuery-&amp;gt;getResult( )	../Bug.php:41
10	0.1936	11394296	Doctrine\ORM\AbstractQuery-&amp;gt;execute( )	../AbstractQuery.php:392
11	0.1945	11397960	Doctrine\ORM\Internal\Hydration\AbstractHydrator-&amp;gt;hydrateAll( )	../AbstractQuery.php:594
12	0.1946	11398656	Doctrine\ORM\Internal\Hydration\ObjectHydrator-&amp;gt;_hydrateAll( )	../AbstractHydrator.php:99
13	0.1946	11399876	Doctrine\ORM\Internal\Hydration\ObjectHydrator-&amp;gt;_hydrateRow( )	../ObjectHydrator.php:140
14	0.1949	11405584	Doctrine\ORM\Internal\Hydration\ObjectHydrator-&amp;gt;_getEntityFromIdentityMap( )	../ObjectHydrator.php:326
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the invalid key, it is not possible to get the entity from the identityMap.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12862">DDC-1300</key>
            <summary>Can&apos;t fetch entities from IdentityMap when using a foreign keys as identifiers</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="tbo">Van Hauwaert Bert</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jul 2011 16:21:22 +0000</created>
                <updated>Sat, 6 Aug 2011 18:26:28 +0000</updated>
                    <resolved>Sat, 6 Aug 2011 18:26:29 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16279" author="beberlei" created="Sat, 6 Aug 2011 18:04:55 +0000"  >&lt;p&gt;I could reproduce this, working on a fix.&lt;/p&gt;</comment>
                    <comment id="16280" author="beberlei" created="Sat, 6 Aug 2011 18:26:28 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1298] SqlWalker-&gt;walkSelectClause imploding empty strings results in invalid query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1298</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given the following MySQL structure&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 TABLE `bar` (
  `barID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL AUTO_INCREMENT,
  `barReference` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`barID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT=&apos;module=bug&apos;;

CREATE TABLE `foo` (
  `fooID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL AUTO_INCREMENT,
  `fooReference` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`fooID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT=&apos;module=bug&apos;;

CREATE TABLE `fooBar` (
  `fooID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  `barID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  PRIMARY KEY (`fooID`,`barID`),
  KEY `fk_foo1` (`fooID`),
  KEY `fk_bar1` (`barID`),
  CONSTRAINT `fk_table1_foo1` FOREIGN KEY (`fooID`) REFERENCES `foo` (`fooID`) ON DELETE CASCADE ON UPDATE NO ACTION,
  CONSTRAINT `fk_table1_bar1` FOREIGN KEY (`barID`) REFERENCES `bar` (`barID`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=&apos;module=bug&apos;;

INSERT INTO `bar` (`barID`, `barReference`)
VALUES
	(1, &apos;bar1&apos;),
	(2, &apos;bar2&apos;);

INSERT INTO `foo` (`fooID`, `fooReference`)
VALUES
	(1, &apos;foo1&apos;);

INSERT INTO `fooBar` (`fooID`, `barID`)
VALUES
	(1, 1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;the following models:&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;

/**
 * Model &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; foo
 *
 * @category Application
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt; Bug
 * @subpackage Model
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class Bug_Model_Foo
{
	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer fooID
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&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;)
	 * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
	 * @ORM\Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooID = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string fooReference
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooReference&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, length=45)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooReference = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bug_Model_FooBar&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_foo&quot;&lt;/span&gt;,
	 * cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooBarRefFoo = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * Constructor
	 *
	 * @param array|Zend_Config|&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; $options
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Bug_Model_Foo
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($options = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBarRefFoo = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
		parent::__construct($options);
	}

}
&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;

/**
 * Model &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; bar
 *
 * @category Application
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt; Bug
 * @subpackage Model
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class Bug_Model_Bar
{
	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer barID
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;barID&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;)
	 * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
	 * @ORM\Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_barID = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string barReference
	 * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;barReference&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, length=45)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_barReference = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bug_Model_FooBar&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_bar&quot;&lt;/span&gt;,
	 * cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooBarRefBar = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * Constructor
	 *
	 * @param array|Zend_Config|&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; $options
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Bug_Model_Bar
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($options = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBarRefBar = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
		parent::__construct($options);
	}
}

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

/**
 * Model &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; fooBar
 *
 * @category Application
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt; Bug
 * @subpackage Model
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooBar&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class Bug_Model_FooBar
{
	/**
	 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bug_Model_Foo&quot;&lt;/span&gt;)
	 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&quot;&lt;/span&gt;)
	 * @ORM\Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_foo = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bug_Model_Bar&quot;&lt;/span&gt;)
	 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;barID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;barID&quot;&lt;/span&gt;)
	 * @ORM\Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_bar = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and using the 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 
	f, b, fb 
FROM 
	Bug_Model_Foo f 
JOIN 
	f._fooBarRefFoo fb
JOIN
	fb._bar b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will result in the following sql 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 f0_.fooID AS fooID0, f0_.fooReference AS fooReference1, , b1_.barID AS barID2, b1_.barReference AS barReference3, f2_.fooID AS fooID4, f2_.barID AS barID5 FROM foo f0_ INNER JOIN fooBar f2_ ON f0_.fooID = f2_.fooID INNER JOIN bar b1_ ON f2_.barID = b1_.barID
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;there are 2 comma&apos;s between &quot;f0_.fooReference AS fooReference1&quot; and &quot;b1_.barID AS barID2&quot; resulting in an invalid query.&lt;/p&gt;

&lt;p&gt;The first line of the walkSelectClause function in Doctrine/ORM/Query/SqlWalker.php will implode the result of the array_map.&lt;br/&gt;
But you receive an empty result from processing the data for the selectExpression &quot;fb&quot; explaining why you got the extra comma.&lt;/p&gt;

&lt;p&gt;This worked in a previous version when 2.1 was still in development.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12860">DDC-1298</key>
            <summary>SqlWalker-&gt;walkSelectClause imploding empty strings results in invalid query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="tbo">Van Hauwaert Bert</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jul 2011 14:39:17 +0000</created>
                <updated>Thu, 28 Jul 2011 18:36:51 +0000</updated>
                    <resolved>Thu, 28 Jul 2011 18:36:51 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16224" author="tbo" created="Wed, 27 Jul 2011 21:31:29 +0000"  >&lt;p&gt;I have fixed it and made a pull request: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/96&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/96&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16227" author="beberlei" created="Thu, 28 Jul 2011 18:36:51 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2079] Error in build entities using yml with several inversedJoinColumns</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2079</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hello guys, sorry for the bad English found the error during a necessity and would like to post the solution.&lt;/p&gt;

&lt;p&gt;Below is an example of my yml relationamento a many to many.&lt;/p&gt;

&lt;p&gt;manyToMany:&lt;br/&gt;
        centroCustos:&lt;br/&gt;
            targetEntity: Album\Entity\CentroCusto&lt;br/&gt;
            cascade: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;persist&amp;quot;, &amp;quot;merge&amp;quot;&amp;#93;&lt;/span&gt;&lt;br/&gt;
            inversedBy: unidades&lt;br/&gt;
            joinTable:&lt;br/&gt;
                name: unidade_centro_custo&lt;br/&gt;
                joinColumns:&lt;br/&gt;
                    idunidade:&lt;br/&gt;
                        referencedColumnName: idunidade&lt;br/&gt;
                        onDelete: cascade&lt;br/&gt;
                inverseJoinColumns:&lt;br/&gt;
                    idcentrocusto:&lt;br/&gt;
                        referencedColumnName: idcentrocusto&lt;br/&gt;
                    idpais:&lt;br/&gt;
                        referencedColumnName: idpais&lt;br/&gt;
                    idmundo:&lt;br/&gt;
                        referencedColumnName: idmundo                        &lt;br/&gt;
                        onDelete: cascade&lt;/p&gt;

&lt;p&gt;Well this example is generating this code.&lt;/p&gt;

&lt;p&gt;  /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@var \Doctrine\Common\Collections\ArrayCollection&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@ORM\ManyToMany(targetEntity=&quot;Album\Entity\CentroCusto&quot;, inversedBy=&quot;unidades&quot;, cascade=
{&quot;persist&quot;,&quot;merge&quot;}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;@ORM\JoinTable(name=&quot;unidade_centro_custo&quot;,&lt;/li&gt;
	&lt;li&gt;joinColumns=
{
     *     @ORM\JoinColumn(name=&quot;idunidade&quot;, referencedColumnName=&quot;idunidade&quot;, onDelete=&quot;cascade&quot;)
     *   }
&lt;p&gt;,&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;inverseJoinColumns=
{
     *     @ORM\JoinColumn(name=&quot;idcentrocusto&quot;, referencedColumnName=&quot;idcentrocusto&quot;)
     *     @ORM\JoinColumn(name=&quot;idpais&quot;, referencedColumnName=&quot;idpais&quot;)
     *     @ORM\JoinColumn(name=&quot;idmundo&quot;, referencedColumnName=&quot;idmundo&quot;, onDelete=&quot;cascade&quot;)
     *   }&lt;/li&gt;
	&lt;li&gt;)&lt;br/&gt;
     */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Notice that Doctrine 2 is not putting commas to separate JoinColumns.&lt;/p&gt;

&lt;p&gt;So looking at the source code I found the following code and put it solved my problem.&lt;/p&gt;

&lt;p&gt;The changes was performed in EntityGenerator.php line 1090.&lt;/p&gt;

&lt;p&gt;                $arrJoins = array();&lt;br/&gt;
                foreach ($associationMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;joinTable&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;joinColumns&amp;#39;&amp;#93;&lt;/span&gt; as $joinColumn) &lt;/p&gt;
{
                    $arrJoins[] = $this-&amp;gt;spaces . &apos; *     &apos; . $this-&amp;gt;generateJoinColumnAnnotation($joinColumn);
                }

&lt;p&gt;                $lines[] = implode(&quot;,&quot;. PHP_EOL, $arrJoins);&lt;br/&gt;
                $lines[] = $this-&amp;gt;spaces . &apos; *   },&apos;;&lt;br/&gt;
                $lines[] = $this-&amp;gt;spaces . &apos; *   inverseJoinColumns={&apos;;&lt;/p&gt;

&lt;p&gt;                $arrJoinsInverse = array();&lt;br/&gt;
                foreach ($associationMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;joinTable&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;inverseJoinColumns&amp;#39;&amp;#93;&lt;/span&gt; as $joinColumn) &lt;/p&gt;
{
                	
                	$arrJoinsInverse[] = $this-&amp;gt;spaces . &apos; *     &apos; . $this-&amp;gt;generateJoinColumnAnnotation($joinColumn);
                }

&lt;p&gt;                $lines[] = implode(&quot;,&quot;. PHP_EOL, $arrJoinsInverse);&lt;br/&gt;
                $lines[] = $this-&amp;gt;spaces . &apos; *   }&apos;;&lt;br/&gt;
                $lines[] = $this-&amp;gt;spaces . &apos; * )&apos;;              }&lt;/p&gt;

&lt;p&gt;I hope you understand what I&apos;m trying to say, for you do not know if this error occurred, but if there ocorrei is one possible solution.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;</description>
                <environment>windows 7/php 5.3/apache 2.2</environment>
            <key id="14129">DDC-2079</key>
            <summary>Error in build entities using yml with several inversedJoinColumns</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="coisa2004">Andr&#233; Ant&#244;nio Lemos de Moraes</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Oct 2012 14:14:30 +0000</created>
                <updated>Fri, 9 Nov 2012 21:18:00 +0000</updated>
                    <resolved>Sun, 21 Oct 2012 03:17:46 +0000</resolved>
                            <version>2.3</version>
                                <fixVersion>2.3.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18856" author="fabio.bat.silva" created="Sun, 21 Oct 2012 03:17:46 +0000"  >&lt;p&gt;Fixed by : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/2c0feb2a46a7cf97dc2878e6214924c3ffdbce67&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/2c0feb2a46a7cf97dc2878e6214924c3ffdbce67&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2032] DQL fails for Joined Inheritance with Associations on child classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2032</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the following object hierarchy:&lt;/p&gt;

&lt;p&gt;Clazz A with Joined Table Inheritance&lt;br/&gt;
Clazz B extends A &lt;br/&gt;
Clazz C extends A with an association (n:1) to D&lt;br/&gt;
Clazz D&lt;/p&gt;

&lt;p&gt;I am doing a DQL query &apos;SELECT u FROM A u&apos;&lt;/p&gt;

&lt;p&gt;If I just have As and Bs in the DB everything is fine. But I there is a C in there I get the following error:&lt;/p&gt;

&lt;p&gt;Notice: Trying to get property of non-object in X:\Zend_Workspace\goalio_application\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 479&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function fetch() on a non-object in X:\Zend_Workspace\goalio_application\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 148&lt;/p&gt;

&lt;p&gt;When I debug the _rsm of the Hydrator is null when trying to hydrate the row for C. &lt;/p&gt;

&lt;p&gt;Any ideas?&lt;/p&gt;</description>
                <environment>Windows XAMPP</environment>
            <key id="14040">DDC-2032</key>
            <summary>DQL fails for Joined Inheritance with Associations on child classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="pdobrigkeit">Philipp Dobrigkeit</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Sat, 15 Sep 2012 16:47:09 +0000</created>
                <updated>Fri, 21 Sep 2012 18:34:28 +0000</updated>
                    <resolved>Fri, 21 Sep 2012 18:30:44 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18682" author="pdobrigkeit" created="Wed, 19 Sep 2012 10:31:04 +0000"  >&lt;p&gt;Ok, it doesn&apos;t seem related to inheritance. Have the same problem now as well with a Join DQL query.&lt;/p&gt;

&lt;p&gt;Foo (1:n) Bar&lt;br/&gt;
Bar (1:n) Baz&lt;/p&gt;

&lt;p&gt;SELECT c FROM Foo c INNER JOIN c.bar cj WITH cj.id IN(1)&lt;/p&gt;

&lt;p&gt;Gives me the same error as above when it tries to hydrate Bar&lt;/p&gt;</comment>
                    <comment id="18692" author="pdobrigkeit" created="Fri, 21 Sep 2012 18:30:44 +0000"  >&lt;p&gt;Ok, further investigations on my part have found the problem to be somewhere else entirely... Not sure yet if it is a bug, but the problem arises because during the hydration my application does another query, which uses the same hydrator object and thus does cleanup before the initial query is complete. That results in the _rsm being null when the original hydration continues. Will see if that can be fixed in my application.&lt;/p&gt;</comment>
                    <comment id="18693" author="ocramius" created="Fri, 21 Sep 2012 18:34:28 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=pdobrigkeit&quot; class=&quot;user-hover&quot; rel=&quot;pdobrigkeit&quot;&gt;Philipp Dobrigkeit&lt;/a&gt; this is known. You have to pass a custom hydrator to the new query if you use DQL during PostLoad events.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2012] Inserting a new entity with a custom mapping type does not call convertToDatabaseValueSQL() when using InheritanceType(&quot;JOINED&quot;)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2012</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using class type inheritance - @InheritanceType(&quot;JOINED&quot;) and inserting new entity with a custom mapping type, custom type method convertToDatabaseValueSQL() is never called.&lt;/p&gt;

&lt;p&gt;Here is sample class mapping:&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;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; 
/**
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;item&quot;&lt;/span&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;type_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;)
 * @DiscriminatorMap({1 = &lt;span class=&quot;code-quote&quot;&gt;&quot;ItemPerson&quot;&lt;/span&gt;})
 */
class Item {

	/**
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;tsv&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;tsvector&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $tsv;
}

/**
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;item_person&quot;&lt;/span&gt;)
 * @Entity
 */
class ItemPerson &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Item
{
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;I am using the same custom TsvectorType with simple entities and even Mapped Superclasses and it works perfectly, however on InheritanceType(&quot;JOINED&quot;) method convertToDatabaseValueSQL() is never called :/&lt;br/&gt;
Hope someone knows how to fix this. &lt;br/&gt;
Thank you.&lt;/p&gt;
</description>
                <environment>PHP</environment>
            <key id="14012">DDC-2012</key>
            <summary>Inserting a new entity with a custom mapping type does not call convertToDatabaseValueSQL() when using InheritanceType(&quot;JOINED&quot;)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="darklow">Kaspars Spro&#291;is</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Sep 2012 10:02:03 +0000</created>
                <updated>Wed, 3 Oct 2012 11:57:09 +0000</updated>
                    <resolved>Wed, 3 Oct 2012 10:52:45 +0000</resolved>
                            <version>2.2.3</version>
                                <fixVersion>2.2.4</fixVersion>
                <fixVersion>2.3.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18704" author="fabio.bat.silva" created="Mon, 24 Sep 2012 00:00:03 +0000"  >&lt;p&gt;Hi Kaspars,&lt;/p&gt;


&lt;p&gt;I can&apos;t reproduce, &lt;br/&gt;
Could you change the added testcase and try to make it fails ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18735" author="darklow" created="Wed, 26 Sep 2012 16:26:25 +0000"  >&lt;p&gt;@Fabio thanks for looking into my problem&lt;br/&gt;
I attached test where you can detect the problem.&lt;/p&gt;

&lt;p&gt;It was quite strange, all i did was changed column that uses custom type to array and some minimal convertToDatabaseValue and convertToDatabaseValueSQL logic and convertToDatabaseValueSQL was never called. &lt;/p&gt;

&lt;p&gt;One more thing i noticed, this bug only appears on persist and not on merge. &lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18741" author="fabio.bat.silva" created="Sat, 29 Sep 2012 17:57:34 +0000"  >&lt;p&gt;Thanks Kaspars &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;But sorry, I dont get your use case.&lt;/p&gt;

&lt;p&gt;Notice that convertToDatabaseValueSQL is called just when using queries to find a object by a especific columns which is your mapping type.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/en/2.1/cookbook/advanced-field-value-conversion-using-custom-mapping-types.html#the-mapping-type&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/2.1/cookbook/advanced-field-value-conversion-using-custom-mapping-types.html#the-mapping-type&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18743" author="darklow" created="Sat, 29 Sep 2012 22:15:09 +0000"  >&lt;p&gt;I am using PostgreSQL tsvector data type for full text search.&lt;/p&gt;

&lt;p&gt;Here is my tsvector custom data type class:&lt;br/&gt;
&lt;a href=&quot;https://gist.github.com/3129096&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/3129096&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The only way to update this field in postgresql is to use postgresql function to_tsvector(&apos;some text&apos;).&lt;br/&gt;
And everything works fine, if i persist simple entity, this method transforms insert query as needed:&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 convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
{
	&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; sprintf(&apos;to_tsvector(%s)&apos;, $sqlExpr);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But when i use inheritance, then by some reason convertToDatabaseValueSQL method is not called and tsv field is updated with simple text as returned by convertToDatabaseValue() method.&lt;br/&gt;
I modified the Ticket Test so that you can see exact moment of when it is not called, which is exactly my problem.&lt;/p&gt;

&lt;p&gt;Here is the result after persisting (for persist it failed)&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;
$person = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ItemPerson();
$person-&amp;gt;setName(&apos;some words &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; test&apos;);
$em-&amp;gt;persist($person);
$em-&amp;gt;flush();

DB Result:
Name                | Tsv
--------------------|------------------------------------
some words &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; test | &apos;&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;&apos; &apos;some&apos; &apos;test&apos; &apos;words&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the result after second time update (now by tsv format you can see it worked):&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;
$person-&amp;gt;setName(&apos;some more words &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; test&apos;);
$em-&amp;gt;flush();

DB Result:
Name                | Tsv
--------------------|------------------------------------
some words &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; test | &apos;test&apos;:5 &apos;word&apos;:3
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="18744" author="fabio.bat.silva" created="Sun, 30 Sep 2012 18:32:40 +0000"  >&lt;p&gt;Thanks Kaspars&lt;/p&gt;

&lt;p&gt;Now i saw the problem&lt;/p&gt;

&lt;p&gt;Writing a patch ...&lt;/p&gt;</comment>
                    <comment id="18766" author="darklow" created="Wed, 3 Oct 2012 11:07:02 +0000"  >&lt;p&gt;Just tested fixed version and everything works perfectly now.&lt;br/&gt;
Thank you!&lt;/p&gt;</comment>
                    <comment id="18767" author="fabio.bat.silva" created="Wed, 3 Oct 2012 11:57:09 +0000"  >&lt;p&gt;Fixed by : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/91caff1d8965c20b72d5fdd04ffadf3ab063c1ba&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/91caff1d8965c20b72d5fdd04ffadf3ab063c1ba&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11327" name="DDC2012Test.php" size="4473" author="darklow" created="Wed, 26 Sep 2012 16:24:17 +0000" />
                    <attachment id="11326" name="DDC2012Test.php" size="4372" author="fabio.bat.silva" created="Mon, 24 Sep 2012 00:00:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2001] Problem nextval sequence persist many object</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2001</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Seems to be a bug doctrine.&lt;/p&gt;

&lt;p&gt;Scenario: You cart table and Product table when trying to persist the products do not set the last sequence postgres. In the example cart will id = 1&lt;br/&gt;
products id = 1 ... 5 but the sequence of the final product value is 2 and not 5.&lt;br/&gt;
If I run the script again I get the following 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;
PDOException: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint &lt;span class=&quot;code-quote&quot;&gt;&quot;product_pkey&quot;&lt;/span&gt; DETAIL: Key (id)=(2) already exists. in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/codeigniter/scclocal/application/third_party/doctrine-orm/Doctrine/DBAL/Statement.php on line 131
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sample 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;
        $cart = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; cart\models\Cart;

        $cart-&amp;gt;em-&amp;gt;getConnection()-&amp;gt;beginTransaction();

        $cart-&amp;gt;setDescription(&apos;My Cart&apos;);

        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            &lt;span class=&quot;code-comment&quot;&gt;//Persist Cart
&lt;/span&gt;            $cart-&amp;gt;em-&amp;gt;persist($cart);
            $cart-&amp;gt;em-&amp;gt;flush();
        } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(Exception $e) {
            $cart-&amp;gt;em-&amp;gt;getConnection()-&amp;gt;rollback();
            $cart-&amp;gt;em-&amp;gt;close();
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e;
        }
        &lt;span class=&quot;code-comment&quot;&gt;//Product
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;($i=0; $i &amp;lt; 5; $i++){
            $product = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; cart\models\Product;
            $product-&amp;gt;setName(&apos;Name product &apos;.$i);
            $product-&amp;gt;setDescription(&apos;Description product &apos;.$i);
            $product-&amp;gt;setCart($cart);
            $cart-&amp;gt;getProducts()-&amp;gt;add($product); &lt;span class=&quot;code-comment&quot;&gt;//Add products in cart
&lt;/span&gt;            $product-&amp;gt;em-&amp;gt;persist($product); &lt;span class=&quot;code-comment&quot;&gt;//Persist Products
&lt;/span&gt;        }

        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            $cart-&amp;gt;em-&amp;gt;persist($cart);
            $cart-&amp;gt;em-&amp;gt;flush();
            $cart-&amp;gt;em-&amp;gt;getConnection()-&amp;gt;commit();
        } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(Exception $e) {
            $cart-&amp;gt;em-&amp;gt;getConnection()-&amp;gt;rollback();
            $cart-&amp;gt;em-&amp;gt;close();
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e;
        }
        die (&apos;success save);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;EchoSQLLogger Cart:&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 NEXTVAL(&apos;cart_id_seq&apos;) INSERT INTO cart (id, description) VALUES (?, ?)

array
  1 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1
  2 =&amp;gt; string &apos;My Cart&apos; (length=7)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;EchoSQLLogger Products( Note that the second interaction forward select nextval was not generated. ) :&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 NEXTVAL(&apos;product_id_seq&apos;) INSERT INTO product (id, name, description, cart_id) VALUES (?, ?, ?, ?)

array
  1 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1
  2 =&amp;gt; string &apos;Name product 0&apos; (length=14)
  3 =&amp;gt; string &apos;Description product 0&apos; (length=21)
  4 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1

INSERT INTO product (id, name, description, cart_id) VALUES (?, ?, ?, ?)

array
  1 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 2
  2 =&amp;gt; string &apos;Name product 1&apos; (length=14)
  3 =&amp;gt; string &apos;Description product 1&apos; (length=21)
  4 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1

INSERT INTO product (id, name, description, cart_id) VALUES (?, ?, ?, ?)

array
  1 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 3
  2 =&amp;gt; string &apos;Name product 2&apos; (length=14)
  3 =&amp;gt; string &apos;Description product 2&apos; (length=21)
  4 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1

INSERT INTO product (id, name, description, cart_id) VALUES (?, ?, ?, ?)

array
  1 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 4
  2 =&amp;gt; string &apos;Name product 3&apos; (length=14)
  3 =&amp;gt; string &apos;Description product 3&apos; (length=21)
  4 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1

INSERT INTO product (id, name, description, cart_id) VALUES (?, ?, ?, ?)

array
  1 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 5
  2 =&amp;gt; string &apos;Name product 4&apos; (length=14)
  3 =&amp;gt; string &apos;Description product 4&apos; (length=21)
  4 =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Entity Cart:&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 cart\models;

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cart&quot;&lt;/span&gt;)
 */
use models\MY_Model,
    Doctrine\Common\Collections\ArrayCollection;


class Cart &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; MY_Model {

    /**
     * @Id
     * @Column(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;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
     * @SequenceGenerator(sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;cart_id_seq&quot;&lt;/span&gt;, initialValue=1, allocationSize=100)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=200, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $description;


    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Product&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;cart&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $products;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
        parent::__construct();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;products = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
    }

    /**
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;
     */
    &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;
    }

    /**
     *
     * @param $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;return&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDescription()
    {
        &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;description;
    }

    /**
     *
     * @param $descricao
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setDescription($description)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;description = $description;
    }

    /**
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getProducts()
    {
        &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;products;
    }

    /**
     *
     * @param $categoria
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setProducts(Products $products)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;products = $products;
    }
}
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Entity Product:&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 cart\models;

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;product&quot;&lt;/span&gt;)
 */
use models\MY_Model,
    Doctrine\Common\Collections\ArrayCollection;

class Product &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; MY_Model {

    /**
     * @Id
     * @Column(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;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
     * @SequenceGenerator(sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;product_id_seq&quot;&lt;/span&gt;, initialValue=1, allocationSize=100)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=100)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;

    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=200)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $description;

   
    /**
     * @link http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#one-to-many-bidirectional
&lt;/span&gt;     *
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Cart&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;product&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cart_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; $cart;


    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct(){
        parent::__construct();
    }

    /**
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;
     */
    &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;
    }

    /**
     *
     * @param $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;return&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; 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;
    }

    /**
     *
     * @param $name
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setName($name)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $name;
    }

    /**
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDescription()
    {
        &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;description;
    }

    /**
     *
     * @param $description
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setDescription($description)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;description = $description;
    }

    /**
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getCart()
    {
        &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;cart;
    }

    /**
     *
     * @param $cart
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setCart(Cart $cart)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cart = $cart;
    }
}
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Attachment application sample&lt;/p&gt;</description>
                <environment></environment>
            <key id="13994">DDC-2001</key>
            <summary>Problem nextval sequence persist many object</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sandrocandido">Sandro C&#226;ndido de Oliveira</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Aug 2012 12:17:06 +0000</created>
                <updated>Sat, 6 Oct 2012 09:23:48 +0000</updated>
                    <resolved>Sat, 6 Oct 2012 09:23:48 +0000</resolved>
                                                            <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18571" author="beberlei" created="Wed, 29 Aug 2012 12:40:55 +0000"  >&lt;p&gt;But the SQL Log correctly shows 1,..,5 in case of the INSERT statements for products. Where is the unique id clash happening?&lt;/p&gt;</comment>
                    <comment id="18572" author="sandrocandido" created="Wed, 29 Aug 2012 12:53:33 +0000"  >&lt;p&gt;It happens that for each insert must have a nextval to generate the unique id. Log in to run the script the first time the insert works but if you run the script again next products are not generated 6 ... 10 of the error occurring.&lt;/p&gt;

&lt;p&gt;PDOException: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23505&amp;#93;&lt;/span&gt;: Unique violation: 7 ERROR: duplicate key value violates unique constraint &quot;product_pkey&quot; DETAIL: Key (id)=(2) already exists. in /var/www/codeigniter/bugcodeigniterdoctrine/application/third_party/doctrine-orm/Doctrine/DBAL/Statement.php on line 131&lt;/p&gt;</comment>
                    <comment id="18587" author="sandrocandido" created="Thu, 30 Aug 2012 12:40:04 +0000"  >&lt;p&gt;Benjamin you could understand the problem now?&lt;/p&gt;</comment>
                    <comment id="18792" author="beberlei" created="Sat, 6 Oct 2012 09:23:48 +0000"  >&lt;p&gt;Its not a bug with Doctrine but your code, your sequence is defined wrong:&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 SEQUENCE product_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you increment by 100, then the sequence has to increment by 100. This is a low level db vendor feature.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11314" name="bugcodeigniterdoctrine.tar.gz" size="2344968" author="sandrocandido" created="Wed, 29 Aug 2012 12:17:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1657] The Doctrine cli tool  does not handle schema correctly.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1657</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;At first time, sorry for my english and I will be short and brief, the problem is clearly explained in the title and the test is very simple.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The entity&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;/**
 * &lt;span class=&quot;code-object&quot;&gt;Short&lt;/span&gt; description.
 *
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Stonewood\Model\Entity\Repository\Screen&quot;&lt;/span&gt;)
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;stonewood.screen&quot;&lt;/span&gt;)
 */
class Screen &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Entity
{

    /**
     * Identifier
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
     *
     * @Id
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&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; $pk;

    /**
     * Title
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;title&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=255, 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; $title;

    /**
     * Path
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;path&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=255, 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; $path;

    /**
     * Register date
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Date
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;ddate&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;date&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; $ddate;

    /**
     * Avatar
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Stonewood\Model\Entity\Avatar
     *
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Stonewood\Model\Entity\Avatar&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk_avatar&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $avatar;

    /**
     *
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($pk = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $title = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $path = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $ddate = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $avatar = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setPk($pk);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTitle($title);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setPath($path);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setDdate($ddate);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setAvatar($avatar);
    }

    [...]

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Before the first deployment&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:schema-tool:update --dump-sql
CREATE TABLE stonewood.screen (pk SERIAL NOT NULL, pk_avatar INT DEFAULT NULL, title VARCHAR(255) NOT NULL, path VARCHAR(255) NOT NULL, ddate DATE NOT NULL, PRIMARY KEY(pk));
CREATE INDEX IDX_D91A7FB3E9032144 ON stonewood.screen (pk_avatar);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;During the first deployement&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:schema-tool:update --force
Updating database schema...
Database schema updated successfully! &lt;span class=&quot;code-quote&quot;&gt;&quot;100&quot;&lt;/span&gt; queries were executed
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;&lt;b&gt;I test the application and all work correctly&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;After this test&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:schema-tool:update --dump-sql
ALTER TABLE screen ADD pk SERIAL NOT NULL;
ALTER TABLE screen ADD pk_avatar INT DEFAULT NULL;
ALTER TABLE screen ADD title VARCHAR(255) NOT NULL;
ALTER TABLE screen ADD path VARCHAR(255) NOT NULL;
ALTER TABLE screen ADD ddate DATE NOT NULL;
ALTER TABLE screen ADD CONSTRAINT FK_D91A7FB3E9032144 FOREIGN KEY (pk_avatar) REFERENCES stonewood.avatar (pk) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
CREATE INDEX IDX_D91A7FB3E9032144 ON screen (pk_avatar);
ALTER TABLE screen ADD PRIMARY KEY (pk);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The result is false. I should see &lt;em&gt;Nothing to update - your database is already in sync with the current entity metadata.&lt;/em&gt;&lt;br/&gt;
In addition, the schema name does not appear, except for foreign key, what must be causing the problem.&lt;/p&gt;</description>
                <environment>Linux Mint Debian Edition, PHP 5.3.10, PostgreSQL 9.1</environment>
            <key id="13460">DDC-1657</key>
            <summary>The Doctrine cli tool  does not handle schema correctly.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="presteus">Presteus</reporter>
                        <labels>
                    </labels>
                <created>Sun, 19 Feb 2012 06:08:47 +0000</created>
                <updated>Sun, 8 Jul 2012 16:22:02 +0000</updated>
                    <resolved>Sun, 8 Jul 2012 16:22:02 +0000</resolved>
                            <version>2.2</version>
                                <fixVersion>2.3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17989" author="beberlei" created="Sun, 27 May 2012 08:42:11 +0000"  >&lt;p&gt;This issue was partially fixed in DBAL already, however it seems there is still a problem with sequence detection.&lt;/p&gt;</comment>
                    <comment id="18245" author="beberlei" created="Sun, 8 Jul 2012 16:22:02 +0000"  >&lt;p&gt;Fixed the sequence problem in 2.3, the other schema problems where indeed fixed in 2.2.1 already.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1651] APC query caching fails when an entity is bound to a query parameter.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1651</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When an entity is bound as a query parameter, query caching with APC fails with error message:&lt;/p&gt;

&lt;p&gt;Catchable fatal error: Object of class XXX could not be converted to string in /libs/doctrine-orm/Doctrine/DBAL/Connection.php on line 1081&lt;/p&gt;

&lt;p&gt;If I bind with entity&apos;s primary key field, everything works fine.&lt;/p&gt;</description>
                <environment>Debian, Php 5.3, APC 3.1.9</environment>
            <key id="13449">DDC-1651</key>
            <summary>APC query caching fails when an entity is bound to a query parameter.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jonathanpete">Jonathan Robinson</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Feb 2012 00:26:30 +0000</created>
                <updated>Sat, 18 Feb 2012 15:13:11 +0000</updated>
                    <resolved>Sat, 18 Feb 2012 15:13:11 +0000</resolved>
                            <version>2.1.6</version>
                                <fixVersion>2.2.1</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17443" author="beberlei" created="Sat, 18 Feb 2012 15:13:11 +0000"  >&lt;p&gt;Fixed and merged into 2.2 branch.&lt;/p&gt;

&lt;p&gt;A rebase onto the 2.1.x branch would take a rewrite, since the code is completly new and since there is a simple workaround ($entity-&amp;gt;getId()) when binding i will not backported it into the 2.1.x branch.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/6cd82d77f5e581b3d21c60c5cb5e6c5042a3ff9b&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/6cd82d77f5e581b3d21c60c5cb5e6c5042a3ff9b&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1644] Using full annotation namespace breaks annotations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1644</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have created my own custom annotations.  They work fine when I use them in a normal class file, but if I try to use them inside of a Doctrine Model class then the base Doctrine annotations don&apos;t work.  My understanding is I have to specify the full namespace for the default Annotations in order for them to work with custom annotations.  However, when I do this I get the dreaded error:&lt;/p&gt;

&lt;p&gt;Uncaught exception &apos;Doctrine\ORM\Mapping\MappingException&apos; with message &apos;Class xxx is not a valid entity or mapped super class.&apos; in /Magnet/winlibrary/doctrine-orm/Doctrine/ORM/Mapping/MappingException.php:142&lt;/p&gt;

&lt;p&gt;In order to test this further I used the quick start documentation and modified it to use full annotation namespaces.  Here is the 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;&amp;lt;?php
require_once &apos;/library/doctrine-orm/Doctrine/Common/&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;.php&apos;;

$loader = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine&quot;&lt;/span&gt;, &apos;/library/doctrine-orm&apos;);
$loader-&amp;gt;register();

use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping as ORM;

/** @ORM\Entity **/
class Post
{
    /** @ORM\Id @GeneratedValue @ORM\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;
    /** @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) **/
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $title;
    /** @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;text&quot;&lt;/span&gt;) **/
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $body;
}

$dbParams = array(
    &apos;driver&apos; =&amp;gt; &apos;pdo_mysql&apos;,
    &apos;user&apos; =&amp;gt; &apos;root&apos;,
    &apos;password&apos; =&amp;gt; &apos;&apos;,
    &apos;dbname&apos; =&amp;gt; &apos;mydb&apos;
);

$config = Setup::createAnnotationMetadataConfiguration(array());
$entityManager = EntityManager::create($dbParams, $config);
$post = $entityManager-&amp;gt;find(&lt;span class=&quot;code-quote&quot;&gt;&quot;Post&quot;&lt;/span&gt;, 555);

print_r($post);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I run this I get the error:&lt;/p&gt;

&lt;p&gt;Uncaught exception &apos;Doctrine\ORM\Mapping\MappingException&apos; with message &apos;Class Post is not a valid entity or mapped super class.&apos; in /Magnet/winlibrary/doctrine-orm/Doctrine/ORM/Mapping/MappingException.php:142&lt;/p&gt;

&lt;p&gt;If I remove the &quot;ORM\&quot; from the annotations and remove &quot;use Doctrine\ORM\Mapping as ORM;&quot; then it works properly.  I can&apos;t seem to find why the full annotation namespaces don&apos;t work properly as I&apos;ve seen a number of examples that do this.&lt;/p&gt;

&lt;p&gt;Also, I noticed that if I specify the full namespace without the &quot;use Doctrine\ORM\Mapping as ORM;&quot; alias (i.e. @Doctrine\ORM\Mapping\Entity) then it works on 2.1.x but does not work on 2.2.0.  Using the ORM alias does not work on either version.  Given I&apos;ve followed the documentation and have found inconsistencies between the versions it seems this is a bug in either the code or the documentation.&lt;/p&gt;
</description>
                <environment>Red Hat Linux - PHP 5.3.8</environment>
            <key id="13431">DDC-1644</key>
            <summary>Using full annotation namespace breaks annotations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jreed">James Reed</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Feb 2012 04:07:36 +0000</created>
                <updated>Fri, 17 Feb 2012 22:32:07 +0000</updated>
                    <resolved>Fri, 17 Feb 2012 22:32:07 +0000</resolved>
                            <version>2.1.6</version>
                <version>2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17438" author="beberlei" created="Fri, 17 Feb 2012 22:32:07 +0000"  >&lt;p&gt;Setup::createAnnotationMetadataDriver().. uses the Simple Annotation Reader.&lt;/p&gt;

&lt;p&gt;You have to setup the &quot;normal&quot; annotation reader with the AnnotationDriver to get &quot;ORM\&quot; working. This could be documented better.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1640] Actual classMetadata is not used when entity with DiscriminatorMap is hydrated, instead AbstractClass metaData is used.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1640</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Because the className changes in ObjectHydrator:226 it might be that the ClassMetadata has not been loaded yet.&lt;br/&gt;
When the classMetadata has not been loaded the PostLoad events are not executed.&lt;/p&gt;

&lt;p&gt;adding the following after the className has changed solves the issue.&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;_getClassMetadata($className);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; Session {
    /**
     * @access &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; ArrayCollection
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;AbstractService&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;session&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $services;
}
&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\HasLifecycleCallbacks
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&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;A&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;ServiceA&quot;&lt;/span&gt;,
 * 		&lt;span class=&quot;code-quote&quot;&gt;&quot;B&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;ServiceB&quot;&lt;/span&gt;
 * })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class AbstractService 
{
    /**
     * @access &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     * @ORM\Column()
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_status;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $status;

    /**
     * @access &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;
     * @internal Do not use; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; is &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; Doctrine only
     * @ORM\PostLoad
     * @&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 _reconstituteValueObjects()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;status = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Status($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_status);
    }
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I would do now:&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 ( $session-&amp;gt;services as $service ) {
    $service-&amp;gt;status-&amp;gt;stop();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$service would be a concrete class ServceA or ServiceB, but these ClassMetadata&apos;s might not be loaded yet. If this is the cause then $service-&amp;gt;status will be null as the @PostLoad has not been executed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13425">DDC-1640</key>
            <summary>Actual classMetadata is not used when entity with DiscriminatorMap is hydrated, instead AbstractClass metaData is used.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jelte@marlon">Jelte Steijaert</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Feb 2012 13:20:50 +0000</created>
                <updated>Fri, 17 Feb 2012 22:29:34 +0000</updated>
                    <resolved>Fri, 17 Feb 2012 22:29:34 +0000</resolved>
                            <version>2.2</version>
                                <fixVersion>2.2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17385" author="jelte@marlon" created="Thu, 9 Feb 2012 13:11:18 +0000"  >&lt;p&gt;I&apos;ve have found the same issue with the SimpleObjectHydrator.&lt;/p&gt;

&lt;p&gt;Although here it might have worse consequences.&lt;br/&gt;
When a row is hydrated it the class has a discriminatorMap, the classMetadata of the defined class (usually the abstract class) is used and not the actual classMetadata of the class it will be converted to.&lt;br/&gt;
Same issue here that the @PostLoad isn&apos;t triggered but also &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;registerManaged($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;class,...) 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;uses the wrong classMetadata is used.&lt;/p&gt;

&lt;p&gt;should be: Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator:86&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;protected&lt;/span&gt; function hydrateRowData(array $sqlResult, array &amp;amp;$cache, array &amp;amp;$result)
    {
        $classMetadata = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;class;
        $entityName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;class-&amp;gt;name;
        $data       = array();

        &lt;span class=&quot;code-comment&quot;&gt;// We need to find the correct entity class name &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we have inheritance in resultset
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($classMetadata-&amp;gt;inheritanceType !== ClassMetadata::INHERITANCE_TYPE_NONE) {
            $discrColumnName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_platform-&amp;gt;getSQLResultCasing($classMetadata-&amp;gt;discriminatorColumn[&apos;name&apos;]);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($sqlResult[$discrColumnName] === &apos;&apos;) {
                &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; HydrationException::emptyDiscriminatorValue(key($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_rsm-&amp;gt;aliasMap));
            }

            $entityName = $classMetadata-&amp;gt;discriminatorMap[$sqlResult[$discrColumnName]];
            $classMetadata = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getClassMetadata($entityName);

            unset($sqlResult[$discrColumnName]);
        }
        foreach ($sqlResult as $column =&amp;gt; $value) {
            &lt;span class=&quot;code-comment&quot;&gt;// Hydrate column information &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; not yet present
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($cache[$column])) {
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (($info = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hydrateColumnInfo($entityName, $column)) === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                    &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
                }

                $cache[$column] = $info;
            }

            &lt;span class=&quot;code-comment&quot;&gt;// Convert field to a valid PHP value
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($cache[$column][&apos;field&apos;])) {
                $type  = Type::getType($cache[$column][&apos;class&apos;]-&amp;gt;fieldMappings[$cache[$column][&apos;name&apos;]][&apos;type&apos;]);
                $value = $type-&amp;gt;convertToPHPValue($value, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_platform);
            }

            &lt;span class=&quot;code-comment&quot;&gt;// Prevent overwrite in &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; of inherit classes using same property name (See AbstractHydrator)
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($cache[$column]) &amp;amp;&amp;amp; ( ! isset($data[$cache[$column][&apos;name&apos;]]) || $value !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)) {
                $data[$cache[$column][&apos;name&apos;]] = $value;
            }
        }

        &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;_hints[Query::HINT_REFRESH_ENTITY])) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;registerManaged($classMetadata, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_hints[Query::HINT_REFRESH_ENTITY], $data);
        }

        $uow    = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getUnitOfWork();
        $entity = $uow-&amp;gt;createEntity($entityName, $data, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_hints);

        &lt;span class=&quot;code-comment&quot;&gt;//TODO: These should be invoked later, after hydration, because associations may not yet be loaded here.
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($classMetadata-&amp;gt;lifecycleCallbacks[Events::postLoad])) {
            $classMetadata-&amp;gt;invokeLifecycleCallbacks(Events::postLoad, $entity);
        }

        $evm = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getEventManager();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($evm-&amp;gt;hasListeners(Events::postLoad)) {
            $evm-&amp;gt;dispatchEvent(Events::postLoad, &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; LifecycleEventArgs($entity, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em));
        }

        $result[] = $entity;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="17386" author="jelte@marlon" created="Thu, 9 Feb 2012 13:14:12 +0000"  >&lt;p&gt;Changed summery to better reflect the bug.&lt;/p&gt;</comment>
                    <comment id="17436" author="beberlei" created="Fri, 17 Feb 2012 22:29:34 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1638] Inexistant method newInstance in UnitOfWork</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1638</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;the UnitOfWork uses ``newInstance`` to get the managed copy but this method does not exist in 2.1.6, thus breaking the code: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/e1647229cd2544bd77f10620e1b95a5781c4a733/lib/Doctrine/ORM/UnitOfWork.php#L1418&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/e1647229cd2544bd77f10620e1b95a5781c4a733/lib/Doctrine/ORM/UnitOfWork.php#L1418&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is probably an error when backporting a patch as the method exists in master&lt;/p&gt;</description>
                <environment></environment>
            <key id="13423">DDC-1638</key>
            <summary>Inexistant method newInstance in UnitOfWork</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Feb 2012 13:26:46 +0000</created>
                <updated>Fri, 10 Feb 2012 19:49:21 +0000</updated>
                    <resolved>Fri, 10 Feb 2012 19:49:21 +0000</resolved>
                            <version>2.1.6</version>
                                <fixVersion>2.1.7</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17376" author="ocramius" created="Tue, 7 Feb 2012 13:43:40 +0000"  >&lt;p&gt;Patch at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/276&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/276&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17398" author="beberlei" created="Fri, 10 Feb 2012 19:49:21 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1636] JoinColumn with name the same as id generates wrong SQL.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1636</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Issue came from Hussani de Oliveira on MSN.&lt;br/&gt;
He has this Entities configuration:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Usuario.php&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;&amp;lt;?php
 
namespace App\UsuariosBundle\Entity;
 
use Doctrine\ORM\Mapping as ORM;
 
/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;usuarios&quot;&lt;/span&gt;)
 */
class Usuario
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
     *
     * @ORM\Id
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;usuarios_id&quot;&lt;/span&gt;, 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;var&lt;/span&gt; string
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;nome&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=45)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $nome;
   
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;PerfilUsuario&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;perfil_usuarios_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;perfil_usuarios_id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $perfil;
   
    &lt;span class=&quot;code-comment&quot;&gt;// getters and setters
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;&lt;b&gt;PerfilUsuario.php&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;&amp;lt;?php
 
namespace App\UsuariosBundle\Entity;
 
use Doctrine\ORM\Mapping as ORM;
 
/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;perfil_usuarios&quot;&lt;/span&gt;)
 */
class PerfilUsuario
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
     * @ORM\Id
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;perfil_usuarios_id&quot;&lt;/span&gt;, 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;Secoes&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;protected&lt;/span&gt; $secoes;
   
    &lt;span class=&quot;code-comment&quot;&gt;// getters and setters
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Whenever he tries to load User (Usuario) and automatically join the UserProfle (PerfilUsuario), it generates the wrong 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 
    t0.usuarios_id AS usuarios_id1, 
    t0.nome AS nome2, 
    t0.email AS email3,
    t0.login AS login4,
    t0.senha AS senha5,
    t0.cargo AS cargo6,
    t0.perfil_usuarios_id AS perfil_usuarios_id7,
    t8.perfil_usuarios_id AS perfil_usuarios_id9,
    t8.secoes_id AS secoes_id10 
FROM usuarios t0 
LEFT JOIN perfil_usuarios t8 
  ON t0.perfil_usuarios_id = t11.perfil_usuarios_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;His schema dump:&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;SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=&apos;TRADITIONAL&apos;;
 
CREATE SCHEMA IF NOT EXISTS `aquario` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
USE `aquario` ;
 
-- -----------------------------------------------------
-- Table `aquario`.`perfil_usuarios`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `aquario`.`perfil_usuarios` (
  `perfil_usuarios_id` INT(11) NOT NULL ,
  `nome` VARCHAR(45) CHARACTER SET &apos;utf8&apos; COLLATE &apos;utf8_unicode_ci&apos; NULL DEFAULT NULL ,
  PRIMARY KEY (`perfil_usuarios_id`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
 
 
-- -----------------------------------------------------
-- Table `aquario`.`usuarios`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `aquario`.`usuarios` (
  `usuarios_id` INT(11) NOT NULL ,
  `perfil_usuarios_id` INT(11) NULL DEFAULT NULL ,
  `nome` VARCHAR(45) CHARACTER SET &apos;utf8&apos; COLLATE &apos;utf8_unicode_ci&apos; NULL DEFAULT NULL ,
  `email` VARCHAR(100) CHARACTER SET &apos;utf8&apos; COLLATE &apos;utf8_unicode_ci&apos; NULL DEFAULT NULL ,
  `login` VARCHAR(45) CHARACTER SET &apos;utf8&apos; COLLATE &apos;utf8_unicode_ci&apos; NULL DEFAULT NULL ,
  `senha` VARCHAR(45) CHARACTER SET &apos;utf8&apos; COLLATE &apos;utf8_unicode_ci&apos; NULL DEFAULT NULL ,
  `cargo` VARCHAR(45) CHARACTER SET &apos;utf8&apos; COLLATE &apos;utf8_unicode_ci&apos; NULL DEFAULT NULL ,
  PRIMARY KEY (`usuarios_id`) ,
  INDEX `FK_PERIFIL_USUARIOS_PERFIL_USUARIOSID_PERFIL_USUARIOS` (`perfil_usuarios_id` ASC) ,
  CONSTRAINT `FK_PERIFIL_USUARIOS_PERFIL_USUARIOSID_PERFIL_USUARIOS`
    FOREIGN KEY (`perfil_usuarios_id` )
    REFERENCES `aquario`.`perfil_usuarios` (`perfil_usuarios_id` ))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13420">DDC-1636</key>
            <summary>JoinColumn with name the same as id generates wrong SQL.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Feb 2012 18:22:44 +0000</created>
                <updated>Sat, 7 Apr 2012 07:27:04 +0000</updated>
                    <resolved>Sat, 7 Apr 2012 07:27:04 +0000</resolved>
                            <version>2.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17407" author="fabio.bat.silva" created="Sat, 11 Feb 2012 01:24:07 +0000"  >&lt;p&gt;Hi,&lt;br/&gt;
I&apos;m trying to test this, But I can&apos;t reproduce.&lt;br/&gt;
I&apos;m attaching a test case.&lt;/p&gt;

&lt;p&gt;Hussani Oliveira , &lt;br/&gt;
Can you try to change the test to make it fail ?&lt;/p&gt;</comment>
                    <comment id="17822" author="beberlei" created="Sat, 7 Apr 2012 07:27:04 +0000"  >&lt;p&gt;No feedback was given on this critical issue with proof of working through TestCase. Closing until further feedback.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11159" name="DDC1636Test.php" size="2459" author="fabio.bat.silva" created="Sat, 11 Feb 2012 01:24:07 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1635] Single Table Inheritance and a composite key gives the wrong entity when using the IdentityMap</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1635</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given the following data, a single table inheritance with &apos;type&apos; being the discriminator column and a composite key of (type, key, foreign):&lt;/p&gt;

&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;type&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;key&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;foreign&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;type-1&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;key-1&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;xyz&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;type-2&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;key-1&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;xyz&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;p&gt;As Doctrine only takes the columns &apos;key&apos; and &apos;foreign&apos; into the composite key, it gives me an instance of the class being mapped to &apos;type-1&apos; when wanting to select an instance of &apos;type-2&apos; with key=key-1 &amp;amp;&amp;amp; foreign=xyz. BUT this only occurs when i already fetched the instance mapped to type-1 with the same values.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13418">DDC-1635</key>
            <summary>Single Table Inheritance and a composite key gives the wrong entity when using the IdentityMap</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="h-andreas">Andreas H&#246;rnicke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Feb 2012 11:38:00 +0000</created>
                <updated>Mon, 20 Feb 2012 08:19:51 +0000</updated>
                    <resolved>Sat, 18 Feb 2012 13:50:31 +0000</resolved>
                            <version>2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17400" author="beberlei" created="Fri, 10 Feb 2012 20:31:21 +0000"  >&lt;p&gt;The type can never be part of the primary key, how did you even map that? can you post details?&lt;/p&gt;</comment>
                    <comment id="17423" author="h-andreas" created="Tue, 14 Feb 2012 05:37:19 +0000"  >&lt;p&gt;I did not specified type as being part of the primary key ... for obvious reasons. I didnt even thought of it being necessary as this is the only time we are using single table inheritance.&lt;/p&gt;

&lt;p&gt;This is an abstracted version of our domain model:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;sql definition&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE `users` (
	`id` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
	`mail` VARCHAR(255) NULL DEFAULT NULL,
	`passwd` VARCHAR(255) NULL DEFAULT NULL,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB;

CREATE TABLE `tasks` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`f_user` MEDIUMINT(8) UNSIGNED NULL DEFAULT NULL,
	`priority` SMALLINT(5) UNSIGNED NOT NULL,
	`some_other_column` VARCHAR(255) NULL DEFAULT NULL,
	PRIMARY KEY (`id`),
	CONSTRAINT `fk_tasks_user` FOREIGN KEY (`f_user`) REFERENCES `users` (`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB;

CREATE TABLE `attributes` (
	`key` VARCHAR(50) NOT NULL,
	`name` VARCHAR(255) NOT NULL,
	PRIMARY KEY (`key`)
) ENGINE=InnoDB;

CREATE TABLE `attributes_rel` (
	`type` ENUM(&apos;task&apos;,&apos;user&apos;) NOT NULL,
	`foreign_id` BIGINT(20) UNSIGNED NOT NULL,
	`f_attribute` VARCHAR(50) NOT NULL,
	`value_int` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
	`value_date` DATETIME NULL DEFAULT NULL,
	`value_text` TEXT NULL,
	PRIMARY KEY (`type`, `foreign_id`, `f_attribute`),
	CONSTRAINT `fk_attributes_rel_attribute` FOREIGN KEY (`f_attribute`) REFERENCES `attributes` (`key`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB;

INSERT INTO `attributes` (`key`, `name`) VALUES
  (&apos;description&apos;, &apos;description&apos;);

INSERT INTO `users` (`id`, `mail`, `passwd`) VALUES
  (1, &apos;abc@def.xyz&apos;, &apos;e10adc3949ba59abbe56e057f20f883e&apos;);

INSERT INTO `tasks` (`id`, `f_user`, `priority`, `some_other_column`) VALUES
  (1, 1, 1, &apos;nothing in here&apos;);

INSERT INTO `attributes_rel` (`type`, `foreign_id`, `f_attribute`, `value_int`, `value_date`, `value_text`) VALUES
  (&apos;task&apos;, 1, &apos;description&apos;, NULL, NULL, &apos;catchy description &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; a task&apos;),
  (&apos;user&apos;, 1, &apos;description&apos;, NULL, NULL, &apos;catchy description &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; a user&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;&lt;span class=&quot;code-comment&quot;&gt;// definition wihin task model
&lt;/span&gt;/**
 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection
 *
 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;TaskAttribute&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;foreign&quot;&lt;/span&gt;)
 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foreign&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; $attributes;

&lt;span class=&quot;code-comment&quot;&gt;// definition wihin user model
&lt;/span&gt;/**
 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection
 *
 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserAttribute&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;foreign&quot;&lt;/span&gt;)
 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foreign&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; $attributes;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When calling &lt;tt&gt;$em-&amp;gt;find(&apos;Task&apos;, 1)&lt;del&gt;&amp;gt;getAttributes()&lt;/tt&gt; and then doing &lt;tt&gt;$em&lt;/del&gt;&amp;gt;find(&apos;User&apos;, 1)-&amp;gt;getAttributes()&lt;/tt&gt; it gives me an instance of TaskAttribute for the user instead of a fresh UserAttribute.&lt;/p&gt;</comment>
                    <comment id="17442" author="beberlei" created="Sat, 18 Feb 2012 13:50:31 +0000"  >&lt;p&gt;To have type part of the primary key you have to map it as field. Discrimnator columns can never be part of the PK for doctrine, even if they are in the database.&lt;/p&gt;

&lt;p&gt;You can change your domain model to 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 Attribute
{
   /** @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;public&lt;/span&gt; $type;
   /** @Id @ManyToOne(target=&lt;span class=&quot;code-quote&quot;&gt;&quot;Foreign&quot;&lt;/span&gt;) */
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $foreign;
   /** @id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $key;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="17445" author="h-andreas" created="Mon, 20 Feb 2012 07:01:06 +0000"  >&lt;p&gt;But then i cant use table inheritance.&lt;/p&gt;</comment>
                    <comment id="17446" author="beberlei" created="Mon, 20 Feb 2012 08:19:51 +0000"  >&lt;p&gt;Yes, you can&apos;t in your scenario, its just not supported with the discriminator column in it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1632] one-to-many associations with fetch mode eager using too many SQL queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1632</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am loading a list of many entities.&lt;br/&gt;
These entities have a one-to-many association to other entities.&lt;br/&gt;
These other entities should be loaded in one single SQL query (instead of one query for every entity in the first list).&lt;/p&gt;

&lt;p&gt;As discribed in the doctrine2 documentation: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql&lt;/a&gt; this should be possible with &quot;EAGER&quot; loading.&lt;/p&gt;

&lt;p&gt;but it does not work as described.&lt;/p&gt;

&lt;p&gt;my 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;class User{
    /**
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Address&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&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;protected&lt;/span&gt; $addresses;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct(){
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addresses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
    }
}

class Address{
    /**
     * @ORM\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;addresses&quot;&lt;/span&gt;)
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserId&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; $user;
}

class UserRepository{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function findUsersWithAddresses(){
        &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;getEntityManager()
            -&amp;gt;createQuery(&apos;SELECT u FROM MyBundle:User u ORDER BY u.name ASC&apos;)
            -&amp;gt;setFetchMode(&apos;MyBundle\Entity\User&apos;, &apos;addresses&apos;, \Doctrine\ORM\Mapping\ClassMetadata::FETCH_EAGER)
            -&amp;gt;setMaxResults(10)
            -&amp;gt;getResult();
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The method UserRepository::findUsersWithAddresses() executes 11 SQL Queries instead of 2 SQL Queries.&lt;/p&gt;

&lt;p&gt;I am using:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;symfony v2.0.9&lt;/li&gt;
	&lt;li&gt;doctrine-common 2.1.4&lt;/li&gt;
	&lt;li&gt;doctrine-dbal 2.1.5&lt;/li&gt;
	&lt;li&gt;doctrine 2.1.5&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="13407">DDC-1632</key>
            <summary>one-to-many associations with fetch mode eager using too many SQL queries</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ausi">Martin</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Feb 2012 09:49:32 +0000</created>
                <updated>Fri, 10 Feb 2012 16:51:04 +0000</updated>
                    <resolved>Thu, 9 Feb 2012 21:01:26 +0000</resolved>
                            <version>2.1.5</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17372" author="beberlei" created="Mon, 6 Feb 2012 18:04:35 +0000"  >&lt;p&gt;Increased priority&lt;/p&gt;</comment>
                    <comment id="17382" author="ausi" created="Thu, 9 Feb 2012 08:54:03 +0000"  >&lt;p&gt;there is also a question on stackoverflow about this issue: &lt;a href=&quot;http://stackoverflow.com/questions/9020433/doctrine2-loads-one-to-many-associations-with-fetch-mode-eager-using-too-many-sq&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/9020433/doctrine2-loads-one-to-many-associations-with-fetch-mode-eager-using-too-many-sq&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17390" author="beberlei" created="Thu, 9 Feb 2012 21:01:26 +0000"  >&lt;p&gt;Its not a bug, its just a feature we haven&apos;t implemented yet.&lt;/p&gt;

&lt;p&gt;There is a ticket for it&lt;/p&gt;</comment>
                    <comment id="17394" author="ausi" created="Fri, 10 Feb 2012 16:51:04 +0000"  >&lt;p&gt;Sorry, I didn&apos;t found the ticket before I reported this issue.&lt;br/&gt;
now i found 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;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1149&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1149&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would be very great to have this feature in a future version of doctrine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1598] ProxyFactory makes assumptions on identifier getter code</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1598</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As of &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L214&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L214&lt;/a&gt;&lt;br/&gt;
and&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L237&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L237&lt;/a&gt;&lt;br/&gt;
the current ProxyFactory isn&apos;t actually checking if the identifier getter has logic in it.&lt;br/&gt;
Current checks aren&apos;t enough/valid.&lt;/p&gt;

&lt;p&gt;In my opinion the check should be matching following:&lt;/p&gt;

&lt;p&gt;(public|protected)\s+function\s+getFieldname\s*&amp;#40;\s*&amp;#41;\s+&lt;/p&gt;
{\s*\$this\s*-&amp;gt;Fieldname\s*;\s*}

&lt;p&gt;Not really experienced with regex, but currently cannot come up with a more secure check.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13356">DDC-1598</key>
            <summary>ProxyFactory makes assumptions on identifier getter code</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Jan 2012 17:28:03 +0000</created>
                <updated>Mon, 16 Jan 2012 09:56:15 +0000</updated>
                    <resolved>Mon, 16 Jan 2012 08:28:11 +0000</resolved>
                            <version>2.0</version>
                <version>2.0.1</version>
                <version>2.0.2</version>
                <version>2.0.3</version>
                <version>2.0.4</version>
                <version>2.0.5</version>
                <version>2.0.6</version>
                <version>2.0.7</version>
                <version>2.1</version>
                <version>2.1.1</version>
                <version>2.1.2</version>
                <version>2.1.3</version>
                <version>2.1.4</version>
                <version>2.1.5</version>
                <version>2.2-BETA1</version>
                <version>2.2-BETA2</version>
                <version>Git Master</version>
                                <fixVersion>2.2</fixVersion>
                <fixVersion>2.3</fixVersion>
                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17247" author="beberlei" created="Sun, 15 Jan 2012 11:19:31 +0000"  >&lt;p&gt;Can you explain why you think this is necessary?&lt;/p&gt;

&lt;p&gt;You are right an id method with logic could exist in 4 lines of code, but for what purpose? &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="17250" author="ocramius" created="Sun, 15 Jan 2012 12:40:31 +0000"  >&lt;p&gt;First of all it is a question of concept. Doctrine &lt;b&gt;shouldn&apos;t&lt;/b&gt; assume anything about entities outside of their fields. It already introduces a level of complication when we explain how to clone/serialize objects, which was very confusing.&lt;/p&gt;

&lt;p&gt;Asking for the purpose of an identifier field getter method is in my opinion again an attempt of making assumptions over user&apos;s code...&lt;/p&gt;

&lt;p&gt;What if the user wrote something like:&lt;/p&gt;

&lt;p&gt;public function getIdentifierField1()&lt;br/&gt;
 {&lt;br/&gt;
    return $this-&amp;gt;identifierField1? $this-&amp;gt;_myInitializationStuff() : null;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;private function _myInitializationStuff() &lt;br/&gt;
{&lt;br/&gt;
    //open files, check stuff, make things difficult for the D2 team &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.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;
}&lt;/p&gt;

&lt;p&gt;For instance, opening file handlers, sockets, whatever... This is a case that would break the entity because of optimization introduced by the ProxyFactory. (not to mention when getIdentifierField1 does some conversion, like return $this-&amp;gt;identifierField1 + self::OFFSET_REQUIRED_BY_WEBSERVICE;&lt;/p&gt;

&lt;p&gt;I&apos;m not arguing about the validity of this optimization, but that the checks are too lazy.&lt;/p&gt;

&lt;p&gt;I&apos;ve read something about moving the ProxyFactory to common and using code scanner tools, and the check should be about applying the optimization only when the form is&lt;/p&gt;

&lt;p&gt;return $this-&amp;gt;identifierField1;&lt;/p&gt;

&lt;p&gt;That&apos;s why I put the example of the regex. That would probably not be as safe as using some reflection-based tool, but surely more than just checking if the code is &amp;lt;= 4 lines...&lt;/p&gt;</comment>
                    <comment id="17251" author="ocramius" created="Sun, 15 Jan 2012 13:03:58 +0000"  >&lt;p&gt;Also don&apos;t know what stuff like EAccelerator (known in this Jira as of it&apos;s fantastic idea about stripping comments) would make the check of the 4 lines like.&lt;/p&gt;</comment>
                    <comment id="17280" author="beberlei" created="Mon, 16 Jan 2012 08:28:03 +0000"  >&lt;p&gt;This argument is void i just seen&lt;/p&gt;

&lt;p&gt;A method:&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 getIdentifierField1()
{
   &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;identifierField1? $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_myInitializationStuff() : &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
} 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will only used when the id is not set anyways.&lt;/p&gt;

&lt;p&gt;In any other case Ids are Immutable and changing them in your code would break a lot more than just this smart proxy method generation.&lt;/p&gt;</comment>
                    <comment id="17283" author="ocramius" created="Mon, 16 Jan 2012 09:28:51 +0000"  >&lt;p&gt;Nope, this code actually works only if the ID &lt;b&gt;is&lt;/b&gt; set &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;br/&gt;
I&apos;m not talking about changing IDs, it&apos;s just that getters and setters don&apos;t always reflect the class attributes...&lt;/p&gt;</comment>
                    <comment id="17284" author="ocramius" created="Mon, 16 Jan 2012 09:56:15 +0000"  >&lt;p&gt;As of IRC there&apos;s 3 ways (for now) to get this solved:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Some code scanner/stronger checks (difficult/problems with private methods/slow)&lt;/li&gt;
	&lt;li&gt;Regex (as of description)&lt;/li&gt;
	&lt;li&gt;Adding configuration (per-entity or per-method. Probably too messy)&lt;/li&gt;
	&lt;li&gt;Documenting it as &quot;magic&quot; of proxies and let the users be aware of it&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1568] A better quality control??</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1568</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;h1&gt;&lt;a name=&quot;Theproblem&quot;&gt;&lt;/a&gt;The problem&lt;/h1&gt;

&lt;p&gt;I love doctrine, but I think you should control quality of your releases better.&lt;br/&gt;
Issues like this one - &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1504&quot; title=&quot;Cascade remove in OneToMany relation doesn&amp;#39;t work&quot;&gt;&lt;del&gt;DDC-1504&lt;/del&gt;&lt;/a&gt; makes doctrine smell bad.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13313">DDC-1568</key>
            <summary>A better quality control??</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="entea">Nurlan Turdaliev</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Dec 2011 14:30:10 +0000</created>
                <updated>Tue, 27 Dec 2011 15:43:36 +0000</updated>
                    <resolved>Tue, 27 Dec 2011 15:43:36 +0000</resolved>
                            <version>2.1.5</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17108" author="entea" created="Tue, 27 Dec 2011 15:43:36 +0000"  >&lt;p&gt;Hey guys, sorry for this ticket &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;br/&gt;
I&apos;ve checkouted doctrine tests, looked through &apos;em.&lt;br/&gt;
They are thorough and good.&lt;br/&gt;
The issue I linked in ticket happens because of misuse &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-1548] One to one entity badly populated</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1548</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;One to one entity over populated&lt;/p&gt;</description>
                <environment>ubuntu php 5.3.8</environment>
            <key id="13283">DDC-1548</key>
            <summary>One to one entity badly populated</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="goetas">Asmir Mustafic</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Dec 2011 09:09:58 +0000</created>
                <updated>Mon, 19 Dec 2011 18:33:46 +0000</updated>
                    <resolved>Mon, 19 Dec 2011 15:55:15 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.5</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17042" author="goetas" created="Mon, 19 Dec 2011 09:14:31 +0000"  >&lt;p&gt;I have created a test. &lt;/p&gt;

&lt;p&gt;the bug may be in \Doctrine\ORM\Internal\Hydration\AbstractHydrator at line 246.&lt;/p&gt;

&lt;p&gt;i think...&lt;/p&gt;

&lt;p&gt;remove &lt;br/&gt;
if ( ! isset($rowData&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt;[$cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;]) || $value !== null) {&lt;/p&gt;

&lt;p&gt;and replace with :&lt;/p&gt;

&lt;p&gt;if ( ! isset($rowData&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt;[$cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;]) &amp;amp;&amp;amp; $value !== null) {&lt;/p&gt;

&lt;p&gt;this will fix the bug&lt;/p&gt;</comment>
                    <comment id="17048" author="guilhermeblanco" created="Mon, 19 Dec 2011 15:55:15 +0000"  >&lt;p&gt;Fixed since this commit: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/68663fac4b5619643b8a140d6bbe7031e4fa2ad5&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/68663fac4b5619643b8a140d6bbe7031e4fa2ad5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks a lot for the report and patch! =D&lt;/p&gt;</comment>
                    <comment id="17055" author="beberlei" created="Mon, 19 Dec 2011 18:33:46 +0000"  >&lt;p&gt;Update fix version, this was merged into 2.1.5&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11132" name="1548.php" size="1491" author="goetas" created="Mon, 19 Dec 2011 09:11:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1545] Update on loaded association not detected upon flush()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1545</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If an association is joined during fetching and then updated in-memory, the update is not detected during flushing. I made the following test cases:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Association is joined:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;change NULL &#8594; entity: &lt;b&gt;does not work&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;change entity &#8594; NULL: works&lt;/li&gt;
	&lt;li&gt;change entity1 &#8594;  entity2: &lt;b&gt;does not work&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Assocation is not joined:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;change NULL &#8594; entity: works&lt;/li&gt;
	&lt;li&gt;change entity &#8594; NULL: works&lt;/li&gt;
	&lt;li&gt;change entity1 &#8594;  entity2: works&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="13279">DDC-1545</key>
            <summary>Update on loaded association not detected upon flush()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="bschussek">Bernhard Schussek</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Dec 2011 11:13:02 +0000</created>
                <updated>Mon, 19 Dec 2011 18:33:30 +0000</updated>
                    <resolved>Mon, 19 Dec 2011 06:40:49 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.5</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17023" author="bschussek" created="Sun, 18 Dec 2011 11:20:05 +0000"  >&lt;p&gt;See here for the test case: &lt;a href=&quot;https://github.com/bschussek/doctrine-orm/tree/DDC-1545&quot; class=&quot;external-link&quot;&gt;https://github.com/bschussek/doctrine-orm/tree/DDC-1545&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17036" author="guilhermeblanco" created="Mon, 19 Dec 2011 05:23:06 +0000"  >&lt;p&gt;Increasing priority&lt;/p&gt;</comment>
                    <comment id="17037" author="guilhermeblanco" created="Mon, 19 Dec 2011 06:40:49 +0000"  >&lt;p&gt;Issue fixed since this commit:&lt;/p&gt;

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

&lt;p&gt;Thanks a lot for the bug reporting. It was the second time someone reported me this issue and I could not reproduce! =)&lt;/p&gt;</comment>
                    <comment id="17043" author="beberlei" created="Mon, 19 Dec 2011 10:44:04 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-229&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/229&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/229&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17044" author="beberlei" created="Mon, 19 Dec 2011 11:23:04 +0000"  >&lt;p&gt;Related Pull Request was closed: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/229&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/229&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17051" author="beberlei" created="Mon, 19 Dec 2011 17:09:48 +0000"  >&lt;p&gt;Fixed properly now. Will be merged into 2.1.x&lt;/p&gt;</comment>
                    <comment id="17054" author="beberlei" created="Mon, 19 Dec 2011 18:33:30 +0000"  >&lt;p&gt;Update fix version, this was merged into 2.1.5&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1535] Association method createEntity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1535</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;File: ORM/UnitOfWork.php&lt;br/&gt;
Method: function createEntity  &lt;/p&gt;

&lt;p&gt;within the&lt;br/&gt;
if ($assoc &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;inversedBy&amp;#39;&amp;#93;&lt;/span&gt; &amp;amp;&amp;amp; $assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt; &amp;amp; ClassMetadata:ONE_TO_ONE) {&lt;/p&gt;

&lt;p&gt;The excerpt below is thus&lt;br/&gt;
$targetClass-&amp;gt;reflFields[$inverseAssoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;]-&amp;gt;setValue($newValue, $entity);&lt;/p&gt;

&lt;p&gt;And should be well&lt;br/&gt;
$targetClass-&amp;gt;reflFields[$inverseAssoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;]-&amp;gt;setValue ($entity, $newValue);&lt;/p&gt;</description>
                <environment>php 5.3.8</environment>
            <key id="13260">DDC-1535</key>
            <summary>Association method createEntity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ardemiranda">Andr&#233; Ribeiro de Miranda</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Dec 2011 19:07:59 +0000</created>
                <updated>Thu, 15 Dec 2011 19:15:19 +0000</updated>
                    <resolved>Thu, 15 Dec 2011 19:15:19 +0000</resolved>
                            <version>2.1.4</version>
                <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16984" author="guilhermeblanco" created="Wed, 14 Dec 2011 04:48:01 +0000"  >&lt;p&gt;Are you experiencing any type of issues with this?&lt;br/&gt;
If positive, please share your models and the script that this issue is happening.&lt;/p&gt;

&lt;p&gt;This specific line does the inverse side association assignment of newly created node. I don&apos;t see anything wrong with that line.&lt;/p&gt;</comment>
                    <comment id="16993" author="beberlei" created="Thu, 15 Dec 2011 19:15:19 +0000"  >&lt;p&gt;This code is valid. It sets the other side of an association on a bidirectional one to one.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1526] Unecessary queries with LEFT JOIN</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1526</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;After upgrading to 2.1.4 (from 2.1.2), the following dql started creating way more queries than necessary :&lt;br/&gt;
SELECT m, p, s, c, o&lt;br/&gt;
FROM FERMainBundle:Menu m&lt;br/&gt;
LEFT JOIN m.page p&lt;br/&gt;
LEFT JOIN m.section s&lt;br/&gt;
LEFT JOIN m.children c&lt;br/&gt;
LEFT JOIN s.position o&lt;br/&gt;
ORDER BY m.lft&lt;/p&gt;

&lt;p&gt;Details to the code here:&lt;br/&gt;
&lt;a href=&quot;http://pastie.textmate.org/private/z9gtgqe1odwenxcmudywqa&quot; class=&quot;external-link&quot;&gt;http://pastie.textmate.org/private/z9gtgqe1odwenxcmudywqa&lt;/a&gt;&lt;br/&gt;
The model looks like that:&lt;br/&gt;
&lt;a href=&quot;http://pastie.textmate.org/private/przxzfimsfyua02cxqcv9a&quot; class=&quot;external-link&quot;&gt;http://pastie.textmate.org/private/przxzfimsfyua02cxqcv9a&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://pastie.textmate.org/private/ob1jqiekv89e4xj9bq06q&quot; class=&quot;external-link&quot;&gt;http://pastie.textmate.org/private/ob1jqiekv89e4xj9bq06q&lt;/a&gt;&lt;br/&gt;
First query is executed, it should in fact retrieve everything there is about the menu, but then it runs the second query for every menu element I have, generating a lot of queries that didn&apos;t occur before.&lt;/p&gt;</description>
                <environment>PHP 5.3.6</environment>
            <key id="13250">DDC-1526</key>
            <summary>Unecessary queries with LEFT JOIN</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nenuial">Pascal Burkhard</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Dec 2011 19:22:23 +0000</created>
                <updated>Tue, 23 Oct 2012 11:41:45 +0000</updated>
                    <resolved>Sat, 28 Jan 2012 11:28:38 +0000</resolved>
                            <version>2.1.4</version>
                                <fixVersion>2.1.6</fixVersion>
                <fixVersion>2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16997" author="beberlei" created="Thu, 15 Dec 2011 20:04:07 +0000"  >&lt;p&gt;Can you profile where exactly the extra queries are executed using xdebug_start_trace? Directly during hydration or later in your code?&lt;/p&gt;</comment>
                    <comment id="17053" author="nenuial" created="Mon, 19 Dec 2011 18:22:40 +0000"  >&lt;p&gt;xdebug trace start just before I query the database&lt;/p&gt;</comment>
                    <comment id="17062" author="beberlei" created="Tue, 20 Dec 2011 07:54:28 +0000"  >&lt;p&gt;Hi Pascal, sorry but this is not enough. I need this query until all the other entities (or at least one) are n+1 joined.&lt;/p&gt;</comment>
                    <comment id="17063" author="nenuial" created="Tue, 20 Dec 2011 11:30:21 +0000"  >&lt;p&gt;Here the complete trace, started just before the first query. I&apos;m sorry but I can&apos;t make heads or tails with that... I hope it can help you pinpoint the problem.&lt;/p&gt;

&lt;p&gt;Please also note that I have update Doctrine ORM to 2.1.5 and there was a change in the number of &quot;superfluous&quot; queries done. I am now only left with additional queries to get the relations to &quot;parent&quot;, cf the model ( &lt;a href=&quot;http://pastie.textmate.org/private/przxzfimsfyua02cxqcv9a&quot; class=&quot;external-link&quot;&gt;http://pastie.textmate.org/private/przxzfimsfyua02cxqcv9a&lt;/a&gt; ).&lt;/p&gt;</comment>
                    <comment id="17132" author="beberlei" created="Wed, 28 Dec 2011 19:41:49 +0000"  >&lt;p&gt;Is the trace from before upgrade to 2.1.5 or after?&lt;/p&gt;</comment>
                    <comment id="17133" author="nenuial" created="Wed, 28 Dec 2011 19:44:45 +0000"  >&lt;p&gt;The &quot;complete&quot; trace, i.e. the one that is 5.94 mb big is from after the upgrade to 2.1.5.&lt;/p&gt;</comment>
                    <comment id="17143" author="beberlei" created="Thu, 29 Dec 2011 15:32:02 +0000"  >&lt;p&gt;Can you disable the nested set extension? the other ticket uses it too and i want to rule out that its the extensions fault. &lt;/p&gt;</comment>
                    <comment id="17149" author="nenuial" created="Thu, 29 Dec 2011 22:14:24 +0000"  >&lt;p&gt;Alright. I deactivated the Tree extension, but there are no changes in the number of queries.&lt;/p&gt;</comment>
                    <comment id="17348" author="beberlei" created="Sat, 28 Jan 2012 11:19:12 +0000"  >&lt;p&gt;I found the issue.&lt;/p&gt;</comment>
                    <comment id="17349" author="beberlei" created="Sat, 28 Jan 2012 11:28:38 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="13320">DDC-1573</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="11134" name="trace.txt" size="6229522" author="nenuial" created="Tue, 20 Dec 2011 11:30:21 +0000" />
                    <attachment id="11133" name="trace.txt" size="40737" author="nenuial" created="Mon, 19 Dec 2011 18:22:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1533] ResultSetMap don&apos;t work with aliases when using joined entites</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1533</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using entityNamespace and ResultSetMapping with joined entites you get hydration error.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
EntityNamespace is set to &quot;Project\Model&quot;&lt;/p&gt;

&lt;p&gt;I have result set mapping:&lt;br/&gt;
-&amp;gt;addEntityResult(&apos;:Entity&apos;, &apos;e&apos;)&lt;br/&gt;
-&amp;gt;addJoinedEntityResult(&apos;:OtherEntity&apos;, &apos;oe&apos;, &apos;e&apos;, &apos;other&apos;)&lt;/p&gt;

&lt;p&gt;you will get error:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Notice: Undefined index: Projet\Model\OtherEntity in Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 371&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;solution is to use full names for entites:&lt;br/&gt;
-&amp;gt;addEntityResult(&apos;Project\Model\Entity&apos;, &apos;e&apos;)&lt;br/&gt;
-&amp;gt;addJoinedEntityResult(&apos;Project\Model\OtherEntity&apos;, &apos;oe&apos;, &apos;e&apos;, &apos;other&apos;)&lt;/p&gt;</description>
                <environment>windows 7, php 5.3.6</environment>
            <key id="13258">DDC-1533</key>
            <summary>ResultSetMap don&apos;t work with aliases when using joined entites</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="bostjan">Bostjan Oblak</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Dec 2011 12:28:07 +0000</created>
                <updated>Thu, 15 Dec 2011 19:18:52 +0000</updated>
                    <resolved>Thu, 15 Dec 2011 19:18:52 +0000</resolved>
                            <version>2.1.4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16995" author="beberlei" created="Thu, 15 Dec 2011 19:18:52 +0000"  >&lt;p&gt;Class names in strings are always full qualified expect for the metadata target entities. This is expected.&lt;/p&gt;

&lt;p&gt;I don&apos;t think a check makes sense here, also because we don&apos;t have access to a utility that allows for checks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1515] [Regression] Entities with composite PKs and no other scalar fields are not hydrated</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1515</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Test entities attached.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13227">DDC-1515</key>
            <summary>[Regression] Entities with composite PKs and no other scalar fields are not hydrated</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="darkangel">Glen Ainscow</reporter>
                        <labels>
                    </labels>
                <created>Tue, 29 Nov 2011 20:18:48 +0000</created>
                <updated>Sun, 11 Dec 2011 19:23:09 +0000</updated>
                    <resolved>Sun, 11 Dec 2011 19:23:09 +0000</resolved>
                            <version>2.1.4</version>
                                <fixVersion>2.1.5</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16937" author="beberlei" created="Thu, 1 Dec 2011 19:01:20 +0000"  >&lt;p&gt;Marked as critical&lt;/p&gt;</comment>
                    <comment id="16942" author="guilhermeblanco" created="Sun, 4 Dec 2011 07:09:00 +0000"  >&lt;p&gt;Just as a comment... in 2.2 this issue does not exist.&lt;/p&gt;</comment>
                    <comment id="16966" author="beberlei" created="Sun, 11 Dec 2011 15:36:22 +0000"  >&lt;p&gt;Confirmed for 2.1 and 2.2&lt;/p&gt;</comment>
                    <comment id="16968" author="beberlei" created="Sun, 11 Dec 2011 19:23:09 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11121" name="Test.php" size="518" author="darkangel" created="Tue, 29 Nov 2011 20:18:48 +0000" />
                    <attachment id="11122" name="Test1.php" size="205" author="darkangel" created="Tue, 29 Nov 2011 20:18:48 +0000" />
                    <attachment id="11123" name="Test2.php" size="205" author="darkangel" created="Tue, 29 Nov 2011 20:18:48 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1505] EntityManager-&gt;find returning null for entity on the inverse side of a OneToOne association </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1505</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;BasicEntityPersister.getJoinSQLForJoinColumns treats joinColumn nullable setting as defaulting to false:&lt;/p&gt;

&lt;p&gt;             if(isset($joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;)&lt;/p&gt;
{
                 return &apos;LEFT JOIN&apos;;
             }&lt;br/&gt;
&lt;br/&gt;
I think it should be:&lt;br/&gt;
&lt;br/&gt;
             if(!isset($joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;) || $joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;){                 return &apos;LEFT JOIN&apos;;             }</description>
                <environment></environment>
            <key id="13210">DDC-1505</key>
            <summary>EntityManager-&gt;find returning null for entity on the inverse side of a OneToOne association </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="asm89">Alexander</assignee>
                                <reporter username="chrisrichard">Chris Richard</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Nov 2011 02:57:57 +0000</created>
                <updated>Sun, 18 Dec 2011 21:19:50 +0000</updated>
                    <resolved>Sun, 18 Dec 2011 21:19:50 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                <fixVersion>Git Master</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17004" author="beberlei" created="Thu, 15 Dec 2011 22:07:43 +0000"  >&lt;p&gt;Assigned to asm&lt;/p&gt;</comment>
                    <comment id="17030" author="beberlei" created="Sun, 18 Dec 2011 20:35:04 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-226&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/226&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/226&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17031" author="asm89" created="Sun, 18 Dec 2011 20:35:14 +0000"  >&lt;p&gt;Should be fixed as soon as this is pulled:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/226&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/226&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17032" author="beberlei" created="Sun, 18 Dec 2011 21:00:04 +0000"  >&lt;p&gt;Related Pull Request was closed: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/226&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/226&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1498] Wrong behavior in getIdentifierValues with null fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1498</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When an identifier field is null, getIdentifierValues will not include it in the returned array: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L125&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L125&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will lead to a PHP warning when using `$repository-&amp;gt;find($classMatadata-&amp;gt;getIdentifierValues($object))` because there is not the good number of elements in the array. And btw, the array should be validated instead of letting array_combine complain as it does not explain what went wrong: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L122&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L122&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This issue was found in &lt;a href=&quot;https://github.com/symfony/symfony/issues/2670&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/issues/2670&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13204">DDC-1498</key>
            <summary>Wrong behavior in getIdentifierValues with null fields</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Nov 2011 10:33:22 +0000</created>
                <updated>Thu, 1 Dec 2011 19:15:17 +0000</updated>
                    <resolved>Thu, 1 Dec 2011 19:03:54 +0000</resolved>
                            <version>2.1.2</version>
                <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16908" author="beberlei" created="Tue, 22 Nov 2011 23:22:21 +0000"  >&lt;p&gt;Looks fishy yes, i will look into it.&lt;/p&gt;
</comment>
                    <comment id="16938" author="beberlei" created="Thu, 1 Dec 2011 19:03:54 +0000"  >&lt;p&gt;This is required from the internals of Doctrine to work this way as its a way to detect if the entity even has identifiers (is new or known).&lt;/p&gt;

&lt;p&gt;The Symfony code to load entities has to catch this.&lt;/p&gt;</comment>
                    <comment id="16939" author="stof" created="Thu, 1 Dec 2011 19:15:17 +0000"  >&lt;p&gt;at least, you should throw an exception in find() when the given data is invalid instead of letting array_combine throw a warning (which cannot be catched when you are not using an error handler transforming it to an exception)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1490] Generated Ids with Sequence/Auto Increment Generators not always casted to int</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1490</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The Id Generators don&apos;t necessarily cast ids to integer values when generating them.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13180">DDC-1490</key>
            <summary>Generated Ids with Sequence/Auto Increment Generators not always casted to int</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 13 Nov 2011 14:35:41 +0000</created>
                <updated>Sun, 13 Nov 2011 14:48:28 +0000</updated>
                    <resolved>Sun, 13 Nov 2011 14:48:28 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16801" author="beberlei" created="Sun, 13 Nov 2011 14:48:28 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1850] Problems deleting when fields are case sensitive, and realtion many to many too</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1850</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;well we have same issues when we delete same field from a postgres data base where columns are camelcase and start with caps.&lt;/p&gt;

&lt;p&gt;I upload in this issue a patch that solve the problem.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13746">DDC-1850</key>
            <summary>Problems deleting when fields are case sensitive, and realtion many to many too</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="pminetti">Pablo Minetti</reporter>
                        <labels>
                    </labels>
                <created>Thu, 31 May 2012 18:12:46 +0000</created>
                <updated>Fri, 6 Jul 2012 12:41:22 +0000</updated>
                    <resolved>Fri, 6 Jul 2012 12:41:22 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18043" author="fabio.bat.silva" created="Tue, 5 Jun 2012 21:41:14 +0000"  >&lt;p&gt;Hi Pablo Minetti,&lt;/p&gt;

&lt;p&gt;I&apos;m working on a quote patch right now.&lt;br/&gt;
I think that will fix a lot of quote issues.&lt;/p&gt;

&lt;p&gt;Could you attach a test for this case please ?&lt;/p&gt;</comment>
                    <comment id="18217" author="beberlei" created="Fri, 6 Jul 2012 12:41:22 +0000"  >&lt;p&gt;No feeback given and a fix was pushed to master. Please reopen if problems persist with master + custom quoting strategy.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11195" name="BasicEntityPersister.patch" size="2218" author="pminetti" created="Thu, 31 May 2012 18:12:46 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1831] Problem while implement a relation many to many with columns names starting with caps</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1831</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, In my team we are implementing a solution that involves make a relation many to many.&lt;/p&gt;

&lt;p&gt;The problem is that the columns names of the middle table start with caps.&lt;/p&gt;

&lt;p&gt;we make correction to ORM to solve this problem. I attach to you the files modify.&lt;/p&gt;


</description>
                <environment></environment>
            <key id="13718">DDC-1831</key>
            <summary>Problem while implement a relation many to many with columns names starting with caps</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="pminetti">Pablo Minetti</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 May 2012 17:28:36 +0000</created>
                <updated>Fri, 6 Jul 2012 12:41:38 +0000</updated>
                    <resolved>Fri, 6 Jul 2012 12:41:38 +0000</resolved>
                                            <fixVersion>2.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18044" author="fabio.bat.silva" created="Tue, 5 Jun 2012 21:41:46 +0000"  >&lt;p&gt;Hi Pablo,&lt;/p&gt;

&lt;p&gt;I&apos;m working on a quote patch right now.&lt;br/&gt;
I think that will fix a lot of quote issues.&lt;/p&gt;

&lt;p&gt;Could you attach a test for this case please ?&lt;/p&gt;</comment>
                    <comment id="18192" author="beberlei" created="Thu, 5 Jul 2012 18:19:32 +0000"  >&lt;p&gt;Fabio, any stats on this one? Is it fixed through your change?&lt;/p&gt;</comment>
                    <comment id="18193" author="fabio.bat.silva" created="Thu, 5 Jul 2012 18:31:45 +0000"  >&lt;p&gt;There is no answers from Pablo,&lt;/p&gt;

&lt;p&gt;I think this is fixed by quote strategy, also &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1850&quot; title=&quot;Problems deleting when fields are case sensitive, and realtion many to many too&quot;&gt;&lt;del&gt;DDC-1850&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
but without entities or tests is hard to know if are really fixed.&lt;/p&gt;


&lt;p&gt;if we don&apos;t get any feedback from Pablo, I think both could be closed.&lt;/p&gt;</comment>
                    <comment id="18218" author="beberlei" created="Fri, 6 Jul 2012 12:41:38 +0000"  >&lt;p&gt;No feeback given and a fix was pushed to master. Please reopen if problems persist with master + custom quoting strategy.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11190" name="defect_patch.txt" size="4913" author="pminetti" created="Mon, 21 May 2012 17:28:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1802] DQL parser issue when using FunctionsReturningStrings(...)  NOT LIKE</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1802</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you create a query like the following, you will get an exception:&lt;/p&gt;

&lt;p&gt;$em-&amp;gt;createQuery( &quot;SELECT e FROM MyEntity e WHERE CONCAT(e.name, e.name2) NOT LIKE &apos;%abc%&apos;&quot; );&lt;/p&gt;

&lt;p&gt;The variable $token&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt; is Lexer::T_NOT - &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/Parser.php#L2238&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/Parser.php#L2238&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13668">DDC-1802</key>
            <summary>DQL parser issue when using FunctionsReturningStrings(...)  NOT LIKE</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Apr 2012 06:10:42 +0000</created>
                <updated>Fri, 4 May 2012 20:09:10 +0000</updated>
                    <resolved>Fri, 4 May 2012 20:09:10 +0000</resolved>
                            <version>2.1.3</version>
                <version>2.1.4</version>
                <version>2.1.5</version>
                <version>2.1.6</version>
                <version>2.2-BETA1</version>
                <version>2.2-BETA2</version>
                <version>2.2.0-RC1</version>
                <version>2.2</version>
                <version>2.2.1</version>
                <version>2.2.2</version>
                                <fixVersion>2.3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17912" author="asm89" created="Fri, 4 May 2012 20:09:10 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/345&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/345&lt;/a&gt; got merged &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-1799] Doctrine&apos;s Reverse Engineering 1-n (one to many) association misunderstood as 1-1 (one to one)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1799</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I found an odd behaviour of Doctrine&apos;s reverse engineering process, just create two simple tables tied by a simple 1-n relationship, take a look at the snap of the folowing SQL code:&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;    SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
    SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
    SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=&apos;TRADITIONAL&apos;;
    
    DROP SCHEMA IF EXISTS `ACME` ;
    CREATE SCHEMA IF NOT EXISTS `ACME` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
    USE `ACME` ;
    
    -- -----------------------------------------------------
    -- Table `ACME`.`task`
    -- -----------------------------------------------------
    DROP TABLE IF EXISTS `ACME`.`task` ;
    
    CREATE  TABLE IF NOT EXISTS `ACME`.`task` (
      `id_task` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
      `description` VARCHAR(45) NULL ,
      PRIMARY KEY (`id_task`) )
    ENGINE = InnoDB;
    
    
    -- -----------------------------------------------------
    -- Table `ACME`.`tag`
    -- -----------------------------------------------------
    DROP TABLE IF EXISTS `ACME`.`tag` ;
    
    CREATE  TABLE IF NOT EXISTS `ACME`.`tag` (
      `id_tag` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
      `name` VARCHAR(50) NULL ,
      `task_id` INT UNSIGNED NOT NULL ,
      PRIMARY KEY (`id_tag`) ,
      INDEX `fk_tag_task` (`task_id` ASC) ,
      CONSTRAINT `fk_tag_task`
        FOREIGN KEY (`task_id` )
        REFERENCES `ACME`.`task` (`id_task` )
        ON DELETE NO ACTION
        ON UPDATE NO ACTION)
    ENGINE = InnoDB;
    
    
    
    SET SQL_MODE=@OLD_SQL_MODE;
    SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
    SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have a Symfony2 netbeans project at &lt;/p&gt;

&lt;p&gt;&amp;gt; /Applications/MAMP/htdocs/Acme&lt;/p&gt;

&lt;p&gt; and from that location, according to &lt;/p&gt;

&lt;p&gt;&amp;gt; &lt;a href=&quot;http://symfony.com/doc/current/cookbook/doctrine/reverse_engineering.html&quot; class=&quot;external-link&quot;&gt;http://symfony.com/doc/current/cookbook/doctrine/reverse_engineering.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; in a terminal I did:&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;    $ ./../../bin/php/php5.3.6/bin/php app/console doctrine:mapping:convert yml ./src/Acme/TaskBundle/Resources/config/doctrine/ --from-database --force
    Processing entity &lt;span class=&quot;code-quote&quot;&gt;&quot;Tag&quot;&lt;/span&gt;
    Processing entity &lt;span class=&quot;code-quote&quot;&gt;&quot;Task&quot;&lt;/span&gt;
    
    Exporting &lt;span class=&quot;code-quote&quot;&gt;&quot;yml&quot;&lt;/span&gt; mapping information to &lt;span class=&quot;code-quote&quot;&gt;&quot;/Applications/MAMP/htdocs/Acme/src/Acme/TaskBundle/Resources/config/doctrine&quot;&lt;/span&gt;
    
    $ ./../../bin/php/php5.3.6/bin/php app/console doctrine:mapping:&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; Acme\TaskBundle yml
    Importing mapping information from &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&quot;&lt;/span&gt; entity manager
      &amp;gt; writing /Applications/MAMP/htdocs/Acme/src/Acme/TaskBundle/Resources/config/doctrine/Tag.orm.yml
      &amp;gt; writing /Applications/MAMP/htdocs/Acme/src/Acme/TaskBundle/Resources/config/doctrine/Task.orm.yml
    
    $ ./../../bin/php/php5.3.6/bin/php app/console doctrine:generate:entities Acme\TaskBundle
    Generating entities &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; bundle &lt;span class=&quot;code-quote&quot;&gt;&quot;AcmeTaskBundle&quot;&lt;/span&gt;
      &amp;gt; backing up Tag.php to Tag.php~
      &amp;gt; generating Acme\TaskBundle\Entity\Tag
      &amp;gt; backing up Task.php to Task.php~
      &amp;gt; generating Acme\TaskBundle\Entity\Task
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The fact is that it only seems ok, because if you take a look at &quot;Tag.orm.yml&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Tag.orm.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    Acme\TaskBundle\Entity\Tag:
      type: entity
      table: tag
      fields:
        idTag:
          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;
          column: id_tag
          generator:
            strategy: IDENTITY
        name:
          type: string
          length: 50
          fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
          nullable: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      oneToOne:
        task:
          targetEntity: Task
          cascade: {  }
          mappedBy: &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
          inversedBy: &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
          joinColumns:
            task_id:
              referencedColumnName: id_task
          orphanRemoval: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      lifecycleCallbacks: {  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It created a *&lt;b&gt;oneToOne&lt;/b&gt;* relationship and not a *&lt;b&gt;oneToMany&lt;/b&gt;* !&lt;/p&gt;

&lt;p&gt;If you need any more confirmation, here are **&lt;b&gt;Task.php&lt;/b&gt;** and **&lt;b&gt;Tag.php&lt;/b&gt;**:&lt;/p&gt;

&lt;p&gt;**&lt;b&gt;Task.php&lt;/b&gt;**&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Task.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &amp;lt;?php
    
    namespace Acme\TaskBundle\Entity;
    
    use Doctrine\ORM\Mapping as ORM;
    
    /**
     * Acme\TaskBundle\Entity\Task
     */
    class Task
    {
        /**
         * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idTask
         */
        &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idTask;
    
        /**
         * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $description
         */
        &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $description;
    
    
        /**
         * Get idTask
         *
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; integer 
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getIdTask()
        {
            &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;idTask;
        }
    
        /**
         * Set description
         *
         * @param string $description
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setDescription($description)
        {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;description = $description;
        }
    
        /**
         * Get description
         *
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string 
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDescription()
        {
            &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;description;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Tag.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;***Tag.php***

    &amp;lt;?php
    
    namespace Acme\TaskBundle\Entity;
    
    use Doctrine\ORM\Mapping as ORM;
    
    /**
     * Acme\TaskBundle\Entity\Tag
     */
    class Tag
    {
        /**
         * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $idTag
         */
        &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $idTag;
    
        /**
         * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $name
         */
        &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;
    
        /**
         * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Acme\TaskBundle\Entity\Task
         */
        &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $task;
    
    
        /**
         * Get idTag
         *
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; integer 
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getIdTag()
        {
            &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;idTag;
        }
    
        /**
         * Set name
         *
         * @param string $name
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setName($name)
        {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $name;
        }
    
        /**
         * Get name
         *
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string 
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; 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;
        }
    
        /**
         * Set task
         *
         * @param Acme\TaskBundle\Entity\Task $task
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTask(\Acme\TaskBundle\Entity\Task $task)
        {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;task = $task;
        }
    
        /**
         * Get task
         *
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Acme\TaskBundle\Entity\Task 
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getTask()
        {
            &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;task;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;linuxatico&lt;/p&gt;</description>
                <environment>MAC OS X 10.6.8, Symfony 2.0.12, PHP 5.3.6, mysql server 5.5.9</environment>
            <key id="13663">DDC-1799</key>
            <summary>Doctrine&apos;s Reverse Engineering 1-n (one to many) association misunderstood as 1-1 (one to one)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="linuxatico">simone adami</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Apr 2012 10:46:30 +0000</created>
                <updated>Sun, 27 May 2012 08:02:46 +0000</updated>
                    <resolved>Sun, 27 May 2012 08:02:46 +0000</resolved>
                            <version>2.1.6</version>
                                <fixVersion>2.1.7</fixVersion>
                <fixVersion>2.2.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17897" author="linuxatico" created="Mon, 30 Apr 2012 07:55:50 +0000"  >&lt;p&gt;This problem is encountered only in this case, 1-1 and n-m relationship are handled in the right way, has anyone else faced this problem too?&lt;/p&gt;

&lt;p&gt;linuxatico&lt;/p&gt;</comment>
                    <comment id="17931" author="linuxatico" created="Mon, 7 May 2012 12:41:27 +0000"  >&lt;p&gt;Hi all,&lt;br/&gt;
I wanna give the Doctrine community my full support to help fixing this bug, but I need someone who can give me an answer.....&lt;br/&gt;
I couldn&apos;t figure out in the source code which is the method executed when given the command &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;$ ./../../bin/php/php5.3.6/bin/php app/console doctrine:mapping:convert yml ./src/Acme/TaskBundle/Resources/config/doctrine/ --from-database --force&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I will keep on looking for it, but some help will be appreciated,&lt;/p&gt;

&lt;p&gt;linuxatico&lt;/p&gt;</comment>
                    <comment id="17932" author="linuxatico" created="Mon, 7 May 2012 12:52:21 +0000"  >&lt;p&gt;Found in vendor/doctrine/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php&lt;br/&gt;
I&apos;ll see what I can do.&lt;/p&gt;

&lt;p&gt;linuxatico&lt;/p&gt;</comment>
                    <comment id="17936" author="linuxatico" created="Wed, 9 May 2012 10:43:38 +0000"  >&lt;p&gt;Even if I keep being ignored, I want to report a very useful discovery about this annoying bug: it&apos;s 100% related to the YAML conversion, because if you execute the first command &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; $ ./../../bin/php/php5.3.6/bin/php app/console doctrine:mapping:convert xml ./src/Acme/TaskBundle/Resources/config/doctrine/ --from-database --force&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using XML instead of YML it works in the expected way. I wonder if the author of this code have written a unit test before integrating this function in the official release of Doctrine.... (ironic question)&lt;/p&gt;

&lt;p&gt;linuxatico&lt;/p&gt;</comment>
                    <comment id="17984" author="beberlei" created="Sun, 27 May 2012 08:02:46 +0000"  >&lt;p&gt;This case was indeed not unit-tested, many-to-one and one-to-one were handled the same in YAML Exporter. No need to get picky about it though, we are investing our free time here.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1742] Cascade remove doesn&apos;t work with inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1742</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When removing an entity with a one-to-many relationship with a cascade delete option on it causes a &quot;Integrity constraint violation: 1451 Cannot delete or update a parent row:&quot; 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;&amp;lt;?php
/** @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;) @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;cat&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Cat&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;dog&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Dog&quot;&lt;/span&gt;}) @Entity @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&quot;&lt;/span&gt;) */
class Animal
{
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Person&quot;&lt;/span&gt;,inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;pets&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $owner;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setOwner(Person $person) { $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;owner = $person; }
}

/** @Entity */
class Cat &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Animal
{
}

/** @Entity */
class Dog &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Animal
{
}

/** @Entity */
class Person
{
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /** @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Animal&quot;&lt;/span&gt;,mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;owner&quot;&lt;/span&gt;,cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;delete&quot;&lt;/span&gt;}) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $pets;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addPet(Animal $animal) { $animal-&amp;gt;setOwner($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;); $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;pets[] = $animal; }
}


$person1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Person();

$dog1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Dog();

$person1-&amp;gt;addPet($dog1);

$em-&amp;gt;persist($person1);
$em-&amp;gt;persist($dog1);

$em-&amp;gt;flush();

$em-&amp;gt;remove($person1);

$em-&amp;gt;flush();

/*
PHP Fatal error:  Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test`.`Animal`, CONSTRAINT `FK_6D0726297E3C61F9` FOREIGN KEY (`owner_id`) REFERENCES `Person` (`id`))&apos; in /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/DBAL/Connection.php:754
Stack trace:
#0 /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/DBAL/Connection.php(754): PDOStatement-&amp;gt;execute(Array)
#1 /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/DBAL/Connection.php(438): Doctrine\DBAL\Connection-&amp;gt;executeUpdate(&apos;DELETE FROM Per...&apos;, Array)
#2 /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(464): Doctrine\DBAL\Connection-&amp;gt;delete(&apos;Person&apos;, Array)
#3 /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/ORM/UnitOfWork.php(993): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;delete(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Person))
#4 /home/jhendric/public_html/doctrine-test/pear/php/Doctrine in /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/DBAL/Connection.php on line 754

Fatal error: Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test`.`Animal`, CONSTRAINT `FK_6D0726297E3C61F9` FOREIGN KEY (`owner_id`) REFERENCES `Person` (`id`))&apos; in /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/DBAL/Connection.php on line 754

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test`.`Animal`, CONSTRAINT `FK_6D0726297E3C61F9` FOREIGN KEY (`owner_id`) REFERENCES `Person` (`id`)) in /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/DBAL/Connection.php on line 754

Call Stack:
    0.0002     647440   1. {main}() /home/jhendric/public_html/doctrine-test/test.php:0
    0.0513    7989360   2. Doctrine\ORM\EntityManager-&amp;gt;flush() /home/jhendric/public_html/doctrine-test/test.php:26
    0.0513    7989440   3. Doctrine\ORM\UnitOfWork-&amp;gt;commit() /home/jhendric/public_html/doctrine-test/pear/php/Doctrine/ORM/EntityManager.php:355
*/
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu 11.10, PHP 5.3.6-13ubuntu3.6 with Suhosin-Patch (cli), MySQL</environment>
            <key id="13580">DDC-1742</key>
            <summary>Cascade remove doesn&apos;t work with inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="toxygene">Justin Hendrickson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Mar 2012 21:25:03 +0000</created>
                <updated>Sun, 1 Apr 2012 08:43:48 +0000</updated>
                    <resolved>Sun, 1 Apr 2012 08:43:48 +0000</resolved>
                            <version>2.2.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17691" author="toxygene" created="Fri, 30 Mar 2012 21:26:50 +0000"  >&lt;p&gt;I did some step debugging and it looked like the calculate commit order determined that the person should be removed before the animal.&lt;/p&gt;</comment>
                    <comment id="17696" author="beberlei" created="Sat, 31 Mar 2012 07:31:59 +0000"  >&lt;p&gt;It works for me.&lt;/p&gt;

&lt;p&gt;See the testcase attached, you can put it into tests/Doctrine/Tests/ORM/Functional/Ticket, then run &quot;phpunit --group &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1742&quot; title=&quot;Cascade remove doesn&amp;#39;t work with inheritance&quot;&gt;&lt;del&gt;DDC-1742&lt;/del&gt;&lt;/a&gt;&quot; from the CLI to get the result.&lt;/p&gt;

&lt;p&gt;Can you make it fail?&lt;/p&gt;</comment>
                    <comment id="17699" author="toxygene" created="Sat, 31 Mar 2012 11:46:16 +0000"  >&lt;p&gt;I ran the provided test and could not reproduce the original error. There were some differences between the original environment and the environment I ran the tests in.&lt;/p&gt;

&lt;p&gt;My original environment was a pear install of 2.2.1 and used the MySQL backend. The pear install does not include the unit tests, so I did a github checkout and used that source code for the tests. I initially got an error about not having pdo_sqlite installed, so I&apos;m assuming the unit test used an sqlite(3) database for it&apos;s test. I can&apos;t imagine how either of these would effect the final result, but I wanted to note them, just in case.&lt;/p&gt;

&lt;p&gt;Assuming neither of the previous differences is the source of the problem, I&apos;ll try to figure out how to reproduce the problem with a unit test today.&lt;/p&gt;</comment>
                    <comment id="17700" author="toxygene" created="Sat, 31 Mar 2012 11:50:57 +0000"  >&lt;p&gt;Using the phpunit.xml file, I setup the unit tests to use MySQL instead of SQLite and I was able to reproduce the error:&lt;/p&gt;

&lt;p&gt;jhendric@jhendric-Ubuntu:~/public_html/doctrine2-test/doctrine2-orm$ phpunit --group &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1742&quot; title=&quot;Cascade remove doesn&amp;#39;t work with inheritance&quot;&gt;&lt;del&gt;DDC-1742&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
PHPUnit 3.6.10 by Sebastian Bergmann.&lt;/p&gt;

&lt;p&gt;Configuration read from /home/jhendric/public_html/doctrine2-test/doctrine2-orm/phpunit.xml&lt;/p&gt;

&lt;p&gt;E&lt;/p&gt;

&lt;p&gt;Time: 1 second, Memory: 72.50Mb&lt;/p&gt;

&lt;p&gt;There was 1 error:&lt;/p&gt;

&lt;p&gt;1) Doctrine\Tests\ORM\Functional\Ticket\DDC1742Test::testIssue&lt;br/&gt;
Exception: &lt;span class=&quot;error&quot;&gt;&amp;#91;PDOException&amp;#93;&lt;/span&gt; SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`doctrine_tests`.`DDC1742Animal`, CONSTRAINT `FK_215064B57E3C61F9` FOREIGN KEY (`owner_id`) REFERENCES `DDC1742Person` (`id`))&lt;/p&gt;

&lt;p&gt;With queries:&lt;br/&gt;
6. SQL: &apos;INSERT INTO DDC1742Animal (owner_id, type) VALUES (?, ?)&apos; Params: &apos;1&apos;, &apos;dog&apos;&lt;br/&gt;
5. SQL: &apos;INSERT INTO DDC1742Person (id) VALUES (null)&apos; Params:&lt;br/&gt;
4. SQL: &apos;ALTER TABLE DDC1742Animal ADD CONSTRAINT FK_215064B57E3C61F9 FOREIGN KEY (owner_id) REFERENCES DDC1742Person (id)&apos; Params:&lt;br/&gt;
3. SQL: &apos;CREATE TABLE DDC1742Person (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB&apos; Params:&lt;br/&gt;
2. SQL: &apos;CREATE TABLE DDC1742Animal (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, INDEX IDX_215064B57E3C61F9 (owner_id), PRIMARY KEY(id)) ENGINE = InnoDB&apos; Params:&lt;/p&gt;

&lt;p&gt;Trace:&lt;br/&gt;
/home/jhendric/public_html/doctrine2-test/doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php:754&lt;br/&gt;
/home/jhendric/public_html/doctrine2-test/doctrine2-orm/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php:438&lt;br/&gt;
/home/jhendric/public_html/doctrine2-test/doctrine2-orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php:464&lt;br/&gt;
/home/jhendric/public_html/doctrine2-test/doctrine2-orm/lib/Doctrine/ORM/UnitOfWork.php:993&lt;br/&gt;
/home/jhendric/public_html/doctrine2-test/doctrine2-orm/lib/Doctrine/ORM/UnitOfWork.php:331&lt;br/&gt;
/home/jhendric/public_html/doctrine2-test/doctrine2-orm/lib/Doctrine/ORM/EntityManager.php:355&lt;br/&gt;
/home/jhendric/public_html/doctrine2-test/doctrine2-orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1742Test.php:38&lt;/p&gt;


&lt;p&gt;/home/jhendric/public_html/doctrine2-test/doctrine2-orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php:401&lt;/p&gt;

&lt;p&gt;FAILURES!&lt;br/&gt;
Tests: 1, Assertions: 0, Errors: 1.&lt;/p&gt;</comment>
                    <comment id="17705" author="beberlei" created="Sun, 1 Apr 2012 08:06:45 +0000"  >&lt;p&gt;Ah yes, i have the same result I ran only against sqlite and they dont have foreign keys. Sorry for that.&lt;/p&gt;</comment>
                    <comment id="17706" author="beberlei" created="Sun, 1 Apr 2012 08:43:48 +0000"  >&lt;p&gt;Its not a bug, your mapping is wrong. The option is cascade=&lt;/p&gt;
{&quot;remove&quot;}
&lt;p&gt; not cascade=&lt;/p&gt;
{&quot;delete&quot;}</comment>
                </comments>
                    <attachments>
                    <attachment id="11175" name="DDC1742Test.php" size="1930" author="beberlei" created="Sat, 31 Mar 2012 07:31:59 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2310] Recent changes to DBAL SQL Server platform lock hinting breaks ORM SqlWalker in DQL queries with joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2310</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The SQL Server platform throws an error when you try to run DQL with JOIN statements.&lt;/p&gt;

&lt;p&gt;The breaking change was in the DBAL SQL Server platform &amp;#8211; it was changed to add a &apos; WITH (NOLOCK)&apos; to the appendLockHint function. Change was in &lt;a href=&quot;https://github.com/doctrine/dbal/commit/6af7845cc3779176ec7e111200fe69654179eaf8#L0R851&quot; class=&quot;external-link&quot;&gt;this rev&lt;/a&gt;. The change in DBAL is not wrong, it just highlighted the bug in the ORM...&lt;/p&gt;


&lt;p&gt;The ORM SqlWalker runs the appendLockHint function against a generated FROM / JOIN clause in the walkFromClause func &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/1bcda5147a890a8f419eb333df69852bd4f6b307/lib/Doctrine/ORM/Query/SqlWalker.php#L777&quot; class=&quot;external-link&quot;&gt;here&lt;/a&gt;. This is actually the wrong place to append lock hints. This is generating the FROM clause 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; FROM foo f0_ LEFT JOIN foo_bar f1_ ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ ON f1_.bar_id = b2_.id WITH (NOLOCK)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When it should actually generate 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; FROM foo f0_ WITH (NOLOCK) LEFT JOIN foo_bar f1_ WITH (NOLOCK) ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ WITH (NOLOCK) ON f1_.bar_id = b2_.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; It should append lock hints after the table alias.&lt;/p&gt;

&lt;p&gt;I think the only reason this hasn&apos;t shown up before is that the other lock hint types haven&apos;t been applied in this way before, if at all.&lt;/p&gt;</description>
                <environment>SQL Server</environment>
            <key id="14513">DDC-2310</key>
            <summary>Recent changes to DBAL SQL Server platform lock hinting breaks ORM SqlWalker in DQL queries with joins</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="wschalle">William Schaller</reporter>
                        <labels>
                        <label>dbal</label>
                        <label>lockhints</label>
                        <label>orm</label>
                        <label>sqlserver</label>
                        <label>sqlsrv</label>
                    </labels>
                <created>Thu, 21 Feb 2013 17:46:19 +0000</created>
                <updated>Thu, 21 Feb 2013 19:51:37 +0000</updated>
                    <resolved>Thu, 21 Feb 2013 18:04:07 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.3.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19583" author="stof" created="Thu, 21 Feb 2013 19:38:07 +0000"  >&lt;p&gt;I think the line appending the lock should be moved to &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/1bcda5147a890a8f419eb333df69852bd4f6b307/lib/Doctrine/ORM/Query/SqlWalker.php#L796&quot; class=&quot;external-link&quot;&gt;this place&lt;/a&gt; to achieve the result displayed above.&lt;/p&gt;

&lt;p&gt;But it may cause issues with some other vendor.&lt;/p&gt;</comment>
                    <comment id="19584" author="wschalle" created="Thu, 21 Feb 2013 19:51:26 +0000"  >&lt;p&gt;@Christophe I considered that too. None of the other platforms implement the appendLockHint function. None of the other platforms implement this because it is handled differently on other platforms &amp;#8211; with transaction isolation levels and such.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2204] Order by With Equals is not supported</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2204</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The sample query (I want to bring a specific item to the top of the list).&lt;br/&gt;
mysql&amp;gt; select * from Language order by name=&apos;English&apos; desc, name asc limit 5;&lt;br/&gt;
&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; id &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; name     &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 82 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; English  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 73 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Albanian &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 74 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Arabic   &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 75 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Armenian &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 76 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Bengali  &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;br/&gt;
5 rows in set (0.00 sec)&lt;/p&gt;

&lt;p&gt;In theory, the code below should generate the same query.&lt;br/&gt;
$repository-&amp;gt;createQueryBuilder(&apos;p&apos;)&lt;br/&gt;
-&amp;gt;addOrderBy(&quot;p.name=&apos;english&apos;&quot;, &apos;desc&apos;)&lt;br/&gt;
-&amp;gt;addOrderBy(&apos;p.name&apos;, &apos;asc&apos;);&lt;/p&gt;

&lt;p&gt;In practice, an exception is thrown.&lt;br/&gt;
Doctrine\ORM\Query\QueryException: &lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 67: Error: Expected end of string, got &apos;=&apos; (uncaught exception) at /vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 44 &lt;/p&gt;

&lt;p&gt;Attached, SQL dump for the table &amp;amp; data&lt;/p&gt;</description>
                <environment>SQL construct tested on postgres 9.0, mysql 5.5, and sqlite 3.</environment>
            <key id="14318">DDC-2204</key>
            <summary>Order by With Equals is not supported</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ibiryukov">Ilya Biryukov</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Mon, 17 Dec 2012 20:39:59 +0000</created>
                <updated>Sat, 22 Dec 2012 13:19:16 +0000</updated>
                    <resolved>Sat, 22 Dec 2012 13:19:16 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19172" author="beberlei" created="Sat, 22 Dec 2012 13:19:16 +0000"  >&lt;p&gt;Its supported by including the condition in the SELECT clause, aliasing it, then using it. You might need to use &quot;AS HIDDEN name&quot; to prevent it from appearing in the result&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11364" name="Language.sql" size="1756" author="ibiryukov" created="Mon, 17 Dec 2012 20:39:59 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2205] Negative Values in Case Then expressions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2205</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL Expression: &lt;/p&gt;

&lt;p&gt;SELECT (CASE WHEN t.id = 1 THEN -1 ELSE t.id END) FROM Table t&lt;/p&gt;

&lt;p&gt;Gives an error:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 32: Error: Unexpected &apos;-&apos;&lt;/p&gt;

&lt;p&gt;It doesn&apos;t seem to like the negative number.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14320">DDC-2205</key>
            <summary>Negative Values in Case Then expressions</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="ibiryukov">Ilya Biryukov</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Tue, 18 Dec 2012 00:18:52 +0000</created>
                <updated>Fri, 21 Dec 2012 12:03:45 +0000</updated>
                    <resolved>Fri, 21 Dec 2012 12:03:45 +0000</resolved>
                            <version>2.3.1</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19166" author="fabio.bat.silva" created="Fri, 21 Dec 2012 12:03:45 +0000"  >&lt;p&gt;Fixed : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/8b5e4a9a52670992b85e7223d255b98cf77a35a3&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/8b5e4a9a52670992b85e7223d255b98cf77a35a3&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2162] Undefined index: joinColumns in ManyToMany association</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2162</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;My classes: &lt;a href=&quot;https://gist.github.com/4131893&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/4131893&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When calling PageRepository::findByTags i get&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: joinColumns in vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1494&lt;/p&gt;</description>
                <environment></environment>
            <key id="14258">DDC-2162</key>
            <summary>Undefined index: joinColumns in ManyToMany association</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="vslinko">Vyacheslav Slinko</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Nov 2012 17:20:11 +0000</created>
                <updated>Thu, 22 Nov 2012 19:07:04 +0000</updated>
                    <resolved>Thu, 22 Nov 2012 19:07:04 +0000</resolved>
                            <version>2.3</version>
                <version>Git Master</version>
                                                <component>DQL</component>
                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19030" author="vslinko" created="Thu, 22 Nov 2012 19:06:50 +0000"  >&lt;p&gt;Found a problem: PageRepository not configured for Page entity &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2155] problem with DQL and cache</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2155</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a problem when I get database records through a query DQL&lt;br/&gt;
  and then they are changed by another application&lt;br/&gt;
If I repeat the query, Doctrine always return the first value, not the current value of the base&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

&lt;span class=&quot;code-comment&quot;&gt;// bootstrap
&lt;/span&gt;
$cache = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Cache\ArrayCache();
$config = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine\ORM\Configuration();
$config-&amp;gt;setQueryCacheImpl($cache);
$conn = array(
				&apos;dbname&apos; =&amp;gt; $database_name,
				&apos;user&apos; =&amp;gt; $cnx_user,
				&apos;password&apos; =&amp;gt; $cnx_pass,
				&apos;host&apos; =&amp;gt; $cnx_host,
				&apos;driver&apos; =&amp;gt; $cnx_type,
				&apos;charset&apos; =&amp;gt; &apos;utf8&apos;,
				&apos;driverOptions&apos; =&amp;gt; array( 1002 =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;SET NAMES &apos;utf8&apos;&quot;&lt;/span&gt; )
				);

			$em = Doctrine\ORM\EntityManager::create($conn, $config);




&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;
&lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;){
   $dql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT s from Register s WHERE s.id = 1&quot;&lt;/span&gt;;
   $query = $em-&amp;gt;createQuery($dql);
&lt;span class=&quot;code-comment&quot;&gt;// the next line is optional, produces same result
&lt;/span&gt;   $query-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
   $res = $query-&amp;gt;getResult();
   $orm = reset($res);
   	
   echo &lt;span class=&quot;code-quote&quot;&gt;&quot; regiter id :&quot;&lt;/span&gt;.$orm-&amp;gt;getId().&lt;span class=&quot;code-quote&quot;&gt;&quot;  field &quot;&lt;/span&gt;$orm-&amp;gt;getText().&lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I run this code in a terminal, and then edit the registry (field text), but the terminal still shows the same result&lt;/p&gt;</description>
                <environment>linux , php 5.4.8, mysql 5.5.28</environment>
            <key id="14243">DDC-2155</key>
            <summary>problem with DQL and cache</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gabrielnn77">gabriel sancho</reporter>
                        <labels>
                        <label>cache</label>
                        <label>dql</label>
                    </labels>
                <created>Sun, 18 Nov 2012 22:57:30 +0000</created>
                <updated>Sun, 25 Nov 2012 11:59:34 +0000</updated>
                    <resolved>Sun, 25 Nov 2012 11:59:34 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19048" author="beberlei" created="Sun, 25 Nov 2012 11:59:34 +0000"  >&lt;p&gt;Doctrine uses an IdentityMap pattern which leads to this issue.&lt;/p&gt;

&lt;p&gt;You need to call &quot;EntityManager#clear()&quot; to clean the in memory cache of Doctrine and fetch records from the database again. or call &quot;EntityManager#refresh($entity)&quot;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2157] @HasLifecycleCallbacks does not fire events when set on @MappedSuperclass</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2157</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am unable to fire any of the &quot;HasLifecycleCallbacks&quot; when defined on a MappedSuperclass... (neither PreUpdate, PostUpdate,PrePersist, PostPersist and others)&lt;/p&gt;

&lt;p&gt;I have even tried to put @ORM\HasLifecycleCallbacks on the child class with onPostRemove() on mapped =&amp;gt; not working anymore&lt;/p&gt;

&lt;p&gt;It only works when i put @ORM\HasLifecycleCallbacks and onPostRemove() both in child class &quot;MyMappedTask&quot;...&lt;/p&gt;

&lt;p&gt;Is this a bug ..?&lt;/p&gt;

&lt;p&gt;To reproduce :&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 MyProject\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\MappedSuperclass
 * @ORM\HasLifecycleCallbacks
 */
class MyMappedTask
{
   /**
    * @ORM\PreRemove
    * @ORM\PostRemove
    * @ORM\PreUpdate
    * @ORM\PostUpdate
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function onPostRemove()
    {
        echo &lt;span class=&quot;code-quote&quot;&gt;&quot;here is never reached !&quot;&lt;/span&gt;;
    }
}

/**
 * @ORM\Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;MyProject\Repository\MyTaskRepository&quot;&lt;/span&gt;)
 * @ORM\Table()
 */
class MyTask &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; MyMappedTask
{

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Windows 7 x64 / Apache 2.4.2 / MySQL server 5.1.62</environment>
            <key id="14246">DDC-2157</key>
            <summary>@HasLifecycleCallbacks does not fire events when set on @MappedSuperclass</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="frederes">Frederic</reporter>
                        <labels>
                        <label>HasLifecycleCallbacks</label>
                        <label>MappedSuperclass</label>
                    </labels>
                <created>Tue, 20 Nov 2012 13:59:52 +0000</created>
                <updated>Tue, 27 Nov 2012 21:29:48 +0000</updated>
                    <resolved>Tue, 27 Nov 2012 21:29:48 +0000</resolved>
                            <version>2.2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19025" author="fabio.bat.silva" created="Thu, 22 Nov 2012 14:40:48 +0000"  >&lt;p&gt;code format&lt;/p&gt;</comment>
                    <comment id="19026" author="fabio.bat.silva" created="Thu, 22 Nov 2012 14:43:33 +0000"  >&lt;p&gt;Hi Frederic,&lt;/p&gt;

&lt;p&gt;It failed for all events or just for @PostRemove ?&lt;/p&gt;

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

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19038" author="frederes" created="Fri, 23 Nov 2012 14:35:46 +0000"  >&lt;p&gt;Hi Fabio,&lt;/p&gt;

&lt;p&gt;1) Thank you for the &quot;code&quot; tag, i didn&apos;t know to do &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;

&lt;p&gt;2) Is fails with all the Annotations &quot;Pre/Post*&quot; ...&lt;/p&gt;

&lt;p&gt;Did you try this test case ?&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;</comment>
                    <comment id="19040" author="fabio.bat.silva" created="Fri, 23 Nov 2012 18:40:18 +0000"  >&lt;p&gt;Hi Frederic,&lt;/p&gt;

&lt;p&gt;Can&apos;t reproduce.. &lt;br/&gt;
Could you try to change the attached test case and make it fails ?&lt;/p&gt;


&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19068" author="frederes" created="Tue, 27 Nov 2012 15:44:53 +0000"  >&lt;p&gt;Hi Fabio,&lt;/p&gt;

&lt;p&gt;Thank you for the test case, it is OK !&lt;/p&gt;

&lt;p&gt;I found what the problem was :&lt;br/&gt;
I use Symfony2 and i have one bundle with the @MappedSuperclass entity and its callbacks (@HasLifecycleCallbacks), and another bundle with the child class (@Entity/@Table).&lt;br/&gt;
In that case, you must register the 2 bundles on the mappings (config.yml) otherwise it fails. &lt;br/&gt;
(I only registered the bundle which contains the child class but was not enough for Doctrine to understand...) &lt;/p&gt;

&lt;p&gt;I don&apos;t know if it is a bug on Symfony2, not well documented in this case...&lt;/p&gt;

&lt;p&gt;Thank you for all&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11354" name="DDC2157Test.php" size="3171" author="fabio.bat.silva" created="Fri, 23 Nov 2012 18:30:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1098] Cascading delete is broken for all relationships other than inheritance relationships, at least on MySQL 5.0</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1098</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The console tools do not generate the proper DDL statements for the constraints declared as part of the relationship annotations.&lt;/p&gt;

&lt;p&gt;Take this entity field declaration, e.g. :&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;     /**
  * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;\persistentData\model\core\invoiceCreator\AnalogOrderInvoiceLineItem&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;partialInvoice&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-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;})
  */

 &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $analogOrderInvoiceLineItems;
 &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This declaration should generate some sort of ON DELETE CASCADE constraint, or at least actually cascade the delete, in whatever way. It does not. I reviewed the generated DDL statements with &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:schema-tool:create --dump-sql
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And it clearly showed that no &quot;ON DELETE CASCADE&quot; was generated. Neither did Doctrine 2 perform a cascading delete otherwise.&lt;/p&gt;

&lt;p&gt;The delete simply does not cascade.&lt;/p&gt;


&lt;p&gt;Subsequently, I end up getting errors like:&lt;/p&gt;

&lt;p&gt;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: 1451 Cannot delete or update a parent row: a foreign key constraint fails &lt;br/&gt;
(`invoiceCreatorDB/AnalogOrderInvoiceLineItem`, CONSTRAINT `AnalogOrderInvoiceLineItem_ibfk_1` FOREIGN KEY (`partialInvoice_dbID`) REFERENCES `PartialInvoice` (`dbID`))&apos;&lt;/p&gt;


&lt;p&gt;The query that caused the error 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;DELETE FROM PartialInvoice where dbID = &apos;2&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;(PartialInvoice is the entity containing the above field declaration).&lt;/p&gt;


&lt;p&gt;It seems that the cascading delete feature is fundamentally broken.&lt;/p&gt;</description>
                <environment>Debian Linux 6.0, MySQL 5.0.51a</environment>
            <key id="12528">DDC-1098</key>
            <summary>Cascading delete is broken for all relationships other than inheritance relationships, at least on MySQL 5.0</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Apr 2011 05:46:55 +0000</created>
                <updated>Tue, 27 Sep 2011 14:37:45 +0000</updated>
                    <resolved>Tue, 27 Sep 2011 14:37:45 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15677" author="beberlei" created="Mon, 4 Apr 2011 06:20:03 +0000"  >&lt;p&gt;This is expected, cascade remove is working with in memory instances of the to be deleted objects. This way lifecycle events are triggered.&lt;/p&gt;

&lt;p&gt;If you want to perform this operation on the databse level you have to set onDelete=&quot;CASCADE&quot; as an option of the join column:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-joincolumn&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-joincolumn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This difference should be explained in the docs on Working with Associations, 8.6 Transitive persistence / Cascade Operations i guess.&lt;/p&gt;</comment>
                    <comment id="15683" author="dalvarez" created="Tue, 5 Apr 2011 05:38:14 +0000"  >&lt;p&gt;Good idea.&lt;/p&gt;

&lt;p&gt;I believe that it is normal to expect that declared cascade behaviours refer to persistent state, and not only to in-memory object graphs.&lt;/p&gt;


&lt;p&gt;That declared cascade behaviours are only applicable to objects in main memory is a fundamental limitation that&lt;/p&gt;

&lt;p&gt;1) should be prominently documented, whereas, as of now, the information it is not visible at all&lt;/p&gt;

&lt;p&gt; 2) is IMO a highly questionable design in the first place, considering the principal focus of a ORM-solution as an interface to access &lt;b&gt;persistent&lt;/b&gt; data&lt;/p&gt;


&lt;p&gt;The current documentation states:&lt;/p&gt;

&lt;p&gt;&quot;Persisting, removing, detaching and merging individual entities can become pretty cumbersome, especially when a large object graph with collections is involved. Therefore Doctrine 2 provides a mechanism for transitive persistence through cascading of these operations. Each association to another entity or a collection of entities can be configured to automatically cascade certain operations. By default, no operations are cascaded.&lt;/p&gt;

&lt;p&gt;The following cascade options exist:&lt;/p&gt;

&lt;p&gt;persist : Cascades persist operations to the associated entities.&lt;br/&gt;
remove : Cascades remove operations to the associated entities.&lt;br/&gt;
merge : Cascades merge operations to the associated entities.&lt;br/&gt;
detach : Cascades detach operations to the associated entities.&lt;br/&gt;
all : Cascades persist, remove, merge and detach operations to associated entities.&quot;&lt;/p&gt;


&lt;p&gt;How are users supposed to understand, that the &quot;remove&quot; option is limited to in-memory object graphs, if all the docs say is &quot;Cascades remove operations to the associated entities.&quot;. From a user standpoint, the entities &lt;b&gt;are&lt;/b&gt; associated, and even the more so being persistent, aren&apos;t they?&lt;/p&gt;</comment>
                    <comment id="15684" author="dalvarez" created="Tue, 5 Apr 2011 05:38:52 +0000"  >&lt;p&gt;Also, we obviously have a different understanding of the word &quot;fixed&quot;.&lt;/p&gt;</comment>
                    <comment id="15686" author="beberlei" created="Tue, 5 Apr 2011 07:35:10 +0000"  >&lt;p&gt;Persist remove works, it fetches the association and deletes the objects, pulling them into memory.&lt;/p&gt;

&lt;p&gt;As to the ticket, i wanted to mark it as invalid and must have missclicked.&lt;/p&gt;</comment>
                    <comment id="15691" author="dalvarez" created="Tue, 5 Apr 2011 18:20:26 +0000"  >&lt;p&gt;If it works, why is there an exception?&lt;/p&gt;

&lt;p&gt;The situation was pretty isolated. The entity to be deleted was merge()d, and then remove()d. &quot;remove&quot; was declared as a cascade option.&lt;/p&gt;

&lt;p&gt;Doctrine simply issued a &quot;DELETE FROM \x where dbID = &apos;1&apos;&quot;, but did not remove the associated entity, instead violating the integrity constraint.&lt;/p&gt;</comment>
                    <comment id="16510" author="dalvarez" created="Sun, 25 Sep 2011 14:44:24 +0000"  >&lt;p&gt;I think we are referring to the same end result: After all, persistent state needs to be modified one way or the other. Otherwise it would not make any sense.&lt;/p&gt;

&lt;p&gt;Still, the cascading delete does not work for me. It does not modify persistent state in any way.&lt;/p&gt;

&lt;p&gt;E. g. I have a use case where the following association is declared within an entity class, say A.&lt;/p&gt;


&lt;p&gt;   /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@OneToOne(targetEntity=&quot;B&quot;, inversedBy=&quot;a&quot;, cascade=
{&quot;persist&quot;, &quot;remove&quot;, &quot;detach&quot;, &quot;merge&quot;}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;@JoinColumn(name=&quot;b_dbID&quot;, referencedColumnName=&quot;dbID&quot;)&lt;br/&gt;
    */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  protected $b;&lt;/p&gt;


&lt;p&gt;Here, the cascade option &quot;remove&quot; is set.&lt;/p&gt;

&lt;p&gt;Now, if I remove a persistent instance of this class, like so:&lt;/p&gt;

&lt;p&gt;$doctrineEntityManager-&amp;gt;merge($a);&lt;/p&gt;

&lt;p&gt;$doctrineEntityManager-&amp;gt;remove($a);&lt;/p&gt;

&lt;p&gt;it will delete that particular entity instance from the database, but none of the entity instances associated with it through the association.&lt;/p&gt;

&lt;p&gt;I made sure that also &quot;merge&quot; was activated for the association - just in case it matters to be able to pull the object graph into memory first.&lt;/p&gt;

&lt;p&gt;Funnily enough, inheritance relationships declare a ON DELETE CASCADE at the database level. Just that all non-inheritance associations rely on that other in-memory mechanism, that, in the scenario above, does not work. I don&apos;t get it why the same mechanism cannot be used for both scenarios - after all its about deleting dependent database rows in both cases.&lt;/p&gt;

&lt;p&gt;Am I doing it wrongly? How is this mechanism supposed to work? Could you please verify it does work? (For me, it does not, at least not as described above).&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="16511" author="dalvarez" created="Sun, 25 Sep 2011 14:46:29 +0000"  >&lt;p&gt;Oh yes, I forgot to mention I am now using version 2.1.1 of Doctrine. The last post was tested using version 2.1.1.&lt;/p&gt;</comment>
                    <comment id="16512" author="dalvarez" created="Sun, 25 Sep 2011 14:50:25 +0000"  >&lt;p&gt;Updated the issue data to reflect the current environment.&lt;/p&gt;</comment>
                    <comment id="16513" author="beberlei" created="Sun, 25 Sep 2011 15:54:05 +0000"  >&lt;p&gt;Can you give an example domain for this bug? since it seems to have to do either with merge or inheritance.&lt;/p&gt;

&lt;p&gt;following questions:&lt;/p&gt;

&lt;p&gt;1. does it work for you without inheritance&lt;br/&gt;
2. does it work by grabbing an entity using find, then remove.&lt;/p&gt;</comment>
                    <comment id="16525" author="dalvarez" created="Mon, 26 Sep 2011 03:24:22 +0000"  >&lt;p&gt;Thanks for your quick reply.&lt;/p&gt;

&lt;p&gt;I have now tested quite a number of different scenarios, both scenarios that involve inheritance, and scenarios that do not.&lt;/p&gt;

&lt;p&gt;Inheritance was just the matter in the original issue because the initial observation was that, at the database level, only inheritance relationships would declare an ON DELETE CASCADE constraint. Inheritance does not really have an effect on the basic problem that delete operations are not cascaded.&lt;/p&gt;

&lt;p&gt;As the application code I use involves a lot of inheritance, and since you explicitly mentioned it, I included inheritance in the tests, too, just to see if it made a difference. I performed the tests based on two different data models - first one where the target entity class of the association would inherit from another entity class, and a second one where it does not.&lt;/p&gt;

&lt;p&gt;In the end, inheritance did not matter. The results were the same whether the target entity inherits from a base class or not.&lt;/p&gt;

&lt;p&gt;What did matter is the way in which the delete was performed.&lt;/p&gt;

&lt;p&gt;I have accidentally given you wrong information about the way I actually deleted the entity instances in my last post. Since calling the remove method is the regular way I delete objects in my application, I blindly assumed it would be the same in this scenario. Unfortunately, I overlooked a special case here. In that case, the delete is performed using a DQL DELETE query.&lt;/p&gt;

&lt;p&gt;It seems that, for deletions performed using DQL queries, the cascade options are not respected. This is only logical, since - assuming that DQL gets compiled down straight to SQL and has no side effects on the in-memory objects - there will not be any in-memory object graph, and therefore any technique based purely on in-memory objects cannot possibly work for DQL.&lt;/p&gt;

&lt;p&gt;A solution would be to declare ON DELETE CASCADE constraints at the database level too (as already done in case of inheritance relationships) for associations that declare &quot;remove&quot; as a cascade option, so that the SQL resulting from the compilation of DQL DELETE queries will have the expected semantics, and maybe the onDelete annotation would be mandatory here.&lt;/p&gt;


&lt;p&gt;Here are the details of the tests I performed:&lt;/p&gt;



&lt;p&gt;First, here are the entity models used for the test:&lt;/p&gt;


&lt;p&gt;Here&apos;s the first, simple, model:&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 persistentData\model;

/**
 * @Entity
 */

class Something {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
   
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\SomethingElse&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;thing&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-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;})
    * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing_dbID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;dbID&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $otherThing;
}


/**
 * @Entity
 */

class SomethingElse {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\Something&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $thing;
}

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There is an entity class &quot;Something&quot; which refers to an entity class &quot;SomethingElse&quot; with a bidirectional one-to-one association&lt;br/&gt;
The association declares a typical set of cascade options I use, including &quot;remove&quot;. That&apos;s it.&lt;/p&gt;

&lt;p&gt;Here is the second model, where the target entity class of the association inherits from another entitiy class.&lt;br/&gt;
Except for the inheritance, this second model is functionally identical to the 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;&amp;lt;?php

namespace persistentData\model;

/**
 * @Entity
 */

class Something {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
   
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\SomethingElse&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;thing&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-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;})
    * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing_dbID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;dbID&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $otherThing;
}


/**
 * @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;doctrineTypeDiscriminator&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=64)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;baseClassForSomethingElse&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\BaseClassForSomethingElse&quot;&lt;/span&gt;,
 *                    &lt;span class=&quot;code-quote&quot;&gt;&quot;somethingElse&quot;&lt;/span&gt;               = &lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\SomethingElse&quot;&lt;/span&gt;})
 */

&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class BaseClassForSomethingElse {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
}



/**
 * @Entity
 */

class SomethingElse &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; BaseClassForSomethingElse {
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\Something&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $thing;
}

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;I used the Doctrine command-line tools to generate the proxy classes and update the database model. Consequently, the following tables were generated:&lt;/p&gt;

&lt;p&gt;For the simple model:&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;mysql&amp;gt; describe Something;
+-----------------+------------+------+-----+---------+----------------+
| Field           | Type       | Null | Key | Default | Extra          |
+-----------------+------------+------+-----+---------+----------------+
| dbID            | bigint(20) | NO   | PRI | NULL    | auto_increment |
| otherThing_dbID | bigint(20) | YES  | UNI | NULL    |                |
+-----------------+------------+------+-----+---------+----------------+


mysql&amp;gt; describe SomethingElse;
+-------+------------+------+-----+---------+----------------+
| Field | Type       | Null | Key | Default | Extra          |
+-------+------------+------+-----+---------+----------------+
| dbID  | bigint(20) | NO   | PRI | NULL    | auto_increment |
+-------+------------+------+-----+---------+----------------+
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;And for the model involving inheritance:&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; 
mysql&amp;gt; describe Something;
+-----------------+------------+------+-----+---------+----------------+
| Field           | Type       | Null | Key | Default | Extra          |
+-----------------+------------+------+-----+---------+----------------+
| dbID            | bigint(20) | NO   | PRI | NULL    | auto_increment |
| otherThing_dbID | bigint(20) | YES  | UNI | NULL    |                |
+-----------------+------------+------+-----+---------+----------------+


mysql&amp;gt; describe SomethingElse;
+-------+------------+------+-----+---------+-------+
| Field | Type       | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| dbID  | bigint(20) | NO   | PRI | NULL    |       |
+-------+------------+------+-----+---------+-------+


mysql&amp;gt; describe BaseClassForSomethingElse;
+---------------------------+-------------+------+-----+---------+----------------+
| Field                     | Type        | Null | Key | Default | Extra          |
+---------------------------+-------------+------+-----+---------+----------------+
| dbID                      | bigint(20)  | NO   | PRI | NULL    | auto_increment |
| doctrineTypeDiscriminator | varchar(64) | NO   |     | NULL    |                |
+---------------------------+-------------+------+-----+---------+----------------+
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;Using doctrine, I then created some sample entity instances:&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;$something = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Something();


$somethingElse = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SomethingElse();

$doctrineEntityManager-&amp;gt;persist($somethingElse);


$something-&amp;gt;otherThing = $somethingElse;

$doctrineEntityManager-&amp;gt;persist($something);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;The database ends up with the following content:&lt;/p&gt;


&lt;p&gt;For the simple model:&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;mysql&amp;gt; select * from Something;
+------+-----------------+
| dbID | otherThing_dbID |
+------+-----------------+
|    2 |               2 |
+------+-----------------+
1 row in set (0.00 sec)


mysql&amp;gt; select * from SomethingElse;
+------+
| dbID |
+------+
|    2 |
+------+
1 row in set (0.00 sec)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;And for the model involving inheritance:&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;mysql&amp;gt; select * from Something;
+------+-----------------+
| dbID | otherThing_dbID |
+------+-----------------+
|    1 |               1 |
+------+-----------------+
1 row in set (0.00 sec)

mysql&amp;gt; select * from SomethingElse;
+------+
| dbID |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

mysql&amp;gt; select * from BaseClassForSomethingElse;
+------+---------------------------+
| dbID | doctrineTypeDiscriminator |
+------+---------------------------+
|    1 | somethingElse             |
+------+---------------------------+
1 row in set (0.00 sec)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;We now have an entity instance of class &quot;Something&quot;, which refers to an entity instance of class &quot;SomethingElse&quot;. The database with the model involving inheritance is identical, except for the implementation detail that the entity instance of class &quot;SomethingElse&quot; inherits from an entity instance of class &quot;BaseClassForSomethingElse&quot;.&lt;/p&gt;


&lt;p&gt;This is the setup. Now to the program code:&lt;/p&gt;


&lt;p&gt;This code deletes both entity instances correctly, as expected, including the base class row in case of the second data model:&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 = $doctrineEntityManager-&amp;gt;createQuery(&apos;SELECT something
                                                FROM \persistentData\model\Something something
                                               WHERE something.dbID = 2&apos;);

$something = $query-&amp;gt;getSingleResult();

$doctrineEntityManager-&amp;gt;remove($something);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;This code will also work correctly, having the exact same effect as the code above:&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;$something = $doctrineEntityManager-&amp;gt;find(&apos;persistentData\model\Something&apos;, 2);

$doctrineEntityManager-&amp;gt;remove($something);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;However, this code will not work:&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 = $doctrineEntityManager-&amp;gt;createQuery(&apos;DELETE
                                                FROM \persistentData\model\Something something
                                               WHERE something.dbID = 2&apos;);

$something = $query-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;The code deletes the entity instance of class &quot;Something&quot;, but will not delete the dependent data object of class &quot;SomethingElse&quot;.&lt;/p&gt;


&lt;p&gt;It seems like the cascade option for the cascading delete is completely ignored by any delete operations performed through DQL queries (as opposed to e. g. calling the remove method on the entity manager).&lt;/p&gt;

&lt;p&gt;In the trivial example above, the query could simply be replaced by a call to the remove method, of course. Fortunately, in the application I am developing, this is possible, so I can resort to that.&lt;br/&gt;
But for queries involving more complex WHERE clauses, it will not be easily possible, except maybe by first performing a SELECT query to have the WHERE clause evaluated, and then iterating over the result object-by-object to delete them.&lt;/p&gt;


&lt;p&gt;Is this behaviour (cascade options being bypassed by DQL queries) intended? At least it is logical according to your explanation of the in-memory object-graph approach.&lt;br/&gt;
It would be a pain to understand though, with no clear mention of this fundamental restriction being available in the docs.&lt;/p&gt;

&lt;p&gt;However, I found a mention of an &quot;onDelete&quot; option in the &quot;transitive persistence&quot; section of the reference documentation&lt;/p&gt;

&lt;p&gt;&quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt; To rely on the database level cascade operations for the delete operation instead, you can configure each join column with the onDelete option. See the respective mapping driver chapters for more information.&quot;&lt;/p&gt;

&lt;p&gt;Do I &lt;b&gt;have&lt;/b&gt; to rely on that, even if cascade=&quot;remove&quot; is declared?&lt;/p&gt;


&lt;p&gt;The annotation reference explains the onDelete annotation as &quot;onDelete: Cascade Action (Database-level)&quot;. However, this is misleading, because a cascade option is understood to be one of &quot;persist&quot;/&quot;remove&quot;/&quot;detach&quot;/&quot;merge&quot;/&quot;all&quot; throughout the annotation reference. Only the Doctrine 1.2 docs contain a mention of &quot;database-level cascades&quot; (&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_1/ru/defining-models:transitive-persistence:database-level-cascades&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_1/ru/defining-models:transitive-persistence:database-level-cascades&lt;/a&gt;). Reading the source, I assume the syntax would be onDelete=&quot;cascade&quot;, but from the docs this is not evident.&lt;/p&gt;

&lt;p&gt;Personally, I would opt for generally using ON DELETE CASCADE constraints at the database level - either exclusively, or in addition to anything that might happen in the object domain. This is IMO the only efficient way to make the declared cascade=&lt;/p&gt;
{&quot;remove&quot;}
&lt;p&gt; constraint be generally effective.&lt;/p&gt;


&lt;p&gt;Please clarify if the behaviour is intended, and if declaring onDelete=&quot;cascade&quot; is mandatory to have DQL queries cascade delete operations.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="16526" author="dalvarez" created="Mon, 26 Sep 2011 03:32:49 +0000"  >&lt;p&gt;Wrapped the code in code blocks and the MySQL tables into noformat-blocks.&lt;/p&gt;</comment>
                    <comment id="16531" author="beberlei" created="Tue, 27 Sep 2011 07:25:51 +0000"  >&lt;p&gt;Ah ok, using DELETE makes all the difference. This is actually the exepcted behavior. Cascade Operations are purely in-memory operations and dont trigger on DELETE statements. That is waht the join column on-delete definitions are for.&lt;/p&gt;

&lt;p&gt;This is documented in the DQL chapter, but should probably be documented in the cascade section aswell: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#delete-queries&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#delete-queries&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16532" author="dalvarez" created="Tue, 27 Sep 2011 14:36:22 +0000"  >&lt;p&gt;Thanks for the clarification. Doctrine 2 really is one complex beast to tame.&lt;/p&gt;

&lt;p&gt;Maybe a note in the architecture section could point out that anything involving DQL belongs to the database domain as opposed to the object domain. As DQL is toutet as an object-query-language it is quite contrary to the principle of least astonishment that cascade constraints defined at the object-domain-level are ignored. Bypassing object-domain constraints basically makes DQL a mere SQL abstraction rather than a fully-blown object-query-language aware of the object domain constraints. This is a very fundamental architectural tenet.&lt;/p&gt;

&lt;p&gt;I will close this issue as invalid, because it does work as intended by the creators, even if the behaviour IMO constitutes a questionable design choice, being highly counter-intuitive without compensating for it by giving adequate other benefits to the user that would necessarily depend on that design choice.&lt;/p&gt;</comment>
                    <comment id="16533" author="dalvarez" created="Tue, 27 Sep 2011 14:37:45 +0000"  >&lt;p&gt;Works as intended, though maybe not as to be expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1096] &quot;You may have observed that in a mixed result, the object always ends up on index 0 of a result row.&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1096</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The DQL reference at&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;defines that&lt;/p&gt;

&lt;p&gt;&quot;You may have observed that in a mixed result, the object always ends up on index 0 of a result row.&quot;&lt;/p&gt;

&lt;p&gt;I find this too important to state it in such a parenthetic way.&lt;/p&gt;


&lt;p&gt;The reordering is counterintuitive behaviour at its worst, and grossly in violation of the principle of least astonishment. I bet noone would even guess that this could be intended behaviour. I would not consider this a classic bug, as it is documented behaviour, but as a way of deliberately doing it wrong, making mixed results totally counterintuitive to use. From a usability standpoint, this is as bad as it gets.&lt;/p&gt;

&lt;p&gt;I cannot think of any convincing reason why the ORM should decide on its own, and without any notice, to change the explicitly specified ordering from the select list, because it is absolutely confusing and IMO there is no advantage at all in doing so.&lt;/p&gt;

&lt;p&gt;I explicitly told Doctrine 2 to put the entity element on position 3, so why should it end up at position 0 without further notice? If position 0 is a must (which I do not think it should be), then the user should not be able to specify entity elements at any other position than that. As long as other positions are permissible, I would rather have the element stay at the exact position declared, and not be shuffled around.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12526">DDC-1096</key>
            <summary>&quot;You may have observed that in a mixed result, the object always ends up on index 0 of a result row.&quot;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Sun, 3 Apr 2011 09:37:06 +0000</created>
                <updated>Mon, 14 Nov 2011 03:36:02 +0000</updated>
                    <resolved>Mon, 31 Oct 2011 19:06:46 +0000</resolved>
                            <version>2.0.2</version>
                                <fixVersion>2.0.4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15657" author="dalvarez" created="Sun, 3 Apr 2011 09:40:46 +0000"  >&lt;p&gt;And: Is the entry in the manual bad humor? I mean the way the DQL reference puts it (&quot;You may have obverved...&quot;) - it even assumes it already took the user some experimentation. Really funny. I wish I had the time back I spent debugging.&lt;/p&gt;</comment>
                    <comment id="15658" author="beberlei" created="Sun, 3 Apr 2011 09:53:15 +0000"  >&lt;p&gt;I don&apos;t understand your confusion with this. How would you expect it to work? Scalar values have a name, so they are named. Objects dont have a &quot;name&quot; or alias and therefore key-based. Its just an convention.&lt;/p&gt;

&lt;p&gt;Yes the sentence may be formulated strangely, but its still stating how it works.&lt;/p&gt;</comment>
                    <comment id="15659" author="dalvarez" created="Sun, 3 Apr 2011 10:06:32 +0000"  >&lt;p&gt;I would expect this to work using regular numeric indexing. If Doctrine can put something at position 0, it should as well be able to put it at position 3. I do not see where this requires string keys.&lt;/p&gt;</comment>
                    <comment id="15660" author="dalvarez" created="Sun, 3 Apr 2011 10:09:49 +0000"  >&lt;p&gt;The confusion is due to the total deviation from regular query semantics. The behaviour to be expected is that when selecting Elements (A, B, C), A is listed first in the result rows, B comes second, and then C. Now, in case of mixed results, it can end up (A, C, B), (C, A, B), or (B, A, C), depending on the types of A, B, and C. Now, tell me this isn&apos; confusing.&lt;/p&gt;</comment>
                    <comment id="15661" author="dalvarez" created="Sun, 3 Apr 2011 10:11:32 +0000"  >&lt;p&gt;To support my point, Scalar expressions or Literals do not have a &quot;name&quot; either.&lt;/p&gt;</comment>
                    <comment id="15662" author="beberlei" created="Sun, 3 Apr 2011 11:26:00 +0000"  >&lt;p&gt;Its a requirement to put it on 0 the way how the hydration algorithm works. You would have to add some additional variables to the ResultSetMapping to save the name of an alias or the order with regards to scalar values, which adds additional variables that need to be cached and serialized/unserialized and going by a convention is just easier here.&lt;/p&gt;

&lt;p&gt;Scalar expressions and literals can use AS name, and start by a scalar counter of 1 per the requirement that objects start at 0. Multiple objects on the main level come in multiple result rows, so there is no clash possible here.&lt;/p&gt;

&lt;p&gt;This is quite different of how sql works with regards to conventions, but fetching an alias which is actually a set of many columns required this shift in conventions in our opinion.&lt;/p&gt;</comment>
                    <comment id="15663" author="dalvarez" created="Sun, 3 Apr 2011 12:29:39 +0000"  >&lt;p&gt;Multiple rows... geez, I did not think it would get any worse &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;

&lt;p&gt;In a word: counterintuitive. I am getting what you are explaining, nevertheless I perceive it as a way-too-complicated approach, without recompensating the user with advantages.&lt;/p&gt;


&lt;p&gt;I would suggest not relying on names at all for positioning. Names should be names and positions should be positions. In fact, names are not even unique. &lt;/p&gt;

&lt;p&gt;Consider this 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 A.somefield, A.somefield, A.somefield FROM \A
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I would expect it to return any number of rows with three elements each. It does not. It returns any number of rows with only one element each. That&apos;s because the implicit &quot;names&quot; clash internally, and are aliased to the same value, which apparently is not only used to identify the content, but also the whole output field. So in fact the query shown above is equivalent to&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 A.somefield FROM \A
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which is clearly not what the user asked for. Maybe it is a matter of &quot;hydration&quot;, but in this case it would be more straightforward to give the fields unique indexes automatically like &quot;somefield2&quot;, &quot;somefield3&quot;.&lt;/p&gt;

&lt;p&gt;I run into peculiarities like this one several times a week with Doctrine 2. I am not claiming that there is anything buggy about Doctrine 2 in this case. But I definitely have to say Doctrine 2 could behave much more intuitively. Even if it is intended behaviour, it is a nightmare to understand, and it is not something anyone would come up with intuitively by himself.&lt;/p&gt;

&lt;p&gt;In the original query example, I did not ask Doctrine to change the order specified, and would never ever ask for the result being split up into multiple rows. From a user perspective, the behavior is in no way desirable.&lt;/p&gt;

&lt;p&gt;From what I would expect, I would simply propose to always keep the ordering of fields in the result just as the user specified it, and always return one row for one match. I do not see any advantages in doing it any different, if not for purely technical reasons related to the existing implementation. What can I say - embrace change &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;</comment>
                    <comment id="15664" author="beberlei" created="Sun, 3 Apr 2011 12:59:24 +0000"  >&lt;p&gt;1. The example with a.somefield, a.somefield, a.somefield breaks down with standard SQL aswell leading to exactly the same result, just one &quot;somefield&quot;. This is why i would expect everyone coming from an SQL background working with scalar fields to alias everything, which ends with you getting all named fields and a zero key for the object.&lt;/p&gt;

&lt;p&gt;2. You can write your own hydrator if you wish to handle the multiple rows per object in the from statement. In that hydrator you could even handle positioning differently (I don&apos;t know if thats possible with the current information though).&lt;/p&gt;

&lt;p&gt;You can register it with the Configuration and pass its name to &quot;getResult()&quot; on any AbstractQuery. The default hydration has to stay this way obviously for BC reasons. Only negative thing about writing your own hydrator is that you have to copy paste lots of code because all the logic is inlined into one big method for performance reasons.&lt;/p&gt;

&lt;p&gt;I will update the docs about mixed results as they clearly lack detail and statements with regard to the conventions.&lt;/p&gt;
</comment>
                    <comment id="15665" author="beberlei" created="Sun, 3 Apr 2011 14:18:39 +0000"  >&lt;p&gt;Clarified in the docs.&lt;/p&gt;</comment>
                    <comment id="15674" author="dalvarez" created="Mon, 4 Apr 2011 05:28:18 +0000"  >&lt;p&gt;If I select the same field multiple times in SQL, I get multiple elements per row in the result set. That&apos;s an of-course.&lt;/p&gt;


&lt;p&gt;Here&apos;s the result from PostgreSQL 8.4.7&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;NameOfMyDatabase=# select dbID, dbID From WPOMOrder limit 1;
 dbid | dbid
------+------
  363 |  363
(1 row)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here&apos;s the result from MySQL Server 5.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;mysql&amp;gt; select dbID, dbID From WPOMOrder limit 1;
+------+------+
| dbID | dbID |
+------+------+
|  363 |  363 |
+------+------+
1 row in set (0.00 sec)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There is no intuitiveness whatsoever about the merge of multiple columns into a single one, neither in SQL, nor by any reasonable common-sense standard. If I specify it twice, I get it twice. And that&apos;s the only thing to expect, having explicitly defined it in the query. Now, imagine a user has to &quot;register with the configuration&quot; or &quot;write his own &quot;hydrator&quot;&quot;...&lt;/p&gt;


&lt;p&gt;Even using Aliasing, the result will still have two columns:&lt;/p&gt;


&lt;p&gt;Again, PostgreSQL 8.4.7:&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;NameOfMyDatabase=# select dbID as A, dbID as A From WPOMOrder limit 1;
  a  |  a
-----+-----
 363 | 363
(1 row)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and here&apos;s the result from MySQL Server 5.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;mysql&amp;gt; select dbID as a, dbID as a From WPOMOrder limit 1;
+-----+-----+
| a   | a   |
+-----+-----+
| 363 | 363 |
+-----+-----+
1 row in set (0.00 sec)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15676" author="beberlei" created="Mon, 4 Apr 2011 06:17:23 +0000"  >&lt;p&gt;Well yes, but using mysql_fetch_assoc/pg_fetch_assoc you will getone field again of course. ORM has no concept of numeric fetching at least not with the current hydrators.&lt;/p&gt;</comment>
                    <comment id="15681" author="dalvarez" created="Tue, 5 Apr 2011 05:21:48 +0000"  >&lt;p&gt;Well, that&apos;s what this issue is all about: That a concept of numeric fetching would be highly desirable. That there currently is no such concept is obvious.&lt;/p&gt;

&lt;p&gt;In case of the db drivers, there is almost always an option to simply return the row as-is, using numeric indexing, e. g. mysql_fetch_row, or pg_fetch_row. This avoids any unwanted merging of columns by name. If the user chooses the *_fetch_assoc functions instead, name clashes are to be expected. But you do not have to, by design, contrary to Doctrine 2, where this IMO highly broken behaviour is currently inherent.&lt;/p&gt;</comment>
                    <comment id="15682" author="dalvarez" created="Tue, 5 Apr 2011 05:22:57 +0000"  >&lt;p&gt;Not only that, what bugs me primarily is that it &lt;b&gt;reorders&lt;/b&gt; the resulting columns at its own liking.&lt;/p&gt;</comment>
                    <comment id="15685" author="beberlei" created="Tue, 5 Apr 2011 07:33:05 +0000"  >&lt;p&gt;It seems that everything that does not work as you want is broken. However there is a perfectly legitmate way to work with the hydrator and youre bloating a problem that is just not there, since DQL is primarily about fetching Objects the numerical fetch mechanism is not nearly as important as in the RMDBS world.&lt;/p&gt;

&lt;p&gt;Quoting a sentence from the docs that has nothing to do with numerical fetching as ticket title, saying nothing about that you want this as a feature in the ticket description imho doesnt constitute &quot;this is what is this issue about&quot;, i.e. a feature request about adding a numerical fetch mode. You can add a feature request ticket for this and I&apos;ll look into it.&lt;/p&gt;

&lt;p&gt;Additionally there is a consistent way how Doctrine names &quot;unnamed&quot; columns, its was just not documented good enough yet.&lt;/p&gt;</comment>
                    <comment id="15702" author="dalvarez" created="Wed, 6 Apr 2011 17:16:52 +0000"  >&lt;p&gt;I changed the issue type to &quot;improvement&quot; to not cause offence. The recent discussion was clearly heading in the wrong direction.&lt;/p&gt;

&lt;p&gt;Seriously, if the notion of  &quot;index 0&quot; has nothing to do with numerical indexing, I don&apos;t know what does. The statements &quot;As long as other positions are permissible, I would rather have the element stay at the exact position declared, and not be shuffled around.&quot; and &quot;From what I would expect, I would simply propose to always keep the ordering of fields in the result just as the user specified it&quot; are, to me, as clear as it gets about desiring the described characteristic.&lt;/p&gt;

&lt;p&gt;I certainly do not mean any offense. All I want is provide you with feedback. Of course, this is not always possible without voicing a different opinion. Issues are, by nature, mostly things that are wanted differently than they are. As I said right up-front, I did and do not mean to report this as a classical bug, because I knew from the documentation that it was intended, but rather as a severely couterintuitive behaviour, which I still insist it is. I did not enter it as an explicit feature request here, because maintaining the ordering specified is already implemented (in case of non-&quot;mixed&quot; results), and the solution of this issue would rather be to simply always maintain the ordering given, and getting rid of a special case of deliberately overriding the given order for &quot;mixed&quot; results. So I could not see the new feature here. Now, considering it, I think &quot;improvement&quot; nails it.&lt;/p&gt;

&lt;p&gt;Getting back to what I originally wished would work differently, I wish that selecting the columns (A, B, C) would return result rows of the form (A, B, C) always, and under no circumstances of the form (A, C, B), (C A B) or (B A C). Column names would be just that, and a column having no name would still be rendered at the column position specified by the ordering in the select expression.&lt;/p&gt;</comment>
                    <comment id="15704" author="beberlei" created="Wed, 6 Apr 2011 17:44:07 +0000"  >&lt;p&gt;Do you mean the order regardless of keys?&lt;/p&gt;

&lt;p&gt;Say SELECT A B C=&amp;gt; $a = array_shift($result); $b = array_shift($result); $c = array_shift($result) ?&lt;/p&gt;</comment>
                    <comment id="15707" author="dalvarez" created="Thu, 7 Apr 2011 06:49:56 +0000"  >&lt;p&gt;Yes, that&apos;s exactly what I mean (ignoring the shifting side effect on the result of course).&lt;/p&gt;

&lt;p&gt;It would be:&lt;/p&gt;

&lt;p&gt;$A = reset($result);&lt;br/&gt;
$B = next($result);&lt;br/&gt;
$C = next($result);&lt;/p&gt;


&lt;p&gt;And never, e. g.:&lt;/p&gt;

&lt;p&gt;$C = reset($result);&lt;br/&gt;
$A = next($result);&lt;br/&gt;
$B = next($result);&lt;/p&gt;


&lt;p&gt;If you&apos;d rely on numeric indexes, it would be:&lt;/p&gt;

&lt;p&gt;Basically: SELECT A, B, C -&amp;gt; $A = $result&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;, $B = $result&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, $C = $result&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;Or: list ($A, $B, $C) = $result;&lt;/p&gt;


&lt;p&gt;And never: SELECT A, B, C -&amp;gt; $A = $result&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;, $B = $result&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;, $C = $result&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;Or: list ($C, $A, $B) = $result;&lt;/p&gt;


&lt;p&gt;Numeric indexing is, though, of course not guaranteed to correctly identify positioning under all circumstances due to the associative-table nature of PHP arrays. E. g. if you populate an array with non-continuous numeric keys, say array (3 = &amp;gt; &apos;someValue&apos;, 5 = &apos;someOtherValue&apos;), you end up with an array with numeric key 3 at position 0, where the key is clearly not suitable to identify the element&apos;s position. But provided you assign numeric keys to the elements in such a way that the numeric keys coincide with the element positions in the array (i. e. the element at position 0 has numeric key 0, and the element at position 1 has numeric key 1), then, of course, you could use numeric keys internally to identify element positions. Then again, you do not need to, the approach of using the de-facto element positions should be more fail-safe.&lt;/p&gt;</comment>
                    <comment id="15708" author="dalvarez" created="Thu, 7 Apr 2011 07:17:24 +0000"  >&lt;p&gt;Which reminds me... I will have to double-check that it is not the list() calls I do on the result that are screwing things up.&lt;/p&gt;</comment>
                    <comment id="15816" author="dalvarez" created="Sun, 8 May 2011 18:24:36 +0000"  >&lt;p&gt;Sorry for the late update.&lt;/p&gt;

&lt;p&gt;I double checked that the effect is not caused by using the list construct on the result in application code.&lt;/p&gt;

&lt;p&gt;For DQL queries of the following form:&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 someEntityReference.someStringValuedField, someEntityReference
    FROM \SomeEntity someEntityReference
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the fields in the result rows will have got shuffled around as soon as the result is returned by Doctrine 2, i. e. before any list() function or the like gets called on it in application code.&lt;/p&gt;


&lt;p&gt;Calling gettype() on the result elements, 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;$result = $aQueryOfTheFormShownAbove-&amp;gt;getResult();

$firstResultElement = reset($result);

foreach ($firstResultElement as $field) {
  
   echo gettype($field) . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;will output:&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;object
string
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;whereas the DQL query explicitly asked for a result of the form (string, object), not (object, string).&lt;/p&gt;

&lt;p&gt;To my best knowledge, the foreach construct will rely only on the actual positioning regardless of the key values in the input array.&lt;/p&gt;

&lt;p&gt;So the situation is just as I have previously described.&lt;/p&gt;</comment>
                    <comment id="16744" author="beberlei" created="Mon, 31 Oct 2011 19:06:46 +0000"  >&lt;p&gt;Result keys Will be implemented as part of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1424&quot; title=&quot;Make order in DQL SELECT clause matter for hydration&quot;&gt;&lt;del&gt;DDC-1424&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16817" author="guilhermeblanco" created="Mon, 14 Nov 2011 03:36:02 +0000"  >&lt;p&gt;Improvement implemented in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/81cc6d9da83d217ea62bd467053fd9885d1083cd&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/81cc6d9da83d217ea62bd467053fd9885d1083cd&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="13089">DDC-1424</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1706] aggregate all writes does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1706</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have 1 entity :&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 Test\DoctrineBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
 
/**
 * Test\DoctrineBundle\Entity\User
 *
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class User
{
    /**
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\Id
     * @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(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;, 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;

...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;In controller, i create 2 users, i persist and i flush&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 indexAction()
    {
        $em = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDoctrine()-&amp;gt;getEntityManager();
        $repository = $em-&amp;gt;getRepository(&apos;TestDoctrineBundle:User&apos;);
        
        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
        $user-&amp;gt;setName(&apos;name-&apos;.rand(1, 1000));
        $em-&amp;gt;persist($user);
        
        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
        $user-&amp;gt;setName(&apos;name-&apos;.rand(1, 1000));
        $em-&amp;gt;persist($user);
        
        $em-&amp;gt;flush();
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; array();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Results, i have 3 requests&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 08:23:53&amp;#93;&lt;/span&gt; doctrine.DEBUG: SET NAMES UTF8&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 08:23:53&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-683&quot;}
&lt;p&gt;)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 08:23:53&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-638&quot;}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;I expect to have only 2 requests because i think &quot;INSERT&quot; lines have to be into one single transaction.&lt;/p&gt;

&lt;p&gt;I am on dev environment, because in production, i can not know how many request i have.&lt;/p&gt;</description>
                <environment>Standard edition Symfony v2.0.11</environment>
            <key id="13530">DDC-1706</key>
            <summary>aggregate all writes does not work</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jforet">J&#233;r&#244;me For&#234;t</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Mar 2012 08:34:28 +0000</created>
                <updated>Thu, 15 Mar 2012 11:12:15 +0000</updated>
                    <resolved>Thu, 15 Mar 2012 11:12:15 +0000</resolved>
                            <version>2.1.5</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17592" author="beberlei" created="Thu, 15 Mar 2012 08:46:26 +0000"  >&lt;p&gt;This has nothing to do with each other. You are just showing the log output. The Begin and Commit Statements are not listed in the log, the queries are still executed consequitevly, but they are aggregated in the transaction.&lt;/p&gt;</comment>
                    <comment id="17593" author="jforet" created="Thu, 15 Mar 2012 10:59:37 +0000"  >&lt;p&gt;Thank you, Benjamin. Ok I understand what you say.&lt;br/&gt;
But I think it&apos;s too simple, or the tools provide incomplete information.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;1st sample :&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;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-1&apos;);
$em-&amp;gt;persist($user);

$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-2&apos;);
$em-&amp;gt;persist($user);

$em-&amp;gt;flush();
        
$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-3&apos;);
$em-&amp;gt;persist($user);

$em-&amp;gt;flush();

$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-4&apos;);
$em-&amp;gt;persist($user);

$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The dev.log gives 4 queries ; the webprofiler bar in sf shows 4 queries.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:50:01&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-1&quot;}
&lt;p&gt;)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:50:01&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-2&quot;}
&lt;p&gt;)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:50:01&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-3&quot;}
&lt;p&gt;)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:50:01&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-4&quot;}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;&lt;b&gt;2nd sample :&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;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-1&apos;);
$em-&amp;gt;persist($user);

$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-2&apos;);
$em-&amp;gt;persist($user);
        
$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-3&apos;);
$em-&amp;gt;persist($user);

$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setName(&apos;name-4&apos;);
$em-&amp;gt;persist($user);

$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The dev.log gives 4 queries ; the webprofiler bar in sf shows 4 queries.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:51:31&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-1&quot;}
&lt;p&gt;)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:51:31&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-2&quot;}
&lt;p&gt;)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:51:31&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-3&quot;}
&lt;p&gt;)&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2012-03-15 11:51:31&amp;#93;&lt;/span&gt; doctrine.DEBUG: INSERT INTO user (name) VALUES &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;
{&quot;1&quot;:&quot;name-4&quot;}
&lt;p&gt;)&lt;/p&gt;


&lt;p&gt;In 1st sample, there is 3 transactions.&lt;br/&gt;
In 2nd sample, there is 1 transaction.&lt;/p&gt;

&lt;p&gt;Is there a possibility to know number of transactions because i think it can help developpers in order to have better performances.&lt;/p&gt;

&lt;p&gt;Maybe it is not in doctrine, it is in Symfony webprofiler; what do you think ?&lt;/p&gt;</comment>
                    <comment id="17594" author="beberlei" created="Thu, 15 Mar 2012 11:12:15 +0000"  >&lt;p&gt;Well the Symfony debug profiler only shows the queries, not the transactions. If you need the transactions you can extend it of course, for example listening to the &quot;onFlush&quot; event that marks the start of a UnitOfwork transaction. Its still not a bug and we won&apos;t add it to the core Doctrine bundle.&lt;/p&gt;

&lt;p&gt;EntityManager#flush wrapping the transaction is discussed at length in the documentation.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-229] Changeset 6982 breakage</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-229</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6982/&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6982/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The new processDeferredExpressionsStack does not look good. It processes &lt;b&gt;all&lt;/b&gt; expressions. Previously, each (sub)query had its own stack.&lt;/p&gt;

&lt;p&gt;Now, when you do sth like this: &quot;select u, (select max(o.id) from Other o) maxId from User u&quot; you will trigger all validations at the end of the subquery. &apos;u&apos; will be validated but is still undefined.&lt;/p&gt;

&lt;p&gt;Please explain why the old behavior with one stack for each (sub)query was not preserved.&lt;/p&gt;

&lt;p&gt;Also, things 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;$method = &apos;_validate&apos; . $item[&apos;method&apos;]; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;lead to very fragile (bad) code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10666">DDC-229</key>
            <summary>Changeset 6982 breakage</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Dec 2009 15:39:57 +0000</created>
                <updated>Sun, 27 Dec 2009 18:45:44 +0000</updated>
                    <resolved>Sun, 27 Dec 2009 18:45:44 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11302" author="guilhermeblanco" created="Sun, 27 Dec 2009 18:45:44 +0000"  >&lt;p&gt;Just a little mis-comprehension of the new way I&apos;ve build expressions validations.&lt;br/&gt;
Resolving ticket.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-214] schema-tool --complete-update throw PDOException on DROP INDEX</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-214</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Here is the stack trace&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;SchemaTool: exception &apos;PDOException&apos; with message &apos;SQLSTATE[HY000]: General error: 1025 Error on rename of &apos;./fna_common/#sql-665_60b&apos; to &apos;./fna_common/fna_owned_insurance&apos; (errno: 150)&apos; in /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Connection.php:571
Stack trace:
#0 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Connection.php(571): PDO-&amp;gt;query(&apos;DROP INDEX fna_...&apos;)
#1 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(537): Doctrine\DBAL\Connection-&amp;gt;execute(&apos;DROP INDEX fna_...&apos;)
#2 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/Cli/Tasks/SchemaToolTask.php(217): Doctrine\ORM\Tools\SchemaTool-&amp;gt;updateSchema(Array, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
#3 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/Cli/CliController.php(190): Doctrine\ORM\Tools\Cli\Tasks\SchemaToolTask-&amp;gt;run()
#4 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/doctrine/doctrine.php(19): Doctrine\ORM\Tools\Cli\CliController-&amp;gt;run(Array)
#5 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/doctrine/doctrine(4): include(&apos;/home/eric/Zend...&apos;)
#6 {main}

#0 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/Cli/CliController.php(190): Doctrine\ORM\Tools\Cli\Tasks\SchemaToolTask-&amp;gt;run()
#1 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/doctrine/doctrine.php(19): Doctrine\ORM\Tools\Cli\CliController-&amp;gt;run(Array)
#2 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/doctrine/doctrine(4): include(&apos;/home/eric/Zend...&apos;)
#3 {main}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think the problem is in the Schema Comparator.  It generate a DROP for a foreign key index. &lt;/p&gt;

&lt;p&gt;If you compare the index definition from database and from metadata you will see that the foreign key index is present only in the definition obtained from database.&lt;/p&gt;

&lt;p&gt;Database : &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
(
    [primary] =&amp;gt; Doctrine\DBAL\Schema\Index &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
        (
            [_columns:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; Array
                (
                    [0] =&amp;gt; id
                )

            [_isUnique:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; 1
            [_isPrimary:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; 1
            [_name:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; PRIMARY
        )

    [fna_client_id] =&amp;gt; Doctrine\DBAL\Schema\Index &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
        (
            [_columns:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; Array
                (
                    [0] =&amp;gt; fna_client_id
                )

            [_isUnique:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt;
            [_isPrimary:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt;
            [_name:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; fna_client_id
        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From metadata :&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
(
    [primary] =&amp;gt; Doctrine\DBAL\Schema\Index &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
        (
            [_columns:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; Array
                (
                    [0] =&amp;gt; id
                )

            [_isUnique:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; 1
            [_isPrimary:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; 1
            [_name:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; primary
        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10624">DDC-214</key>
            <summary>schema-tool --complete-update throw PDOException on DROP INDEX</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rickdt">Eric Durand-Tremblay</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Dec 2009 18:07:28 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:45 +0000</updated>
                    <resolved>Sun, 7 Feb 2010 07:38:27 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11204" author="rickdt" created="Wed, 16 Dec 2009 18:11:42 +0000"  >&lt;p&gt;I take the index definition from DBAL/Schema/Comparator:207&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;$table1Indexes = $table1-&amp;gt;getIndexes();
$table2Indexes = $table2-&amp;gt;getIndexes();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11205" author="beberlei" created="Wed, 16 Dec 2009 18:23:02 +0000"  >&lt;p&gt;Which database platform is this happening on?&lt;/p&gt;</comment>
                    <comment id="11206" author="rickdt" created="Wed, 16 Dec 2009 18:27:10 +0000"  >&lt;p&gt;mysql&lt;/p&gt;</comment>
                    <comment id="11236" author="beberlei" created="Sat, 19 Dec 2009 15:41:30 +0000"  >&lt;p&gt;Ok so Mysql creates an index for each foreign key implicitly which is then queryable explicitly.&lt;/p&gt;

&lt;p&gt;To fix this the schema comparator &quot;FixSchema&quot; visitor accompanies for that for the MySQL Platform. Do you use your own platform maybe?&lt;/p&gt;</comment>
                    <comment id="11237" author="beberlei" created="Sat, 19 Dec 2009 15:43:22 +0000"  >&lt;p&gt;You could really help me if you could paste the serialized object code for both schema instances for your use-case or a reproduce case.&lt;/p&gt;</comment>
                    <comment id="11255" author="rickdt" created="Mon, 21 Dec 2009 13:22:15 +0000"  >&lt;p&gt;Here are the serialized schema you required.&lt;/p&gt;</comment>
                    <comment id="11256" author="rickdt" created="Mon, 21 Dec 2009 13:23:47 +0000"  >&lt;p&gt;I only use Doctrine basic feature, no custom platform.&lt;/p&gt;</comment>
                    <comment id="11602" author="rickdt" created="Wed, 3 Feb 2010 18:23:26 +0000"  >&lt;p&gt;Can I do anything to help you resolve this issue.  This is really a big annoyance not being able to update existing database.&lt;/p&gt;</comment>
                    <comment id="11603" author="rickdt" created="Wed, 3 Feb 2010 19:02:33 +0000"  >&lt;p&gt;Attached a test case&lt;/p&gt;

&lt;p&gt;Doctrine/Tests/ORM/Functional/Ticket/DDC214Test&lt;/p&gt;</comment>
                    <comment id="11604" author="rickdt" created="Wed, 3 Feb 2010 19:03:34 +0000"  >&lt;p&gt;The test case must be run using mysql.&lt;/p&gt;</comment>
                    <comment id="11605" author="beberlei" created="Wed, 3 Feb 2010 20:31:17 +0000"  >&lt;p&gt;hah thats an awesome-ly simple test-case.&lt;/p&gt;

&lt;p&gt;thank you very much &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="11606" author="beberlei" created="Wed, 3 Feb 2010 22:56:44 +0000"  >&lt;p&gt;Yes, i found the issue - however the test-case will not work with me requiring it to have 0 change sqls - there is another bug that is related to not null and default values.&lt;/p&gt;</comment>
                    <comment id="11611" author="rickdt" created="Thu, 4 Feb 2010 14:32:10 +0000"  >&lt;p&gt;I did not really intend to do a &quot;clean&quot; unit test.  I just wanted allow you reproduce the problem.&lt;/p&gt;

&lt;p&gt;Good news you have been able to reproduce the issue.&lt;/p&gt;

&lt;p&gt;And again, your great work is really appreciated!&lt;/p&gt;</comment>
                    <comment id="11625" author="beberlei" created="Sun, 7 Feb 2010 07:38:27 +0000"  >&lt;p&gt;This and many more issues have been fixed.&lt;/p&gt;</comment>
                    <comment id="11638" author="rickdt" created="Tue, 9 Feb 2010 13:31:17 +0000"  >&lt;p&gt;This is VERY VERY VERY Great!!!&lt;/p&gt;

&lt;p&gt;I experienced serious perfomance issue with the query  (getListTableForeignKeysSql) :&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;  $sql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;FROM information_schema.key_column_usage k /*!50116 &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;  c.constraint_name = k.constraint_name AND &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;  c.table_name = k.table_name */ WHERE k.table_name = &apos;$table&apos;&quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think this is a bug in mysql server (5.1.37-1ubuntu5).&lt;/p&gt;

&lt;p&gt;I changed the query a little bit and it work great : &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;  $sql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;FROM information_schema.key_column_usage k /*!50116 &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;  c.constraint_name = k.constraint_name AND &quot;&lt;/span&gt;.
               &lt;span class=&quot;code-quote&quot;&gt;&quot;  c.table_name = &apos;$table&apos; */ WHERE k.table_name = &apos;$table&apos;&quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11639" author="beberlei" created="Tue, 9 Feb 2010 13:48:36 +0000"  >&lt;p&gt;Patched, and speedy again! Thank you very much.&lt;/p&gt;</comment>
                    <comment id="11640" author="rickdt" created="Tue, 9 Feb 2010 13:55:14 +0000"  >&lt;p&gt;That was fast!&lt;/p&gt;</comment>
                    <comment id="13059" author="jwage" created="Tue, 25 May 2010 13:37:04 +0000"  >&lt;p&gt;The test for this issue is failing for me under mysql.&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;
There was 1 failure:

1) Doctrine\Tests\ORM\Functional\Ticket\DDC214Test::testCompanyModel
Failed asserting that &amp;lt;integer:8&amp;gt; matches expected &amp;lt;integer:0&amp;gt;.

/Users/jwage/Sites/doctrine2-orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC214Test.php:77
/Users/jwage/Sites/doctrine2-orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC214Test.php:54

FAILURES!
Tests: 736, Assertions: 2260, Failures: 1, Skipped: 6.

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Any ideas?&lt;/p&gt;</comment>
                    <comment id="13127" author="romanb" created="Sun, 6 Jun 2010 17:38:03 +0000"  >&lt;p&gt;Seems to fail under postgres, too.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10244" name="both_schema_print_r" size="1414965" author="rickdt" created="Mon, 21 Dec 2009 13:22:15 +0000" />
                    <attachment id="10343" name="DDC214Test.php" size="1112" author="rickdt" created="Wed, 3 Feb 2010 19:02:33 +0000" />
                    <attachment id="10242" name="from_schema" size="312423" author="rickdt" created="Mon, 21 Dec 2009 13:22:15 +0000" />
                    <attachment id="10243" name="to_schema" size="131304" author="rickdt" created="Mon, 21 Dec 2009 13:22:15 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-204] ActiveEntity persistent object recursion on self referencing class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-204</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using a self-referencing relationship, 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;  /**
   * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Collection&quot;&lt;/span&gt;)
   * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;parent_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;var&lt;/span&gt; Collection
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $parent;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;ActiveEntity::toArray() recurses through all parents and children.&lt;/p&gt;

&lt;p&gt;This was all working fine until my database actually started getting some data... then XDebug stopped me with a &quot;Maximum function nesting level of &apos;100&apos; reached, aborting!&quot; 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;..
..
95 0.2574 14222056 Proxies\CollectionProxy-&amp;gt;toArray( ) ..\ActiveEntity.php:164 
96 0.2574 14222056 DoctrineExtensions\ActiveEntity-&amp;gt;toArray( ) ..\CollectionProxy.php:183 
97 0.2576 14231520 Proxies\CollectionProxy-&amp;gt;toArray( ) ..\ActiveEntity.php:173 
98 0.2576 14231520 DoctrineExtensions\ActiveEntity-&amp;gt;toArray( ) ..\CollectionProxy.php:183 
99 0.2576 14231736 Doctrine\ORM\EntityManager-&amp;gt;getClassMetadata( ) ..\ActiveEntity.php:150 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The PersistentCollection object does not have a state so cannot be locked in the same was as an ActiveEntity object can - maybe it needs a lockable state for this to work?&lt;/p&gt;</description>
                <environment></environment>
            <key id="10597">DDC-204</key>
            <summary>ActiveEntity persistent object recursion on self referencing class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="russ">Russ Flynn (rooster)</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Dec 2009 00:45:43 +0000</created>
                <updated>Tue, 16 Mar 2010 15:24:00 +0000</updated>
                    <resolved>Tue, 16 Mar 2010 15:24:00 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11890" author="jwage" created="Mon, 1 Mar 2010 15:45:37 +0000"  >&lt;p&gt;Is this still a problem or has it been fixed?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10248" name="ActiveEntity-DDC-204.diff" size="1480" author="russ" created="Tue, 22 Dec 2009 13:27:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-197] OCI8 does handle CLOBS differently than all PDO drivers</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-197</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;OCI8 returns OCI-LOB objects instead of the clob directly (also for binary large objects) as described by the Underground Manual to PHP and Oracle.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf&quot; class=&quot;external-link&quot;&gt;http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To accompany for this behaviour we need to use the described methods to directly get access to strings:&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;//   Instead of using locators, LOB data can alternatively be returned as a string:
&lt;/span&gt;$arr = oci_fetch_array($s, OCI_ASSOC+OCI_RETURN_LOBS);
echo $arr[&apos;BLOBDATA&apos;];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And use temporary LOBs for update/insert:&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; emporary LOBs
Temporary LOBs make some operations easier. Inserting data with a Temporary LOB does not use a
RETURNING INTO clause:
Script 70: tempblobinsert.php
&amp;lt;?php
$c = oci_connect(&apos;hr&apos;, &apos;hrpwd&apos;, &apos;localhost/XE&apos;);
$myblobid = 124;
$myv = &apos;a very large amount of binary data&apos;;
$s = oci_parse($c, &apos;insert into mybtab (blobid, blobdata)
                            values (:myblobid, :blobdata)&apos;);
$lob = oci_new_descriptor($c, OCI_D_LOB);
oci_bind_by_name($s, &apos;:myblobid&apos;, $myblobid);
oci_bind_by_name($s, &apos;:blobdata&apos;, $lob, -1, OCI_B_BLOB);
$lob-&amp;gt;writeTemporary($myv, OCI_TEMP_BLOB);
oci_execute($s, OCI_DEFAULT);
oci_commit($c);
$lob-&amp;gt;close();             &lt;span class=&quot;code-comment&quot;&gt;// close lob descriptor to free resources
&lt;/span&gt;?&amp;gt;
Temporary LOBs also simplify updating values:
$s = oci_parse($c, &apos;update mybtab set blobdata = :bd where blobid = :bid&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10573">DDC-197</key>
            <summary>OCI8 does handle CLOBS differently than all PDO drivers</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 Dec 2009 23:39:55 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:45 +0000</updated>
                    <resolved>Sun, 6 Dec 2009 23:46:34 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11031" author="beberlei" created="Sun, 6 Dec 2009 23:42:14 +0000"  >&lt;p&gt;Added test that fails on Oracle OCI into BasicFunctionalTest TestCase.&lt;/p&gt;

&lt;p&gt;I think we should handle CLOBs and BLOBs differently.&lt;/p&gt;

&lt;p&gt;a CLOB should be a string by default, however a BLOB on any platform should look like an OCI-LOB instance imho.&lt;/p&gt;</comment>
                    <comment id="11032" author="beberlei" created="Sun, 6 Dec 2009 23:46:33 +0000"  >&lt;p&gt;Hm, the simple addition of the OCI_RETURN_LOBS constant seemed to work. That easy? We&apos;ll see!&lt;/p&gt;</comment>
                    <comment id="11035" author="romanb" created="Mon, 7 Dec 2009 10:57:27 +0000"  >&lt;p&gt;The current solution is fine as a start. Its just that this setting also affects blobs.&lt;/p&gt;

&lt;p&gt;This gets problematic whenever a clob/blob is very large, in which case its not really good to load it all at once. We probably need new types for this stuff.&lt;/p&gt;

&lt;p&gt;1) a ClobType&lt;br/&gt;
2) a BlobType&lt;/p&gt;

&lt;p&gt;both being represented by some kind of object that wraps the platform differences.&lt;/p&gt;

&lt;p&gt;However, its not easy to propagate to the driver whetner to use OCI_RETURN_LOBS or not.&lt;/p&gt;

&lt;p&gt;So I think the current behavior is fine as a start. There is nothing better and simpler that works right now.&lt;/p&gt;</comment>
                    <comment id="11036" author="beberlei" created="Mon, 7 Dec 2009 11:18:54 +0000"  >&lt;p&gt;PDO handles BLOB vs CLOB differently afaik, i can&apos;t tell for sure though. I think for BLOBs pdo returns a file pointer, CLOBs are returned as string.&lt;/p&gt;

&lt;p&gt;Now how PDO recognizes the difference for example in the case of oracle is probably not configurable for the enduser.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-192] Composite primary key workaround stopped working after SchemaTool refactoring</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-192</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This example shows a &lt;b&gt;User&lt;/b&gt; and a &lt;b&gt;Phonenumber&lt;/b&gt; entity, where the &lt;b&gt;Phonenumber&lt;/b&gt; entity has a &lt;em&gt;phone&lt;/em&gt; column and a &lt;em&gt;userId&lt;/em&gt; column (which maps the Phonenumber to the User). Primary key should be composite (phone, userId).&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pastie.org/private/uoawwvf75onnvph8bj1fwg&quot; class=&quot;external-link&quot;&gt;http://pastie.org/private/uoawwvf75onnvph8bj1fwg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Normally I would achieve this by adding @Id to the User association in Phonenumber.php, but since @Id is not supported for associations, I added a userId property (which I have to set every time I set the User property). &lt;/p&gt;

&lt;p&gt;After the SchemaTool refactoring, Doctrine 2 complains about duplicate keys when trying to create the database...&lt;/p&gt;

&lt;p&gt;see &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; (@Id on associations should really be supported and add the &quot;JoinColumn name&quot; to the list of primary keys...)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10553">DDC-192</key>
            <summary>Composite primary key workaround stopped working after SchemaTool refactoring</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 11:29:44 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:45 +0000</updated>
                    <resolved>Tue, 8 Dec 2009 18:53:49 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11026" author="beberlei" created="Sun, 6 Dec 2009 23:19:37 +0000"  >&lt;p&gt;Can you comment on this issue, is it still present?&lt;/p&gt;</comment>
                    <comment id="11084" author="romanb" created="Tue, 8 Dec 2009 14:02:30 +0000"  >&lt;p&gt;Can this be considered fixed now?&lt;/p&gt;</comment>
                    <comment id="11090" author="nicokaiser" created="Tue, 8 Dec 2009 16:44:45 +0000"  >&lt;p&gt;Looks good!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-191] Case sensitive columnName&apos;s don&apos;t work anymore</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-191</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Since the Schema refactoring, misc case column names do not work again.&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

/**
 * @Entity @Table(name=&quot;user&quot;)
 */
class User
{ 
    /** @Id @Column(name=&quot;userId&quot;, type=&quot;integer&quot;) @GeneratedValue(strategy=&quot;AUTO&quot;)  */
    public $id;
    
    /** @Column(name=&quot;name&quot;, type=&quot;string&quot;)  */
    public $name;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This crashes the SchemaTool when creating the database schema: &lt;/p&gt;

&lt;p&gt;&lt;cite&gt;SchemaTool: exception &apos;Doctrine\DBAL\Schema\SchemaException&apos; with message &apos;An unknown column-name userId was given.&apos; in .../doctrine/lib/Doctrine/DBAL/Schema/SchemaException.php:60&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;This may be because of several strtolower calls, e.g. in Doctrine\DBAL\Schema\Table (&quot;$columnName = strtolower($columnName);&quot;)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10552">DDC-191</key>
            <summary>Case sensitive columnName&apos;s don&apos;t work anymore</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 10:55:56 +0000</created>
                <updated>Fri, 25 Nov 2011 20:58:47 +0000</updated>
                    <resolved>Tue, 8 Dec 2009 18:54:58 +0000</resolved>
                                            <fixVersion>2.0-ALPHA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10989" author="beberlei" created="Thu, 3 Dec 2009 12:31:51 +0000"  >&lt;p&gt;Oh! &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;/p&gt;

&lt;p&gt;I&apos;ll fix it asap, that means this evening. Sorry &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;/p&gt;</comment>
                    <comment id="10999" author="beberlei" created="Thu, 3 Dec 2009 22:16:03 +0000"  >&lt;p&gt;Can you try again? I implemented case handling in Schema now and added a test-case for this problem.&lt;/p&gt;</comment>
                    <comment id="11030" author="beberlei" created="Sun, 6 Dec 2009 23:20:52 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                    <comment id="11034" author="nicokaiser" created="Mon, 7 Dec 2009 10:44:03 +0000"  >&lt;p&gt;The example given (with &quot;userId&quot; as column name for $id) still does not work. And there are still strtolower in Doctrine\DBAL\Schema\Table - is this intended? In my opinion the DB column names should be preserved exactly as they are written in the annotations (e.g. &quot;userId&quot;, not &quot;userid&quot;)...&lt;/p&gt;</comment>
                    <comment id="11037" author="beberlei" created="Mon, 7 Dec 2009 11:34:43 +0000"  >&lt;p&gt;The strtolower in Table is just for the platform independent access to column names, however for generation the Column::getName() is used. There is never a strtolower applied to this, so i am a bit puzzled to where this should happen.&lt;/p&gt;

&lt;p&gt;I have to look at it again.&lt;/p&gt;</comment>
                    <comment id="11041" author="romanb" created="Mon, 7 Dec 2009 13:44:50 +0000"  >&lt;p&gt;@Nico: Just to shed some light on this issue because I assume this sounds trivial to you at first glance. The casing is a major pain with database portability. For example, whether you query for &quot;coLuMn&quot; or &quot;colUmn&quot; or &quot;COLUMN&quot;, Postgres will always give you lowercase in the result set. And Oracle will give you all uppercase.&lt;/p&gt;

&lt;p&gt;PDO tried to address this with the PDO::ATTR_CASE constant that you can set LOWER or UPPER to force a unified casing in result sets.&lt;br/&gt;
But since we&apos;re not solely relying on PDO, we cant use that. For example, the PDO_OCI driver sucks badly and so we have a custom driver around the OCI8 extension.&lt;/p&gt;

&lt;p&gt;Now these casing differences cause Benjamin trouble as he tries to determine differences between database schemas and things like that.&lt;/p&gt;

&lt;p&gt;So while we would be happy with preserving the names everywhere, the databases play against us as they dont all return the names &quot;as is&quot;.&lt;/p&gt;

&lt;p&gt;And now we&apos;re trying hard to make this invisible for the user.&lt;/p&gt;

&lt;p&gt;Of course you should be able to use mixed case column names and let doctrine worry about the rest.&lt;/p&gt;

&lt;p&gt;Just wanted to give some background info.&lt;/p&gt;

</comment>
                    <comment id="11044" author="nicokaiser" created="Mon, 7 Dec 2009 14:10:49 +0000"  >&lt;p&gt;Ok, I understand. This sounds quite difficult... thanks for the background info, this always helps me to understand some of the Doctrine internals...&lt;/p&gt;

&lt;p&gt;As you said, for portability reasons it is not a good idea to rely on the users&apos; knowledge about the database (i.e. to always use columnName&apos;s with the &apos;right&apos; case), because in some cases columnNames are automatically generated... And with DBMs being configurable&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; it may also be a bad idea to rely on Doctrine mapping casing behavior to DB drivers...&lt;/p&gt;

&lt;p&gt;Yet in my project there is the simple requirement to keep the existing database model and use DDC on top of it, i.e. especially not renaming columns or changing primary keys, etc.&lt;/p&gt;</comment>
                    <comment id="11045" author="romanb" created="Mon, 7 Dec 2009 16:50:16 +0000"  >&lt;p&gt;@Benjamin: Can you review my latest changeset?&lt;/p&gt;

&lt;p&gt;Also, I discovered 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;$theJoinTable-&amp;gt;createColumn( 
    $columnName, $class-&amp;gt;getTypeOfColumn($joinColumn[&apos;referencedColumnName&apos;]), array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doesnt that mean all foreign keys are nullable? shouldnt this 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;$theJoinTable-&amp;gt;createColumn( 
    $columnName, $class-&amp;gt;getTypeOfColumn($joinColumn[&apos;referencedColumnName&apos;]), array(&apos;notnull&apos; =&amp;gt; ! $joinColumn[&apos;nullable&apos;])
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;?&lt;/p&gt;</comment>
                    <comment id="11083" author="romanb" created="Tue, 8 Dec 2009 14:01:46 +0000"  >&lt;p&gt;Can this be considered fixed now?&lt;/p&gt;</comment>
                    <comment id="11089" author="nicokaiser" created="Tue, 8 Dec 2009 16:43:57 +0000"  >&lt;p&gt;Looks good!&lt;/p&gt;</comment>
                    <comment id="16920" author="phansys" created="Fri, 25 Nov 2011 20:58:47 +0000"  >&lt;p&gt;How can I get PostgreSQL case sensitive quoted columns works?&lt;/p&gt;

&lt;p&gt;My table structure is like this:&lt;/p&gt;

&lt;p&gt;CREATE TABLE &quot;Author&quot;&lt;br/&gt;
(&lt;br/&gt;
  &quot;IdAuthor&quot; serial NOT NULL,&lt;br/&gt;
  &quot;Name&quot; character varying(100) NOT NULL DEFAULT &apos;&apos;::character varying,&lt;br/&gt;
  &quot;CreationDate&quot; timestamp without time zone,&lt;br/&gt;
  &quot;ModificationDate&quot; timestamp without time zone,&lt;br/&gt;
  CONSTRAINT &quot;Author_pkey&quot; PRIMARY KEY (&quot;IdAuthor&quot;)&lt;br/&gt;
)&lt;br/&gt;
WITH (&lt;br/&gt;
  OIDS=FALSE&lt;br/&gt;
);&lt;/p&gt;

&lt;p&gt;And in php...&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;br/&gt;
// $em instanceof EntityManager&lt;br/&gt;
$q = $em-&amp;gt;createQuery(&apos;select a from MyDomain\Model\Author a where a.&quot;IdAuthor&quot; = 1&apos;);&lt;br/&gt;
$author = $q-&amp;gt;getResult();&lt;/p&gt;

&lt;p&gt;and this returns the exception:&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 56: Error: Expected =, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, &amp;gt;, &amp;gt;=, !=, got &apos;IdAuthor&apos; &lt;/p&gt;

&lt;p&gt;Sorry if it&apos;s a wrong place to do de question; and many thanks for your help.&lt;br/&gt;
Best regards.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-173] Collection does not get turned into a PersistentCollection when loaded from a proxy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-173</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We have two entities, a BugReport and a Reporter. The BugReport holds a reference to a Reporter, and the Reporter holds a reference to all his bug reports:&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 Reporter {
	/**
	 * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
	/**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;BugReport&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;reporter&quot;&lt;/span&gt;)
     */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $bugReports;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;bugReports = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection;
	}
}


/**
 * @Entity
 */
class BugReport {
	/**
	 * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
	/**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Reporter&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;reporter_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;public&lt;/span&gt; $reporter;
}

$tool = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Tools\SchemaTool($em);
$classes = array(
  $em-&amp;gt;getClassMetadata(&apos;Entities\Reporter&apos;),
  $em-&amp;gt;getClassMetadata(&apos;Entities\BugReport&apos;)
);
$tool-&amp;gt;createSchema($classes);

$reporter = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Reporter();
$bug = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; BugReport();
$bug-&amp;gt;reporter = $reporter;

$bug2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; BugReport();
$bug2-&amp;gt;reporter = $reporter;

$em-&amp;gt;persist($reporter);
$em-&amp;gt;persist($bug);
$em-&amp;gt;persist($bug2);

$em-&amp;gt;flush();

$reporterId = $reporter-&amp;gt;id;
$bug1Id = $bug-&amp;gt;id;
$bug2Id = $bug2-&amp;gt;id;

$em-&amp;gt;clear();

$reporter = $em-&amp;gt;find(&apos;Entities\Reporter&apos;, $reporterId);

echo get_class($reporter-&amp;gt;bugReports);

$em-&amp;gt;clear();

$bug = $em-&amp;gt;find(&apos;Entities\BugReport&apos;, $bug1Id);

echo get_class($bug-&amp;gt;reporter-&amp;gt;bugReports);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This outputs &quot;Doctrine\ORM\PersistentCollectionDoctrine\Common\Collections\ArrayCollection&quot;&lt;/p&gt;

&lt;p&gt;It seems that when the Reporter is loaded from a Proxy, the fields don&apos;t get turned into &quot;managed fields&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10499">DDC-173</key>
            <summary>Collection does not get turned into a PersistentCollection when loaded from a proxy</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ablock">Avi Block</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Nov 2009 15:43:05 +0000</created>
                <updated>Wed, 25 Nov 2009 03:10:06 +0000</updated>
                    <resolved>Wed, 25 Nov 2009 03:10:06 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10838" author="romanb" created="Tue, 24 Nov 2009 15:54:10 +0000"  >&lt;p&gt;I rather suspect that the $bug-&amp;gt;reporter proxy is never initialized as $bug-&amp;gt;reporter-&amp;gt;bugReports accesses a public property and lazy loading can not work with public properties as there is no way for the proxy to intercept these calls.&lt;/p&gt;

&lt;p&gt;What if you use &quot;echo get_class($bug-&amp;gt;reporter-&amp;gt;getBugReports());&quot;, provided you add a method getBugReports() first ?&lt;/p&gt;

&lt;p&gt;Or did you only make all these fields public for the contrived example shown here and in reality they&apos;re not?&lt;/p&gt;
</comment>
                    <comment id="10839" author="romanb" created="Tue, 24 Nov 2009 15:58:14 +0000"  >&lt;p&gt;Fixed formatting&lt;/p&gt;</comment>
                    <comment id="10840" author="ablock" created="Tue, 24 Nov 2009 16:06:45 +0000"  >&lt;p&gt;What I&apos;m asking is that in the case of loading the Reporter directly from the EntityManager, the bugReports property gets turned into a PersistentCollection, but if the Reporter is loaded through a proxy, the fields stay as they are. Can&apos;t the proxy, in its constructor convert all the fields into Proxies/PersistenCollections?&lt;/p&gt;</comment>
                    <comment id="10841" author="romanb" created="Tue, 24 Nov 2009 16:18:07 +0000"  >&lt;p&gt;When loading the reporter the bugReports property gets wrapped in a PersistentCollection because it is directly referenced by a loaded/managed entity, the reporter.&lt;/p&gt;

&lt;p&gt;When the bugreport is loaded directly in the second case only the fields of the bugreport are properly proxied. When you access a public property of the proxy, the proxy cant be initialized. Creating PersistentCollections in an uninitialized proxy as you suggest is a) unnecessary overhead and b) not really a solution to the fact that public properties circumvent lazy loading, i.e. while $bug-&amp;gt;reporter-&amp;gt;bugReports might work then, other fields, especially simple value fields (strings, integers,...) will remain null or at their default value because they&apos;re not loaded.&lt;/p&gt;

&lt;p&gt;If you want to use public properties, you can, but you must be aware that they dont play nice with lazy-loading. In general, public properties in entities are discouraged and this is also stated in the manual: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/architecture:entities#persistent-fields&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/architecture:entities#persistent-fields&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So my question comes down to: Does the issue you describe in this ticket here occur without public properties? If yes, it is a bug.&lt;/p&gt;</comment>
                    <comment id="10842" author="ablock" created="Tue, 24 Nov 2009 16:31:03 +0000"  >&lt;p&gt;To answer your question, the example in real life is not using public properties, and works totally fine using a getter.&lt;/p&gt;

&lt;p&gt;In this contrived example, I&apos;m using public properties, but what I&apos;m actually doing is writing a &quot;Mapper&quot; which converts my Domain entities into a different layer...similar to the Automapper project which is popular in .NET circles. Since I like to keep all my properties private, and only create a &quot;getter&quot; when absolutely necessary, and also for the sake of automation, I use reflection to get at these properties. This works fine, until I try to map an initialized proxy. So I&apos;m not actually using public properties, but I&apos;m using reflection to get at the properties.&lt;/p&gt;</comment>
                    <comment id="10860" author="ablock" created="Wed, 25 Nov 2009 03:10:06 +0000"  >&lt;p&gt;I&apos;ve taken a totally different approach to the issue. For some reason it didn&apos;t occur to me that fields in proxies would be scalars (and thus there is no proxy for them, forgetting about the fact that it doesn&apos;t make sense to lazy load simple values)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-135] With/on extra join clauses are not yet processed  properly by SqlWalker</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-135</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Reference thread: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/5f3e01818cf30878&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/5f3e01818cf30878&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Criteria specified with QueryBuilder::leftJoin() do not appear in the native query. Looks like the with/on extra join clauses are not yet processed  &lt;br/&gt;
properly by the SqlWalker that constructs the SQL+parameters.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10378">DDC-135</key>
            <summary>With/on extra join clauses are not yet processed  properly by SqlWalker</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="reinier.kip">Reinier Kip</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Nov 2009 11:07:23 +0000</created>
                <updated>Sun, 14 Feb 2010 04:54:12 +0000</updated>
                    <resolved>Sun, 14 Feb 2010 04:54:12 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11113" author="guilhermeblanco" created="Wed, 9 Dec 2009 03:36:12 +0000"  >&lt;p&gt;They talk about the same thing.&lt;/p&gt;</comment>
                    <comment id="11698" author="beberlei" created="Sat, 13 Feb 2010 18:50:24 +0000"  >&lt;p&gt;Patch that fixes both &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-135&quot; title=&quot;With/on extra join clauses are not yet processed  properly by SqlWalker&quot;&gt;&lt;del&gt;DDC-135&lt;/del&gt;&lt;/a&gt; but restricts it by the assumptions of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-177&quot; title=&quot;Throw exception if ON/WITH join condition override/extension is used on a fetch-join with HYDRATE_OBJECT&quot;&gt;&lt;del&gt;DDC-177&lt;/del&gt;&lt;/a&gt;, namely not allowing to fetch join a LEFT JOIN .. ON/WITH clause&lt;/p&gt;</comment>
                    <comment id="11700" author="romanb" created="Sun, 14 Feb 2010 04:05:05 +0000"  >&lt;p&gt;@Benjamin: Thats a good start but its not yet what its supposed to be. WITH &lt;b&gt;appends&lt;/b&gt; to the join condition whereas ON &lt;b&gt;overrides&lt;/b&gt; it. In the patch I only see ON implemented and it behaves like WITH.&lt;/p&gt;</comment>
                    <comment id="11701" author="romanb" created="Sun, 14 Feb 2010 04:06:56 +0000"  >&lt;p&gt;I see you implemented WITH also, but they are supposed to produce different SQL. ON overrides, WITH appends.&lt;/p&gt;</comment>
                    <comment id="11702" author="romanb" created="Sun, 14 Feb 2010 04:11:45 +0000"  >&lt;p&gt;@Benjamin: Btw. I think we should only implement WITH for now. ON is a bit too scary for me and I&apos;d like to see more usecases first.&lt;/p&gt;</comment>
                    <comment id="11703" author="beberlei" created="Sun, 14 Feb 2010 04:41:10 +0000"  >&lt;p&gt;Ah now i understand, i didn&apos;t get the difference &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;

&lt;p&gt;I will strip down the patch to WITH then and handle it appropriately&lt;/p&gt;</comment>
                    <comment id="11704" author="beberlei" created="Sun, 14 Feb 2010 04:42:02 +0000"  >&lt;p&gt;The way i implemented ON it worked as WITH anyways.&lt;/p&gt;</comment>
                    <comment id="11705" author="beberlei" created="Sun, 14 Feb 2010 04:54:12 +0000"  >&lt;p&gt;Fixed, WITH clauses are processed correctly now. ON clauses throw an exception.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10515">DDC-177</issuekey>
        </issuelink>
                    </outwardlinks>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10514">DDC-176</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10366" name="ddc135_ddc177.patch" size="4207" author="beberlei" created="Sat, 13 Feb 2010 18:50:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-130] Cascading and @ManyToMany associations is broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-130</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have two Entities: Users and Alerts. They are associated with @ManyToMany, the assiciation table should be &quot;user_alert&quot;. &lt;/p&gt;

&lt;p&gt;Entities:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/m7bca724a&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/m7bca724a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sample code:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/m4e530f42&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/m4e530f42&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;The &quot;remove&quot; command in the sample code deletes the user entry and alert entry, but not the user_alert entry (which was automatically created though). This leaves an orphan entry (or the DBMS will complain because of FK constraints).&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;INSERT INTO users (name) VALUES (?)
array(1) {
  [1]=&amp;gt;
  string(3) &quot;Bob&quot;
}
INSERT INTO alert (name) VALUES (?)
array(1) {
  [1]=&amp;gt;
  string(9) &quot;Testalert&quot;
}
INSERT INTO user_alert (userId, alertId) VALUES (?, ?)
array(2) {
  [0]=&amp;gt;
  int(1)
  [1]=&amp;gt;
  int(1)
}
DELETE FROM users WHERE id = ?
array(1) {
  [0]=&amp;gt;
  int(1)
}
DELETE FROM alert WHERE id = ?
array(1) {
  [0]=&amp;gt;
  int(1)
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The user_alert table should be automatically updated (on creation &lt;em&gt;and&lt;/em&gt; removal)...&lt;/p&gt;</description>
                <environment></environment>
            <key id="10368">DDC-130</key>
            <summary>Cascading and @ManyToMany associations is broken</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Nov 2009 09:28:08 +0000</created>
                <updated>Sat, 10 Jul 2010 08:11:06 +0000</updated>
                    <resolved>Sat, 10 Jul 2010 08:10:29 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10586" author="romanb" created="Wed, 11 Nov 2009 12:52:25 +0000"  >&lt;p&gt;I think in most cases the entry in the association table should be deleted by the FK constraint. However I think that is currently not the default. You can force it by using onDelete=&quot;CASCADE&quot; on the @JoinColumn definitions inside the @JoinTable. That should probably be set by default on join columns on an association table.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure its worth supporting manual deletion of association table entries through Doctrine as all databases support proper foreign key constraints and this is the most effective way to delete these entries and also enforces the integrity on the database side.&lt;/p&gt;

&lt;p&gt;So I&apos;m rather voting for making onDelete=&quot;CASCADE&quot; the default for join columns of association tables unless specified otherwise.&lt;/p&gt;</comment>
                    <comment id="10637" author="romanb" created="Fri, 13 Nov 2009 18:54:55 +0000"  >&lt;p&gt;It appears that this doesnt work in JPA(2) either, or well, it depends on the implementation provider. But cascade=REMOVE on @ManyToMany is not allowed per the spec.&lt;/p&gt;

&lt;p&gt;This issue here is probably one of the reasons for this. Meaning there might be no easy way for the ORM to deal with entries in association tables transparently on cascade=REMOVE.&lt;/p&gt;

&lt;p&gt;We have the following options:&lt;/p&gt;

&lt;p&gt;1) Disallow cascade=REMOVE on ManyToManyMapping (throw a MappingException)&lt;/p&gt;

&lt;p&gt;2) Allow it but clearly document that entries in association tables are not removed by Doctrine, so that you need to apply onDelete=&quot;CASCADE&quot; on the @JoinColumn definitions. Are there any more caveats with this I can not think of currently?&lt;/p&gt;

&lt;p&gt;3) Someone has an idea for transparently deleting entries in association tables on cascade=REMOVE. Solutions would need to be performant and not too cumbersome to implement.&lt;/p&gt;

&lt;p&gt;Waiting for feedback.&lt;/p&gt;</comment>
                    <comment id="10639" author="beberlei" created="Sat, 14 Nov 2009 12:21:03 +0000"  >&lt;p&gt;Hm after thinking about it the problem is that the collection has to be either:&lt;/p&gt;

&lt;p&gt;1. loaded into memory completely and put through to regular remove a single entity process. This would be required to mark entities for deleted that are also hydrated but attached to another many to many collection of this type.&lt;br/&gt;
2. selected for all their ids and there should be a many to many deletion mechanism that works based on id, however then also finds also hydrated entities based on their id.&lt;/p&gt;</comment>
                    <comment id="10648" author="nicokaiser" created="Mon, 16 Nov 2009 08:57:00 +0000"  >&lt;p&gt;Hm, I don&apos;t know if my report was unclear... What I meant was automatic update of the join table (&quot;user_alert&quot; in this example). When I delete e.g. a User, I don&apos;t want to have to care about updates in the &quot;user_alert&quot; table - this table was automatically generated (by the @JoinTable statement), so it should be automatically updated, e.g. when I delete either a User or an Alert...&lt;/p&gt;</comment>
                    <comment id="10770" author="alex" created="Thu, 19 Nov 2009 11:22:56 +0000"  >&lt;p&gt;How about removing a relation between a user and an alert?&lt;/p&gt;

&lt;p&gt;Meaning the user and alert both remain in the database but they are not connected anymore (think about users with multiple roles).&lt;/p&gt;</comment>
                    <comment id="10771" author="romanb" created="Thu, 19 Nov 2009 11:33:54 +0000"  >&lt;p&gt;@Alexander: Just like in normal OOP. If a user as a collection of alerts and an alert a collection of users (bidirectional many-many) and you want to remove an alert from a user you simply remove the alert from the collection and the user from the collection of the corresponding alert. This is very clean, the only problem with this is the efficiency because in order to remove the elements from the collections, the collections must be loaded. (Strictly speaking, you only need to adjust the &quot;owning side&quot;, so only 1 collection needs to be loaded). Of course you can always use some custom SQL that directly manipulates the intermediate table. See also &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-128&quot; title=&quot;Consider adding EntityManager#link/unlink methods for direct association manipulation&quot;&gt;DDC-128&lt;/a&gt;. Also there is &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-45&quot; title=&quot;Consider changing the contract of Collection#remove&quot;&gt;&lt;del&gt;DDC-45&lt;/del&gt;&lt;/a&gt; but I dont think thats doable.&lt;/p&gt;

&lt;p&gt;Collections of entities always only represent the association of the entity that has the collection and the contained entities. If you remove an entity from a collection, the association is removed, not the entity itself. &quot;The association is removed&quot; means that either the foreign key is NULLed out (in the case of one-to-many) or that the entry in the association table is removed.&lt;/p&gt;</comment>
                    <comment id="10772" author="alex" created="Thu, 19 Nov 2009 12:01:55 +0000"  >&lt;p&gt;@Roman: All sounds very simple. But in practice this doesn&apos;t seem to work.&lt;br/&gt;
I have the 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;$uRep = $em-&amp;gt;getRepository(&apos;System_User&apos;);
$user = $uRep-&amp;gt;findOneById(1);
unset($user-&amp;gt;roles[0]);
$em-&amp;gt;persist($user);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, when I clear the manager and reload the user:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;If the user had 1 role -&amp;gt; it still has one role&lt;/li&gt;
	&lt;li&gt;If the user had more roles -&amp;gt; it still has the removed role and all others are duplicated.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="10773" author="romanb" created="Thu, 19 Nov 2009 12:07:34 +0000"  >&lt;p&gt;@Alexander: Please open a separate issue for this. Thanks.&lt;/p&gt;</comment>
                    <comment id="12859" author="mjh_ca" created="Thu, 6 May 2010 12:51:19 +0000"  >&lt;p&gt;Pastebin entries have expired and this bug is not attached to a specific version so it is difficult to tell the status.  Nico, is this still a problem with the current release?&lt;/p&gt;</comment>
                    <comment id="12987" author="romanb" created="Mon, 17 May 2010 14:30:42 +0000"  >&lt;p&gt;My currently proposed solution to this would be to simply make onDelete=&quot;CASCADE&quot; the default for join columns in join tables. Anyone has a strong objection or better idea?&lt;/p&gt;</comment>
                    <comment id="13469" author="beberlei" created="Wed, 30 Jun 2010 16:05:30 +0000"  >&lt;p&gt;sounds good to me&lt;/p&gt;</comment>
                    <comment id="13550" author="beberlei" created="Fri, 9 Jul 2010 14:02:27 +0000"  >&lt;p&gt;Other tools actually delete the related records manually, no cascading involved. Since Sqlite doesn&apos;t even support foreign keys we should probably do the same instead of relying on &quot;onDelete&quot;=&quot;cascade&quot;.&lt;/p&gt;

&lt;p&gt;Whats your take roman?&lt;/p&gt;</comment>
                    <comment id="13551" author="beberlei" created="Fri, 9 Jul 2010 14:11:58 +0000"  >&lt;p&gt;We have to support this anyways for the following reason:&lt;/p&gt;

&lt;p&gt;Doctrine 2 gives you absolutely no access to the many-to-many join table, i.e. to be working with cascade it should not only be the default, but the only option (since other options don&apos;t work). We need to extend the way &quot;delete&quot; works inside each persister to also clean up many-to-many tables.&lt;/p&gt;

&lt;p&gt;We need this mechanism anyways for Element Collections to delete all the related entries.&lt;/p&gt;

&lt;p&gt;The option onDelete=&quot;cascade|noaction&quot; is therefore only a hint for the persisters to decide if they perform this action themselves, or let the database vendor perform it.&lt;/p&gt;</comment>
                    <comment id="13552" author="beberlei" created="Fri, 9 Jul 2010 16:57:06 +0000"  >&lt;p&gt;I pushed my proposed changes to a feature branch: &lt;a href=&quot;http://github.com/doctrine/doctrine2/tree/DDC-130&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/tree/DDC-130&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are definatly refactorings that need to be done, however in that state its currently doing its job very well.&lt;/p&gt;</comment>
                    <comment id="13557" author="beberlei" created="Sat, 10 Jul 2010 02:15:50 +0000"  >&lt;p&gt;What about DQL DELETE?&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;DELETE FROM Boo WHERE bar
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For each join table:&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;DELETE FROM join_foo WHERE (SELECT id FROM foo WHERE bar)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Can this be done determinstically?&lt;/p&gt;</comment>
                    <comment id="13558" author="beberlei" created="Sat, 10 Jul 2010 02:52:56 +0000"  >&lt;p&gt;The DQL stuff is just way to much to add. Foreign Key constraints should fail in these cases imho&lt;/p&gt;</comment>
                    <comment id="13560" author="romanb" created="Sat, 10 Jul 2010 04:39:30 +0000"  >&lt;p&gt;I think we have to do this on bulk deletion then, too.&lt;/p&gt;

&lt;p&gt;Examples from EclipseLink:&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.createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;delete from User2 u where u.id=1&quot;&lt;/span&gt;).executeUpdate();
=&amp;gt;
DELETE FROM USER2_GROUP2 WHERE EXISTS(SELECT ID FROM USER2 WHERE (ID = ?) AND ID = USER2_GROUP2.User2_ID)
DELETE FROM USER2 WHERE (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;em.createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;delete from User2 u&quot;&lt;/span&gt;).executeUpdate();
=&amp;gt;
DELETE FROM USER2_GROUP2
DELETE FROM USER2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13561" author="beberlei" created="Sat, 10 Jul 2010 08:10:29 +0000"  >&lt;p&gt;Fixed in master using the following semantics:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;If a many-to-many join table is to be found not using onDelete=&quot;CASCADE&quot; execute this manually&lt;/li&gt;
	&lt;li&gt;In self-referential relationships delete both possible pairs.&lt;/li&gt;
	&lt;li&gt;Use Database onDelete=&quot;CASCADE&quot; if present on both foreign keys of the join table.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Tested against normal entities, self-referential, CTI and STI, from the owning and the inverse side.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11605">DDC-677</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-115] Two ClassMetadata instances for an entity in global namespace</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-115</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The global namespace creates problems for entities that are retrieved via getClassMetadata($className) when $className is not prepended by &quot;\&quot;. This is only a problem in the global namespace, because in other instances a slash might be present and the metadata factory does not find the relevant previously generated ClassMetadata instance.&lt;/p&gt;

&lt;p&gt;This problem specifically occours with Annotations Mapping, since ReflectionClass::getName() returns the class name unqualified.&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;php -r &apos;namespace Foo { $r = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \ReflectionClass(&lt;span class=&quot;code-quote&quot;&gt;&quot;\stdClass&quot;&lt;/span&gt;); echo $r-&amp;gt;getName();} &apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I attached a Test-Case that proves this behaviour. It requires the additional attached Global namespace model data.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10338">DDC-115</key>
            <summary>Two ClassMetadata instances for an entity in global namespace</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 19:27:23 +0000</created>
                <updated>Wed, 4 Nov 2009 23:09:23 +0000</updated>
                    <resolved>Wed, 4 Nov 2009 20:15:40 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10493" author="beberlei" created="Wed, 4 Nov 2009 19:46:16 +0000"  >&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;[20:20:55] &amp;lt;beberlei&amp;gt; guilhermeblanco: the problem is that ReflectionClass-&amp;gt;getName() returns the name without prepended namespace &lt;span class=&quot;code-keyword&quot;&gt;operator&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; global classes
[20:27:43] &amp;lt;guilhermeblanco&amp;gt; beberlei: so it&apos;s a bug in ReflectionClass
[20:27:51] &amp;lt;guilhermeblanco&amp;gt; can&apos;t you just &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; get_class($instance)?
[20:28:11] &amp;lt;beberlei&amp;gt; no its the annotations mapping
[20:28:22] &amp;lt;beberlei&amp;gt; its using ReflectionClass::getName()
[20:29:13] &amp;lt;guilhermeblanco&amp;gt; hm...
[20:29:22] &amp;lt;guilhermeblanco&amp;gt; give me a second... I wanna test something
[20:31:33] &amp;lt;beberlei&amp;gt; i all attach test and classes to a bug
[20:32:43] &amp;lt;guilhermeblanco&amp;gt; weird
[20:32:54] &amp;lt;guilhermeblanco&amp;gt; beberlei: let me show you something
[20:33:37] &amp;lt;beberlei&amp;gt; http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org/jira/browse/DDC-115
&lt;/span&gt;[20:33:50] &amp;lt;beberlei&amp;gt; the problem is ReflectionClass-&amp;gt;getName() has to be backwards compatible
[20:34:19] &amp;lt;guilhermeblanco&amp;gt; beberlei: http:&lt;span class=&quot;code-comment&quot;&gt;//pastie.org/683660
&lt;/span&gt;[20:34:54] &amp;lt;beberlei&amp;gt; oh
[20:34:57] &amp;lt;beberlei&amp;gt; they all strip it?
[20:35:04] &amp;lt;beberlei&amp;gt; we need a normalize method
[20:35:41] &amp;lt;guilhermeblanco&amp;gt; let me go further
[20:35:47] &amp;lt;guilhermeblanco&amp;gt; I wanna check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it&apos;s not a PHP bug
[20:37:53] &amp;lt;guilhermeblanco&amp;gt; beberlei: http:&lt;span class=&quot;code-comment&quot;&gt;//pastie.org/683669
&lt;/span&gt;[20:48:22] &amp;lt;beberlei&amp;gt; its not a bug yeah, but then we need to extend ClassMetadataFactory to prepend each $className which has none with the namespace separator
[20:48:34] &amp;lt;beberlei&amp;gt; hasMetadata getMetadata setMetadata
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10495" author="beberlei" created="Wed, 4 Nov 2009 19:57:50 +0000"  >&lt;p&gt;Committing a patch that adds the following 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;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($className[0] == &lt;span class=&quot;code-quote&quot;&gt;&quot;\\&quot;&lt;/span&gt;) {
    $className = substr($className, 1);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to each of the following methods of ClassMetadataFactory: &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;hasMetdataFor($className)
getMetadataFor($className)
setMetadataFor($className, $class)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10498" author="beberlei" created="Wed, 4 Nov 2009 20:15:40 +0000"  >&lt;p&gt;Applied to trunk, Can someone verify this is ok?&lt;/p&gt;</comment>
                    <comment id="10502" author="romanb" created="Wed, 4 Nov 2009 22:10:23 +0000"  >&lt;p&gt;Not sure I understand this. As I said in another issue class names in strings are always considered fully qualified by php. A leading backslash in class names in strings should never be used it is completely unnecessary.&lt;/p&gt;

&lt;p&gt;The patch is problematic because the methods they&apos;re applied to are one of the most-called methods and they were already &quot;slow enough&quot; previously.&lt;/p&gt;

&lt;p&gt;If there is a problem and the problem is only with models in the global namespace then this should not be fixed. User-defined classes dont belong in the global namespace, ever.&lt;/p&gt;</comment>
                    <comment id="10504" author="beberlei" created="Wed, 4 Nov 2009 23:09:23 +0000"  >&lt;p&gt;We found the true issue.&lt;/p&gt;

&lt;p&gt;Several methods in ClassMetadataInfo assumed when no slash was prepended that a shortcut is used and prepends its own namespace plus a NS. This caused the problem which is now fixed by additionally checking for strlen($this-&amp;gt;namespace) on this positions.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10140" name="dcc115.diff" size="2870" author="beberlei" created="Wed, 4 Nov 2009 19:28:32 +0000" />
                    <attachment id="10141" name="GlobalNamespaceModel.php" size="1328" author="beberlei" created="Wed, 4 Nov 2009 19:28:32 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-96] Problem using Doctrine Autoloaders from Global Namespace</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-96</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The Doctrine Autoloaders don&apos;t work from the global namespace in the following context:&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;Loader::loadClass(&lt;span class=&quot;code-quote&quot;&gt;&quot;\Doctrine\ORM\Mapping\Driver\AnnotationsDriver&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The prefix slash is not matched and the doctrine autoloader fails.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10300">DDC-96</key>
            <summary>Problem using Doctrine Autoloaders from Global Namespace</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2009 09:47:26 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:34 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 10:00:33 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10385" author="beberlei" created="Mon, 2 Nov 2009 09:53:51 +0000"  >&lt;p&gt;The problem is rather that i want to address a class by its fully qualified name:&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 = &apos;\Doctrine\ORM\Mapping\Driver\AnnnotationDriver&apos;;

&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(class_exists($class)) {

} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
    &lt;span class=&quot;code-comment&quot;&gt;// he cant find it with the \ prefixed
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The IsolatedClassLoader tries to match the namespace against the 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;string(9) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\&quot;&lt;/span&gt;
string(46) &lt;span class=&quot;code-quote&quot;&gt;&quot;\Doctrine\ORM\Mapping\Driver\AnnnotationDriver&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the strpos prefix check fails on this.&lt;/p&gt;</comment>
                    <comment id="10386" author="romanb" created="Mon, 2 Nov 2009 09:59:22 +0000"  >&lt;p&gt;Namespaces in strings are &lt;b&gt;always&lt;/b&gt; fully qualified so there is no need for the leading backslash.&lt;/p&gt;</comment>
                    <comment id="10387" author="beberlei" created="Mon, 2 Nov 2009 10:00:33 +0000"  >&lt;p&gt;This was just a typo in the class name, sorry &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-20] CLONE -cache problem with joined tables and external data change</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-20</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine doesn&apos;t invalidate cache properly. Queries like the one below has the second table taken from cache and it shouldn&apos;t.&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;$comp = Doctrine_Query::create()
			-&amp;gt;select(&apos;a.*, s.*&apos;)
			-&amp;gt;from(&apos;AttachedComponents a, a.SubscriptionComponents s&apos;)
			-&amp;gt;fetchOne();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-24&quot; title=&quot;&amp;quot;AS&amp;quot; clause in DQL crashes the further update of the row in one-many relationship &quot;&gt;&lt;del&gt;DC-24&lt;/del&gt;&lt;/a&gt; the advice is to select id of second table, I selected all fields in second table but doctrine doesn&apos;t seem to notice foreign key has changed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10110">DDC-20</key>
            <summary>CLONE -cache problem with joined tables and external data change</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="psycon">Ionut E</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 22:03:33 +0000</created>
                <updated>Fri, 25 Sep 2009 15:23:53 +0000</updated>
                    <resolved>Fri, 25 Sep 2009 15:23:53 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0-ALPHA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10126" author="romanb" created="Fri, 25 Sep 2009 15:23:53 +0000"  >&lt;p&gt;After some researh this is desired behavior. However, parts of a consistent implementation of this behavior are still incomplete as described in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-21&quot; title=&quot;Already fetched associations should not be overriden by subsequent queries.&quot;&gt;&lt;del&gt;DDC-21&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-22&quot; title=&quot;EntityManager#refresh() should also refresh associations.&quot;&gt;&lt;del&gt;DDC-22&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10086">DC-41</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-19] Can&apos;t unserialize serialized entity which has a proxy as a single valued relationship as a value</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-19</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;entities.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;namespace Test;
/**
 * @Entity
 */
class Book {
	/** 
	 * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @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;
	
	/**
         * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Author&quot;&lt;/span&gt;,cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
         * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;author_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; $author;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setAuthor(Author $a) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;author = $a;
	}	

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getAuthor() {
		&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;author;
	}
}

/**
 * @Entity
 */
class Author {
	/**
	 * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @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;
	
	/**
	 * @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; $name;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setName($name) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $name;
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; 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;
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Client1.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;include &apos;entities.php&apos;;
include &apos;config.php&apos;;

$query = $em-&amp;gt;createQuery(&apos;select b from Test\Book b where b.id = 1&apos;);
$book = $query-&amp;gt;getSingleResult();
$book-&amp;gt;getAuthor()-&amp;gt;getName(); &lt;span class=&quot;code-comment&quot;&gt;// If I don&apos;t &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;, the object is not &lt;span class=&quot;code-quote&quot;&gt;&quot;loaded&quot;&lt;/span&gt; and I can&apos;t serialize it.
&lt;/span&gt;file_put_contents(&apos;out&apos;,serialize($book));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Client2.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;include &apos;entities.php&apos;;
include &apos;config.php&apos;;
$b = unserialize(file_get_contents(&apos;out&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This generates the error:&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;PHP Fatal error:  require(): Failed opening required &apos;/home/ablock/doctrine/lib/Doctrine/Generated/Proxies/Test_AuthorAProxy.php&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10094">DDC-19</key>
            <summary>Can&apos;t unserialize serialized entity which has a proxy as a single valued relationship as a value</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ablock">Avi Block</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Sep 2009 20:05:50 +0000</created>
                <updated>Wed, 14 Oct 2009 20:21:34 +0000</updated>
                    <resolved>Wed, 14 Oct 2009 20:21:34 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10099" author="romanb" created="Mon, 21 Sep 2009 20:40:57 +0000"  >&lt;p&gt;Thanks for reporting this. I think I have an idea what the issue is and will try to address this as soon as possible.&lt;/p&gt;</comment>
                    <comment id="10140" author="ablock" created="Tue, 29 Sep 2009 16:59:17 +0000"  >&lt;p&gt;Just looking around, I saw that the generated class names have a &quot;.g&quot; appended to them. When I removed that, it seems to work fine. Is there a reason why this &quot;.g&quot; is in there? If it must be in there, might it be suggested that the class loader takes that into account?&lt;/p&gt;</comment>
                    <comment id="10141" author="romanb" created="Tue, 29 Sep 2009 17:31:12 +0000"  >&lt;p&gt;Yea but I would not be very happy with that solution (&quot;g.&quot; simply means &quot;generated&quot;). I think it would be much better to be able to completely detach managed objects from doctrine, so that there are no proxies or wrapped collections left. The existing EntityManager#detach() detaches the entity in a way that doctrine does no longer hold any references to it but it still leaves proxies or wrapped collections in place. But I dont want to make detach() remove proxies etc because that is not always wanted and can be unnecessary overhead.&lt;/p&gt;

&lt;p&gt;So I&apos;m thinking of a new operation similar to detach but instead of having a cascade option it simply completely detaches a whole connected object graph. All proxies that are already initialized are replaced with the originals and all uninitialized proxies and collections are removed. Afterwards it is completely isolated from doctrine. The big benefit would be that you do not even need doctrine and its proxies around to unserialize them in a different application.&lt;/p&gt;

&lt;p&gt;Still thinking about this one. Feel free to speak up if you have ideas or suggestions.&lt;/p&gt;</comment>
                    <comment id="10142" author="romanb" created="Tue, 29 Sep 2009 17:48:34 +0000"  >&lt;p&gt;By the way, did you set &quot;/home/ablock/doctrine/lib&quot; as your cache dir? (Configuration#setCacheDir) ? Because otherwise I cant imagine that to work even without the &quot;.g&quot; suffix.&lt;/p&gt;</comment>
                    <comment id="10143" author="romanb" created="Tue, 29 Sep 2009 17:56:40 +0000"  >&lt;p&gt;Maybe we should make both ways possible. Serialization should also work with proxies IMHO, of course with the disadvantage that the proxy classes need to be available to the application that unserializes (no problem if its the same application).&lt;/p&gt;</comment>
                    <comment id="10146" author="ablock" created="Wed, 30 Sep 2009 15:30:31 +0000"  >&lt;p&gt;Interestingly enough, my cache dir is /tmp...why this works, is a good question, but It definitely works! I definitely agree, that having both options available is good, although some might think it smacks of &quot;YAGNI&quot;. Definitely more important that the serialized entities should be &quot;doctrineable&quot;, but still a good idea that they should be portable between applications.  &lt;/p&gt;</comment>
                    <comment id="10228" author="romanb" created="Wed, 14 Oct 2009 20:21:34 +0000"  >&lt;p&gt;This should work better now in HEAD. Please refer to the updated Configuration chapter of the manual, especially the section and configuration options about proxy classes. Also there is a new CLI task to (re)generate proxy classes by hand. Proxy classes now now behave like all other classes with regard to class loading.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-589] Doctrine\Tests\ORM\Functional\DatabaseDriverTest failures</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-589</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;5) Doctrine\Tests\ORM\Functional\DatabaseDriverTest::testCreateSimpleYamlFromDatabase
Exception: [Doctrine\ORM\Mapping\MappingException] Property &lt;span class=&quot;code-quote&quot;&gt;&quot;other2&quot;&lt;/span&gt; in &lt;span class=&quot;code-quote&quot;&gt;&quot;MultiSelfReference&quot;&lt;/span&gt; was already declared, but it must be declared only once

With queries:
213. SQL: &apos;SHOW INDEX FROM MultiSelfReference&apos; Params: 
212. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;MultiSelfReference&apos; */ WHERE k.table_name = &apos;MultiSelfReference&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
211. SQL: &apos;DESCRIBE MultiSelfReference&apos; Params: 
210. SQL: &apos;SHOW INDEX FROM LifecycleCallbackTestUser&apos; Params: 
209. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;LifecycleCallbackTestUser&apos; */ WHERE k.table_name = &apos;LifecycleCallbackTestUser&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
208. SQL: &apos;DESCRIBE LifecycleCallbackTestUser&apos; Params: 
207. SQL: &apos;SHOW INDEX FROM EntitySubClass&apos; Params: 
206. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;EntitySubClass&apos; */ WHERE k.table_name = &apos;EntitySubClass&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
205. SQL: &apos;DESCRIBE EntitySubClass&apos; Params: 
204. SQL: &apos;SHOW INDEX FROM CTIRelated2_CTIChild&apos; Params: 
203. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;CTIRelated2_CTIChild&apos; */ WHERE k.table_name = &apos;CTIRelated2_CTIChild&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
202. SQL: &apos;DESCRIBE CTIRelated2_CTIChild&apos; Params: 
201. SQL: &apos;SHOW INDEX FROM CTIRelated2&apos; Params: 
200. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;CTIRelated2&apos; */ WHERE k.table_name = &apos;CTIRelated2&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
199. SQL: &apos;DESCRIBE CTIRelated2&apos; Params: 
198. SQL: &apos;SHOW INDEX FROM CTIRelated&apos; Params: 
197. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;CTIRelated&apos; */ WHERE k.table_name = &apos;CTIRelated&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
196. SQL: &apos;DESCRIBE CTIRelated&apos; Params: 
195. SQL: &apos;SHOW INDEX FROM type&apos; Params: 
194. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;type&apos; */ WHERE k.table_name = &apos;type&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
193. SQL: &apos;DESCRIBE type&apos; Params: 
192. SQL: &apos;SHOW INDEX FROM serialize_model&apos; Params: 
191. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;serialize_model&apos; */ WHERE k.table_name = &apos;serialize_model&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
190. SQL: &apos;DESCRIBE serialize_model&apos; Params: 

Trace:
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1064
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1017
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1040
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php:136
/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:93
/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:36


/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/OrmFunctionalTestCase.php:275

6) Doctrine\Tests\ORM\Functional\DatabaseDriverTest::testCreateYamlWithForeignKeyFromDatabase
Exception: [Doctrine\ORM\Mapping\MappingException] Property &lt;span class=&quot;code-quote&quot;&gt;&quot;other2&quot;&lt;/span&gt; in &lt;span class=&quot;code-quote&quot;&gt;&quot;MultiSelfReference&quot;&lt;/span&gt; was already declared, but it must be declared only once

With queries:
222. SQL: &apos;SHOW INDEX FROM MultiSelfReference&apos; Params: 
221. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;MultiSelfReference&apos; */ WHERE k.table_name = &apos;MultiSelfReference&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
220. SQL: &apos;DESCRIBE MultiSelfReference&apos; Params: 
219. SQL: &apos;SHOW INDEX FROM LifecycleCallbackTestUser&apos; Params: 
218. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;LifecycleCallbackTestUser&apos; */ WHERE k.table_name = &apos;LifecycleCallbackTestUser&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
217. SQL: &apos;DESCRIBE LifecycleCallbackTestUser&apos; Params: 
216. SQL: &apos;SHOW INDEX FROM EntitySubClass&apos; Params: 
215. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;EntitySubClass&apos; */ WHERE k.table_name = &apos;EntitySubClass&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
214. SQL: &apos;DESCRIBE EntitySubClass&apos; Params: 
213. SQL: &apos;SHOW INDEX FROM CTIRelated2_CTIChild&apos; Params: 
212. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;CTIRelated2_CTIChild&apos; */ WHERE k.table_name = &apos;CTIRelated2_CTIChild&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
211. SQL: &apos;DESCRIBE CTIRelated2_CTIChild&apos; Params: 
210. SQL: &apos;SHOW INDEX FROM CTIRelated2&apos; Params: 
209. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;CTIRelated2&apos; */ WHERE k.table_name = &apos;CTIRelated2&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
208. SQL: &apos;DESCRIBE CTIRelated2&apos; Params: 
207. SQL: &apos;SHOW INDEX FROM CTIRelated&apos; Params: 
206. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;CTIRelated&apos; */ WHERE k.table_name = &apos;CTIRelated&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
205. SQL: &apos;DESCRIBE CTIRelated&apos; Params: 
204. SQL: &apos;SHOW INDEX FROM type&apos; Params: 
203. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;type&apos; */ WHERE k.table_name = &apos;type&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
202. SQL: &apos;DESCRIBE type&apos; Params: 
201. SQL: &apos;SHOW INDEX FROM serialize_model&apos; Params: 
200. SQL: &apos;SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON k.`CONSTRAINT_NAME` = c.constraint_name AND   c.constraint_name = k.constraint_name AND   c.table_name = &apos;serialize_model&apos; */ WHERE k.table_name = &apos;serialize_model&apos; AND table_schema = &apos;doctrine_tests&apos; AND `REFERENCED_COLUMN_NAME` is not NULL&apos; Params: 
199. SQL: &apos;DESCRIBE serialize_model&apos; Params: 

Trace:
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1064
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1017
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1040
/home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php:136
/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:93
/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:72


/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/OrmFunctionalTestCase.php:275
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11364">DDC-589</key>
            <summary>Doctrine\Tests\ORM\Functional\DatabaseDriverTest failures</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 15 May 2010 04:09:46 +0000</created>
                <updated>Tue, 25 May 2010 13:36:20 +0000</updated>
                    <resolved>Tue, 25 May 2010 13:35:44 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13008" author="romanb" created="Wed, 19 May 2010 06:59:52 +0000"  >&lt;p&gt;This should be fixed for beta2.&lt;/p&gt;</comment>
                    <comment id="13058" author="jwage" created="Tue, 25 May 2010 13:36:20 +0000"  >&lt;p&gt;This is fixed but the test for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-214&quot; title=&quot;schema-tool --complete-update throw PDOException on DROP INDEX&quot;&gt;&lt;del&gt;DDC-214&lt;/del&gt;&lt;/a&gt; is failing for me under mysql. Is this failing for anyone else or is it just me?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-552] Fatal error Undefined Method on ClassMetadataInfo::getReflectionClass() over CLI commands</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-552</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When calling orm:generate-entities or orm:convert-mapping over cli I get following Fatal Error:&lt;br/&gt;
---------------------------------------&lt;br/&gt;
Fatal error: Call to undefined method Doctrine\ORM\Mapping\ClassMetadataInfo::getReflectionClass() in /vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php on line 132&lt;br/&gt;
---------------------------------------&lt;/p&gt;


&lt;p&gt;PHP Version:&lt;br/&gt;
---------------------------------------&lt;br/&gt;
PHP 5.3.1 (cli) (built: Feb 11 2010 02:32:22) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
    with XCache v1.3.0, Copyright (c) 2005-2009, by mOo&lt;br/&gt;
---------------------------------------&lt;/p&gt;</description>
                <environment>OSX, PHP5.3.1</environment>
            <key id="11284">DDC-552</key>
            <summary>Fatal error Undefined Method on ClassMetadataInfo::getReflectionClass() over CLI commands</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="guille">Guillermo Thiemann</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Apr 2010 16:58:13 +0000</created>
                <updated>Fri, 30 Apr 2010 12:29:12 +0000</updated>
                    <resolved>Fri, 30 Apr 2010 12:29:12 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12772" author="romanb" created="Wed, 28 Apr 2010 17:08:35 +0000"  >&lt;p&gt;I think this is a known issue and will be fixed soon, I already talked with Jon about it.&lt;/p&gt;</comment>
                    <comment id="12773" author="romanb" created="Wed, 28 Apr 2010 17:13:06 +0000"  >&lt;p&gt;If you want to fix it yourself preliminarily to get the tasks to work you may try the following hack in the AnnotationDriver:&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; ($metadata &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; ClassMetadata) {
    $class = $metadata-&amp;gt;getReflectionClass();
} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
    $class = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ReflectionClass($className);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It will be fixed in a more elegant way, however, but maybe this can do the trick in the meantime.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-506] Schema tool no longer creates AUTO_INCREMENT primary keys in MySQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-506</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A recent update broke the schema generation of all primary keys for my models. The following no longer results in an AUTO_INCREMENT primary key in MySQL.&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;/**
 * @Entity
 * @Table(name=&quot;admin_history&quot;)
 */
class AdminHistory
{
    /**
     * @Id
     * @Column(type=&quot;integer&quot;, name=&quot;admin_history_id&quot;)
     * @GeneratedValue
     */
    protected $id;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11201">DDC-506</key>
            <summary>Schema tool no longer creates AUTO_INCREMENT primary keys in MySQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="hobodave">David Abdemoulaie</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Apr 2010 02:47:32 +0000</created>
                <updated>Mon, 12 Apr 2010 16:49:22 +0000</updated>
                    <resolved>Mon, 12 Apr 2010 16:49:22 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12618" author="romanb" created="Sat, 10 Apr 2010 05:22:37 +0000"  >&lt;p&gt;This might have something to do with the CLI refactorings, too? Otherwise I have no idea where this is coming from since the test suite runs fine against mysql (and it obviously uses generated values a lot).&lt;/p&gt;</comment>
                    <comment id="12642" author="beberlei" created="Mon, 12 Apr 2010 16:49:22 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-501] Merging entities that contained unloaded proxy collections will delete those associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-501</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If loading an entity without its -to-many-collections, detaching and merging it back WITHOUT having touched those associations will result in two strange behaviours:&lt;/p&gt;

&lt;p&gt;oneToMany (bidrectional, mapped by loaded entity): After merge the collection remains empty. Flushing EM and reloading entity will reveal associated entities again&lt;/p&gt;

&lt;p&gt;manyToMany (bidirectional, mapped by targeted entity): After merge the collection remains empty. Flushing EM will physically delete associations.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;----------------- !! NOTE !! --------------------&lt;/li&gt;
	&lt;li&gt;To reproduce the manyToMany-Bug it&apos;s necessary&lt;/li&gt;
	&lt;li&gt;to cascade &quot;merge&quot; on cmUser::groups&lt;/li&gt;
	&lt;li&gt;-------------------------------------------------&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>PHP-Version 5.3.2&lt;br/&gt;
PHPUnit-Version 3.4.11&lt;br/&gt;
PDO Driver for MySQL, client library version =&amp;gt; 5.0.83&lt;br/&gt;
&lt;a href=&apos;mailto:doctrine-trunk@7546&apos;&gt;doctrine-trunk@7546&lt;/a&gt;&lt;br/&gt;
Kubuntu 9.10 / 32bit&lt;br/&gt;
</environment>
            <key id="11191">DDC-501</key>
            <summary>Merging entities that contained unloaded proxy collections will delete those associations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</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>Thu, 8 Apr 2010 15:33:36 +0000</created>
                <updated>Thu, 1 Jul 2010 17:50:33 +0000</updated>
                    <resolved>Thu, 1 Jul 2010 17:50:33 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12607" author="markus.woessner" created="Thu, 8 Apr 2010 15:34:48 +0000"  >&lt;p&gt;Forgot to tell trunk revision&lt;/p&gt;</comment>
                    <comment id="12925" author="shurakai" created="Wed, 12 May 2010 10:35:57 +0000"  >&lt;p&gt;This issue is mainly caused by the entity not being initialized before serialization. Additionally, the PersistenCollection does loose all information that is needed to regain the kept entities because the collection itself is not initialized before serialization.&lt;/p&gt;

&lt;p&gt;I&apos;ve added an initialization call here &lt;a href=&quot;http://github.com/Shurakai/doctrine2/commit/6c185a2891111dfbd83d381bad8c5a2b16536cad#diff-0&quot; class=&quot;external-link&quot;&gt;http://github.com/Shurakai/doctrine2/commit/6c185a2891111dfbd83d381bad8c5a2b16536cad#diff-0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, I&apos;m not sure whether this is the best solution. Any thoughts?&lt;/p&gt;</comment>
                    <comment id="12932" author="romanb" created="Thu, 13 May 2010 05:38:57 +0000"  >&lt;p&gt;@Christian: I looked at the testcase you committed there and the assumptions it makes are not correct. The original test case provided by Markus made the right assumptions, that is, after the user is unserialized it can and should not know about its groups or phonenumbers since these were not serialized.&lt;br/&gt;
When you serialize an entity, you serialize a partial snapshot of its state. When you unserialize it you have all the state that was loaded prior to serialization but you can not get at the rest, the object is detached from the rest of the object graph. Thats where merge() comes in, it reattaches a detached entity to a managed environment where associations can be lazy-loaded, state changes are tracked, etc.&lt;/p&gt;

&lt;p&gt;So the problem must come later, at the point of merging.&lt;/p&gt;</comment>
                    <comment id="13095" author="romanb" created="Thu, 3 Jun 2010 05:41:05 +0000"  >&lt;p&gt;Pushing back to beta3.&lt;/p&gt;</comment>
                    <comment id="13484" author="beberlei" created="Thu, 1 Jul 2010 17:50:33 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10562" name="DetachedPartiallyLoadedEntityTest.php" size="3517" author="markus.woessner" created="Thu, 8 Apr 2010 15:33:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-502] Remove &quot;mapping-path&quot; from cli schema tool commands</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-502</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the Schema Tool Tasks need the mapping path information.&lt;/p&gt;

&lt;p&gt;That is however only needed for the Annotations driver, the xml and yaml driver already specify all the paths.&lt;/p&gt;

&lt;p&gt;Additionally the annotation path could easily be specified in the HelperSet as an argument.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11194">DDC-502</key>
            <summary>Remove &quot;mapping-path&quot; from cli schema tool commands</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Apr 2010 10:56:51 +0000</created>
                <updated>Sat, 10 Apr 2010 09:53:51 +0000</updated>
                    <resolved>Sat, 10 Apr 2010 06:12:01 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12620" author="beberlei" created="Sat, 10 Apr 2010 06:12:01 +0000"  >&lt;p&gt;I removed the requirement of specifiying the paths to the mapping files at the CLI.&lt;/p&gt;

&lt;p&gt;1. For File Drivers they are known to the driver&lt;br/&gt;
2. For Annotations they can now be passed as an option to the EntityManagerHelper:&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;$mappingPaths = array(__DIR__ . &lt;span class=&quot;code-quote&quot;&gt;&quot;/entities&quot;&lt;/span&gt;);
&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; EntityManagerHelper($em, $mappingPaths);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This way you have to configure this only once.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11205">DDC-510</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-477] Schema tool does not support STI - attempts duplicate table creation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-477</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sample entities:&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;/**
 * @Entity
 * @InheritanceType(&quot;SINGLE_TABLE&quot;)
 * @DiscriminatorColumn(name=&quot;type&quot;, type=&quot;string&quot;)
 * @DiscriminatorMap({&quot;User&quot; = &quot;User&quot;, &quot;Group&quot; = &quot;Group&quot;})
 * @Table(name=&quot;user&quot;)
 */
class User extends Principal
{}

/**
 * @Entity
 * @InheritanceType(&quot;SINGLE_TABLE&quot;)
 * @DiscriminatorColumn(name=&quot;type&quot;, type=&quot;string&quot;)
 * @DiscriminatorMap({&quot;User&quot; = &quot;User&quot;, &quot;Group&quot; = &quot;Group&quot;})
 * @Table(name=&quot;user&quot;)
 */
class Group extends Principal
{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;CLI Results:&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;daves-macbookpro:sandbox hobodave$ ./doctrine Orm:schema-tool --create --dump-sql
Doctrine Command Line Interface

Orm:schema-tool =&amp;gt; The table with name &apos;user&apos; already exists.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I would expect it to be intelligent enough to not try to create the user table twice.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11138">DDC-477</key>
            <summary>Schema tool does not support STI - attempts duplicate table creation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="hobodave">David Abdemoulaie</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Mar 2010 19:08:39 +0000</created>
                <updated>Sat, 10 Apr 2010 12:33:41 +0000</updated>
                    <resolved>Sat, 10 Apr 2010 07:51:01 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12465" author="beberlei" created="Fri, 26 Mar 2010 04:45:28 +0000"  >&lt;p&gt;I think the mapping is wrong, you effectivly define STI twice. It has to be done on the most parent class, i.e. on Principal.&lt;/p&gt;</comment>
                    <comment id="12466" author="romanb" created="Fri, 26 Mar 2010 06:05:57 +0000"  >&lt;p&gt;Benjamin is right. This is also stated in the docs: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/inheritance-mapping#single-table-inheritance&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/inheritance-mapping#single-table-inheritance&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="12613" author="hobodave" created="Sat, 10 Apr 2010 02:44:51 +0000"  >&lt;p&gt;A recent update broke all support for STI.&lt;/p&gt;

&lt;p&gt;Now the following does not work:&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;/**
 * @MappedSuperclass
 * @InheritanceType(&quot;SINGLE_TABLE&quot;)
 * @DiscriminatorColumn(name=&quot;type&quot;, type=&quot;string&quot;)
 * @DiscriminatorMap({&quot;User&quot; = &quot;User&quot;, &quot;Group&quot; = &quot;Group&quot;})
 * @Table(name=&quot;user&quot;)
 */
abstract class Principal
{}
/**
 * @Entity
 */
class Group extends Principal
{}
/**
 * @Entity
 */
class User extends Principal
{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Attempting to use orm:schema-tool:create results in the following error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;Group (user_id INT NOT NULL, username VARCHAR(45) NOT NULL, password VARCHAR(40)&apos; at line 1  &lt;/p&gt;</comment>
                    <comment id="12625" author="beberlei" created="Sat, 10 Apr 2010 07:50:21 +0000"  >&lt;p&gt;Can you paste the complete SQL?&lt;/p&gt;

&lt;p&gt;You can call $em-&amp;gt;getConfiguration()-&amp;gt;setSQLLogger(new EchoSqlLogger()); to print it&lt;/p&gt;</comment>
                    <comment id="12626" author="beberlei" created="Sat, 10 Apr 2010 07:51:01 +0000"  >&lt;p&gt;plus add a new issue please, this is pretty different to the orignal one.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11207">DDC-511</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-449] ClassMetadata Exporter Refactorings broke DatabaseDriverTest</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-449</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;1) Doctrine\Tests\ORM\Functional\DatabaseDriverTest::testCreateSimpleYamlFromDatabase
Exception: [PHPUnit_Framework_Error_Warning] is_dir() expects parameter 1 to be string, object given

With queries:
2. SQL: &apos;CREATE TABLE dbdriver_foo (id INT NOT NULL, bar VARCHAR(200) NOT NULL, PRIMARY KEY(id))&apos; Params: 

Trace:
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Tools/ClassMetadataReader.php:188
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Tools/ClassMetadataReader.php:135
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php:124
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:92
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:36


/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/OrmFunctionalTestCase.php:259

2) Doctrine\Tests\ORM\Functional\DatabaseDriverTest::testCreateYamlWithForeignKeyFromDatabase
Exception: [PHPUnit_Framework_Error_Warning] is_dir() expects parameter 1 to be string, object given

With queries:
5. SQL: &apos;ALTER TABLE dbdriver_baz ADD CONSTRAINT dbdriver_baz_bar_id_fk FOREIGN KEY (bar_id) REFERENCES dbdriver_bar(id) NOT DEFERRABLE INITIALLY IMMEDIATE&apos; Params: 
4. SQL: &apos;CREATE TABLE dbdriver_baz (id INT NOT NULL, bar_id INT NOT NULL, PRIMARY KEY(id))&apos; Params: 
3. SQL: &apos;DROP TABLE dbdriver_baz&apos; Params: 
2. SQL: &apos;CREATE TABLE dbdriver_bar (id INT NOT NULL, PRIMARY KEY(id))&apos; Params: 

Trace:
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Tools/ClassMetadataReader.php:188
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Tools/ClassMetadataReader.php:135
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php:124
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:92
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php:72


/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/OrmFunctionalTestCase.php:259
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11099">DDC-449</key>
            <summary>ClassMetadata Exporter Refactorings broke DatabaseDriverTest</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Mar 2010 13:20:47 +0000</created>
                <updated>Wed, 24 Mar 2010 11:32:02 +0000</updated>
                    <resolved>Wed, 24 Mar 2010 11:32:02 +0000</resolved>
                                            <fixVersion>2.0-BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-412] YAML can&apos;t handle multiple lifecycle events with one method</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-412</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;YAML uses the method as key and therefore can only register one lifecycle event per method. Annotations and XML dont have this limitation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11036">DDC-412</key>
            <summary>YAML can&apos;t handle multiple lifecycle events with one method</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Mar 2010 17:22:12 +0000</created>
                <updated>Mon, 15 Mar 2010 15:32:47 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:32:47 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12093" author="shurakai" created="Thu, 11 Mar 2010 18:37:35 +0000"  >&lt;p&gt;I think we should simply flip the order in line 383 (instead of method =&amp;gt; type use type =&amp;gt; method). One would have to use &lt;/p&gt;

&lt;p&gt;prePersist: doSomethingOnPrePersist &lt;/p&gt;

&lt;p&gt;in that case. This should be easy enough to fix.&lt;/p&gt;

&lt;p&gt;Remember to change documentation if this fix is accepted.&lt;/p&gt;</comment>
                    <comment id="12100" author="beberlei" created="Fri, 12 Mar 2010 03:58:50 +0000"  >&lt;p&gt;this wouldnt allow multiple methods per 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;prePersist:
  doSomethingOnPrePersist1
  doSomethingOnPrePersist2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12170" author="shurakai" created="Sun, 14 Mar 2010 20:04:19 +0000"  >&lt;p&gt;Benjamin, I got you wrong the first time - sorry. I&apos;ve attached a patch and some tests that should fix this issue. The test also affects other drivers so the mapping files needed updating too.&lt;/p&gt;

&lt;p&gt;Please make sure to update your models accordingly:&lt;/p&gt;

&lt;p&gt;Former syntax:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt; methodname: lifecycle&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;now:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt; lifecycle: [ method ]&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Multiple methods:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt; lifecycle: [ method1, method2 ]&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;This should also be noted in the docs and especially in the upgrade instructions from Alpha4 to Beta1. Could you please take care of that?&lt;/p&gt;</comment>
                    <comment id="12224" author="beberlei" created="Mon, 15 Mar 2010 15:32:47 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10460" name="yaml_multiple_lifecycles.patch" size="13647" author="shurakai" created="Sun, 14 Mar 2010 20:04:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-384] Add support for Entity namespacing globally</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-384</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Recently Jonathan committed a patch to support Entity aliasing.&lt;br/&gt;
Patch at first glance looks good, but it has some issues (it double processes the loadedMetadata).&lt;/p&gt;

&lt;p&gt;I have fixed this issue by including a new level of configuration. Instead of create a 1 alias =&amp;gt; 1 entity hashmap, I added support for namespacing.&lt;br/&gt;
The idea is similar to AnnotationReader support recently introduced.&lt;/p&gt;

&lt;p&gt;To take advantage of it, simply include the $ormConfig-&amp;gt;addEntityNamespace(&apos;CMS&apos;, &apos;Doctrine\Tests\ORM\Models&apos;);&lt;br/&gt;
Then, just do: &quot;SELECT u FROM CMS:CmsUser u&quot;&lt;/p&gt;

&lt;p&gt;This is also supported in $em-&amp;gt;getReference(), -&amp;gt;getRepository(), etc.&lt;/p&gt;

&lt;p&gt;Patch is attached including updated unit test plus another test for getRepository().&lt;/p&gt;</description>
                <environment></environment>
            <key id="10974">DDC-384</key>
            <summary>Add support for Entity namespacing globally</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Feb 2010 22:48:15 +0000</created>
                <updated>Thu, 4 Mar 2010 12:50:36 +0000</updated>
                    <resolved>Thu, 4 Mar 2010 12:50:36 +0000</resolved>
                                            <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11876" author="romanb" created="Mon, 1 Mar 2010 07:54:43 +0000"  >&lt;p&gt;My initial comments:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;T_COLON is not needed, its not a token and never used.&lt;/li&gt;
	&lt;li&gt;The lexer pattern should remain simple: &apos;&lt;span class=&quot;error&quot;&gt;&amp;#91;a-z_&amp;#93;&lt;/span&gt;[a-z0-9_:\\\]*&apos;&lt;/li&gt;
	&lt;li&gt;The changes to ClassMetadataFactory#getMetadataFor are not good because they bypass the cache, invoking a method and functions. This is the most used method of all times. 1 more method call here means hundreds or even thousands more method calls in practice, 1 more function invocation means hundreds or even thousands more function calls in practice. strrpos is not needed also because a colon &quot;:&quot; should always separate a namespace and there should always only be 1 colon, if any.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;== UPDATE ==&lt;/p&gt;

&lt;p&gt;&lt;b&gt;I just realized that the old alias map implementation completely bypassed the cache (ouch!). You would never get a hit on $this-&amp;gt;_loadedMetadata with an alias because the metadata is only stored for the fully qualified class name. As a result the metadata is loaded again and again and again on each invocation, whether its from the metadata cache or from the sources, both is awful.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Summary:&lt;/p&gt;

&lt;p&gt;1) The old/current alias map implementation is badly broken.&lt;br/&gt;
2) The new implementation is too slow and I dont see an elegant way to do it properly.&lt;/p&gt;

&lt;p&gt;When reconsidering that we&apos;re talking of a (imho minor) convenience feature here, unless someone has a good implementation for getMetadataFor that is both fast and correct, I dont see a way to support that feature, neither the old one nor the new one.&lt;/p&gt;</comment>
                    <comment id="11880" author="romanb" created="Mon, 1 Mar 2010 08:08:41 +0000"  >&lt;p&gt;The new implementation could use double-check approach on the cache after the full class name has been invoked, similar to what I have shown in a comment on &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-379&quot; title=&quot;Implement entity aliases&quot;&gt;&lt;del&gt;DDC-379&lt;/del&gt;&lt;/a&gt;. Only people who use aliasing would suffer an extra perf. hit from extracting the namespace and double-checking the cache.&lt;/p&gt;

&lt;p&gt;Again, any code that resolves namespace aliases must be &lt;b&gt;inside&lt;/b&gt; the outermost if ( ! isset($this-&amp;gt;_loadedMetadata&lt;span class=&quot;error&quot;&gt;&amp;#91;$className&amp;#93;&lt;/span&gt;)) block, not outside because that impacts every single call, even for people who dont use aliasing.&lt;/p&gt;</comment>
                    <comment id="11881" author="romanb" created="Mon, 1 Mar 2010 08:17:39 +0000"  >&lt;p&gt;Here is my suggestion for the getMetadataFor 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;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getMetadataFor($className)
    {
        &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;_loadedMetadata[$className])) {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strpos($className, &apos;:&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
                list($namespaceAlias, $simpleClassName) = explode(&apos;:&apos;, $className);
                $className = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getConfiguration()-&amp;gt;getEntityNamespace($namespaceAlias) . &apos;\\&apos; . $simpleClassName;
                &lt;span class=&quot;code-comment&quot;&gt;// Check cache again after resolving the full class name
&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;_loadedMetadata[$className])) {
                    &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;_loadedMetadata[$className];
                }
            }

            $cacheKey = &lt;span class=&quot;code-quote&quot;&gt;&quot;$className\$CLASSMETADATA&quot;&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;_cacheDriver) {
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (($cached = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_cacheDriver-&amp;gt;fetch($cacheKey)) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
                    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_loadedMetadata[$className] = $cached;
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                    foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_loadMetadata($className) as $loadedClassName) {
                        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_cacheDriver-&amp;gt;save($cacheKey, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_loadedMetadata[$className], &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
                    }
                }
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_loadMetadata($className);
            }
        }
        
        &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;_loadedMetadata[$className];
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that even this implementation means when you use aliasing you get extra strpos/explode/method calls on the configuration &lt;b&gt;on every invocation&lt;/b&gt; but at least you have the choice. People who dont use aliasing are only punished with a single strpos() on a cache-miss.&lt;/p&gt;

&lt;p&gt;Thats the only feasible implementation I can see currently.&lt;/p&gt;</comment>
                    <comment id="11882" author="guilhermeblanco" created="Mon, 1 Mar 2010 09:22:34 +0000"  >&lt;p&gt;T_COLON:&lt;br/&gt;
Sorry, forgot to remove that.&lt;/p&gt;


&lt;p&gt;LEXER::&lt;br/&gt;
NO. It must be changed. It&apos;s a lexical error to have an identifier named: &quot;Foo:&quot; or even &quot;MyProject\&quot; and it&apos;s currently supported as a valid one.&lt;br/&gt;
It&apos;s a bug that is not directly related to this enhancement, but it&apos;s still a bug that must be fixed.&lt;/p&gt;

&lt;p&gt;We validate this AbstractSchemaName as wrong only in semantical checks, when actually trying to load the class using $exists = class_exists($schemaName, true);&lt;br/&gt;
That&apos;s wrong and must be fixed.&lt;/p&gt;


&lt;p&gt;STRRPOS:&lt;br/&gt;
I don&apos;t have the direct intention, but the purpose of strrpos is to actually support subnamespacing of entities. In theory, this would be supported:&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;$ormConfig-&amp;gt;addEntityNamespace(&apos;FMM&apos;, &apos;FMM\Entity&apos;)
                      -&amp;gt;addEntityNamespace(&apos;FMM:Wiki&apos;, &apos;FMM\Wiki\Entity&apos;);

$q = $em-&amp;gt;createQuery(&apos;SELECT a FROM FMM:Wiki:Article a&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of course by adding the alias, we support subnamespacing WITHIN the same namespace by 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;$q = $em-&amp;gt;createQuery(&apos;SELECT e FROM FMM:SomeModule\Entity e&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, I agree that I wasn&apos;t happy with the bypass of cache hit and surely I can add the second lookup in cache hash map.&lt;br/&gt;
But also, I think we could take advatange of ClassMetadataFactory::setMetadataFor($className, $class) and consider to add an alias there too, preventing even the substr. Since class instances are always passed by reference, this  would have a very low resources usage increase, but almost none performant impact. What do you think?&lt;/p&gt;</comment>
                    <comment id="11883" author="romanb" created="Mon, 1 Mar 2010 09:51:32 +0000"  >&lt;p&gt;LEXER:&lt;br/&gt;
&lt;del&gt;Well, the purpose of our lexer is not to be ultimately strict. Even with your change it sill allows &quot;:Foo&quot; and other weird edge-cases. Once you start wanting to make everything super-strict you&apos;re on a road with no end. Keep the lexer patterns as simple as possible. False positives are not really problematic, only false negatives are.&lt;/del&gt;&lt;br/&gt;
OK.&lt;/p&gt;

&lt;p&gt;STRRPOS:&lt;br/&gt;
I think subnamespacing unnecessarily overcomplicates things. Lets stay simple.&lt;/p&gt;

&lt;p&gt;Re: Storing alias + full class name in _loadedMetadata.&lt;br/&gt;
I thought about that but it can not be implemented easily because _loadMetadata populates _loadedMetadata directly and must do so in order to work properly. Thus I discarded the idea, it would spread the knowledge of aliasing out across larger parts of the code, we dont want that.&lt;/p&gt;

&lt;p&gt;I still think the implementation I proposed above is the best.&lt;/p&gt;</comment>
                    <comment id="11888" author="guilhermeblanco" created="Mon, 1 Mar 2010 15:32:12 +0000"  >&lt;p&gt;LEXER: Fine... will commit the patch when we agree on final things. If we didn&apos;t reach an optimal implementation, patch is not 100% correct.&lt;/p&gt;

&lt;p&gt;STRRPOS: I&apos;m fine with that. That would make code much more simple.&lt;/p&gt;

&lt;p&gt;HASHMAP OF ALIAS:&lt;br/&gt;
I can be implemented and my patch is already done. Will upload it as soon as I get my implementation updated (due to previous subject).&lt;br/&gt;
I found another issue inside the getMetadataFor that I like to talk to you, so once possible... let&apos;s chat.&lt;/p&gt;</comment>
                    <comment id="11951" author="guilhermeblanco" created="Tue, 2 Mar 2010 10:38:12 +0000"  >&lt;p&gt;New patch, supporting alias and more performant&lt;/p&gt;</comment>
                    <comment id="11959" author="jwage" created="Tue, 2 Mar 2010 11:22:59 +0000"  >&lt;p&gt;Roman, what is your opinion on this? Are you ok with Guilhermes patch now or would you still like to go with your original proposed patch?&lt;/p&gt;</comment>
                    <comment id="11963" author="romanb" created="Tue, 2 Mar 2010 12:14:29 +0000"  >&lt;p&gt;The new patch looks smart but I would still like to see _resolveClassName inlined and simplified according to my earlier proposal in a comment (strpos + explode instead of strrpos + substr + substr).&lt;/p&gt;

&lt;p&gt;Btw, in the lexer pattern I think you can leave off the &lt;/p&gt;
{1}
&lt;p&gt;, it makes no difference, the set &lt;span class=&quot;error&quot;&gt;&amp;#91;a-z0-9_&amp;#93;&lt;/span&gt; already means 1 char of this set afaik.&lt;/p&gt;

&lt;p&gt;Apart from these things the patch looks good now.&lt;/p&gt;</comment>
                    <comment id="11992" author="guilhermeblanco" created="Tue, 2 Mar 2010 20:31:57 +0000"  >&lt;p&gt;In r7300 this enhancement was committed.&lt;/p&gt;</comment>
                    <comment id="11998" author="romanb" created="Wed, 3 Mar 2010 05:59:13 +0000"  >&lt;p&gt;Perfect, looks good. Nice work!&lt;/p&gt;</comment>
                    <comment id="12017" author="jnye" created="Wed, 3 Mar 2010 15:45:26 +0000"  >&lt;p&gt;I think this broke proxy objects.&lt;br/&gt;
&quot;Parse error: syntax error, unexpected &apos;:&apos;, expecting &apos;{&apos; in /home/josh/src/superman/app/models/proxies/app:UserProxy.php on line 6&quot;&lt;/p&gt;
</comment>
                    <comment id="12019" author="guilhermeblanco" created="Wed, 3 Mar 2010 20:49:36 +0000"  >&lt;p&gt;Joshua found an issue in implementation, reopening it for inspection&lt;/p&gt;</comment>
                    <comment id="12020" author="guilhermeblanco" created="Wed, 3 Mar 2010 20:50:49 +0000"  >&lt;p&gt;@Joshua, could you please provide more information about what were you trying to do when you got this issue, etc?&lt;/p&gt;

&lt;p&gt;Depending how complex the issue is, it may be required for us to revert my changeset and try a different approach.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="12021" author="guilhermeblanco" created="Wed, 3 Mar 2010 21:02:50 +0000"  >&lt;p&gt;Increased priority... this should be fixed ASAP.&lt;/p&gt;</comment>
                    <comment id="12022" author="jnye" created="Wed, 3 Mar 2010 22:57:00 +0000"  >&lt;p&gt;I was using the new namespace syntax while trying to get a reference. I&apos;m not sure if support for this was meant or not.&lt;/p&gt;

&lt;p&gt;$config-&amp;gt;setAutoGenerateProxyClasses(true); // Enable proxy class generation.&lt;br/&gt;
$config-&amp;gt;addEntityNamespace(&apos;app&apos;, &apos;app\models&apos;); // Setup namespace on the EntityManager configuration.&lt;br/&gt;
$em = EntityManager::create($conn, $config);&lt;br/&gt;
$user = $em-&amp;gt;getReference(&apos;app:User&apos;, 3610); // Get reference. Triggers generation of invalid PHP proxy class.&lt;/p&gt;
</comment>
                    <comment id="12024" author="romanb" created="Thu, 4 Mar 2010 07:45:56 +0000"  >&lt;p&gt;This should be fixed now. Can you confirm?&lt;/p&gt;</comment>
                    <comment id="12025" author="jnye" created="Thu, 4 Mar 2010 08:08:52 +0000"  >&lt;p&gt;Yes, it&apos;s working again. Thanks.&lt;/p&gt;</comment>
                    <comment id="12031" author="romanb" created="Thu, 4 Mar 2010 12:50:36 +0000"  >&lt;p&gt;Seems to be ok now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10408" name="patch-entity-namespace.diff" size="9325" author="guilhermeblanco" created="Tue, 2 Mar 2010 10:38:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-282] Evaluate use of (bool) in XML-Driver</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-282</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There are still some casts to (bool) in the XmlDriver and we should check wheater they are working correctly.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10796">DDC-282</key>
            <summary>Evaluate use of (bool) in XML-Driver</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jan 2010 23:15:47 +0000</created>
                <updated>Sat, 30 Jan 2010 20:25:13 +0000</updated>
                    <resolved>Sat, 30 Jan 2010 20:25:13 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11532" author="beberlei" created="Sat, 30 Jan 2010 20:25:13 +0000"  >&lt;p&gt;Added additional assertions to show that all the use of (bool) for cascade elements is working correctly.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10706">DDC-247</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-736] Nasty ordering issue with fetch-joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-736</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Will not work correctly:&lt;/p&gt;

&lt;p&gt;select c, ca from Cart ca join ca.customer c&lt;/p&gt;

&lt;p&gt;Works correctly:&lt;/p&gt;

&lt;p&gt;select ca, c from Cart ca join ca.customer c&lt;/p&gt;

&lt;p&gt;In the first case the ordering of the DQL aliases causes associations to be skipped during hydration.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11738">DDC-736</key>
            <summary>Nasty ordering issue with fetch-joins</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sat, 7 Aug 2010 16:57:49 +0000</created>
                <updated>Fri, 10 Dec 2010 14:57:01 +0000</updated>
                    <resolved>Sat, 13 Nov 2010 03:55:32 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14151" author="romanb" created="Mon, 30 Aug 2010 06:19:29 +0000"  >&lt;p&gt;Scheduling for RC1.&lt;/p&gt;</comment>
                    <comment id="14571" author="mitmaro" created="Fri, 15 Oct 2010 12:49:42 +0000"  >&lt;p&gt;If anyone is getting issues with missing or incorrectly ordered relations it may be caused by this bug.&lt;/p&gt;

&lt;p&gt;Would it be possible to put a note in the documentation to ensure the order of the select clause must match that of the joins. I just spent 2 days trying to figure out why the data being returned was incorrect.&lt;/p&gt;</comment>
                    <comment id="14712" author="beberlei" created="Wed, 10 Nov 2010 17:36:55 +0000"  >&lt;p&gt;Patch that solves this problem. What does it do?&lt;/p&gt;

&lt;p&gt;Two additional instance variables are needed, one for the order of the AliasIdentificationVariables and one for a IdentVariable =&amp;gt; SelectExpression lookup map.&lt;/p&gt;

&lt;p&gt;Inside parse() a reordering is done right before the SQL Walkers are created. This is only done if there is more than one Identification variable in the select expressions, otherwise its not necessary.&lt;/p&gt;

&lt;p&gt;The reordering iterates in order of the alias identification variables, grabs the expression from the select expressions and appends it to them. This way it is guaranteed that the expressions are ordered 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;SELECT a, b, c.foo, count(d.bar) FROM B b JOIN b.a a JOIN ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;becomes:&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 c.foo, count(d.bar), b, a FROM ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Roman do you think this is viable? See the patch for more details &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;</comment>
                    <comment id="14725" author="romanb" created="Fri, 12 Nov 2010 17:57:52 +0000"  >&lt;p&gt;Attached simplified patch.&lt;/p&gt;</comment>
                    <comment id="14726" author="beberlei" created="Sat, 13 Nov 2010 03:55:32 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                    <comment id="14926" author="hype" created="Tue, 7 Dec 2010 09:02:17 +0000"  >&lt;p&gt;I think that this patch breaks modifying the select clause in custom tree walkers because walking the select clause will be done after the $_identVariableExpressions array is populated. Reordering the identification variables will then override the modified select clause.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12200">DDC-915</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12218">DDC-925</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10860" name="ddc736-simplified.patch" size="3869" author="romanb" created="Fri, 12 Nov 2010 17:56:32 +0000" />
                    <attachment id="10857" name="ddc736.patch" size="3763" author="beberlei" created="Wed, 10 Nov 2010 17:36:55 +0000" />
                    <attachment id="10846" name="DDC736Test.php" size="1405" author="romanb" created="Sat, 6 Nov 2010 13:13:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-729] When merging many to many entities back into the repository all associations are deleted on the next flush</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-729</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging a DETACHED entity into the repository with a ManyToMany association, the entries in the join table are deleted on the next flush.&lt;/p&gt;

&lt;p&gt;Many Movies have many Artists:&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 Movie {
	
	/** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
	/** @Column(length=50, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $title;
	
	/** 
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Artist&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $artists;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;artists = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
	}
	
}
&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;class Artist {
	
	/** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
	/** @Column(length=50, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
	
	/** @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Movie&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;artists&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $movies;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;movies = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Assume that the database contains:&lt;br/&gt;
  Movie: id=1, title=&quot;Movie 1&quot;&lt;br/&gt;
  Artist: id=1, name=&quot;Artist 1&quot;&lt;/p&gt;

&lt;p&gt;and that there is a entry (1, 1) in movie_artist so that there is a many-many relationship between Movie 1 and Artist 1.&lt;/p&gt;

&lt;p&gt;I then run the following code to merge the existing associations into the entity manager:&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; \vo\Movie();
$m1-&amp;gt;id = 1;
$m1-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Movie 1&quot;&lt;/span&gt;;

$a1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Artist();
$a1-&amp;gt;id = 1;
$a1-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Artist 1&quot;&lt;/span&gt;;

$m1-&amp;gt;artists-&amp;gt;add($a1); $a1-&amp;gt;movies-&amp;gt;add($m1);

$m1 = $em-&amp;gt;merge($m1);
$m1-&amp;gt;artists-&amp;gt;set(0, $em-&amp;gt;merge($a1));
$a1-&amp;gt;movies-&amp;gt;set(0, $em-&amp;gt;merge($m1));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At this point $m1 should contains merged entities reflecting the same as what is in the database.&lt;/p&gt;

&lt;p&gt;If I now 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;$em-&amp;gt;flush()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the association is deleted from movie_artist and the SQL log shows DELETE FROM Movie_Artist WHERE Movie_id = &apos;1&apos; as having been run.&lt;/p&gt;

&lt;p&gt;Debugging $m1 both before and after the flush shows the expected values, and $em-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets() is empty before the flush.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11701">DDC-729</key>
            <summary>When merging many to many entities back into the repository all associations are deleted on the next flush</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Jul 2010 07:44:13 +0000</created>
                <updated>Wed, 11 Aug 2010 06:30:50 +0000</updated>
                    <resolved>Mon, 9 Aug 2010 17:05:16 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13840" author="beberlei" created="Sun, 8 Aug 2010 06:03:14 +0000"  >&lt;p&gt;Can you explain why you merge $m1 twice?&lt;/p&gt;</comment>
                    <comment id="13843" author="ccapndave" created="Sun, 8 Aug 2010 06:59:19 +0000"  >&lt;p&gt;Its a representation of how the algorithm I am using works - it assumes that once an entity is managed merge() will just return the already managed entity.&lt;/p&gt;

&lt;p&gt;Anyway, to be sure I just ran another test that only calls merge() once, and it has the same behaviour.&lt;/p&gt;</comment>
                    <comment id="13860" author="beberlei" created="Sun, 8 Aug 2010 10:09:35 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="13879" author="ccapndave" created="Mon, 9 Aug 2010 14:05:58 +0000"  >&lt;p&gt;A slightly different many to many merge bug is occurring - I am re-opening this ticket for it because a) I expect it is somewhat related and b) the example to recreate follows on from the example in this bug.&lt;/p&gt;

&lt;p&gt;Now assume the database has one more artist:&lt;/p&gt;

&lt;p&gt;Movie: id=1, title=&quot;Movie 1&quot;&lt;br/&gt;
Artist: id=1, name=&quot;Artist 1&quot;&lt;br/&gt;
Artist: id=2, name=&quot;Artist 2&quot;&lt;/p&gt;

&lt;p&gt;and that there is still only an entry (1, 1) in movie_artist so that there is a many-many relationship between Movie 1 and Artist 1.&lt;/p&gt;

&lt;p&gt;I then run the following code to merge the existing entity AND add a new association between artist 2 and movie 1:&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; \vo\Movie();
$m1-&amp;gt;id = 1;
$m1-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Movie 1&quot;&lt;/span&gt;;

$a1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Artist();
$a1-&amp;gt;id = 1;
$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; \vo\Artist();
$a2-&amp;gt;id = 2;
$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);

$m1 = $em-&amp;gt;merge($m1);

$m1-&amp;gt;artists-&amp;gt;set(0, $em-&amp;gt;merge($a1));
$a1-&amp;gt;movies-&amp;gt;set(0, $em-&amp;gt;merge($m1));

$m1-&amp;gt;artists-&amp;gt;set(1, $em-&amp;gt;merge($a2));
$a2-&amp;gt;movies-&amp;gt;set(1, $em-&amp;gt;merge($m1));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I now 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;$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Instead of getting a (1, 2) entry added to movie_artist as expected, the change sets are empty and I get the following error:&lt;/p&gt;

&lt;p&gt;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: 1062 Duplicate entry &apos;1-2&apos; for key &apos;PRIMARY&apos;&apos; in D:\Projects\ORM\doctrine2\lib\vendor\doctrine-dbal\lib\Doctrine\DBAL\Connection.php on line 646&lt;br/&gt;
( ! ) PDOException: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1-2&apos; for key &apos;PRIMARY&apos; in D:\Projects\ORM\doctrine2\lib\vendor\doctrine-dbal\lib\Doctrine\DBAL\Connection.php on line 646&lt;br/&gt;
Call Stack&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Time	Memory	Function	Location&lt;br/&gt;
1	0.0006	400744	
{main}
&lt;p&gt;( )	..\index.php:0&lt;br/&gt;
2	0.0933	4375416	Doctrine\ORM\EntityManager-&amp;gt;flush( )	..\index.php:62&lt;br/&gt;
3	0.0934	4375416	Doctrine\ORM\UnitOfWork-&amp;gt;commit( )	..\EntityManager.php:320&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
</comment>
                    <comment id="13882" author="beberlei" created="Mon, 9 Aug 2010 16:23:12 +0000"  >&lt;p&gt;There is no CASCADE=MERGE on this relation or?&lt;/p&gt;</comment>
                    <comment id="13883" author="ccapndave" created="Mon, 9 Aug 2010 16:25:55 +0000"  >&lt;p&gt;No - I think I am simulating what cascade merge would do though.&lt;/p&gt;</comment>
                    <comment id="13884" author="beberlei" created="Mon, 9 Aug 2010 16:59:43 +0000"  >&lt;p&gt;I cannot reproduce this with any case.&lt;/p&gt;

&lt;p&gt;Additionally your algorithm is REALLY slow compared to doing this natively in the UnitOfWork. The merge operation does lots of stuff even if the entity is already merged before.&lt;/p&gt;</comment>
                    <comment id="13885" author="beberlei" created="Mon, 9 Aug 2010 17:05:16 +0000"  >&lt;p&gt;Added 3 more tests that verify the correct behavior. Please add a failing test-case for this and open up a new ticket.&lt;/p&gt;</comment>
                    <comment id="13902" author="ccapndave" created="Wed, 11 Aug 2010 06:30:50 +0000"  >&lt;p&gt;Thanks for pointing out the inefficiency in the algorithm - you are completely right and as recommended I have changed the Flextrine codebase to use UnitOfWork merge (by internally changing the metadata to enable cascade).  However, there still seems to be a bug mergng many to many - I will open it up in a new ticket.  Cheers &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-685] Bug in BasicEntityPersister</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-685</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have Entity:&lt;/p&gt;

&lt;p&gt;class Comments&lt;br/&gt;
{&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Column(type=&quot;integer&quot;)&lt;/li&gt;
	&lt;li&gt;@Id&lt;/li&gt;
	&lt;li&gt;@GeneratedValue(strategy=&quot;IDENTITY&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    private $commentId;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;   /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Column (type=&quot;integer&quot;, nullable=true)&lt;br/&gt;
     */&lt;br/&gt;
    private $userId;&lt;br/&gt;
   ...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ManyToOne(targetEntity=&quot;Entities\Passport\Clients&quot;)&lt;/li&gt;
	&lt;li&gt;@JoinColumn(name=&quot;userId&quot;, referencedColumnName=&quot;clientID&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    private $Clients;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;    ...&lt;/p&gt;

&lt;p&gt;here i have field userId, and relation with another table on this field.&lt;/p&gt;

&lt;p&gt;Where i`m trying to insert (flush) new record in table, i get null value in field userId.&lt;/p&gt;

&lt;p&gt;In method _prepareUpdateData (class BasicEntityPersister) field userId overlaps by field of  &quot;attachable&quot; table Clents - userId, and sets to null.&lt;/p&gt;</description>
                <environment>Ubuntu Linux 10.04, &lt;br/&gt;
Nginx + FastCGI,&lt;br/&gt;
PHP 5.3.2,&lt;br/&gt;
MySQL,&lt;br/&gt;
etc</environment>
            <key id="11614">DDC-685</key>
            <summary>Bug in BasicEntityPersister</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="avi">Avi</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 03:14:28 +0000</created>
                <updated>Mon, 12 Jul 2010 04:21:52 +0000</updated>
                    <resolved>Mon, 12 Jul 2010 04:21:19 +0000</resolved>
                            <version>2.0-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13568" author="beberlei" created="Mon, 12 Jul 2010 04:21:19 +0000"  >&lt;p&gt;First: your mapping is wrong, you are not supposed to map foreign keys. UserId is supposed to be a ManyToOne relation with the User class.&lt;/p&gt;

&lt;p&gt;Second: If you want to do this anyways, there is arleady two issues for it: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-419&quot; title=&quot;Problem when I make a INNER JOIN between 2 classes&quot;&gt;&lt;del&gt;DDC-419&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-522&quot; title=&quot;Join columns can not be named the same as the association fields.&quot;&gt;&lt;del&gt;DDC-522&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-684] Flaw in Build Process?</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-684</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As I see it from our build script, each PEAR package of ORM and DBAL includes the Common sources again, although it sets itself as dependent on that package? That would mean the ORM package overwrites the files from the DBAL and Common packages.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11612">DDC-684</key>
            <summary>Flaw in Build Process?</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 11 Jul 2010 03:53:55 +0000</created>
                <updated>Mon, 30 Aug 2010 17:39:18 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 17:39:18 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13812" author="beberlei" created="Sat, 7 Aug 2010 05:40:56 +0000"  >&lt;p&gt;Assigned to jon.&lt;/p&gt;

&lt;p&gt;One solution would be to change the package.xml to reference only the ORM code, although DBAL and Common are also shipped.&lt;/p&gt;</comment>
                    <comment id="13826" author="jwage" created="Sat, 7 Aug 2010 08:46:23 +0000"  >&lt;p&gt;Hmm. I don&apos;t understand what you mean. The ORM includes the DBAL and Common code and installs it? Should it not do that and require that you install the dependencies via PEAR?&lt;/p&gt;</comment>
                    <comment id="13828" author="beberlei" created="Sat, 7 Aug 2010 10:02:18 +0000"  >&lt;p&gt;yes, otherwise if you install DBAL after ORM, the DBAL code will overwrite the DBAL code from the ORM. Or the other way around.&lt;/p&gt;

&lt;p&gt;Plus if you deinstall DBAL it will deinstall the DBAL code although ORM might still be installed.&lt;/p&gt;

&lt;p&gt;I can come up with about 20 other scenarios where this is problematic &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;</comment>
                    <comment id="14153" author="romanb" created="Mon, 30 Aug 2010 06:21:49 +0000"  >&lt;p&gt;Can we address this for BETA4 or should we push that to RC1 ? After releasing beta4 we still have time to address a lot of things before we go into RC.&lt;/p&gt;</comment>
                    <comment id="14163" author="jwage" created="Mon, 30 Aug 2010 10:27:01 +0000"  >&lt;p&gt;I think the only solution is for the pear packages to only include the specific code for that package and the dependencies installed via pear. But even then, installing the ORM will require a certain version of the DBAL, so if you already have a version of the DBAL installed, it will need you to install the version the ORM requires. So either way you can&apos;t mix and match packages. If you use the ORM, you wouldn&apos;t ever have your own version of Common and DBAL installed because they would conflict.&lt;/p&gt;</comment>
                    <comment id="14165" author="beberlei" created="Mon, 30 Aug 2010 11:48:26 +0000"  >&lt;p&gt;yes, but that is a downside of PEAR that we cannot influence.&lt;/p&gt;</comment>
                    <comment id="14166" author="jwage" created="Mon, 30 Aug 2010 12:54:30 +0000"  >&lt;p&gt;So the same problem exists either way. Do we have anything to fix then?&lt;/p&gt;</comment>
                    <comment id="14181" author="beberlei" created="Mon, 30 Aug 2010 17:39:18 +0000"  >&lt;p&gt;Fixed:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/dbal/commit/8054984a0448c54d5c658f60707b9ac490425c8b&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/dbal/commit/8054984a0448c54d5c658f60707b9ac490425c8b&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/803e33836518b7c019db667f482601f55803c29d&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/803e33836518b7c019db667f482601f55803c29d&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2 packages are now generated, one full package and one PEAR package. The PEAR package does not contain its dependencies, instead defines where to fetch them using the &amp;lt;dependencies&amp;gt;&amp;lt;package&amp;gt; configuration for d51PearPkg2 task.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-661] SchemaTool::getSchemaFromMetadata throws Fatal Errror: Undefined method Doctrine\DBAL\Schema\Table::setIdGeneratorType()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-661</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Commit &lt;a href=&quot;http://github.com/doctrine/dbal/commit/b016a5e411fa13f384d8a62a548851d3b17778dd&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/dbal/commit/b016a5e411fa13f384d8a62a548851d3b17778dd&lt;/a&gt; removes methods from Doctrine\DBAL\Schema\Table used in Doctrine\Orm\Tools\SchemaTool::getSchemaFromMetadata (lines 120-124 and 174-176).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11572">DDC-661</key>
            <summary>SchemaTool::getSchemaFromMetadata throws Fatal Errror: Undefined method Doctrine\DBAL\Schema\Table::setIdGeneratorType()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Jun 2010 07:49:50 +0000</created>
                <updated>Wed, 30 Jun 2010 08:14:33 +0000</updated>
                    <resolved>Wed, 30 Jun 2010 08:14:33 +0000</resolved>
                            <version>2.0-BETA3</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13463" author="romanb" created="Wed, 30 Jun 2010 08:14:33 +0000"  >&lt;p&gt;DBAL and ORM are separate projects and DBAL master and ORM master are never guaranteed to be (backwards)-compatible.&lt;/p&gt;

&lt;p&gt;The ORM master currently uses DBAL Beta2 and Common Beta3 as you can see from &quot;git submodule status&quot;.&lt;/p&gt;

&lt;p&gt;You need to use compatible versions of the projects or just download a release package from: &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/download&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/download&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-656] UnitOfWork::recomputeSingleEntityChangeSet does not preserve field order</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-656</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;XML&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; xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;    &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Entities\Specification&quot;&lt;/span&gt; table=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification&quot;&lt;/span&gt;&amp;gt;
        &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; length=&lt;span class=&quot;code-quote&quot;&gt;&quot;255&quot;&lt;/span&gt;/&amp;gt;
        &amp;lt;field 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; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;/&amp;gt;
        &amp;lt;id name=&lt;span class=&quot;code-quote&quot;&gt;&quot;specificationId&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification_id&quot;&lt;/span&gt;&amp;gt;
            &amp;lt;generator strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;/&amp;gt;
        &amp;lt;/id&amp;gt;
    &amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&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;$spec = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entities\Specification();
$spec-&amp;gt;setName(&apos;test1&apos;);
$spec-&amp;gt;setType(&apos;type1&apos;);
$em-&amp;gt;persist($spec);
$em-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSet($em-&amp;gt;getClassMetadata(get_class($spec)), $spec);
$data1 = $em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityChangeset($spec);
$spec-&amp;gt;setType(&apos;type2&apos;);
$em-&amp;gt;getUnitOfWork()-&amp;gt;recomputeSingleEntityChangeSet($em-&amp;gt;getClassMetadata(get_class($spec)), $spec);
$data2 = $em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityChangeset($spec);
&lt;span class=&quot;code-comment&quot;&gt;// data1 contains keys in correct order: name, type
&lt;/span&gt;var_dump($data1);
&lt;span class=&quot;code-comment&quot;&gt;// data2 contains keys in reverse order: type, name
&lt;/span&gt;var_dump($data2);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I got this issue when was trying to change entity properties using onFlush event&lt;/p&gt;</description>
                <environment>php 5.3.2, ubuntu 10.4</environment>
            <key id="11556">DDC-656</key>
            <summary>UnitOfWork::recomputeSingleEntityChangeSet does not preserve field order</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="wizardz">Andriy Savchenko</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Jun 2010 15:27:51 +0000</created>
                <updated>Sun, 4 Jul 2010 02:55:22 +0000</updated>
                    <resolved>Sun, 4 Jul 2010 02:55:22 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13432" author="beberlei" created="Sun, 27 Jun 2010 13:36:10 +0000"  >&lt;p&gt;fixed format&lt;/p&gt;</comment>
                    <comment id="13433" author="beberlei" created="Sun, 27 Jun 2010 13:36:48 +0000"  >&lt;p&gt;how is this a bug?&lt;/p&gt;</comment>
                    <comment id="13472" author="wizardz" created="Wed, 30 Jun 2010 17:58:40 +0000"  >&lt;p&gt;when you call $em-&amp;gt;flush() values are inserted switched&lt;/p&gt;</comment>
                    <comment id="13488" author="beberlei" created="Thu, 1 Jul 2010 18:39:38 +0000"  >&lt;p&gt;Updating priority to critical&lt;/p&gt;</comment>
                    <comment id="13503" author="beberlei" created="Sun, 4 Jul 2010 02:55:22 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-649] SQL Error with single table inheritance and findAll method</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-649</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When selecting all objects of SecondClass and ThirdClass which both inherit from FirstClass with the following code :&lt;/p&gt;

&lt;p&gt;$em-&amp;gt;getRepository(&apos;FirstClass&apos;)-&amp;gt;findAll();&lt;/p&gt;

&lt;p&gt;Postgresql is throwing the following error :&lt;br/&gt;
Invalid text representation: 7 ERROR: invalid input syntax for integer: &quot;&quot; LINE 1: ...er_stuff3 FROM &quot;first_class&quot; t0 WHERE t0.type IN (&apos;&apos;, &apos;1&apos;, &apos;... &lt;/p&gt;

&lt;p&gt;I think it&apos;s because of the empty string after the IN clause.&lt;/p&gt;

&lt;p&gt;There is the fail test case :&lt;/p&gt;

&lt;p&gt;Classes :&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 FirstClass {

  &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; $type;
}

class SecondClass &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; FirstClass {
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $otherStuff;
}

class ThirdClass &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; FirstClass {
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $otherStuff;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Mapping :&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; xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; xsi:schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;
  &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;FirstClass&quot;&lt;/span&gt; table=&apos;&lt;span class=&quot;code-quote&quot;&gt;&quot;first_class&quot;&lt;/span&gt;&apos; inheritance-type=&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;id name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;&amp;gt;
      &amp;lt;generator strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;/&amp;gt;
      &amp;lt;sequence-generator sequence-name=&lt;span class=&quot;code-quote&quot;&gt;&quot;first_class_id_seq&quot;&lt;/span&gt; allocation-size=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; initial-value=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;/&amp;gt;
    &amp;lt;/id&amp;gt;

    &amp;lt;discriminator-column 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;integer&quot;&lt;/span&gt; field-name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt; /&amp;gt;

    &amp;lt;discriminator-map&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;ThirdClass&quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;SecondClass&quot;&lt;/span&gt; /&amp;gt;
    &amp;lt;/discriminator-map&amp;gt;
  &amp;lt;/entity&amp;gt;
  &amp;lt;/doctrine-mapping&amp;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; xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; xsi:schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;
  &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;SecondClass&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherStuff&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;other_stuff&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;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; xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; xsi:schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;
  &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;ThirdClass&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherStuff&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;other_stuff&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The 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;CREATE TABLE first_class
(
  id serial NOT NULL,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt; integer,
  other_stuff character varying,
  CONSTRAINT first_class_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The fail test :&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;require_once &apos;class/FirstClass.php&apos;;
require_once &apos;class/SecondClass.php&apos;;
require_once &apos;class/ThirdClass.php&apos;;

$entities = $doctrineEntityManager-&amp;gt;getRepository(&apos;FirstClass&apos;)-&amp;gt;findAll();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Postgresql</environment>
            <key id="11531">DDC-649</key>
            <summary>SQL Error with single table inheritance and findAll method</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="needle">Paul Fariello</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Jun 2010 17:12:43 +0000</created>
                <updated>Sun, 4 Jul 2010 07:46:56 +0000</updated>
                    <resolved>Sun, 4 Jul 2010 07:46:56 +0000</resolved>
                            <version>2.0-BETA1</version>
                <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13382" author="needle" created="Sun, 20 Jun 2010 17:25:16 +0000"  >&lt;p&gt;The problem seems to come from Doctrine\ORM\Persisters\SingleTablePersister::_getSelectConditionSQL()&lt;/p&gt;</comment>
                    <comment id="13403" author="bmills" created="Tue, 22 Jun 2010 18:02:56 +0000"  >&lt;p&gt;I am also experiencing this exact issue. The value of the empty string in the &apos;IN&apos; clause would appear to be the &apos;discriminatorValue&apos; field on the instance of ClassMetadataInfo that gets passed into SingleTablePersister. For me, that value is null.&lt;/p&gt;

&lt;p&gt;As a side note, this came up when I was trying to switch all my entities from using Annotation to XML. When using Annotations, I do not experience the problem with this query, which leads me to believe the issues lies somewhere in the XML drivers.&lt;/p&gt;

&lt;p&gt;That&apos;s about as far as I&apos;ve gotten trying to debug it.&lt;/p&gt;</comment>
                    <comment id="13409" author="needle" created="Thu, 24 Jun 2010 17:12:05 +0000"  >&lt;p&gt;Why do not juste change the _getSelectConditionSQL() to the 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;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _getSelectConditionSQL(array $criteria, $assoc = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        $conditionSql = parent::_getSelectConditionSQL($criteria, $assoc);

        &lt;span class=&quot;code-comment&quot;&gt;// Append discriminator condition
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($conditionSql) $conditionSql .= &apos; AND &apos;;
        &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;_class-&amp;gt;discriminatorValue)) {
            $values = array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quote($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;discriminatorValue));
        }
        $discrValues = array_flip($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;discriminatorMap);
        foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;subClasses as $subclassName) {
            $values[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quote($discrValues[$subclassName]);
        }
        $conditionSql .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getSQLTableAlias($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;name) . &apos;.&apos;
                . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;discriminatorColumn[&apos;name&apos;]
                . &apos; IN (&apos; . implode(&apos;, &apos;, $values) . &apos;)&apos;;

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $conditionSql;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13468" author="beberlei" created="Wed, 30 Jun 2010 15:37:02 +0000"  >&lt;p&gt;There is a fundamental flaw in your logic i believe.&lt;/p&gt;

&lt;p&gt;The parent entity has to be part of the entity map, otherwise it cannot be used as a starting point for findAll() on the repository.&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;discriminator-map&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;FirstClass&quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;ThirdClass&quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;SecondClass&quot;&lt;/span&gt; /&amp;gt;
    &amp;lt;/discriminator-map&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13474" author="needle" created="Wed, 30 Jun 2010 18:38:26 +0000"  >&lt;p&gt;But what if the FirstClass is abstract ?&lt;br/&gt;
Then it can&apos;t be part of the entity map, isn&apos;t it ?&lt;/p&gt;

&lt;p&gt;However I should be able to select all its children classes. Anyway I think Doctrine should allow me to do it &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;</comment>
                    <comment id="13476" author="beberlei" created="Thu, 1 Jul 2010 01:35:05 +0000"  >&lt;p&gt;even if it is abstract it is part of the hierachy and can be selected in DQL, repository and find methods. Since you cannot instantiate&lt;br/&gt;
the abstract class in userland anyways there is never going to be a problem. It still has to be done.&lt;/p&gt;

&lt;p&gt;Maybe we should throw an exception in the mapping drivers if this is not done properly&lt;/p&gt;</comment>
                    <comment id="13477" author="needle" created="Thu, 1 Jul 2010 03:38:56 +0000"  >&lt;p&gt;Correct me if I&apos;m wrong, but if I do such a thing then i&apos;ll have a discriminator value wich will never be used.&lt;br/&gt;
It seems strange to me but as long as it works &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;Thank you for the explanation.&lt;/p&gt;</comment>
                    <comment id="13489" author="beberlei" created="Thu, 1 Jul 2010 18:40:12 +0000"  >&lt;p&gt;add it for now, you are right its never used. We will look into a change.&lt;/p&gt;</comment>
                    <comment id="13507" author="beberlei" created="Sun, 4 Jul 2010 07:46:56 +0000"  >&lt;p&gt;Fixed in master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-644] [ORACLE] setting query maxResults together with firstResult leads to an error</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-644</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m not very skilled in doctrine yet, but I found something that might be worth reporting. &lt;/p&gt;

&lt;p&gt;The code below produces &quot;Class does not exist&quot; error, which is quite misleading and just a side effect of a Notice that shows up in AbstractHydrator.php (lines 190 and 191).&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 = DBConnection::Common()-&amp;gt;createQueryBuilder()-&amp;gt;select(&apos;c&apos;)-&amp;gt;from(&apos;COMPANY&apos;, &apos;c&apos;)-&amp;gt;getQuery();
		$q-&amp;gt;setMaxResults(15);
		$q-&amp;gt;setFirstResult(1);
		var_dump($query-&amp;gt;getResult());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The query becomes:&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 b.* FROM (SELECT a.*, ROWNUM AS doctrine_rownum FROM (SELECT c0_.ID_COMPANY AS ID_COMPANY0, c0_.CONTACT AS CONTACT1, c0_.CONTRACT AS CONTRACT2, c0_.DESCRIPTION AS DESCRIPTION3, c0_.ID_DISPLAY_CASE AS ID_DISPLAY_CASE4, c0_.MAX_OPEN_WIN AS MAX_OPEN_WIN5, c0_.NAME AS NAME6, c0_.REFRESH_TIME AS REFRESH_TIME7, c0_.STATUS AS STATUS8, c0_.TABLESPACE AS TABLESPACE9 FROM COMPANY c0_) a ) b WHERE doctrine_rownum BETWEEN 2 AND 16
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem occurs when iterating over the list of internal column aliases (ID_COMPANY0,DESCRIPTION3,ID_DISPLAY_CASE4,MAX_OPEN_WIN5,NAME6,REFRESH_TIME7,STATUS8,TABLESPACE9 and&lt;br/&gt;
DOCTRINE_ROWNUM). The last one &quot;DOCTRINE_ROWNUM&quot; is missing in both $this-&amp;gt;_rsm-&amp;gt;metaMappings and $this-&amp;gt;_rsm-&amp;gt;columnOwnerMap and it&apos;s not a matter of case sensitivity, it&apos;s missing completely.&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;$cache[$key][&apos;dqlAlias&apos;] becomes NULL
$rowData[$dqlAlias][$cache[$key][&apos;fieldName&apos;]] = $value;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(line 203) creates a new key (named as empty string) in $rowData and things get screwed up since then in further iterations over $rowData array.&lt;/p&gt;

&lt;p&gt;Unfortunately I&apos;m not familiar with the internal code of doctrine at all, and it seems too complex for me to be able to provide a fix (except for an ugly hack).&lt;/p&gt;

&lt;p&gt;I&apos;ve attached the Exception trace (might help).&lt;/p&gt;

&lt;p&gt;BTW: Doctrine 2 is the cleanest piece of complex code I&apos;ve ever seen. You guys rock !!!&lt;/p&gt;</description>
                <environment>PHP 5.3.2</environment>
            <key id="11518">DDC-644</key>
            <summary>[ORACLE] setting query maxResults together with firstResult leads to an error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="cicovec">Martin Ivi&#269;i&#269;</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 17:42:06 +0000</created>
                <updated>Wed, 28 Jul 2010 15:53:00 +0000</updated>
                    <resolved>Wed, 28 Jul 2010 15:53:00 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13447" author="beberlei" created="Mon, 28 Jun 2010 17:13:14 +0000"  >&lt;p&gt;fixed formating&lt;/p&gt;</comment>
                    <comment id="13723" author="beberlei" created="Wed, 28 Jul 2010 15:53:00 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10669" name="ReflectionException.zip" size="23954" author="cicovec" created="Thu, 17 Jun 2010 17:42:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-636] Incorrect proxy name when using alias for entity namespace</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-636</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When I create an alias for entity namespace:&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;$config-&amp;gt;setEntityNamespaces(array(
	&apos;Entities&apos; =&amp;gt; &apos;A\B\Entities&apos;,
));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and then use it in association mapping:&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;/**
 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Entities:Foo\Bar&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $bar;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then the proxy for the target entity is not generated correctly. It generates proxy class name &quot;Entities:Foo\BarProxy&quot;, instead of &quot;ABEntitiesFooBarProxy&quot;. It obviously causes Parse error in PHP.&lt;/p&gt;</description>
                <environment>Linux Debian SID, PHP 5.3.2</environment>
            <key id="11485">DDC-636</key>
            <summary>Incorrect proxy name when using alias for entity namespace</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="majkl578">Michael Moravec</reporter>
                        <labels>
                    </labels>
                <created>Sun, 13 Jun 2010 10:17:50 +0000</created>
                <updated>Sun, 13 Jun 2010 10:33:55 +0000</updated>
                    <resolved>Sun, 13 Jun 2010 10:33:55 +0000</resolved>
                            <version>2.0-BETA1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13297" author="beberlei" created="Sun, 13 Jun 2010 10:33:44 +0000"  >&lt;p&gt;Aliases in targetEntity are not supported and can&apos;t be architecture-wise. Aliases only work in DQL Queries or for EntityManager::find() ::getRepository().&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-633] fetch=&quot;EAGER&quot; is not loading one to one associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-633</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;&amp;lt;?php
namespace vo;

/**
 * @Entity
 */

class Appointment {
	
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
	/**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Patient&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;appointment&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
	 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;patient_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;public&lt;/span&gt; $patient;
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When doing a findAll() on appointments, $patient is being created as a proxy even though fetch is EAGER.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11477">DDC-633</key>
            <summary>fetch=&quot;EAGER&quot; is not loading one to one associations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jun 2010 15:25:08 +0000</created>
                <updated>Tue, 28 Sep 2010 15:19:25 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 05:05:54 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13834" author="beberlei" created="Sun, 8 Aug 2010 05:05:54 +0000"  >&lt;p&gt;Fixed in master&lt;/p&gt;</comment>
                    <comment id="13976" author="majkl578" created="Tue, 17 Aug 2010 12:19:19 +0000"  >&lt;p&gt;What is an advantage of this solution (in master) if it is loaded in the same way as when fetched lazily? Maybe it&apos;d be better to use INNER JOIN instead, at least for OneToOne and save one or more (probably unnecessary) SQL queries?&lt;/p&gt;</comment>
                    <comment id="13978" author="beberlei" created="Tue, 17 Aug 2010 12:40:01 +0000"  >&lt;p&gt;There is none (yet), it may be a future enhancement, however we dont know this yet. fetch=EAGER is not so useful at the moment.&lt;/p&gt;</comment>
                    <comment id="13989" author="majkl578" created="Tue, 17 Aug 2010 18:08:24 +0000"  >&lt;p&gt;I think that fetch=EAGER should behave like this DQL:&lt;br/&gt;
SELECT a, b FROM foo a JOIN a.bar b&lt;br/&gt;
This query will use INNER JOIN to load &quot;a.bar&quot; association, but fetch=EAGER won&apos;t.&lt;/p&gt;

&lt;p&gt;Should I open a new issue for this?&lt;/p&gt;</comment>
                    <comment id="14483" author="edke" created="Tue, 28 Sep 2010 11:01:08 +0000"  >&lt;p&gt;fetch=EAGER still is not working as I think it should.&lt;/p&gt;

&lt;p&gt;class Project  {&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@id&lt;/li&gt;
	&lt;li&gt;@column(type=&quot;integer&quot;)&lt;/li&gt;
	&lt;li&gt;@generatedValue(strategy=&quot;SEQUENCE&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    private $id;&lt;br/&gt;
    /**&lt;/li&gt;
	&lt;li&gt;@manyToOne(targetEntity=&quot;Client&quot;, inversedBy=&quot;projects&quot;, fetch=&quot;EAGER&quot;)&lt;/li&gt;
	&lt;li&gt;@joinColumn(name=&quot;id_client&quot;, referencedColumnName=&quot;id&quot;,nullable=false, onDelete=&quot;cascade&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    private $client;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;but after &lt;/p&gt;

&lt;p&gt;$this-&amp;gt;getEntityManager()&lt;del&gt;&amp;gt;find(&apos;\Entities\Project&apos;, $this&lt;/del&gt;&amp;gt;project);&lt;/p&gt;

&lt;p&gt;2 doctrine queries are executed:&lt;/p&gt;

&lt;p&gt;SELECT t0.id AS id1, t0.name AS name2, t0.paths AS paths3, t0.modified AS modified4, t0.created AS&lt;br/&gt;
created5, t0.has_running_tasks AS has_running_tasks6, t0.tasksCount AS taskscount7, t0.productsCount&lt;br/&gt;
AS productscount8, t0.id_client AS id_client9 &lt;br/&gt;
FROM projects t0 &lt;br/&gt;
WHERE t0.id = ?&lt;/p&gt;

&lt;p&gt;SELECT t0.id AS id1, t0.name AS name2, t0.modified AS modified3, t0.created AS created4 &lt;br/&gt;
FROM clients t0 &lt;br/&gt;
WHERE t0.id = ?&lt;/p&gt;

&lt;p&gt;And it should be one query with inner join to clients.&lt;/p&gt;</comment>
                    <comment id="14484" author="beberlei" created="Tue, 28 Sep 2010 13:01:13 +0000"  >&lt;p&gt;Eager doesnt mean it does a Join, it only means the query is executed directly&lt;/p&gt;</comment>
                    <comment id="14485" author="edke" created="Tue, 28 Sep 2010 15:19:25 +0000"  >&lt;p&gt;I see. And how can be achieved that product and client will be queried at once, and not only when I request product-&amp;gt;getClient() ? &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-613] QueryBuilder doesn&apos;t permit any functions in select()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-613</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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;        $expr = $qb-&amp;gt;expr();
        $qb-&amp;gt;select($expr-&amp;gt;count(&apos;e.id&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;InvalidArgumentException: Expression of type &apos;Doctrine\ORM\Query\Expr\Func&apos; not allowed in this context.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11417">DDC-613</key>
            <summary>QueryBuilder doesn&apos;t permit any functions in select()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="hobodave">David Abdemoulaie</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 May 2010 21:34:50 +0000</created>
                <updated>Wed, 16 Jun 2010 11:55:54 +0000</updated>
                    <resolved>Wed, 16 Jun 2010 11:55:54 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2306] Lazy loading associated entity&apos;s property causes identity loss when another association is set to fetch=&quot;EAGER&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2306</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There appears to be a bug in UnitOfWork.php, introduced in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/afee16e56bae9bfe93c96ef1398f077e534962a0#L9R2473&quot; class=&quot;external-link&quot;&gt;Merge pull request #406 from Ocramius/DCOM-96&lt;/a&gt;. The relevant section is lines 2479-2495.&lt;/p&gt;

&lt;p&gt;In the attached test sandbox, there are 4 entities. &lt;/p&gt;

&lt;p&gt;User and Address have a many-many relationship via UserAddress &amp;#8211; this more or less duplicates what I have in my actual application. There is another entity that both User and Address refer to in a one-to-many relationship &amp;#8211; Zone. &lt;/p&gt;

&lt;p&gt;When the Zone relationship on User and Address is set to fetch=&quot;LAZY&quot;, the problem is absent. When the relationship is set to fetch=&quot;EAGER&quot;, the problem manifests as such:&lt;/p&gt;

&lt;p&gt;When I load a User via $em-&amp;gt;find(), and then access properties on a related Address, the identity of the Address is lost. The same is true going in the other direction. I var_dump the Address before accessing its street property, and it shows up properly as an uninitialized proxy with just the id set. After I access the street property of the Address, var_dump shows the proxy is loaded and initialized, with all properties set &lt;em&gt;except&lt;/em&gt; the identity, which is now null.&lt;/p&gt;

&lt;p&gt;I stepped through the code using XDebug, and found that the referenced lines in UnitOfWork.php are setting the created Address entity&apos;s properties incorrectly, removing the identity from the generated entity. It seems to have something to do with the _hints parameter. &lt;/p&gt;

&lt;p&gt;I&apos;m not sure what the fix is, because I am not familiar enough with this part of the code and what it is intended to do. I assume that this is not intended behavior.&lt;/p&gt;

&lt;p&gt;I&apos;ve included my test case sandbox, which references ../../../../autoload.php to load Doctrine. This was tested against doctrine2/master as of today.&lt;/p&gt;</description>
                <environment>PHP 5.4 - IIS 7.0</environment>
            <key id="14506">DDC-2306</key>
            <summary>Lazy loading associated entity&apos;s property causes identity loss when another association is set to fetch=&quot;EAGER&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="wschalle">William Schaller</reporter>
                        <labels>
                        <label>orm</label>
                        <label>proxy</label>
                        <label>unitofwork</label>
                    </labels>
                <created>Wed, 20 Feb 2013 05:40:54 +0000</created>
                <updated>Tue, 26 Feb 2013 08:27:25 +0000</updated>
                    <resolved>Tue, 26 Feb 2013 08:27:25 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.4</fixVersion>
                                <component>ORM</component>
                        <due>Fri, 22 Feb 2013 00:00:00 +0000</due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19573" author="ocramius" created="Thu, 21 Feb 2013 01:29:19 +0000"  >&lt;p&gt;I&apos;ve created a branch with a fix at &lt;a href=&quot;https://github.com/Ocramius/doctrine2/compare/hotfix;DDC-2306&quot; class=&quot;external-link&quot;&gt;https://github.com/Ocramius/doctrine2/compare/hotfix;DDC-2306&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically, what was happening here is a really nasty one: &lt;/p&gt;

&lt;p&gt;The UnitOfWork did consider the `Zone` entity as if it was a `User` entity (not comparing classnames, basically). Since the identifier was also the same in this case, the two entities were compared as if the newly loaded `Zone` had to replace the existing `User` proxy.&lt;/p&gt;

&lt;p&gt;Thus, the proxy was marked as un-managed and trashed (and so the identifier was also nulled).&lt;/p&gt;

&lt;p&gt;Please pull the branch and give it a try. I&apos;ll re-read it tomorrow and then open a PR.&lt;/p&gt;</comment>
                    <comment id="19574" author="wschalle" created="Thu, 21 Feb 2013 04:10:27 +0000"  >&lt;p&gt;This fixes the problem for the test case and for my app. Excellent speedy fix, thanks &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="19575" author="beberlei" created="Thu, 21 Feb 2013 08:36:52 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-585&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/585&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/585&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19685" author="beberlei" created="Tue, 26 Feb 2013 05:55:52 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-585&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/585&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/585&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11379" name="sandbox-uow-issue.zip" size="11305" author="wschalle" created="Wed, 20 Feb 2013 05:40:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2230] Changes from DDC-1690 trigger a bug in entity merging</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2230</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Following the changes for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1690&quot; title=&quot;Notify policy listeners are not attached to entities with Notify policy&quot;&gt;&lt;del&gt;DDC-1690&lt;/del&gt;&lt;/a&gt;, I encountered a serious bug in how EntityManager::merge(...) functions for entities that use NOTIFY change tracking. It&apos;s related to interaction between lazy loading and calls to addPropertyChangedListener().&lt;/p&gt;

&lt;p&gt;Scenario:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;EntityA has a One-To-One, lazy-load association to EntityB&lt;/li&gt;
	&lt;li&gt;EntityB implements NotifyPropertyChanged and uses change tracking policy &quot;NOTIFY&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Steps to reproduce:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;$instanceA = $em-&amp;gt;find(&apos;EntityA&apos;, $id)&lt;/li&gt;
	&lt;li&gt;$em-&amp;gt;clear()&lt;/li&gt;
	&lt;li&gt;$instanceA = $em-&amp;gt;merge($instanceA)&lt;/li&gt;
	&lt;li&gt;$instanceA-&amp;gt;getB() will return a proxy for B that is marked as initialized by contains no data&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Workaround: Mark EntityB::addPropertyChangedListener(...) as &apos;final&apos;, so it doesn&apos;t get proxied and lazy loading is not triggered.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14368">DDC-2230</key>
            <summary>Changes from DDC-1690 trigger a bug in entity merging</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="pschwisow">Patrick Schwisow</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jan 2013 21:52:10 +0000</created>
                <updated>Tue, 26 Feb 2013 08:28:01 +0000</updated>
                    <resolved>Tue, 26 Feb 2013 08:28:01 +0000</resolved>
                            <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="19268" author="pschwisow" created="Wed, 9 Jan 2013 22:58:52 +0000"  >&lt;p&gt;Also, the returned proxy from $instanceA-&amp;gt;getB() is in the entityStates array but not in the identity map&lt;/p&gt;</comment>
                    <comment id="19368" author="ocramius" created="Wed, 23 Jan 2013 21:16:08 +0000"  >&lt;p&gt;Looks like this one is related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1734&quot; title=&quot;Uninitialized proxies cannot be serialized properly&quot;&gt;&lt;del&gt;DDC-1734&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19674" author="ocramius" created="Sat, 23 Feb 2013 00:47:51 +0000"  >&lt;p&gt;I implemented a fix at &lt;a href=&quot;https://github.com/Ocramius/doctrine2/compare/hotfix;DDC-2230&quot; class=&quot;external-link&quot;&gt;https://github.com/Ocramius/doctrine2/compare/hotfix;DDC-2230&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Please let me know if that branch works for you: I will open a PR tomorrow.&lt;/p&gt;</comment>
                    <comment id="19678" author="beberlei" created="Sat, 23 Feb 2013 18:35:11 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-589&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/589&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/589&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19687" author="beberlei" created="Tue, 26 Feb 2013 05:59:08 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-589&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/589&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/589&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1007] Add ability to filter a association</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1007</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Note: I used critical priority for this issue because this is one of the most criticised things about Doctrine 2 worldwide.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;The worst thing about Doctrine 2 is, that you can do almost nothing through methods like Category::getArticles();.&lt;br/&gt;
For example, you have the Category and want to output all the articles. Fine, nothing easier:&lt;/p&gt;

&lt;p&gt;foreach ($category-&amp;gt;getArticles() as $article) {&lt;br/&gt;
	echo $article-&amp;gt;name;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;OK. And now I need only &quot;visible&quot; articles (others are hidden for now). And here it is. You need DQL even for this easy task. Without DQL you can&apos;t do nothing, but using DQL (or QueryBuilder) everywhere is very very bad. Simply there is no way to write method like getVisibleArticles(). (Except selecting all and using some filter, but that&apos;s nonsense.)&lt;/p&gt;

&lt;p&gt;The solution would be some kind of smart collections (but i don&apos;t mind if you come up with something different):&lt;/p&gt;

&lt;p&gt;public function getArticles($visibility = 0, $limit = NULL) {&lt;br/&gt;
	return $this-&amp;gt;articles-&amp;gt;filter(&apos;visibility&apos;, $visibility)-&amp;gt;limit($limit);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Of course when you need any AND, OR, XOR, IN, LIKE and so DQL is needed. This should be for some simple things only.&lt;/p&gt;</description>
                <environment>any</environment>
            <key id="12337">DDC-1007</key>
            <summary>Add ability to filter a association</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="enumag">J&#225;chym Tou&#353;ek</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Jan 2011 05:13:44 +0000</created>
                <updated>Fri, 1 Mar 2013 10:02:06 +0000</updated>
                    <resolved>Mon, 31 Jan 2011 05:40:43 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="15198" author="beberlei" created="Mon, 31 Jan 2011 05:39:29 +0000"  >&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;Note: I used critical priority &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; issue because &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; is one of the most criticised things about Doctrine 2 worldwide. &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;By which standard are you making this assumption?&lt;/p&gt;</comment>
                    <comment id="15212" author="enumag" created="Wed, 2 Feb 2011 17:22:11 +0000"  >&lt;p&gt;Just some examples:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/limitations-and-known-issues.html#restricing-associations&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/limitations-and-known-issues.html#restricing-associations&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/d013705a109d7e44&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/d013705a109d7e44&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/4214286/doctrine-2-association&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/4214286/doctrine-2-association&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You need to use DQL even for the most easiest tasks. There is no way to implement methods like &quot;getVisibleArticles&quot;, everything must be done through repositories and DQL. Therefor the associations are almost useless as they are now.&lt;/p&gt;

&lt;p&gt;There is almost always need for some filter and this logic should be in entities themselves. I mean I of course can make new repository class for every entity, but then why are we using ORM which makes every task even more difficult then it is without the ORM?&lt;/p&gt;

&lt;p&gt;I&apos;ve been looking for some way to manually modify the SQL query used to load the collection, but found none.&lt;/p&gt;

&lt;p&gt;//EDIT:&lt;br/&gt;
This is also related. There would be no need for such crutches if this issue is solved.&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/blog/doctrine2-large-collections&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/blog/doctrine2-large-collections&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15223" author="mjh_ca" created="Thu, 3 Feb 2011 17:43:39 +0000"  >&lt;p&gt;No need for this.  This is exactly what custom repositories are for.  &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#custom-repositories&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#custom-repositories&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you don&apos;t like writing raw DQL, use the QueryBuilder class instead to build up your query.&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
class ArticleRepository extends EntityRepository
{
    public function getVisibleArticles()
    {
        // use Query or QueryBuilder object to build up your query here and return the results.
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15225" author="beberlei" created="Fri, 4 Feb 2011 03:26:40 +0000"  >&lt;p&gt;I do think its very necessary to have this, but we are still evaluating how this can be done generically.&lt;/p&gt;</comment>
                    <comment id="15586" author="parljohn" created="Sun, 27 Mar 2011 03:23:02 +0000"  >&lt;p&gt;I tend to agree.  I have just spent an unfortunate amount of time trying to figure out how to filter an association without loading the whole thing.  I figured i could easily use a custom repository and was headed down that path until it dawned on me that I&apos;m breaking the whole point of doctrine to use an Entity Manager inside of an existing entity... which is the only way I can call a custom repository from inside of an entity.  In order to keep my code clean I need a way to get an association and filter it without loading the whole thing.  Tell me how else I would do that without breaking clean coding rules?  Even if you could just use custom Collection loaders from a custom repository that would be great but it doesn&apos;t appear that when you load a collection you&apos;re not even calling a Repository to do it, if you were, I would have found a way to override that function and add some filtering devices to it.  This seems to make complete sense to me?  What am I missing here about Jachyms request?&lt;/p&gt;</comment>
                    <comment id="15587" author="beberlei" created="Sun, 27 Mar 2011 03:36:28 +0000"  >&lt;p&gt;There is currently no way to &quot;just override&quot; some function, as I said its really complicated to implement and we are evaluating the best way to do it. If you want to filter associations use DQL for now.&lt;/p&gt;</comment>
                    <comment id="15588" author="parljohn" created="Sun, 27 Mar 2011 03:42:10 +0000"  >&lt;p&gt;Awesome, thanks for the quick response.  Just leaves me with 2 questions then that would help me a ton:&lt;br/&gt;
1. How does DQL filter the association now as it is and why couldn&apos;t that be overriden in the hydration process of an association?&lt;br/&gt;
2. Knowing the answer to 1 is difficult for now and that I should just use DQL, how do you suggest I do that?  I have an entity that cannot have its association pre-populated by a DQL, should I just get an EM from inside the entity and go from there?  Just wondering what the optimal way to this is?&lt;/p&gt;

&lt;p&gt;To clarify, I have an entity with an association that is NULL for a specific filter and I need it to stay null, but I can&apos;t because it autoloads all the other records that don&apos;t match that filter when I ask for it.  I have no way to &quot;redo&quot; the filter I originally used in the DQL.&lt;/p&gt;

&lt;p&gt;Thanks again for the quick response.&lt;/p&gt;</comment>
                    <comment id="15589" author="beberlei" created="Sun, 27 Mar 2011 03:45:18 +0000"  >&lt;p&gt;1. Assocations are not loaded through DQL but through the Persisters.&lt;br/&gt;
2. In DQL you can do SELECT a FROM Article a JOIN a.comments c WITH c.status = &apos;active&apos; ...&lt;br/&gt;
3 . With Doctrine 2.1-DEV you can mark an association as EXTRA_LAZY and use Article::$comments-&amp;gt;slice($count, $offset) to fetch only parts of the association.&lt;/p&gt;</comment>
                    <comment id="15590" author="parljohn" created="Sun, 27 Mar 2011 03:49:11 +0000"  >&lt;p&gt;So based on my clarification above, how do you suggest I call a DQL from inside of an entity?  Call it inline in one my methods through an entity manager? or through an entity manager to a custom repository? I don&apos;t see any other ways, am I missing anything?  My problem is the reverse of what you are solving with Extra Lazy Loading, I need a collection to stay empty based on a my DQL, but it won&apos;t!  It keeps calling all associations.&lt;/p&gt;</comment>
                    <comment id="17067" author="enumag" created="Tue, 20 Dec 2011 19:38:48 +0000"  >&lt;p&gt;Hi, is there a way to implement this in current Doctrine? I&apos;m talking about this method (it should be a method of CategoryEntity):&lt;/p&gt;

&lt;p&gt;public function getArticles($visibility = 0, $limit = NULL) &lt;/p&gt;
{ return /* what should be here? */ }</comment>
                    <comment id="18737" author="iamkoby" created="Thu, 27 Sep 2012 15:18:23 +0000"  >&lt;p&gt;A year later this is still highly required feature.&lt;/p&gt;</comment>
                    <comment id="19787" author="alexandresalome" created="Fri, 1 Mar 2013 10:02:06 +0000"  >&lt;p&gt;Found this in documentation, related to this ticket:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/en/latest/reference/working-with-associations.html#filtering-collections&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/latest/reference/working-with-associations.html#filtering-collections&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11283">DDC-551</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10924" name="example_entities.php" size="620" author="enumag" created="Mon, 31 Jan 2011 05:13:44 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2224] convertToDatabaseValueSQL() is not honored for DQL query parameters</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2224</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Following