<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 17:37:47 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+fixVersion+%3D+%222.0-RC1%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC&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+fixVersion+%3D+%222.0-RC1%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="72" total="72"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-727] Proxy instances should be able to get their correspondent ClassMetadata</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-727</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This should be possible:&lt;/p&gt;

&lt;div class=&quot;code panel&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 = $em-&amp;gt;getReference(&apos;Foo&apos; , 1); 
$class = $em-&amp;gt;getClassMetadata(get_class($entity)); &lt;span class=&quot;code-comment&quot;&gt;// ClassMetadata &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; Foo entity&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Currently it seems to throw an Exception.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11697">DDC-727</key>
            <summary>Proxy instances should be able to get their correspondent ClassMetadata</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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>Fri, 30 Jul 2010 14:23:31 +0000</created>
                <updated>Sat, 7 Apr 2012 07:21:03 +0000</updated>
                    <resolved>Wed, 15 Sep 2010 16:24:37 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14391" author="beberlei" created="Wed, 15 Sep 2010 16:24:37 +0000"  >&lt;p&gt;I added a testcase for this, it works.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/d3419780f9daa3eaf0400c2b6fcee0234240b1de&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/d3419780f9daa3eaf0400c2b6fcee0234240b1de&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17704" author="beberlei" created="Sat, 31 Mar 2012 21:26:59 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-315&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/315&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/315&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17711" author="beberlei" created="Sun, 1 Apr 2012 09:02:15 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-315&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/315&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/315&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17718" author="beberlei" created="Sun, 1 Apr 2012 14:27:52 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-315&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/315&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/315&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17755" author="beberlei" created="Wed, 4 Apr 2012 19:59:04 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-315&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/315&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/315&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17795" author="beberlei" created="Fri, 6 Apr 2012 13:50:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-315&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/315&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/315&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17814" author="beberlei" created="Sat, 7 Apr 2012 07:21:03 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-315&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/315&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/315&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-841] Generated SQL contains non-existen alias</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-841</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;PDOException: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1 no such column: e2_.owner_id&lt;/p&gt;

&lt;p&gt;Generated SQL:&lt;/p&gt;

&lt;p&gt;SELECT c0_.id AS id0, c0_.createdAt AS createdAt1, c0_.updatedAt AS updatedAt2, c0_.title AS title3, c0_.color AS color4, c0_.owner_id AS owner_id5 FROM calendar c0_ INNER JOIN user u1_ ON e2_.owner_id = u1_.id WHERE u1_.username = &apos;bot&apos;&lt;/p&gt;

&lt;p&gt;Notice how the table alias &quot;e2&quot; does not existm yet is used in the join clause.&lt;/p&gt;

&lt;p&gt;Meta:&lt;/p&gt;

&lt;p&gt;	/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ManyToOne(targetEntity=&quot;User&quot;)&lt;/li&gt;
	&lt;li&gt;@JoinColumn(name=&quot;owner_id&quot;, referencedColumnName=&quot;id&quot;)&lt;br/&gt;
	 *&lt;/li&gt;
	&lt;li&gt;@var User&lt;br/&gt;
	 */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;DQL:&lt;/p&gt;

&lt;p&gt;SELECT c FROM Calendar c JOIN c.owner u WHERE u.username = &apos;bot&apos;&lt;/p&gt;

&lt;p&gt;A workaround would be appreciated.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment></environment>
            <key id="12011">DDC-841</key>
            <summary>Generated SQL contains non-existen alias</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jkleijn">John Kleijn</reporter>
                        <labels>
                    </labels>
                <created>Sat, 16 Oct 2010 08:22:49 +0000</created>
                <updated>Wed, 2 Feb 2011 13:31:44 +0000</updated>
                    <resolved>Sun, 31 Oct 2010 04:36:48 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14572" author="jkleijn" created="Sun, 17 Oct 2010 14:53:33 +0000"  >&lt;p&gt;This also happened with BETA1 and also in other scenarios, e.g.&lt;/p&gt;

&lt;p&gt;SELECT w0_.id AS id0, w0_.createdAt AS createdAt1, w0_.updatedAt AS updatedAt2, w0_.start AS start3, w0_.end AS end4, w0_.owner_id AS owner_id5 FROM worklog w0_ INNER JOIN user u1_ ON e2_.owner_id = u1_.id WHERE u1_.id = ? AND w0_.start IS NULL&lt;/p&gt;


&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1 no such column: e2_.owner_id&lt;/p&gt;

&lt;p&gt;This may have to do with the &quot;owner&quot; field being defined in a mapped superclass.&lt;/p&gt;</comment>
                    <comment id="14573" author="jkleijn" created="Sun, 17 Oct 2010 14:58:05 +0000"  >&lt;p&gt;Confirmed, when I move the declaration down to the implementation class the exception goes away.&lt;/p&gt;

&lt;p&gt;When I add it rather then moving it, I get an exception saying the field was already added, so the declaration in the supertype is not simply omitted (not that that would explain the invalid SQL).&lt;/p&gt;
</comment>
                    <comment id="14574" author="romanb" created="Sun, 17 Oct 2010 15:07:19 +0000"  >&lt;p&gt;Generall,y mapped superclasses may only define unidirectional associations, because an association can not point back to a mapped superclass (a mapped superclass is not a persistent class). The relevant doc section is here:  &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/inheritance-mapping/en#mapped-superclasses&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/inheritance-mapping/en#mapped-superclasses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Though, in your example the association actually points back to an entity, not the mapped superclass, so this may be a case that can be addressed properly, so we need to investigate this further.&lt;/p&gt;

&lt;p&gt;ps: It is not entirely clear from the information you provided, but I assume there is no class that has targetEntity=&quot;NameOfMappedSuperclass&quot; ? Because that will by definition never work.&lt;/p&gt;</comment>
                    <comment id="14575" author="jkleijn" created="Sun, 17 Oct 2010 17:22:25 +0000"  >&lt;p&gt;No, there are no associations to the mapped superclass.&lt;/p&gt;

&lt;p&gt;It is purely for defining common meta data and properties for a certain type, exactly what one would use a mapped superclass for.&lt;/p&gt;

&lt;p&gt;It&apos;s worth noting that while this is a birectional association between the two types when viewed statically, we&apos;re not talking about a single, bidirectional relation:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Calendar has an owner, which is a User. This is the user that created the object, a mechanism applicable to most entities in the system, hence the mapped superclass.&lt;/li&gt;
	&lt;li&gt;A User has a Calendar, but he may or may not be the &quot;owner&quot; of that Calendar.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So User has this specified:&lt;/p&gt;

&lt;p&gt;	/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ManyToOne(targetEntity=Calendar&quot;, fetch=&quot;EAGER&quot;, cascade=
{&quot;persist&quot;, &quot;remove&quot;}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;@JoinColumn(name=&quot;calendar_id&quot;, referencedColumnName=&quot;id&quot;)&lt;br/&gt;
	 *&lt;/li&gt;
	&lt;li&gt;@var Calendar&lt;br/&gt;
	 */&lt;br/&gt;
	private $calendar;&lt;/li&gt;
&lt;/ul&gt;

</comment>
                    <comment id="14577" author="jkleijn" created="Sun, 17 Oct 2010 17:26:33 +0000"  >&lt;p&gt;Obviously this means that a User also has an &quot;owner&quot;, which may or may not be the object itself.&lt;/p&gt;</comment>
                    <comment id="14607" author="beberlei" created="Fri, 29 Oct 2010 07:46:44 +0000"  >&lt;p&gt;I think this might be fixed with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-671&quot; title=&quot;Table aliases wrongly computed with YAML + mappedsuperclasses and joins&quot;&gt;&lt;del&gt;DDC-671&lt;/del&gt;&lt;/a&gt; already.&lt;/p&gt;</comment>
                    <comment id="14630" author="beberlei" created="Sun, 31 Oct 2010 02:39:18 +0000"  >&lt;p&gt;relating&lt;/p&gt;</comment>
                    <comment id="14632" author="beberlei" created="Sun, 31 Oct 2010 02:50:02 +0000"  >&lt;p&gt;I need the whole entitiy definitions of Calender and User. Can you please paste them to somewhere?&lt;/p&gt;</comment>
                    <comment id="14635" author="beberlei" created="Sun, 31 Oct 2010 03:12:09 +0000"  >&lt;p&gt;I cannot reproduce it, i am pretty sure its a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-671&quot; title=&quot;Table aliases wrongly computed with YAML + mappedsuperclasses and joins&quot;&gt;&lt;del&gt;DDC-671&lt;/del&gt;&lt;/a&gt; and should therefore be fixed already in trunk.&lt;/p&gt;</comment>
                    <comment id="14636" author="jkleijn" created="Sun, 31 Oct 2010 03:47:47 +0000"  >&lt;p&gt;&amp;gt; I need the whole entitiy definitions of Calender and User. Can you please paste them to somewhere?&lt;/p&gt;

&lt;p&gt;I have since chaned it, but I emailed you what I think are the relevant revisions of the classes.&lt;/p&gt;</comment>
                    <comment id="15203" author="jkleijn" created="Wed, 2 Feb 2011 04:03:19 +0000"  >&lt;p&gt;I&apos;ve had a similar issue with multiple levels of MappedSuperclasses. It works in RC1, fails in 2.0 stable on non-existent table aliases. Don&apos;t have time to do a full bug report right now.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11591">DDC-671</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="11978">DDC-826</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12348">DDC-1013</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-899] Add an unobtrusive way to determine if entity manager is closed</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-899</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There is no way to unobtrusively determine if an entity manager instance has been closed (due to exceptions/errors during a transaction).&lt;/p&gt;

&lt;p&gt;Something like the following would come in handy:&lt;/p&gt;

&lt;p&gt;class EntityManager {&lt;br/&gt;
    public function isOpen()&lt;/p&gt;
    {
        return $this-&amp;gt;closed === false;
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;To determine if the instance is closed or not, this way one could instantiate a new entity manager instance with the same connection and configuration.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12173">DDC-899</key>
            <summary>Add an unobtrusive way to determine if entity manager is closed</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="alex">Alexander Brouwer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Nov 2010 04:32:25 +0000</created>
                <updated>Fri, 3 Dec 2010 11:44:34 +0000</updated>
                    <resolved>Fri, 3 Dec 2010 11:44:34 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14899" author="beberlei" created="Fri, 3 Dec 2010 11:44:34 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-909] Doctrine 2 AbstractQuery:: _getResultCacheId() fails when an Entity instance is used as a param (recursive references and var_export don&apos;t mix)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-909</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the AbstractQuery::_getResultCacheId() function the following line generates the MD5 hash key:&lt;/p&gt;

&lt;div class=&quot;code panel&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;return&lt;/span&gt; md5(implode(&lt;span class=&quot;code-quote&quot;&gt;&quot;;&quot;&lt;/span&gt;, (array)$sql) . var_export($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_params, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;) .
                var_export($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_hints, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;).&lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;amp;hydrationMode=&quot;&lt;/span&gt;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_hydrationMode);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The issue is the use of &lt;tt&gt;var_export($this-&amp;gt;_params, true);&lt;/tt&gt; fails when one of the params is an instance of an Entity (which usually have recursive references).&lt;/p&gt;

&lt;p&gt;To be honest I really don&apos;t know what solution there would be internally, if doctrine were to extend the proxy class to provide a &quot;getIdentifier&quot; or if the _getResultCacheId() could grab the identification of the Entity we could avoid this.&lt;/p&gt;

&lt;p&gt;However beyond that potential idea really probably the best thing is to throw a giant warning text in the manual saying &quot;if your&apos;e using entities as parameters manually set your cache ids&quot;.&lt;/p&gt;</description>
                <environment>Debian, PHP 5.3, Doctrine 2.0-BETA4</environment>
            <key id="12184">DDC-909</key>
            <summary>Doctrine 2 AbstractQuery:: _getResultCacheId() fails when an Entity instance is used as a param (recursive references and var_export don&apos;t mix)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dcousineau">Daniel Cousineau</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Dec 2010 16:26:49 +0000</created>
                <updated>Fri, 3 Dec 2010 11:37:19 +0000</updated>
                    <resolved>Fri, 3 Dec 2010 11:35:13 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14890" author="dcousineau" created="Thu, 2 Dec 2010 16:47:30 +0000"  >&lt;p&gt;Maybe serializing instead of running a var_export?&lt;/p&gt;</comment>
                    <comment id="14891" author="dcousineau" created="Thu, 2 Dec 2010 16:56:50 +0000"  >&lt;p&gt;Yeah, changing the &lt;tt&gt;var_export($this-&amp;gt;_params, true)&lt;/tt&gt; to &lt;tt&gt;serialize($this-&amp;gt;_params)&lt;/tt&gt; has yet to result in the same recursion error.&lt;/p&gt;</comment>
                    <comment id="14894" author="beberlei" created="Fri, 3 Dec 2010 02:56:38 +0000"  >&lt;p&gt;Its unbelievable slow though. I have to change this to retrieve the entity-identifer + name from the UoW&lt;/p&gt;</comment>
                    <comment id="14897" author="beberlei" created="Fri, 3 Dec 2010 11:35:13 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="14898" author="dcousineau" created="Fri, 3 Dec 2010 11:37:19 +0000"  >&lt;p&gt;You get a high five, Benjamin!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-897] Make ClassMetadataFactory configurable</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-897</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It was requested lots of times: ClassMetadataFactory has to be overrideable for some frameworks to operate!&lt;/p&gt;</description>
                <environment></environment>
            <key id="12170">DDC-897</key>
            <summary>Make ClassMetadataFactory configurable</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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>Sat, 27 Nov 2010 14:52:54 +0000</created>
                <updated>Mon, 29 Nov 2010 05:58:12 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 16:18:38 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14860" author="beberlei" created="Sat, 27 Nov 2010 16:18:38 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                    <comment id="14866" author="ayhan" created="Mon, 29 Nov 2010 04:41:43 +0000"  >&lt;p&gt;that&apos;s really great news. &lt;/p&gt;

&lt;p&gt;but i think, the access levels of its class properties and methods should be changed from private to protected or is there are reason for not doing that?&lt;br/&gt;
It would make it easier to subclass it, if you p.e. only want to override one method.&lt;/p&gt;</comment>
                    <comment id="14867" author="beberlei" created="Mon, 29 Nov 2010 05:11:27 +0000"  >&lt;p&gt;No, the only methods that should be overwritten are already protected or public.&lt;/p&gt;</comment>
                    <comment id="14868" author="ayhan" created="Mon, 29 Nov 2010 05:41:11 +0000"  >&lt;p&gt;thanks for the quick answer.&lt;/p&gt;

&lt;p&gt;examples:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;method getMetadataFor is public and probably candidate #1 to get overwritten... but that&apos;s only possible to a certain degree as the subclass cannot access the EntityManager.&lt;/li&gt;
	&lt;li&gt;method getAllMetadata is public, but as the subclass cannot access the initialized property, not really overwrittable.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;i might have overlooked something, as i just grabbed the updated version.&lt;/p&gt;</comment>
                    <comment id="14869" author="beberlei" created="Mon, 29 Nov 2010 05:48:15 +0000"  >&lt;p&gt;no, the primary method to be overwritten are:&lt;/p&gt;

&lt;div class=&quot;code panel&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 newClassMetadataInstance($className)
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function getParentClasses($name)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All the other code should not be touched as it handles the caching loading and such.&lt;/p&gt;</comment>
                    <comment id="14870" author="ayhan" created="Mon, 29 Nov 2010 05:56:01 +0000"  >&lt;p&gt;for me it&apos;s getMetadataFor :-D as i need another alias mechanism.&lt;/p&gt;

&lt;p&gt;but don&apos;t get me wrong, i think the changes you already made are sufficent for my case... but it&apos;s confusing, therefore the comment.&lt;/p&gt;

&lt;p&gt;for the method getParentClasses that you mentioned:&lt;/p&gt;

&lt;p&gt;how would you access the driver property in the subclass?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-818] MSSQL Locking not working in all places</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-818</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;MSSQL locking requires the table name to be hinted with additional information. However in many places there are only ways to append the lock hints to the whole Query.&lt;/p&gt;

&lt;p&gt;We have to lock over the code and delegate table name generation to $platform-&amp;gt;appendLockHint($tableName) to get this fixed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11955">DDC-818</key>
            <summary>MSSQL Locking not working in all places</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Sep 2010 03:49:00 +0000</created>
                <updated>Sat, 27 Nov 2010 16:41:51 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 16:41:51 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14862" author="beberlei" created="Sat, 27 Nov 2010 16:41:51 +0000"  >&lt;p&gt;This was fixed by juokaz&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-880] Metadata XSD is out of sync</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-880</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The XSD file at &lt;a href=&quot;http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd&lt;/a&gt; is out of sync with the git repository.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12113">DDC-880</key>
            <summary>Metadata XSD is out of sync</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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>Tue, 16 Nov 2010 16:36:11 +0000</created>
                <updated>Sat, 27 Nov 2010 16:35:55 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 16:35:55 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14861" author="beberlei" created="Sat, 27 Nov 2010 16:35:55 +0000"  >&lt;p&gt;Fixed, however not in the deployment task (yet).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-876] CLI Global namespace forced on all Entity generated TypeHinting</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-876</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using the CLI tool to generate your entities Doctrine forces a global namespace on all TypeHints in functions. For example I used the sandbox&lt;/p&gt;

&lt;p&gt;See file User.php with function setAddress:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;public function setAddress(Address $address)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Remove this function entirely, so that it can be generated. Then run,&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;./doctrine orm:generate-entities .&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Open file User.php and now the function has become:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;public function setAddress(\Address $address)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;note the prepended \ for global namespace&lt;/p&gt;

&lt;p&gt;This behaviour would be fine if all types would be in the global scope, but they&apos;re not. If you use another entity such as Address in the same namespace it should just generate the proper &lt;br/&gt;
public function setAddress(Address $address)&lt;/p&gt;

&lt;p&gt;Or better yet, generate the Fully Qualified Namespace&lt;/p&gt;

&lt;p&gt;Code responsible for this:&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/browser/trunk/lib/Doctrine/ORM/Tools/EntityGenerator.php#L609&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/trunk/lib/Doctrine/ORM/Tools/EntityGenerator.php#L609&lt;/a&gt;&lt;/p&gt;</description>
                <environment>All, but testcase on Debian Lenny (x64/32bit) with Squeeze php packages</environment>
            <key id="12098">DDC-876</key>
            <summary>CLI Global namespace forced on all Entity generated TypeHinting</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="santananl">Dirk Teurlings</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Nov 2010 15:43:55 +0000</created>
                <updated>Sat, 27 Nov 2010 16:18:19 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 16:18:19 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14727" author="beberlei" created="Sat, 13 Nov 2010 04:04:48 +0000"  >&lt;p&gt;sorry but the code you highlight here on trac is 7 months old, the current code is on Git: www.github.com/doctrine/doctrine2&lt;/p&gt;

&lt;p&gt;Are you really using Beta 4?&lt;/p&gt;</comment>
                    <comment id="14729" author="santananl" created="Sat, 13 Nov 2010 04:25:34 +0000"  >&lt;p&gt;yes I&apos;m using beta 4 It&apos;s a PEAR install.&lt;/p&gt;

&lt;p&gt;Sorry for the outdated URL, here&apos;s the proper one.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/EntityGenerator.php#L591&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/EntityGenerator.php#L591&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14855" author="beberlei" created="Sat, 27 Nov 2010 14:03:43 +0000"  >&lt;p&gt;Ah i know what is causing this issue.&lt;/p&gt;

&lt;p&gt;The Disconnected Metadata factory cannot know which namespace the class is in. Are you generating the code from XML or YAML?&lt;/p&gt;</comment>
                    <comment id="14857" author="santananl" created="Sat, 27 Nov 2010 14:26:34 +0000"  >&lt;p&gt;No XML or YAML in this setup, just class files and an SQL based backend&lt;/p&gt;</comment>
                    <comment id="14859" author="beberlei" created="Sat, 27 Nov 2010 16:18:19 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-895] Generated XML is not valid (because of order)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-895</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The generated XML using the Tool Chain is not valid (because of order of generated elements).&lt;/p&gt;</description>
                <environment></environment>
            <key id="12167">DDC-895</key>
            <summary>Generated XML is not valid (because of order)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 27 Nov 2010 03:45:15 +0000</created>
                <updated>Sat, 27 Nov 2010 14:37:16 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 14:37:16 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14858" author="beberlei" created="Sat, 27 Nov 2010 14:32:25 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-888] PHP stars to complain if no joinColumns/inverseJoinColumns provided for JoinTable annotation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-888</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The problem is rather trivial - if no joinColumns or inverseJoinColumns provided for the JoinTable annotation declaration, then PHP will complain on lines 215/225 of Doctrine\ORM\Mapping\Driver\AnnotationDriver. The easiest way to eliminate this problem is to simply initialize these fields in the annotation-class:&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;DoctrineAnnotations.php&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-keyword&quot;&gt;final&lt;/span&gt; class JoinTable &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Annotation {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $schema;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $joinColumns = array();
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $inverseJoinColumns = array();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12142">DDC-888</key>
            <summary>PHP stars to complain if no joinColumns/inverseJoinColumns provided for JoinTable annotation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="sergei.lissovski">Sergei Lissovski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Nov 2010 07:33:52 +0000</created>
                <updated>Sat, 27 Nov 2010 14:05:44 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 14:05:44 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14856" author="beberlei" created="Sat, 27 Nov 2010 14:05:44 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-855] [patch] EntityGenerator add an extra return line at each call ...</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-855</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using the php kooqit/console doctrine:generate:entities  command (from the symfony2 framework), the EntityGenerator add an extra return line every time the command is called ....&lt;/p&gt;

&lt;div class=&quot;code panel&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/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php
index f2fa583..b0c8320 100644
--- a/lib/Doctrine/ORM/Tools/EntityGenerator.php
+++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php
@@ -218,7 +218,7 @@ &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function &amp;lt;methodName&amp;gt;()
         $body = str_replace(&apos;&amp;lt;spaces&amp;gt;&apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_spaces, $body);
         $last = strrpos($currentCode, &apos;}&apos;);
 
