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

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=fixVersion+%3D+%222.1.3%22+AND+project+%3D+DDC&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=fixVersion+%3D+%222.1.3%22+AND+project+%3D+DDC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="24" total="24"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-1496] OrphanRemove does not work when using clear() without initializing the collection before</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1496</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Collection items (marked with orphanRemoval=true) are not removed from the database correctly if&lt;br/&gt;
1. the collection is not initialized&lt;br/&gt;
2. we now call -&amp;gt;clear() on it.&lt;/p&gt;

&lt;p&gt;I think the problem is that PersistentCollection::clear() iterates through the uninitialized collection which is empty in this case. Thus the scheduleOrphanRemoval() method is never called.&lt;/p&gt;

&lt;p&gt;The best example is within the doctrine 2 documentation: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#orphan-removal&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#orphan-removal&lt;/a&gt; . Calling $this-&amp;gt;addresses-&amp;gt;clear() raises this bug.&lt;/p&gt;

&lt;p&gt;I&apos;m currently helping myself by fixing the situation with accessing the elements of the collection before calling -&amp;gt;clear().&lt;/p&gt;</description>
                <environment></environment>
            <key id="13190">DDC-1496</key>
            <summary>OrphanRemove does not work when using clear() without initializing the collection before</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="georgwaechter">Georg W&#228;chter</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Nov 2011 10:25:00 +0000</created>
                <updated>Fri, 18 Nov 2011 14:45:22 +0000</updated>
                    <resolved>Fri, 18 Nov 2011 14:45:22 +0000</resolved>
                            <version>2.1.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16862" author="beberlei" created="Fri, 18 Nov 2011 14:45:22 +0000"  >&lt;p&gt;fixed and merged into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1477] GH-177: ProxyFactory was redeclaring methods in some OSs</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1477</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/177&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/177&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ProxyFactory was redeclaring methods serialize and unserialize (in my case) on the cache file on some OSs.&lt;/p&gt;

&lt;p&gt;Here is the full comment with some screenshots: &lt;a href=&quot;https://github.com/symfony/symfony/issues/2501&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/issues/2501&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13156">DDC-1477</key>
            <summary>GH-177: ProxyFactory was redeclaring methods in some OSs</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>Tue, 8 Nov 2011 23:34:45 +0000</created>
                <updated>Wed, 25 Jul 2012 09:55:32 +0000</updated>
                    <resolved>Sun, 13 Nov 2011 16:20:38 +0000</resolved>
                                            <fixVersion>2.1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16806" author="beberlei" created="Sun, 13 Nov 2011 16:20:38 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="18381" author="beberlei" created="Wed, 25 Jul 2012 09:42:53 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-177&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/177&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/177&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18382" author="beberlei" created="Wed, 25 Jul 2012 09:55:32 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-177&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/177&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/177&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1474] Selecting expressions involving the unary minus operator will not work, whereas the EBNF syntax definitions for DQL say they should</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1474</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL queries like:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT - someEntity.someNumericField FROM \SomeEntity someEntity
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will result in a syntax error:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[Syntax Error] line 0, col 7: Error: Expected IdentificationVariable | StateFieldPathExpression | AggregateExpression | &quot;(&quot; Subselect &quot;)&quot; | ScalarExpression, got &apos;-&apos;&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think this should work, because the relevant EBNF definitions state the following:&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;SimpleSelectExpression  ::= ScalarExpression | IdentificationVariable |
                            (AggregateExpression [[&quot;AS&quot;] AliasResultVariable])
ScalarExpression       ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary | StateFieldPathExpression
                           BooleanPrimary | EntityTypeExpression | CaseExpression
SimpleArithmeticExpression ::= ArithmeticTerm {(&quot;+&quot; | &quot;-&quot;) ArithmeticTerm}*
ArithmeticTerm             ::= ArithmeticFactor {(&quot;*&quot; | &quot;/&quot;) ArithmeticFactor}*
ArithmeticFactor           ::= [(&quot;+&quot; | &quot;-&quot;)] ArithmeticPrimary
ArithmeticPrimary          ::= SingleValuedPathExpression | Literal | &quot;(&quot; SimpleArithmeticExpression &quot;)&quot;
                               | FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings
                               | FunctionsReturningDatetime | IdentificationVariable | InputParameter | CaseExpression
SingleValuedPathExpression                ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
StateFieldPathExpression                  ::= IdentificationVariable &quot;.&quot; StateField | SingleValuedAssociationPathExpression &quot;.&quot; StateField
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Therefore, the expression &quot;- someEntity.someField&quot; is a legitimate arithmetic factor, which ultimately should be a legitimate scalar expression too, which is a legitimate simple select expression.&lt;/p&gt;

&lt;p&gt;Fortunately, this is easy to work around, by simply subtracting from zero, like in:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT 0 - someEntity.someNumericField FROM \SomeEntity someEntity
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13153">DDC-1474</key>
            <summary>Selecting expressions involving the unary minus operator will not work, whereas the EBNF syntax definitions for DQL say they should</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="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 Nov 2011 16:48:17 +0000</created>
                <updated>Tue, 15 Nov 2011 21:30:50 +0000</updated>
                    <resolved>Tue, 15 Nov 2011 21:30:50 +0000</resolved>
                            <version>2.1.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16844" author="beberlei" created="Tue, 15 Nov 2011 21:30:50 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1462] Extra Lazy and slice() on dirty collection</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1462</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If i slice and the collection is dirty then i have to go to the database.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13138">DDC-1462</key>
            <summary>Extra Lazy and slice() on dirty collection</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>Mon, 31 Oct 2011 20:30:22 +0000</created>
                <updated>Mon, 31 Oct 2011 20:35:53 +0000</updated>
                    <resolved>Mon, 31 Oct 2011 20:35:53 +0000</resolved>
                            <version>2.1.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16750" author="beberlei" created="Mon, 31 Oct 2011 20:35:52 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1454] SQL error when requesting state for unknown joined inheritance entity with natural identifier</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1454</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When having unknown (not cached by UnitOfWork) joined inheritance entity with natural identifier (GENERATOR_TYPE_NONE), method UnitOfWork::getEntityState() fails with SQL error:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Column not found: 1054 Unknown column &apos;t1.file_id&apos; in &apos;where clause&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will attach testcase right after creating the issue.&lt;/p&gt;</description>
                <environment>Ubuntu 11.10, PHP 5.3.6, MySQL 5.1.58</environment>
            <key id="13126">DDC-1454</key>
            <summary>SQL error when requesting state for unknown joined inheritance entity with natural identifier</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="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 Oct 2011 15:26:52 +0000</created>
                <updated>Thu, 27 Oct 2011 22:59:48 +0000</updated>
                    <resolved>Thu, 27 Oct 2011 22:59:48 +0000</resolved>
                            <version>2.1.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16697" author="gedrox" created="Tue, 25 Oct 2011 15:29:52 +0000"  >&lt;p&gt;Test case.&lt;/p&gt;</comment>
                    <comment id="16703" author="gedrox" created="Wed, 26 Oct 2011 15:57:12 +0000"  >&lt;p&gt;Possible change diff for file Doctrine/ORM/Persisters/BasicEntityPersister.php from Doctrine ORM 2.1.2.&lt;/p&gt;