-        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; substr($currentCode, 0, $last) . $body . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n}&quot;&lt;/span&gt;;
+        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; substr($currentCode, 0, $last) . $body . (strlen($body) &amp;gt; 0 ? &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt; : &apos;&apos;). &lt;span class=&quot;code-quote&quot;&gt;&quot;}&quot;&lt;/span&gt;;
     }
 
     /**

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12062">DDC-855</key>
            <summary>[patch] EntityGenerator add an extra return line at each call ...</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rande">Thomas Rabaix</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Nov 2010 10:33:07 +0000</created>
                <updated>Sat, 27 Nov 2010 13:57:46 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 13:57:46 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14854" author="beberlei" created="Sat, 27 Nov 2010 13:57:46 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-886] Mapped Supperclass composite identifier is ignored in child class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-886</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently $class-&amp;gt;isIdentifierComposite value stays &quot;false&quot; if no new identifiers were added on child class..&lt;/p&gt;

&lt;p&gt;patch proposal:&lt;br/&gt;
around line 270, file: ClassMetadataFactory.php&lt;/p&gt;

&lt;p&gt;add line: &lt;br/&gt;
$class-&amp;gt;isIdentifierComposite = $parent-&amp;gt;isIdentifierComposite;&lt;/p&gt;

&lt;p&gt;this way if supperclass had composite identifier and child had none identifiers&lt;br/&gt;
the result would be as suspected.&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="12132">DDC-886</key>
            <summary>Mapped Supperclass composite identifier is ignored in child class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="gediminasm">Gediminas Morkevicius</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Nov 2010 14:40:17 +0000</created>
                <updated>Sat, 27 Nov 2010 11:38:41 +0000</updated>
                    <resolved>Sat, 27 Nov 2010 11:38:41 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14843" author="beberlei" created="Sat, 27 Nov 2010 03:52:11 +0000"  >&lt;p&gt;Schedule for RC1&lt;/p&gt;</comment>
                    <comment id="14846" author="beberlei" created="Sat, 27 Nov 2010 11:38:41 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-882] The constructor type hinting of LoadClassMetadataEventArgs is not good</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-882</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The constructor type hinting of &lt;tt&gt;LoadClassMetadataEventArgs&lt;/tt&gt; is not good. It should be &lt;tt&gt;ClassMetadataInfo&lt;/tt&gt; and not &lt;tt&gt;ClassMetadata&lt;/tt&gt;. &lt;/p&gt;

&lt;p&gt;&lt;tt&gt;ClassMetadataInfo&lt;/tt&gt; is the base class used in the &lt;tt&gt;DisconnectedClassMetadataFactory&lt;/tt&gt;. So when the event is used the argument is &lt;tt&gt;ClassMetadataInfo&lt;/tt&gt; instance and not  a &lt;tt&gt;ClassMetadata&lt;/tt&gt; instance. I have this issue with the DoctrineBundle form the symfony2 framework.&lt;/p&gt;</description>
                <environment>symfony2 framework</environment>
            <key id="12122">DDC-882</key>
            <summary>The constructor type hinting of LoadClassMetadataEventArgs is not good</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rande">Thomas Rabaix</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Nov 2010 06:00:33 +0000</created>
                <updated>Thu, 18 Nov 2010 14:46:04 +0000</updated>
                    <resolved>Thu, 18 Nov 2010 14:46:04 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14781" author="beberlei" created="Thu, 18 Nov 2010 14:46:04 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-722] EntityRepository::find(One?)By should also support Associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-722</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should allow EntityRepository to also support associations fetching (when fetched Entity is the owning side).&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$employee = $em-&amp;gt;getRepository(&apos;Employee&apos;)-&amp;gt;findByEmployer($em-&amp;gt;getReference(&apos;Employer&apos;, $id));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11689">DDC-722</key>
            <summary>EntityRepository::find(One?)By should also support Associations</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Jul 2010 11:33:31 +0000</created>
                <updated>Tue, 16 Nov 2010 16:30:15 +0000</updated>
                    <resolved>Tue, 16 Nov 2010 16:30:15 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14763" author="guilhermeblanco" created="Tue, 16 Nov 2010 16:30:15 +0000"  >&lt;p&gt;Already implemented.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-796] Inheritance Discriminator mapping fails when the parent class is after a subclass alphabetically</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-796</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If I have a class called AbstractPage, with this single table inheritance mapping linking to the folllowing classes (Page, Article, Review), then it works fine:&lt;/p&gt;

&lt;p&gt;&amp;lt;discriminator-column name=&quot;discr&quot; type=&quot;string&quot; /&amp;gt;&lt;br/&gt;
&amp;lt;discriminator-map&amp;gt;&lt;br/&gt;
	&amp;lt;discriminator-mapping value=&quot;page&quot; class=&quot;Page&quot; /&amp;gt;&lt;br/&gt;
	&amp;lt;discriminator-mapping value=&quot;article&quot; class=&quot;Article&quot; /&amp;gt;&lt;br/&gt;
	&amp;lt;discriminator-mapping value=&quot;review&quot; class=&quot;Review&quot; /&amp;gt;&lt;br/&gt;
&amp;lt;/discriminator-map&amp;gt;&lt;/p&gt;

&lt;p&gt;If however I rename the classes to the Zend framework format, within modules (Default_Model_AbstractPage, Default_Model_Page, Article_Model_Article, Article_Model_Review), then because Article is before Default, then the schema tool gets confused and throws an error -  &lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine\DBAL\Schema\SchemaException&amp;#93;&lt;/span&gt; The table with name &apos;pages&apos; already exists. Everything else is the same but the class names.&lt;/p&gt;

&lt;p&gt;I have attached examples of this both working and nonworking with the different naming schemes. As you can see everything else is the same.&lt;/p&gt;</description>
                <environment>PHP 5.3, PDO_MYSQL</environment>
            <key id="11899">DDC-796</key>
            <summary>Inheritance Discriminator mapping fails when the parent class is after a subclass alphabetically</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gnuffo1">Daniel Moore</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Sep 2010 23:45:16 +0000</created>
                <updated>Tue, 16 Nov 2010 16:04:24 +0000</updated>
                    <resolved>Tue, 16 Nov 2010 16:04:24 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14316" author="beberlei" created="Fri, 10 Sep 2010 03:06:35 +0000"  >&lt;p&gt;if yo uspecify class=&quot;page&quot; the class has to be called Page, not Default_Model_Page. You have to change the mapping 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;&amp;lt;discriminator-column 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; /&amp;gt;
&amp;lt;discriminator-map&amp;gt;
&amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;page&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;Default_Model_Page&quot;&lt;/span&gt; /&amp;gt;
&amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;article&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;Default_Model_Article&quot;&lt;/span&gt; /&amp;gt;
&amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;review&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;Default_Model_Review&quot;&lt;/span&gt; /&amp;gt;
&amp;lt;/discriminator-map&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You cannot re-use the mapping for different classes, it has to be bound specifically to an exisiting class.&lt;/p&gt;</comment>
                    <comment id="14317" author="gnuffo1" created="Fri, 10 Sep 2010 08:06:03 +0000"  >&lt;p&gt;I probably wasn&apos;t being explicit enough - when I said I rename the classes I also meant that I renamed them in all of the mapping, so I&apos;ve got this:&lt;/p&gt;

&lt;p&gt;&amp;lt;discriminator-column name=&quot;discr&quot; type=&quot;string&quot; /&amp;gt;&lt;br/&gt;
&amp;lt;discriminator-map&amp;gt;&lt;br/&gt;
    &amp;lt;discriminator-mapping value=&quot;page&quot; class=&quot;Default_Model_Page&quot; /&amp;gt;&lt;br/&gt;
    &amp;lt;discriminator-mapping value=&quot;article&quot; class=&quot;Article_Model_Article&quot; /&amp;gt;&lt;br/&gt;
    &amp;lt;discriminator-mapping value=&quot;review&quot; class=&quot;Article_Model_Review&quot; /&amp;gt;&lt;br/&gt;
  &amp;lt;/discriminator-map&amp;gt;&lt;/p&gt;

&lt;p&gt;And I&apos;ve also renamed the mapping files themselves from Page.dcm.xml to Default_Model_Page.dcm.xml and so on. Still doesn&apos;t work.&lt;/p&gt;</comment>
                    <comment id="14330" author="gnuffo1" created="Fri, 10 Sep 2010 20:21:12 +0000"  >&lt;p&gt;I&apos;ve found a workaround for now. Move the subclasses into another folder (I&apos;ve create a subfolder called &quot;subclasses&quot;) and then add the second line:&lt;/p&gt;

&lt;p&gt;$driverImpl = new Doctrine\ORM\Mapping\Driver\XmlDriver(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;/mappings&apos;);&lt;br/&gt;
$driverImpl-&amp;gt;addPaths(array(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;/mappings/subclasses&apos;));&lt;/p&gt;

&lt;p&gt;That way the second folder will get read after the parent classes.&lt;/p&gt;</comment>
                    <comment id="14761" author="beberlei" created="Tue, 16 Nov 2010 16:04:24 +0000"  >&lt;p&gt;This issue was fixed in another ticket.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10780" name="nonworking.rar" size="2791" author="gnuffo1" created="Thu, 9 Sep 2010 23:45:16 +0000" />
                    <attachment id="10781" name="working.rar" size="2658" author="gnuffo1" created="Thu, 9 Sep 2010 23:45:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-511] Schema tool does not support STI - attempts to create a table per subclass</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-511</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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;

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


&lt;p&gt;CREATE TABLE Group (user_id INT NOT NULL, username VARCHAR(45) NOT NULL, password VARCHAR(40) NOT NULL, status SMALLINT NOT NULL, firstname VARCHAR(45) NOT NULL, lastname VARCHAR(45) NOT NULL, email VARCHAR(60) NOT NULL, phone VARCHAR(20) DEFAULT NULL, pager VARCHAR(20) DEFAULT NULL, reset_code VARCHAR(6) DEFAULT NULL, is_password_expired TINYINT(1) NOT NULL, failed_login_count SMALLINT NOT NULL, is_admin TINYINT(1) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX Group_username_uniq (username), PRIMARY KEY(user_id)) ENGINE = InnoDB;&lt;/p&gt;

&lt;p&gt;CREATE TABLE User (user_id INT NOT NULL, username VARCHAR(45) NOT NULL, password VARCHAR(40) NOT NULL, status SMALLINT NOT NULL, firstname VARCHAR(45) NOT NULL, lastname VARCHAR(45) NOT NULL, email VARCHAR(60) NOT NULL, phone VARCHAR(20) DEFAULT NULL, pager VARCHAR(20) DEFAULT NULL, reset_code VARCHAR(6) DEFAULT NULL, is_password_expired TINYINT(1) NOT NULL, failed_login_count SMALLINT NOT NULL, is_admin TINYINT(1) NOT NULL, version INT DEFAULT 1 NOT NULL, UNIQUE INDEX User_username_uniq (username), PRIMARY KEY(user_id)) ENGINE = InnoDB;&lt;/p&gt;
</description>
                <environment></environment>
            <key id="11207">DDC-511</key>
            <summary>Schema tool does not support STI - attempts to create a table per subclass</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="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 12:31:07 +0000</created>
                <updated>Tue, 16 Nov 2010 15:55:07 +0000</updated>
                    <resolved>Tue, 16 Nov 2010 15:55:07 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12644" author="guilhermeblanco" created="Mon, 12 Apr 2010 21:08:37 +0000"  >&lt;p&gt;That seems to be a reserved keyword issues.&lt;br/&gt;
I see comments around the STI issues, but this one doesn&apos;t seem to be the case.&lt;/p&gt;

&lt;p&gt;Try to use a different table 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;@Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;groups&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and...&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;@Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="12645" author="hobodave" created="Mon, 12 Apr 2010 21:52:35 +0000"  >&lt;p&gt;No. This is a STI problem. I don&apos;t &lt;em&gt;want&lt;/em&gt; two different tables. Users and Groups are meant to share the same table &quot;user&quot;. This worked prior to the omega CLI changes.&lt;/p&gt;</comment>
                    <comment id="12712" author="romanb" created="Mon, 19 Apr 2010 05:25:48 +0000"  >&lt;p&gt;After thinking about this a while, I think it is an interesting problem that points out some conceptual issues as well as some opportunities. The reason SchemaTool behaves that way is simple, I think: A mapped superclass is nothing more than a regular php class that inherits its mapping information to the child classes &quot;as if it were defined directly on the child classes&quot;. It is mainly a way to &quot;reuse&quot; mapping information without copy/paste. So the example given in the issue description is pretty much the same as 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-keyword&quot;&gt;abstract&lt;/span&gt; class Principal
{}
/**
 * @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;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;User&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;})
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;)
 */
class Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Principal
{}
/**
 * @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;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;User&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;})
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;)
 */
 */
class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Principal
{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hence why it wants to create two tables. However, something else is also probably wrong because it should rather result in an error due to creating the same table twice (&quot;user&quot;). So deriving @Table from a mapped superclass seems to be uncharted territory also. How/Why this ever worked before as you say is still a mystery to me. Do you know by any chance a revision or tag (alpha4?) where this worked so that we can compare to that? &lt;/p&gt;

&lt;p&gt;As you already found out, making the parent class an @Entity should work fine. We need to think more about how to deal with inheritance mapping information derived from mapped superclasses. For example, what should happen if we take the original example in the issue description but use JOINED instead 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;/**
 * @MappedSuperclass
 * @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;User&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;})
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Principal
{}
/**
 * @Entity
 */
class Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Principal
{}
/**
 * @Entity
 */
class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Principal
{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Can this ever work or does it even make sense? Rewriting it to reflect what it actually &quot;looks like&quot; for Doctrine:&lt;/p&gt;

&lt;div class=&quot;code panel&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;abstract&lt;/span&gt; class Principal
{}
/**
 * @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;User&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;})
 */
class Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Principal
{}
/**
 * @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;User&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;})
 */
class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Principal
{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think this would make no sense at all. Hence the combination of @MappedSuperclass + @InheritanceType probably only seems to make sense currently in the SINGLE_TABLE scenario mentioned in the issue description.&lt;/p&gt;

&lt;p&gt;An interesting possibility I noticed due to this ticket is that you can indeed use different inheritance mapping strategies in the same hierarchy, as long as the different subtrees of the hierarchy that are mapped with different strategies do not have a common ancestor &lt;b&gt;entity&lt;/b&gt;. (For Doctrine the subtrees are then simply unrelated hierarchies, it does not care about common ancestor classes that are regular php classes). We should write some tests for that and add it to the docs, I will create a new ticket for that. 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;class Base {}
class RootOfTreeA &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base {} &lt;span class=&quot;code-comment&quot;&gt;// Entity + SINGLE_TABLE
&lt;/span&gt;class RootOfTreeB &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base {} &lt;span class=&quot;code-comment&quot;&gt;// Entity + JOINED&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    <comment id="14154" author="romanb" created="Mon, 30 Aug 2010 06:22:57 +0000"  >&lt;p&gt;A solution and/or documented behavior for this should be evaluated before entering RC1.&lt;/p&gt;</comment>
                    <comment id="14759" author="beberlei" created="Tue, 16 Nov 2010 15:55:07 +0000"  >&lt;p&gt;MappedSuperclass Inheritance Details are confusing and are ignored now.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11138">DDC-477</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-853] Mysql: Drop schema for entities doesnt work if Database contains already tables with &apos;enum&apos; Field</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-853</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Dropping Entities 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;$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\User&apos;),
  $em-&amp;gt;getClassMetadata(&apos;Entities\Profile&apos;)
);
$tool-&amp;gt;dropSchema($classes);

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

&lt;p&gt;&lt;b&gt;throws:&lt;/b&gt;&lt;br/&gt;
Doctrine\DBAL\DBALException: Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it&lt;/p&gt;

&lt;p&gt;The Database already contains some tables with enum fields. But those should not be affected. They have no constraints  to the tables managed by the EntityManager&lt;/p&gt;

&lt;p&gt;Some debugging brought me to the point that Doctrine2 is trying to drop complete database, even metaclasses where given.&lt;/p&gt;

&lt;p&gt;In Doctrine\ORM\Tools\SchemaTool $classes will not be used in any way&lt;/p&gt;
&lt;div class=&quot;code panel&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 dropSchema(array $classes)
    {
        $dropSchemaSql = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getDropSchemaSql($classes);
        $conn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getConnection();

        foreach ($dropSchemaSql as $sql) {
            $conn-&amp;gt;executeQuery($sql);
        }
    }
&lt;span class=&quot;code-comment&quot;&gt;// Here $classes will not be used
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDropSchemaSql(array $classes)
    {
        $sm = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getConnection()-&amp;gt;getSchemaManager();
        $schema = $sm-&amp;gt;createSchema();

        $visitor = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_platform);
        /* @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; $schema \Doctrine\DBAL\Schema\Schema */
        $schema-&amp;gt;visit($visitor);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $visitor-&amp;gt;getQueries();
    }

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

&lt;p&gt;Also method SchemaTool::_getDropSchemaTablesDatabaseMode($classes) seems not to be used.&lt;/p&gt;

</description>
                <environment>Win 7 64Bit; PHP 5.3.3, MYSQL 5.14</environment>
            <key id="12052">DDC-853</key>
            <summary>Mysql: Drop schema for entities doesnt work if Database contains already tables with &apos;enum&apos; Field</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="schnueggel">Christian Steinmann</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Nov 2010 18:13:39 +0000</created>
                <updated>Tue, 16 Nov 2010 15:32:48 +0000</updated>
                    <resolved>Tue, 16 Nov 2010 15:32:48 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14758" author="beberlei" created="Tue, 16 Nov 2010 15:32:48 +0000"  >&lt;p&gt;Fixed, duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-629&quot; title=&quot;SchemaTool&amp;#39;s method dropSchema, drops all classes instead of those specified in $classes argument&quot;&gt;&lt;del&gt;DDC-629&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-629] SchemaTool&apos;s method dropSchema, drops all classes instead of those specified in $classes argument</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-629</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;$classes = array(
  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata(&apos;Models\Acl\Role&apos;),
  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata(&apos;Models\Acl\Resource\Module&apos;),
  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata(&apos;Models\Acl\Resource\Controller&apos;),
  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata(&apos;Models\Acl\Resource\Action&apos;)
);

&lt;span class=&quot;code-comment&quot;&gt;// Delete databases
&lt;/span&gt;$tool = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Tools\SchemaTool($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em);
$tool-&amp;gt;dropSchema($classes);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected:&lt;br/&gt;
Drops just schema specified by $classes&lt;/p&gt;

&lt;p&gt;Actual:&lt;br/&gt;
Drops all schema, not just that specified in $classes&lt;/p&gt;</description>
                <environment>Ubuntu, PHP 5.3.2, MySQL</environment>
            <key id="11466">DDC-629</key>
            <summary>SchemaTool&apos;s method dropSchema, drops all classes instead of those specified in $classes argument</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sammysnake">Joshua Henn</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jun 2010 06:44:58 +0000</created>
                <updated>Tue, 16 Nov 2010 15:32:15 +0000</updated>
                    <resolved>Tue, 16 Nov 2010 15:32:15 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13280" author="sammysnake" created="Fri, 11 Jun 2010 18:27:47 +0000"  >&lt;p&gt;SchemaTool.php method getDropSchemaSql(array $classes) &lt;/p&gt;

&lt;p&gt;doesn&apos;t create $schema from $classes argument&lt;br/&gt;
$schema = $sm-&amp;gt;createSchema();&lt;/p&gt;


&lt;p&gt;Additionally in AbstractSchemaManager.php method createSchema() ..&lt;/p&gt;

&lt;p&gt;doesn&apos;t support creating schema from argument ($classes)&lt;/p&gt;</comment>
                    <comment id="13281" author="beberlei" created="Fri, 11 Jun 2010 19:23:56 +0000"  >&lt;p&gt;yeah i think this is a non-issue, but requires better documentation and a disctiction of th etwo different approaches to deleting tables through totally different method names. I will be on this issue &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="14757" author="beberlei" created="Tue, 16 Nov 2010 15:32:15 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-867] QueryBuilder clone only does shallow clone</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-867</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Cloning a QueryBuilder object only performs a shallow clone.  This is problematic as object references in the dqlParts array stay the same in cloned copies of a QueryBuilder object.&lt;/p&gt;

&lt;p&gt;For example, say I have a QueryBuilder object with two simple &quot;andWhere&quot; clauses.  Now I clone the QueryBuilder instance and add a third &quot;andWhere&quot; clause to the cloned object.  The 3rd andWhere clause will also appear in the original QueryBuilder object.  The desired behavior is that the original QueryBuilder object is not modified when adding clauses to the cloned copy.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12079">DDC-867</key>
            <summary>QueryBuilder clone only does shallow clone</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="blt04">Brandon Turner</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Nov 2010 16:51:55 +0000</created>
                <updated>Mon, 15 Nov 2010 15:32:49 +0000</updated>
                    <resolved>Mon, 15 Nov 2010 15:32:49 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14741" author="beberlei" created="Mon, 15 Nov 2010 15:32:49 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-866] The EBNF definition for DQL needs to be updated</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-866</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is a summary replacing bugs 857, 863 and 864, which I hereby close.&lt;/p&gt;

&lt;p&gt;In summary, deep path expressions like &lt;/p&gt;

&lt;p&gt;SingleValuedAssociationPathExpression ::= IdentificationVariable &quot;.&quot; &lt;/p&gt;
{SingleValuedAssociationField &quot;.&quot;}
&lt;p&gt;* SingleValuedAssociationField&lt;/p&gt;

&lt;p&gt;are not suppored by the current implementation, but are documented to work in the EBNF definition for DQL (&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/dql-doctrine-query-language/en#dql-doctrine-query-language&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/dql-doctrine-query-language/en#dql-doctrine-query-language&lt;/a&gt;). The EBNF definitions need to be fixed, because currently they are factually wrong and thus misleading.&lt;/p&gt;

&lt;p&gt;(Obviously, actually having the feature would be preferrable IMO)&lt;/p&gt;</description>
                <environment></environment>
            <key id="12078">DDC-866</key>
            <summary>The EBNF definition for DQL needs to be updated</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Nov 2010 15:56:51 +0000</created>
                <updated>Mon, 15 Nov 2010 15:00:44 +0000</updated>
                    <resolved>Mon, 15 Nov 2010 15:00:44 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14695" author="beberlei" created="Tue, 9 Nov 2010 16:41:21 +0000"  >&lt;p&gt;This feature was removed for technical reasons. I updated the docs accordingly.&lt;/p&gt;</comment>
                    <comment id="14737" author="dalvarez" created="Mon, 15 Nov 2010 14:23:16 +0000"  >&lt;p&gt;The online documentation (&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/dql-doctrine-query-language/en#dql-doctrine-query-language&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/dql-doctrine-query-language/en#dql-doctrine-query-language&lt;/a&gt;) is still listing the factually wrong EBNF, specifically:&lt;/p&gt;

&lt;p&gt;/* &quot;u.Group&quot; */&lt;br/&gt;
SingleValuedAssociationPathExpression     ::= IdentificationVariable &quot;.&quot; &lt;/p&gt;
{SingleValuedAssociationField &quot;.&quot;}* SingleValuedAssociationField&lt;br/&gt;
&lt;br/&gt;
/* &quot;u.Group.Permissions&quot; */&lt;br/&gt;
CollectionValuedPathExpression            ::= IdentificationVariable &quot;.&quot; {SingleValuedAssociationField &quot;.&quot;}
&lt;p&gt;* CollectionValuedAssociationField&lt;/p&gt;


&lt;p&gt;I cleared my local web cache, of course, before viewing, but to no effect. It&apos;s possibly that the fix was done internally in a SCM Tool, but was not published. As of now, the documentation fix did not become effective for the docs that are now visible online. I reopen this as a reminder.&lt;/p&gt;</comment>
                    <comment id="14738" author="beberlei" created="Mon, 15 Nov 2010 15:00:44 +0000"  >&lt;p&gt;we dont render the docs all the time, it takes some time.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-873] @Version and Single Table</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-873</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In my previous Bug Report &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-871&quot; title=&quot;@Version causes cascading to behave strangely&quot;&gt;&lt;del&gt;DDC-871&lt;/del&gt;&lt;/a&gt; I&apos;m using a separate table for versioning copies. However, if one wishes to keep all versions in a single table, this causes some headaches, since the field with @version can&apos;t be set by the developer (i.e. Doctrine2 does magic here).&lt;/p&gt;

&lt;p&gt;I&apos;ll try to describe it with some meta code.&lt;/p&gt;

&lt;p&gt;Let&apos;s say you have the class SingleTable, which has a property version marked with @version and @id, and also a property id marked with @id. I know this isn&apos;t the preferred way since it&apos;s a composite primary key, but in theory it would work. I&apos;m managing the ID of the object myself, which works without a problem.&lt;/p&gt;

&lt;p&gt;The problem is that once a field is marked with @version, it isn&apos;t set during an insert operation. Doctrine2 relies on the field&apos;s default value. This causes the following problems:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;You can&apos;t start with an object version higher than 1.&lt;/li&gt;
	&lt;li&gt;If you wish to insert an older version (which is possible with my composite primary key example), you can&apos;t simply set the version - Doctrine2 does it&apos;s own magic, which fails at this point.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;No matter if there will be a change to the @version behavior or not, it should be documented a bit better in the documentation. Once I know if it will be changed or not, I can contribute additional documentation for this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12092">DDC-873</key>
            <summary>@Version and Single Table</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2010 11:49:22 +0000</created>
                <updated>Thu, 11 Nov 2010 15:21:40 +0000</updated>
                    <resolved>Thu, 11 Nov 2010 15:21:40 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14707" author="beberlei" created="Wed, 10 Nov 2010 13:02:34 +0000"  >&lt;p&gt;Yes @Version and @Id are not allowed. This should just throw an exception.&lt;/p&gt;</comment>
                    <comment id="14709" author="felicitus" created="Wed, 10 Nov 2010 13:14:02 +0000"  >&lt;p&gt;As I&apos;m already working on some documentation things, I will add this to the documentation and maybe also add some code to throw an Exception.&lt;/p&gt;</comment>
                    <comment id="14711" author="felicitus" created="Wed, 10 Nov 2010 15:54:17 +0000"  >&lt;p&gt;Just created a pull request for this (I added the bugfix + testcase), feel free to close after pull.&lt;/p&gt;</comment>
                    <comment id="14724" author="beberlei" created="Thu, 11 Nov 2010 15:21:40 +0000"  >&lt;p&gt;Implemented exception on this wrong usage.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-856] Boolean discriminator field for single table inheritance does not work as expected with MySQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-856</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I have a a single table inheritance, with a boolean discriminator field, see: &lt;a href=&quot;http://pastie.org/1269467&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1269467&lt;/a&gt;&lt;br/&gt;
As MySQL does not have a boolean field, true / false should be translated to 1/0 (as it uses a TINYINT(1) field instead).&lt;/p&gt;

&lt;p&gt;If I use 1 / 0 in the annotation instead of true / false it works, but than it&apos;s not boolean anymore...&lt;/p&gt;

&lt;p&gt;So it should either translate that, or mention this in the documentation (although vendor specific exceptions should be avoided imo).&lt;/p&gt;</description>
                <environment>MySQL 5</environment>
            <key id="12063">DDC-856</key>
            <summary>Boolean discriminator field for single table inheritance does not work as expected with MySQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sebak">seba kerckhof</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Nov 2010 13:27:59 +0000</created>
                <updated>Thu, 11 Nov 2010 15:14:05 +0000</updated>
                    <resolved>Thu, 11 Nov 2010 15:14:05 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14663" author="beberlei" created="Thu, 4 Nov 2010 03:25:29 +0000"  >&lt;p&gt;This is not supported, i suggest using smallint and 0 / 1 instead.&lt;/p&gt;</comment>
                    <comment id="14723" author="beberlei" created="Thu, 11 Nov 2010 15:14:05 +0000"  >&lt;p&gt;Throwing an exception now on using boolean, object, array, datetime, date or time for the discriminator column.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-870] @Version causes integer fields to return a string</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-870</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Here&apos;s a small example when using @Version causes the field to return a string and not an integer. &lt;/p&gt;

&lt;p&gt;Here&apos;s a very simple example:&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;SimpleTest class&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 */
class SimpleTest {
	 /**
     * @Id
     * @generatedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     * @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;
    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @version
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $version;
    /**
     * @Column
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $content;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setContent ($content) {
    	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;content = $content;
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getVersion () {
    	&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;version;
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId () {
    	&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }
    
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;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;Invocation&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$test = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SimpleTest();
$test-&amp;gt;setContent(&lt;span class=&quot;code-quote&quot;&gt;&quot;V1&quot;&lt;/span&gt;);
$em-&amp;gt;persist($test);
$em-&amp;gt;flush();

&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (gettype($test-&amp;gt;getVersion()) == &lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) { die(&lt;span class=&quot;code-quote&quot;&gt;&quot;Version should be an integer, not a string!&quot;&lt;/span&gt;); }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The invocation fails because the version property is suddenly a string and not an integer anymore.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12087">DDC-870</key>
            <summary>@Version causes integer fields to return a string</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Nov 2010 12:44:17 +0000</created>
                <updated>Tue, 9 Nov 2010 17:16:15 +0000</updated>
                    <resolved>Tue, 9 Nov 2010 17:16:15 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14696" author="beberlei" created="Tue, 9 Nov 2010 17:16:15 +0000"  >&lt;p&gt;Fixed, and a bunch of other issues with versioning that i found while looking at the code.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-868] ORM:Schema-tool:create failure -- the result depends on xml files enumeration order of RecursiveDirectoryIterator in context of SINGLE_TABLE inherantence</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-868</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;= Relevant configuration:  =&lt;br/&gt;
    resources.doctrine.driver.class = Doctrine\ORM\Mapping\Driver\XmlDriver&lt;br/&gt;
    resources.doctrine.driver.dir = APPLICATION_PATH &quot;/../library/Droop/Model/Xml&quot;&lt;br/&gt;
    resources.doctrine.cache.class = Doctrine\Common\Cache\ArrayCache&lt;br/&gt;
    resources.doctrine.conn.driver = pdo_mysql&lt;/p&gt;

&lt;p&gt;= Models hierarchy =&lt;br/&gt;
class Sysbase {}&lt;br/&gt;
class Drooplet extends Sysbase {}&lt;br/&gt;
class Menu extends Sysbase {}&lt;/p&gt;

&lt;p&gt;= Xml driver = &lt;br/&gt;
attached&lt;/p&gt;

&lt;p&gt;= Error =&lt;br/&gt;
While using command line to generate schema &lt;span class=&quot;error&quot;&gt;&amp;#91;php doctrine.php orm:schema-tool:create --dump-sql&amp;#93;&lt;/span&gt;, it reports error &quot;The table with name &apos;system&apos; already exists.&quot; on windows however not on linux. &lt;/p&gt;

&lt;p&gt;It is because the ClassMetaFactory.php depends on the sequence of result returned by getAllClassNames(). In this scenario, it&apos;s in descending order on linux and ascending on windows.&lt;br/&gt;
124        foreach ($this-&amp;gt;driver-&amp;gt;getAllClassNames() as $className) &lt;/p&gt;
{
125            $metadata[] = $this-&amp;gt;getMetadataFor($className);
126        }
&lt;p&gt;127&lt;br/&gt;
128        return $metadata;&lt;br/&gt;
This order populates to SchemaTool::getSchemaFromMetadata(); If the base model is processed before it&apos;s descendants, everything is OK. Otherwise, it will complain about the table already exists.&lt;/p&gt;

&lt;p&gt;= Fix =&lt;br/&gt;
ClassMetaFactory.php&lt;br/&gt;
128        return $this-&amp;gt;loadedMetadata;&lt;/p&gt;

</description>
                <environment>Windows or Linux, PHP-5.3.3</environment>
            <key id="12080">DDC-868</key>
            <summary>ORM:Schema-tool:create failure -- the result depends on xml files enumeration order of RecursiveDirectoryIterator in context of SINGLE_TABLE inherantence</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="xhorse">Jim Chen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Nov 2010 21:03:40 +0000</created>
                <updated>Tue, 9 Nov 2010 16:13:58 +0000</updated>
                    <resolved>Tue, 9 Nov 2010 16:13:58 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14693" author="beberlei" created="Tue, 9 Nov 2010 15:57:30 +0000"  >&lt;p&gt;By what means is that a valid fix? Doesnt that just give another random order that happens to work for your cases now?&lt;/p&gt;</comment>
                    <comment id="14694" author="beberlei" created="Tue, 9 Nov 2010 16:13:58 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10853" name="Droop.Model.Drooplet.dcm.xml" size="390" author="xhorse" created="Mon, 8 Nov 2010 21:03:40 +0000" />
                    <attachment id="10854" name="Droop.Model.Menu.dcm.xml" size="386" author="xhorse" created="Mon, 8 Nov 2010 21:03:40 +0000" />
                    <attachment id="10852" name="Droop.Model.Sysbase.dcm.xml" size="1315" author="xhorse" created="Mon, 8 Nov 2010 21:03:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-861] Improve ProxyFactory to avoid having to use Autoloader</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-861</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In ProxyFactory::getProxy all the information is necessary to avoid having to configure an autoloader. Why don&apos;t we do that already?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12070">DDC-861</key>
            <summary>Improve ProxyFactory to avoid having to use Autoloader</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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, 5 Nov 2010 17:16:33 +0000</created>
                <updated>Sat, 6 Nov 2010 07:24:14 +0000</updated>
                    <resolved>Sat, 6 Nov 2010 07:24:14 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14674" author="beberlei" created="Fri, 5 Nov 2010 17:41:45 +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;diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
index 472e730..8be75d9 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php
+++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -77,9 +77,11 @@ class ProxyFactory
         $proxyClassName = str_replace(&apos;\\&apos;, &apos;&apos;, $className) . &apos;Proxy&apos;;
         $fqn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyNamespace . &apos;\\&apos; . $proxyClassName;
 
-        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_autoGenerate &amp;amp;&amp;amp; ! class_exists($fqn, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (! class_exists($fqn, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
             $fileName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . &apos;.php&apos;;
-            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
+            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_autoGenerate) {
+                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplat
+            }
             require $fileName;
         }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14677" author="beberlei" created="Sat, 6 Nov 2010 07:24:14 +0000"  >&lt;p&gt;I committed this yesterday. From now you don&apos;t need an autoloader for both autogenerate = true and = false.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-860] loadClassMetadata event on event listeners</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-860</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;loadClassMetadata event arguments - LoadClassMetadataEventArgs, should contain a reference to metadataCacheDriver used on classMetadataFactory&lt;br/&gt;
that is important in order to cache additional metadata which can be read from other annotations during this event. Currently it is not possible to retrieve it during this event.&lt;br/&gt;
That concerns only event listeners not livecycle events directly on entity.&lt;/p&gt;</description>
                <environment>no matter</environment>
            <key id="12069">DDC-860</key>
            <summary>loadClassMetadata event on event listeners</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="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="gediminasm">Gediminas Morkevicius</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Nov 2010 14:33:33 +0000</created>
                <updated>Fri, 5 Nov 2010 17:13:46 +0000</updated>
                    <resolved>Fri, 5 Nov 2010 17:13:46 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14673" author="beberlei" created="Fri, 5 Nov 2010 17:13:46 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-859] Datetime object changeset computing</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-859</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The problem is with Datetime value on entity, if I dirrecly modify it, unitOfWork will not add it into change set&lt;br/&gt;
// assume loaded entity through dql or repository:&lt;/p&gt;

&lt;p&gt;$entity-&amp;gt;getStartDate()-&amp;gt;modify(&quot;+ 1day&quot;);&lt;br/&gt;
$em-&amp;gt;persist($entity);&lt;br/&gt;
$em-&amp;gt;flush(); // no changes&lt;/p&gt;

&lt;p&gt;as far as I understand objects are compared through ($oldObject === $newObject) probably php takes spl_object_hash to do the comparison&lt;br/&gt;
copying an object works as expected&lt;/p&gt;</description>
                <environment>php 5.3.2, windows</environment>
            <key id="12068">DDC-859</key>
            <summary>Datetime object changeset computing</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="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="gediminasm">Gediminas Morkevicius</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Nov 2010 14:25:53 +0000</created>
                <updated>Fri, 5 Nov 2010 16:18:47 +0000</updated>
                    <resolved>Fri, 5 Nov 2010 16:18:47 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14672" author="beberlei" created="Fri, 5 Nov 2010 16:18:47 +0000"  >&lt;p&gt;This is expected behavior, DateTime objects are thought of as immutable value objects (php allowing them to be mutable is sort of a design mistake that even Derick sees now).&lt;/p&gt;

&lt;p&gt;Only changing the instance will change the value, otherwise the difference computation would be too difficult and would involve cloning the datetime (overhead).&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-812] DQL hydration of joined objects skipped when main instance already present in entity manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-812</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I do 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;$author1 = $em-&amp;gt;find(&apos;Author&apos;, 1);

$author1again = $em
  -&amp;gt;createQuery(
    &apos;SELECT A, B &apos;.
    &apos;FROM Author A &apos;.
    &apos;INNER JOIN A.Books B &apos;.
   &apos;WHERE A.ID = 1&apos;
  )
  -&amp;gt;getSingleResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the Books collection is not hydrated because the author instance was already&lt;br/&gt;
hydrated when populating $author1. This means when I call&lt;br/&gt;
count($author1-&amp;gt;getBooks()) a third query is executed to fetch the Books again.&lt;/p&gt;

&lt;p&gt;The result is even more problematic when adding a WITH clause to the&lt;br/&gt;
INNER JOIN, in that case one would expect the Books collection to only&lt;br/&gt;
contain the books matching matching that criteria.&lt;/p&gt;

&lt;p&gt;The result is expected when commenting out the $author1 =... line, thus when&lt;br/&gt;
the author does not already exist in the entity manager.&lt;/p&gt;

&lt;p&gt;I&apos;m sorry I can&apos;t produce a test case right now.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11947">DDC-812</key>
            <summary>DQL hydration of joined objects skipped when main instance already present in entity manager</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="dennis.verspuij">Dennis Verspuij</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Sep 2010 11:43:33 +0000</created>
                <updated>Sun, 31 Oct 2010 06:13:53 +0000</updated>
                    <resolved>Sun, 31 Oct 2010 06:13:53 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14433" author="beberlei" created="Tue, 21 Sep 2010 13:08:16 +0000"  >&lt;p&gt;fix formatting&lt;/p&gt;</comment>
                    <comment id="14644" author="romanb" created="Sun, 31 Oct 2010 06:13:52 +0000"  >&lt;p&gt;Fixed in master. Note that your second case still &quot;won&apos;t work&quot; from your point of view. If the collection is already initialized it is not overridden. This is consistent with other behavior (what is in-memory is preserved). Fetch-joinining a collection and using WITH at the same time is not a nice thing to do since the meaning of the association is changed per-query. First $author-&amp;gt;getBooks() means one thing (all books written by this author) and a few lines later something else (all books written by this author in the last 10 years or whatever). To get the desired result in your second case, that is, overriding the collection in-memory, set the REFRESH query hint. Note that this will change the meaning of Author#books though, as is always the case with fetch-join + WITH.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-274] Class and namespace naming inconsistency</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-274</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There are inconsistencies with some class and namespace names that include acronyms.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;Classes with upper-casing:&lt;br/&gt;
    ORMException, DBALException, OCI8Connection, etc.&lt;/p&gt;

&lt;p&gt;Classes with proper-casing:&lt;br/&gt;
    RunDqlTask, CliException, MySqlPlatform, etc.&lt;/p&gt;

&lt;p&gt;Namespaces with upper-casing:&lt;br/&gt;
    DBAL, ORM, Doctrine\DBAL\Driver\PDOMsSql, etc.&lt;/p&gt;

&lt;p&gt;Namespaces with proper-casing:&lt;br/&gt;
    Doctrine\Common\Cli, Doctrine\DBAL\Tools\Cli\, Doctrine\ORM\Id, etc.&lt;/p&gt;

&lt;p&gt;There is more proper-casing than upper-casing. IMHO, proper-casing is better as it&apos;s easier to read &quot;SqlException&quot; than it is to read &quot;SQLException&quot; (the &quot;E&quot; looks like part of the acronym), and things like &quot;CLITask&quot; can be avoided. &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;I discussed this a bit with Benjamin and Guilherme, and they were unsure and said that the whole team needed to reach consensus.&lt;/p&gt;

&lt;p&gt;I&apos;m leaving the priority as &quot;Major&quot; because this should probably be fixed sooner rather than later to prevent compatibility breaks.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10769">DDC-274</key>
            <summary>Class and namespace naming inconsistency</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="darkangel">Glen Ainscow</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Jan 2010 16:30:50 +0000</created>
                <updated>Sun, 31 Oct 2010 05:20:55 +0000</updated>
                                    <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11462" author="guilhermeblanco" created="Mon, 25 Jan 2010 13:41:23 +0000"  >&lt;p&gt;Increasing the severity and adding a fix version since this MUST be fixed before next release.&lt;/p&gt;</comment>
                    <comment id="11467" author="romanb" created="Mon, 25 Jan 2010 13:57:02 +0000"  >&lt;p&gt;I find this to be of rather minor importance. You&apos;re talking of compatibility breaks, but thats only the case if we intend to start being very nitpicky about the naming in the future. We are currently not, and we wont be, so not much risk of later breakage.&lt;/p&gt;

&lt;p&gt;We have a rule of thumb already: Acronyms up to 4 characters all uppercase, otherwise normal camelcase.&lt;/p&gt;

&lt;p&gt;Now, it is often a matter of taste what is an acronym and what not and also not all acronyms have a clear casing, prime example mysql.&lt;/p&gt;

&lt;p&gt;Being too nit-picky here is just a pain in the ass and we won&apos;t reach a common consensus anyway.&lt;/p&gt;</comment>
                    <comment id="11468" author="romanb" created="Mon, 25 Jan 2010 13:58:51 +0000"  >&lt;p&gt;Oh and we better dont start arguing about whats better to read because there is no chance of agreement. If you ask me I find SQLException better than SqlException. So here we go. Lets better not run down this path.&lt;/p&gt;</comment>
                    <comment id="11469" author="darkangel" created="Mon, 25 Jan 2010 14:15:34 +0000"  >&lt;p&gt;No need to get upset, I&apos;m only trying to help.&lt;/p&gt;

&lt;p&gt;I just thought that consistency is usually a good idea, either way.&lt;/p&gt;

&lt;p&gt;I have to disagree in that an acronym is an acronym, it&apos;s not a matter of taste, the letters either stand for something, or they don&apos;t.&lt;/p&gt;

&lt;p&gt;As for &quot;mysql&quot;, only the SQL part is an acronym. So, MySQL or MySql.&lt;/p&gt;

&lt;p&gt;Close if you disagree.&lt;/p&gt;</comment>
                    <comment id="11471" author="romanb" created="Mon, 25 Jan 2010 14:28:03 +0000"  >&lt;p&gt;I&apos;m not upset. What made you think so? Maybe I should introduce a &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; every now and then.&lt;/p&gt;

&lt;p&gt;There&apos;s just no point in arguing about readability.&lt;/p&gt;

&lt;p&gt;Like I said, we do have a naming standard even if its not adhered everywhere. The standard is also not something we&apos;ve made up ourselves because we try to avoid that. When we introduced namespaces, we talked about adopting either the Java or .NET naming standards. We opted for the .NET standards. And there its recommended to write acronyms with up to 4 characters all uppercase.&lt;/p&gt;

&lt;p&gt;I dont think there are too many violations of that in the code, probably Cli =&amp;gt; CLI and some others but most of it looks ok to me.&lt;/p&gt;

&lt;p&gt;UPDATE: Maybe we can gather a list here in this ticket of violations? Cli =&amp;gt; CLI would be one. MySql =&amp;gt; MySQL another. &quot;Id&quot; is rather an abbreviation of Identifier and not an acronym, to me at least.&lt;/p&gt;</comment>
                    <comment id="11472" author="guilhermeblanco" created="Mon, 25 Jan 2010 14:29:41 +0000"  >&lt;p&gt;It&apos;s not a case of getting anyone upset...&lt;/p&gt;

&lt;p&gt;But we should fix it and keep consistency of our codebase.&lt;/p&gt;

&lt;p&gt;@romanb We should all talk and reach a common sense.&lt;br/&gt;
That&apos;s our last chance (last alpha) to get this consistency in.&lt;/p&gt;</comment>
                    <comment id="11473" author="romanb" created="Mon, 25 Jan 2010 14:33:04 +0000"  >&lt;p&gt;@Guilherme: We do have a naming standard since a year. You want to change the standard now?&lt;/p&gt;</comment>
                    <comment id="11478" author="darkangel" created="Mon, 25 Jan 2010 16:02:14 +0000"  >&lt;p&gt;@Roman,&lt;/p&gt;

&lt;p&gt;Just a feeling I got. &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;This issue was more about consistency (indicated in the title) than moving to proper-case naming.&lt;/p&gt;

&lt;p&gt;I think it might be up to 3 characters in .NET, HtmlElement, System.Linq, etc. Anyway, not important. &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 agree that Id. is an abbreviation.&lt;/p&gt;

&lt;p&gt;There are some more violations. If you decide you want to change them, let me know and I&apos;ll compile a list.&lt;/p&gt;</comment>
                    <comment id="11480" author="romanb" created="Mon, 25 Jan 2010 17:30:04 +0000"  >&lt;p&gt;@Glen: Yes, a list would be great. I find it hard to be 100% consistent sometimes though because my taste conflicts with the rule. For example, I would prefer &quot;Id&quot; over &quot;ID&quot;, especially since it comes directly after ORM &quot;Doctrine\ORM\ID\...&quot; would be a bit too much. But I would not like &quot;Orm&quot; or &quot;Dbal&quot; either. But I think in most cases we can clearly fix the inconsistency. Like CLI or MySQL or MSSQL (or should it be MsSQL?).&lt;/p&gt;

&lt;p&gt;Thanks for your help!&lt;/p&gt;

&lt;p&gt;We should probably create updated coding standards for Doctrine 2 also, since they differ quite some from Doctrine 1 due to the introduction of namespaces and such. I&apos;ll create a ticket for that.&lt;/p&gt;</comment>
                    <comment id="11481" author="darkangel" created="Mon, 25 Jan 2010 18:40:02 +0000"  >&lt;p&gt;I&apos;ll do the list for you by tomorrow at the latest, just running out of time ATM.&lt;/p&gt;

&lt;p&gt;Id is correct, as mentioned above, so that would be fine. MsSQL is correct (Ms = Microsoft = abbreviation).&lt;/p&gt;</comment>
                    <comment id="11483" author="darkangel" created="Mon, 25 Jan 2010 20:31:56 +0000"  >&lt;p&gt;Found some time ...&lt;/p&gt;

&lt;p&gt;Doctrine\Common\Cache\ApcCache -&amp;gt; APCCache&lt;br/&gt;
Doctrine\Common\Cli -&amp;gt; CLI&lt;br/&gt;
Doctrine\Common\Cli\Printers\AnsiColorPrinter -&amp;gt; ANSIColorPrinter&lt;br/&gt;
Doctrine\Common\Cli\CliController -&amp;gt; CLIController&lt;br/&gt;
Doctrine\Common\Cli\CliException -&amp;gt; CLIException&lt;/p&gt;

&lt;p&gt;Doctrine\DBAL\Driver\PDOMsSql -&amp;gt; PDOMsSQL&lt;br/&gt;
Doctrine\DBAL\Driver\PDOMySql -&amp;gt; PDOMySQL&lt;br/&gt;
Doctrine\DBAL\Driver\PDOPgSql -&amp;gt; PDOPgSQL&lt;br/&gt;
Doctrine\DBAL\Driver\PDOSqlite -&amp;gt; PDOSQLite&lt;br/&gt;
Doctrine\DBAL\Logging\EchoSqlLogger -&amp;gt; EchoSQLLogger&lt;br/&gt;
Doctrine\DBAL\Logging\SqlLogger -&amp;gt; SQLLogger&lt;br/&gt;
Doctrine\DBAL\Platforms\MsSqlPlatform -&amp;gt; MsSQLPlatform&lt;br/&gt;
Doctrine\DBAL\Platforms\MySqlPlatform -&amp;gt; MySQLPlatform&lt;br/&gt;
Doctrine\DBAL\Platforms\PostgreSqlPlatform -&amp;gt; PostgreSQLPlatform&lt;br/&gt;
Doctrine\DBAL\Platforms\SqlitePlatform -&amp;gt; SQLitePlatform&lt;br/&gt;
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector -&amp;gt; CreateSchemaSQLCollector&lt;br/&gt;
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector -&amp;gt; DropSchemaSQLCollector&lt;br/&gt;
Doctrine\DBAL\Schema\MsSqlSchemaManager -&amp;gt; MsSQLSchemaManager&lt;br/&gt;
Doctrine\DBAL\Schema\MySqlSchemaManager -&amp;gt; MySQLSchemaManager&lt;br/&gt;
Doctrine\DBAL\Schema\PostgreSqlSchemaManager -&amp;gt; PostgreSQLSchemaManager&lt;br/&gt;
Doctrine\DBAL\Schema\SqliteSchemaManager -&amp;gt; SQLiteSchemaManager&lt;br/&gt;
Doctrine\DBAL\Tools\Cli -&amp;gt; CLI&lt;br/&gt;
Doctrine\DBAL\Tools\Cli\Tasks\RunSqlTask -&amp;gt; RunSQLTask&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Mapping\Driver\PhpDriver -&amp;gt; PHPDriver&lt;br/&gt;
Doctrine\ORM\Mapping\Driver\XmlDriver -&amp;gt; XMLDriver&lt;br/&gt;
Doctrine\ORM\Mapping\Driver\YamlDriver -&amp;gt; YAMLDriver&lt;br/&gt;
Doctrine\ORM\Query\Exec\AbstractSqlExecutor -&amp;gt; AbstractSQLExecutor&lt;br/&gt;
(Should Doctrine\ORM\Query\Expr\Andx and Orx be AndX and OrX?)&lt;br/&gt;
Doctrine\ORM\Query\SqlWalker -&amp;gt; SQLWalker&lt;br/&gt;
Doctrine\ORM\Tools\Cli -&amp;gt; CLI&lt;br/&gt;
Doctrine\ORM\Tools\Cli\Tasks\RunDqlTask -&amp;gt; RunDQLTask&lt;br/&gt;
Doctrine\ORM\Tools\Export\Driver\PhpExporter -&amp;gt; PHPExporter&lt;br/&gt;
Doctrine\ORM\Tools\Export\Driver\XmlExporter -&amp;gt; XMLExporter&lt;br/&gt;
Doctrine\ORM\Tools\Export\Driver\YamlExporter -&amp;gt; YAMLExporter&lt;/p&gt;

&lt;p&gt;... I think that&apos;s it. More than you expected? I did say: &quot;There is more proper-casing than upper-casing.&quot; &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="11484" author="romanb" created="Mon, 25 Jan 2010 20:46:33 +0000"  >&lt;p&gt;No, not more than I expected. It&apos;s mostly SQL and CLI basically. Thanks for the list!&lt;/p&gt;

&lt;p&gt;We should try to go through that list before beta.&lt;/p&gt;</comment>
                    <comment id="12037" author="romanb" created="Fri, 5 Mar 2010 11:40:16 +0000"  >&lt;p&gt;Methods should be adjusted accordingly also (even though they&apos;re case insensitive). I already started with that. More to come.&lt;/p&gt;</comment>
                    <comment id="12479" author="romanb" created="Sun, 28 Mar 2010 06:19:38 +0000"  >&lt;p&gt;Most of the Cli =&amp;gt; CLI changes seem to be complete now.&lt;/p&gt;</comment>
                    <comment id="12745" author="romanb" created="Mon, 26 Apr 2010 06:06:21 +0000"  >&lt;p&gt;Pushing the rest of the name changes towards beta2.&lt;/p&gt;</comment>
                    <comment id="13007" author="romanb" created="Wed, 19 May 2010 06:58:27 +0000"  >&lt;p&gt;More renamings have been done but still more to do. Pushing remaining work to beta3.&lt;/p&gt;</comment>
                    <comment id="14152" author="romanb" created="Mon, 30 Aug 2010 06:20:35 +0000"  >&lt;p&gt;Final name changes should be done prior to going into RC1.&lt;/p&gt;</comment>
                    <comment id="14629" author="beberlei" created="Sun, 31 Oct 2010 02:36:54 +0000"  >&lt;p&gt;there is much to be done yet, however most of it is also public API class names and might cause quite some BC breaks (i.e. DBAL Platforms and Schema Manager, Mapping Driver Names). I am not sure how to proceed here.&lt;/p&gt;</comment>
                    <comment id="14642" author="romanb" created="Sun, 31 Oct 2010 05:20:55 +0000"  >&lt;p&gt;Since PHP is mostly case-insensitive on class and method names it shouldn&apos;t be much of an issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-826] Problem with @MappedSuperclass and associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-826</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a project with global entities(Lib\Shared\Main - @MappedSuperclass ) and local entities(Shared\Main) which extends the globals. &lt;/p&gt;

&lt;p&gt;The following DQL is returning wrong SQL:&lt;/p&gt;

&lt;p&gt;SELECT Horoscope FROM Shared\Main\Horoscope Horoscope JOIN Horoscope.sign Sign WHERE Sign.id = 7&lt;/p&gt;

&lt;p&gt;SELECT h0_.id AS id0, h0_.date AS date1, h0_.contents AS contents2, h0_.signId AS signId3 FROM horoscopes h0_ INNER JOIN global.sys_zodiac_signs g1_ ON h2_.signId = g1_.id WHERE g1_.id = 7 &lt;/p&gt;

&lt;p&gt;The attached zip contains the entity files.&lt;/p&gt;

&lt;p&gt;What is the correct way to extends entities and to build JOINed requests&lt;/p&gt;

&lt;p&gt;Have a nice day&lt;/p&gt;</description>
                <environment></environment>
            <key id="11978">DDC-826</key>
            <summary>Problem with @MappedSuperclass and associations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mojito">Kristiyan Chakarov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Oct 2010 04:18:24 +0000</created>
                <updated>Sun, 31 Oct 2010 03:11:40 +0000</updated>
                    <resolved>Sun, 31 Oct 2010 03:11:40 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14534" author="beberlei" created="Wed, 6 Oct 2010 06:23:47 +0000"  >&lt;p&gt;Beta2? Please update to Beta4&lt;/p&gt;

&lt;p&gt;Are you using YAML Driver? If yes this is a known bug that was fixed in trunk lately and will be included as a fix for RC1.&lt;/p&gt;</comment>
                    <comment id="14536" author="mojito" created="Wed, 6 Oct 2010 07:09:06 +0000"  >&lt;p&gt;I&apos;m using annotations and Beta4 is not working better for my problem.&lt;/p&gt;</comment>
                    <comment id="14538" author="mojito" created="Wed, 6 Oct 2010 09:31:23 +0000"  >&lt;p&gt;is there a good example of using Class Table Inheritance and Mapped Superclasses &lt;/p&gt;</comment>
                    <comment id="14634" author="beberlei" created="Sun, 31 Oct 2010 03:11:40 +0000"  >&lt;p&gt;I cant reproduce it, i am pretty sure this is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-671&quot; title=&quot;Table aliases wrongly computed with YAML + mappedsuperclasses and joins&quot;&gt;&lt;del&gt;DDC-671&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12011">DDC-841</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10821" name="test.zip" size="2579" author="mojito" created="Wed, 6 Oct 2010 04:18:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-671] Table aliases wrongly computed with YAML + mappedsuperclasses and joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-671</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Affects only YAML. (Maybe also XML? But works with Annotations!) &lt;/p&gt;

&lt;p&gt;If there&apos;s a relation specified in a mappedSuperclass (manyToOne, towards entity B) and two Entities A and B using this mappedSuperclass, an error occurs within generating the SQL-Query when using a query a la SELECT * FROM A JOIN B ON A.relation = B.id: &lt;/p&gt;

&lt;p&gt;This is due to no table name being specified for the mappedSuperclass. (But this tableName is accessed in SqlWalker.php ll. 718. Be aware that there&apos;s the mappedSuperclass in use, &lt;b&gt;NOT&lt;/b&gt; the class B!)&lt;/p&gt;

&lt;p&gt;I&apos;m not quite sure how this should be handled. At least, not specifying the relation in the mappedSuperclass but moving it to each of the yml-files of A and B solves this problem. (But unneccessarily complicates things?)&lt;/p&gt;

&lt;p&gt;I will push a test case to my repo.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11591">DDC-671</key>
            <summary>Table aliases wrongly computed with YAML + mappedsuperclasses and joins</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Jul 2010 14:17:38 +0000</created>
                <updated>Sun, 31 Oct 2010 02:40:37 +0000</updated>
                    <resolved>Tue, 21 Sep 2010 18:20:32 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13528" author="shurakai" created="Tue, 6 Jul 2010 14:21:55 +0000"  >&lt;p&gt;A testcase is now available in my repo: &lt;a href=&quot;http://github.com/Shurakai/doctrine2/tree/DDC-671&quot; class=&quot;external-link&quot;&gt;http://github.com/Shurakai/doctrine2/tree/DDC-671&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13827" author="jwage" created="Sat, 7 Aug 2010 08:58:45 +0000"  >&lt;p&gt;According to the docs: &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/inheritance-mapping/en#inheritance-mapping&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/inheritance-mapping/en#inheritance-mapping&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&quot;A mapped superclass cannot be an entity, it is not queryable and persistent relationships defined by a mapped superclass must be unidirectional. For further support of inheritance, the single or joined table inheritance features have to be used.&quot;&lt;/p&gt;</comment>
                    <comment id="13839" author="beberlei" created="Sun, 8 Aug 2010 05:51:41 +0000"  >&lt;p&gt;I agree with Jon, this is not an issue.&lt;/p&gt;

&lt;p&gt;I dont understand at all what this has to do with XML, YAML or Annotations?&lt;/p&gt;</comment>
                    <comment id="13915" author="shurakai" created="Wed, 11 Aug 2010 11:32:44 +0000"  >&lt;p&gt;Jonathan: Thanks for your comment, but that does not seem to fit the problem. As you can see within my testcase, the mapped superclass defines a relationship (manyToOne) which is unidirectional.&lt;/p&gt;

&lt;p&gt;Benjamin: The problem is, that this specific feature works with annotations, but not with YAML.&lt;/p&gt;</comment>
                    <comment id="13916" author="jwage" created="Wed, 11 Aug 2010 13:15:06 +0000"  >&lt;p&gt;When I look at your test I see you have association on the mapper super class side as well as on Directory side. That looks bidirectional, no?&lt;/p&gt;</comment>
                    <comment id="13950" author="beberlei" created="Sun, 15 Aug 2010 13:30:12 +0000"  >&lt;p&gt;@jwage he is specifiying a directory or page on the OneToMany side, so this looks ok.&lt;/p&gt;

&lt;p&gt;@Christian: Why do you specified a table attribute on the mapped superclass? That doesnt make sense. The mapping looks correct, can you please show the error message? ADditionally can you link the correct line in SQL Walker again? The lines moved, so i cant verify what 718 is anymore, it changed.&lt;/p&gt;</comment>
                    <comment id="14360" author="shurakai" created="Mon, 13 Sep 2010 10:09:50 +0000"  >&lt;p&gt;Benjamin: I removed the table attribute on the mapped superclass. I don&apos;t know why it was in there.&lt;/p&gt;

&lt;p&gt;Some more information: &lt;/p&gt;

&lt;p&gt;The parentDirectory is currently in the mappedSuperclass. However, if you try to join it this way, the source entity used in SqlWalker::walkJoinVariableDeclarationwill look 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-quote&quot;&gt;&quot;sourceEntity&quot;&lt;/span&gt;]=&amp;gt;
  string(46) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Tests\ORM\Mapping\AbstractContentItem&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which is actually the mappingSuperclass.&lt;/p&gt;

&lt;p&gt;That said, Doctrine will try to get an alias for AbstractContentItem (l. 730 SqlWalker), which does not exist at that point. Thus, it will create a new one (in my case: a2). &lt;/p&gt;

&lt;p&gt;You can see the result in the query below. Note that a2 is only used, but never declared.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;SELECT c0_.id AS id0, c0_.extension AS extension1, c0_.parent_directory_id AS parent_directory_id2 FROM core_content_pages c0_ INNER JOIN core_content_directories c1_ ON a2_.parent_directory_id = c1_.id WHERE (c1_.url = ?) AND (c0_.extension = ?)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;It might be that l. 730 currently passes a wrong argument (mappedSuperclass instead of entity-in-use) or that there is some error in the yaml driver? As I&apos;m unfortunately not too familiar with this process, I need your oppinions to fix this issue. It would be interesting to know where the &lt;/p&gt;

&lt;div class=&quot;code panel&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;_queryComponents[$joinedDqlAlias][&apos;relation&apos;]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; array is getting filled.&lt;/p&gt;</comment>
                    <comment id="14436" author="beberlei" created="Tue, 21 Sep 2010 16:56:20 +0000"  >&lt;p&gt;This is actually wrong for Annotations and XML Driver also, the problem is shown by this assertions and test-failures in combination with your 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;        $classPage = $em-&amp;gt;getClassMetadata(&apos;Doctrine\Tests\ORM\Mapping\Page&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(&apos;Doctrine\Tests\ORM\Mapping\Directory&apos;, $classPage-&amp;gt;associationMappings[&apos;parentDirectory&apos;][&apos;sourceEntity&apos;]);
        $classDirectory = $em-&amp;gt;getClassMetadata(&apos;Doctrine\Tests\ORM\Mapping\Page&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(&apos;Doctrine\Tests\ORM\Mapping\Directory&apos;, $classDirectory-&amp;gt;associationMappings[&apos;parentDirectory&apos;][&apos;sourceEntity&apos;]);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Failure.&lt;/p&gt;

&lt;div class=&quot;code panel&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\Mapping\YamlMappingDriverTest::testJoinTablesWithMappedSuperclassForYamlDriver
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-Doctrine\Tests\ORM\Mapping\Directory
+Doctrine\Tests\ORM\Mapping\AbstractContentItem

/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php:33

2) Doctrine\Tests\ORM\Mapping\AnnotationDriverTest::testJoinTablesWithMappedSuperclassForAnnotationDriver
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-Doctrine\Tests\ORM\Mapping\Directory
+Doctrine\Tests\ORM\Mapping\AbstractContentItem
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14438" author="beberlei" created="Tue, 21 Sep 2010 18:20:32 +0000"  >&lt;p&gt;This works with annotations because the annotation reader also reads properties from parent classes.&lt;/p&gt;

&lt;p&gt;For YAML and XML this did not work and required a little change in the ClassMetadataFactory method that copied over inherited metadata.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12011">DDC-841</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-758] When merging many to many entites back into the repository changes to the associations are not respected</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-758</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging a DETACHED entity into the repository with ManyToMany associations that have changed since the last flush, the join table is not updated with the new associations.&lt;/p&gt;

&lt;p&gt;Many Movies have many Artists with cascade merge:&lt;/p&gt;

&lt;div class=&quot;code panel&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;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;merge&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;&amp;lt;?php
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;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;merge&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;br/&gt;
Artist: id=2, name=&quot;Artist 2&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 now want to merge a detched version of a movie into the repository, with an extra relationship between Movie 1 and Artist 2:&lt;/p&gt;

&lt;div class=&quot;code panel&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);

&lt;span class=&quot;code-comment&quot;&gt;// Add the &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; association
&lt;/span&gt;$m1-&amp;gt;artists-&amp;gt;add($a2); $a2-&amp;gt;movies-&amp;gt;add($m1);

&lt;span class=&quot;code-comment&quot;&gt;// This is a cascade merge so it will merge the entities down the tree
&lt;/span&gt;$m1 = $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, plus the extra association between Movie 1 and Artist 2, so after a flush() movie_artist should contain (1,1),(1,2)&lt;/p&gt;

&lt;p&gt;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;but movie_artist remains unchanged (still just (1,1)) and $em-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets() is empty before the flush().&lt;/p&gt;

&lt;p&gt;The same behaviour is exhibited when merging $m1 after deleting entities from its many-to-many associations; movie_artist does not change.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11802">DDC-758</key>
            <summary>When merging many to many entites back into the repository changes to the associations are not respected</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Aug 2010 06:36:50 +0000</created>
                <updated>Sun, 31 Oct 2010 02:35:36 +0000</updated>
                    <resolved>Sun, 31 Oct 2010 02:35:36 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14353" author="ccapndave" created="Mon, 13 Sep 2010 05:27:15 +0000"  >&lt;p&gt;Here is a failing test case for this issue.&lt;/p&gt;</comment>
                    <comment id="14359" author="ccapndave" created="Mon, 13 Sep 2010 07:55:24 +0000"  >&lt;p&gt;The problem area seems to be in the first lines of UnitOfWork::computeAssociationChanges:&lt;/p&gt;

&lt;div class=&quot;code panel&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; ($value &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; PersistentCollection &amp;amp;&amp;amp; $value-&amp;gt;isDirty()) {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($assoc[&apos;isOwningSide&apos;]) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;collectionUpdates[] = $value;
            }
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;visitedCollections[] = $value;
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I comment out the check for $value-&amp;gt;isDirty() then the test case passes so it looks like this is failing because the ManyToMany PersistentCollection isn&apos;t getting marked as dirty during computeChangeSets.  I&apos;ve actually fiddled around and found various ways to fix it, but computeChangeSets is pretty complicated and I&apos;m worried that any changes I make might affect performance without me realizing.  However, if you can give me a few pointers I&apos;m happy to have another go at patching the issue.&lt;/p&gt;</comment>
                    <comment id="14429" author="ccapndave" created="Tue, 21 Sep 2010 10:06:02 +0000"  >&lt;p&gt;As it turns out commenting out $value-&amp;gt;isDirty() only half fixes the problem; it fixes it in the case of &lt;b&gt;adding&lt;/b&gt; many to many associations (as in the example about), but it doesn&apos;t fix the case of &lt;b&gt;removing&lt;/b&gt; many to many associations.&lt;/p&gt;

&lt;p&gt;I have updated the attached test to include a test case which creates some many to many associations, then merges in equivalent detached entities but which have empty association attributes.  On a cascade merge and flush I would expect this to empty out the associations table; in fact it has no effect.&lt;/p&gt;</comment>
                    <comment id="14430" author="beberlei" created="Tue, 21 Sep 2010 10:44:36 +0000"  >&lt;p&gt;removing $value-&amp;gt;isDirty() is no option as it is really necessary at that position. The question is, why does merge not mark the collection as dirty.&lt;/p&gt;</comment>
                    <comment id="14432" author="ccapndave" created="Tue, 21 Sep 2010 10:57:10 +0000"  >&lt;p&gt;Agreed.  I am hard at work on this right now, and have discovered something that may be another clue.  It actually seems the problem is twofold.  As well as the collection not getting marked dirty, the reason that the ManyToManyPersister is not removing rows is that &lt;b&gt;PersistentCollection::getDeleteDiff()&lt;/b&gt; isn&apos;t returning any differences, and the reason for that is that $snapshot isn&apos;t get set to anything during the merge process.  When merging a collection I think we need to set $snapshot to whatever is currently in the database, and set $coll to whatever is in the collection being merged.  I&apos;m not quite sure, but perhaps this could also be the reason why the collection isn&apos;t getting set as dirty?&lt;/p&gt;</comment>
                    <comment id="14440" author="ccapndave" created="Tue, 21 Sep 2010 18:29:19 +0000"  >&lt;p&gt;This is an attempt to patch the issue.  After each cascade merge this fills in $snapshot from the database.&lt;/p&gt;</comment>
                    <comment id="14441" author="ccapndave" created="Tue, 21 Sep 2010 18:43:40 +0000"  >&lt;p&gt;Slightly changed the patch - this uses setDirty() instead of changed() - without this a Flextrine test fails.&lt;/p&gt;</comment>
                    <comment id="14628" author="beberlei" created="Sun, 31 Oct 2010 02:35:36 +0000"  >&lt;p&gt;Fixed, can you verify Dave?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10810" name="0147-DDC-758.patch" size="2085" author="ccapndave" created="Tue, 21 Sep 2010 18:43:40 +0000" />
                    <attachment id="10807" name="DDC758Test.php" size="5717" author="ccapndave" created="Tue, 21 Sep 2010 10:05:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-666] @ManyToMany JoinTable defaults - Allow only table name</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-666</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently you cannot only speciify the table name and rely on the mapping to figure out the foreign key names.&lt;/p&gt;

&lt;p&gt;The following should be possible:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ManytoMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Foo&quot;&lt;/span&gt;)
 * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foo_bar_table&quot;&lt;/span&gt;)
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11582">DDC-666</key>
            <summary>@ManyToMany JoinTable defaults - Allow only table name</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Jul 2010 07:49:12 +0000</created>
                <updated>Sun, 31 Oct 2010 00:42:03 +0000</updated>
                    <resolved>Sun, 31 Oct 2010 00:42:03 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13823" author="romanb" created="Sat, 7 Aug 2010 07:19:47 +0000"  >&lt;p&gt;Scheduling for 2.1 for now.&lt;/p&gt;</comment>
                    <comment id="14625" author="romanb" created="Sat, 30 Oct 2010 15:43:09 +0000"  >&lt;p&gt;I think this is fixed already?&lt;/p&gt;</comment>
                    <comment id="14626" author="beberlei" created="Sun, 31 Oct 2010 00:42:03 +0000"  >&lt;p&gt;Yes, closed&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-732] Class Table Inheritance - wrong table order on insert  with more than one level of inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-732</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is the error that i get when i try to create new entity Employee&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$newEmployee = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Users_Entity_Model_Employee;
&lt;span class=&quot;code-comment&quot;&gt;//here i set the data
&lt;/span&gt;.....

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

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`crm/Employees`, CONSTRAINT `employee_person` FOREIGN KEY (`contactID`) REFERENCES `Persons` (`contactID`) ON DELETE NO ACTION ON UPDATE NO ACTION)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 *
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Contacts&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;contactType&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;Users_Model_Entity_Person&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;COMPANY&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Users_Model_Entity_Company&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;Users_Model_Entity_Employee&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;FIRM&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Users_Model_Entity_Firm&quot;&lt;/span&gt;})
 */
class Users_Model_Entity_Contacts 
{