&lt;p&gt;Idea is to use the main table (not inherited one) if the column is a part of ID. So, I guess, it will be in both tables.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;@@ -1197,7 +1197,7 @@ class BasicEntityPersister
             $conditionSql .= $conditionSql ? &apos; AND &apos; : &apos;&apos;;
 
             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;columnNames[$field])) {
-                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;fieldMappings[$field][&apos;inherited&apos;])) {
+                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;fieldMappings[$field][&apos;inherited&apos;]) &amp;amp;&amp;amp; empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;fieldMappings[$field][&apos;id&apos;])) {
                     $conditionSql .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getSQLTableAlias($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;fieldMappings[$field][&apos;inherited&apos;]) . &apos;.&apos;;
                 } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                     $conditionSql .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getSQLTableAlias($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;name) . &apos;.&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16706" author="beberlei" created="Thu, 27 Oct 2011 22:59:48 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11090" name="DDC1454Test.php" size="1200" author="gedrox" created="Tue, 25 Oct 2011 15:29:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1436] Problems with identity map on self-referencing</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1436</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Orm\Entity
 * @Orm\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;tt_content&quot;&lt;/span&gt;)
 */
class Page
{
	/**
	 * @Orm\Id
	 * @Orm\GeneratedValue
	 * @Orm\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

	/**
	 * @Orm\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Page&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;children&quot;&lt;/span&gt;)
	 * @Orm\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pid&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $parent;

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

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

$id = 5;

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

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

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

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

&lt;p&gt;Let me try to reproduce this in a test and then go further from there.&lt;/p&gt;</comment>
                    <comment id="16855" author="beberlei" created="Fri, 18 Nov 2011 12:28:10 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1452&quot; title=&quot;ObjectHydrator bug: hydration of entity with self (cyclic) relation through ref entity&quot;&gt;&lt;del&gt;DDC-1452&lt;/del&gt;&lt;/a&gt; is indeed the same bug as this one and the fix works.&lt;/p&gt;</comment>
                    <comment id="16856" author="beberlei" created="Fri, 18 Nov 2011 12:55:42 +0000"  >&lt;p&gt;I cant merge this as with the latest refactorings it gives hundrets of conflicts, but will re-apply manually.&lt;/p&gt;</comment>
                    <comment id="16857" author="beberlei" created="Fri, 18 Nov 2011 13:04:35 +0000"  >&lt;p&gt;Backported and fixed in 2.1.x&lt;/p&gt;</comment>
                    <comment id="16860" author="koc" created="Fri, 18 Nov 2011 14:02:03 +0000"  >&lt;p&gt;Thank you very much, Benjamin!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1435] Exception thrown when generating SQL from a DQL subselect where the entity has a foreign key as a primary key</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1435</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If an entity has a foreign key as part of its primary key and you try to query that entity in a subselect clause in DQL, an exception is thrown in ClassMetadataInfo-&amp;gt;getQuotedColumnName. The problem seems to be that it&apos;s only considering the field mappings rather than both the field and association mappings when it&apos;s looking for the correct column name. &lt;/p&gt;

&lt;p&gt;Example entities:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Article(id primary key, title, content)&lt;/li&gt;
	&lt;li&gt;ArticleTag(article_id, tag, primary key (article_id, tag))&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Example DQL: select art from Article art where exists (select tag from ArticleTag tag where tag.article = art)&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13100">DDC-1435</key>
            <summary>Exception thrown when generating SQL from a DQL subselect where the entity has a foreign key as a primary key</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="phekmat">Payam Hekmat</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Oct 2011 17:47:05 +0000</created>
                <updated>Thu, 7 Jun 2012 08:39:52 +0000</updated>
                    <resolved>Sat, 29 Oct 2011 04:04:12 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16709" author="beberlei" created="Fri, 28 Oct 2011 06:21:21 +0000"  >&lt;p&gt;Verified:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * @group DDC-1435
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testForeignKeyAsPrimaryKeySubselect()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertSqlGeneration(
            &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT s FROM Doctrine\Tests\Models\DDC117\DDC117Article s WHERE EXISTS (SELECT r FROM Doctrine\Tests\Models\DDC117\DDC117Reference r WHERE r.source = s)&quot;&lt;/span&gt;,
            &quot;&quot;
        );
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This however is not possible anyways, since you cannot have &quot;r&quot; in a SimpleSelectExpression when it resolves to multiple columns. You can try to select just one arbitrary field, for example.&quot;SELECT r.foobar FROM ..&quot;&lt;/p&gt;</comment>
                    <comment id="16712" author="phekmat" created="Fri, 28 Oct 2011 15:12:08 +0000"  >&lt;p&gt;Would that just be a documentation issue then? I didn&apos;t see that restriction in the &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#ebnf&quot; class=&quot;external-link&quot;&gt;grammar&lt;/a&gt;, but I may have overlooked it. I issued a &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/159&quot; class=&quot;external-link&quot;&gt;pull request&lt;/a&gt; for this issue assuming that an association mapped field is valid input for getQuotedColumnName. &lt;/p&gt;

&lt;p&gt;Selecting a single field does work fine.&lt;/p&gt;</comment>
                    <comment id="16715" author="beberlei" created="Fri, 28 Oct 2011 22:37:13 +0000"  >&lt;p&gt;Did you touch this in your latest changes to SimpleSelectExpression guilherme?&lt;/p&gt;</comment>
                    <comment id="16718" author="guilhermeblanco" created="Sat, 29 Oct 2011 04:04:12 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;@beberlei No. Issue was totally unrelated.&lt;br/&gt;
Please merge my commit to 2.1.X.&lt;/p&gt;

&lt;p&gt;The issue was caused by the identifier iteration was considering that @Id fields are always fields, never associations. You may see that in method getQuoteColumnName.&lt;/p&gt;

&lt;p&gt;Solution was to create a new method called getQuotedIdenitiferColumnNames and consume it in SqlWalker.&lt;br/&gt;
This addresses the issue.&lt;/p&gt;

&lt;p&gt;Committed patch and test case as of: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/0ec2cc557f51d6240396689e36101f62d84d2a38&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/0ec2cc557f51d6240396689e36101f62d84d2a38&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="16722" author="beberlei" created="Sat, 29 Oct 2011 10:09:22 +0000"  >&lt;p&gt;Merged into 2.1.x&lt;/p&gt;</comment>
                    <comment id="16781" author="beberlei" created="Tue, 8 Nov 2011 23:49:05 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-159&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/159&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/159&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18047" author="beberlei" created="Thu, 7 Jun 2012 08:39:52 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-159&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/159&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/159&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1421] SQL Casing in BasicEntityPersister::_getSelectColumnAssociationSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1421</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;SQL Casing is not applied to column alias and method is used twice unnecessarily.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13086">DDC-1421</key>
            <summary>SQL Casing in BasicEntityPersister::_getSelectColumnAssociationSQL</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>Sat, 15 Oct 2011 14:40:41 +0000</created>
                <updated>Sat, 15 Oct 2011 15:49:28 +0000</updated>
                    <resolved>Sat, 15 Oct 2011 15:02:10 +0000</resolved>
                                            <fixVersion>2.1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1420] doctrine orm:validate-schema failure when using Migrations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1420</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m using Doctrine 2.1.2 with Migrations 2.0. Doctrine cli tool works &lt;br/&gt;
correctly for both schema creation (from annotations) and migrations &lt;br/&gt;
but, after using the tool to validate the schema i get the following &lt;br/&gt;
error: &lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Mapping&amp;#93;&lt;/span&gt;  OK - The mapping files are correct. &lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Database&amp;#93;&lt;/span&gt; FAIL - The database schema is not in sync with the current &lt;br/&gt;
mapping file. &lt;/p&gt;

&lt;p&gt;The failure is caused by the doctrine_migration_versions table that &lt;br/&gt;
the migration project has created in the db of my project. &lt;/p&gt;

&lt;p&gt;orm:validate-schema fails because the relation is not defined as an &lt;br/&gt;
entity in the annotations. &lt;/p&gt;</description>
                <environment>Linux, php 5.3.8</environment>
            <key id="13085">DDC-1420</key>
            <summary>doctrine orm:validate-schema failure when using Migrations</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="rtshome">Denis</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Oct 2011 18:46:02 +0000</created>
                <updated>Mon, 31 Oct 2011 22:14:43 +0000</updated>
                    <resolved>Mon, 31 Oct 2011 22:14:43 +0000</resolved>
                            <version>2.1.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16758" author="beberlei" created="Mon, 31 Oct 2011 22:14:43 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;An example case in pseudocode:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;A: ManyToOne to B, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
B: ManyToOne to C, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
C: no owning relations

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

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


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

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index ea516f3..991acac 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -853,6 +853,7 @@ class UnitOfWork implements PropertyChangedListener
                     $targetClass = $this-&amp;gt;em-&amp;gt;getClassMetadata($assoc[&apos;targetEntity&apos;]);
                     if ( ! $calc-&amp;gt;hasClass($targetClass-&amp;gt;name)) {
                         $calc-&amp;gt;addClass($targetClass);
+                        $newNodes[] = $targetClass;
                     }
                     $calc-&amp;gt;addDependency($targetClass, $class);
                     // If the target class has mapped subclasses,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

<item>
            <title>[DDC-1411] onCascade property gets wrong value when entities are generated</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1411</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m using this cmd to generate entities &quot;/path/to/php path/to/doctrine orm:generate-entities --generate-annotations=&quot;1&quot; ~/some/path&quot;.&lt;/p&gt;

&lt;p&gt;The CASCADE option for ONDELETE columns is being wrongly generated, the right would be: onDelete=&quot;CASCADE&quot; but it is being generated as onDelete=true&lt;/p&gt;</description>
                <environment>Unix/Apache/PHP 5.3/MySQL</environment>
            <key id="13076">DDC-1411</key>
            <summary>onCascade property gets wrong value when entities are generated</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="vinicius.bo">Vin&#237;cius Borriello</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Oct 2011 18:29:38 +0000</created>
                <updated>Sat, 15 Oct 2011 15:54:02 +0000</updated>
                    <resolved>Sat, 15 Oct 2011 15:54:02 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16594" author="beberlei" created="Sat, 15 Oct 2011 15:54:02 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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


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


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

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

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

&lt;p&gt;Here the scalar result :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;array(3) {
  [0]=&amp;gt;
  array(21) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;player_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_id&quot;&lt;/span&gt;]=&amp;gt;
    NULL
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_enabled&quot;&lt;/span&gt;]=&amp;gt;
    NULL
  }
  [1]=&amp;gt;
  array(21) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;player_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_enabled&quot;&lt;/span&gt;]=&amp;gt;
    bool(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
  }
  [2]=&amp;gt;
  array(21) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;player_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_id&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(4)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;options_enabled&quot;&lt;/span&gt;]=&amp;gt;
    bool(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


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

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

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

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

&lt;p&gt;Thomas.&lt;/p&gt;</comment>
                    <comment id="16699" author="beberlei" created="Tue, 25 Oct 2011 18:59:39 +0000"  >&lt;p&gt;can you post your mappings?&lt;/p&gt;</comment>
                    <comment id="16701" author="armetiz" created="Wed, 26 Oct 2011 09:39:00 +0000"  >&lt;p&gt;PlayerEntity :&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt;
&lt;/span&gt;      xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt;
&lt;/span&gt;      xsi:schemaLocation=&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping
&lt;/span&gt;                    http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&amp;gt;
&lt;/span&gt;	&amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;PlayerEntity&quot;&lt;/span&gt;&amp;gt;
		&amp;lt;many-to-many field=&lt;span class=&quot;code-quote&quot;&gt;&quot;options&quot;&lt;/span&gt; target-entity=&lt;span class=&quot;code-quote&quot;&gt;&quot;OptionEntity&quot;&lt;/span&gt; mapped-by=&lt;span class=&quot;code-quote&quot;&gt;&quot;players&quot;&lt;/span&gt; /&amp;gt;
	&amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;gt;
{/code}

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

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

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

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

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

<item>
            <title>[DDC-1402] Huge performance leak in SingleTablePersister</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1402</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This code :&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;person&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Person&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;employee&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Employee&quot;&lt;/span&gt;})
 */
class Person
{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
}

/**
 * @Entity
 */
class Employee &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Person
{
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $a;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $b;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $c;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $d;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $e;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $f;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $g;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */ &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $h;
}

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

&lt;p&gt;Will output:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 100 ==&amp;gt; 0.461275
 200 ==&amp;gt; 1.128404
 300 ==&amp;gt; 1.823122
 400 ==&amp;gt; 2.521054
 500 ==&amp;gt; 3.232034
 600 ==&amp;gt; 3.950081
 700 ==&amp;gt; 4.648849
 800 ==&amp;gt; 5.380236
 900 ==&amp;gt; 6.080108
1000 ==&amp;gt; 6.807214
1100 ==&amp;gt; 7.519942
1200 ==&amp;gt; 8.238971
1300 ==&amp;gt; 8.951686
1400 ==&amp;gt; 9.648996
1500 ==&amp;gt; 10.370053
1600 ==&amp;gt; 11.069523
1700 ==&amp;gt; 11.791530
1800 ==&amp;gt; 12.481427
1900 ==&amp;gt; 13.190570
2000 ==&amp;gt; 13.902810
2100 ==&amp;gt; 14.671100
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the first and last SELECT queries as:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; t0.id AS id1, discr, t0.a AS a2, t0.b AS b3, t0.c AS c4, t0.d AS d5, t0.e AS e6, t0.f AS f7, t0.g AS g8, t0.h AS h9 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Person t0 &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; t0.id = 1 AND t0.discr IN (&apos;person&apos;, &apos;employee&apos;)

...

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

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

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


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

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


&lt;p&gt;I fixed my project using the following patch:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;diff --git a/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php b/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php
index f910a8e..78b27cb 100644
--- a/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php
+++ b/doctrine-orm/Doctrine/ORM/Persisters/SingleTablePersister.php
@@ -41,6 +41,15 @@ class SingleTablePersister extends AbstractEntityInheritancePersister
     /** {@inheritdoc} */
     protected function _getSelectColumnListSQL()
     {
+        /** @see BasicEntityPersister::_getSelectColumnListSQL() */
+        if ($this-&amp;gt;_selectColumnListSql !== null) {
+            return $this-&amp;gt;_selectColumnListSql;
+        }
+
+        #####
+        #####
+        #####
+
         $columnList = parent::_getSelectColumnListSQL();
 
         // Append discriminator column
@@ -74,7 +83,13 @@ class SingleTablePersister extends AbstractEntityInheritancePersister
             }
         }
 