	/**
	 *  @Id  @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;contactID&quot;&lt;/span&gt;, 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;protected&lt;/span&gt; $contactID;

	&lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;
}

/**
 *
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Persons&quot;&lt;/span&gt;)
 * @entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Users_Model_PersonRepo&quot;&lt;/span&gt;)


 */
class Users_Model_Entity_Person &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Users_Model_Entity_Contacts
{
 &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;}




/**
 *
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Employees&quot;&lt;/span&gt;)
 * @entity
 */
class Users_Model_Entity_Employee &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Users_Model_Entity_Person
{
	&lt;span class=&quot;code-comment&quot;&gt;// .....
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11730">DDC-732</key>
            <summary>Class Table Inheritance - wrong table order on insert  with more than one level of inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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>Fri, 6 Aug 2010 08:11:14 +0000</created>
                <updated>Sat, 30 Oct 2010 12:17:02 +0000</updated>
                    <resolved>Sat, 30 Oct 2010 12:17:02 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13794" author="vigor_bg" created="Fri, 6 Aug 2010 08:15:24 +0000"  >&lt;p&gt;I managed to fix it but i am not sure that this is the wright solution. The problem is in the&lt;br/&gt;
Doctrine\ORM\Persisters\JoinedSubclassPersister in the function executeInserts()&lt;/p&gt;
&lt;div class=&quot;code panel&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; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_queuedInserts) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&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;_class-&amp;gt;isVersioned) {
            $versionedClass = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getVersionedClassMetadata();
        }

        $postInsertIds = array();
        $idGen = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;idGenerator;
        $isPostInsertId = $idGen-&amp;gt;isPostInsertGenerator();

        &lt;span class=&quot;code-comment&quot;&gt;// Prepare statement &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the root table
&lt;/span&gt;        $rootClass = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;name == $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;rootEntityName ?
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class : $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;rootEntityName);
        $rootPersister = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityPersister($rootClass-&amp;gt;name);
        $rootTableName = $rootClass-&amp;gt;table[&apos;name&apos;];
        $rootTableStmt = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;prepare($rootPersister-&amp;gt;_getInsertSQL());

        &lt;span class=&quot;code-comment&quot;&gt;// Prepare statements &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; sub tables.
&lt;/span&gt;        $subTableStmts = array();
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($rootClass !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class) {
            $subTableStmts[$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;table[&apos;name&apos;]] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;prepare($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getInsertSQL());
        }
        foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;parentClasses as $parentClassName) {
            $parentClass = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($parentClassName);
            $parentTableName = $parentClass-&amp;gt;table[&apos;name&apos;];
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($parentClass !== $rootClass) {
                $parentPersister = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityPersister($parentClassName);
                $subTableStmts[$parentTableName] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;prepare($parentPersister-&amp;gt;_getInsertSQL());
            }
        }


        &lt;span class=&quot;code-comment&quot;&gt;// Execute all inserts. For each entity:
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;// 1) Insert on root table
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;// 2) Insert on sub tables
&lt;/span&gt;        foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_queuedInserts as $entity) {
        	$insertData = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_prepareInsertData($entity);

            &lt;span class=&quot;code-comment&quot;&gt;// Execute insert on root table
&lt;/span&gt;            $paramIndex = 1;
            foreach ($insertData[$rootTableName] as $columnName =&amp;gt; $value) {
                $rootTableStmt-&amp;gt;bindValue($paramIndex++, $value, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_columnTypes[$columnName]);
            }
            $rootTableStmt-&amp;gt;execute();

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($isPostInsertId) {
                $id = $idGen-&amp;gt;generate($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em, $entity);
                $postInsertIds[$id] = $entity;
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                $id = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($entity);
            }
            
            /**
             * Here is the fix that i made
             */
           $subTableStmts = array_reverse($subTableStmts);
            /**
             * end 
             */
           
            &lt;span class=&quot;code-comment&quot;&gt;// Execute inserts on subtables.
&lt;/span&gt;            &lt;span class=&quot;code-comment&quot;&gt;// The order doesn&apos;t matter because all child tables link to the root table via FK.
&lt;/span&gt;            foreach ($subTableStmts as $tableName =&amp;gt; $stmt) {
                $data = isset($insertData[$tableName]) ? $insertData[$tableName] : array();
                $paramIndex = 1;
                foreach ((array) $id as $idVal) {
                    $stmt-&amp;gt;bindValue($paramIndex++, $idVal);
                }
                foreach ($data as $columnName =&amp;gt; $value) {
                    $stmt-&amp;gt;bindValue($paramIndex++, $value, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_columnTypes[$columnName]);
                }
                $stmt-&amp;gt;execute();
            }
        }

        $rootTableStmt-&amp;gt;closeCursor();
        foreach ($subTableStmts as $stmt) {
            $stmt-&amp;gt;closeCursor();
        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($versionedClass)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_assignDefaultVersionValue($versionedClass, $entity, $id);
        }

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_queuedInserts = array();

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $postInsertIds;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the order of the queue for insert was not correct.&lt;/p&gt;</comment>
                    <comment id="13835" author="beberlei" created="Sun, 8 Aug 2010 05:11:46 +0000"  >&lt;p&gt;thanks for the report, but posting large bunches of changed code isnt very helpful. You should post patches/diffs instead using &quot;git diff&quot; or &quot;diff&quot; against the original file.&lt;/p&gt;

&lt;p&gt;I checked your patch and it cannot be right, you check the reverse inside the loop each time. Without a failing test-case i cant do anything here, i will look into it in more detail later.&lt;/p&gt;</comment>
                    <comment id="13872" author="vigor_bg" created="Mon, 9 Aug 2010 04:20:39 +0000"  >&lt;p&gt;Hi there sorry for that you are wright the reverse should be before the foreach. I will prepare the test- case and post it a bit later.&lt;/p&gt;</comment>
                    <comment id="13873" author="vigor_bg" created="Mon, 9 Aug 2010 06:23:28 +0000"  >&lt;p&gt;This is the database and the test case for inserting data and we have Class Table Inheritance. the problematic ones are &lt;/p&gt;
&lt;div class=&quot;code panel&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 testInsertInheritedTwo(){ } &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;  and &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testInsertInheritedThree(){ } &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13874" author="vigor_bg" created="Mon, 9 Aug 2010 06:33:14 +0000"  >&lt;p&gt;Also i just updated to BETA3 and found one more problem in /Doctrine/DBAL/Statement.php in the &apos;function execute&apos; on line 126.  $this-&amp;gt;_params = array(); This bit of code is braking the insert statements. Because it clears the currently bound parameters. Hope that is all the info you need if there is more information that is required please let me know.&lt;/p&gt;</comment>
                    <comment id="14142" author="beberlei" created="Sun, 29 Aug 2010 07:33:49 +0000"  >&lt;p&gt;What database and driver are you using? All three tests pass for me&lt;/p&gt;</comment>
                    <comment id="14175" author="beberlei" created="Mon, 30 Aug 2010 16:27:00 +0000"  >&lt;p&gt;can you please use the SQL generated from Doctrine Schema-Tool and try again if this issue occurs to you? You have generated your own SQL, this might be the issue.&lt;/p&gt;</comment>
                    <comment id="14192" author="vigor_bg" created="Tue, 31 Aug 2010 08:39:19 +0000"  >&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;I will try with the sql generated by Doctrine. But the problem I got was when I have more than 2 levels of the inheritance hierarchy. When try to make an insert trough the lowest level (in my example the DDC732Driver. Actually it was not working with the DDC732Employee entity as well) the order of inserting was not correct. First it went trough the correct entity (in my example the DDC732Contacts), but then instead of going through DDC732Person it try to go trough the last level (DDC732Driver or DDC732Employee depending on the example). And then the MySql said that it can not go trough. Also maybe the reason is that I am using InnoDB, but then it shouldn&apos;t really matter because I thought that the hierarchy inheritance is supposed to work with it. Actually I am almost 100% sure the problem is in the InnoDB could you please try with it. If it is still working for you i will reexamine my application and find the mistake.&lt;/p&gt;

&lt;p&gt;Thanks in advance for the help and sorry. Now on second thought I should have explained all that in the beginning. &lt;/p&gt;</comment>
                    <comment id="14390" author="beberlei" created="Wed, 15 Sep 2010 16:21:31 +0000"  >&lt;p&gt;Doctrine2 only creates InnoDB tables. Are you using foreign keys in a different way?&lt;/p&gt;</comment>
                    <comment id="14439" author="beberlei" created="Tue, 21 Sep 2010 18:29:08 +0000"  >&lt;p&gt;Closed because we can&apos;t reproduce this. Schema of the user differs from the ORM SchemaTool and causes this issue.&lt;/p&gt;</comment>
                    <comment id="14552" author="vigor_bg" created="Mon, 11 Oct 2010 08:55:05 +0000"  >&lt;p&gt;Hi there i am reopening this ticket, because i found problem with the logic of creating inherited join tables from your create schema tool. I was expecting when we have more than one level of inherited tables the foreign key constrain to go to the parent and not to the root table. And because of that with the sql generated from your tool it was ok and it was not working with my sql. I would like to know are you going to fix that or it was intended to work that way from the beginning? Because logically for me and my colleagues if Employee extends Person then the foreign key constrain in Employee should go to Person and at the same time Person extends Contact then foreign key constrain in Person should go to Contact. And with your schema tool in that instance the foreign key constrain in Employee go to Contact which is wrong.&lt;/p&gt;</comment>
                    <comment id="14621" author="beberlei" created="Sat, 30 Oct 2010 12:17:02 +0000"  >&lt;p&gt;This is a documentation issue.&lt;/p&gt;

&lt;p&gt;I have now documented the SQL schema requirements for inheritance scenarios.&lt;/p&gt;

&lt;p&gt;Closing this issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10730" name="DDC732Test.php" size="3605" author="vigor_bg" created="Mon, 9 Aug 2010 06:23:28 +0000" />
                    <attachment id="10729" name="testDoc.sql" size="2858" author="vigor_bg" created="Mon, 9 Aug 2010 06:23:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-787] Camelcase tablename lost when creating models based on the database </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-787</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a table articleLocale and I created the model with the doctrine tool using the following command: # doctrine orm:convert-mapping --from-database annotation temp.&lt;/p&gt;

&lt;p&gt;The model that was created was Articlelocale instead of ArticleLocale and the annotations were 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;&amp;lt;?php
/**
 * Articlelocale
 *
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;articlelocale&quot;&lt;/span&gt;)
 * @Entity
 */
class Articlelocale
{
&lt;span class=&quot;code-comment&quot;&gt;//....
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When trying to fetch some data, I get the following error: 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;doctrine.articlelocale&apos; doesn&apos;t exist &lt;br/&gt;
If i change the annotation so that it reads articleLocale instead of articlelocale it works like it should be working.&lt;/p&gt;

&lt;div class=&quot;code panel&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
/**
 * Articlelocale
 *
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;articleLocale&quot;&lt;/span&gt;)
 * @Entity
 */
class Articlelocale
{
&lt;span class=&quot;code-comment&quot;&gt;//....
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So there is a problem with camelCase table names.&lt;/p&gt;</description>
                <environment>Ubuntu&lt;br/&gt;
MySQL 5.1&lt;br/&gt;
</environment>
            <key id="11879">DDC-787</key>
            <summary>Camelcase tablename lost when creating models based on the database </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="tbo">Van Hauwaert Bert</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Sep 2010 12:41:43 +0000</created>
                <updated>Sat, 30 Oct 2010 06:35:33 +0000</updated>
                    <resolved>Sat, 30 Oct 2010 06:35:33 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14617" author="beberlei" created="Sat, 30 Oct 2010 06:35:33 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-711] Compatibility with Codeigniter 1.7.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-711</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Following the instructions in the website did not succeed with the configuration (Doctrine.php) file. Seems that there is a problem with the namespaces (the Doctrine folder is placed in \application\libraries folder of the Codeigniter structure) and the application cannot find its clases.&lt;/p&gt;</description>
                <environment>Codeigniter 1.7.2 framework</environment>
            <key id="11664">DDC-711</key>
            <summary>Compatibility with Codeigniter 1.7.2</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="odisey">Deyan Yankov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 13:39:38 +0000</created>
                <updated>Sat, 30 Oct 2010 06:08:40 +0000</updated>
                    <resolved>Sat, 30 Oct 2010 06:08:40 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13646" author="beberlei" created="Wed, 21 Jul 2010 15:27:28 +0000"  >&lt;p&gt;Can you come up with a solution? This recipe is not written by the Doctrine team, we don&apos;t have any skills in Code Igniter&lt;/p&gt;</comment>
                    <comment id="13688" author="odisey" created="Sat, 24 Jul 2010 13:47:55 +0000"  >&lt;p&gt;Finally succeeded to start up Doctrine with Codeigniter. Attached is the configuration Library file for CI.&lt;/p&gt;
</comment>
                    <comment id="14616" author="beberlei" created="Sat, 30 Oct 2010 06:08:40 +0000"  >&lt;p&gt;Added note to the manual.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10707" name="Doctrine.php" size="2180" author="odisey" created="Sat, 24 Jul 2010 13:47:55 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-830] Missing prefix \ to switch to global space in Tools/EntityGenerator</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-830</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If generated entity isn&apos;t in global namespace and extends class, name of extended class has to have prefix \ to switch to global namespace.&lt;/p&gt;

&lt;p&gt;Fix: class Doctrine\ORM\Tools\EntityGenerator&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;Doctrine/ORM/Tools/EntityGenerator.php&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-keyword&quot;&gt;private&lt;/span&gt; function _getClassToExtendName()
{
    $refl = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \ReflectionClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getClassToExtend());

    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;\\&apos; . $refl-&amp;gt;getName();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11984">DDC-830</key>
            <summary>Missing prefix \ to switch to global space in Tools/EntityGenerator</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Oct 2010 05:14:24 +0000</created>
                <updated>Sat, 30 Oct 2010 03:17:12 +0000</updated>
                    <resolved>Sat, 30 Oct 2010 03:17:12 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14615" author="beberlei" created="Sat, 30 Oct 2010 03:17:12 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-767] Updating many-to-many relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-767</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have an entity with a many-to-many relation.&lt;/p&gt;

&lt;p&gt;When I delete all relations and then flush, add new relations and then flush, all inside one transaction, I get&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function update() on a non-object in Doctrine/ORM/UnitOfWork.php on line 312&lt;/p&gt;

&lt;div class=&quot;code panel&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;// Delete old categories
&lt;/span&gt;        foreach ($revision-&amp;gt;getCategories() as $category) {
            $revision-&amp;gt;removeCategory($category);
        }

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;flush();

        &lt;span class=&quot;code-comment&quot;&gt;// Add &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;
&lt;/span&gt;        foreach ($categories as $categoryId) {
            $category = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;find(&apos;Category&apos;, $categoryId);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($category &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Category) {
                $revision-&amp;gt;addCategory($category);
            }
        }

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&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;Revision::getCategories()&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-keyword&quot;&gt;return&lt;/span&gt; ArrayCollection
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getCategories()
    {
        &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;categories;
    }
&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;Revision::addCategory()&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * @param Category $category
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Revision
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addCategory(Category $category)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;categories-&amp;gt;add($category);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Revision::removeCategory()&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * @param Category $category
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Revision
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeCategory(Category $category)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;categories-&amp;gt;removeElement($category);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If this is not a bug, I&apos;d like to know which is the most efficient and elegant way to update many-to-many relationships.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11825">DDC-767</key>
            <summary>Updating many-to-many relations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ambis">Matti Niemel&#228;</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 16:03:23 +0000</created>
                <updated>Sat, 30 Oct 2010 01:48:26 +0000</updated>
                    <resolved>Sat, 30 Oct 2010 01:47:54 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14068" author="ambis" created="Wed, 25 Aug 2010 16:21:30 +0000"  >&lt;p&gt;When I add at least one relation between Revision and Category (directly into the db) everything works just as expected. I can add more and delete old. But as soon as all relations are deleted, this problem occurs.&lt;/p&gt;</comment>
                    <comment id="14069" author="ambis" created="Wed, 25 Aug 2010 17:12:18 +0000"  >&lt;p&gt;I changed Revision::removeCategory() to Revision::removeCategories() which calls -&amp;gt;clear() on the ArrayColleciton. This didn&apos;t have any effect.&lt;/p&gt;

&lt;p&gt;I also created a WHERE IN-query for the new categories to optimize the code a bit.&lt;/p&gt;</comment>
                    <comment id="14238" author="ambis" created="Thu, 2 Sep 2010 11:11:11 +0000"  >&lt;p&gt;After updating to BETA4, the error message has changed:&lt;/p&gt;

&lt;p&gt;Catchable fatal error: Argument 1 passed to Doctrine\ORM\UnitOfWork::getCollectionPersister() must be an array, null given, called in /usr/local/zend/share/pear/Doctrine/ORM/UnitOfWork.php on line 297 and defined in /usr/local/zend/share/pear/Doctrine/ORM/UnitOfWork.php on line 2131 &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * @param Revision $revision
     * @param array $categories
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Revision
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function updateRevisionCategories(Revision $revision, array $categories)
    {
        &lt;span class=&quot;code-comment&quot;&gt;// Delete old categories
&lt;/span&gt;        $revision-&amp;gt;removeCategories();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;flush();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($categories)) {
            &lt;span class=&quot;code-comment&quot;&gt;// Query and add &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ones
&lt;/span&gt;            $qb = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;createQueryBuilder();

            $qb-&amp;gt;select(&apos;category&apos;)
               -&amp;gt;from(&apos;Category&apos;, &apos;category&apos;)
               -&amp;gt;where($qb-&amp;gt;expr()-&amp;gt;in(&apos;category.id&apos;, $categories));

            $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;createQuery($qb);

            foreach ($query-&amp;gt;getResult() as $category) {
                $revision-&amp;gt;addCategory($category);
            }

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;flush();
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $revision;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14388" author="beberlei" created="Wed, 15 Sep 2010 16:12:22 +0000"  >&lt;p&gt;I committed a testcase with your scenario that shows it works. It seems there is something wrong with your entity code, can you show more? Or try to make tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/810a129a3273a3826ecedb4b744a55e33a54a3ff&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/810a129a3273a3826ecedb4b744a55e33a54a3ff&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14511" author="ambis" created="Sat, 2 Oct 2010 11:24:23 +0000"  >&lt;p&gt;Yeah I just now noticed you were using em-&amp;gt;clear() there.&lt;/p&gt;

&lt;p&gt;I got all things working after I started using:&lt;/p&gt;

&lt;p&gt;entity-&amp;gt;removeCategories()&lt;/p&gt;

&lt;p&gt;em-&amp;gt;flush()&lt;br/&gt;
em-&amp;gt;clear()&lt;/p&gt;

&lt;p&gt;entity = em-&amp;gt;merge(entity)&lt;/p&gt;

&lt;p&gt;Is ther something inherintly wrong here? I wouldn&apos;t want to reload the entity because 1) I would neet to hit the db and 2) all the relations might not come along which are already loaded for it when first obtained before.&lt;/p&gt;</comment>
                    <comment id="14512" author="ambis" created="Sat, 2 Oct 2010 12:24:06 +0000"  >&lt;p&gt;All was good up until I realized that using the em-&amp;gt;merge(entity) breaks the object reference.&lt;/p&gt;

&lt;p&gt;I do things much 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;$entity = loadById($id)
beginTransaction()
&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
service-&amp;gt;doStuff($entity, $data) 
otherService-&amp;gt;doOtherStuff($entity, $data)
commit()
} &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; ...&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, when I have to merge the entity inside the doStuff() service method, the managed object is not the same object doOtherStuff gets.&lt;/p&gt;

&lt;p&gt;So, what I&apos;ve gathered is that a PersistentCollection cannot be cleared, flushed, re-populated and then flushed again without things breaking catastrophically (see my 3rd comment for the error I get).&lt;/p&gt;

&lt;p&gt;I&apos;d like to see your test case work without clearing the entity manager at any point.&lt;/p&gt;

&lt;p&gt;Or at least I&apos;d love to hear the reasoning behind the clearing process if it truly is required.&lt;/p&gt;</comment>
                    <comment id="14513" author="ambis" created="Sat, 2 Oct 2010 16:58:26 +0000"  >&lt;p&gt;Here is a test which fails with the following error and is 1:1 to my case:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Argument 1 passed to Doctrine\ORM\UnitOfWork::getCollectionPersister() must be an array, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; given, called in doctrine2/lib/Doctrine/ORM/UnitOfWork.php on line 302 and defined&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Full trace in my app:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;exception &apos;ErrorException&apos; with message &apos;Argument 1 passed to Doctrine\ORM\UnitOfWork::getCollectionPersister() must be an array, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; given, called in /usr/local/zend/share/pear/Doctrine/ORM/UnitOfWork.php on line 302 and defined&apos; in /usr/local/zend/share/pear/Doctrine/ORM/UnitOfWork.php:2131
Stack trace:
#0 /usr/local/zend/share/pear/Doctrine/ORM/UnitOfWork.php(2131): ***_ErrorHandler::handleError(4096, &apos;Argument 1 pass...&apos;, &apos;/usr/local/zend...&apos;, 2131, Array)
#1 /usr/local/zend/share/pear/Doctrine/ORM/UnitOfWork.php(302): Doctrine\ORM\UnitOfWork-&amp;gt;getCollectionPersister(NULL)
#2 /usr/local/zend/share/pear/Doctrine/ORM/EntityManager.php(320): Doctrine\ORM\UnitOfWork-&amp;gt;commit()
#3 ***/ImageGroupService.php(182): Doctrine\ORM\EntityManager-&amp;gt;flush()
#4 ***EntryUsercpController.php(104): ***ImageGroupService-&amp;gt;setImageGroupImages(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(***ImageGroup), Array, NULL)
#5 library/ZendFramework-1.10.8/library/Zend/Controller/Action.php(513): ***EntryUsercpController-&amp;gt;imagesAction()
#6 library/ZendFramework-1.10.8/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action-&amp;gt;dispatch(&apos;imagesAction&apos;)
#7 library/ZendFramework-1.10.8/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_Http), &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Zend_Controller_Response_Http))
#8 library/ZendFramework-1.10.8/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-&amp;gt;dispatch()
#9 library/ZendFramework-1.10.8/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&amp;gt;run()
#10 dev.sotavasara.net/published/index.php(26): Zend_Application-&amp;gt;run()
#11 {main} &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14514" author="ambis" created="Sat, 2 Oct 2010 16:58:56 +0000"  >&lt;p&gt;Please review attached test case.&lt;/p&gt;</comment>
                    <comment id="14613" author="beberlei" created="Sat, 30 Oct 2010 01:47:54 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-839&quot; title=&quot;Error when trying to update PersistentCollection&quot;&gt;&lt;del&gt;DDC-839&lt;/del&gt;&lt;/a&gt;, and fixed.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12009">DDC-839</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10820" name="DDC767AmbisTest.php" size="2230" author="ambis" created="Sat, 2 Oct 2010 16:58:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-839] Error when trying to update PersistentCollection</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-839</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is the error that i get :&lt;br/&gt;
&quot;Argument 1 passed to Doctrine\ORM\UnitOfWork::getCollectionPersister() must be an array, null given, called in /home/vis/projects/CRM/trunk/library/Doctrine/ORM/UnitOfWork.php on line 302 and defined at /home/vis/projects/CRM/trunk/library/Doctrine/ORM/UnitOfWork.php:2149&quot;&lt;/p&gt;

&lt;p&gt;This happens when i try to update Entity that have PersistentCollection but when i was creating the entity did not create entities to be attached to it by the PersistentCollection. Later on i called it and and used :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$collectionEntity = $em-&amp;gt;getRepository(&apos;CollectionEntityName&apos;)-&amp;gt;findOneBy($data);
$entity                   = $em-&amp;gt;getRepository(&apos;EntityName&apos;)-&amp;gt;findOneBy($entityData);
$entity-&amp;gt;getCollection()-&amp;gt;add($collectionEntity);
$em-&amp;gt;presist();
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12009">DDC-839</key>
            <summary>Error when trying to update PersistentCollection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="vigor_bg">victor Velkov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Oct 2010 05:09:53 +0000</created>
                <updated>Sat, 30 Oct 2010 01:47:23 +0000</updated>
                    <resolved>Fri, 29 Oct 2010 07:30:37 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14570" author="vigor_bg" created="Fri, 15 Oct 2010 05:15:35 +0000"  >&lt;p&gt;After some investigating i did find a solution that seems to work.&lt;br/&gt;
In Doctrine\ORM\UnitOfWork;&lt;br/&gt;
in the function computeChangeSet()&lt;/p&gt;