-        return $columnList;
+        #####
+        #####
+        #####
+
+        /** @see BasicEntityPersister::_getSelectColumnListSQL() */
+        $this-&amp;gt;_selectColumnListSql = $columnList;
+        return $this-&amp;gt;_selectColumnListSql;
     }
 
     /** {@inheritdoc} */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

<item>
            <title>[DDC-1400] joining and selecting associated collection, which is using indexBy, to a query is triggering UPDATE queries for each collection element which were joined.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1400</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
/**
 * @Entity
 */
class Article
{

    /**
     * @Id
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserState&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;article&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;userId&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EXTRA_LAZY&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $userStates;

    .......

}

/**
 * @Entity
 */
class User
{

    /**
     * @Id
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserState&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;articleId&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EXTRA_LAZY&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $userStates;

    .......

}

/**
 * @Entity
 */
class UserState
{

    /**
      * @Id
     *  @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Article&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;userStates&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $article;

    /**
      * @Id
     *  @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;userStates&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $user;

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

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

    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $hasLiked;

    .......

}

$q = $em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a, s FROM Article a JOIN a.userStates s WITH s.user = :activeUser&quot;&lt;/span&gt;);
$q-&amp;gt;setParameter(&apos;activeUser&apos;, $activeUserId);
$q-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;if i $em-&amp;gt;flush() now it will execute lots of update queries like:&lt;br/&gt;
UPDATE userstate SET article_id = ? WHERE user_id = ? AND article_id = ?&lt;/p&gt;</description>
                <environment></environment>
            <key id="13055">DDC-1400</key>
            <summary>joining and selecting associated collection, which is using indexBy, to a query is triggering UPDATE queries for each collection element which were joined.</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="hypno">Reio Piller</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Sep 2011 12:46:05 +0000</created>
                <updated>Mon, 2 Jan 2012 13:57:25 +0000</updated>
                    <resolved>Mon, 2 Jan 2012 13:57:25 +0000</resolved>
                            <version>2.1.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16599" author="beberlei" created="Sat, 15 Oct 2011 16:26:09 +0000"  >&lt;p&gt;I think your mapping is wrong. You cannot map an @Id + @ManyToOne and then remap the same column using @Column.&lt;/p&gt;

&lt;p&gt;What exactly are the parameters to the query? How is it updating article_id ?&lt;/p&gt;

&lt;p&gt;Is this even affected by &quot;indexBy&quot;? Can you remove them and try again?&lt;/p&gt;</comment>
                    <comment id="16646" author="hypno" created="Mon, 17 Oct 2011 08:02:04 +0000"  >&lt;p&gt;I have to use @Id + $ManyToOne and @Column on the same database field because indexBy only supports normal @Columns as key. We have used this workaround numerous times in our system without any issues.&lt;/p&gt;

&lt;p&gt;And it seems that this is not causing the updates. Here is another example:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
/**
 * @Entity
 */
class Article
{