&lt;p&gt;from line 482&lt;/p&gt;
&lt;div class=&quot;code panel&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;// Look &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; changes in associations of the entity
&lt;/span&gt;        foreach ($class-&amp;gt;associationMappings as $field =&amp;gt; $assoc) {
            $val = $class-&amp;gt;reflFields[$field]-&amp;gt;getValue($entity);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($val !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {

           	/**
            	 * Fix done by Victor on 15.10.2010
            	 */
            	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($val &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; PersistentCollection) {
            		$val-&amp;gt;setOwner($entity, $assoc);
            	}
            	/**
            	 * End Fix
            	 */

                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;computeAssociationChanges($assoc, $val);

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

&lt;p&gt;That way i make sure that the owner for the PersistentCollection is set for sure and when it is called in the commit function it does not give errors.&lt;/p&gt;

&lt;p&gt;Hope that this solution will work for 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>
                    <comment id="14603" author="seldaek" created="Thu, 28 Oct 2010 18:19:21 +0000"  >&lt;p&gt;I hit the same issue, if a many-to-many&apos;s collection is empty (either at the firstr creation or if you clear()&apos;d it later on), and then you add() something to it and try to flush, it does not know its parent.&lt;/p&gt;

&lt;p&gt;Victor&apos;s fix has also been verified here. Not sure if it&apos;s the best way, but it&apos;s working. Please fix this asap because it&apos;s essentially preventing relations to be used for me. I had to resort to a ugly hack for the time being to always have one item in the association that is hidden..&lt;/p&gt;</comment>
                    <comment id="14604" author="beberlei" created="Fri, 29 Oct 2010 07:30:37 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11825">DDC-767</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-833] Internal Collection of a PersistentCollection is an Entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-833</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The creation of an Associated Collection of a Proxy Class is broken by 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;$reflField-&amp;gt;getValue($entity) ?: &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;$entity is a Proxy Class and the property is the field users. The function ReflectionProperty::getValue() will return an Entity User. This results that the internal collection of the PersistenCollection is an Entity. This 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;Fatal error: Call to undefined method Entity\User::clear() in \library\Doctrine\ORM\PersistentCollection.php on line 206
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is my Entity 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 Organization {
    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;organization&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;private&lt;/span&gt; $users;    

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

class User {
    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Organization&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;organization_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; $organization; 	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment># Windows Vista&lt;br/&gt;
# Apache 2.2.14&lt;br/&gt;
# MySQL 5.1.41 &lt;br/&gt;
# PHP 5.3.1&lt;br/&gt;
# Perl 5.10.1&lt;br/&gt;
# PHPUnit 3.5.0</environment>
            <key id="11987">DDC-833</key>
            <summary>Internal Collection of a PersistentCollection is an Entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="jeffreiffers">Jeff Reiffers</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Oct 2010 15:09:31 +0000</created>
                <updated>Mon, 11 Oct 2010 16:23:53 +0000</updated>
                    <resolved>Mon, 11 Oct 2010 16:23:53 +0000</resolved>
                            <version>2.0-RC1</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14554" author="beberlei" created="Mon, 11 Oct 2010 14:55:46 +0000"  >&lt;p&gt;Fixed formatting&lt;/p&gt;</comment>
                    <comment id="14555" author="beberlei" created="Mon, 11 Oct 2010 15:32:28 +0000"  >&lt;p&gt;I don&apos;t understand why this $reflField-&amp;gt;getValue() returns a user entity. It should only return either NULL or a collection.&lt;/p&gt;</comment>
                    <comment id="14556" author="beberlei" created="Mon, 11 Oct 2010 16:23:53 +0000"  >&lt;p&gt;fixed aswell as another nasty bug.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-834] EntityManager::getReference may return proxy for parent class when using class table inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-834</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using class table inheritance, it is possible for a parent class proxy to get saved into the identifier map.&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;/**
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;employee&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;customer&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Customer&quot;&lt;/span&gt;})
 */
class Person
{
   ...
}

/** @Entity */
class Employee &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Person
{
    ...
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getEmployeeNumber()
    ...
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following will fail:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$person = $entityManager-&amp;gt;getReference(&apos;Person&apos;, 1);  &lt;span class=&quot;code-comment&quot;&gt;// the identity map contains a PersonProxy with id 1
&lt;/span&gt;
...

$employee = $entityManger-&amp;gt;getReference(&apos;Employee&apos;, 1);  &lt;span class=&quot;code-comment&quot;&gt;// $employee is set to the PersonProxy object in the identity map
&lt;/span&gt;
...

$employee-&amp;gt;getEmployeeNumber();  &lt;span class=&quot;code-comment&quot;&gt;// error, PersonProxy object does not have a getEmployeeNumber method&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11990">DDC-834</key>
            <summary>EntityManager::getReference may return proxy for parent class when using class table inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="pschwisow">Patrick Schwisow</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Oct 2010 13:42:22 +0000</created>
                <updated>Mon, 11 Oct 2010 14:46:33 +0000</updated>
                    <resolved>Mon, 11 Oct 2010 14:46:33 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14553" author="beberlei" created="Mon, 11 Oct 2010 14:46:33 +0000"  >&lt;p&gt;Fixed this issue. Classes that have further entity subclasses CANNOT be loaded by reference. This is a technical requirement. Go live with it inheritance users &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;Also updated the docs:&lt;/p&gt;

&lt;div class=&quot;code panel&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 is a general performance consideration with Single and &lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; Table Inheritance: If you use a STI/CTI entity as
a many-to-one or one-to-one entity you should never use one of the classes at the upper levels of the
inheritance hierachy as &lt;span class=&quot;code-quote&quot;&gt;&quot;targetEntity&quot;&lt;/span&gt;, only those that have no subclasses. Otherwise Doctrine *CANNOT*
create proxy instances of &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; entity and will *ALWAYS* load the entity eagerly.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-831] Return value of getAssociationMapping in class Doctrine\ORM\Mapping\ClassMetadataInfo</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-831</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The problem is in the comment of function return value is Doctrine\ORM\Mapping\AssociationMapping. &lt;br/&gt;
My code expected to work with object of this type and normal situation is Fatal error: Call to a member function isOneToOne() on a non-object in /home/vis/projects/crm/trunk/library/Viscomp/Doctrine/Repository.php on line 371.&lt;/p&gt;

&lt;p&gt;In my mind I suppose is normal to return object of Doctrine\ORM\Mapping\AssociationMapping, because in comment return value have this type.&lt;/p&gt;

&lt;p&gt;I will be grateful if have fast answer because this is blocking issue for my project.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; /**
     * Gets the mapping of an association.
     *
     * @param string $fieldName  The field name that represents the association in
     *                           the object model.
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine\ORM\Mapping\AssociationMapping  The mapping.
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getAssociationMapping($fieldName)
    {
        &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;associationMappings[$fieldName])) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; MappingException::mappingNotFound($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name, $fieldName);
        }
        &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;associationMappings[$fieldName];
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11985">DDC-831</key>
            <summary>Return value of getAssociationMapping in class Doctrine\ORM\Mapping\ClassMetadataInfo</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="vigor_bg">victor Velkov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Oct 2010 08:16:21 +0000</created>
                <updated>Sun, 10 Oct 2010 11:13:35 +0000</updated>
                    <resolved>Sun, 10 Oct 2010 11:13:35 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14544" author="beberlei" created="Thu, 7 Oct 2010 08:45:32 +0000"  >&lt;p&gt;That is out of date, Association Mappings are now arrays. See the public $associationMappings definition how this array is structured.&lt;/p&gt;</comment>
                    <comment id="14547" author="vigor_bg" created="Fri, 8 Oct 2010 07:45:37 +0000"  >&lt;p&gt;Could you please change the comment of return value of this method.&lt;/p&gt;</comment>
                    <comment id="14549" author="beberlei" created="Sun, 10 Oct 2010 11:13:35 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-673] yaml metadata allows integer(X) types but ignores the X</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-673</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using the yaml mapping driver, it is possible (and in fact used by the yaml exporter) to have type: integer(X). doctrine never complains, however it always creates mysql int(11) fields regardless of the X. It should either cause an error at some point (like it does in the annotation driver according to romanb) or observe the X when creating the integer size.&lt;/p&gt;</description>
                <environment>Fedora 13, php 5.3.2, apache mysql etc.</environment>
            <key id="11596">DDC-673</key>
            <summary>yaml metadata allows integer(X) types but ignores the X</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="shurakai">Christian Heinrich</assignee>
                                <reporter username="gnat">Nathanael Noblet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Jul 2010 18:23:19 +0000</created>
                <updated>Wed, 6 Oct 2010 16:20:27 +0000</updated>
                    <resolved>Wed, 6 Oct 2010 16:20:27 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13595" author="shurakai" created="Sat, 17 Jul 2010 16:55:16 +0000"  >&lt;p&gt;I think we should throw an error in that case and change the yaml exporter to observe this rule.&lt;/p&gt;

&lt;p&gt;Roman, would that be okay? If so, I&apos;ll try to fix it before the next beta.&lt;/p&gt;</comment>
                    <comment id="13725" author="romanb" created="Wed, 28 Jul 2010 17:26:20 +0000"  >&lt;p&gt;Yes, I guess that would be fine.&lt;/p&gt;</comment>
                    <comment id="14541" author="beberlei" created="Wed, 6 Oct 2010 16:20:27 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10693" name="Account.dcm.yml" size="1593" author="gnat" created="Thu, 8 Jul 2010 11:55:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-798] Clarify param term in MEMBER OF example in DQL docs</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-798</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Current code example reads:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $em-&amp;gt;createQuery(&apos;SELECT u.id FROM CmsUser u WHERE :param MEMBER OF u.groups&apos;);
$ids = $query-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Maybe it&apos;s just me, but it was not immediately apparent that &lt;b&gt;:param&lt;/b&gt; is expected to be an identifier value from the CmsGroups entity (group ID number).   It may improve the example to rename &lt;b&gt;:param&lt;/b&gt; to &lt;b&gt;:groupId&lt;/b&gt; or add $query-&amp;gt;setParameter(&apos;:param&apos;, $groupId);&lt;/p&gt;</description>
                <environment></environment>
            <key id="11901">DDC-798</key>
            <summary>Clarify param term in MEMBER OF example in DQL docs</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 01:26:18 +0000</created>
                <updated>Thu, 30 Sep 2010 16:14:10 +0000</updated>
                    <resolved>Thu, 30 Sep 2010 16:14:10 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14323" author="romanb" created="Fri, 10 Sep 2010 14:08:23 +0000"  >&lt;p&gt;Its supposed to be an object, not an id, although an id might work too, I dont know.&lt;/p&gt;</comment>
                    <comment id="14325" author="mjh_ca" created="Fri, 10 Sep 2010 14:13:19 +0000"  >&lt;p&gt;Ok.  Well, a clarification of whatever is permitted there would improve the docs.  An id does seem to work.&lt;/p&gt;</comment>
                    <comment id="14504" author="beberlei" created="Thu, 30 Sep 2010 16:14:10 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-797] WHERE EXISTS example code doesn&apos;t make sense in docs</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-797</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Example for &quot;WHERE EXISTS&quot; in DQL section of docs currently reads:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $em-&amp;gt;createQuery(&apos;SELECT u.id FROM CmsUser u WHERE EXISTS (SELECT p.phonenumber FROM CmsPhonenumber p WHERE p.phonenumber = u.id)&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But, &lt;b&gt;p.phonenumber = u.id&lt;/b&gt; doesn&apos;t make sense - you&apos;re comparing the PK of a CmsPhoneNumber to a PK of a CmsUser.  I think it is supposed to be &lt;b&gt;p.user = u.id&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;$query = $em-&amp;gt;createQuery(&apos;SELECT u.id FROM CmsUser u WHERE EXISTS (SELECT p.phonenumber FROM CmsPhonenumber p WHERE p.user = u.id)&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also consider updating the test at Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php line 466 to match.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11900">DDC-797</key>
            <summary>WHERE EXISTS example code doesn&apos;t make sense in docs</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 01:15:09 +0000</created>
                <updated>Thu, 30 Sep 2010 16:05:57 +0000</updated>
                    <resolved>Thu, 30 Sep 2010 16:05:57 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14503" author="beberlei" created="Thu, 30 Sep 2010 16:05:57 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-822] Query with detached Entity as parameter fails to execute</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-822</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When dealing with detached entities, e.g. with the QueryCache, you cannot use these entities as parameters for other Query.&lt;/p&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;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;$em-&amp;gt;detach($user);
$query = $em-&amp;gt;createQuery(&apos;SELECT a FROM Address a WHERE a.User = ?1&apos;);
$query-&amp;gt;setParameter(1, $user); &lt;span class=&quot;code-comment&quot;&gt;// $user is detached&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As $user is detached, the EntityManager does not have its identifier, so Query::_doExecute fails. (There is a &quot;//TODO: Check that $value is MANAGED?&quot; line near the failing line).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11968">DDC-822</key>
            <summary>Query with detached Entity as parameter fails to execute</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 10:31:25 +0000</created>
                <updated>Thu, 30 Sep 2010 16:00:26 +0000</updated>
                    <resolved>Thu, 30 Sep 2010 16:00:26 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14499" author="nicokaiser" created="Thu, 30 Sep 2010 10:32:17 +0000"  >&lt;p&gt;This patch should fix Doctrine\ORM\Query to work with detached Entities.&lt;/p&gt;</comment>
                    <comment id="14502" author="beberlei" created="Thu, 30 Sep 2010 16:00:12 +0000"  >&lt;p&gt;Did some changes to the patch, but overally its now committed!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10819" name="ddc-822.patch" size="813" author="nicokaiser" created="Thu, 30 Sep 2010 10:32:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-793] CLI doctrine.php tool should not hard code require_once paths -- leave the include path setup to cli-config.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-793</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The current CLI tool doctrine.php makes assumptions about lib/vendor paths.  Consider refactoring to allow cli-config.php to contain any include path/autoloader setup and remove hard coded paths from doctrine.php&lt;/p&gt;</description>
                <environment></environment>
            <key id="11894">DDC-793</key>
            <summary>CLI doctrine.php tool should not hard code require_once paths -- leave the include path setup to cli-config.php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Sep 2010 21:40:03 +0000</created>
                <updated>Thu, 30 Sep 2010 15:00:56 +0000</updated>
                    <resolved>Thu, 30 Sep 2010 15:00:56 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14501" author="beberlei" created="Thu, 30 Sep 2010 15:00:56 +0000"  >&lt;p&gt;Denied! That is really the PEAR binary code, nothing used in another context.&lt;/p&gt;

&lt;p&gt;I refactored the large bunch of code to Doctrine\ORM\Tools\Console\ConsoleRunner::main() and ::addCommands().&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-784] Add Windows CLI command and remove doctrine.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-784</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Add a Windows CLI .bat and remove the annoying doctrine.php that duplicates doctrine binary.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11868">DDC-784</key>
            <summary>Add Windows CLI command and remove doctrine.php</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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, 1 Sep 2010 17:47:05 +0000</created>
                <updated>Thu, 30 Sep 2010 14:57:54 +0000</updated>
                    <resolved>Thu, 30 Sep 2010 14:57:54 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14354" author="balupton" created="Mon, 13 Sep 2010 05:38:25 +0000"  >&lt;p&gt;What about OSX users?&lt;/p&gt;</comment>
                    <comment id="14355" author="beberlei" created="Mon, 13 Sep 2010 07:23:31 +0000"  >&lt;p&gt;What about them? Don&apos;t they have a shell that listens to #!/bin/sh ?&lt;/p&gt;</comment>
                    <comment id="14500" author="beberlei" created="Thu, 30 Sep 2010 14:57:54 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-820] Nullable associations combined with a column definition generates a notice</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-820</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When an entity has an optional association on a given field and also a column definition on that field, loading that entity generates a notice in UnitOfWork.php on line 1884. Other than the notice, the code works fine. This is the line:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$joinColumnValue = $data&lt;span class=&quot;error&quot;&gt;&amp;#91;$srcColumn&amp;#93;&lt;/span&gt;;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Suggested fix:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$joinColumnValue = isset($data&lt;span class=&quot;error&quot;&gt;&amp;#91;$srcColumn&amp;#93;&lt;/span&gt;) ? $data&lt;span class=&quot;error&quot;&gt;&amp;#91;$srcColumn&amp;#93;&lt;/span&gt; : null;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;I have attached a test case which reproduces the issue.&lt;/p&gt;</description>
                <environment>Ubuntu 9.10, PHP 5.3.3, MySQL 5.0.83</environment>
            <key id="11959">DDC-820</key>
            <summary>Nullable associations combined with a column definition generates a notice</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hasbridge">Harold Asbridge</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Sep 2010 10:33:23 +0000</created>
                <updated>Wed, 29 Sep 2010 15:14:28 +0000</updated>
                    <resolved>Wed, 29 Sep 2010 15:14:28 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14491" author="beberlei" created="Wed, 29 Sep 2010 15:14:28 +0000"  >&lt;p&gt;This is already fixed in master, will be in RC1.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10816" name="doctrine-test.tar.gz" size="304371" author="hasbridge" created="Wed, 29 Sep 2010 10:33:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-815] Identifier quoting does not work with unique columns in PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-815</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems that Doctrine ORM tries to generate invalid unique index names, when the table name is quoted and one of the columns uses the &quot;unique&quot; 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;/**
 * Users\User
 *
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`User`&quot;&lt;/span&gt;)
 * @Entity
 */
class User
{
	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $login
	 *
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;login&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=40, unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $login;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected result:&lt;/p&gt;

&lt;p&gt;The table gets created.&lt;/p&gt;

&lt;p&gt;Actual 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;Creating database schema...
Doctrine\DBAL\Schema\SchemaException
Invalid index-name &lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;_login_uniq given, has to be [a-zA-Z0-9_]
/.../Doctrine/DBAL/Schema/SchemaException.php
Line 33
Trace:
        0. Doctrine\DBAL\Schema\SchemaException::indexNameInvalid on line 214
        1. Doctrine\DBAL\Schema\Table::_createIndex on line 176
        2. Doctrine\DBAL\Schema\Table::addUniqueIndex on line 341
        3. Doctrine\ORM\Tools\SchemaTool::_gatherColumn on line 273
        4. Doctrine\ORM\Tools\SchemaTool::_gatherColumns on line 193
        5. Doctrine\ORM\Tools\SchemaTool::getSchemaFromMetadata on line 93
        6. Doctrine\ORM\Tools\SchemaTool::getCreateSchemaSql on line 76
        7. Doctrine\ORM\Tools\SchemaTool::createSchema on line 73
        8. Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand::executeSchemaCommand on line 59
        9. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand::execute on line 159
        10. Symfony\Component\Console\Command\Command::run on line 205
        11. Symfony\Component\Console\Application::doRun on line 117
        12. Symfony\Component\Console\Application::run on line 72
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I don&apos;t know whether the problem is caused by ORM which forgets that the table names can be quoted, or by DBAL for the same reason. Anyway, I think this should be fixed. I agree with your argumentation that identifier quoting can be wrong, but you should also remember that Doctrine can be used in cooperation with other ORM libraries or with legacy databases. I am in this particular situation: the database is shared by two different systems written in two different languages and using two different ORM libraries, and this is a big limitation for me.&lt;/p&gt;</description>
                <environment>PostgreSQL 8.4</environment>
            <key id="11950">DDC-815</key>
            <summary>Identifier quoting does not work with unique columns in PostgreSQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="zyxist">Tomasz J&#281;drzejewski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Sep 2010 07:08:15 +0000</created>
                <updated>Mon, 27 Sep 2010 17:29:12 +0000</updated>
                    <resolved>Mon, 27 Sep 2010 17:29:12 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14457" author="beberlei" created="Fri, 24 Sep 2010 08:16:01 +0000"  >&lt;p&gt;1. Why do you need SchemaTool if you have a legacy database?&lt;/p&gt;

&lt;p&gt;2. You can use @Table(uniqueConstraints=...) to specify the index name, this circumvents your problem &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/annotations-reference/en#ann_table&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/annotations-reference/en#ann_table&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14481" author="beberlei" created="Mon, 27 Sep 2010 17:29:12 +0000"  >&lt;p&gt;This issue has a simple workaround and no possible sane solution undoing the quoting.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-525] STI Fields null vs not null behaviour</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-525</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;What is the expected behaviour for fields on STI sub-classes?&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Should they always be DEFAULT NULL?&lt;/li&gt;
	&lt;li&gt;Should the EntityPersister always write a default value to them?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;A user reported on IRC that he had issues with Sqlite inserting null values (failing) vs Mysql which inserted empty strings.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11230">DDC-525</key>
            <summary>STI Fields null vs not null behaviour</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Apr 2010 04:30:48 +0000</created>
                <updated>Mon, 27 Sep 2010 17:23:35 +0000</updated>
                    <resolved>Mon, 27 Sep 2010 17:23:35 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12684" author="beberlei" created="Fri, 16 Apr 2010 04:59:34 +0000"  >&lt;p&gt;&amp;lt;mluiten&amp;gt; beberlei; final note before i move to other issues: I found that MySQL puts empty strings in columns that are not specified in the column list of the query, vs sqlite that puts nulls into non-specified columns. That explains a lot of it..&lt;/p&gt;</comment>
                    <comment id="12686" author="mluiten" created="Fri, 16 Apr 2010 05:12:10 +0000"  >&lt;p&gt;Said user reporting in &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;Found this extremely annoying mostly due to inconsistent behavior between different drivers. I just found that MySQL inserts empty strings (&apos;&apos;) into columns not specified in the INSERT query, while SQLite inserts NULLs. I&apos;d say SQLite is technically correct..&lt;/p&gt;

&lt;p&gt;E.g. a superclass Collector (id, name) which has a subclass SpecialCollector, with the column &apos;subdomain&apos; added (nullable=false).&lt;/p&gt;
&lt;div class=&quot;code panel&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 Collector (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, subdomain VARCHAR(255) NOT NULL)
&lt;span class=&quot;code-comment&quot;&gt;// Mysql
&lt;/span&gt;INSERT INTO Collector (id, name) VALUES (1, &apos;foo&apos;); &lt;span class=&quot;code-comment&quot;&gt;// Works fine... subdomain value in &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; row = &apos;&apos; (empty string)
&lt;/span&gt;INSERT INTO Collector(id, name, subdomain) VALUES (1, &apos;foo&apos;, NULL); &lt;span class=&quot;code-comment&quot;&gt;// Error, subdomain may not be NULL
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// SQLite
&lt;/span&gt;INSERT INTO Collector (id, name) VALUES (1, &apos;foo&apos;); &lt;span class=&quot;code-comment&quot;&gt;// Error, subdomain may not be NULL
&lt;/span&gt;INSERT INTO Collector(id, name, subdomain) VALUES (1, &apos;foo&apos;, NULL); &lt;span class=&quot;code-comment&quot;&gt;// Error, subdomain may not be NULL&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When creating a subclass without the subdomain field, Doctrine creates an insert query without subdomain and thus works fine. SQLite however, gives an error.&lt;/p&gt;

&lt;p&gt;Possible solutions would be to include every column of subclasses to the query and hard-set to empty string, or to imply NOT NULL on all columns of subclasses during table creation, and check for NULL in the DBAL instead. But I&apos;ll let the big boys figure that out &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="12687" author="romanb" created="Fri, 16 Apr 2010 05:27:12 +0000"  >&lt;p&gt;Columns mapped by child classes in single table inheritance must be nullable.&lt;/p&gt;

&lt;p&gt;The behavior of mysql looks weird to me, too.&lt;/p&gt;</comment>
                    <comment id="12755" author="romanb" created="Mon, 26 Apr 2010 15:59:49 +0000"  >&lt;p&gt;So do we have an issue here, assuming columns mapped by child classes in STI must be nullable? If yes what is the problem?&lt;/p&gt;</comment>
                    <comment id="14480" author="beberlei" created="Mon, 27 Sep 2010 17:23:35 +0000"  >&lt;p&gt;The problem is that currently you had to do nullable=true on all the fields in chield entities of STI.&lt;/p&gt;

&lt;p&gt;Now SchemaTool doe this automatically.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-533] Cache keys are not limited to word characters</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-533</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m currently working on some glue classes to integrate Doctrine 2 into an existing Zend Framework project. &lt;br/&gt;
To be able to re-use our caching classes (which use Zend_Cache), I wrote a \Doctrine\Common\Cache\AbstractCache implementation for Zend_Cache: &lt;/p&gt;

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

&lt;p&gt;However Zend_Cache only allows &quot;a-zA-Z0-9_&quot; for cache keys, while Doctrine seems to allow anything, and Doctrine ORM seems to use at lease &quot;\&quot; and &quot;$&quot; for metadata storage (&quot;Entity\Article\Category$CLASSMETADATA&quot;). &lt;/p&gt;

&lt;p&gt;What do you think is the most elegant way to solve this? &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Should Doctrine also limit the cache key characters?&lt;/li&gt;
	&lt;li&gt;How could _encodeId and _decodeId be implemented?&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="11252">DDC-533</key>
            <summary>Cache keys are not limited to word characters</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Apr 2010 08:12:43 +0000</created>
                <updated>Mon, 27 Sep 2010 16:49:32 +0000</updated>
                    <resolved>Mon, 27 Sep 2010 16:49:32 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12723" author="nicokaiser" created="Wed, 21 Apr 2010 08:21:50 +0000"  >&lt;p&gt;Currently the cached results and queries are saved with an md5 key anyway, so this works out of the box. &lt;/p&gt;

&lt;p&gt;The only ones that make problems are metadata cache, which stores &quot;Entity\Article\Category$CLASSMETADATA&quot;. As the Doctrine caching layer can be used separate from the other components, it may be a good idea to still allow arbitrary keys and mapping them internally.&lt;/p&gt;</comment>
                    <comment id="12724" author="nicokaiser" created="Wed, 21 Apr 2010 08:23:17 +0000"  >&lt;p&gt;Don&apos;t know the reason for Zend_Cache only supporting &quot;\w+&quot;. When using file cache for Zend, it stores the keys in the filenames instead of hashing them, so the allowed characters have to be limited in order to be able to support a wide range of backends (files, database, etc.)...&lt;/p&gt;</comment>
                    <comment id="12725" author="nicokaiser" created="Wed, 21 Apr 2010 08:33:07 +0000"  >&lt;p&gt;Even base64 does not work, as it has the &quot;+&quot; and &quot;/&quot; characters (and the &quot;=&quot; padding character). &lt;/p&gt;

&lt;p&gt;By stripping the = (PHP&apos;s base64 implementations does not seem to need it) and escaping + and / with the _ (not in base64), it works:&lt;/p&gt;

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

&lt;p&gt;But this is a really dirty hack... (md5&apos;ing does not help, as getIds() requires the cache key encoding to be bidirectional)&lt;/p&gt;</comment>
                    <comment id="14158" author="romanb" created="Mon, 30 Aug 2010 06:34:10 +0000"  >&lt;p&gt;If the cache keys are going to be changed this needs to happen for RC1, therefore rescheduling.&lt;/p&gt;</comment>
                    <comment id="14406" author="beberlei" created="Thu, 16 Sep 2010 15:18:44 +0000"  >&lt;p&gt;I don&apos;t think this is necessary, why would you want to nest a Zend Cache adapter inside a Doctrine Cache instead of just using that cache?&lt;/p&gt;</comment>
                    <comment id="14408" author="nicokaiser" created="Thu, 16 Sep 2010 15:22:15 +0000"  >&lt;p&gt;When you integrate Doctrine 2 into an existing project that uses, manages and provides Zend_Cache instances? In our case, we have centralized factories that deliver the Zend_Cache instances (depending from configuration, environment, etc.), so we don&apos;t want to add additional cache configuration logic for Doctrine.&lt;/p&gt;</comment>
                    <comment id="14455" author="guilhermeblanco" created="Thu, 23 Sep 2010 21:14:40 +0000"  >&lt;p&gt;This is not a problem that we need to fix. It&apos;s a problem with Zend Framework.&lt;br/&gt;
We cannot do anything here. I&apos;d mark it as &quot;Invalid&quot;, since it&apos;s up to Zend Framework fix their limitation.&lt;/p&gt;

&lt;p&gt;If possible I&apos;d make the ClassMetadata hash generator as a configuration extension.&lt;br/&gt;
I cannot imagine anything more than this.&lt;/p&gt;</comment>
                    <comment id="14456" author="beberlei" created="Fri, 24 Sep 2010 03:21:37 +0000"  >&lt;p&gt;@Guilherme Zend Cahce restricts the keys because of the filesystem cache. It needs proper chars i guess.&lt;/p&gt;

&lt;p&gt;@Nico: Why not use str_replace and replace the chars into words? &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$key = str_replace(array(&apos;\\&apos;, &apos;$&apos;), array(&apos;__NS__&apos;, &apos;__USD__&apos;), $key);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you use a cache other than ArrayCache for the Annotations you need to translate that chars also, they contain other stuff that is not filesystem compliant.&lt;/p&gt;</comment>
                    <comment id="14459" author="nicokaiser" created="Fri, 24 Sep 2010 10:49:27 +0000"  >&lt;p&gt;This is the way I do it currently. Not the most elegant way, but it seems to work...&lt;br/&gt;
Which other characters are used for Annotations?&lt;/p&gt;</comment>
                    <comment id="14478" author="beberlei" created="Mon, 27 Sep 2010 16:47:26 +0000"  >&lt;p&gt;$, # and :: (dollar, hash and double colon).&lt;/p&gt;</comment>
                    <comment id="14479" author="beberlei" created="Mon, 27 Sep 2010 16:49:32 +0000"  >&lt;p&gt;Closed, this won&apos;t be changed and there is a simple workaround to be applied in the wrapping driver replacing \, ::, $, #&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-819] Attempting to search a recursive relationship by null results in an error...</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-819</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have an entity which has a many to one relationship pointing to itself.  This is ultimately set to map parent/child relationships.&lt;/p&gt;

&lt;p&gt;Consider the following snippet:&lt;/p&gt;

&lt;p&gt;		// Start out assuming we are searching for &quot;Pages&quot; with no parent specified (root level).&lt;br/&gt;
		$parentId = null;&lt;/p&gt;

&lt;p&gt;		// Check to see if we&apos;re fetching pages that are a child of a parent.&lt;br/&gt;
		if(array_key_exists(&quot;parent_id&quot;, $_GET)) &lt;/p&gt;
{
			$parentId = $_GET[&apos;parent_id&apos;];
		}

&lt;p&gt;		$pages = $this-&amp;gt;entityManager-&amp;gt;getRepository(&quot;MyNamespace\Models\Page&quot;)-&amp;gt;findByParent($parentId);&lt;/p&gt;

&lt;p&gt;When this code is run, PHP tells me:&lt;/p&gt;

&lt;p&gt;    PHP Fatal error:  Uncaught exception &apos;Doctrine\\ORM&lt;br class=&quot;atl-forced-newline&quot; /&gt;ORMException&apos; with message &apos;You need to pass a parameter to &apos;findByParent&apos;&apos;&lt;/p&gt;

&lt;p&gt;At which point, it&apos;s obvious that it&apos;s expecting a parameter an receiving none.  The problem here however is that I have no way of matching for null.  Is there some kind of surrogate null php-class that can be created to represent a model-null?&lt;/p&gt;</description>
                <environment>Ubuntu Linux, MySQL</environment>
            <key id="11956">DDC-819</key>
            <summary>Attempting to search a recursive relationship by null results in an error...</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="omega">Alexander Trauzzi</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Sep 2010 11:39:59 +0000</created>
                <updated>Mon, 27 Sep 2010 16:42:00 +0000</updated>
                    <resolved>Mon, 27 Sep 2010 16:39:21 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14466" author="beberlei" created="Mon, 27 Sep 2010 03:18:22 +0000"  >&lt;p&gt;This is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-817&quot; title=&quot;Repository Query by associated ID&quot;&gt;&lt;del&gt;DDC-817&lt;/del&gt;&lt;/a&gt;, querying by associated ids inside the repositories is currently not possible. You have to use DQL for it.&lt;/p&gt;</comment>
                    <comment id="14469" author="omega" created="Mon, 27 Sep 2010 09:36:53 +0000"  >&lt;p&gt;While that is relevant to this issue, the problem I outlined here isn&apos;t &lt;b&gt;just&lt;/b&gt; to do with being able to query an association by ID.  It&apos;s about how I want to match for entities that have null specified.&lt;/p&gt;

&lt;p&gt;This problem would arise with any regular field.  Note: the error that I&apos;m getting &quot;you need to pass a parameter to findByParent&quot;.  That&apos;s a PHP error, not Doctrine2.  Which means the method isn&apos;t even getting a chance to run.&lt;/p&gt;

&lt;p&gt;I understand that currently it won&apos;t work once it does run, but there has to be some way to test for null...&lt;/p&gt;</comment>
                    <comment id="14470" author="beberlei" created="Mon, 27 Sep 2010 14:53:09 +0000"  >&lt;p&gt;you are right, there is another bug &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="14471" author="beberlei" created="Mon, 27 Sep 2010 15:03:24 +0000"  >&lt;p&gt;Fixed!&lt;/p&gt;</comment>
                    <comment id="14472" author="omega" created="Mon, 27 Sep 2010 16:11:45 +0000"  >&lt;p&gt;Unrelated to the fix, split this off if necessary: Looking at the other issue you linked in, it appears as though the column that stores the actual foreign key will be forced into becoming a primary key.  Which is not really optimal.  Is there any way to do this without creating another primary key on the entity?&lt;/p&gt;</comment>
                    <comment id="14473" author="beberlei" created="Mon, 27 Sep 2010 16:25:52 +0000"  >&lt;p&gt;err i just realized that this fix is bullshit.&lt;/p&gt;

&lt;p&gt;the query turns into WHERE foo = &apos;&apos;.&lt;/p&gt;

&lt;p&gt;There is no conversion into IS NULL. This case can only be solved by DQL.&lt;/p&gt;</comment>
                    <comment id="14474" author="beberlei" created="Mon, 27 Sep 2010 16:38:31 +0000"  >&lt;p&gt;I reverted this patch in the fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-817&quot; title=&quot;Repository Query by associated ID&quot;&gt;&lt;del&gt;DDC-817&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14476" author="beberlei" created="Mon, 27 Sep 2010 16:42:00 +0000"  >&lt;p&gt;@Alexander: I don&apos;t get your foreign key to primary key force question, there is no such requirement.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11952">DDC-817</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-817] Repository Query by associated ID</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-817</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The &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; already has an implementation for this. We need a way to use the EntityRepository to query by foreign key or the related object instance.&lt;/p&gt;

&lt;p&gt;This should be in 2.0&lt;/p&gt;</description>
                <environment></environment>
            <key id="11952">DDC-817</key>
            <summary>Repository Query by associated ID</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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>Sat, 25 Sep 2010 04:05:12 +0000</created>
                <updated>Mon, 27 Sep 2010 16:41:06 +0000</updated>
                    <resolved>Mon, 27 Sep 2010 16:41:06 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14475" author="beberlei" created="Mon, 27 Sep 2010 16:41:06 +0000"  >&lt;p&gt;Implemented, you can now do repository queries 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;$post = $em-&amp;gt;getRepository(&apos;Post&apos;)-&amp;gt;findByCategory($categoryId);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This does however NOT allow something like 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;$post = $em-&amp;gt;getRepository(&apos;Post&apos;)-&amp;gt;findByCategory($category);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with $category being an instance of the entity. Only lookups per key are allowed.&lt;/p&gt;

&lt;p&gt;It also obviously only works on the owning side of an association.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="11956">DDC-819</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-653] Convert annotation mapping to xml having troubles with discriminator map</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-653</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I wanted to convert Company model from unit test folder in Doctrine 2&lt;br/&gt;
project but I get following error:&lt;/p&gt;

&lt;p&gt;&amp;gt; doctrine orm:convert-mapping xml /var/www/doctrine-xml/&lt;/p&gt;

&lt;p&gt;Entity class &apos;CompanyPerson&apos; used in the discriminator map of class&lt;br/&gt;
&apos;Doctrine\Tests\Models\Company\CompanyPerson&apos; does not exist.&lt;/p&gt;

&lt;p&gt;I&apos;m able to convert all other models without any errors and didn&apos;t&lt;br/&gt;
make any changes to the test models from the current Git version. I&lt;br/&gt;
checked the discriminator definitions against documentation and it&lt;br/&gt;
seems ok. I have updated Doctrine 2 with all related packages today&lt;br/&gt;
form Git. Could you please let me know what am I doing wrong?&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;</description>
                <environment></environment>
            <key id="11545">DDC-653</key>
            <summary>Convert annotation mapping to xml having troubles with discriminator map</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="frantisek.troster">Frantisek Troster</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 09:49:27 +0000</created>
                <updated>Sat, 25 Sep 2010 10:19:39 +0000</updated>
                    <resolved>Sat, 25 Sep 2010 10:19:39 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13955" author="beberlei" created="Sun, 15 Aug 2010 14:08:08 +0000"  >&lt;p&gt;works for me, can you explain where you get the error described and also paste the stack trace?&lt;/p&gt;</comment>
                    <comment id="14156" author="romanb" created="Mon, 30 Aug 2010 06:26:09 +0000"  >&lt;p&gt;If we don&apos;t get any more feedback and can not reproduce this issue it will be unscheduled from BETA4 since the release is close.&lt;/p&gt;</comment>
                    <comment id="14161" author="frantisek.troster" created="Mon, 30 Aug 2010 08:17:01 +0000"  >&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;sorry I was away for a few weeks. 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;                                                                                                                                 
  [Doctrine\ORM\Mapping\MappingException]                                                                                            
  Entity class &apos;CompanyPerson&apos; used in the discriminator map of class &apos;Doctrine\Tests\Models\Company\CompanyPerson&apos; does not exist.  
                                                                                                                                     
orm:convert-mapping [--filter=&lt;span class=&quot;code-quote&quot;&gt;&quot;...&quot;&lt;/span&gt;] [--from-database] [--extend[=&lt;span class=&quot;code-quote&quot;&gt;&quot;...&quot;&lt;/span&gt;]] [--num-spaces[=&lt;span class=&quot;code-quote&quot;&gt;&quot;...&quot;&lt;/span&gt;]] [-h|--help] [-q|--quiet] [-v|--verbose] [-V|--version] [-c|--color] [-n|--no-interaction] command to-type dest-path


Exception trace:
 () at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/Doctrine/ORM/Mapping/MappingException.php:187
 Doctrine\ORM\Mapping\MappingException::invalidClassInDiscriminatorMap() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1180
 Doctrine\ORM\Mapping\ClassMetadataInfo-&amp;gt;setDiscriminatorMap() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php:187
 Doctrine\ORM\Mapping\Driver\AnnotationDriver-&amp;gt;loadMetadataForClass() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:256
 Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;_loadMetadata() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:155
 Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;getMetadataFor() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:102
 Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;getAllMetadata() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php:100
 Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand-&amp;gt;execute() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/vendor/Symfony/Components/Console/Command/Command.php:159
 Symfony\Components\Console\Command\Command-&amp;gt;run() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/vendor/Symfony/Components/Console/Application.php:205
 Symfony\Components\Console\Application-&amp;gt;doRun() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/lib/vendor/Symfony/Components/Console/Application.php:117
 Symfony\Components\Console\Application-&amp;gt;run() at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine2/doctrine.php:61

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

&lt;p&gt;I&apos;m using version:&lt;/p&gt;

&lt;div class=&quot;code panel&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 doctrine.php -V
Doctrine Command Line Interface version 2.0.0BETA4-DEV
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Please let me know if you need more information. Maybe it&apos;s just me having wrong configuration. &lt;/p&gt;</comment>
                    <comment id="14199" author="jwage" created="Tue, 31 Aug 2010 15:00:28 +0000"  >&lt;p&gt;Can you provide the entity classes you are getting the errors with?&lt;/p&gt;</comment>
                    <comment id="14210" author="beberlei" created="Wed, 1 Sep 2010 04:05:09 +0000"  >&lt;p&gt;Its the Doctrine\Tests\Models\Company model-set in our suite.&lt;/p&gt;</comment>
                    <comment id="14464" author="beberlei" created="Sat, 25 Sep 2010 10:19:39 +0000"  >&lt;p&gt;Fixed the underlying issue, but this still won&apos;t work since mapping conversion is not currently possible with inheritance.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-816] orm:schema-tool:create --dump-sql is preceded by invalid sql statements</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-816</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I used to create the schema dump for non-doctrine users 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;bin/doctrine orm:schema-tool:create --dump-sql &amp;gt; sql/mysql.sql&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The output is now preceded by 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;ATTENTION: This operation should not be executed in an production enviroment.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I would suggest to direct this warning to stderr so we can easily create our dumps &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>Ubuntu 10.4, Apache 2.2, PHP 5.3.3</environment>
            <key id="11951">DDC-816</key>
            <summary>orm:schema-tool:create --dump-sql is preceded by invalid sql statements</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="steffenvogel">Steffen Vogel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Sep 2010 10:49:53 +0000</created>
                <updated>Sat, 25 Sep 2010 06:12:34 +0000</updated>
                    <resolved>Sat, 25 Sep 2010 06:12:34 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14463" author="beberlei" created="Sat, 25 Sep 2010 06:12:34 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-514] Default for discriminator column</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-514</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The discriminator column should default 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;@DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;dtype&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;whenever the inheritance type is not NONE and there is no explicit @DiscriminatorColumn specified.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="11211">DDC-514</key>
            <summary>Default for discriminator column</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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>Mon, 12 Apr 2010 08:44:54 +0000</created>
                <updated>Thu, 23 Sep 2010 17:10:53 +0000</updated>
                    <resolved>Thu, 23 Sep 2010 17:10:53 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14453" author="beberlei" created="Thu, 23 Sep 2010 17:10:53 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-630] Column aliases are not properly quoted</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-630</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sandbox &lt;/p&gt;