    /**
     * @Id
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ArticleText&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;article&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;locale&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EXTRA_LAZY&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $texts;

    .......

}

/**
 * @Entity
 */
class ArticleText
{

    /**
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Article&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;texts&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $article;

    /**
     * @Id
     * @Column
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $locale;

   /**
    * @Column
    */
   &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $title;

    .......

}

$q = $em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a, t FROM Article a JOIN a.texts t WITH t.locale = :activeLocale&quot;&lt;/span&gt;);
$q-&amp;gt;setParameter(&apos;activeLocale&apos;, &apos;en&apos;);

$em-&amp;gt;flush(); &lt;span class=&quot;code-comment&quot;&gt;// dummy flush, no queries made
&lt;/span&gt;
$q-&amp;gt;getResult();

$em-&amp;gt;flush(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; will trigger the updates&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;UPDATE article_text SET article_id = 1 WHERE locale = &apos;en&apos; AND article_id = 1&lt;br/&gt;
UPDATE article_text SET article_id = 2 WHERE locale = &apos;en&apos; AND article_id = 2&lt;br/&gt;
UPDATE article_text SET article_id = 3 WHERE locale = &apos;en&apos; AND article_id = 3&lt;br/&gt;
UPDATE article_text SET article_id = 4 WHERE locale = &apos;en&apos; AND article_id = 4&lt;br/&gt;
UPDATE article_text SET article_id = 5 WHERE locale = &apos;en&apos; AND article_id = 5&lt;br/&gt;
.......&lt;/p&gt;

&lt;p&gt;it does it one per article for all articles in result.&lt;/p&gt;

&lt;p&gt;If i remove the indexBy annotation the updates disappear. Extra lazy loading has no effect on this bug.&lt;/p&gt;</comment>
                    <comment id="16886" author="beberlei" created="Sat, 19 Nov 2011 07:51:42 +0000"  >&lt;p&gt;Attached is a working testcase with your example code.&lt;/p&gt;

&lt;p&gt;Can you please verify that it follows your example exactly and try to make it generate those UPDATEs?&lt;/p&gt;</comment>
                    <comment id="17166" author="beberlei" created="Mon, 2 Jan 2012 13:57:25 +0000"  >&lt;p&gt;This is fixed in 2.1.3, it was a bug until 2.1.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11113" name="DDC1400Test.php" size="3040" author="beberlei" created="Sat, 19 Nov 2011 07:51:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1399] Wrong count() value in many-to-many relationship and EXTRA_LAZY</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1399</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Relation many-to-many, EXTRA_LAZY, $user is owning side. Without EXTRA_LAZY all is ok.&lt;/p&gt;

&lt;p&gt;Main problem: counter is increased twice.&lt;/p&gt;

&lt;p&gt;$user-&amp;gt;getPhotos()-&amp;gt;count(); // returns 100 (OK)&lt;br/&gt;
$user-&amp;gt;addPhoto($photo);&lt;br/&gt;
$user-&amp;gt;getPhotos()-&amp;gt;count(); // returns 101 (OK)&lt;br/&gt;
$em-&amp;gt;flush();&lt;br/&gt;
$user-&amp;gt;getPhotos()-&amp;gt;count(); // returns 102 (WRONG! Should be 101)&lt;/p&gt;</description>
                <environment>Symfony 2.0.3 / LAMP</environment>
            <key id="13054">DDC-1399</key>
            <summary>Wrong count() value in many-to-many relationship and EXTRA_LAZY</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="elnino">Pawe&#322; Gniadkowski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Sep 2011 09:32:48 +0000</created>
                <updated>Mon, 31 Oct 2011 20:18:07 +0000</updated>
                    <resolved>Mon, 31 Oct 2011 20:18:07 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16747" author="beberlei" created="Mon, 31 Oct 2011 20:07:24 +0000"  >&lt;p&gt;verified.&lt;/p&gt;</comment>
                    <comment id="16749" author="beberlei" created="Mon, 31 Oct 2011 20:18:07 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1386] getPartialReference() will result in data loss if default values are used</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1386</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If a entity uses default values e.g.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class User {
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name = &lt;span class=&quot;code-quote&quot;&gt;&quot;unnamed&quot;&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;a reference returned from EntityManager::getPartialReference() will automatically result in a scheduled update for this entity (and all fields with default values), because the EM expects the fields of the entity to be empty. This results in resetting all data inside the database to the default values when doing an $em-&amp;gt;flush().&lt;/p&gt;

&lt;p&gt;Regards Stefan&lt;/p&gt;</description>
                <environment></environment>
            <key id="13030">DDC-1386</key>
            <summary>getPartialReference() will result in data loss if default values are used</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="stefanklug">Stefan Klug</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Sep 2011 17:29:04 +0000</created>
                <updated>Sat, 15 Oct 2011 15:49:29 +0000</updated>
                    <resolved>Sat, 15 Oct 2011 13:54:47 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16590" author="beberlei" created="Sat, 15 Oct 2011 12:42:42 +0000"  >&lt;p&gt;Verified, have a fix for this already but its rather tricky with how far i want to push this.&lt;/p&gt;</comment>
                    <comment id="16591" author="beberlei" created="Sat, 15 Oct 2011 13:54:24 +0000"  >&lt;p&gt;I committed a fix into master and 2.1.x &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/3801e0c230b5bf4060ee72800a270340ffee2355&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/3801e0c230b5bf4060ee72800a270340ffee2355&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This could somewhat be considered a BC. But i doubt people use partial objects to update the fields they omitted.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="10612">DDC-209</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1383] Inheritance superclass object is created after merging entity referencing to discriminated entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1383</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Problem is that after merging the object with a reference to some other entity with inheritance (is one of the superclass&apos;s discriminator map), the referenced object has wrong instance (it is Proxy object). It is instance of the superclass not the extended class.&lt;/p&gt;

&lt;p&gt;In my test case I have joined inheritance model with only two entities to make things simple as possible.&lt;/p&gt;

&lt;p&gt;First is the base entity (I have even marked it as abstract):&lt;/p&gt;
&lt;div class=&quot;code panel&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;integer&quot;&lt;/span&gt;)
 * @DiscriminatorMap({1 = &lt;span class=&quot;code-quote&quot;&gt;&quot;Entity&quot;&lt;/span&gt;})
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class AbstractEntity
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and one entity which extends from the first one:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 */
class Entity &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; AbstractEntity {
	/**
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;AbstractEntity&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; AbstractEntity
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $reference;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this scheme I&apos;ve got 2 objects, first referencing to the second. They both are inserted in the database with no problems.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$child = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Entity();
$parent = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Entity();
$child-&amp;gt;setReference($parent);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After the flush I try merging the child entity into the entity manager, the parent entity reference is not instance of Entity\Entity anymore.&lt;/p&gt;

&lt;p&gt;You can see full test case in the archive attached.&lt;/p&gt;</description>
                <environment>Ubuntu 11.04, MySQL 5.1.54-1ubuntu4, PHP 5.3.5-1ubuntu7.2</environment>
            <key id="13027">DDC-1383</key>
            <summary>Inheritance superclass object is created after merging entity referencing to discriminated 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="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Sep 2011 10:11:13 +0000</created>
                <updated>Sat, 15 Oct 2011 17:16:24 +0000</updated>
                    <resolved>Sat, 15 Oct 2011 17:16:24 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.1.3</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16527" author="gedrox" created="Mon, 26 Sep 2011 11:09:37 +0000"  >&lt;p&gt;Attached standardized test case.&lt;/p&gt;</comment>
                    <comment id="16606" author="beberlei" created="Sat, 15 Oct 2011 17:16:24 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11067" name="DDC1383Test.php" size="2058" author="gedrox" created="Mon, 26 Sep 2011 11:09:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1382] getIdentifierValues causes an exception on entyties that have only association keys</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1382</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On entities that have only association keys as primary keys:&lt;/p&gt;

&lt;p&gt;Calling BasicEntityPersister::exists() cause the invocation of ClassMetadata::getIdentifierValues() method.&lt;br/&gt;
This method returns associated entities as identifier values. &lt;br/&gt;
Then BasicEntityPersister::exists()  tries to converts these objects to string, instead of searching their primary keys.&lt;/p&gt;

&lt;p&gt;Some problems: &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;getIdentifierValues have not access to external world (only its class metadata and the current entity).&lt;/li&gt;
	&lt;li&gt;getIdentifierValues is uses in many places of doctrine&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;(sorry for my bad English)&lt;/p&gt;
</description>
                <environment>ubuntu</environment>
            <key id="13026">DDC-1382</key>
            <summary>getIdentifierValues causes an exception on entyties that have only association keys</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="goetas">Asmir Mustafic</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Sep 2011 08:23:21 +0000</created>
                <updated>Sat, 15 Oct 2011 15:49:28 +0000</updated>
                    <resolved>Mon, 3 Oct 2011 05:16:46 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16545" author="guilhermeblanco" created="Mon, 3 Oct 2011 05:16:46 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/24042863acbabdcd0fa1432135a9836467f3bce7&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/24042863acbabdcd0fa1432135a9836467f3bce7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It should be available in next release.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1358] Native Query hydration ignores empty entity doublons</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1358</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;My case is the follwing :&lt;/p&gt;

&lt;p&gt;In a range of dates, I want to know if an entity has been defined for each day. So the raw SQL result would looks 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-sql&quot;&gt;DATE              ID NAME
--------- ---------- -------------
19-SEP-11          4 [Entity Name]
20-SEP-11          1 [Entity Name]
21-SEP-11          2 [Entity Name]
22-SEP-11          3 [Entity Name]
23-SEP-11       NULL NULL
24-SEP-11       NULL NULL
25-SEP-11       NULL NULL
26-SEP-11       NULL NULL
27-SEP-11          7 [Entity Name]
28-SEP-11          6 [Entity Name]
29-SEP-11          5 [Entity Name]

11 rows selected.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The range calculation forced me to use Native Query, but I stumbled upon a strange behavior : the Result array showed less records than the raw SQL would provide. After some dirty debugging, I found out that during hydration, an array of previously hydrated object keys was stored &lt;tt&gt;ObjectHydrator-&amp;gt;_identifierMap&lt;/tt&gt;. The key of null elements (the gap in the SQL result above) is  stored too.  The problem is that when there is multiple empty elements, hydration only keeps one, and forget the others, thus reducing the overall size of the output result.&lt;/p&gt;

&lt;p&gt;I&apos;ve already come up with a quick n&apos;dirty fix wich suits my current needs, but it would be better if this issue was addressed at a more global level.&lt;/p&gt;

&lt;p&gt;Here&apos;s the one-liner fix :&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/Internal/Hydration/ObjectHydrator.php line 397 was :&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;if&lt;/span&gt; ( ! isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_identifierMap[$dqlAlias][$id[$dqlAlias]]) ) {
&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;Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 397 now :&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;if&lt;/span&gt; ( ! isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_identifierMap[$dqlAlias][$id[$dqlAlias]]) || str_replace( &apos;|&apos;, &apos;&apos;, $id[$dqlAlias]) == &apos;&apos;) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment>Debian 6, Symfony 2, Doctrine 2</environment>
            <key id="12992">DDC-1358</key>
            <summary>Native Query hydration ignores empty entity doublons</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="hypolite">Benjamin Lorteau</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Sep 2011 17:37:20 +0000</created>
                <updated>Sun, 16 Oct 2011 09:18:17 +0000</updated>
                    <resolved>Sun, 16 Oct 2011 09:18:17 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16422" author="beberlei" created="Sun, 4 Sep 2011 12:52:02 +0000"  >&lt;p&gt;Doesnt he still hydrate an empty object for this row then? Why are you even using the object hydrator? I rather tend to go and throw an exception if for a query using the ObjectHydrator $id&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt; is empty, because frankly this is just not supported.&lt;/p&gt;</comment>
                    <comment id="16424" author="hypolite" created="Sun, 4 Sep 2011 14:50:30 +0000"  >&lt;p&gt;He does hydrate one empty object for the first line with empty ID, but he does not hydrate further empty object.&lt;/p&gt;

&lt;p&gt;Thus, instead of having an array with the following objects :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
Entity(id=4)
Entity(id=1)
Entity(id=2)
Entity(id=3)
Entity(id=)
Entity(id=)
Entity(id=)
Entity(id=)
Entity(id=7)
Entity(id=6)
Entity(id=5)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;I 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; 
Entity(id=4)
Entity(id=1)
Entity(id=2)
Entity(id=3)
Entity(id=)
Entity(id=7)
Entity(id=6)
Entity(id=5)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="16427" author="beberlei" created="Sun, 4 Sep 2011 21:28:45 +0000"  >&lt;p&gt;Yes, but can you show me your DQL statement?&lt;/p&gt;</comment>
                    <comment id="16437" author="hypolite" created="Mon, 5 Sep 2011 08:49:50 +0000"  >&lt;p&gt;I&apos;m using Native Query, so I guess it&apos;s not DQL, but here&apos;s the query (Oracle SQL)&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT *
FROM (
    SELECT to_date(:date_start,\&apos;dd-mm-yyyy\&apos;) + rownum -1 as period_date
    FROM all_objects
    WHERE rownum &amp;lt;= to_date(:date_end,\&apos;dd-mm-yyyy\&apos;) - to_date(:date_start,\&apos;dd-mm-yyyy\&apos;)+1
)
LEFT JOIN entity ON period_date = entity_date&apos;,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16600" author="beberlei" created="Sat, 15 Oct 2011 16:32:52 +0000"  >&lt;p&gt;For the Array- and ObjectHydrator the ID is a required result.&lt;/p&gt;

&lt;p&gt;I am not sure how to proceed with this, i think the right behavior is to return null as the object when no id is found. What do you think?&lt;/p&gt;

&lt;p&gt;Is the Date a scalar value of the result?&lt;/p&gt;</comment>
                    <comment id="16611" author="hypolite" created="Sat, 15 Oct 2011 22:37:57 +0000"  >&lt;p&gt;The expected results would be, in order of preference :&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Entity without id set (like in my example above)&lt;/li&gt;
	&lt;li&gt;null value&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And yes, the Date was an additional scalar value for which I needed the Native Query &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="16619" author="beberlei" created="Sun, 16 Oct 2011 06:57:01 +0000"  >&lt;p&gt;Your example lacks details but, for case one. Did the queries return values for the non-id columns of this entity?&lt;/p&gt;</comment>
                    <comment id="16623" author="hypolite" created="Sun, 16 Oct 2011 07:32:37 +0000"  >&lt;p&gt;Sorry for the concision, I didn&apos;t wanted to flood my comment with unrelated data.&lt;/p&gt;

&lt;p&gt;The fact is the queries returned values for the non-id columns when the ID was set, and null values when not. I will update my comment.&lt;/p&gt;</comment>
                    <comment id="16630" author="beberlei" created="Sun, 16 Oct 2011 09:18:17 +0000"  >&lt;p&gt;I will go with adding NULL values there. This is more consistent, since null represents a non-existent entity.&lt;/p&gt;

&lt;p&gt;Fixed and merged back into 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1346] Error when referencing aliased sub-select in where clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1346</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Example:
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb-&amp;gt;addSelect(&apos;(SELECT COUNT(tp2) FROM TeamPlayer tp2 WHERE tp2.team = t) AS test&apos;);

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

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

<item>
            <title>[DDC-1335] QueryBuilder-&gt;form() does not allow the INDEX BY clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1335</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The QueryBuilder does not allow the INDEX BY clause in the form() function, so queris like &apos;SELECT u FROM User u INDEX BY u.id&apos; are not possible just using the QueryBuilder. There is the option in the join() functions but when a join is not needed, you can only use DQL.&lt;/p&gt;

&lt;p&gt;If you find id appropiate i&apos;ll work on a patch for the issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12928">DDC-1335</key>
            <summary>QueryBuilder-&gt;form() does not allow the INDEX BY clause</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="acasademont">Albert Casademont</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Aug 2011 08:44:57 +0000</created>
                <updated>Sun, 25 Sep 2011 22:38:25 +0000</updated>
                    <resolved>Sun, 25 Sep 2011 22:38:25 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="16368" author="sandermarechal" created="Mon, 22 Aug 2011 13:14:22 +0000"  >&lt;p&gt;I too would like to see this. I thought this issue was fixed with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1145&quot; title=&quot;INDEX BY is not supported by the QueryBuilder&quot;&gt;&lt;del&gt;DDC-1145&lt;/del&gt;&lt;/a&gt; but that only solves it for joins. It does not allow indexing on the result itself. I would like to see something like this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$builder-&amp;gt;select(&apos;u&apos;)-&amp;gt;from(&apos;User&apos;)-&amp;gt;indexBy(&apos;u.id&apos;);
$builder-&amp;gt;getQuery()-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or it may be better to implement it on the query (since it affects hydration rather than the query itself):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$builder-&amp;gt;select(&apos;u&apos;)-&amp;gt;from(&apos;User&apos;);
$builder-&amp;gt;getQuery()-&amp;gt;setIndex(&apos;u.id&apos;)-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16524" author="guilhermeblanco" created="Sun, 25 Sep 2011 22:38:25 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/80284a273ded303c059b013808d1199d8546d359&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/80284a273ded303c059b013808d1199d8546d359&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1316] Insert statement for joined subclass presister doesn&apos;t type change the id values for subtables</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1316</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;I am using &quot;Class Table Inheritance&quot; and this are my entities.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;**
 * @Entity
 * @Table (name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Vehicles&quot;&lt;/span&gt;)
 * @InheritanceType (&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn (name=&lt;span class=&quot;code-quote&quot;&gt;&quot;vehicleClass&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;own&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;OwnCar&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;renta&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;RentedCar&quot;&lt;/span&gt;})
 */
class Vehicle
{