&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;  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;Entities\User&quot;&lt;/span&gt; table=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&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;&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;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; length=&lt;span class=&quot;code-quote&quot;&gt;&quot;50&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;`test-name`&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;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;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User;
$user-&amp;gt;setName(&lt;span class=&quot;code-quote&quot;&gt;&quot;tester&quot;&lt;/span&gt;);
$em-&amp;gt;persist($user);
$em-&amp;gt;flush();
$user2 = $em-&amp;gt;getRepository(&apos;Entities\User&apos;)-&amp;gt;find(1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expectected to get valid user entity&lt;br/&gt;
Got&lt;/p&gt;

&lt;div class=&quot;code panel&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: Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the right syntax to use near &apos;-name1, t0.id AS id2 FROM users t0 WHERE t0.id = &apos;1&apos;&apos; at line 1&apos; in /Doctrine/DBAL/Connection.php:566
Stack trace:
#0 /lib/Doctrine/DBAL/Connection.php(566): PDOStatement-&amp;gt;execute(Array)
#1 /lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(493): Doctrine\DBAL\Connection-&amp;gt;executeQuery(&apos;SELECT t0.`test...&apos;, Array)
#2 /lib/Doctrine/ORM/EntityRepository.php(106): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;load(Array)
#3 /index.php(61): Doctrine\ORM\EntityRepository-&amp;gt;find(1)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Loks like the problem is in the BasicEntityPersister::_getSelectColumnSQL&lt;/p&gt;</description>
                <environment>ubuntu x64, php 5.3.1, Mysql 5.0.31, but can be reproduced in any environment</environment>
            <key id="11468">DDC-630</key>
            <summary>Column aliases are not properly quoted</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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>Wed, 9 Jun 2010 18:31:39 +0000</created>
                <updated>Thu, 23 Sep 2010 16:41:35 +0000</updated>
                    <resolved>Thu, 23 Sep 2010 16:41:35 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13854" author="romanb" created="Sun, 8 Aug 2010 09:13:14 +0000"  >&lt;p&gt;You mention BETA1 as the affected version. Can you confirm that this issue still exists in the BETA3 release and/or the master repository?&lt;/p&gt;</comment>
                    <comment id="13954" author="beberlei" created="Sun, 15 Aug 2010 13:54:47 +0000"  >&lt;p&gt;Are dashes even allowed in column names? I dont think so.&lt;/p&gt;</comment>
                    <comment id="14017" author="shurakai" created="Thu, 19 Aug 2010 11:15:26 +0000"  >&lt;p&gt;I don&apos;t think so either. This seems to be a non-issue.&lt;/p&gt;</comment>
                    <comment id="14077" author="romanb" created="Thu, 26 Aug 2010 07:52:29 +0000"  >&lt;p&gt;Unscheduled until we get further feedback.&lt;/p&gt;</comment>
                    <comment id="14409" author="wizardz" created="Thu, 16 Sep 2010 15:26:19 +0000"  >&lt;p&gt;Roman,&lt;br/&gt;
I do not have this setup anymore so I cannot check next beta releases&lt;/p&gt;

&lt;p&gt;Benjamin,&lt;br/&gt;
dash it is an allowed character for MySQL at least.&lt;/p&gt;

&lt;p&gt;I do not think it is a big issue, it&apos;s just mater of your preferences - do you want to allow using of dash in the field names or not. If not may be it&apos;s a good idea to mention this fact somewhere in documentation&lt;/p&gt;</comment>
                    <comment id="14417" author="beberlei" created="Mon, 20 Sep 2010 06:01:20 +0000"  >&lt;p&gt;According to the SQL Error messages dashes dont seem to be allowed. Its exactly that character that causes the error message or not?&lt;/p&gt;

&lt;p&gt;Hm, but dash seems to work. So it must be something else&lt;/p&gt;</comment>
                    <comment id="14452" author="beberlei" created="Thu, 23 Sep 2010 16:41:35 +0000"  >&lt;p&gt;This doesn&apos;t work because the persister uses the column-name for the AS part of the query. We won&apos;t fix this programatically, this is rather a restriction of Doctrine 2.&lt;/p&gt;

&lt;p&gt;For this reason i have updated the documentation to state that non a-zA-Z0-9_ chars should not be used (even quoted) as columns.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-573] Provide generic resetDQLPart() and resetDQLParts() methods in QueryBuilder</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-573</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given an existing instance of QueryBuilder, there appears to be no way to &apos;reset&apos; most of the DQL parts.  Usage 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;// reset single part
$queryBuilder-&amp;gt;resetDQLPart(&apos;select&apos;);

// reset multiple parts
$queryBuilder-&amp;gt;resetDQLParts(array(&apos;select&apos;, &apos;from&apos;));

// reset all
$queryBuilder-&amp;gt;resetDQLParts();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are probably multiple use cases, but having the ability to reset parts of the DQL in QueryBuilder allows fine grained manipulation of an existing query (i.e. to build a two-part query to accomplish an efficient COUNT() query for pagination).&lt;/p&gt;

&lt;p&gt;Suggested addition to QueryBuilder:&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;    /**
     * Reset DQL parts
     *
     * @param array $parts
     * @return QueryBuilder
     */
    public function resetDQLParts($parts = null)
    {
        if (is_null($parts)) {
            $parts = array_keys($this-&amp;gt;_dqlParts);
        }
        foreach ($parts as $part) {
            $this-&amp;gt;resetDQLPart($part);
        }
        return $this;
    }

    /**
     * Reset single DQL part
     *
     * @param string $part
     * @return QueryBuilder;
     */
    public function resetDQLPart($part)
    {
        if (is_array($this-&amp;gt;_dqlParts[$part])) {
            $this-&amp;gt;_dqlParts[$part] = array();
        } else {
            $this-&amp;gt;_dqlParts[$part] = null;
        }
        $this-&amp;gt;_state = self::STATE_DIRTY;
        return $this;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11326">DDC-573</key>
            <summary>Provide generic resetDQLPart() and resetDQLParts() methods in QueryBuilder</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 May 2010 18:34:29 +0000</created>
                <updated>Thu, 23 Sep 2010 16:33:00 +0000</updated>
                    <resolved>Thu, 23 Sep 2010 16:33:00 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12862" author="romanb" created="Fri, 7 May 2010 04:36:10 +0000"  >&lt;p&gt;select(), where(), orderby(), groupby() etc. all replace existing parts, as opposed to their add* counterparts. I don&apos;t think we need such reset* methods (I also find such methods rather ugly in the API, no offense). &lt;/p&gt;

&lt;p&gt;Concerning replacing &quot;from&quot;, I am not sure. Is that really needed? I don&apos;t think that is already possible but it would be good to see concrete use-cases first.&lt;/p&gt;</comment>
                    <comment id="12863" author="romanb" created="Fri, 7 May 2010 04:45:19 +0000"  >&lt;p&gt;If you really want to &quot;unset&quot; and not &quot;replace&quot;, creating a new QueryBuilder and then putting in the parts you want to reuse might also be a good idea.&lt;/p&gt;</comment>
                    <comment id="12865" author="romanb" created="Fri, 7 May 2010 05:43:14 +0000"  >&lt;p&gt;Found out that the generic add() method can basically be used to replace anything, even the from part. Just in case this is of any help.&lt;/p&gt;</comment>
                    <comment id="12868" author="mjh_ca" created="Fri, 7 May 2010 14:02:19 +0000"  >&lt;p&gt;@Roman thanks for the comments.  add() allows you to replace (with one or more new DQL parts) but does not allow you to unset the parts.  i.e. Once you have added an orderBy, you can&apos;t get it back to state where there is no orderBy in the query.&lt;/p&gt;

&lt;p&gt;I could see use cases for resetting the join, groupBy and orderBy.  At present it seems QueryBuilder is a one-way street and once you get it into certain states, you can&apos;t get it back out without calling getDQLParts() and manually copying each part to a new QueryBuilder.  It shouldn&apos;t be that difficult.&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;// Given an existing $qb instance of QueryBuilder,
// run a COUNT() query to determine matching rows. 
// Removes the ORDER BY as it is not necessary for a COUNT().

// with a reset method
$qb2 = clone $qb; // don&apos;t modify existing query
$qb2-&amp;gt;resetDQLPart(&apos;orderBy&apos;)-&amp;gt;select(&apos;COUNT(DISTINCT a.id)&apos;);
$count = $qb2-&amp;gt;getQuery()-&amp;gt;getSingleScalarResult();

// without a reset method
$qb2 = new QueryBuilder($qb-&amp;gt;getEntityManager());
$excludeParts = array(&apos;orderBy&apos;);
foreach ($qb-&amp;gt;getDQLParts() as $partName =&amp;gt; $partVal) {
    if (in_array($partName, $excludeParts)) {
        continue;
    }
    if (is_array($partVal)) {
        foreach ($partVal as $subPart) {
            $qb2-&amp;gt;add($partName, $subPart, true);
        } 
    } else {
        $qb2-&amp;gt;add($partName, $partVal);
    }
}
$count = $qb2-&amp;gt;select(&apos;COUNT(DISTINCT a.id)&apos;)-&amp;gt;getQuery()-&amp;gt;getSingleScalarResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13832" author="romanb" created="Sat, 7 Aug 2010 15:31:37 +0000"  >&lt;p&gt;Scheduling for 2.0 for now but I&apos;d like to get more opinions on this.&lt;/p&gt;</comment>
                    <comment id="13926" author="guilhermeblanco" created="Thu, 12 Aug 2010 00:15:00 +0000"  >&lt;p&gt;Initially I was against it. But I see some valid point on user request.&lt;br/&gt;
I don&apos;t have a formed opinion. Whatever you choose, I implement. =)&lt;/p&gt;</comment>
                    <comment id="14351" author="beberlei" created="Sun, 12 Sep 2010 16:50:35 +0000"  >&lt;p&gt;reset sounds good&lt;/p&gt;</comment>
                    <comment id="14451" author="beberlei" created="Thu, 23 Sep 2010 16:33:00 +0000"  >&lt;p&gt;Pushed into master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-759] More than one many-to-many relations cannot be created using default values</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-759</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;An entity that has two many to many fields that referrence the same entity can&apos;t exist on its own, because ClassMetadataInfo uses the actual name of the referrenced entity to define joining table.&lt;/p&gt;