	/**
	 * @Id
	 * @Column (name=&lt;span class=&quot;code-quote&quot;&gt;&quot;vehicleID&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $vehicleID;

        /**
	 * @Id
         * @Column (name=&lt;span class=&quot;code-quote&quot;&gt;&quot;dateFrom&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;)
         */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $dateFrom;

       .........
}
&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;OwnCars&quot;&lt;/span&gt;)
 * @Entity (repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;OwnCarRepo&quot;&lt;/span&gt;)
 */
class OwnCars_Model_Entity_OwnCar &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; OwnCars_Model_Entity_Vehicle {

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


&lt;p&gt;As you can see i am using composed id keys. The problem that i get is when building the insert statement the value for the second key which is type datetime is not transformed to date transformed but cast to integer and in the data base i got inserted value of 0000-00-00 00:00:00 instead of the date that i have given. After i did a bit of debugging  i found the problem to be in the &quot;Doctrine\ORM\Persisters\JoinedSubclassPersister&quot; on line 163.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;foreach ((array) $id as $idVal) {
    $stmt-&amp;gt;bindValue($paramIndex++, $idVal);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see when you are binding the values for the subtable ids you are not giving the type for the id. So for me to work i did a quick fix:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;foreach ((array) $id as $columnNameIdentifier =&amp;gt; $idVal) {

    /**
     * Fix untyped join inherited table.
     * All identifiers was typed now.
     */
    $type = \PDO::PARAM_STR;
    &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;_columnTypes[$columnNameIdentifier])) {
        $type = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_columnTypes[$columnNameIdentifier];
    }

    $stmt-&amp;gt;bindValue($paramIndex++, $idVal, $type);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I hope that you will have time to take a look in to that problem soon as it is important for my project. Otherwise great work so far with the &quot;ORM&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;

&lt;p&gt;Have a nice day,&lt;br/&gt;
Victor&lt;/p&gt;</description>
                <environment></environment>
            <key id="12896">DDC-1316</key>
            <summary>Insert statement for joined subclass presister doesn&apos;t type change the id values for subtables</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="vigor_bg">victor Velkov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Aug 2011 07:08:07 +0000</created>
                <updated>Mon, 31 Oct 2011 20:52:06 +0000</updated>
                    <resolved>Mon, 5 Sep 2011 05:24:22 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16275" author="beberlei" created="Sat, 6 Aug 2011 17:02:47 +0000"  >&lt;p&gt;Even if we fixed that it wouldn&apos;t work to have a DateTime as primary key. Since PK values need to be &quot;stringable&quot;.&lt;/p&gt;</comment>
                    <comment id="16276" author="beberlei" created="Sat, 6 Aug 2011 17:06:16 +0000"  >&lt;p&gt;Changed to improvement and link to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1320&quot; title=&quot;Ship Immutable date time with Doctrine Common, use in ORM - Should implement __toString()&quot;&gt;DDC-1320&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16432" author="guilhermeblanco" created="Mon, 5 Sep 2011 05:24:22 +0000"  >&lt;p&gt;Even though DateTime would be solved in a different way, I think the patch must be applied specially because the identifier can be anything else, including a user customized type.&lt;/p&gt;

&lt;p&gt;I fixed this issue by commit: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/666691f84fd5a48d0eb6af7e93b83c2651555e61&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/666691f84fd5a48d0eb6af7e93b83c2651555e61&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16505" author="beberlei" created="Sun, 25 Sep 2011 13:20:29 +0000"  >&lt;p&gt;Set to 2.2-DEV as one thing is unclear for me, see commit comment.&lt;/p&gt;</comment>
                    <comment id="16751" author="beberlei" created="Mon, 31 Oct 2011 20:52:06 +0000"  >&lt;p&gt;Merged into 2.1.x&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="12904">DDC-1320</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1266] doctrine drop sequence twice</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1266</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;when &quot;_platform-&amp;gt;supportsSequences()&quot;, a sequence can be droped twice&lt;/p&gt;

&lt;p&gt;patch attached&lt;/p&gt;</description>
                <environment></environment>
            <key id="12810">DDC-1266</key>
            <summary>doctrine drop sequence twice</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="mathroc">Mathieu Rochette</reporter>
                        <labels>
                    </labels>
                <created>Sun, 10 Jul 2011 15:56:27 +0000</created>
                <updated>Mon, 31 Oct 2011 22:04:38 +0000</updated>
                    <resolved>Mon, 31 Oct 2011 22:04:15 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16755" author="beberlei" created="Mon, 31 Oct 2011 22:04:15 +0000"  >&lt;p&gt;Fixed in DBAL now by using SplObjectStorage to have only one unique sequence to drop (same for tables and foreign keys)&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="12504">DDC-1082</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="11027" name="doctrine-orm_drop-sequence-twice.patch" size="790" author="mathroc" created="Sun, 10 Jul 2011 15:56:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1082] On PostgreSQL &quot;doctrine orm:schema-tool:drop --force&quot; will not delete all tables created by orm:schema-tool:create and still report success</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1082</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;doctrine orm:schema-tool:drop --force&lt;/p&gt;