&lt;p&gt;When there are for example Product and TextFile entities and you want to assigng the TextFile entitites to the Product entity firstly as descriptions (that are for example displayed on a product page) and secondly as simple text files (that can be downloaded on the product page, but are not displayed), ClassMetadataInfo tries to generate joining table called product_textfile for the descriptions field, then tries to generated joining table called product_textfile for the textfiles, but the latter will fail, because the product_textfile table already exists.&lt;/p&gt;

&lt;p&gt;I propose that the table name generation strategy for many to many relations is changed so it will use the actual field name rather than the entity name. In the above example the joining tables would be product_descriptions and product_textFiles. I know that the standard naming conventions for database tables are not to use plurals, but I think it&apos;s better to use plurals and have those joining tables created automatically than not use them and have the user set names for the joining tables manually.&lt;/p&gt;

&lt;p&gt;This new behaviour can be achieved by changing the file ClassMetadataInfo.php, line 837 from $targetShortName = substr($mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;, strrpos($mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;, &apos;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&apos;) + 1); to $targetShortName = $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11803">DDC-759</key>
            <summary>More than one many-to-many relations cannot be created using default values</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="petr_motejlek">Petr Motejlek</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Aug 2010 09:17:26 +0000</created>
                <updated>Tue, 21 Sep 2010 13:17:23 +0000</updated>
                    <resolved>Tue, 21 Sep 2010 13:17:23 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14434" author="beberlei" created="Tue, 21 Sep 2010 13:17:23 +0000"  >&lt;p&gt;This will not be implemented, you can use:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;other_name&quot;&lt;/span&gt;)
 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Foo&quot;&lt;/span&gt;)
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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-739] DQL generates wrong SQL if id column has other name</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-739</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I created many to many relation User &amp;lt;-&amp;gt; Group same as CmsUser and CmsGroup in test.&lt;br/&gt;
But by User class has another definition for ID column:&lt;/p&gt;
&lt;div class=&quot;code panel&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
{
    /**
     * @Id @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;)
     * @GeneratedValue
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
   ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;My DQL 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; 
$queryBuilder-&amp;gt;select(&lt;span class=&quot;code-quote&quot;&gt;&quot;g&quot;&lt;/span&gt;)-&amp;gt;from(&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;g&quot;&lt;/span&gt;)-&amp;gt;join(&lt;span class=&quot;code-quote&quot;&gt;&quot;g.users&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;u&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;It generates 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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; g0_.Id AS Id0, g0_.name AS name1 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; groups g0_ INNER JOIN users_groups u2_ ON g0_. = u2_.group_id INNER JOIN users u1_ ON u1_. = u2_.user_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;As you see g0_. has ho id column.&lt;br/&gt;
If  I removes &lt;b&gt;name=&quot;Id&quot;&lt;/b&gt; from id column definition &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
class User
{
    /**
     * @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;private&lt;/span&gt; $id;
   ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;all works fine and generated sql 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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; g0_.id AS id0, g0_.name AS name1 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; groups g0_ INNER JOIN users_groups u2_ ON g0_.id = u2_.group_id INNER JOIN users u1_ ON u1_.id = u2_.user_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11742">DDC-739</key>
            <summary>DQL generates wrong SQL if id column has other name</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="5">Cannot Reproduce</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="musuk">Alexey V. Ryazhskikh</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Aug 2010 03:50:53 +0000</created>
                <updated>Wed, 15 Sep 2010 16:27:21 +0000</updated>
                    <resolved>Wed, 15 Sep 2010 16:27:21 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13922" author="guilhermeblanco" created="Wed, 11 Aug 2010 23:22:08 +0000"  >&lt;p&gt;Assigning to me&lt;/p&gt;</comment>
                    <comment id="13923" author="guilhermeblanco" created="Wed, 11 Aug 2010 23:53:51 +0000"  >&lt;p&gt;Please public your Group and User mappings... I have tested here and could not reproduce the issue.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="13957" author="beberlei" created="Sun, 15 Aug 2010 14:42:18 +0000"  >&lt;p&gt;This is probably a bug on the other side missing a correct @joinColumn annotation?&lt;/p&gt;</comment>
                    <comment id="14155" author="romanb" created="Mon, 30 Aug 2010 06:24:54 +0000"  >&lt;p&gt;We need a complete (failing) unit test in order to proceed on this. Scheduling for RC1.&lt;/p&gt;</comment>
                    <comment id="14392" author="beberlei" created="Wed, 15 Sep 2010 16:27:21 +0000"  >&lt;p&gt;This is for sure an error in the @joinColumn specification (or no @joinColumn at all) i close this issue until further feedback is given.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-806] XSD requires an id element before the first field element</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-806</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The entity element in doctrine-mapping.xsd requires an element id in front of the first element field.&lt;/p&gt;

&lt;p&gt;This leads to invalid XML files, where a inherited class doesn&apos;t need an ID on its own, but inherits one from its parent.&lt;/p&gt;

&lt;p&gt;In the examples in the documentation,&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en#xml-element-reference:defining-fields&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en#xml-element-reference:defining-fields&lt;/a&gt;&lt;br/&gt;
the code, too, has no id element in front of the first field elements.&lt;/p&gt;

&lt;p&gt;A minimal example, showing the inheritance problem, too, is attached. The validation error occurs on the field element of the &quot;Cat&quot; entity.&lt;/p&gt;</description>
                <environment>Win XP + Cygwin, validating with xmlstar and xmllint</environment>
            <key id="11922">DDC-806</key>
            <summary>XSD requires an id element before the first field element</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="m.strehl">Manuel Strehl</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Sep 2010 03:36:59 +0000</created>
                <updated>Wed, 15 Sep 2010 15:52:12 +0000</updated>
                    <resolved>Wed, 15 Sep 2010 15:52:12 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14387" author="beberlei" created="Wed, 15 Sep 2010 15:52:12 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10796" name="doctrine-xsd-test.dcm.xml" size="685" author="m.strehl" created="Wed, 15 Sep 2010 03:36:59 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-802] Missing variable $name in XmlExporter</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-802</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;At line 112 &lt;a href=&quot;http://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php#L112&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php#L112&lt;/a&gt; is required variable $name. This variable should be replaced by $unique&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;. And before this line should be test if(isset($unique&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;)).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11918">DDC-802</key>
            <summary>Missing variable $name in XmlExporter</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Sep 2010 06:42:56 +0000</created>
                <updated>Wed, 15 Sep 2010 13:13:27 +0000</updated>
                    <resolved>Wed, 15 Sep 2010 13:13:27 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14382" author="guilhermeblanco" created="Wed, 15 Sep 2010 13:13:27 +0000"  >&lt;p&gt;On &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/4845745337dbbed5eead25c3062a07103b38649f&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/4845745337dbbed5eead25c3062a07103b38649f&lt;/a&gt; I fixed this issue.&lt;/p&gt;

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

<item>
            <title>[DDC-749] positional query parameters throwing a QueryException</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-749</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I get the following exception:&lt;br/&gt;
&quot;Invalid parameter number: number of bound variables does not match number of tokens&quot;&lt;br/&gt;
when executing the following Doctrine 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;$em = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getEntityManager();
$query = $em-&amp;gt;createQuery(&apos;select e from Domain_Entity_Country e where e.alpha2Code like ?1&apos;);
$query-&amp;gt;setParameters(array(1 =&amp;gt; &apos;A%&apos;)); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>MacOS 10.6.4/PHP 5.3.2</environment>
            <key id="11783">DDC-749</key>
            <summary>positional query parameters throwing a QueryException</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="goriol">Guillaume ORIOL</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Aug 2010 04:25:07 +0000</created>
                <updated>Wed, 15 Sep 2010 05:02:42 +0000</updated>
                    <resolved>Tue, 14 Sep 2010 12:22:39 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14350" author="beberlei" created="Sun, 12 Sep 2010 16:43:30 +0000"  >&lt;p&gt;I cannot reproduce this sorry, can you retry with Beta4?&lt;/p&gt;</comment>
                    <comment id="14370" author="goriol" created="Tue, 14 Sep 2010 10:04:33 +0000"  >&lt;p&gt;Hi Benjamin,&lt;/p&gt;

&lt;p&gt;I made a new test and got the same error with BETA4.&lt;/p&gt;

&lt;p&gt;Here is the stack trace:&lt;br/&gt;
Invalid parameter number: number of bound variables does not match number of tokens&lt;br/&gt;
#0 \/Users\/goriol\/src\/Doctrine\/doctrine-orm-2.0.0BETA4\/Doctrine\/ORM\/Query.php(229): Doctrine\\ORM\\Query&lt;br class=&quot;atl-forced-newline&quot; /&gt;QueryException::invalidParameterNumber()&lt;br/&gt;
#1 \/Users\/goriol\/src\/Doctrine\/doctrine-orm-2.0.0BETA4\/Doctrine\/ORM\/AbstractQuery.php(528): Doctrine\\ORM&lt;br class=&quot;atl-forced-newline&quot; /&gt;Query-&amp;gt;_doExecute()&lt;br/&gt;
#2 \/Users\/goriol\/src\/Doctrine\/doctrine-orm-2.0.0BETA4\/Doctrine\/ORM\/AbstractQuery.php(408): Doctrine\\ORM&lt;br class=&quot;atl-forced-newline&quot; /&gt;AbstractQuery-&amp;gt;execute(Array, 4)&lt;br/&gt;
#3 \/Users\/goriol\/src\/Doctrine\/doctrine-orm-2.0.0BETA4\/Doctrine\/ORM\/AbstractQuery.php(434): Doctrine\\ORM&lt;br class=&quot;atl-forced-newline&quot; /&gt;AbstractQuery-&amp;gt;getSingleResult(4)&lt;br/&gt;
#4 \/Users\/goriol\/src\/DoctrineExtensions\/lib\/DoctrineExtensions\/Paginate\/PaginationAdapter.php(82): Doctrine\\ORM&lt;br class=&quot;atl-forced-newline&quot; /&gt;AbstractQuery-&amp;gt;getSingleScalarResult()&lt;br/&gt;
#5 \/Users\/goriol\/src\/DoctrineExtensions\/lib\/DoctrineExtensions\/Paginate\/PaginationAdapter.php(134): DoctrineExtensions\\Paginate\\PaginationAdapter-&amp;gt;setRowCount(Object(Doctrine\\ORM&lt;br class=&quot;atl-forced-newline&quot; /&gt;Query))&lt;br/&gt;
#6 \/Users\/goriol\/src\/Zend\/ZendFramework-1.10.5\/library\/Zend\/Paginator.php(1028): DoctrineExtensions\\Paginate&lt;br class=&quot;atl-forced-newline&quot; /&gt;PaginationAdapter-&amp;gt;count()&lt;br/&gt;
#7 \/Users\/goriol\/src\/Zend\/ZendFramework-1.10.5\/library\/Zend\/Paginator.php(712): Zend_Paginator-&amp;gt;_calculatePageCount()&lt;br/&gt;
#8 \/Users\/goriol\/src\/Technema\/Service\/Doctrine.php(285): Zend_Paginator-&amp;gt;setItemCountPerPage(30)&lt;br/&gt;
#9 \/Users\/goriol\/src\/Technema\/Controller\/Rest.php(85): Technema_Service_Doctrine-&amp;gt;fetchPage(Array)&lt;br/&gt;
#10 \/Users\/goriol\/src\/Zend\/ZendFramework-1.10.5\/library\/Zend\/Controller\/Action.php(513): Technema_Controller_Rest-&amp;gt;indexAction()&lt;br/&gt;
#11 \/Users\/goriol\/src\/Zend\/ZendFramework-1.10.5\/library\/Zend\/Controller\/Dispatcher\/Standard.php(295): Zend_Controller_Action-&amp;gt;dispatch(&apos;indexAction&apos;)&lt;br/&gt;
#12 \/Users\/goriol\/src\/Zend\/ZendFramework-1.10.5\/library\/Zend\/Controller\/Front.php(954): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))&lt;br/&gt;
#13 \/Users\/goriol\/src\/Zend\/ZendFramework-1.10.5\/library\/Zend\/Application\/Bootstrap\/Bootstrap.php(97): Zend_Controller_Front-&amp;gt;dispatch()&lt;br/&gt;
#14 \/Users\/goriol\/src\/Zend\/ZendFramework-1.10.5\/library\/Zend\/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&amp;gt;run()&lt;br/&gt;
#15 \/private\/var\/www\/erp.alterimago.com\/public\/index.php(24): Zend_Application-&amp;gt;run()&lt;br/&gt;
#16 &lt;/p&gt;
{main}</comment>
                    <comment id="14371" author="beberlei" created="Tue, 14 Sep 2010 12:22:10 +0000"  >&lt;p&gt;That stack trace puts the report in a new light, your code example is not really the source of the error but the pagination adapter is.&lt;/p&gt;</comment>
                    <comment id="14372" author="beberlei" created="Tue, 14 Sep 2010 12:22:39 +0000"  >&lt;p&gt;This is a Doctrine Extensions paginator bug, closing the issue here, its known in the extension already.&lt;/p&gt;</comment>
                    <comment id="14373" author="goriol" created="Tue, 14 Sep 2010 12:38:32 +0000"  >&lt;p&gt;Are you talking about this issue?&lt;br/&gt;
&lt;a href=&quot;http://github.com/beberlei/DoctrineExtensions/issues#issue/10&quot; class=&quot;external-link&quot;&gt;http://github.com/beberlei/DoctrineExtensions/issues#issue/10&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14379" author="beberlei" created="Wed, 15 Sep 2010 05:02:42 +0000"  >&lt;p&gt;yes thats the one&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-762] undefined index errors when the join-column of a relation is NULL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-762</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When the value of the join-column of a relation is NULL, &quot;undefined index&quot; errors are thrown in UnitOfWork::createEntity().&lt;/p&gt;

&lt;p&gt;The problem is in BasicEntityPersister::_processSQLResult() ; the attached diff fixed the problem for me.&lt;/p&gt;

&lt;p&gt;I reproduce the problem with a code like this :&lt;br/&gt;
This triggers an error when the value of the column b_id is NULL.&lt;/p&gt;

&lt;div class=&quot;code panel&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

class A {
  @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;b_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $bId;

  @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;B&quot;&lt;/span&gt;)
  @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;b_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; $b;
}

$entityManager-&amp;gt;find(&apos;A&apos;, 1);
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11810">DDC-762</key>
            <summary>undefined index errors when the join-column of a relation is NULL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="arnaud-lb">arnaud-lb</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 Aug 2010 01:13:17 +0000</created>
                <updated>Tue, 14 Sep 2010 09:49:41 +0000</updated>
                    <resolved>Mon, 13 Sep 2010 15:48:45 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14137" author="beberlei" created="Sun, 29 Aug 2010 05:11:38 +0000"  >&lt;p&gt;fixed formating&lt;/p&gt;</comment>
                    <comment id="14138" author="beberlei" created="Sun, 29 Aug 2010 05:17:54 +0000"  >&lt;p&gt;This should either be fixed in MASTER, or is not an issue (redefine of the same column as key and relation). This will really only be possible with the experimental &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; branch that will be merged for 2.1&lt;/p&gt;</comment>
                    <comment id="14143" author="arnaud-lb" created="Sun, 29 Aug 2010 08:09:16 +0000"  >&lt;p&gt;&amp;gt; not an issue (redefine of the same column as key and relation)&lt;/p&gt;

&lt;p&gt;My example was not clear enough, the column is not a key.&lt;/p&gt;

&lt;div class=&quot;code panel&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

class A {

  @Id
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

  &lt;span class=&quot;code-comment&quot;&gt;// apart being a foreign key, &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; is not a key of A
&lt;/span&gt;  @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;b_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $bId;

  @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;B&quot;&lt;/span&gt;)
  @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;b_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; $b;
}

$entityManager-&amp;gt;find(&apos;A&apos;, 1);
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14363" author="beberlei" created="Mon, 13 Sep 2010 13:46:35 +0000"  >&lt;p&gt;problem is that array_key_exists is 9 times slower than isset, and this method is easily called several thousand times. We need to find another solution&lt;/p&gt;</comment>
                    <comment id="14364" author="beberlei" created="Mon, 13 Sep 2010 14:51:45 +0000"  >&lt;p&gt;@roman my proposed patch is this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index 242d84b..e3cd015 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -1881,7 +1881,7 @@ class UnitOfWork &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; PropertyChangedListener
                         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($assoc[&apos;isOwningSide&apos;]) {
                             $associatedId = array();
                             foreach ($assoc[&apos;targetToSourceKeyColumns&apos;] as $targetColumn =&amp;gt; $srcColumn) {
-                                $joinColumnValue = $data[$srcColumn];
+                                $joinColumnValue = isset($data[$srcColumn]) ? $data[$srcColumn] : &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
                                 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($joinColumnValue !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                                     $associatedId[$targetClass-&amp;gt;fieldNames[$targetColumn]] = $joinColumnValue;
                                 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;it sucks this applies only to this use-case however...&lt;/p&gt;</comment>
                    <comment id="14366" author="beberlei" created="Mon, 13 Sep 2010 15:48:45 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="14369" author="arnaud-lb" created="Tue, 14 Sep 2010 09:49:41 +0000"  >&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10747" name="patch.diff" size="769" author="arnaud-lb" created="Sat, 21 Aug 2010 01:13:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-761] Associations between string fields result in mismatched column definitions on owning side</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-761</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using the latest master from github, defining a one-to-one or many-to-one relationship where the inverse side is a string of a specific length (i.e. other than the default 255 chars), the owning side column definition becomes a VARCHAR(255) (at least in MySQL) regardless of the length of the column on the other side of the relationship.  I would expect the correct behavior would be for the column definitions to match on both sides.  For 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;
/** @Entity */
class foo {

    /**
     * @Id @Column(type=&quot;string&quot;, length=5)
     */
    protected $id;
}

/** @Entity */
class bar {
    /**
     * @Id @Column(type=&quot;integer&quot;)
     */
    protected $id;

    /**
     * @OneToOne(targetEntity=&quot;Foo&quot;)
     * @JoinColumn(name=&quot;foo_id&quot;, referencedColumnName=&quot;id&quot;)
     */
    protected $foo;
}

/** @Entity */
class baz {
    /**
     * @Id @Column(type=&quot;integer&quot;)
     */
    protected $id;

    /**
     * @ManyToOne(targetEntity=&quot;Foo&quot;)
     * @JoinColumn(name=&quot;foo_id&quot;, referencedColumnName=&quot;id&quot;)
     */
    protected $foo;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Resulting SQL from schematool:&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;CREATE TABLE foo (id VARCHAR(5) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
CREATE TABLE bar (id INT NOT NULL, foo_id VARCHAR(255) DEFAULT NULL, UNIQUE INDEX bar_foo_id_uniq (foo_id), PRIMARY KEY(id)) ENGINE = InnoDB;
CREATE TABLE baz (id INT NOT NULL, foo_id VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
ALTER TABLE bar ADD FOREIGN KEY (foo_id) REFERENCES foo(id);
ALTER TABLE baz ADD FOREIGN KEY (foo_id) REFERENCES foo(id)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected result:&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;CREATE TABLE foo (id VARCHAR(5) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
CREATE TABLE bar (id INT NOT NULL, foo_id VARCHAR(5) DEFAULT NULL, UNIQUE INDEX bar_foo_id_uniq (foo_id), PRIMARY KEY(id)) ENGINE = InnoDB;
CREATE TABLE baz (id INT NOT NULL, foo_id VARCHAR(5) DEFAULT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
ALTER TABLE bar ADD FOREIGN KEY (foo_id) REFERENCES foo(id);
ALTER TABLE baz ADD FOREIGN KEY (foo_id) REFERENCES foo(id)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This bug is possibly related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-755&quot; title=&quot;Length of String column in a many to many bi-directional is 255 chars&quot;&gt;&lt;del&gt;DDC-755&lt;/del&gt;&lt;/a&gt; except these associations don&apos;t involve integers.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11809">DDC-761</key>
            <summary>Associations between string fields result in mismatched column definitions on owning side</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Aug 2010 15:53:04 +0000</created>
                <updated>Sun, 12 Sep 2010 16:34:48 +0000</updated>
                    <resolved>Sun, 12 Sep 2010 16:34:48 +0000</resolved>
                                            <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14349" author="beberlei" created="Sun, 12 Sep 2010 16:34:48 +0000"  >&lt;p&gt;fixed (should be!)&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="11799">DDC-755</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-748] BasicEntityPersister::refresh() broken with ManyToOne relationships</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-748</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;ManyToOne relationships are defined as an owning side of OneToOne relationships. This makes BasicEntityPersister to believe that it is refreshing a OneToOne relationship, resulting in the inverse end (collection) to be replaced with the entity being refreshed rather than a collection. (in BasicEntityPersister.php:662 in Beta 3)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11781">DDC-748</key>
            <summary>BasicEntityPersister::refresh() broken with ManyToOne relationships</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jasu_m">Jasper Mattsson</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Aug 2010 23:26:21 +0000</created>
                <updated>Sun, 12 Sep 2010 15:44:54 +0000</updated>
                    <resolved>Sun, 12 Sep 2010 15:44:54 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14348" author="beberlei" created="Sun, 12 Sep 2010 15:44:47 +0000"  >&lt;p&gt;Fixed!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-755] Length of String column in a many to many bi-directional is 255 chars</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-755</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As per discussion with Guilherme, I&apos;m opening a ticket for when a bi-directional many to many relationship is established with one side having a string as its primary key, and the other having an integer.&lt;/p&gt;

&lt;p&gt;It appears as though the ORM/DBAL are getting confused as to what the length of the invisible join table column between them should be.&lt;/p&gt;

&lt;p&gt;In the case of my example models, when I use SchemaTool to generate the tables, it creates a BlogPost table with the column blog_name with a length of 255 characters (it should be 40).  When I use the SchemaTool to generate an update to the table, it tells me it wants to modify the column to be 255 characters in spite the facts that:&lt;/p&gt;

&lt;p&gt;1) It already is.&lt;br/&gt;
2) It&apos;s wrong.&lt;/p&gt;</description>
                <environment>Ubuntu</environment>
            <key id="11799">DDC-755</key>
            <summary>Length of String column in a many to many bi-directional is 255 chars</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="omega">Alexander Trauzzi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Aug 2010 17:35:52 +0000</created>
                <updated>Sun, 12 Sep 2010 12:56:16 +0000</updated>
                    <resolved>Sun, 12 Sep 2010 12:55:58 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14347" author="beberlei" created="Sun, 12 Sep 2010 12:55:58 +0000"  >&lt;p&gt;This issue is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-761&quot; title=&quot;Associations between string fields result in mismatched column definitions on owning side&quot;&gt;&lt;del&gt;DDC-761&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11809">DDC-761</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10745" name="Models.php" size="1031" author="omega" created="Wed, 18 Aug 2010 17:35:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>