&lt;p&gt;will report success even if there are still tables in the schema. The tables remaining are regular tables pertaining to the schema, which was originally created by the doctrine tools, and the tables should have be deleted regularly.&lt;/p&gt;

&lt;p&gt;Repeating the command will delete all tables as expected.&lt;/p&gt;

&lt;p&gt;I tried this with PostgreSQL 8.4.7 on Debian/Linux 5.0.&lt;/p&gt;


&lt;p&gt;Btw, I think there should be another issue priority to assign to bugs like these. I made this a major bug, because in the existing priority system, according to the issue priority definitions, I think this closer to a major bug than to a minor bug because the system gives wrong information to the user, so that the underlying problem manifests in subsequent errors only, and is hard to detect if you believe the console tool&apos;s output. Still, it is easy to work around it. I would deem this a &quot;normal&quot; bug. &quot;Major&quot; seems to severe while &quot;minor&quot; seems not severe enough. Do you think it is worthwhile to introduce &quot;normal&quot;? This could help distinguish the real &quot;major&quot; bugs from those just declared as &quot;major&quot; because there was no option to declare them normal, and maybe give you a better focus on the more important bugs.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12504">DDC-1082</key>
            <summary>On PostgreSQL &quot;doctrine orm:schema-tool:drop --force&quot; will not delete all tables created by orm:schema-tool:create and still report success</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, 28 Mar 2011 05:39:21 +0000</created>
                <updated>Mon, 31 Oct 2011 22:04:47 +0000</updated>
                    <resolved>Mon, 31 Oct 2011 22:04:47 +0000</resolved>
                            <version>2.0.2</version>
                                <fixVersion>2.1.3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15601" author="dalvarez" created="Mon, 28 Mar 2011 06:05:23 +0000"  >&lt;p&gt;In my database, out of 56 tables, 17 will not be deleted. I tried to find something these tables have in common, but could not find a pattern. After repeating the drop-schema command, three tables remain, including the top-most base table in the inheritance hierarchy, and a table referenced by it. Repeating the drop-schema command again drops those tables, too.&lt;/p&gt;</comment>
                    <comment id="15793" author="beberlei" created="Sun, 1 May 2011 06:06:30 +0000"  >&lt;p&gt;I changed alot in the dropSchema command, can you try again? The problem here is with all the foreign keys.&lt;/p&gt;</comment>
                    <comment id="15817" author="dalvarez" created="Sun, 8 May 2011 18:53:16 +0000"  >&lt;p&gt;Ok, thanks.&lt;/p&gt;

&lt;p&gt;I tried again, now with Doctrine version 2.04.&lt;/p&gt;

&lt;p&gt;I updated the Doctrine 2 installation to version 2.04, then recreated the complete database from scratch using doctrine orm:schema-tool:create --force.&lt;br/&gt;
Before recreating the database, I manually, dropped all tables in the database, and verified all tables were gone. I also regenerated the proxy classes, just in case it could have any effect. &lt;/p&gt;

&lt;p&gt;The 86 tables have been created, as expected.&lt;/p&gt;


&lt;p&gt;Then I tried to drop the database by calling doctrine orm:schema-tool:drop --force.&lt;/p&gt;

&lt;p&gt;After using the command, there are still 17 tables remaining.&lt;/p&gt;

&lt;p&gt;Overall, the result seems to be unaffected by the upgrade to the latest minor version.&lt;/p&gt;</comment>
                    <comment id="15818" author="dalvarez" created="Sun, 8 May 2011 19:03:43 +0000"  >&lt;p&gt;One thing that works now, though, is that calling doctrine orm:schema-tool:drop --force repeatedly, will also delete the 17 tables remaining after the first call.&lt;/p&gt;

&lt;p&gt;So it did get better, although it does not work the first time it gets called, and still wrongly reports success the first time.&lt;/p&gt;</comment>
                    <comment id="16021" author="beberlei" created="Sun, 19 Jun 2011 08:42:54 +0000"  >&lt;p&gt;This should be fixed now, SchemaTool didnt handle sequence removal correctly before. Can you verify?&lt;/p&gt;</comment>
                    <comment id="16031" author="dalvarez" created="Sun, 19 Jun 2011 11:23:51 +0000"  >&lt;p&gt;Hey Ben,&lt;/p&gt;

&lt;p&gt;I am currently travelling and do not have access to any development system. I will be back home by July, 1st and will have a look at this and let you know. Thanks for fixing it.&lt;/p&gt;</comment>
                    <comment id="16138" author="mathroc" created="Sun, 10 Jul 2011 16:53:11 +0000"  >&lt;p&gt;maybe it&apos;s related to this bug : &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1266&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1266&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I just found this piece of code that mutes exceptions... &lt;/p&gt;
&lt;div class=&quot;code panel&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) {
            &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
                $conn-&amp;gt;executeQuery($sql);
            } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(\Exception $e) {
                
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;maybe I&apos;m missing something but even after reading the function comment this seems like a bad idea.&lt;br/&gt;
if dropTable is called within a transaction, the transaction will be aborted and the function will still return as if sucessful&lt;/p&gt;</comment>
                    <comment id="16184" author="dalvarez" created="Wed, 20 Jul 2011 15:15:36 +0000"  >&lt;p&gt;@Mathieu: Yes, that could very well be the root cause.&lt;/p&gt;


&lt;p&gt;@Benjamin: I verified that the error is still there, now with Doctrine 2.1 and PostgreSQL 8.4. The command line tool (doctrine orm:schema-tool:drop --force) still wrongly reports success, in spite of several tables remaining in the schema.&lt;/p&gt;

&lt;p&gt;Once I remove the try-catch-construct mentioned by Mathieu above (leaving the try block&apos;s content intact, of course), and reissue the command, there are exceptions. E.g.:&lt;/p&gt;

&lt;p&gt;PDOException SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42P01&amp;#93;&lt;/span&gt;: Undefined table: 7 ERROR:  sequence &quot;some_random_sequence_seq&quot; does not exist.&lt;/p&gt;

&lt;p&gt;I believe that the intention of the try-catch-block above is to mute exactly that type of error, since it should not make any difference if something that is not there could not be deleted, because, after all, it is gone anyway. Unfortunately, it actually does make a difference in case several SQL-DDL commands are combined into a single call, because if any command in the call fails and raises an exception, all following commands in the same call will not be executed. I have not analyzed this further, but I think there is something smelly here.&lt;/p&gt;</comment>
                    <comment id="16756" author="beberlei" created="Mon, 31 Oct 2011 22:04:47 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="12810">DDC-1266</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>