<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed Jun 19 06:29:13 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DDC+AND+fixVersion+%3D+%222.1%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DDC+AND+fixVersion+%3D+%222.1%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="108" total="108"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-1172] Schema tool does not drop sequences on table drop for PostgreSql platform</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1172</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When recreating database using&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$schemaTool-&amp;gt;dropSchema($metaDatas);
$schemaTool-&amp;gt;createSchema($metaDatas);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the second line fails with error that the sequence &quot;tbl_id_seq&quot; already exists. It&apos;s because the sequence is created without an owner column and schema tool doesn&apos;t include &quot;drop sequence&quot; statements in the drop SQL.&lt;/p&gt;

&lt;p&gt;I&apos;ve created a patch which fixes the problem for my environment. Revision numbers in patch is from the local SVN. Doctrine base is 2.0.5.&lt;/p&gt;</description>
                <environment>PostgreSql 8.4</environment>
            <key id="12670">DDC-1172</key>
            <summary>Schema tool does not drop sequences on table drop for PostgreSql platform</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>Thu, 26 May 2011 12:59:08 +0000</created>
                <updated>Fri, 1 Mar 2013 16:26:15 +0000</updated>
                    <resolved>Fri, 17 Jun 2011 18:40:01 +0000</resolved>
                            <version>2.0.5</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15946" author="beberlei" created="Sun, 5 Jun 2011 15:32:54 +0000"  >&lt;p&gt;That will always drop all sequences also when you only pass some classes in there. We need to find a better solution for this problem.&lt;/p&gt;</comment>
                    <comment id="16007" author="beberlei" created="Fri, 17 Jun 2011 18:40:01 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                    <comment id="19790" author="pylebecq" created="Fri, 1 Mar 2013 16:26:15 +0000"  >&lt;p&gt;I don&apos;t know if this is the right place to add a comment because this bug is quite old, and if anyone will see it but &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/42c5382a037c95960744341030313c7472f6c15b&quot; class=&quot;external-link&quot;&gt;the code that fixed the reported bug&lt;/a&gt; seems to create a bug on my setup. The SchemaTool tries to drop two times the sequences, which produces an error.&lt;/p&gt;

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

&lt;p&gt;    ALTER TABLE utilisateurs DROP CONSTRAINT fk_497b315e7634f637;&lt;br/&gt;
    ALTER TABLE utilisateurs DROP CONSTRAINT fk_497b315e19863134;&lt;br/&gt;
    DROP SEQUENCE civilites_civ_id_seq;&lt;br/&gt;
    DROP SEQUENCE utilisateursClientType_ucty_id_seq;&lt;br/&gt;
    DROP SEQUENCE utilisateurs_user_id_seq;&lt;br/&gt;
    DROP SEQUENCE civilites_civ_id_seq;&lt;br/&gt;
    DROP SEQUENCE utilisateursclienttype_ucty_id_seq;&lt;br/&gt;
    DROP SEQUENCE utilisateurs_user_id_seq;&lt;br/&gt;
    DROP TABLE civilites;&lt;br/&gt;
    DROP TABLE utilisateursClientType;&lt;br/&gt;
    DROP TABLE utilisateurs&lt;/p&gt;

&lt;p&gt;I&apos;m using postgres 9.1.8, Doctrine 2.3.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10996" name="DoctrineDropSequencePatch.diff" size="435" author="gedrox" created="Thu, 26 May 2011 12:59:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-250] ArrayCollection Key Column @indexBy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-250</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;To be honest I feel like I saw this mentioned somewhere, but after looking around I couldn&apos;t find it, so I&apos;ll just post this anyway.&lt;/p&gt;

&lt;p&gt;I&apos;d like the ability to set a property as the associative key on ArrayCollections.  This functionality could probably be done in a PostLoad by iterating over the objects, but it seems like ArrayCollection should be able to handle this functionality already, it&apos;s just a matter of modifying the mapper/parser.&lt;/p&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;/**
 * @Entity
 */
class Object
{
//... $id column and anything else ...
    /**
     * @OneToMany(targetEntity=&quot;Param&quot;, mappedBy=&quot;object&quot;)
     */
    protected $params;
//...
    public function getParam($name)
    {
         return $this-&amp;gt;params[$name];
    }
}

/**
 * @Entity
 */
class Param
{
    /**
     * @ManyToOne(targetEntity=&quot;Object&quot;)
     * @JoinColumn(name=&quot;object_id&quot;, referencedColumnName=&quot;id&quot;, nullable=&quot;false&quot;)
     */
    protected $object;
    /**
     * @Column(type=&quot;string&quot;)
     */
    protected $name;
    /**
     * @Column(type=&quot;string&quot;)
     */
    protected $value;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you were able to specify an ArrayCollection key column then you would be able to have functions like getParam without having to loop over the objects in the collection.  Something like:&lt;/p&gt;
    &lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt; @OneToMany(targetEntity=&quot;Param&quot;, mappedBy=&quot;object&quot;, collectionKey=&quot;name&quot;) &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10718">DDC-250</key>
            <summary>ArrayCollection Key Column @indexBy</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mridgway">Michael Ridgway</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jan 2010 19:49:22 +0000</created>
                <updated>Thu, 11 Oct 2012 12:34:56 +0000</updated>
                    <resolved>Sat, 5 Feb 2011 05:50:46 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="12714" author="marijn" created="Mon, 19 Apr 2010 19:06:36 +0000"  >&lt;p&gt;As much as I would like this I doubt it is &lt;del&gt;possible&lt;/del&gt; feasible. Imagine the &lt;tt&gt;name&lt;/tt&gt; column of your &lt;tt&gt;Param&lt;/tt&gt; object not being unique for you your linked &lt;tt&gt;Object&lt;/tt&gt;..? How could the &lt;tt&gt;ArrayCollection&lt;/tt&gt; &lt;em&gt;know&lt;/em&gt; which instance to add to the collection and which one not?&lt;/p&gt;</comment>
                    <comment id="12715" author="mridgway" created="Mon, 19 Apr 2010 19:31:39 +0000"  >&lt;p&gt;You are absolutely correct.  There is no way to ensure the uniqueness of the collection elements.  This is something that would have to be ensured in the domain model and shouldn&apos;t have anything to do with Doctrine.&lt;/p&gt;

&lt;p&gt;It will certainly work to loop through the collection on PostLoad (once &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-54&quot; title=&quot;Trigger postLoad events and callbacks after associations have been initialized&quot;&gt;DDC-54&lt;/a&gt; is implemented).  For now, I just set the keys the first time I call getParam().&lt;/p&gt;

&lt;p&gt;I suppose I should close this (I forgot it was still open).&lt;/p&gt;</comment>
                    <comment id="14540" author="mridgway" created="Wed, 6 Oct 2010 11:51:39 +0000"  >&lt;p&gt;I just noticed that DQL has an INDEX BY keyword to be able to do this during a DQL query.  Is this something that could  then be possible to set in a oneToMany or manyToMany?  It seems like most of the groundwork for being able to do this is already done.&lt;/p&gt;</comment>
                    <comment id="15003" author="beberlei" created="Fri, 24 Dec 2010 04:43:17 +0000"  >&lt;p&gt;Example code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php

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

    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $headline;

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Translation&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;language&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $translations;
}

class Translation
{
    /**
     * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $language;

    /**
     * @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;translations&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $article;

    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $headline;
}


$article = $em-&amp;gt;find(&lt;span class=&quot;code-quote&quot;&gt;&quot;Article&quot;&lt;/span&gt;, 1);
$article-&amp;gt;translations[&lt;span class=&quot;code-quote&quot;&gt;&quot;en&quot;&lt;/span&gt;]-&amp;gt;headlinle;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this case @IndexBy uses the Translation::$language as key for the collection.&lt;/p&gt;</comment>
                    <comment id="15005" author="beberlei" created="Fri, 24 Dec 2010 04:46:15 +0000"  >&lt;p&gt;Schedule for 2.1&lt;/p&gt;</comment>
                    <comment id="15231" author="beberlei" created="Sat, 5 Feb 2011 05:50:46 +0000"  >&lt;p&gt;This is now in master &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/7390030854cdb4b775f6f11f83c970ab2705e924&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/7390030854cdb4b775f6f11f83c970ab2705e924&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Syntax is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;@ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;OtherEntity&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;foreignField&quot;&lt;/span&gt;)
@OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;OtherEntity&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;foreignField&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;many-to-many index-by=&lt;span class=&quot;code-quote&quot;&gt;&quot;foreignField&quot;&lt;/span&gt; /&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;manyToMany:
  indexBy: foreignField
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="18824" author="beberlei" created="Thu, 11 Oct 2012 12:34:56 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-470&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/470&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/470&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="12359">DDC-1018</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10620">DDC-213</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1209] DateTime (and other custom object types) cannot be used in primary key (singular or composite)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1209</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This bug was encountered using a DateTime type as an @Id, but it appears that it will affect any type of custom data type if it is an object.&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Id\AssignedGenerator checks to see if the key is an object. If so it does a look up in the identity map to find the object, but in the case of DateTime it will not find it and throws an exception. It is appears this is the case for both singular and composite keys as shown in the attached test.&lt;/p&gt;

&lt;p&gt;Offending code: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Id/AssignedGenerator.php#L52&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Id/AssignedGenerator.php#L52&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test case forthcoming.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12716">DDC-1209</key>
            <summary>DateTime (and other custom object types) cannot be used in primary key (singular or composite)</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="mridgway">Michael Ridgway</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Jun 2011 21:11:28 +0000</created>
                <updated>Fri, 14 Sep 2012 01:22:00 +0000</updated>
                    <resolved>Thu, 16 Jun 2011 18:56:57 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="15993" author="mridgway" created="Wed, 15 Jun 2011 21:16:11 +0000"  >&lt;p&gt;Test case: &lt;a href=&quot;https://github.com/mridgway/doctrine2/blob/DDC-1209/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php&quot; class=&quot;external-link&quot;&gt;https://github.com/mridgway/doctrine2/blob/DDC-1209/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15998" author="mridgway" created="Thu, 16 Jun 2011 15:07:03 +0000"  >&lt;p&gt;I posted a fix and it was merged this morning by Guilherme: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/74&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/74&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18623" author="jonathaningram" created="Tue, 11 Sep 2012 02:12:12 +0000"  >&lt;p&gt;I am wondering if this fix is working correctly or has regressed?&lt;/p&gt;

&lt;p&gt;I have a YAML file as follows:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt; 
Acme\Entity\SearchExecution:
    type: entity
    table: search_execution
    id:
        search:
            associationKey: true
        # It seems this is not working
        dateExecuted:
            type: datetime
            column: Date
    fields:
        executionTime:
            type: integer
    manyToOne:
        search:
            targetEntity: Acme\Entity\Search
            joinColumn:
                name: SearchID
                referencedColumnName: id
        user:
            targetEntity: Acme\Entity\User
            joinColumn:
                name: ByUserID
                referencedColumnName: id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So the &quot;dateExecuted&quot; field is used to compose an artificial primary key since the table has no PK.&lt;/p&gt;

&lt;p&gt;The error is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
[ErrorException]                                                                                                                                                                                
  Catchable Fatal Error: &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; of class DateTime could not be converted to string in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1295

Exception trace:
 () at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1295
 Symfony\Component\HttpKernel\Debug\ErrorHandler-&amp;gt;handle() at n/a:n/a
 implode() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1295
 Doctrine\ORM\UnitOfWork-&amp;gt;addToIdentityMap() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1125
 Doctrine\ORM\UnitOfWork-&amp;gt;scheduleForInsert() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:810
 Doctrine\ORM\UnitOfWork-&amp;gt;persistNew() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1540
 Doctrine\ORM\UnitOfWork-&amp;gt;doPersist() at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1501
 Doctrine\ORM\UnitOfWork-&amp;gt;persist() at vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:565
 ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In my composer.json, the relevant versions of Doctrine are:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    {
        {
            &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine/common&quot;&lt;/span&gt;,
            &lt;span class=&quot;code-quote&quot;&gt;&quot;version&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;2.3.0-RC1&quot;&lt;/span&gt;
        },
        {
            &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine/dbal&quot;&lt;/span&gt;,
            &lt;span class=&quot;code-quote&quot;&gt;&quot;version&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;2.3.x-dev&quot;&lt;/span&gt;,
            &lt;span class=&quot;code-quote&quot;&gt;&quot;source-reference&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;239630b61f03f39d198441eced1bfffb7b0e61d1&quot;&lt;/span&gt;,
            &lt;span class=&quot;code-quote&quot;&gt;&quot;commit-date&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;1346866589&quot;&lt;/span&gt;
        },
        {
            &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine/orm&quot;&lt;/span&gt;,
            &lt;span class=&quot;code-quote&quot;&gt;&quot;version&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;2.3.0-RC1&quot;&lt;/span&gt;
        },
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is this a bug or am I misusing this?&lt;/p&gt;</comment>
                    <comment id="18638" author="stof" created="Thu, 13 Sep 2012 09:56:56 +0000"  >&lt;p&gt;this has never been supported. Doctrine 2 has always required id fields to be castable as string, which is not the case of a DateTime object&lt;/p&gt;</comment>
                    <comment id="18641" author="jonathaningram" created="Fri, 14 Sep 2012 01:22:00 +0000"  >&lt;p&gt;But didn&apos;t the PR &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/74&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/74&lt;/a&gt; get merged in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/98bc3c4e402731fae8716e99c7c19d5e0ff7b60a&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/98bc3c4e402731fae8716e99c7c19d5e0ff7b60a&lt;/a&gt; ? And you can see the use of @Id in the test cases, e.g. &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/98bc3c4e402731fae8716e99c7c19d5e0ff7b60a#L2R78&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/98bc3c4e402731fae8716e99c7c19d5e0ff7b60a#L2R78&lt;/a&gt; ?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-945] Crashing Bug: BasicEntityPersister::_getSelectColumnListSQL returns empty list, thus generating wrong SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-945</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a situation where Doctrine generates a wrong SQL query and crashes with an exception.&lt;/p&gt;

&lt;p&gt;The userland code calls the EntityManager::merge method.&lt;/p&gt;

&lt;p&gt;The query generated looks like &quot;SELECT FROM SomeTable&quot;, meaning it has no select column list, and therefore it&apos;s plainly wrong.&lt;/p&gt;

&lt;p&gt;The entity I am trying to merge back into the entity manager is a regular entity with state detached. The class has a column which is declared as ID and filled with an autogenerated value, three regular columns, and a one-to-many relationship. The to-many-relationship causes BasicEntityPersister::loadOneToManyCollection() to be called, which in turn calls BasicEntityPersister::_getSelectEntitiesSQL, which then calls BasicEntityPersister::_getSelectColumnListSQL, which wrongly returns an empty string, thus leading to the corrupt query without a select column list being generated. The target entity of the one-to-many relationship is a mapped superclass, which has an ID (again with autogenerated values), and a many-to-one relationship inversing the one in the first entity. Further fields depend on its exact type as determined by the inheriting entities, but it will always have some.&lt;/p&gt;

&lt;p&gt;Here is the exception, up to the point where the trace leaves the ORM:&lt;/p&gt;

&lt;p&gt;exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;FROM VersionedDataObject t0&apos; at line 1&apos; in /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/DBAL/Connection.php:577 Stack trace: #0 /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/DBAL/Connection.php(577): PDO-&amp;gt;query(&apos;SELECT FROM Ve...&apos;) #1 /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/ORM/Persisters/BasicEntityPersister.php(1173): Doctrine\DBAL\Connection-&amp;gt;executeQuery(&apos;SELECT FROM Ve...&apos;, Array) #2 /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/ORM/UnitOfWork.php(1984): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;loadOneToManyCollection(Array, Object(persistentData\model\versioning\InputComponentDataVersion), Object(Doctrine\ORM\PersistentCollection)) #3 /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/ORM/PersistentCollection.php(207): Doctrine\ORM\UnitOfWork-&amp;gt;loadCollection(Object(Doctrine\ORM\PersistentCollection)) #4 /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/ORM/UnitOfWork.php(1441): Doctrine\ORM\PersistentCollection-&amp;gt;initialize() #5 /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/ORM/UnitOfWork.php(1323): Doctrine\ORM\UnitOfWork-&amp;gt;doMerge(Object(persistentData\model\versioning\InputComponentDataVersion), Array) #6 /var/www/invoiceCreator/src/thirdPartyComponents/doctrine/Doctrine/ORM/EntityManager.php(520): Doctrine\ORM\UnitOfWork-&amp;gt;merge(Object(persistentData\model\versioning\InputComponentDataVersion))&lt;/p&gt;


&lt;p&gt;This one is a blocker by user standards. The error means that it is impossible to use Doctrine in long-running batch jobs like in my situation, because it does not support merging certain detached objects back into the entity manager at all, while at some point they need to be detached for virtual memory capacity reasons.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12245">DDC-945</key>
            <summary>Crashing Bug: BasicEntityPersister::_getSelectColumnListSQL returns empty list, thus generating wrong SQL</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="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Dec 2010 11:04:51 +0000</created>
                <updated>Sat, 14 Apr 2012 05:48:44 +0000</updated>
                    <resolved>Tue, 28 Dec 2010 06:09:38 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14994" author="dalvarez" created="Wed, 22 Dec 2010 11:10:40 +0000"  >&lt;p&gt;Added a more accurate description of both entities involved.&lt;/p&gt;</comment>
                    <comment id="14996" author="beberlei" created="Wed, 22 Dec 2010 11:53:48 +0000"  >&lt;p&gt;This is not enough information to reproduce this issue. We have tests that show merge and detach works. I need more code, mapping files and a reproduce set.&lt;/p&gt;

&lt;p&gt;If yo udont want to attach it to the issue you can send me a mail.&lt;/p&gt;</comment>
                    <comment id="15017" author="dalvarez" created="Sat, 25 Dec 2010 13:15:07 +0000"  >&lt;p&gt;After analyzing the problem further, I think it is nothing but a subsequent error due to the bidirectional association in the mapped superclass, which is documented to not work in the first place, as relationships declared in mapped superclasses must be unidirectional. After changing the mapped superclass to a regular entity, the application is working.&lt;/p&gt;

&lt;p&gt;The only remaining problem in this case is the crashing effect. This is due to the rudimentary data model validation combined with the total lack of decent error messages in Doctrine 2. As there is no apparent relationship between the symptom (exception due to incorrect SQL being generated) and the effective technical source of the problem (bidirectional relationship declared in a mapped superclass), it is unnecessarily cumbersome to determine what possible sources of error to look for. It would be great if doctrine could defend itself against non-conforming data model inputs by producing an understandable error message instead of just crashing.&lt;/p&gt;

&lt;p&gt;I will leave this bug open as a validation issue.&lt;/p&gt;</comment>
                    <comment id="15021" author="beberlei" created="Mon, 27 Dec 2010 03:55:25 +0000"  >&lt;p&gt;Yeah this is annoying, i check if we can implement a cheap runtime validation when loading the class metadata.&lt;/p&gt;</comment>
                    <comment id="15035" author="beberlei" created="Tue, 28 Dec 2010 06:09:38 +0000"  >&lt;p&gt;Throwing mapping exception if using a mapped superclass with ManyToMany or OneToMany association now.&lt;/p&gt;</comment>
                    <comment id="15060" author="dalvarez" created="Wed, 29 Dec 2010 19:02:44 +0000"  >&lt;p&gt;Thanks for fixing this.&lt;/p&gt;

&lt;p&gt;Shouldn&apos;t it actually only throw an exception when using &lt;b&gt;bidirectional&lt;/b&gt; associations with a mapped superclass?&lt;/p&gt;</comment>
                    <comment id="15076" author="beberlei" created="Fri, 31 Dec 2010 08:34:27 +0000"  >&lt;p&gt;Not exactly but you are right, unidirectional Many To Many associations work if you use the Mapped Superclass only once. I will adjust the patch accordingly.&lt;/p&gt;

&lt;p&gt;For 2.1 there will be an additional feature described in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-964&quot; title=&quot;Implement @AssociationOverride and @FieldOverride for MappedSuperclasses&quot;&gt;&lt;del&gt;DDC-964&lt;/del&gt;&lt;/a&gt; that allows overriding certain mapped superclass details to avoid these problems.&lt;/p&gt;</comment>
                    <comment id="15077" author="beberlei" created="Fri, 31 Dec 2010 08:41:26 +0000"  >&lt;p&gt;Corrected.&lt;/p&gt;</comment>
                    <comment id="17628" author="beberlei" created="Thu, 22 Mar 2012 22:07:10 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-218&amp;#93;&lt;/span&gt; was &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/218&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/218&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17845" author="beberlei" created="Sat, 14 Apr 2012 05:48:44 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-335&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/335&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/335&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1024] the EntityGenerator generate getters and setters for properties of the parent class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1024</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;when using the EntityGenerator to generate getters and setters of two classes mapped with annotations, one inheriting from the other, the EntityGenerator generates getters and setters for the properties of the parent class in the child class too. This occurs since the recent EntityGenerator changes (as it did not care about inheritance before).&lt;br/&gt;
I suppose this is due to the fact that the getters and setters of the parent class are not yet generated when handling the child class.&lt;/p&gt;

&lt;p&gt;I haven&apos;t try if it works well when using XML or YAML for the mapping.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12368">DDC-1024</key>
            <summary>the EntityGenerator generate getters and setters for properties of the parent class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Feb 2011 15:16:16 +0000</created>
                <updated>Wed, 4 Jan 2012 11:24:41 +0000</updated>
                    <resolved>Sat, 12 Feb 2011 12:24:53 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15279" author="beberlei" created="Sat, 12 Feb 2011 11:20:38 +0000"  >&lt;p&gt;How do you define inheritance?&lt;/p&gt;</comment>
                    <comment id="15280" author="stof" created="Sat, 12 Feb 2011 11:27:47 +0000"  >&lt;p&gt;In my case, it was inheritance using a Single Table Inheritance.&lt;/p&gt;

&lt;p&gt;Both entities were in the same Symfony2 Bundle so the getters and setters were generated by the same command.&lt;/p&gt;</comment>
                    <comment id="15283" author="beberlei" created="Sat, 12 Feb 2011 12:24:53 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                    <comment id="16764" author="yakobe" created="Tue, 1 Nov 2011 15:29:42 +0000"  >&lt;p&gt;I am still having this problem with the 2.1 branch. Should it not happen anymore?&lt;/p&gt;</comment>
                    <comment id="17172" author="albert.brand" created="Wed, 4 Jan 2012 11:24:41 +0000"  >&lt;p&gt;I&apos;m also still seeing this in 2.1 (bundled with Symfony2).&lt;br/&gt;
Using single table inheritance, adding a protected or public property to the abstract class causes private properties &amp;amp; getters &amp;amp; setters to be added to all subclasses.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1281] ORM uses BasicEntityPersister instead of JoinedSubclassPersister on a JOINED inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1281</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, &lt;br/&gt;
I have these classes:  &lt;a href=&quot;https://gist.github.com/1085518/58b5424bc0ab5af1ae65421fe832e7a1b45533cf&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/1085518/58b5424bc0ab5af1ae65421fe832e7a1b45533cf&lt;/a&gt; (read the comments to see the stracktrace) &lt;/p&gt;

&lt;p&gt;If I try: &lt;br/&gt;
$entity = $em-&amp;gt;find(&apos;Usuario&apos;, $id); &lt;br/&gt;
$entity-&amp;gt;getPessoaFisica()-&amp;gt;getId(); &lt;br/&gt;
I got this error: Class does not exist. &lt;/p&gt;

&lt;p&gt;This is looking weird because, analyzing the stacktrace, the ORM loads the proxy through the BasicEntityPersister instead of JoinedSubclassPersister.&lt;/p&gt;

&lt;p&gt;I&apos;ve been discussed about this on: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/190dc2c4b768ae13#&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/190dc2c4b768ae13#&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Daniel Lima&lt;/p&gt;</description>
                <environment>Database server: Oracle 10, Debian&lt;br/&gt;
PHP: 5.3.6&lt;br/&gt;
Apache: 2.2.18 (Windows 7 Home Premium)</environment>
            <key id="12836">DDC-1281</key>
            <summary>ORM uses BasicEntityPersister instead of JoinedSubclassPersister on a JOINED inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="yourwebmaker">Daniel Lima</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jul 2011 21:52:40 +0000</created>
                <updated>Mon, 1 Aug 2011 22:19:46 +0000</updated>
                    <resolved>Mon, 1 Aug 2011 22:01:31 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16208" author="beberlei" created="Tue, 26 Jul 2011 19:52:34 +0000"  >&lt;p&gt;It seems your mappings are wrong, the @JoinColumn maps to a column named COD_PERFIL_USUARIO, but that is not the ID of the Joined Entity base class.&lt;/p&gt;</comment>
                    <comment id="16261" author="yourwebmaker" created="Mon, 1 Aug 2011 22:01:31 +0000"  >&lt;p&gt;There was a wrong column definition on discriminator column:&lt;/p&gt;

&lt;p&gt;On the DATABASE was: CHAR(30).&lt;/p&gt;

&lt;p&gt;The hydrator filled discriminator column with &quot;F                           &quot;  or  &quot;J                            &quot; (with blank spaces), making it impossible to Discriminator map to locate the related classes.&lt;/p&gt;

&lt;p&gt;I think it&#180;s a bug with OCI driver or Doctrine&#180;s Hydrator.&lt;/p&gt;</comment>
                    <comment id="16262" author="beberlei" created="Mon, 1 Aug 2011 22:19:46 +0000"  >&lt;p&gt;That is how oracle works. It right pads chars.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1309] Doctrine_Collection toArray()  does not return results of table joins.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1309</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;e.g.&lt;br/&gt;
$doctrineCollection = Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;from(&apos;Table1 a&apos;)&lt;br/&gt;
                    -&amp;gt;innerJoin(&apos;a.Table2 b ON a.id = b.id&apos;)&lt;br/&gt;
                    -&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;$doctrineCollection-&amp;gt;toArray() will return only the contents of Table1. However, $doctrineCollection-&amp;gt;getFirst()-&amp;gt;toArray() will return the results of Table1 + an additional key named &apos;Table2&apos; which returns the join result from Table2.&lt;/p&gt;

&lt;p&gt;It does not make sense for the collection hydration to differ to that of the objects in the collection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12883">DDC-1309</key>
            <summary>Doctrine_Collection toArray()  does not return results of table joins.</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="sharn.white">Sharn White</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Aug 2011 01:45:33 +0000</created>
                <updated>Mon, 1 Aug 2011 01:51:09 +0000</updated>
                    <resolved>Mon, 1 Aug 2011 01:51:09 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16254" author="sharn.white" created="Mon, 1 Aug 2011 01:48:08 +0000"  >&lt;p&gt;If this is intended you can go ahead and trash this issue. Just doesn&apos;t seem right to me.&lt;/p&gt;</comment>
                    <comment id="16255" author="sharn.white" created="Mon, 1 Aug 2011 01:51:09 +0000"  >&lt;p&gt;Nevermind. I should have been setting $deep to true.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1104] Require statement in AnnotationDriver.php can cause PHP Fatal error</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1104</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The &lt;em&gt;require&lt;/em&gt; statement in &lt;tt&gt;Doctrine/ORM/Mapping/Driver/AnnotationDriver.php&lt;/tt&gt; causes troubles in some cases. Imagine the situation when you&apos;re creating your own class loader which maps all classes and loads all requested classes lazily. When it loads any class from DoctrineAnnotations.php &lt;b&gt;before&lt;/b&gt; loading AnnotationDriver and this class is loaded later, you get: &lt;tt&gt;PHP Fatal error:  Cannot redeclare class ...&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Changing &lt;em&gt;require&lt;/em&gt; to &lt;em&gt;require_once&lt;/em&gt; solves the problem.&lt;/p&gt;

&lt;p&gt;Pull request: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/45&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/45&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Linux</environment>
            <key id="12539">DDC-1104</key>
            <summary>Require statement in AnnotationDriver.php can cause PHP Fatal error</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="majkl578">Michael Moravec</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Apr 2011 12:37:52 +0000</created>
                <updated>Sun, 31 Jul 2011 10:09:03 +0000</updated>
                    <resolved>Sun, 31 Jul 2011 10:09:03 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16247" author="beberlei" created="Sun, 31 Jul 2011 10:09:03 +0000"  >&lt;p&gt;This was fixed for 2.1&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1226] OneToOne Unidirectional entities not persisting</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1226</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We have the following three entities:&lt;/p&gt;

&lt;p&gt;User&lt;br/&gt;
Participant&lt;br/&gt;
Profile&lt;/p&gt;

&lt;p&gt;... Users and Participants are two distinctly different things in our system and each has a Profile. Currently we use OneToOne unidirectional associations to &quot;map&quot; the User to it&apos;s Profile and a Participant to it&apos;s Profile. So far (2.0) we&apos;ve been able to do the following:&lt;/p&gt;

&lt;p&gt;$profile = $user-&amp;gt;getProfile();&lt;br/&gt;
$profile-&amp;gt;setLastName(&apos;Doe&apos;);&lt;br/&gt;
$em-&amp;gt;persist($profile);&lt;br/&gt;
$em-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;...and the profile is saved. In 2.1 rc1 this no longer works.&lt;/p&gt;

&lt;p&gt;After some testing it was determined that 2.1 is requiring that our Profile refer back to each object (bidirectional). Now, this may not be the best example but imagine we had another entity that wanted to make use of a Profile, we&apos;d rather not have to explicitly add the reference back for each entity that wants to use it just to get it persisted.&lt;/p&gt;

&lt;p&gt;Again, in 2.0 our setup worked fine and so far I&apos;ve been unable to find any documentation pointing to this sort of thing.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12745">DDC-1226</key>
            <summary>OneToOne Unidirectional entities not persisting</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="garrett">Garrett </reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Jun 2011 19:00:12 +0000</created>
                <updated>Sat, 23 Jul 2011 15:56:05 +0000</updated>
                    <resolved>Sat, 25 Jun 2011 12:39:03 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16066" author="beberlei" created="Sat, 25 Jun 2011 10:28:56 +0000"  >&lt;p&gt;Is this relation marked as FETCH=EAGER? Can you post the mapping files of User and Profile please?&lt;/p&gt;</comment>
                    <comment id="16067" author="beberlei" created="Sat, 25 Jun 2011 10:38:22 +0000"  >&lt;p&gt;I could reproduce this issue now.&lt;/p&gt;</comment>
                    <comment id="16068" author="beberlei" created="Sat, 25 Jun 2011 12:39:03 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="16198" author="erikhauters" created="Sat, 23 Jul 2011 15:56:05 +0000"  >&lt;p&gt;how do you mean? Fixed? Where can I find this fix?&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12748">DDC-1228</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1238] Proxy query executed, but object not initialized</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1238</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12763">DDC-1238</key>
            <summary>Proxy query executed, but object not initialized</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>Wed, 29 Jun 2011 18:16:27 +0000</created>
                <updated>Mon, 4 Jul 2011 21:44:11 +0000</updated>
                    <resolved>Mon, 4 Jul 2011 21:44:11 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16116" author="beberlei" created="Mon, 4 Jul 2011 21:44:11 +0000"  >&lt;p&gt;Fixed, nasty issue with lazy loading and $em-&amp;gt;clear()&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1239] Using a repository with composite keys generates invalid SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1239</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Invalid SQL is generated when using composite keys along with Repository methods (fineOneBy, etc). Everything works properly when using createQuery() to generate DQL manually.&lt;/p&gt;

&lt;p&gt;Working: &lt;br/&gt;
$q = $this-&amp;gt;_em&lt;br/&gt;
		-&amp;gt;createQuery(&lt;br/&gt;
			&quot;SELECT c,c2,g FROM Entity\OAuth\Consumer c LEFT JOIN c.group g LEFT JOIN c.clinic c2 WHERE c.key = &apos;{$consumer_key}&apos;&quot;);&lt;br/&gt;
$this-&amp;gt;_consumer = $q-&amp;gt;getSingleResult();&lt;/p&gt;

&lt;p&gt;Invalid:&lt;br/&gt;
$this-&amp;gt;_consumer = $this-&amp;gt;_em-&amp;gt;getRepository(&apos;Entity\OAuth\Consumer&apos;)&lt;br/&gt;
	-&amp;gt;findOneBy(array(&apos;key&apos; =&amp;gt; $consumer_key));&lt;/p&gt;

&lt;p&gt;Generated SQL for &quot;invalid&quot; method:&lt;br/&gt;
SELECT ... FROM oauth_consumer t0 LEFT JOIN groop t10 ON t0.groupId = t10.id  LEFT JOIN company t17 ON t0.companyId = t17.id  LEFT JOIN clinic t28 &lt;b&gt;ON t0.dsid = t28.dsid t0.rid = t28.rid&lt;/b&gt;  LEFT JOIN user t50 ON t0.userId = t50.id  WHERE t0.`key` = ?&lt;/p&gt;

&lt;p&gt;Notice the missing &lt;b&gt;AND&lt;/b&gt; in the query above. I&apos;ve attached the entities in question.&lt;/p&gt;</description>
                <environment>Ubuntu 11.04 (standard LAMP stack), PHP 5.3, MySQL 5.x, Apache 2</environment>
            <key id="12765">DDC-1239</key>
            <summary>Using a repository with composite keys generates invalid SQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="spiffyjr">Kyle Spraggs</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Jun 2011 18:57:56 +0000</created>
                <updated>Thu, 30 Jun 2011 19:04:58 +0000</updated>
                    <resolved>Thu, 30 Jun 2011 19:04:58 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16103" author="beberlei" created="Thu, 30 Jun 2011 19:04:58 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11021" name="Clinic.php" size="2134" author="spiffyjr" created="Thu, 30 Jun 2011 18:57:56 +0000" />
                    <attachment id="11022" name="Consumer.php" size="1528" author="spiffyjr" created="Thu, 30 Jun 2011 18:57:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1203] Single Table Inheritance - Discriminator Column is not populated</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1203</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the following class inheritance; if I have the mapped super class in there, the discriminator column is not populated; if I remove it, it is correctly set.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\Entity
 * @ORM\Table(name = &lt;span class=&quot;code-quote&quot;&gt;&quot;a&quot;&lt;/span&gt;)
 * @ORM\ChangeTrackingPolicy(&lt;span class=&quot;code-quote&quot;&gt;&quot;DEFERRED_EXPLICIT&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=20)
 * @ORM\DiscriminatorMap({
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;C&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;d&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;D&quot;&lt;/span&gt;
 * })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class A { }

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

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

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

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

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

<item>
            <title>[DDC-1233] Minor spellcheck in UnitOfWork</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1233</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On UnitOfWork, line 580:&lt;br/&gt;
                            . &quot; on the relationship. If you cannot find out which entity casues the problem&quot;&lt;/p&gt;

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

&lt;p&gt;                            . &quot; on the relationship. If you cannot find out which entity causes the problem&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12755">DDC-1233</key>
            <summary>Minor spellcheck in UnitOfWork</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="iksela">Alexandre Mathieu</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Jun 2011 12:21:40 +0000</created>
                <updated>Tue, 28 Jun 2011 20:32:02 +0000</updated>
                    <resolved>Tue, 28 Jun 2011 20:32:02 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16094" author="beberlei" created="Tue, 28 Jun 2011 20:32:02 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

<item>
            <title>[DDC-1230] entity state is not set to STATE_REMOVED when removing an entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1230</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The UnitOfWork never sets the state to STATE_REMOVED in the map when scheduling an entity for delete. This means that the UnitOfWork will never tell you that the entity is in STATE_REMOVED when asking for its state but will return STATE_MANAGED&lt;/p&gt;</description>
                <environment></environment>
            <key id="12752">DDC-1230</key>
            <summary>entity state is not set to STATE_REMOVED when removing an entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Jun 2011 09:27:43 +0000</created>
                <updated>Tue, 28 Jun 2011 19:39:28 +0000</updated>
                    <resolved>Tue, 28 Jun 2011 19:39:28 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16090" author="beberlei" created="Tue, 28 Jun 2011 19:39:28 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1218] Generator disappear with mappedSuperclass and in others common inheritance&apos;s cases</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1218</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;With mapped superclass the id lost autoincrement. I&apos;ve test with yaml and annotation this is the same.&lt;/p&gt;

&lt;p&gt;An example with yaml 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-html&quot;&gt; 
Document:
  type: mappedSuperclass
  fields:
    mimetype: { type: string, length: 255 }
    filename: { type: string, length: 255 }

Image:
  type: entity
  fields:
    id: { type: integer, id: true, generator: { strategy: AUTO } }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The id in the  table Image lost autoincrement.&lt;/p&gt;</description>
                <environment>Symfony</environment>
            <key id="12729">DDC-1218</key>
            <summary>Generator disappear with mappedSuperclass and in others common inheritance&apos;s cases</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="ndm">Nicolas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jun 2011 07:11:00 +0000</created>
                <updated>Mon, 27 Jun 2011 09:35:27 +0000</updated>
                    <resolved>Sat, 25 Jun 2011 08:20:59 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16041" author="ndm" created="Wed, 22 Jun 2011 19:44:21 +0000"  >&lt;p&gt;The problem is in file doctrine/lib/Doctrine/ORM/Mapping, a solution, with just one change could be&lt;br/&gt;
: &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function loadMetadata($name)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initialized) {
...
        &lt;span class=&quot;code-comment&quot;&gt;// Move down the hierarchy of parent classes, starting from the topmost class
&lt;/span&gt;...
            &lt;span class=&quot;code-comment&quot;&gt;// Invoke driver
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;driver-&amp;gt;loadMetadataForClass($className, $class);
            } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (ReflectionException $e) {
                &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; MappingException::reflectionFailure($className, $e);
            }
&lt;span class=&quot;code-comment&quot;&gt;//Change
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($parent) {
&lt;span class=&quot;code-comment&quot;&gt;//To
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($parent &amp;amp;&amp;amp; ! $parent-&amp;gt;isInheritanceTypeNone()) {
&lt;span class=&quot;code-comment&quot;&gt;//EndChange
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($parent-&amp;gt;isIdGeneratorSequence()) {
...
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16042" author="ndm" created="Thu, 23 Jun 2011 00:39:11 +0000"  >&lt;p&gt;I have seen the resolution in doctrine later version, so &lt;b&gt;i hesitate to close this issue&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;But i&apos;m sure that the solution in place will &lt;b&gt;not resolve all situation&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;By example, if the superclass isn&apos;t mapped but  an entity with joined, this doesn&apos;t work properly, and you lost the id and the generator of the childclass. Another exemple, you want a mapped with generator, and subclass which don&apos;t indicate id, you can&apos;t the generator isn&apos;t include, and the id is required in the subclass.&lt;/p&gt;

&lt;p&gt;The code actually work just for same table proposition, and not good, because with same table you must indicate an &lt;b&gt;not used id&lt;/b&gt; in the child class ( why an id is an obligation!!!, Sql permit to have table without id).&lt;/p&gt;

&lt;p&gt;If somebody read this, i propose a solution for inherited class with another schema, &lt;/p&gt;

&lt;p&gt;Each propositions are with a class inheriting from superclass :&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Schemaforjoinedclass.&quot;&gt;&lt;/a&gt;Schema for joinedclass.&lt;/h4&gt;
&lt;p&gt;In this case generator are leave in the same functions&lt;/p&gt;
&lt;div class=&quot;code panel&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_class
  class_id -&amp;gt; *self generator*
table_link
  class_id
  class_discriminent
  superclass_id
table_superclass
  superclass_id -&amp;gt; *self generator*
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;or better and closest from the actual solution ( with obligation to have different id name)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;table_class
  class_id -&amp;gt; *self generator*
  superclass_id
table_superclass
  superclass_id -&amp;gt; *self generator*
  discriminator
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h4&gt;&lt;a name=&quot;Schemaforsametable&quot;&gt;&lt;/a&gt;Schema for same table&lt;/h4&gt;
&lt;p&gt;Not exactly the actual behavior but very near&lt;/p&gt;
&lt;div class=&quot;code panel&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_class
   class_id autogenerate (or not exist)
   superclass_id (autogenerate with concatenation class_id and discr or not exit)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The better for me :&lt;/p&gt;
&lt;div class=&quot;code panel&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_class
    superclass_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h4&gt;&lt;a name=&quot;Schemaformapped&quot;&gt;&lt;/a&gt;Schema for mapped&lt;/h4&gt;
&lt;div class=&quot;code panel&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_class
  class_id  &amp;lt;--- &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; exist (not obligatory)
  superclass_id &amp;lt;--- &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; class_id not exist, the generator from superclass_id
                                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; class_id exist, the generator from class_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Even with there ideas, the possibility to have &lt;b&gt;more than one generator&lt;/b&gt; method could be usefull. (i know that autoincrement can be use just one time). A solution, could be to add generator to field an not to entity in a first time, and treat generator at the end of the process not in the same place that the fields.&lt;/p&gt;

&lt;p&gt;So if you read this thank and aufwiedersehen.&lt;/p&gt;</comment>
                    <comment id="16045" author="holtkamp" created="Thu, 23 Jun 2011 09:42:34 +0000"  >&lt;p&gt;This seems to relate to an issue I created at: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1218&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1218&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16055" author="beberlei" created="Sat, 25 Jun 2011 08:20:59 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="16075" author="ndm" created="Mon, 27 Jun 2011 09:35:27 +0000"  >&lt;p&gt;Thanks &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1224] QueryBuilder delete issues CREATE TEMPORARY TABLE error on PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1224</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When I try to issue a delete an Class Table Inheritance Entity using QueryBuilder and I&apos;m using schemas on tablename (for Postgres), I got the following error from postgres:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42P16&amp;#93;&lt;/span&gt;: Invalid table definition: 7 ERROR: temporary tables cannot specify a schema name &lt;/p&gt;

&lt;p&gt;This occurs because Doctrine\ORM\Mapping\ClassMetadataInfo::getTemporaryIdTableName() returns just &quot;$this-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt; . &apos;_id_tmp&apos;&quot;, and when my entity is declared with  @Table(name=&quot;feed.tb_feed&quot;), obviously I will got error.&lt;/p&gt;

&lt;p&gt;Temporary tables are created in a special schema in Postgres, and I&apos;m thinking to convert the tablename from the class metadata from feed.tb_feed to feed_tb_feed into the getTemporaryIdTableName method with a single str_replace. That works for Postgres, but I don&apos;t mind what can happen in another DBMS.&lt;/p&gt;

&lt;p&gt;Any suggestions?&lt;/p&gt;</description>
                <environment>PostgreSQL 8.4</environment>
            <key id="12737">DDC-1224</key>
            <summary>QueryBuilder delete issues CREATE TEMPORARY TABLE error on PostgreSQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="kassner">Rafael Kassner</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Jun 2011 13:06:32 +0000</created>
                <updated>Sun, 26 Jun 2011 08:13:31 +0000</updated>
                    <resolved>Sun, 26 Jun 2011 08:13:31 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16069" author="beberlei" created="Sun, 26 Jun 2011 08:13:31 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1223] STI Inheritance Mapping Exception suggests to mark Entity abstract when initialization is not required, how to realize this?</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1223</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have an abstract PHP class &apos;PartyAbstract&apos; that uses Single Table Inheritance with a discriminator map to distinguish between a number of classes that extend the &apos;PartyAbstract&apos; class. The &apos;PartyAbstract&apos; class itself is not an entry in that discriminator map. Annotations are used to define the discriminator map.&lt;/p&gt;

&lt;div class=&quot;code panel&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(schema=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;party&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;discriminator&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
* @DiscriminatorMap({
* &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Party\PartyType1&quot;&lt;/span&gt;,
* &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Party\PartyType2&quot;&lt;/span&gt;,
* &lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Party\PartyType3&quot;&lt;/span&gt;
* })
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class PartyAbstract{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;As of version 2.1.0-rc1, the following exception is thrown:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity &apos;Project\Entity\PartyAbstract&apos; has to be part of the descriminator map of &apos;Project\Entity\PartyAbstract&apos; to be properly mapped in the inheritance hierachy. If you want to avoid instantiation of &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; type mark it &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt;.&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;My question is: how can I mark this Entity abstract? I DO want to be able to count the complete number of Parties, but instantiation of the PartyAbstract class is never required. The use of @MappedSuperclass is not allowed here, or together with the @Entity annotation...&lt;/p&gt;

&lt;p&gt;PS: also not that the message in the exception contains two typo&apos;s&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&apos;descriminator&apos; vs &apos;discriminator&apos;&lt;/li&gt;
	&lt;li&gt;&apos;hierachy&apos; vs &apos;hierarchy&apos;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="12736">DDC-1223</key>
            <summary>STI Inheritance Mapping Exception suggests to mark Entity abstract when initialization is not required, how to realize this?</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="holtkamp">Menno Holtkamp</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Jun 2011 09:54:24 +0000</created>
                <updated>Sat, 25 Jun 2011 10:22:49 +0000</updated>
                    <resolved>Sat, 25 Jun 2011 09:15:47 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16059" author="beberlei" created="Sat, 25 Jun 2011 09:15:47 +0000"  >&lt;p&gt;This way:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
* @Entity
* @Table(schema=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;party&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;discriminator&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
* @DiscriminatorMap({
* &lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Party\PartyAbstract&quot;&lt;/span&gt;,
* &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Party\PartyType1&quot;&lt;/span&gt;,
* &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Party\PartyType2&quot;&lt;/span&gt;,
* &lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Party\PartyType3&quot;&lt;/span&gt;
* })
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16064" author="holtkamp" created="Sat, 25 Jun 2011 10:22:49 +0000"  >&lt;p&gt;Aah, ok, that was the way I &apos;resolved&apos; it, but the exception message confused me as it suggests that it requires a configuration setting to &apos;mark it abstract&apos;. Maybe the following message can avoid this confusion: &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity &apos;Project\Entity\PartyAbstract&apos; has to be part of the discriminator map of &apos;Project\Entity\PartyAbstract&apos; to be properly mapped in the inheritance hierarchy. If you want to avoid instantiation of &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; type, make it an &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks for the swift response!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1159] From string used as object in QueryBuilder.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1159</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In QueryBuilder.php at line 956, $from is used as an object when it&apos;s in fact a string.&lt;/p&gt;</description>
                <environment>Linux</environment>
            <key id="12650">DDC-1159</key>
            <summary>From string used as object in QueryBuilder.php</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="philio">Phil Bayfield</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 May 2011 11:55:52 +0000</created>
                <updated>Sat, 25 Jun 2011 09:19:10 +0000</updated>
                    <resolved>Sat, 25 Jun 2011 09:19:10 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15928" author="beberlei" created="Sun, 5 Jun 2011 13:28:59 +0000"  >&lt;p&gt;Can you show your code leading to this error? Its an object for me.&lt;/p&gt;</comment>
                    <comment id="16061" author="beberlei" created="Sat, 25 Jun 2011 09:19:10 +0000"  >&lt;p&gt;Is fixed as part of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1227&quot; title=&quot;On 2.1 upgrade QueryBuilder incompatability getAlias() when using  &amp;#39;&amp;#39;-&amp;gt;add(&amp;#39;select&amp;#39;, &amp;#39;sample&amp;#39;)-&amp;gt;add(&amp;#39;from&amp;#39;, &amp;#39;Samply sample&amp;#39;) instead of  -&amp;gt;select(&amp;#39;sample&amp;#39;)-&amp;gt;from(&amp;#39;Sample&amp;#39;, &amp;#39;sample&amp;#39;)&quot;&gt;&lt;del&gt;DDC-1227&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1221&quot; title=&quot;Fatal Error when building a query using -&amp;gt;add() instead of -&amp;gt;from()&quot;&gt;&lt;del&gt;DDC-1221&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1221] Fatal Error when building a query using -&gt;add() instead of -&gt;from()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1221</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When creating a query using &lt;tt&gt;$qb-&amp;gt;add(&apos;from&apos;, ...)&lt;/tt&gt; instead of &lt;tt&gt;$qb-&amp;gt;from(...)&lt;/tt&gt; a fatal error is thrown when building the DQL query line 989 of the QueryBuilder because this line assumes it has a &lt;tt&gt;Doctrine\ORM\Query\Expr\From&lt;/tt&gt; instance whereas it gets a string.&lt;/p&gt;

&lt;p&gt;Note that a similar issue was fixed for &lt;tt&gt;$qb-&amp;gt;getRootAlias&lt;/tt&gt;: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1140&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1140&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12733">DDC-1221</key>
            <summary>Fatal Error when building a query using -&gt;add() instead of -&gt;from()</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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jun 2011 15:44:43 +0000</created>
                <updated>Sat, 25 Jun 2011 09:16:42 +0000</updated>
                    <resolved>Sat, 25 Jun 2011 09:16:42 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16037" author="stof" created="Tue, 21 Jun 2011 15:53:34 +0000"  >&lt;p&gt;Note that this issue has been introduced by &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/905e05cd361e9702325e3ea26224b95ac4f7d2e0&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/905e05cd361e9702325e3ea26224b95ac4f7d2e0&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16060" author="beberlei" created="Sat, 25 Jun 2011 09:16:42 +0000"  >&lt;p&gt;This is fixed, thanks for reporting this regression.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1227] On 2.1 upgrade QueryBuilder incompatability getAlias() when using  &apos;&apos;-&gt;add(&apos;select&apos;, &apos;sample&apos;)-&gt;add(&apos;from&apos;, &apos;Samply sample&apos;) instead of  -&gt;select(&apos;sample&apos;)-&gt;from(&apos;Sample&apos;, &apos;sample&apos;)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1227</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In queryBuilder if I use the add function when adding components to the query I get an error like this :&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function getAlias() on a non-object in /usr/local/zend/share/pear/Doctrine/ORM/QueryBuilder.php on line 989&lt;/p&gt;

&lt;p&gt;sample code is&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;createQueryBuilder()
		    -&amp;gt;add(&apos;select&apos;, &apos;sample&apos;)
		    -&amp;gt;add(&apos;from&apos;, &apos;Sample sample&apos;)
		    -&amp;gt;getQuery()
		    -&amp;gt;execute()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;it works with the following:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;createQueryBuilder()
		    -&amp;gt;select(&apos;sample&apos;)
		    -&amp;gt;from(&apos;Sample&apos;, &apos;sample&apos;)
		    -&amp;gt;getQuery()
		    -&amp;gt;execute()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I apologize if this is a duplicate ticket. I would like to see this fixed in the final release of 2.1 before installing it in our production environment.&lt;/p&gt;</description>
                <environment>ubuntu 10.10, php 5.3.5,</environment>
            <key id="12746">DDC-1227</key>
            <summary>On 2.1 upgrade QueryBuilder incompatability getAlias() when using  &apos;&apos;-&gt;add(&apos;select&apos;, &apos;sample&apos;)-&gt;add(&apos;from&apos;, &apos;Samply sample&apos;) instead of  -&gt;select(&apos;sample&apos;)-&gt;from(&apos;Sample&apos;, &apos;sample&apos;)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="pleicht">Philip Leicht</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Jun 2011 21:36:33 +0000</created>
                <updated>Sat, 25 Jun 2011 08:27:53 +0000</updated>
                    <resolved>Sat, 25 Jun 2011 08:27:53 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16057" author="beberlei" created="Sat, 25 Jun 2011 08:21:57 +0000"  >&lt;p&gt;Formatting&lt;/p&gt;</comment>
                    <comment id="16058" author="beberlei" created="Sat, 25 Jun 2011 08:27:53 +0000"  >&lt;p&gt;Fixed, thanks! You qualify for a mug/t-shirt after 2.1 release &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1156] MappedSuperclass not allowed in the middle of an inheritance hierarchy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1156</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For a Class Table Inheritance mapping configuration, an intermediate MappedSuperclass causes a &apos;noInheritanceOnMappedSuperClass&apos; mapping exception to be thrown by Doctrine\ORM\Mapping\ClassMetadataFactory::loadMetadata() (line 329). However, the MappedSuperclass only contains some simple properties and no inheritance configuration such as DiscriminatorMap or DiscriminatorColumn settings. The MappedSuperclass DOES extend the upper class in the hierarchy that contains this information using annotations, maybe this way it inherits this inheritance configuration.&lt;/p&gt;

&lt;p&gt;The documentation state that a MappedSuperclass can occur in the middle of a inheritance hierarchy.&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/inheritance-mapping.html#mapped-superclasses&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/inheritance-mapping.html#mapped-superclasses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PS: this mapping seemed to be working fine for me using Doctrine 2.0.4 and Doctrine 2.0.5, further inspection showed that this is not the case. Persistence of an Entity fails, Doctrine wants to update a sequence of the persisted Entity, that does not exist as it is a Class Table Inheritance&lt;br/&gt;
PPS: this applies for the 2.1.0-BETA1 release, which is not yet available to create an issue for.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12644">DDC-1156</key>
            <summary>MappedSuperclass not allowed in the middle of an inheritance hierarchy</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="holtkamp">Menno Holtkamp</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 May 2011 08:04:08 +0000</created>
                <updated>Sat, 25 Jun 2011 08:21:21 +0000</updated>
                    <resolved>Sat, 25 Jun 2011 08:21:21 +0000</resolved>
                            <version>2.0.4</version>
                <version>2.0.5</version>
                <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15924" author="beberlei" created="Sun, 5 Jun 2011 13:01:29 +0000"  >&lt;p&gt;Fixed, why does this fail on 2.0.4/5? The code doesnt include that exception.&lt;/p&gt;</comment>
                    <comment id="16043" author="holtkamp" created="Thu, 23 Jun 2011 08:11:36 +0000"  >&lt;p&gt;Adding the @MappedSuperclass annotation in the middle of an inheritance hierarchy does not throw an Exception anymore and the Schema Tool generates the proper SQL. &lt;/p&gt;

&lt;p&gt;However the problem that was indicated for 2.0.4 and 2.0.5 in the first PS statement of my report remains. It seems that the @SequenceGenerator and in specific the &apos;sequenceName&apos; setting is ignored for the childs / leafs of the inheritance hierarchy.&lt;/p&gt;

&lt;p&gt;Configuration:&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Project\Entity\Payment\Method.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;namespace Project\Entity\Payment;
/**
 * @Entity
 * @Table(schema=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;payment_method&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;discriminator&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
 * @DiscriminatorMap({
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Payment\Method\PaymentCard\CreditCard&quot;&lt;/span&gt;,
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Payment\Method\PaymentCard\DebitCard&quot;&lt;/span&gt;,
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Project\Entity\Payment\Method\ElectronicAccount&quot;&lt;/span&gt;
 * })
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Method
{
	/**
	 * The Payment Method&apos;s identifier
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;,type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;,nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
	 * @Id
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
	 * @SequenceGenerator(sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;payment_method_id_seq&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_id;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Project\Entity\Payment\Method\PaymentCard.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;namespace Project\Entity\Payment\Method;
/**
 * Project\Entity\Payment\Method\PaymentCard.php
 * Intermediate class that holds common information &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; PaymentCard Methods
 * No specific database table is required
 *
 * @MappedSuperclass
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class PaymentCard &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Method{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In the Entities that are defined in the discriminator map, we should leave the @Id annotation behind and to use the same sequence as that is used for the Project\Entity\Payment\Method Entity.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Project\Entity\Payment\Method\PaymentCard\CreditCard.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;namespace Project\Entity\Payment\Method\PaymentCard;
/**
 * CreditCard specific class
 *
 * @Entity
 * @Table(schema=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;payment_method_payment_card_credit_card&quot;&lt;/span&gt;)
 */
class CreditCard &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; PaymentCard
{

	/**
	 * The Credit Card Payment Method identifier
	 *
	 * Note that no &apos;Entity-specific&apos; sequence or auto-increment details should be defined, use the inheritance root entity&apos;s one
	 * @link http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org/docs/orm/2.0/en/reference/inheritance-mapping.html#class-table-inheritance
&lt;/span&gt;	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;,type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;,nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
	 * @SequenceGenerator(sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;payment_method_id_seq&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_id;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, Doctrine fails to persist a Project\Entity\Payment\Method\PaymentCard\CreditCard Entity as it tries to increase the value of the sequence of the CreditCard, which does not exist:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;failed saving Entity, Project\Entity\Payment, SQLSTATE[42P01]: Undefined table: 7 ERROR: relation &lt;span class=&quot;code-quote&quot;&gt;&quot;payment_method_payment_card_credit_card_id_seq&quot;&lt;/span&gt; does not exist LINE 1: SELECT NEXTVAL(&apos;payment_method_payment_card_credit_card_id_s...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;When I remove the @MappedSuperclass annotation from the intermediate PaymentCard class, this error does not occur and the proper sequence seems to be used.&lt;/p&gt;</comment>
                    <comment id="16056" author="beberlei" created="Sat, 25 Jun 2011 08:21:21 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1222] Composite Primary Key is not recognized</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1222</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the following mapping:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class TopicTranslation
{
    /**
* @ORM\Id
* @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Topic&quot;&lt;/span&gt;)
*/
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $topic;

    /**
* @ORM\Id
* @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=5)
*/
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $locale;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine will only use &quot;locale&quot; as primary key for the table. I would expect it to use &quot;topic_id&quot; and &quot;locale&quot; instead.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12734">DDC-1222</key>
            <summary>Composite Primary Key is not recognized</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jun 2011 16:56:22 +0000</created>
                <updated>Tue, 21 Jun 2011 18:58:11 +0000</updated>
                    <resolved>Tue, 21 Jun 2011 18:58:11 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16039" author="johannes" created="Tue, 21 Jun 2011 18:58:11 +0000"  >&lt;p&gt;Fixed in D 2.1&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1017] mysql error when renaming a manyToOne property</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1017</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;These are my initial properties with annotations:&lt;/p&gt;

&lt;p&gt;// Task.php&lt;br/&gt;
	/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ManyToOne(targetEntity=&quot;Maia\Model\User&quot;, inversedBy=&quot;tasks&quot;)&lt;br/&gt;
	 */&lt;br/&gt;
	protected $user;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;// User.php&lt;br/&gt;
	/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@OneToMany(targetEntity=&quot;Maia\Model\Task&quot;, mappedBy=&quot;user&quot;)&lt;br/&gt;
	 */&lt;br/&gt;
	protected $tasks;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;At this stage, everythings works fine.&lt;/p&gt;

&lt;p&gt;However when I try to rename the property $user to $author like so:&lt;/p&gt;

&lt;p&gt;// User.php&lt;br/&gt;
	/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@OneToMany(targetEntity=&quot;Maia\Model\Task&quot;, mappedBy=&quot;author&quot;)&lt;br/&gt;
	 */&lt;br/&gt;
	protected $tasks;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;and change the corresponding entity like this:&lt;br/&gt;
	/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ManyToOne(targetEntity=&quot;Maia\Model\User&quot;, inversedBy=&quot;tasks&quot;)&lt;br/&gt;
	 */&lt;br/&gt;
	protected $author;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;and then try to update my database using the &apos;./doctrine orm:schema-tool:update --force&apos; command, I get the following error:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;PDOException&amp;#93;&lt;/span&gt;                                                                                               &lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1025 Error on rename of &apos;./maia/#sql-508_2be&apos; to &apos;./maia/Task&apos; (errno: 150) &lt;/p&gt;

&lt;p&gt;in the database &apos;information_schema&apos; and then tabel &apos;key_column_usage&apos; I find this line:&lt;br/&gt;
CONSTRAINT_CATALOG 			Null&lt;br/&gt;
CONSTRAINT_SCHEMA 				maia&lt;br/&gt;
CONSTRAINT_NAME 				Task_ibfk_1&lt;br/&gt;
TABLE_CATALOG 					Null&lt;br/&gt;
TABLE_SCHEMA 					maia&lt;br/&gt;
TABLE_NAME						Task&lt;br/&gt;
COLUMN_NAME 					user_id&lt;br/&gt;
ORDINAL_POSITION 				1&lt;br/&gt;
POSITION_IN_UNIQUE_CONSTRAINT 1&lt;br/&gt;
REFERENCED_TABLE_SCHEMA 		maia&lt;br/&gt;
REFERENCED_TABLE_NAME 		User&lt;br/&gt;
REFERENCED_COLUMN_NAME		id&lt;/p&gt;

&lt;p&gt;I had to perform the following query on my database before I was able to update:&lt;br/&gt;
ALTER TABLE User DROP FOREIGN KEY Task_ibfk_1;&lt;/p&gt;

&lt;p&gt;Maybe I am doing something wrong, this is my first project with Doctrine, but I tweeted about the error and somebody asked me to create a ticket so here it is.&lt;/p&gt;</description>
                <environment>Ubuntu Maverick 10.10&lt;br/&gt;
PHP 5.3.3&lt;br/&gt;
System 	Linux pim-laptop 2.6.35-25-generic-pae #44-Ubuntu SMP Fri Jan 21 19:01:46 UTC 2011 i686 &lt;br/&gt;
mysql  Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (i686) using readline 6.1</environment>
            <key id="12358">DDC-1017</key>
            <summary>mysql error when renaming a manyToOne property</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="phazebroek">Pim Hazebroek</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Feb 2011 14:44:42 +0000</created>
                <updated>Sun, 19 Jun 2011 08:59:39 +0000</updated>
                    <resolved>Sun, 19 Jun 2011 08:59:39 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16023" author="beberlei" created="Sun, 19 Jun 2011 08:59:39 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10930" name="export.sql" size="1207" author="phazebroek" created="Fri, 4 Feb 2011 14:44:42 +0000" />
                    <attachment id="10928" name="Task.php" size="430" author="phazebroek" created="Fri, 4 Feb 2011 14:44:42 +0000" />
                    <attachment id="10929" name="User.php" size="423" author="phazebroek" created="Fri, 4 Feb 2011 14:44:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-887] Schema tool can throw errno 121 when creating or dropping indexes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-887</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When changing the model in such a way that the schema tool tries to create or drop an index which is also a foreign key an error is sometimes thrown like:&lt;/p&gt;

&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;PDOException&amp;#93;&lt;/span&gt;&lt;br/&gt;
  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1025 Error on rename of &apos;.\mydb&amp;#35;sql-10d8_19&apos; to &apos;.\mydb\auth&apos; (errno: 121)&lt;/p&gt;

&lt;p&gt;This seems to be caused by MySQL trying to re-use indexes and I think it depends on exactly what has happened before in this table so I can&apos;t give an exact case to reproduce.  However, it seems to be InnoDB specific and I&apos;m pretty sure its this bug: &lt;a href=&quot;http://bugs.mysql.com/bug.php?id=15317&quot; class=&quot;external-link&quot;&gt;http://bugs.mysql.com/bug.php?id=15317&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12136">DDC-887</key>
            <summary>Schema tool can throw errno 121 when creating or dropping indexes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 22 Nov 2010 10:26:28 +0000</created>
                <updated>Sun, 19 Jun 2011 08:59:10 +0000</updated>
                    <resolved>Sun, 19 Jun 2011 08:59:00 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14802" author="ccapndave" created="Mon, 22 Nov 2010 10:44:45 +0000"  >&lt;p&gt;Another report of the issue at &lt;a href=&quot;http://bugs.mysql.com/bug.php?id=14347&quot; class=&quot;external-link&quot;&gt;http://bugs.mysql.com/bug.php?id=14347&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16022" author="beberlei" created="Sun, 19 Jun 2011 08:59:00 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1211] Expr::literal problem with numeric value 0</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1211</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&apos;m using master branch of Doctrine 2. Including an Expr with a numeric 0 value (not a string):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$value = 0;

$qb-&amp;gt;expr()-&amp;gt;gte($field, $qb-&amp;gt;expr()-&amp;gt;literal($value));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Expr::literal method will return an empty string (&apos;&apos;) instead of &apos;0&apos;, which causes that this expression be something like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;entity.myField &amp;gt;=  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;instead of:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;entity.miField &amp;gt;= &apos;0&apos;&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This makes the query fail. Tracking the issue down I&apos;ve found this on Expr\Base::add method:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function add($arg)
    {
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($arg) || ($arg &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; self &amp;amp;&amp;amp; $arg-&amp;gt;count() &amp;gt; 0)) {
            &lt;span class=&quot;code-comment&quot;&gt;// If we decide to keep Expr\Base instances, we can use &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; check
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! is_string($arg)) {
                $class = get_class($arg);

                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! in_array($class, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_allowedClasses)) {
                    &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \InvalidArgumentException(&lt;span class=&quot;code-quote&quot;&gt;&quot;Expression of type &apos;$class&apos; not allowed in &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; context.&quot;&lt;/span&gt;);
                }
            }

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_parts[] = $arg;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem is that empty function returns true if you pass &apos;0&apos;, so a call to Expr\Base::add would end on NOT adding &apos;0&apos; to $this-&amp;gt;_parts array. That&apos;s why it finally returns &apos;&apos;.&lt;/p&gt;

&lt;p&gt;I wanted to make the fix for this but I&apos;m having issues running the phing build task. Which are the steps to follow to run the tests? Running phing build task I get on the &quot;test&quot; task:&lt;/p&gt;

&lt;p&gt;    Could not create task/type: &apos;nativephpunit&apos;. Make sure that this class has been declared using taskdef / typedef.&lt;/p&gt;



&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment>Apache 2.2.16&lt;br/&gt;
PHP 5.3.3&lt;br/&gt;
Ubuntu 11</environment>
            <key id="12718">DDC-1211</key>
            <summary>Expr::literal problem with numeric value 0</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="comfortablynumb">Gustavo Falco</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Jun 2011 16:21:32 +0000</created>
                <updated>Sun, 19 Jun 2011 08:27:51 +0000</updated>
                    <resolved>Sun, 19 Jun 2011 08:27:51 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16016" author="beberlei" created="Sun, 19 Jun 2011 08:04:27 +0000"  >&lt;p&gt;Assigned to guilherme, i suppose we could change the !empty($arg) to $arg !== null ?&lt;/p&gt;</comment>
                    <comment id="16020" author="beberlei" created="Sun, 19 Jun 2011 08:27:51 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1214] Call to undefined method Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand::getFullName()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1214</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The getFullName() method has been removed from the latest Symfony\Component\Console\Command\Command class and is causing the above error on line 131 of UpdateCommand.php&lt;/p&gt;</description>
                <environment></environment>
            <key id="12723">DDC-1214</key>
            <summary>Call to undefined method Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand::getFullName()</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="adamanthil">Andrew W Bender</reporter>
                        <labels>
                    </labels>
                <created>Sun, 19 Jun 2011 06:56:14 +0000</created>
                <updated>Sun, 19 Jun 2011 08:05:43 +0000</updated>
                    <resolved>Sun, 19 Jun 2011 08:05:43 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16017" author="beberlei" created="Sun, 19 Jun 2011 08:05:43 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1212] Exception of mapping of ID generation strategy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1212</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;After updating today Doctrine 2 from master branch I&apos;m getting:&lt;/p&gt;

&lt;p&gt;Entity of type &quot;Entity&quot; is missing an assigned ID. The identifier generation strategy for this entity requires the ID field to be populated before EntityManager#persist() is called. If you want automatically generated identifiers instead you need to adjust the metadata mapping accordingly.&lt;/p&gt;

&lt;p&gt;Was there a change on the mapping of ID generation strategy? I was using a commit of the master branch from 1 o 2 weeks ago and it was working ok. I took a look at the repo for changes on the last days but I couldn&apos;t find anything related to this.&lt;/p&gt;

&lt;p&gt;I paste the mapping and entities here:&lt;/p&gt;

&lt;p&gt;Element:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\MappedSuperclass
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Element
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;File:&lt;/p&gt;

&lt;div class=&quot;code panel&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;file&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discriminator&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorMap({
        &lt;span class=&quot;code-quote&quot;&gt;&quot;image&quot;&lt;/span&gt;  = &lt;span class=&quot;code-quote&quot;&gt;&quot;Image&quot;&lt;/span&gt;,
    })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class File &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Element
{
     &lt;span class=&quot;code-comment&quot;&gt;// Fields
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And Image:&lt;/p&gt;

&lt;div class=&quot;code panel&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;image&quot;&lt;/span&gt;)
 */
class Image &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; File
{
     &lt;span class=&quot;code-comment&quot;&gt;// Fields
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Thanks in advance!&lt;/p&gt;</description>
                <environment>Apache 2.2.16&lt;br/&gt;
PHP 5.3.3&lt;br/&gt;
Ubuntu 11</environment>
            <key id="12720">DDC-1212</key>
            <summary>Exception of mapping of ID generation strategy</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="comfortablynumb">Gustavo Falco</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Jun 2011 20:20:51 +0000</created>
                <updated>Thu, 16 Jun 2011 21:10:29 +0000</updated>
                    <resolved>Thu, 16 Jun 2011 21:01:17 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16002" author="beberlei" created="Thu, 16 Jun 2011 20:27:20 +0000"  >&lt;p&gt;Do you &quot;use&quot; the mapping AS ORM namespace?&lt;/p&gt;</comment>
                    <comment id="16004" author="comfortablynumb" created="Thu, 16 Jun 2011 20:38:59 +0000"  >&lt;p&gt;Yes, sorry for not including that. I had to add this to my entities 1 o 2 weeks ago when I updated all my vendors:&lt;/p&gt;

&lt;p&gt;use Doctrine\ORM\Mapping as ORM;&lt;/p&gt;

&lt;p&gt;Is it still right?&lt;/p&gt;</comment>
                    <comment id="16005" author="beberlei" created="Thu, 16 Jun 2011 21:01:17 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="16006" author="comfortablynumb" created="Thu, 16 Jun 2011 21:10:29 +0000"  >&lt;p&gt;Great!&lt;/p&gt;

&lt;p&gt;I want to say just in case BTW that removing the mapped superclass and moving all its fields to, for example, &quot;File&quot; makes the error go away.&lt;/p&gt;


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

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

<item>
            <title>[DDC-1196] EntityGenerator: made it work with Doctrine Common 3.0.x</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1196</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The entity generator does not work with the new Doctrine Common 3.0.x.&lt;/p&gt;

&lt;p&gt;Issue is reported here in Symfony: &lt;a href=&quot;https://github.com/symfony/symfony/issues/1083&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/issues/1083&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PR that fixes the issue here: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/61&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/61&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12698">DDC-1196</key>
            <summary>EntityGenerator: made it work with Doctrine Common 3.0.x</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="fabpot">Fabien Potencier</reporter>
                        <labels>
                    </labels>
                <created>Sun, 5 Jun 2011 06:36:44 +0000</created>
                <updated>Wed, 15 Jun 2011 20:47:03 +0000</updated>
                    <resolved>Wed, 15 Jun 2011 20:47:03 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1204] Single Table Inheritance - Columns of one hierarchy are dropped</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1204</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the following example, the columns of the classes B, C, D are not in the database schema. Only those of the classes A and E.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\Entity
 * @ORM\Table(name = &lt;span class=&quot;code-quote&quot;&gt;&quot;a&quot;&lt;/span&gt;)
 * @ORM\ChangeTrackingPolicy(&lt;span class=&quot;code-quote&quot;&gt;&quot;DEFERRED_EXPLICIT&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=20)
 * @ORM\DiscriminatorMap({
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;C&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;d&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;D&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;e&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;E&quot;&lt;/span&gt;
 * })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class A { }

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

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

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

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

<item>
            <title>[DDC-1168] Implemented tableName -&gt; className and columnName -&gt; fieldName mapping in DatabaseDriver.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1168</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As requested a ticket to remind you of looking at this pull request: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/59&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/59&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The patch enables custom naming of entities and fieldnames when re-engineering from the database. It can be used when the mapping is done with a script, not by the commandline (yet?).&lt;/p&gt;</description>
                <environment></environment>
            <key id="12663">DDC-1168</key>
            <summary>Implemented tableName -&gt; className and columnName -&gt; fieldName mapping in DatabaseDriver.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 May 2011 13:59:13 +0000</created>
                <updated>Sat, 11 Jun 2011 11:02:05 +0000</updated>
                    <resolved>Sat, 11 Jun 2011 11:02:05 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1179] Allow to specify namespace prefix in combination with --from-database</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1179</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;See &lt;a href=&quot;https://github.com/symfony/symfony/issues/1119#comment_1247346&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/issues/1119#comment_1247346&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12677">DDC-1179</key>
            <summary>Allow to specify namespace prefix in combination with --from-database</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 May 2011 18:20:17 +0000</created>
                <updated>Sat, 11 Jun 2011 11:01:58 +0000</updated>
                    <resolved>Sat, 11 Jun 2011 11:01:58 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15900" author="asm89" created="Fri, 3 Jun 2011 11:40:33 +0000"  >&lt;p&gt;Added this feature:&lt;br/&gt;
&lt;a href=&quot;https://github.com/asm89/doctrine2/commit/7ee8dc4e44e3a761b8dab23a18ded74c9f10d7a3&quot; class=&quot;external-link&quot;&gt;https://github.com/asm89/doctrine2/commit/7ee8dc4e44e3a761b8dab23a18ded74c9f10d7a3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It depends on the changes made before:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1168&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1168&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pull request including both tickets:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/59&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/59&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1184] ORM\Id\AssignedGenerator try to current() on non-array</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1184</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;&lt;span class=&quot;code-comment&quot;&gt;// Doctrine\ORM\AssignedGenerator::generate at line 54
&lt;/span&gt;
$identifier[$idField] = current($em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($value));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;$value&lt;/tt&gt; may also be new, so &lt;tt&gt;getEntityIdentifier&lt;/tt&gt; returns &lt;tt&gt;NULL&lt;/tt&gt; and &lt;tt&gt;current(NULL)&lt;/tt&gt; generates an &lt;tt&gt;E_WARNING&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12683">DDC-1184</key>
            <summary>ORM\Id\AssignedGenerator try to current() on non-array</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="slam">Slam</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 May 2011 19:47:29 +0000</created>
                <updated>Sat, 11 Jun 2011 08:46:49 +0000</updated>
                    <resolved>Sat, 11 Jun 2011 07:39:03 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15914" author="beberlei" created="Sun, 5 Jun 2011 10:54:59 +0000"  >&lt;p&gt;Optimized error handling&lt;/p&gt;</comment>
                    <comment id="15962" author="slam" created="Wed, 8 Jun 2011 16:37:43 +0000"  >&lt;p&gt;Error optimizing is welcome but this does not resolve the issue.&lt;/p&gt;

&lt;p&gt;Again, if &lt;tt&gt;$value&lt;/tt&gt; is new object, for example a &lt;tt&gt;new Entity\User&lt;/tt&gt; with an empty &lt;tt&gt;protected $id&lt;/tt&gt;:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_object($value)) {
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!$em-&amp;gt;getUnitOfWork()-&amp;gt;isInIdentityMap($value)) {
		&lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; ORMException::entityMissingForeignAssignedId($entity, $value);
	}
	
	&lt;span class=&quot;code-comment&quot;&gt;// NOTE: Single Columns as associated identifiers only allowed - &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; constraint it is enforced.
&lt;/span&gt;	$identifier[$idField] = current($em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($value));
} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	$identifier[$idField] = $value;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;will &lt;b&gt;ALWAYS&lt;/b&gt; throw an exception in the case the Entity is new.&lt;/p&gt;

&lt;p&gt;In my projects, i resolved with&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_object($value)) {
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!$em-&amp;gt;getUnitOfWork()-&amp;gt;isInIdentityMap($value)) {
		$identifier[$idField] = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
	} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	
		&lt;span class=&quot;code-comment&quot;&gt;// NOTE: Single Columns as associated identifiers only allowed - &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; constraint it is enforced.
&lt;/span&gt;		$identifier[$idField] = current($em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($value));
	}
} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	$identifier[$idField] = $value;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have not unit-tested the solution (i&apos;m sorry) and I think a more accurate investigation is needed.&lt;/p&gt;</comment>
                    <comment id="15972" author="beberlei" created="Sat, 11 Jun 2011 07:39:03 +0000"  >&lt;p&gt;Please read:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/tutorials/composite-primary-keys.html#general-considerations&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/tutorials/composite-primary-keys.html#general-considerations&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a necessary requirement, that means if you want to create two entities with a composite pk key of the one depending on the other you have to use two flush operations when using MySQL Auto Increment Keys. This will work with PostgreSQL or Oracle Sequences, but not with Auto increment keys.&lt;/p&gt;</comment>
                    <comment id="15976" author="slam" created="Sat, 11 Jun 2011 08:46:49 +0000"  >&lt;p&gt;Ok, roger.&lt;/p&gt;

&lt;p&gt;Just one note: you must know that both two entities are STATE_NEW, because if you try to &lt;tt&gt;getEntityState($dependentEntity)&lt;/tt&gt;, &lt;tt&gt;UnitOfWork.php:2155&lt;/tt&gt; will throw a E_RECOVERABLE_ERROR because the $independentEntity could not be converted to a string (because it has no id).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1176] Error on proxy loading with foreign Key</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1176</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Look at this thread:&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/2a03a6aea43428d6&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/2a03a6aea43428d6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This entity class configuration:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class IndividualsStatus
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Individuals
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Individuals&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $individuals;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Diagnosers
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Diagnosers&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $diagnosers;

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

    [...]
}

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

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

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; IndividualsStatus
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;IndividualsStatus&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
     * @joinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;individuals_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $diagnosers;

  [...]
}

class Diagnosers
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Users
     *
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Users&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $users;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Pros
     *
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Pros&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;})
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pros_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $pros;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Reports
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Reports&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $reports;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; IndividualsStatus
     *
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;IndividualsStatus&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;refresh&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
     * @joinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;diagnosers_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $individuals;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that in individuals, the relation called &quot;Diagnosers&quot; refered to IndividualsStatus entity.&lt;br/&gt;
Note that in diagnosers, the relation called &quot;Individuals&quot; refered to IndividualsStatus entity.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;When I execute &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; DQL request:
   $qb-&amp;gt;select(array(&apos;i&apos;, &apos;iss&apos;, &apos;u&apos;)) 
           -&amp;gt;from(&apos;IndividualsStatus&apos;, &apos;iss&apos;) 
           -&amp;gt;join(&apos;iss.individuals&apos;, &apos;i&apos;) 
           -&amp;gt;join(&apos;i.users&apos;, &apos;u&apos;) 
           -&amp;gt;where(&apos;iss.diagnosers = ?1&apos;) 
           -&amp;gt;andWhere(&apos;iss.individuals = ?2&apos;) 
           -&amp;gt;setParameters(array(1 =&amp;gt; $idDiag, 2 =&amp;gt; $id)); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I retrieve an IndividualsStatus entity:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;object(stdClass)[149] 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;IndividualsStatus&apos; (length=37) 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;individuals&apos; =&amp;gt; 
    object(stdClass)[148] 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Individuals&apos; (length=31) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;reference&apos; =&amp;gt; string &apos;451&apos; (length=3) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;maxAdvertisements&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;role&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 2 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;id&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 8 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;users&apos; =&amp;gt; string &apos;Users&apos; (length=25) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;advertisements&apos; =&amp;gt; string &apos;Array(0)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;diagnosers&apos; =&amp;gt; string &apos;Array(1)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;ownedReports&apos; =&amp;gt; string &apos;Array(0)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;reports&apos; =&amp;gt; string &apos;Array(0)&apos; (length=8) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;_em&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;diagnosers&apos; =&amp;gt; 
    object(stdClass)[154] 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Proxies 
\OpengroupeEntitiesDiagnosersProxy&apos; (length=61) 
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;id&apos; =&amp;gt; string &apos;19&apos; (length=2) 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;statusIndividuals&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1 
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;_em&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;p&gt;In my database, this individuals got 2 diagnosers attached, but only 1 is dumped.&lt;br/&gt;
For getting the 2, i have to select the Diagnosers relation into my Dql request:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;   $qb-&amp;gt;select(array(&apos;i&apos;, &apos;iss&apos;, &apos;u&apos;, &apos;d&apos;)) 
           -&amp;gt;from(&apos;IndividualsStatus&apos;, &apos;iss&apos;) 
           -&amp;gt;join(&apos;iss.individuals&apos;, &apos;i&apos;) 
           -&amp;gt;join(&apos;i.diagnosers&apos;, &apos;d&apos;) 
           -&amp;gt;join(&apos;i.users&apos;, &apos;u&apos;) 
           -&amp;gt;where(&apos;iss.diagnosers = ?1&apos;) 
           -&amp;gt;andWhere(&apos;iss.individuals = ?2&apos;) 
           -&amp;gt;setParameters(array(1 =&amp;gt; $idDiag, 2 =&amp;gt; $id)); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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

<item>
            <title>[DDC-1194] Problem using Instance of feature</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1194</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, i get this error message when executing a query with INSTANCE OF.&lt;br/&gt;
Notice: Undefined index: \model\PeopleTaskRecommendFriends in /usr/share/php/Doctrine/ORM/Query/SqlWalker.php on line 1626&lt;/p&gt;

&lt;p&gt;The query to be executed is this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&quot;SELECT pt
                                          FROM \model\PeopleTask pt
                                          WHERE pt instance of \model\PeopleTaskRecommendFriends
                                          &quot;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The query actually being executed is this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT t0_.int_people_task_id AS int_people_task_id0, t0_.int_people_id AS int_people_id1, t0_.dtm_creation AS dtm_creation2, t0_.bit_completed AS bit_completed3, t0_.vch_names AS vch_names4, t0_.int_task_type_id AS int_task_type_id5 FROM tbl_xref_people_task t0_ WHERE (t0_.int_task_type_id = &apos;&apos;) AND t0_.int_task_type_id IN (&apos;1&apos;, &apos;2&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first problem is that for some reason its translating the query with a wrong where clause, so of course no data is returned.&lt;/p&gt;

&lt;p&gt;Here is the model&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;------------------------------------------ Base class----------------------------------------
/**
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;repository\PeopleTaskRepository&quot;&lt;/span&gt;)
 * @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;int_task_type_id&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;PeopleTaskRecommendFriends&quot;&lt;/span&gt;, 2 = &lt;span class=&quot;code-quote&quot;&gt;&quot;PeopleTaskAddBadge&quot;&lt;/span&gt;})
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;tbl_xref_people_task&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class PeopleTask &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; BaseModel {
 
    /**
     * @Id
     * @GeneratedValue
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $int_people_task_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; $int_people_id;
 
    /** @Column(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; $dtm_creation;
 
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bit&quot;&lt;/span&gt;)*/
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $bit_completed;
 
    /** @Column(length=255) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $vch_names;
 
}
 
----------------------------------------------------Children class-----------------------------------------------
 
/**
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;repository\peopleTask\PeopleTaskRecommendFriendsRepository&quot;&lt;/span&gt;)
 */
class PeopleTaskRecommendFriends &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; PeopleTask {
 /* some methods */
 
}
 &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu</environment>
            <key id="12695">DDC-1194</key>
            <summary>Problem using Instance of feature</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="hrajchert">Hernan Rajchert</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Jun 2011 17:11:30 +0000</created>
                <updated>Fri, 10 Jun 2011 16:41:08 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 08:49:01 +0000</resolved>
                            <version>2.0.5</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15908" author="beberlei" created="Sun, 5 Jun 2011 06:29:03 +0000"  >&lt;p&gt;A fix for this is probably just ommitting the prefix \ infront of the model in the DQL. Class Names in Strings are ALWAYS fully qualified, therefore the leading slash has to be omitted.&lt;/p&gt;</comment>
                    <comment id="15911" author="beberlei" created="Sun, 5 Jun 2011 08:49:00 +0000"  >&lt;p&gt;Improved error handling when in &quot;a INSTANCE OF b&quot; the classes a and b are unrelated.&lt;/p&gt;</comment>
                    <comment id="15967" author="hrajchert" created="Fri, 10 Jun 2011 16:41:08 +0000"  >&lt;p&gt;Thanks, that did solve my problem.&lt;/p&gt;

&lt;p&gt;On a related note, for the original query i had to do this:&lt;br/&gt;
$qb-&amp;gt;andWhere(&apos;pt INSTANCE OF &apos;.$task_type);&lt;br/&gt;
instead of this&lt;br/&gt;
$qb-&amp;gt;andWhere(&apos;pt INSTANCE OF :taskType&apos;);&lt;br/&gt;
$qb-&amp;gt;setParameter(&apos;taskType&apos;, $task_type);&lt;/p&gt;

&lt;p&gt;because it complains about the parameter not being a metadata type, and i couldnt find a way to get the metadata type.&lt;/p&gt;

</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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


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

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

<item>
            <title>[DDC-1192] fix undefined variable in join-column section of xml driver</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1192</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;$name is undefined, It might be that the fix is as simple as foreach ($manyToOneElement-&amp;gt;&lt;/p&gt;
{&apos;join-columns&apos;}-&amp;gt;{&apos;join-column&apos;} as $name =&amp;gt; $joinColumnElement) {&lt;br/&gt;
but I&apos;m not sure&lt;br/&gt;

&lt;div class=&quot;code panel&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;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;
if (isset($manyToOneElement-&amp;gt;{&apos;join-column&apos;})) {&lt;br/&gt;
    $joinColumns[] = $this-&amp;gt;_getJoinColumnMapping($manyToOneElement-&amp;gt;{&apos;join-column&apos;});&lt;br/&gt;
} else if (isset($manyToOneElement-&amp;gt;{&apos;join-columns&apos;}
&lt;p&gt;)) {&lt;br/&gt;
    foreach ($manyToOneElement-&amp;gt;&lt;/p&gt;
{&apos;join-columns&apos;}
&lt;p&gt;-&amp;gt;&lt;/p&gt;
{&apos;join-column&apos;}
&lt;p&gt; as $joinColumnElement) {&lt;br/&gt;
        if (!isset($joinColumnElement&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
            $joinColumnElement[&apos;name&apos;] = $name;
        }
&lt;p&gt;        $joinColumns[] = $this-&amp;gt;_getJoinColumnMapping($joinColumnElement);&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12693">DDC-1192</key>
            <summary>fix undefined variable in join-column section of xml driver</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Jun 2011 07:28:56 +0000</created>
                <updated>Sun, 5 Jun 2011 12:51:00 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 12:51:00 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.0.6</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15923" author="beberlei" created="Sun, 5 Jun 2011 12:51:00 +0000"  >&lt;p&gt;This is a copy paste error from the YAML Driver, i fixed it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1173] Fatal error when a listener resets an object in onFlush and recompute the changeset</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1173</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When a listener resets an entity during onFlush and recompute the changeset (setting it to null as there is no changes), the following triggering of preUpdate fails as PreUpdateEventArgs would get null as third argument which is forbidden&lt;/p&gt;</description>
                <environment></environment>
            <key id="12671">DDC-1173</key>
            <summary>Fatal error when a listener resets an object in onFlush and recompute the changeset</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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 May 2011 19:35:25 +0000</created>
                <updated>Sun, 5 Jun 2011 11:34:21 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 11:34:21 +0000</resolved>
                            <version>2.0.5</version>
                <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15896" author="gediminasm" created="Mon, 30 May 2011 19:24:18 +0000"  >&lt;p&gt;Here is a test case:&lt;/p&gt;

&lt;p&gt;use Doctrine\Common\EventSubscriber;&lt;br/&gt;
use Doctrine\ORM\Event\PreUpdateEventArgs;&lt;br/&gt;
use Doctrine\ORM\Event\OnFlushEventArgs;&lt;/p&gt;

&lt;p&gt;class DummyListener implements EventSubscriber&lt;br/&gt;
{&lt;br/&gt;
    public function getSubscribedEvents()&lt;/p&gt;
    {
        return array(&apos;preUpdate&apos;, &apos;onFlush&apos;);
    }

&lt;p&gt;    public function onFlush(OnFlushEventArgs $args)&lt;br/&gt;
    {&lt;br/&gt;
        $uow = $args-&amp;gt;getEntityManager()-&amp;gt;getUnitOfWork();&lt;br/&gt;
        foreach ($uow-&amp;gt;getScheduledEntityUpdates() as $object) &lt;/p&gt;
{
            $uow-&amp;gt;clearEntityChangeSet(spl_object_hash($object));
        }
&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt;    public function preUpdate(PreUpdateEventArgs $args)&lt;/p&gt;
    {
        var_dump(&apos;invoked&apos;);
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;triggers fatal error&lt;/p&gt;</comment>
                    <comment id="15915" author="beberlei" created="Sun, 5 Jun 2011 11:34:21 +0000"  >&lt;p&gt;Only fixed in 2.1&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1191] fix the notices when converting between different mappings</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1191</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/62&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/62&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/63&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/63&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12692">DDC-1191</key>
            <summary>fix the notices when converting between different mappings</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="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Jun 2011 07:26:30 +0000</created>
                <updated>Sun, 5 Jun 2011 10:29:14 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 10:29:14 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15913" author="beberlei" created="Sun, 5 Jun 2011 10:29:14 +0000"  >&lt;p&gt;Merged&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1193] cascadeRemove misses associations due to proxy not being initialized</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1193</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Let&apos;s assume you have two One-to-One relations A&amp;gt;B&amp;gt;C  (all include cascade remove). You are deleting object A, while object B is not initialized (and so it will be a proxy). In that case the object C is not deleted because UOW misses relation B&amp;gt;C since proxy of B is not initialized&lt;/p&gt;</description>
                <environment>Linux x86_64</environment>
            <key id="12694">DDC-1193</key>
            <summary>cascadeRemove misses associations due to proxy not being initialized</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="xanf">Illya Klymov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Jun 2011 16:03:05 +0000</created>
                <updated>Sun, 5 Jun 2011 08:08:55 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 08:08:55 +0000</resolved>
                            <version>2.0.5</version>
                <version>Git Master</version>
                                <fixVersion>2.0.6</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15902" author="xanf" created="Fri, 3 Jun 2011 16:06:29 +0000"  >&lt;p&gt;Test case. Expected to be put into Tests/ORM/Functional/Ticket folder&lt;/p&gt;</comment>
                    <comment id="15904" author="xanf" created="Fri, 3 Jun 2011 16:09:45 +0000"  >&lt;p&gt;Right now i&apos;m using this hack inside of UOW:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index 90d3117..a4891c7 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -1702,7 +1702,10 @@ class UnitOfWork &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; PropertyChangedListener
             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $assoc[&apos;isCascadeRemove&apos;]) {
                 &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
             }
-            &lt;span class=&quot;code-comment&quot;&gt;//TODO: If $entity &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy =&amp;gt; Initialize ?
&lt;/span&gt;+            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($entity &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy) {
+                &lt;span class=&quot;code-comment&quot;&gt;// We need to initialize entity &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; not miss it&apos;s relations
&lt;/span&gt;+                $entity = clone($entity);
+            }
             $relatedEntities = $class-&amp;gt;reflFields[$assoc[&apos;fieldName&apos;]]-&amp;gt;getValue($entity);
             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($relatedEntities &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Collection || is_array($relatedEntities)) {
                 &lt;span class=&quot;code-comment&quot;&gt;// If its a PersistentCollection initialization is intended! No unwrap!
&lt;/span&gt;}}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As stated by beberlei IIRC, we should add  public method to the generated proxy class &quot;__doctrineInitializeProxy&quot; or something&lt;/p&gt;</comment>
                    <comment id="15910" author="beberlei" created="Sun, 5 Jun 2011 08:08:55 +0000"  >&lt;p&gt;Fixed and merged into 2.0.x&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="11731">DDC-733</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10997" name="DDC1193Test.php" size="2028" author="xanf" created="Fri, 3 Jun 2011 16:06:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-733] Implement a way of forcing a PersistentCollection to initialize itself</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-733</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the only way to force an uninitialized collection to load itself is to call one of its methods (e.g. -&amp;gt;count()).&lt;/p&gt;

&lt;p&gt;Roman suggested something like $em-&amp;gt;initialize($collection)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11731">DDC-733</key>
            <summary>Implement a way of forcing a PersistentCollection to initialize itself</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12257">DDC-952</parent>
                        <priority id="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="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Aug 2010 11:02:20 +0000</created>
                <updated>Sun, 5 Jun 2011 06:45:24 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 06:45:24 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="13808" author="jwage" created="Sat, 7 Aug 2010 01:36:27 +0000"  >&lt;p&gt;Why not just make the initialize method public on PersistentCollection:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$collection-&amp;gt;initialize();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;??&lt;/p&gt;</comment>
                    <comment id="13810" author="romanb" created="Sat, 7 Aug 2010 03:45:14 +0000"  >&lt;p&gt;Even if that is done, userland code should not use the PersistentCollection API. Remember that a PersistentCollection is supposed to be a transparent wrapper around a Collection implementation. If a user calls $coll-&amp;gt;initialize() this code implicitly assumes the concrete type of the collection to be PersistentCollection, which is not a good idea. Userland code should always program to the Collection interface.&lt;/p&gt;</comment>
                    <comment id="13811" author="romanb" created="Sat, 7 Aug 2010 03:49:31 +0000"  >&lt;p&gt;Such an initialize method should furthermore handle uninitialized proxies as well as uninitialized collections.&lt;/p&gt;</comment>
                    <comment id="13813" author="ccapndave" created="Sat, 7 Aug 2010 06:07:00 +0000"  >&lt;p&gt;For extra points it might be nice if there was an extra cascade option for initialize, and possibly an event hook for pre and post initialize.&lt;/p&gt;</comment>
                    <comment id="15493" author="ericmuyser" created="Mon, 14 Mar 2011 01:34:22 +0000"  >&lt;p&gt;I just ran into a bug with this, I believe. I have a Blog which cascade deletes it&apos;s Feeds. In cascadeDetach it&apos;s saying the count($relatedEntities) is zero for Feeds after the call to unwrap(), even though I know it to be, say, 1 or 2 (output before detaching owner entity). However, if I do -&amp;gt;count() or count($relatedEntities) BEFORE unwrap(), then PersistentCollection by consequence is initialized, and it cascade deletes correctly. If it don&apos;t, it actually says the Feeds are still MANAGED after having detached the owner entity. So, yeah, this or some other form of auto-initialization would be useful.&lt;/p&gt;

&lt;p&gt;Note: In Blog, I have DQL which fetches Feeds JOINed to Blog, which may be causing the uninitialization (not sure). I&apos;m using EXTRA LAZY LOADING.&lt;/p&gt;</comment>
                    <comment id="15546" author="james.harvey" created="Sun, 20 Mar 2011 22:09:36 +0000"  >&lt;p&gt;I have also run into a problem with this: when adding a single entity to an empty collection and then calling flush(), the collection which should now have 1 entity in it actually has 2. I discovered that this can be fixed by calling count() on the collection prior to the flush() operation. I looked into the code and noticed that most methods in PersistentCollection.php (v2.0.3) call $this-&amp;gt;initialize() as their first step, but the add() function did not. I think this may be an oversight? By adding $this-&amp;gt;initialize() to the add() function my problem was resolved.&lt;/p&gt;</comment>
                    <comment id="15629" author="beberlei" created="Tue, 29 Mar 2011 14:37:19 +0000"  >&lt;p&gt;Hello James, not calling initialize() is a very important performance optimization. Consider your collection containing hundrets, thousands or more entities. You dont want to load them all into memory just to add one new entity.&lt;/p&gt;

&lt;p&gt;To solve your problem there is Collection::contains($entity) which will handle your collection correctly. in combination with &quot;EXTRA_LAZY&quot; support introduced in 2.1-DEV this is even very efficient.&lt;/p&gt;</comment>
                    <comment id="15909" author="beberlei" created="Sun, 5 Jun 2011 06:45:24 +0000"  >&lt;p&gt;Implemented $em-&amp;gt;getUnitOfWork()-&amp;gt;initializeObject().&lt;/p&gt;

&lt;p&gt;For this the proxy method __load() was turned from private to public and marked as /** @private */&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="12694">DDC-1193</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1141] DisconnectedClassMetadataFactory forbids direct XML-to-SQL conversion</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1141</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine\ORM\Tools\DisconnectedClassMetadataFactory::newClassMetadataInstance() returns instances of ClassMetadataInfo, while the parent returns instances of ClassMetadata. This creates problems when using SchemaTool to create a schema from an XML mapping for instance:&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Fatal error: Call to undefined method Doctrine\ORM\Mapping\ClassMetadataInfo::getQuotedTableName() 
in path/to/Doctrine/ORM/Tools/SchemaTool.php on line 133
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is because schemaTool expects ClassMetadata objects, while it got ClassMetadataInfo objects.&lt;/p&gt;

&lt;p&gt;My setup:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
$config = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Configuration();
$config-&amp;gt;setMetadataCacheImpl(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Cache\ArrayCache);
$driverImpl = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; XmlDriver(__DIR__ . &apos;/fixtures&apos;);
$config-&amp;gt;setMetadataDriverImpl($driverImpl);
$config-&amp;gt;setProxyDir(__DIR__ . &apos;/Proxies&apos;);
$config-&amp;gt;setProxyNamespace(&apos;Proxies&apos;);
$connectionOptions = array(
    &apos;driver&apos; =&amp;gt; &apos;pdo_sqlite&apos;,
    &apos;path&apos; =&amp;gt; &apos;database.sqlite&apos;
);
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
$cmf = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DisconnectedClassMetadataFactory();
$cmf-&amp;gt;setEntityManager($em);

$metadatas = $cmf-&amp;gt;getAllMetadata() &lt;span class=&quot;code-comment&quot;&gt;// array of ClassMetadataInfo and not ClassMetadata&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think Doctrine\ORM\Tools\DisconnectedClassMetadataFactory::newClassMetadataInstance() should return a ClassMetadata instance.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12623">DDC-1141</key>
            <summary>DisconnectedClassMetadataFactory forbids direct XML-to-SQL conversion</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="fzaninotto">Francois Zaninotto</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 May 2011 09:35:11 +0000</created>
                <updated>Sun, 5 Jun 2011 06:22:01 +0000</updated>
                    <resolved>Sun, 5 Jun 2011 06:22:01 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15820" author="fzaninotto" created="Tue, 10 May 2011 13:55:53 +0000"  >&lt;p&gt;Ok, the proposed solution is wrong.&lt;/p&gt;

&lt;p&gt;I actually need an array of ClassMetadataInfo and not of ClassMetadata, since the entities don&apos;t exist (yet). So the problem lies in the fact that getQuotedTableName() and getQuotedColumnName() are methods of Doctrine\ORM\Mapping\ClassMetadata, and not of Doctrine\ORM\Mapping\ClassMetadataInfo. Moving these two methods up the inheritance path, I managed to create a schema directly from an XML mapping. However, I had to inject the MetadataFactory inside the EM, otherwise the SchemaTool coped when dealing wit hrelationships.&lt;/p&gt;

&lt;p&gt;So a working setup to generate SQL from an XML mapping without stepping by Entity generation is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$config = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Configuration();
$config-&amp;gt;setMetadataCacheImpl(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Cache\ArrayCache);
$driverImpl = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; XmlDriver(__DIR__ . &apos;/fixtures&apos;);
$config-&amp;gt;setMetadataDriverImpl($driverImpl);
$config-&amp;gt;setProxyDir(__DIR__ . &apos;/Proxies&apos;);
$config-&amp;gt;setProxyNamespace(&apos;Proxies&apos;);
$config-&amp;gt;setClassMetadataFactoryName(&apos;Doctrine\ORM\Tools\DisconnectedClassMetadataFactory&apos;);
$connectionOptions = array(
    &apos;driver&apos; =&amp;gt; &apos;pdo_sqlite&apos;,
    &apos;path&apos; =&amp;gt; &apos;database.sqlite&apos;
);
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
$cmf = $em-&amp;gt;getMetadataFactory();

$schemaTool = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SchemaTool($em);
$schemaTool-&amp;gt;createSchema($cmf-&amp;gt;getAllMetadata());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But again, this requires moving up the two methods from ClassMetadata to ClassMetadataInfo.&lt;/p&gt;</comment>
                    <comment id="15848" author="beberlei" created="Sat, 14 May 2011 10:01:28 +0000"  >&lt;p&gt;Moving the methods up is the solution i guess, however i have to think why we did this in the first place, probably because of dependencies.&lt;/p&gt;</comment>
                    <comment id="15907" author="beberlei" created="Sun, 5 Jun 2011 06:22:01 +0000"  >&lt;p&gt;This was merged into Doctrine 2.1 / master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1080] AbstractHydrator -&gt;_gatherRowData using wrong metadata info</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1080</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The following worked in a previous version but after upgrading to the latest to fix the security issue, I got an issue.&lt;/p&gt;

&lt;p&gt;I will first start with the setup:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;MySQL&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE `bar` (
  `barID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL AUTO_INCREMENT,
  `barTitle` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`barID`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

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

CREATE TABLE `fooBar` (
  `fooID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  `barID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  `orderNr` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) DEFAULT NULL,
  PRIMARY KEY (`fooID`,`barID`),
  KEY `b` (`barID`),
  KEY `f` (`fooID`),
  CONSTRAINT `f` FOREIGN KEY (`fooID`) REFERENCES `foo` (`fooID`) ON DELETE CASCADE ON UPDATE NO ACTION,
  CONSTRAINT `b` FOREIGN KEY (`barID`) REFERENCES `bar` (`barID`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `bar` (barID,barTitle) VALUES (1,&apos;bar title 1&apos;);
INSERT INTO `bar` (barID,barTitle) VALUES (2,&apos;bar title 2&apos;);
INSERT INTO `bar` (barID,barTitle) VALUES (3,&apos;bar title 3&apos;);
INSERT INTO `bar` (barID,barTitle) VALUES (4,&apos;bar title 4&apos;);

INSERT INTO `foo` (fooID,fooTitle) VALUES (1,&apos;foo title 1&apos;);
INSERT INTO `foo` (fooID,fooTitle) VALUES (2,&apos;foo title 2&apos;);

INSERT INTO `fooBar` (fooID,barID,orderNr) VALUES (1,1,0);
INSERT INTO `fooBar` (fooID,barID,orderNr) VALUES (1,2,1);
INSERT INTO `fooBar` (fooID,barID,orderNr) VALUES (1,3,3);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Foo.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;)
 */

class Application_Model_Foo
{
	
	/**
	 * @Id 
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooID;
	
	/**
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooTitle&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooTitle;
	
	/**
	 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Application_Model_FooBar&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_foo&quot;&lt;/span&gt;,
	 * cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
	 * @OrderBy({&lt;span class=&quot;code-quote&quot;&gt;&quot;_orderNr&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooBars;

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct ()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBars = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
	}
	
	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $fooID
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getFooID ()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooID;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $fooTitle
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getFooTitle ()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooTitle;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $fooBars
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getFooBars ()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBars;
	}

	/**
	 * @param field_type $fooID
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setFooID ($fooID)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooID = $fooID;
	}

	/**
	 * @param field_type $fooTitle
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setFooTitle ($fooTitle)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooTitle = $fooTitle;
	}

	/**
	 * @param field_type $fooBars
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setFooBars ($fooBars)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBars = $fooBars;
	}


}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Bar.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt;)
 */

class Application_Model_Bar
{
	
	/**
	 * @Id 
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;barID&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_barID;
	
	/**
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;barTitle&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_barTitle;
	
	/**
	 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Application_Model_FooBar&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_bar&quot;&lt;/span&gt;,
	 * cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
	 * @OrderBy({&lt;span class=&quot;code-quote&quot;&gt;&quot;_orderNr&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_fooBars;

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct ()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBars = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
	}
	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $barID
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getBarID ()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_barID;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $barTitle
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getBarTitle ()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_barTitle;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $fooBars
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getFooBars ()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBars;
	}

	/**
	 * @param field_type $barID
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setBarID ($barID)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_barID = $barID;
	}

	/**
	 * @param field_type $barTitle
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setBarTitle ($barTitle)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_barTitle = $barTitle;
	}

	/**
	 * @param field_type $fooBars
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setFooBars ($fooBars)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_fooBars = $fooBars;
	}


}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;FooBar.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooBar&quot;&lt;/span&gt;)
 * @Entity
 */
class Application_Model_FooBar
{

	/**
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Application_Model_Foo&quot;&lt;/span&gt;)
	 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;fooID&quot;&lt;/span&gt;)
	 * @Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_foo = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

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

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer orderNr
	 * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;orderNr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_orderNr = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * Retrieve the foo property
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Application_Model_Foo
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getFoo()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_foo;
	}

	/**
	 * Set the foo property
	 *
	 * @param Application_Model_Foo $foo
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Application_Model_FooBar
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setFoo($foo)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_foo = $foo;
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
	}

	/**
	 * Retrieve the bar property
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Application_Model_Bar
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getBar()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_bar;
	}

	/**
	 * Set the bar property
	 *
	 * @param Application_Model_Bar $bar
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Application_Model_FooBar
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setBar($bar)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_bar = $bar;
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
	}

	/**
	 * Retrieve the orderNr property
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; integer|&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getOrderNr()
	{
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_orderNr;
	}

	/**
	 * Set the orderNr property
	 *
	 * @param integer|&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; $orderNr
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Application_Model_FooBar
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setOrderNr($orderNr)
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_orderNr = $orderNr;
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
	}


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

&lt;p&gt;When I execute the following code&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;IndexController.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$foo = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;find(&apos;Application_Model_Foo&apos;, 1);
$fooBars = $foo-&amp;gt;getFooBars();
var_dump(count($fooBars));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I expect &quot;3&quot; as output. But I get &quot;1&quot;.&lt;/p&gt;

&lt;p&gt;There seems to be an issue with the metadata or the used fieldname in the _gatherRowData in the AbstractHydrator.&lt;/p&gt;

&lt;p&gt;The following is a dump of $classMetadata = $this-&amp;gt;_em-&amp;gt;getClassMetadata($this-&amp;gt;_rsm-&amp;gt;aliasMap[$cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt;]);&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;abstractHydrator&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine\ORM\Mapping\ClassMetadata &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
(
    [reflFields] =&amp;gt; Array
        (
            [_orderNr] =&amp;gt; ReflectionProperty &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                    [name] =&amp;gt; _orderNr
                    [class] =&amp;gt; Application_Model_FooBar
                )

            [_foo] =&amp;gt; ReflectionProperty &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                    [name] =&amp;gt; _foo
                    [class] =&amp;gt; Application_Model_FooBar
                )

            [_bar] =&amp;gt; ReflectionProperty &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                    [name] =&amp;gt; _bar
                    [class] =&amp;gt; Application_Model_FooBar
                )

        )

    [_prototype:Doctrine\ORM\Mapping\ClassMetadata:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;] =&amp;gt; 
    [name] =&amp;gt; Application_Model_FooBar
    [namespace] =&amp;gt; 
    [rootEntityName] =&amp;gt; Application_Model_FooBar
    [customRepositoryClassName] =&amp;gt; 
    [isMappedSuperclass] =&amp;gt; 
    [parentClasses] =&amp;gt; Array
        (
        )

    [subClasses] =&amp;gt; Array
        (
        )

    [namedQueries] =&amp;gt; Array
        (
        )

    [identifier] =&amp;gt; Array
        (
            [0] =&amp;gt; _foo
            [1] =&amp;gt; _bar
        )

    [inheritanceType] =&amp;gt; 1
    [generatorType] =&amp;gt; 5
    [fieldMappings] =&amp;gt; Array
        (
            [_orderNr] =&amp;gt; Array
                (
                    [fieldName] =&amp;gt; _orderNr
                    [type] =&amp;gt; integer
                    [length] =&amp;gt; 
                    [precision] =&amp;gt; 0
                    [scale] =&amp;gt; 0
                    [nullable] =&amp;gt; 
                    [unique] =&amp;gt; 
                    [columnName] =&amp;gt; orderNr
                )

        )

    [fieldNames] =&amp;gt; Array
        (
            [orderNr] =&amp;gt; _orderNr
        )

    [columnNames] =&amp;gt; Array
        (
            [_orderNr] =&amp;gt; orderNr
        )

    [discriminatorValue] =&amp;gt; 
    [discriminatorMap] =&amp;gt; Array
        (
        )

    [discriminatorColumn] =&amp;gt; 
    [table] =&amp;gt; Array
        (
            [name] =&amp;gt; fooBar
        )

    [lifecycleCallbacks] =&amp;gt; Array
        (
        )

    [associationMappings] =&amp;gt; Array
        (
            [_foo] =&amp;gt; Array
                (
                    [fieldName] =&amp;gt; _foo
                    [id] =&amp;gt; 1
                    [joinColumns] =&amp;gt; Array
                        (
                            [0] =&amp;gt; Array
                                (
                                    [name] =&amp;gt; fooID
                                    [referencedColumnName] =&amp;gt; fooID
                                    [unique] =&amp;gt; 
                                    [nullable] =&amp;gt; 1
                                    [onDelete] =&amp;gt; 
                                    [onUpdate] =&amp;gt; 
                                    [columnDefinition] =&amp;gt; 
                                )

                        )

                    [cascade] =&amp;gt; Array
                        (
                        )

                    [inversedBy] =&amp;gt; 
                    [targetEntity] =&amp;gt; Application_Model_Foo
                    [fetch] =&amp;gt; 2
                    [type] =&amp;gt; 2
                    [mappedBy] =&amp;gt; 
                    [isOwningSide] =&amp;gt; 1
                    [sourceEntity] =&amp;gt; Application_Model_FooBar
                    [isCascadeRemove] =&amp;gt; 
                    [isCascadePersist] =&amp;gt; 
                    [isCascadeRefresh] =&amp;gt; 
                    [isCascadeMerge] =&amp;gt; 
                    [isCascadeDetach] =&amp;gt; 
                    [sourceToTargetKeyColumns] =&amp;gt; Array
                        (
                            [fooID] =&amp;gt; fooID
                        )

                    [joinColumnFieldNames] =&amp;gt; Array
                        (
                            [fooID] =&amp;gt; fooID
                        )

                    [targetToSourceKeyColumns] =&amp;gt; Array
                        (
                            [fooID] =&amp;gt; fooID
                        )

                    [orphanRemoval] =&amp;gt; 
                )

            [_bar] =&amp;gt; Array
                (
                    [fieldName] =&amp;gt; _bar
                    [id] =&amp;gt; 1
                    [joinColumns] =&amp;gt; Array
                        (
                            [0] =&amp;gt; Array
                                (
                                    [name] =&amp;gt; barID
                                    [referencedColumnName] =&amp;gt; barID
                                    [unique] =&amp;gt; 
                                    [nullable] =&amp;gt; 1
                                    [onDelete] =&amp;gt; 
                                    [onUpdate] =&amp;gt; 
                                    [columnDefinition] =&amp;gt; 
                                )

                        )

                    [cascade] =&amp;gt; Array
                        (
                        )

                    [inversedBy] =&amp;gt; 
                    [targetEntity] =&amp;gt; Application_Model_Bar
                    [fetch] =&amp;gt; 2
                    [type] =&amp;gt; 2
                    [mappedBy] =&amp;gt; 
                    [isOwningSide] =&amp;gt; 1
                    [sourceEntity] =&amp;gt; Application_Model_FooBar
                    [isCascadeRemove] =&amp;gt; 
                    [isCascadePersist] =&amp;gt; 
                    [isCascadeRefresh] =&amp;gt; 
                    [isCascadeMerge] =&amp;gt; 
                    [isCascadeDetach] =&amp;gt; 
                    [sourceToTargetKeyColumns] =&amp;gt; Array
                        (
                            [barID] =&amp;gt; barID
                        )

                    [joinColumnFieldNames] =&amp;gt; Array
                        (
                            [barID] =&amp;gt; barID
                        )

                    [targetToSourceKeyColumns] =&amp;gt; Array
                        (
                            [barID] =&amp;gt; barID
                        )

                    [orphanRemoval] =&amp;gt; 
                )

        )

    [isIdentifierComposite] =&amp;gt; 1
    [containsForeignIdentifier] =&amp;gt; 1
    [idGenerator] =&amp;gt; Doctrine\ORM\Id\AssignedGenerator &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
        (
        )

    [sequenceGeneratorDefinition] =&amp;gt; 
    [tableGeneratorDefinition] =&amp;gt; 
    [changeTrackingPolicy] =&amp;gt; 1
    [isVersioned] =&amp;gt; 
    [versionField] =&amp;gt; 
    [reflClass] =&amp;gt; ReflectionClass &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
        (
            [name] =&amp;gt; Application_Model_FooBar
        )

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

&lt;p&gt;$fieldName = $this-&amp;gt;_rsm-&amp;gt;metaMappings&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;; is &quot;fooID&quot; or &quot;barID&quot;&lt;/p&gt;

&lt;p&gt;After assigning  $cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;isIdentifier&amp;#39;&amp;#93;&lt;/span&gt; = $classMetadata-&amp;gt;isIdentifier($fieldName); you get false back.&lt;/p&gt;

&lt;p&gt;So you check for fooID / barID in the array  &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;[identifier] =&amp;gt; Array
        (
            [0] =&amp;gt; _foo
            [1] =&amp;gt; _bar
        )
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;what of course is false because they aren&apos;t in the array.&lt;/p&gt;

&lt;p&gt;When I set the flag $cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;isIdentifier&amp;#39;&amp;#93;&lt;/span&gt; to true for the 2 fields, I get an output of 3 as expected.&lt;/p&gt;

&lt;p&gt;So the fieldname is wrong or the identifier list is wrong.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12497">DDC-1080</key>
            <summary>AbstractHydrator -&gt;_gatherRowData using wrong metadata info</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="tbo">Van Hauwaert Bert</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Mar 2011 12:46:35 +0000</created>
                <updated>Tue, 17 May 2011 21:43:03 +0000</updated>
                    <resolved>Tue, 17 May 2011 21:43:03 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15593" author="beberlei" created="Sun, 27 Mar 2011 06:41:30 +0000"  >&lt;p&gt;&quot;In a previous version&quot;? What exact version please? I can&apos;t pin down the commits with such a broad statement.&lt;/p&gt;

&lt;p&gt;Edit: Ah you are working with master and fk+pk support. Can you still find out the version? There were some general fixes in the hydrator and one larger refactoring since I merged the fk+pk branch.&lt;/p&gt;</comment>
                    <comment id="15616" author="tbo" created="Tue, 29 Mar 2011 05:11:27 +0000"  >&lt;p&gt;This is the last log on a server where it is still working:&lt;br/&gt;
ORM: &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;commit 180078d0f6fa97bf5f3398e8c5d2f56030236c33
Author: Guilherme Blanco &amp;lt;guilhermeblanco@gmail.com&amp;gt;
Date:   Mon Mar 14 01:04:50 2011 -0300

    Added namedQueries as optional during serialization of ClassMetadata.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Common:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;commit ba63ae0f0b6b62a2a8617f01386698730ff2b713
Author: Jonathan H. Wage &amp;lt;jonwage@gmail.com&amp;gt;
Date:   Wed Feb 16 10:17:48 2011 -0600

    Revert &lt;span class=&quot;code-quote&quot;&gt;&quot;Adding Driver &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; mapping drivers.&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;DBAL:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;commit ae084d9c6975356f8f0f10d8802abe91df45b739
Author: Benjamin Eberlei &amp;lt;kontakt@beberlei.de&amp;gt;
Date:   Sun Jan 30 10:58:14 2011 -0500

    Release {$version}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15634" author="beberlei" created="Tue, 29 Mar 2011 15:22:05 +0000"  >&lt;p&gt;Ah i know what the problem might be.&lt;/p&gt;</comment>
                    <comment id="15647" author="tbo" created="Fri, 1 Apr 2011 06:59:46 +0000"  >&lt;p&gt;Great! Looking forward for a fix. It would solve a lot of issues I&apos;m having now.&lt;/p&gt;</comment>
                    <comment id="15853" author="beberlei" created="Sat, 14 May 2011 11:07:52 +0000"  >&lt;p&gt;The bug appears because you rename the id column from the default value. If you rename the property to $fooId instead of $_fooId it works.&lt;/p&gt;

&lt;p&gt;I have to check how i can fix this issue, but its complicated.&lt;/p&gt;</comment>
                    <comment id="15854" author="beberlei" created="Sat, 14 May 2011 11:29:41 +0000"  >&lt;p&gt;There are two potential fixes for this bug, both have their drawbacks, we have to discuss them in the team. For now rename the field to the name of the column to get it working.&lt;/p&gt;</comment>
                    <comment id="15855" author="beberlei" created="Sat, 14 May 2011 11:30:06 +0000"  >&lt;p&gt;Not a blocker, there is a workaround&lt;/p&gt;</comment>
                    <comment id="15863" author="beberlei" created="Tue, 17 May 2011 21:43:03 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-694] Add info Command that shows Entities and Mapping Directories</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-694</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should add an command to get information about the doctrine project:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;List all entities&lt;/li&gt;
	&lt;li&gt;List all mapping directories/mapping drivers&lt;/li&gt;
	&lt;li&gt;Maybe configuration stuff?&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="11638">DDC-694</key>
            <summary>Add info Command that shows Entities and Mapping Directories</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Jul 2010 16:37:01 +0000</created>
                <updated>Sun, 15 May 2011 18:19:07 +0000</updated>
                    <resolved>Sun, 15 May 2011 18:19:07 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15062" author="beberlei" created="Thu, 30 Dec 2010 08:15:52 +0000"  >&lt;p&gt;Schedule for 2.1&lt;/p&gt;

&lt;p&gt;This is very helpful for debugging, people tend to define their mappings wrong and its easy to tell them &quot;check doctrine orm:list-mappings&quot; or something&lt;/p&gt;</comment>
                    <comment id="15861" author="beberlei" created="Sun, 15 May 2011 18:19:07 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1059] Add helper for ResultSetMapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1059</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Building a ResultSetMapping yourself is tedious work, it can be simplified by passing ClassMetadata instances, so that the RSM even changes when the Entity Metadata changes.&lt;/p&gt;

&lt;p&gt;Two use-cases:&lt;/p&gt;

&lt;p&gt;1. Add Entity X as Root Entity&lt;br/&gt;
2. Add Entity X as Fetch Joined Entity of parent entity Y&lt;/p&gt;</description>
                <environment></environment>
            <key id="12451">DDC-1059</key>
            <summary>Add helper for ResultSetMapping</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 5 Mar 2011 14:19:41 +0000</created>
                <updated>Sun, 15 May 2011 17:31:20 +0000</updated>
                    <resolved>Sun, 15 May 2011 17:31:20 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15579" author="mridgway" created="Thu, 24 Mar 2011 16:13:53 +0000"  >&lt;p&gt;What are the inputs and outputs from this?  Would this return just the ResultSetMap and then you&apos;d be expected to generate the SQL yourself?&lt;/p&gt;

&lt;p&gt;The main reason for using the RSM is if you are trying to do something that is not supported in DQL. With the SQL query building functions being added to the DBAL, would it be better to have a helper that takes in DQL (or DQL parts?) and returns the SQL query and the RSM?&lt;/p&gt;

&lt;p&gt;I&apos;m not sure if this covers all use cases, but probably the most common.&lt;/p&gt;</comment>
                    <comment id="15580" author="beberlei" created="Fri, 25 Mar 2011 04:04:41 +0000"  >&lt;p&gt;I was thinking this accepts a ClassMetadata instance, or the EM + ClassName. Additionally you might need to pass a prefix when you have to build a query for many tables that have equally named columns:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$rsm-&amp;gt;addEntityColumnsFromClassMetadata($em-&amp;gt;getClassMetadata(&apos;Article&apos;));
$rsm-&amp;gt;addEntityColumnsFromClassMetadata($em-&amp;gt;getClassMetadata(&apos;Category&apos;), &apos;category_&apos;);
&lt;span class=&quot;code-comment&quot;&gt;// SELECT a.*, c.category_id, c.category_name, c.category_desc FROM Article a INNER JOIN Category c&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Naming and API is open to discussion obviously &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;The goal should be that you dont have to change your native queries when you add or remove a column from your entity.&lt;/p&gt;</comment>
                    <comment id="15636" author="mridgway" created="Tue, 29 Mar 2011 20:41:10 +0000"  >&lt;p&gt;I made a first pass at this: &lt;a href=&quot;https://github.com/mridgway/doctrine2/commit/20dc72ef9ae0d7c4afead35c249c224b95570aa7&quot; class=&quot;external-link&quot;&gt;https://github.com/mridgway/doctrine2/commit/20dc72ef9ae0d7c4afead35c249c224b95570aa7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This basically creates new functions with the same functionality as addEntityResult and addJoinedEntityResult except that they take in ClassMetadata and will add the fields from the class automatically.  There is also an additional parameter for each function that is a prefix that is added to the entity&apos;s column name (see test case for example).&lt;/p&gt;

&lt;p&gt;One problem with this implementation is that it doesn&apos;t use DBAL\Platforms\AbstractPlatform::getSQLResultCasing since we don&apos;t have access to the connection.&lt;/p&gt;

&lt;p&gt;There are probably other problems, but I wanted to get some feedback on whether this is heading in the right direction.&lt;/p&gt;</comment>
                    <comment id="15859" author="beberlei" created="Sun, 15 May 2011 17:31:20 +0000"  >&lt;p&gt;This was implemented by Michael, thank you!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1029] renaming &quot;load()&quot; in proxy to &quot;__load()&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1029</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be really great if the method &quot;load&quot; is renamed to something more protected like &quot;__load&quot; or &quot;_doctrineOdmLoad&quot; like it has done for public properties &lt;br/&gt;
public $__dm;&lt;br/&gt;
public $__identifier;&lt;br/&gt;
public $&lt;em&gt;isInitialized&lt;/em&gt; = false;&lt;br/&gt;
Because otherwise if a referenced document has the same method &quot;load&quot; it causes error like this&lt;/p&gt;

&lt;p&gt;&quot;Fatal error: Cannot redeclare Proxies\ProjectProxy::load() in /projects/tbi_doctrine/tmp/doctrine/proxies/ProjectProxy.php on line 46&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12380">DDC-1029</key>
            <summary>renaming &quot;load()&quot; in proxy to &quot;__load()&quot;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Feb 2011 13:32:26 +0000</created>
                <updated>Fri, 13 May 2011 03:23:57 +0000</updated>
                    <resolved>Fri, 13 May 2011 03:23:57 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15258" author="jwage" created="Fri, 11 Feb 2011 13:33:17 +0000"  >&lt;p&gt;This issue is a duplicate of another issue in the ODM. The fix applies to the ORM as well.&lt;/p&gt;</comment>
                    <comment id="15834" author="guilhermeblanco" created="Fri, 13 May 2011 03:23:57 +0000"  >&lt;p&gt;Fixed on master&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/e5381286458ac467543b23ac1a1a1c613bbc2ff1&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/e5381286458ac467543b23ac1a1a1c613bbc2ff1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="12369">MODM-118</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1122] Parsing OR conditions in Where clause throws an exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1122</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the next query:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $qb =  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQueryBuilder();
    
          $qb -&amp;gt;select(&apos;Inventory&apos;)
            -&amp;gt;from(&apos;\Entity\Inventory&apos;, &apos;Inventory&apos;)
            -&amp;gt;leftJoin(&apos;Inventory.Variant&apos;, &apos;Variant&apos;)
            -&amp;gt;where(&apos;(Variant.isSellable = 0) OR (Variant IS NULL)&apos;)
           -&amp;gt;getQuery()-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;that throws an exception:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; PHP Fatal error:  Call to undefined method Doctrine\ORM\Query\AST\ConditionalExpression::isSimpleConditionalExpression() .../Doctrine/ORM/Query/SqlWalker.php on line 1378.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt; The SqlWalker::walkConditionalPrimary function expects the $primary parameter passed to it to be an instance of Doctrine\ORM\Query\AST\ConditionalPrimary, but it is actually an instance of Doctrine\ORM\Query\AST\ConditionalExpression class that is passed in that case and of course it does not have a method called isSimpleConditionalExpression.&lt;/p&gt;

&lt;p&gt;The workaround is to use extra parentheses around the conditions: ((Variant.isSellable = 0) OR (Variant IS NULL)) which does not seem to be very intuitive way.&lt;/p&gt;</description>
                <environment>Ubuntu Dedicated Server</environment>
            <key id="12573">DDC-1122</key>
            <summary>Parsing OR conditions in Where clause throws an exception</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="deatheriam">Oleg Namaka</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Apr 2011 16:54:30 +0000</created>
                <updated>Fri, 13 May 2011 03:13:47 +0000</updated>
                    <resolved>Fri, 13 May 2011 03:13:47 +0000</resolved>
                            <version>2.0.4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15760" author="beberlei" created="Sat, 30 Apr 2011 05:50:55 +0000"  >&lt;p&gt;Fixed formatting, scheduled for 2.0.5&lt;/p&gt;</comment>
                    <comment id="15764" author="beberlei" created="Sat, 30 Apr 2011 06:41:32 +0000"  >&lt;p&gt;It works for me outside the QueryBuilder context when using DQL itself.&lt;/p&gt;

&lt;p&gt;Can you call $qb-&amp;gt;getQuery()-&amp;gt;getDQL() and print that here?&lt;/p&gt;</comment>
                    <comment id="15833" author="guilhermeblanco" created="Fri, 13 May 2011 03:13:47 +0000"  >&lt;p&gt;As stated by this passing unit test:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/1e9e2de73740667de49847392d978eb4847217a2&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/1e9e2de73740667de49847392d978eb4847217a2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This issue is invalid for assigned fix version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1148] [Patch] Auto infer parameter type in DQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1148</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Here is the patch:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pastie.org/1891023&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1891023&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/1891030&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1891030&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12633">DDC-1148</key>
            <summary>[Patch] Auto infer parameter type in DQL</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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 May 2011 23:19:50 +0000</created>
                <updated>Fri, 13 May 2011 02:12:25 +0000</updated>
                    <resolved>Fri, 13 May 2011 02:12:25 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15825" author="beberlei" created="Thu, 12 May 2011 07:39:34 +0000"  >&lt;p&gt;instanceof DateTimeZone is just wrong. drop that whole branch, TZ only saves the timezone from a DateTime object, infering TYPE::DECIMAL sounds dangerous to me, i would drop that one aswell. The array check has a bug, you call key() and then do nothing with the $key instaed check is_integer on the $value again, which is always an array from the previous check.&lt;/p&gt;</comment>
                    <comment id="15826" author="beberlei" created="Thu, 12 May 2011 07:39:56 +0000"  >&lt;p&gt;I thought you wanted to infer the types from the left hand sides of the DQL conditions?&lt;/p&gt;</comment>
                    <comment id="15830" author="guilhermeblanco" created="Fri, 13 May 2011 02:12:25 +0000"  >&lt;p&gt;Implemented: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/8e3fdc5adc0facd4b44f9054ab3681e46131ba8a&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/8e3fdc5adc0facd4b44f9054ab3681e46131ba8a&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-170] Smarter IN() query mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-170</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is my desired final product:&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;$users = $em-&amp;gt;createQuery(&apos;SELECT FROM User u WHERE u.id IN :ids&apos;)
-&amp;gt;setParameter(&apos;ids&apos; =&amp;gt; array(1, 2, 3))
-&amp;gt;execute()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I am currently using unpleasant methods of generating strings of &apos;?&apos; to insert into the DQL, which is not quite as elegant as the rest of the DQL language.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10488">DDC-170</key>
            <summary>Smarter IN() query mapping</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="mcurcio">Matt Curcio</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 Nov 2009 22:38:26 +0000</created>
                <updated>Fri, 13 May 2011 02:11:56 +0000</updated>
                    <resolved>Fri, 13 May 2011 02:11:56 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>9</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="11372" author="mcurcio" created="Wed, 13 Jan 2010 17:14:06 +0000"  >&lt;p&gt;Can we call this a 2.0beta improvement?&lt;/p&gt;</comment>
                    <comment id="12841" author="mjh_ca" created="Thu, 6 May 2010 01:03:57 +0000"  >&lt;p&gt;Agree it would be nice via setParameter.  But, this can already be accomplished via QueryBuilder expr().  For example:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;// directly from EntityManager
$qb = $em-&amp;gt;createQueryBuilder();

$qb-&amp;gt;select(&apos;u&apos;)
   -&amp;gt;from(&apos;User&apos;, &apos;u&apos;)
   -&amp;gt;where($qb-&amp;gt;expr()-&amp;gt;in(&apos;u.id&apos;, array(1, 2, 3));

$result = $qb-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;// or via EntityRepository
$qb = $em-&amp;gt;getRepository(&apos;User&apos;)-&amp;gt;createQueryBuilder(&apos;u&apos;);
$qb-&amp;gt;where($qb-&amp;gt;expr()-&amp;gt;in(&apos;u.id&apos;, array(1, 2, 3));
$result = $qb-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15829" author="guilhermeblanco" created="Fri, 13 May 2011 02:11:56 +0000"  >&lt;p&gt;Currently it&apos;s possible to send an array of parameters that can perfectly fix this.&lt;br/&gt;
Here is a sample for consideration:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username IN (?0)&quot;&lt;/span&gt;);
$query-&amp;gt;setParameter(0, array(&apos;beberlei&apos;, &apos;jwage&apos;));
        
$users = $query-&amp;gt;execute();
        
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(2, count($users));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the last commit: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/8e3fdc5adc0facd4b44f9054ab3681e46131ba8a&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/8e3fdc5adc0facd4b44f9054ab3681e46131ba8a&lt;/a&gt;&lt;br/&gt;
It is now possible to do that without having to manually define a parameter type (which smartly converts into valid data types).&lt;/p&gt;


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

<item>
            <title>[DDC-1147] Allow 0-based InputParameters in DQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1147</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently it&apos;s impossible to define a 0-based input parameter.&lt;br/&gt;
This restriction of Doctrine 2 is odd, because we already have enough support to it, and restriction is merely cosmetic, and also prevents 1:1 array usage on DQL Parameters.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12631">DDC-1147</key>
            <summary>Allow 0-based InputParameters in DQL</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 May 2011 20:30:01 +0000</created>
                <updated>Wed, 11 May 2011 20:31:03 +0000</updated>
                    <resolved>Wed, 11 May 2011 20:31:03 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15821" author="guilhermeblanco" created="Wed, 11 May 2011 20:31:03 +0000"  >&lt;p&gt;Implemented in trunk&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1120] AbstractQuery::useResultCache no return type in phpdoc</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1120</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;ul&gt;
	&lt;li&gt;@param string $resultCacheId&lt;/li&gt;
	&lt;li&gt;@return This query instance.&lt;br/&gt;
     */&lt;br/&gt;
    public function useResultCache($bool, $timeToLive = null, $resultCacheId = null)&lt;br/&gt;
    {&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;must be&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;@param string $resultCacheId&lt;/li&gt;
	&lt;li&gt;@return Doctrine\ORM\AbstractQuery This query instance.&lt;br/&gt;
     */&lt;br/&gt;
    public function useResultCache($bool, $timeToLive = null, $resultCacheId = null)&lt;br/&gt;
    {&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="12571">DDC-1120</key>
            <summary>AbstractQuery::useResultCache no return type in phpdoc</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="morfi">Andrey Kolyshkin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Apr 2011 04:33:24 +0000</created>
                <updated>Sun, 1 May 2011 06:17:33 +0000</updated>
                    <resolved>Sun, 1 May 2011 06:17:33 +0000</resolved>
                            <version>2.0.4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15795" author="beberlei" created="Sun, 1 May 2011 06:17:33 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1043] Unit of Work - computeChangeSet </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1043</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the unit of work in the compute Change Set function. When comparing the old and the new value of a field. In the case  &apos;Entity is &quot;fully&quot; MANAGED&apos;. And the values are strings it is used &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$orgValue != $actualValue
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;comparison operator instead of &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$orgValue !== $actualValue
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; Which lead to not detecting some changes. I know it is not something major, but it is really annoying. So please fix it for the next release.&lt;/p&gt;

&lt;p&gt;Thanks in advance. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12423">DDC-1043</key>
            <summary>Unit of Work - computeChangeSet </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="vigor_bg">victor Velkov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Feb 2011 06:51:35 +0000</created>
                <updated>Sun, 1 May 2011 04:22:51 +0000</updated>
                    <resolved>Sun, 1 May 2011 04:22:51 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15374" author="beberlei" created="Fri, 25 Feb 2011 18:08:33 +0000"  >&lt;p&gt;Can you give an example? The ones with null are already catched with the second part, so i cannot think of others.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;($orgValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; ^ $actualValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15379" author="vigor_bg" created="Sat, 26 Feb 2011 04:32:25 +0000"  >&lt;p&gt;well in my case I want to save a field with country code with lets say something like &apos;+44&apos;. But then  i want to change it to just &apos;44&apos; it doesn&apos;t catch the difference and the column in the DB is varchar and in the entity it is set as string so it must use the strict comparison operator. &lt;/p&gt;</comment>
                    <comment id="15380" author="beberlei" created="Sat, 26 Feb 2011 04:59:47 +0000"  >&lt;p&gt;What the fuck, i didn&apos;t know PHP had THIS strange conversion rules. The problem with using === is that for integer columns for example &quot;44&quot; vs 44 would determine a change and I cannot check for &quot;string&quot; column yes no at that point because this bit of code is very important for performance of UnitOfWork::commit().&lt;/p&gt;

&lt;p&gt;Can we come up with a universal condition that detects this string change and keeps the comparison of all others equal?&lt;/p&gt;</comment>
                    <comment id="15400" author="vigor_bg" created="Sun, 27 Feb 2011 03:21:30 +0000"  >&lt;p&gt;To be honest I didn&apos;t know about the int problem I will think on it if I can find a solution I will tell you straight away.&lt;/p&gt;</comment>
                    <comment id="15431" author="vigor_bg" created="Wed, 2 Mar 2011 05:22:30 +0000"  >&lt;p&gt;Well the best that i could come up with is&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;((is_string($orgValue) &amp;amp;&amp;amp; $orgValue !== $actualValue)
                			|| ($orgValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; ^ $actualValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)) {
					$changeSet[$propName] = array($orgValue, $actualValue);
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ((!is_string($orgValue) &amp;amp;&amp;amp; $orgValue != $actualValue)
                			|| ($orgValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; ^ $actualValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)) {
                    $changeSet[$propName] = array($orgValue, $actualValue);
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Logically depending on the type of the old value to decide which operator to use as the old value was type cast by the DBAL Type class so we can depend on it. &lt;/p&gt;</comment>
                    <comment id="15678" author="beberlei" created="Mon, 4 Apr 2011 15:31:16 +0000"  >&lt;p&gt;Maybe we really have to change this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index 682e906..8f68c3e 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -467,9 +467,7 @@ class UnitOfWork &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; PropertyChangedListener
                     }
                 } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($isChangeTrackingNotify) {
                     &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
-                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_object($orgValue) &amp;amp;&amp;amp; $orgValue !== $actualValue) {
-                    $changeSet[$propName] = array($orgValue, $actualValue);
-                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orgValue != $actualValue || ($orgValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; ^ $actualValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)) {
+                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orgValue !== $actualValue) {
                     $changeSet[$propName] = array($orgValue, $actualValue);
                 }
             }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rather have more changes, which would be the developers need to take care of then ignoring these tricky casting issues.&lt;/p&gt;</comment>
                    <comment id="15786" author="beberlei" created="Sun, 1 May 2011 04:22:51 +0000"  >&lt;p&gt;Fixed, but only merged into 2.1 / master so people can test this more.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1094] Add Order and Limit to EntityRepository::findBy()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1094</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently repositories are pretty much useless because you cannot limit/offset or order by columns, which is what repositories are for to implement simple list views. That is why the signatures should be extended to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;findAll(array $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $maxResults = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $firstResult = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
findOne(array $criteria, array $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $maxResults = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $firstResult = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12521">DDC-1094</key>
            <summary>Add Order and Limit to EntityRepository::findBy()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 31 Mar 2011 17:36:43 +0000</created>
                <updated>Sun, 1 May 2011 03:54:23 +0000</updated>
                    <resolved>Sun, 1 May 2011 03:54:23 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15781" author="beberlei" created="Sun, 1 May 2011 03:54:23 +0000"  >&lt;p&gt;Implemented, just for findBy() though as findAll() is just a proxy to that in most cases.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1133] DuckType AnnotationReader in AnnotationDriver</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1133</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the hint is strict in AnnotationDriver for the AnnotationReader. This should be duck-typed to support usage of &lt;a href=&quot;https://github.com/schmittjoh/annotations&quot; class=&quot;external-link&quot;&gt;https://github.com/schmittjoh/annotations&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12597">DDC-1133</key>
            <summary>DuckType AnnotationReader in AnnotationDriver</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 30 Apr 2011 08:23:22 +0000</created>
                <updated>Sat, 30 Apr 2011 08:24:53 +0000</updated>
                    <resolved>Sat, 30 Apr 2011 08:24:53 +0000</resolved>
                                            <fixVersion>2.0.5</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15766" author="beberlei" created="Sat, 30 Apr 2011 08:24:53 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1126] SchemaTool fails to dropSchema under SQLite due to ForeignKeyContraints checks</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1126</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When attempting to $schemaTool-&amp;gt;dropSchema($metadatas) using SQLite, it fails because it attempts to fetch for foreign key constraints.&lt;br/&gt;
Here is the exception:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;PHP Fatal error:  Uncaught exception &apos;Doctrine\DBAL\DBALException&apos; with message &apos;Operation &apos;Doctrine\DBAL\Platforms\AbstractPlatform::getListTableForeignKeysSQL&apos; is not supported by platform.&apos; in /Users/gblanco/Sites/mkx2/core/library/vendors/Doctrine/DBAL/DBALException.php:9
Stack trace:
#0 /Users/gblanco/Sites/mkx2/core/library/vendors/Doctrine/DBAL/Platforms/AbstractPlatform.php(1839): Doctrine\DBAL\DBALException::notSupported(&apos;Doctrine\DBAL\P...&apos;)
#1 /Users/gblanco/Sites/mkx2/core/library/vendors/Doctrine/DBAL/Schema/AbstractSchemaManager.php(261): Doctrine\DBAL\Platforms\AbstractPlatform-&amp;gt;getListTableForeignKeysSQL(&apos;ProductEntity_P...&apos;, NULL)
#2 /Users/gblanco/Sites/mkx2/core/library/vendors/Doctrine/ORM/Tools/SchemaTool.php(639): Doctrine\DBAL\Schema\AbstractSchemaManager-&amp;gt;listTableForeignKeys(&apos;ProductEntity_P...&apos;)
#3 /Users/gblanco/Sites/mkx2/core/library/vendors/Doctrine/ORM/Tools/SchemaTool.php(551): Doctrine\ORM\Tools\SchemaTool-&amp;gt;getDropSchemaSQL(Array)
#4 /Users/gblanco/Sites/mkx2/core/tests/Tests/Database/AllTests. in /Users/gblanco/Sites/mkx2/core/library/vendors/Doctrine/DBAL/DBALException.php on line 9
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12581">DDC-1126</key>
            <summary>SchemaTool fails to dropSchema under SQLite due to ForeignKeyContraints checks</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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Apr 2011 11:27:53 +0000</created>
                <updated>Tue, 26 Apr 2011 11:34:02 +0000</updated>
                    <resolved>Tue, 26 Apr 2011 11:34:02 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15745" author="guilhermeblanco" created="Tue, 26 Apr 2011 11:34:02 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/fe66d8bc04de42ab13b83892df11a5ea1533b544&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/fe66d8bc04de42ab13b83892df11a5ea1533b544&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1125] Allow return data of Closure on EntityManager::transactional</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1125</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently it is impossible to use transactional if you want to return an item from there.&lt;/p&gt;

&lt;p&gt;This improvement would allow more flexible behavior from transactional.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12578">DDC-1125</key>
            <summary>Allow return data of Closure on EntityManager::transactional</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Apr 2011 17:28:02 +0000</created>
                <updated>Mon, 25 Apr 2011 17:33:42 +0000</updated>
                    <resolved>Mon, 25 Apr 2011 17:33:42 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15744" author="guilhermeblanco" created="Mon, 25 Apr 2011 17:33:42 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/26bd3e381195ba0901c506e8257e0eb6e5d5c931&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/26bd3e381195ba0901c506e8257e0eb6e5d5c931&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1012] Add isNull($param) and isNotNull($param) to querybuilder</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1012</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Add isNull($param) and isNotNull($param) to querybuilder&lt;/p&gt;</description>
                <environment></environment>
            <key id="12346">DDC-1012</key>
            <summary>Add isNull($param) and isNotNull($param) to querybuilder</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 08:29:53 +0000</created>
                <updated>Fri, 22 Apr 2011 02:44:11 +0000</updated>
                    <resolved>Sun, 20 Feb 2011 03:01:49 +0000</resolved>
                            <version>2.0</version>
                <version>2.0.1</version>
                <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15348" author="guilhermeblanco" created="Sat, 19 Feb 2011 23:55:16 +0000"  >&lt;p&gt;Added to trunk. =)&lt;/p&gt;</comment>
                    <comment id="15742" author="marijn" created="Fri, 22 Apr 2011 02:44:11 +0000"  >&lt;p&gt;I&apos;m sorry but this is not working for me on 2.0.3. I&apos;ve been looking at the source code to find a reference of it but it seems to be removed altogether?!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1110] CTI Entities always trigger -&gt;find even when I&apos;m calling -&gt;getReference</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1110</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Suppose we have some CTI mapped 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;Group &amp;lt;- Company
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Without having a given Entity on UnitOfWork IdentityMap, if I do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$groupProxy = $em-&amp;gt;getReference(&apos;Group&apos;, 1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It will trigger the -&amp;gt;find (accessing the DB). This is correct on this situation, because the Entity can be either Group or Company. But if I do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$companyProxy = $em-&amp;gt;getReference(&apos;Company&apos;, 1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There&apos;re no sub-classes anymore (Doctrine doesn&apos;t know it, but there are other ways to know), so it should correctly return an instance of CompanyProxy instead of trigger the -&amp;gt;find method.&lt;/p&gt;

&lt;p&gt;The solution requires to build the hierarchy of Entities using their ClassMetadata. So it is require to loop though all mapped classes on DiscriminatorMap and check if there&apos;s 1 class that subclass the given Entity. If positive, return the result of -&amp;gt;find; otherwise a Proxy can be returned.&lt;br/&gt;
This is a non-optimal solution (a better solution would be to cache the hierarchy together with ClassMetadata), but it fixes the issue.&lt;/p&gt;

&lt;p&gt;Issue could be considered as major since most CTI scenarios trigger unwanted DB queries, but its usage is so restrict that I left as minor.&lt;br/&gt;
We should fix that for 2.1 IMHO.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12554">DDC-1110</key>
            <summary>CTI Entities always trigger -&gt;find even when I&apos;m calling -&gt;getReference</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="7">Can&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Apr 2011 12:47:16 +0000</created>
                <updated>Tue, 12 Apr 2011 05:19:01 +0000</updated>
                    <resolved>Tue, 12 Apr 2011 05:19:01 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15723" author="beberlei" created="Tue, 12 Apr 2011 05:18:43 +0000"  >&lt;p&gt;Actually doctrine knows it, see the check for $metadata-&amp;gt;subClasses, which is always on the grabbed entity. So the behavior is alraedy correct, no way to optimize it.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$companyProxy = $em-&amp;gt;getReference(&apos;Company&apos;, 1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Does:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$cm = $em-&amp;gt;getMetadataFor(&lt;span class=&quot;code-quote&quot;&gt;&quot;Company&quot;&lt;/span&gt;);
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($cm-&amp;gt;subClasses) &lt;span class=&quot;code-comment&quot;&gt;// 0 &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; Company&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-991] Add method &quot;getFirstResult()&quot; that returns null on no result</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-991</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There are some requests for a method on Query that return a first result or null.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12309">DDC-991</key>
            <summary>Add method &quot;getFirstResult()&quot; that returns null on no result</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12239">DDC-942</parent>
                        <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, 18 Jan 2011 15:31:02 +0000</created>
                <updated>Thu, 31 Mar 2011 17:42:31 +0000</updated>
                    <resolved>Thu, 31 Mar 2011 17:42:31 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15646" author="beberlei" created="Thu, 31 Mar 2011 17:42:31 +0000"  >&lt;p&gt;Implemented as &quot;getOneOrNullResult&quot;. This way it clearly stands out against getSingleResult() and you cannot mess them up&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-692] Read-only entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-692</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It should be possible to mark an entity class as read-only so that it is never considered for change-tracking after it has been initially inserted into the database.&lt;/p&gt;

&lt;p&gt;This feature is mainly a flush performance tweak to avoid checking objects for changes which can never actually change.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11629">DDC-692</key>
            <summary>Read-only entities</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10612">DDC-209</parent>
                        <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Jul 2010 10:19:50 +0000</created>
                <updated>Tue, 29 Mar 2011 14:18:15 +0000</updated>
                    <resolved>Tue, 29 Mar 2011 14:18:15 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14358" author="shurakai" created="Mon, 13 Sep 2010 07:37:37 +0000"  >&lt;p&gt;Roman, could you point out how exactly you expect this to work?&lt;/p&gt;

&lt;p&gt;I mean, when you create a new entity and persist it, you surely need to track updates to the entity-to-be-persisted.&lt;/p&gt;

&lt;p&gt;Additionally, what about entities that are expected to be updated only in one place, like a service. Should there be a possibility to enforce updating?&lt;/p&gt;</comment>
                    <comment id="14365" author="mjh_ca" created="Mon, 13 Sep 2010 15:16:56 +0000"  >&lt;p&gt;For us, I see a use case for summary tables (i.e. Post and PostViews &amp;#8211; a roll up of log data into computed &quot;most popular&quot;, &quot;most commented&quot;, views per day/week/month, etc).  The data is generated outside of Doctrine (i.e. directly via DBAL, or stored procedures) but we still want to define the relationships of other entities to this data so we can access it on a read-only basis in DQL and the object graph.  We would flag these as read-only as there is no need for change-tracking. 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 Post {
    /** @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;PostViews&quot;&lt;/span&gt; ...) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $views;
}
/** @Entity @ReadOnly */
class PostViews { /* summary table computed via stored procedure */

   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() { &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Exception(&apos;Entity is read only&apos;); }

    /** @Column */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $period; &lt;span class=&quot;code-comment&quot;&gt;// day, week, month, year, etc.
&lt;/span&gt;
   /** @Column */
   &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $viewCount;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Regarding Roman&apos;s description of persist-only and then no updates, isn&apos;t this more like @PersistOnly rather than @ReadOnly?  Or you could generalize this further with a tag like @AllowedActions={&quot;persist&quot;, &quot;update&quot;, &quot;delete&quot;} ?&lt;/p&gt;

&lt;div class=&quot;code panel&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 @PersistOnly */
class A {
    /** @Column */
   &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $foo;
   
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($foo) {
     $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;foo = $foo;
  }

  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getFoo() {
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;foo;
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is this what you have in mind Roman?&lt;/p&gt;</comment>
                    <comment id="15627" author="beberlei" created="Tue, 29 Mar 2011 14:18:15 +0000"  >&lt;p&gt;Implemented.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-696] Add onClear Event</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-696</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There should be an event &quot;onClear&quot; that is called whenever someone calls &quot;EntityManager::clear()&quot;.&lt;/p&gt;

&lt;p&gt;This may be necessary in certain long-running script scenarios when you have additional identity maps / caching, for example based on unique fields of an entity.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11641">DDC-696</key>
            <summary>Add onClear Event</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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, 19 Jul 2010 06:09:25 +0000</created>
                <updated>Tue, 29 Mar 2011 13:44:25 +0000</updated>
                    <resolved>Tue, 29 Mar 2011 13:44:25 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13816" author="romanb" created="Sat, 7 Aug 2010 06:54:57 +0000"  >&lt;p&gt;Sounds like a new feature that is not urgent. Can we move that post 2.0?&lt;/p&gt;</comment>
                    <comment id="13844" author="romanb" created="Sun, 8 Aug 2010 07:07:39 +0000"  >&lt;p&gt;Moving to 2.1.&lt;/p&gt;</comment>
                    <comment id="15578" author="mridgway" created="Thu, 24 Mar 2011 16:06:05 +0000"  >&lt;p&gt;I posted a patch for this to Github at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/40&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/40&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(I&apos;m just making sure that this is logged to JIRA)&lt;/p&gt;</comment>
                    <comment id="15626" author="beberlei" created="Tue, 29 Mar 2011 13:44:25 +0000"  >&lt;p&gt;Merged mridgways branch, thank you!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1014] Evaluate common date related functions for DQL inclusion</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1014</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;To check:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Difference in days between two dates&lt;/li&gt;
	&lt;li&gt;Add/subtract an interval to a date&lt;/li&gt;
	&lt;li&gt;Format a date&lt;/li&gt;
	&lt;li&gt;Return only Year, Month or Day, Day of Week, Week of Year of the date&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="12350">DDC-1014</key>
            <summary>Evaluate common date related functions for DQL inclusion</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 18:08:02 +0000</created>
                <updated>Sun, 27 Mar 2011 06:20:03 +0000</updated>
                    <resolved>Sun, 27 Mar 2011 06:20:03 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15591" author="beberlei" created="Sun, 27 Mar 2011 04:25:24 +0000"  >&lt;p&gt;MySQL: &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DATEDIFF, DATE_ADD, DATE_SUB, DATE_FORMAT, YEAR, MONTH, DAY, WEEK, DATE&lt;/p&gt;

&lt;p&gt;Postgres: &lt;a href=&quot;http://developer.postgresql.org/pgdocs/postgres/functions-datetime.html&quot; class=&quot;external-link&quot;&gt;http://developer.postgresql.org/pgdocs/postgres/functions-datetime.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DATEDIFF, DATE_ADD/SUB (Operator), Kein Format?, YEAR, MONTH, DAY, WEEK&lt;/p&gt;

&lt;p&gt;Sqlite: &lt;a href=&quot;http://www.sqlite.org/lang_datefunc.html&quot; class=&quot;external-link&quot;&gt;http://www.sqlite.org/lang_datefunc.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Operators, date(), format, YEAR, MONTH, DAY, WEEK,DATE&lt;/p&gt;

&lt;p&gt;Oracle: &lt;a href=&quot;http://www.oracle-dba-online.com/sql/date_operators_functions.htm&quot; class=&quot;external-link&quot;&gt;http://www.oracle-dba-online.com/sql/date_operators_functions.htm&lt;/a&gt; &lt;a href=&quot;http://www.akadia.com/services/ora_date_time.html&quot; class=&quot;external-link&quot;&gt;http://www.akadia.com/services/ora_date_time.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Operators, TO_CHAR()/EXTRACT()&lt;/p&gt;

&lt;p&gt;MSSQL: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa258863%28v=sql.80%29.aspx&quot; class=&quot;external-link&quot;&gt;http://msdn.microsoft.com/en-us/library/aa258863%28v=sql.80%29.aspx&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15592" author="beberlei" created="Sun, 27 Mar 2011 06:20:03 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-943] EntityRepository::findBy should support multiple values on criteria fetching</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-943</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently it is impossible to execute a multiple value findBy on EntityRepository.&lt;/p&gt;

&lt;p&gt;So supposing we have a Foo entity, we can do this:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$foos = $em-&amp;gt;getRepository(&apos;Foo&apos;)-&amp;gt;findByName(&apos;value&apos;);&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;But it is impossible to do:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$foos = $em-&amp;gt;getRepository(&apos;Foo&apos;)-&amp;gt;findByName(array(&apos;value1&apos;, &apos;value2&apos;));&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;We have most of the support done inside BasicEntityPersister, but the _getSelectConditionSQL restricts to a single value by doing:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$conditionSql .= &apos; = ?&apos;;&lt;/tt&gt; at line 1150&lt;/p&gt;

&lt;p&gt;We can extend the support easily by detecting array value and adding an IN (...) condition on this case.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12240">DDC-943</key>
            <summary>EntityRepository::findBy should support multiple values on criteria fetching</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Dec 2010 09:23:55 +0000</created>
                <updated>Wed, 16 Mar 2011 18:40:57 +0000</updated>
                    <resolved>Wed, 16 Mar 2011 18:40:57 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14985" author="beberlei" created="Mon, 20 Dec 2010 10:18:14 +0000"  >&lt;p&gt;This is not going into 2.0 anymore&lt;/p&gt;</comment>
                    <comment id="15008" author="beberlei" created="Fri, 24 Dec 2010 05:04:50 +0000"  >&lt;p&gt;Schedule for 2.1, there are some gotachs here though.&lt;/p&gt;</comment>
                    <comment id="15508" author="beberlei" created="Wed, 16 Mar 2011 18:40:57 +0000"  >&lt;p&gt;Implemented as part of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-952&quot; title=&quot;Several features to batch eager selects more efficently&quot;&gt;DDC-952&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-734] Possibility to fetch all outstanding proxies of an Entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-734</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For performance reasons (solving the N+1 problem) it might be necessary to load all proxy instances of a given type:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$orders = $em-&amp;gt;getRepository(&apos;Order&apos;)-&amp;gt;findAll();
foreach ($orders AS $order) {
   $order-&amp;gt;getCustomer()-&amp;gt;getId(); &lt;span class=&quot;code-comment&quot;&gt;// n+1
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However say we could do something like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$orders = $em-&amp;gt;getRepository(&apos;Order&apos;)-&amp;gt;findAll();
$em-&amp;gt;getUnitOfWork()-&amp;gt;loadProxies(&lt;span class=&quot;code-quote&quot;&gt;&quot;Customer&quot;&lt;/span&gt;);

foreach ($orders AS $order) {
   $order-&amp;gt;getCustomer()-&amp;gt;getId(); &lt;span class=&quot;code-comment&quot;&gt;// n+1
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This doesnt make too much sense in this case because we could use a fetch join with DQL. However you easily get to the point where you have a query like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT b, e, r, p FROM Bug b JOIN b.engineer e 
JOIN b.reporter r JOIN b.products p ORDER BY b.created DESC
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this case the SQL generated is VERY huge and just the number of joins could cause an performance overhead. In general its better to keep the number of joins as small as possible, a solution here would optimize for the engineer and reporter being both instances of User:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$bugs = $em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT b, p FROM Bug b JOIN b.products p ORDER BY b.created DESC&quot;&lt;/span&gt;)-&amp;gt;getResult();
$em-&amp;gt;getUnitOfWork()-&amp;gt;loadProxies(&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;); &lt;span class=&quot;code-comment&quot;&gt;// will load all engineers and reporters in one query&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We could even make this nicer for using Queries:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$bugs = $em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT b, p FROM Bug b JOIN b.products p ORDER BY b.created DESC&quot;&lt;/span&gt;)
                        -&amp;gt;setQueryHint(Query::LOAD_PROXIES, array(&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;))
                        -&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11736">DDC-734</key>
            <summary>Possibility to fetch all outstanding proxies of an Entity</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12257">DDC-952</parent>
                        <priority id="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, 7 Aug 2010 07:23:52 +0000</created>
                <updated>Wed, 16 Mar 2011 18:36:47 +0000</updated>
                    <resolved>Wed, 16 Mar 2011 18:36:47 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15507" author="beberlei" created="Wed, 16 Mar 2011 18:36:47 +0000"  >&lt;p&gt;Implemented, but in another semantical way. Batching of eager loads of FETCH=EAGER associations aswell as AbstactQuery::setFetchMode($className, $assocName, $fetchMode) function to set this case-by-case for DQL.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-865] Passing an array as parameter</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-865</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;First check the entites in attachments (I&apos;ve deleted everything unnecessary for this example).&lt;/p&gt;

&lt;p&gt;What I want to do is find multiple entities (I have their ids in array) and then do some action with each of them.&lt;/p&gt;

&lt;p&gt;I&apos;m trying to find those entites using IN operator in DQL query, but there is no way (or I was unable find it) to pass the array of ids as parameter to the query. I&apos;ve tried several ways to do it (check the PictureRepository attachment) but none is working as i want. Further details are described in comments.&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;br/&gt;
//I know i could use something like this but I wonder about the IN stetement right now. The example above is just for show.&lt;br/&gt;
foreach ($pictures as $value) {&lt;br/&gt;
    $entity = $repository-&amp;gt;find($value);&lt;br/&gt;
    /&lt;b&gt;...whatever i want to do with the $entity&lt;/b&gt;/&lt;br/&gt;
}&lt;br/&gt;
?&amp;gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12076">DDC-865</key>
            <summary>Passing an array as parameter</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12257">DDC-952</parent>
                        <priority id="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="enumag">J&#225;chym Tou&#353;ek</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Nov 2010 08:33:53 +0000</created>
                <updated>Wed, 16 Mar 2011 18:35:26 +0000</updated>
                    <resolved>Wed, 16 Mar 2011 18:35:26 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15491" author="beberlei" created="Sun, 13 Mar 2011 07:35:20 +0000"  >&lt;p&gt;This will be implemented as part of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-952&quot; title=&quot;Several features to batch eager selects more efficently&quot;&gt;DDC-952&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15506" author="beberlei" created="Wed, 16 Mar 2011 18:35:26 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10849" name="AlbumEntity.php" size="421" author="enumag" created="Sun, 7 Nov 2010 08:33:53 +0000" />
                    <attachment id="10851" name="IdEntity.php" size="331" author="enumag" created="Sun, 7 Nov 2010 08:35:17 +0000" />
                    <attachment id="10850" name="PictureEntity.php" size="676" author="enumag" created="Sun, 7 Nov 2010 08:33:53 +0000" />
                    <attachment id="10848" name="PictureRepository.php" size="3596" author="enumag" created="Sun, 7 Nov 2010 08:33:53 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-53] Introduce batching of eager loads</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-53</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;During hydration when an association is encountered that is configured EAGER this entity is directly loaded through a separate SQL statement. This is inefficient for single-valued associations as it leads to the n+1 queries problem. This should be improved by somehow collecting all entities that need to be eagerly fetched and loading them in a single statement or in batches.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10197">DDC-53</key>
            <summary>Introduce batching of eager loads</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12257">DDC-952</parent>
                        <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Oct 2009 18:32:41 +0000</created>
                <updated>Wed, 16 Mar 2011 18:35:03 +0000</updated>
                    <resolved>Wed, 16 Mar 2011 18:35:03 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10369" author="romanb" created="Sat, 31 Oct 2009 09:13:22 +0000"  >&lt;p&gt;Update: This affects inverse sides of a one-one association since these can never be lazy as well as one-one owning sides that are configured EAGER.&lt;/p&gt;

&lt;p&gt;Probably batching of collection loads is also somehow possible but all this needs quite some design and planning before implementation.&lt;/p&gt;</comment>
                    <comment id="14081" author="romanb" created="Thu, 26 Aug 2010 08:02:37 +0000"  >&lt;p&gt;Rescheduled.&lt;/p&gt;</comment>
                    <comment id="15466" author="beberlei" created="Sun, 6 Mar 2011 05:26:04 +0000"  >&lt;p&gt;I implemented batching of eager loads for Many-To-One and Owning One-To-One associations so far as part of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-952&quot; title=&quot;Several features to batch eager selects more efficently&quot;&gt;DDC-952&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="15505" author="beberlei" created="Wed, 16 Mar 2011 18:35:03 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-914] Use JOIN for Fetch=EAGER ManyToOne and OneToOne in Persisters</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-914</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently Fetch=EAGER Only leads to proxies not being used, no optimizations are being done.&lt;/p&gt;

&lt;p&gt;Optimizations could maybe be done easily for the cases:&lt;/p&gt;

&lt;p&gt;1. Basic Entity Persister + ManyToOne&lt;br/&gt;
2. Basic Entity Persister + OneToOne + Owning side&lt;br/&gt;
3. Basic Entity Persister + OneToOne + Inverse side&lt;/p&gt;

&lt;p&gt;Complicated cases would be:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Everything Single and JoinTableInheritance?&lt;/li&gt;
	&lt;li&gt;OneToMany and ManyToMany collections.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="12249">DDC-914</key>
            <summary>Use JOIN for Fetch=EAGER ManyToOne and OneToOne in Persisters</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12257">DDC-952</parent>
                        <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Dec 2010 05:22:39 +0000</created>
                <updated>Wed, 16 Mar 2011 18:34:43 +0000</updated>
                    <resolved>Wed, 16 Mar 2011 18:34:43 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15504" author="beberlei" created="Wed, 16 Mar 2011 18:34:43 +0000"  >&lt;p&gt;Merged&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

<item>
            <title>[DDC-1060] Use Hydrators inside Persisters</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1060</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The hydration code should be moved out of the persisters and re-using the Hydrators.&lt;/p&gt;

&lt;p&gt;Reasons:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;No duplication of hydration code necessary anymore.&lt;/li&gt;
	&lt;li&gt;More complex hydration (eager loads) possible inside persister&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Implementation:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Either use a SimpleObjectHydrator or reuse the ObjectHydrator (benchmark)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Check for performance first.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12453">DDC-1060</key>
            <summary>Use Hydrators inside Persisters</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12257">DDC-952</parent>
                        <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 Mar 2011 09:14:08 +0000</created>
                <updated>Wed, 16 Mar 2011 18:34:11 +0000</updated>
                    <resolved>Wed, 16 Mar 2011 18:34:11 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15467" author="beberlei" created="Sun, 6 Mar 2011 16:23:35 +0000"  >&lt;p&gt;A first milestone of this is done: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/851f44a066ffbe7849c1402d5e192be9bbd4383e&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/851f44a066ffbe7849c1402d5e192be9bbd4383e&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15502" author="beberlei" created="Wed, 16 Mar 2011 18:34:11 +0000"  >&lt;p&gt;Merged &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-701] Code generation for DQL queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-701</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be cool to have the possibility to define DQL queries in the mapping documents and let these be precompiled to SQL via a command-line code-generation target that produces for each DQL query the SQL and ResultSetMapping in native PHP code.&lt;/p&gt;

&lt;p&gt;This allows people to work without a query cache and maximum performance, on the cost of another code-generation step.&lt;/p&gt;

&lt;p&gt;There are already named queries currently but these must be defined in the Configuration at runtime and thus it does not bear any advantages.&lt;br/&gt;
I would propose removing this runtime named query facility and replacing it with a &quot;compile-time&quot; one. So that &quot;named queries&quot; are queries defined in the mapping, given a name, which can &lt;b&gt;optionally&lt;/b&gt; be precompiled via the CLI. If not precompiled a named query should be handled like a normal query.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11652">DDC-701</key>
            <summary>Code generation for DQL queries</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Jul 2010 06:09:50 +0000</created>
                <updated>Mon, 14 Mar 2011 00:09:34 +0000</updated>
                    <resolved>Wed, 9 Mar 2011 13:22:13 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13623" author="beberlei" created="Tue, 20 Jul 2010 08:50:12 +0000"  >&lt;p&gt;I would keep the runtime named queries though. Its a very useful feature.&lt;/p&gt;</comment>
                    <comment id="13624" author="guilhermeblanco" created="Tue, 20 Jul 2010 10:47:14 +0000"  >&lt;p&gt;The current implementation of named queries is not good.&lt;/p&gt;

&lt;p&gt;I have recognized it previously and I was imagining a way to cast named queries related exclusively to direct EntityRepository.&lt;br/&gt;
Example:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q = $em-&amp;gt;getRepository(&apos;User&apos;)-&amp;gt;getNamedQuery(&apos;findAll&apos;);
$users = $q-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One of the ideas is to have a method called &quot;initialize()&apos; or something similar that would grab all Annotations from Metadata Mapping and automatically add them to the named query.&lt;/p&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 * @NamedQueries({
 *     @NamedQuery(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;findAll&apos;, query=&quot;&lt;/span&gt;SELECT u FROM User u&quot;, hints=[...])
 * })
 * @NamedNativeQueries({
 *     @NamedNativeQuery(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;...&quot;&lt;/span&gt;, query=&lt;span class=&quot;code-quote&quot;&gt;&quot;...&quot;&lt;/span&gt;, rsm=@ResultSetMapping(...))
 * })
 */
class User {
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hibernate has a similar feature. So we have a reference to look at. =)&lt;/p&gt;</comment>
                    <comment id="13819" author="romanb" created="Sat, 7 Aug 2010 07:05:04 +0000"  >&lt;p&gt;Scheduled for 2.1 for now.&lt;/p&gt;</comment>
                    <comment id="15479" author="guilhermeblanco" created="Wed, 9 Mar 2011 13:22:13 +0000"  >&lt;p&gt;This feature is not implemented and merged into ORM trunk. =)&lt;/p&gt;</comment>
                    <comment id="15483" author="beberlei" created="Thu, 10 Mar 2011 03:00:47 +0000"  >&lt;p&gt;There is still one feature missing here guilherme, the actual code generation. We need a task that dumps all named DQL into a SQL + RSM (what the cache is fed) into a single large file and grabs that file from an optional configuration (feature is optional).&lt;/p&gt;

&lt;p&gt;What we need for this is implementation of __set_state() on RSM to use it with var_export(). We could also extend the DQL Run command to &quot;compile&quot; a single query with --compile or something then too.&lt;/p&gt;

&lt;p&gt;Plus the change in $serialized is not made aswell.&lt;/p&gt;</comment>
                    <comment id="15492" author="guilhermeblanco" created="Mon, 14 Mar 2011 00:09:34 +0000"  >&lt;p&gt;@beberlei&lt;/p&gt;

&lt;p&gt;I don&apos;t think it is really necessary.&lt;br/&gt;
The main reason is because we already have a caching strategy here. If we keep the DQL, when developer uses it, it would automatically check for cache of SQL that was generated from first execution.&lt;/p&gt;

&lt;p&gt;If the user attach a QueryCache to Configuration. We have nothing to do here.&lt;/p&gt;

&lt;p&gt;As of compilation... we can do this, but is it a vital feature of this enhancement? I wouldn&apos;t consider it. It is good to have, but does the complexity of having it brings so many benefits?&lt;/p&gt;

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

<item>
            <title>[DDC-1034] Registered lifecycle callbacks of derived classes have unexpected call sequence</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1034</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Situation:&lt;br/&gt;
Create an abstract base class (@InheritanceType(&quot;JOINED&quot;)) and a derived class, both having the annotation @HasLifecycleCallbacks and both having a method  with annotation @PostLoad (different method names). The sequence of methods being called when an object is loaded from the database is not as expected.&lt;/p&gt;

&lt;p&gt;Expected output:&lt;br/&gt;
Called Che\Tmp\BaseClass::PostLoadBase&lt;br/&gt;
Called Che\Tmp\DerivedClass::PostLoadDerived&lt;br/&gt;
(base value, derived value)&lt;/p&gt;

&lt;p&gt;Actual output:&lt;br/&gt;
Called Che\Tmp\BaseClass::PostLoadBase&lt;br/&gt;
Called Che\Tmp\DerivedClass::PostLoadDerived&lt;br/&gt;
Called Che\Tmp\BaseClass::PostLoadBase&lt;br/&gt;
(base value)&lt;/p&gt;

&lt;p&gt;Test code:&lt;br/&gt;
See attachment for classes&lt;/p&gt;

&lt;p&gt;// Assume there is an entity manager $em&lt;br/&gt;
// Create object&lt;br/&gt;
$newDerived = new \Che\Tmp\DerivedClass();&lt;br/&gt;
$em-&amp;gt;persist($newDerived);&lt;/p&gt;

&lt;p&gt;// Fetch object&lt;br/&gt;
$derived = $em-&amp;gt;findById(&apos;\Che\Tmp\DerivedClass&apos;, 1);&lt;br/&gt;
$derived-&amp;gt;echoList();&lt;/p&gt;

&lt;p&gt;Possible problem cause&lt;/p&gt;

&lt;p&gt;ClassMetadataInfo::addLifecycleCallback($callback, $event) method has a note &apos;If the same callback is registered more than once, the old one will be overridden&apos;. We are not sure whether this is the case.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12388">DDC-1034</key>
            <summary>Registered lifecycle callbacks of derived classes have unexpected call sequence</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="bart">Bart</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Feb 2011 05:16:50 +0000</created>
                <updated>Fri, 4 Mar 2011 17:04:55 +0000</updated>
                    <resolved>Fri, 4 Mar 2011 17:04:55 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15453" author="beberlei" created="Fri, 4 Mar 2011 17:04:55 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10940" name="TestClasses.php" size="1035" author="bart" created="Tue, 15 Feb 2011 05:16:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1056] Using the StaticPHPDriver throws PHP Error Undefined property: Doctrine\ORM\Mapping\Driver\StaticPHPDriver::$_classNames</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1056</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using the StaticPHPDriver throws PHP Error Undefined property: Doctrine\ORM\Mapping\Driver\StaticPHPDriver::$_classNames&lt;/p&gt;

&lt;p&gt;this is due to the class not having the two required instance variables $this-&amp;gt;_classNames and $this-&amp;gt;_fileExtension.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12444">DDC-1056</key>
            <summary>Using the StaticPHPDriver throws PHP Error Undefined property: Doctrine\ORM\Mapping\Driver\StaticPHPDriver::$_classNames</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ratius">Steven Rosato</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Mar 2011 21:24:16 +0000</created>
                <updated>Fri, 4 Mar 2011 16:23:55 +0000</updated>
                    <resolved>Fri, 4 Mar 2011 16:23:55 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15440" author="ratius" created="Thu, 3 Mar 2011 21:27:56 +0000"  >&lt;p&gt;I have attached the patch that resolves the issue.&lt;/p&gt;</comment>
                    <comment id="15441" author="ratius" created="Thu, 3 Mar 2011 21:48:51 +0000"  >&lt;p&gt;I applied the patch and added a pull request. &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/34&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/34&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15451" author="beberlei" created="Fri, 4 Mar 2011 16:23:55 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10949" name="0001-DDC-1056-PHPStaticDriver-was-missing-two-instance-va.patch" size="1219" author="ratius" created="Thu, 3 Mar 2011 21:27:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;That&apos;s because the entityRepository (and all the other doctrine class) call the UnitOfWork tryGetById with the rootEntityName, which in my case is AbstractClass.&lt;br/&gt;
See the first line of the entityRepository&apos;s find method :&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getUnitOfWork()-&amp;gt;tryGetById($id, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;rootEntityName)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;if i change this line to :&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getUnitOfWork()-&amp;gt;tryGetById($id, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;name)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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

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

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

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

&lt;p&gt;thx for your help&lt;/p&gt;</comment>
                    <comment id="15412" author="beberlei" created="Mon, 28 Feb 2011 06:31:57 +0000"  >&lt;p&gt;Cant you just check instanceof?&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$a = $em-&amp;gt;find(&apos;ConcretClassA&apos;, $aId);
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($a &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; ConcretClassB) {
   &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Exception();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15413" author="dreddy" created="Mon, 28 Feb 2011 06:48:09 +0000"  >&lt;p&gt;Of course i can.&lt;br/&gt;
But i thought Doctrine should already have to do this check internally for us. Because we must now be very careful with the find method&apos;s returns...&lt;/p&gt;

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

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

<item>
            <title>[DDC-1036] the Aggregate Expressions &quot;AVG&quot; | &quot;MAX&quot; | &quot;MIN&quot; | &quot;SUM&quot;, should be followed by SimpleArithmeticExpression</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1036</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;the Aggregate Expressions &quot;AVG&quot; | &quot;MAX&quot; | &quot;MIN&quot; | &quot;SUM&quot;, should be not only  followed by StateFieldPathExpression , but also SimpleArithmeticExpression,&lt;br/&gt;
see &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#aggregate-expressions&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#aggregate-expressions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i found it can not execute dql like&lt;br/&gt;
select sum(c.quantity * c.price) total_price from cart c&lt;/p&gt;

&lt;p&gt;i think, this should be a bug&lt;/p&gt;</description>
                <environment></environment>
            <key id="12391">DDC-1036</key>
            <summary>the Aggregate Expressions &quot;AVG&quot; | &quot;MAX&quot; | &quot;MIN&quot; | &quot;SUM&quot;, should be followed by SimpleArithmeticExpression</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="jison">Jison Xiao</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 05:29:44 +0000</created>
                <updated>Sun, 20 Feb 2011 03:16:19 +0000</updated>
                    <resolved>Sun, 20 Feb 2011 03:16:19 +0000</resolved>
                                            <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15347" author="guilhermeblanco" created="Sat, 19 Feb 2011 23:45:23 +0000"  >&lt;p&gt;You are totally right.&lt;/p&gt;

&lt;p&gt;I fixed on trunk repository. Thanks a lot for pointing out this issue. =) &lt;/p&gt;</comment>
                    <comment id="15350" author="beberlei" created="Sun, 20 Feb 2011 03:16:19 +0000"  >&lt;p&gt;Merged into 2.0.x also&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

<item>
            <title>[DDC-953] CLI tools orm:generate-entities --regenerate-entities=1 flag will generate empty entities 50% of time.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-953</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Running the command:&lt;br/&gt;
doctrine orm:generate-entities --regenerate-entities=1 --generate-annotations=1 ./&lt;/p&gt;

&lt;p&gt;50% of the time my entity will appear as:&lt;br/&gt;
&amp;lt;?php&lt;/p&gt;

&lt;p&gt;namespace models;&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;models\Role&lt;br/&gt;
 *&lt;/li&gt;
	&lt;li&gt;@Table(name=&quot;roles&quot;)&lt;/li&gt;
	&lt;li&gt;@Entity(repositoryClass=&quot;models\repositories\RoleRepository&quot;)&lt;br/&gt;
 */&lt;br/&gt;
class Role&lt;br/&gt;
{&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;The other 50% everything will be in there. In addition, if the --regenerate-entities=1 argument is removed, if I change the data in my YAML schema file for a column (such as changing length=255 to length=50 on a string), the annotations won&apos;t be updated when the updated entity is generated. It seems only new fields are being added to the entity files which is why --regenerate-entities=1 was required in the first place.&lt;/p&gt;</description>
                <environment>Ubuntu 10.10, PHP5.3.3</environment>
            <key id="12258">DDC-953</key>
            <summary>CLI tools orm:generate-entities --regenerate-entities=1 flag will generate empty entities 50% of time.</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="flynsarmy">Flyn San</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Dec 2010 06:42:01 +0000</created>
                <updated>Tue, 8 Feb 2011 09:20:25 +0000</updated>
                    <resolved>Tue, 8 Feb 2011 09:20:25 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15216" author="beberlei" created="Wed, 2 Feb 2011 17:33:32 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="15240" author="flynsarmy" created="Tue, 8 Feb 2011 08:42:28 +0000"  >&lt;p&gt;This issue is still not fixed in 2.0.1. Simply run orm:generate-entities --regenerate-entities=1 --generate-annotations=1  to replicate.&lt;/p&gt;</comment>
                    <comment id="15241" author="beberlei" created="Tue, 8 Feb 2011 09:20:25 +0000"  >&lt;p&gt;Yes, because this issue is fixed in 2.0.2 not in 2.0.1.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1018] INDEX BY does not work in JOIN clauses</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1018</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems INDEX BY only works in the FROM, not in JOIN clauses.&lt;/p&gt;

&lt;p&gt;This is a dependency for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-250&quot; title=&quot;ArrayCollection Key Column @indexBy&quot;&gt;&lt;del&gt;DDC-250&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12359">DDC-1018</key>
            <summary>INDEX BY does not work in JOIN clauses</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Feb 2011 19:56:48 +0000</created>
                <updated>Sat, 5 Feb 2011 04:34:15 +0000</updated>
                    <resolved>Sat, 5 Feb 2011 04:34:15 +0000</resolved>
                            <version>2.0.1</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15230" author="beberlei" created="Sat, 5 Feb 2011 04:34:15 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="10718">DDC-250</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1006] Entity Generator Regenerate If Not New</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1006</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When regenerating entities from xml ( and i am sure all others ) it gives a blank entity class when the file exists and the regenerateIfExists is set to true, the expected result would be a full entity with any removed columns removed from the entity and new columns to be added.&lt;/p&gt;

&lt;p&gt;i&apos;ve come up with a fix that i assume is the correct way&lt;br/&gt;
i haven&apos;t tested this without the regeneration set to true since my application requires the regeneration, here&apos;s my code block i&apos;m using:&lt;/p&gt;

&lt;p&gt;$em-&amp;gt;getConfiguration()-&amp;gt;setMetadataDriverImpl(&lt;br/&gt;
    new \Doctrine\ORM\Mapping\Driver\SesXmlDriver(&lt;br/&gt;
        &apos;ext/Doctrine/Entities/xml_metadata/&apos;&lt;br/&gt;
    )&lt;br/&gt;
);&lt;/p&gt;

&lt;p&gt;$cmf = new Doctrine\ORM\Tools\DisconnectedClassMetadataFactory();&lt;br/&gt;
$cmf-&amp;gt;setEntityManager($em);&lt;br/&gt;
$metadata = $cmf-&amp;gt;getAllMetadata();&lt;/p&gt;

&lt;p&gt;$generator = new \Doctrine\ORM\Tools\EntityGenerator();&lt;br/&gt;
$generator-&amp;gt;setGenerateAnnotations(true);&lt;br/&gt;
$generator-&amp;gt;setGenerateStubMethods(true);&lt;br/&gt;
$generator-&amp;gt;setRegenerateEntityIfExists(true);&lt;br/&gt;
//$generator-&amp;gt;setUpdateEntityIfExists(true);&lt;br/&gt;
$generator-&amp;gt;generate($metadata, &apos;ext/&apos;);&lt;/p&gt;

&lt;p&gt;in the _hasProperty and _hasMethod functions, need to add the below to the inline check:&lt;/p&gt;

&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; ( ! $this-&amp;gt;_isNew &amp;amp;&amp;amp; $this-&amp;gt;_regenerateEntityIfExists)&lt;/th&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</description>
                <environment></environment>
            <key id="12335">DDC-1006</key>
            <summary>Entity Generator Regenerate If Not New</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="sw45859">Stephen Walker</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Jan 2011 02:11:20 +0000</created>
                <updated>Wed, 2 Feb 2011 17:33:01 +0000</updated>
                    <resolved>Wed, 2 Feb 2011 17:33:01 +0000</resolved>
                            <version>2.0.1</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15210" author="beberlei" created="Wed, 2 Feb 2011 13:52:03 +0000"  >&lt;p&gt;blank as in the file is completly empty?&lt;/p&gt;</comment>
                    <comment id="15211" author="sw45859" created="Wed, 2 Feb 2011 13:57:20 +0000"  >&lt;p&gt;no, it generates just the class with no properties or methods.&lt;/p&gt;</comment>
                    <comment id="15215" author="beberlei" created="Wed, 2 Feb 2011 17:33:01 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1002] bug in generate entities with many2many relationships from xml/yml shcemes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1002</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I try use many2many relations in my symfony2 learning project &lt;a href=&quot;https://github.com/symfony/symfony.git&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony.git&lt;/a&gt;&lt;br/&gt;
But entities thar generates from yml schemes did not meet entities from doctrine2 guide or entities from beberlei Whitewashing project &lt;a href=&quot;https://github.com/beberlei/Whitewashing/tree/master/Blog&quot; class=&quot;external-link&quot;&gt;https://github.com/beberlei/Whitewashing/tree/master/Blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that I try generate similar entitries is doctrine2-sandbox. Problem is the same&lt;br/&gt;
I attached yml schemes and result entities.&lt;/p&gt;

&lt;p&gt;Problem:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Entities\Address does not have relations with Entities\User&lt;/li&gt;
	&lt;li&gt;In Entities\User property $adresses instance of Entity\Address. But this Doctrine\Common\Collections\ArrayCollection or no?
&lt;div class=&quot;code panel&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;var&lt;/span&gt; Entity\Address
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $addresses;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;li&gt;In Entities\User not at __constructor() method:
&lt;div class=&quot;code panel&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 __construct()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addresses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
    }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Linux stfalcon-laptop 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux &lt;br/&gt;
Installed packages, channel pear.doctrine-project.org: &lt;br/&gt;
====================================================== &lt;br/&gt;
Package Version State &lt;br/&gt;
DoctrineCommon 2.0.0 stable &lt;br/&gt;
DoctrineDBAL 2.0.0 stable &lt;br/&gt;
DoctrineORM 2.0.0 stable </environment>
            <key id="12325">DDC-1002</key>
            <summary>bug in generate entities with many2many relationships from xml/yml shcemes</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="stfalcon">Stepan Tanasiychuk</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 Jan 2011 14:48:36 +0000</created>
                <updated>Wed, 2 Feb 2011 17:32:38 +0000</updated>
                    <resolved>Wed, 2 Feb 2011 17:32:38 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15214" author="beberlei" created="Wed, 2 Feb 2011 17:32:38 +0000"  >&lt;p&gt;Fixed the msising constructor. However mind that in my Whitewashing project i wrote the entities manually, not generated them!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10917" name="Entities.tar.gz" size="554" author="stfalcon" created="Tue, 25 Jan 2011 14:48:36 +0000" />
                    <attachment id="10916" name="yml.tar.gz" size="418" author="stfalcon" created="Tue, 25 Jan 2011 14:48:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1008] Entity Generator Stub Method For Id Generator</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1008</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the EntityGenerator when the id setting has a generator of NONE it does not add the stub method for setting the id keys value, here&apos;s my fix:&lt;/p&gt;

&lt;p&gt;around line 478 in the _generateEntityStubMethods function, the first foreach which checks for the id mapping, change:&lt;/p&gt;

&lt;p&gt;            if ( ! isset($fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt;) || ! $fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;/p&gt;

&lt;p&gt;TO&lt;/p&gt;

&lt;p&gt;            if ( ! isset($fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt;) || ! $fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt; || ($this-&amp;gt;_getIdGeneratorTypeString($metadata-&amp;gt;generatorType) == &apos;NONE&apos;)) {&lt;/p&gt;</description>
                <environment></environment>
            <key id="12340">DDC-1008</key>
            <summary>Entity Generator Stub Method For Id Generator</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="sw45859">Stephen Walker</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Jan 2011 19:00:57 +0000</created>
                <updated>Wed, 2 Feb 2011 17:32:07 +0000</updated>
                    <resolved>Wed, 2 Feb 2011 17:32:07 +0000</resolved>
                            <version>2.0.1</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15213" author="beberlei" created="Wed, 2 Feb 2011 17:32:07 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;We need to find a better solution to fix this &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="15085" author="dalvarez" created="Sat, 1 Jan 2011 16:37:36 +0000"  >&lt;p&gt;As for the size limit on cached values, I think it is an independent problem, because any value size limit applies in any case, whether or not you implement unique keys or not. Currently, it also applies e. g. to query results, for which an upper size limit can not be guaranteed in general. Consequently, a strategy for handling such a limit is required anyway. &lt;/p&gt;

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

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

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

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

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

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

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

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

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

<item>
            <title>[DDC-958] postLoad event triggering</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-958</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently I&apos;ve noticed that postLoad event is not triggered on $em-&amp;gt;refresh($entity); it seems like entity should be reloaded on this call&lt;br/&gt;
and logically postLoad event should be also triggered if entity is being reloaded.&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="12263">DDC-958</key>
            <summary>postLoad event triggering</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gediminasm">Gediminas Morkevicius</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Dec 2010 10:10:57 +0000</created>
                <updated>Sun, 23 Jan 2011 11:28:36 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 11:28:36 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15170" author="beberlei" created="Sun, 23 Jan 2011 11:28:36 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-968] Query hints should be retrievable by user</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-968</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the only way to set additional parameters accessible by AST TreeWalker is using the query hints.&lt;br/&gt;
the main problem is then query is being cloned, hints are flushed and the only way to set them is to access them by name and feed to cloned query one by one.&lt;br/&gt;
I think there should be Query::getHints() method available to the userland&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="12277">DDC-968</key>
            <summary>Query hints should be retrievable by user</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gediminasm">Gediminas Morkevicius</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Jan 2011 06:00:19 +0000</created>
                <updated>Sun, 23 Jan 2011 10:48:26 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 10:48:26 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15169" author="beberlei" created="Sun, 23 Jan 2011 10:48:26 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-997] Call to undefined method isIdentifier in AbstractHydrator.php line 197</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-997</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12317">DDC-997</key>
            <summary>Call to undefined method isIdentifier in AbstractHydrator.php line 197</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Jan 2011 10:20:10 +0000</created>
                <updated>Sun, 23 Jan 2011 10:42:21 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 10:42:21 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15168" author="beberlei" created="Sun, 23 Jan 2011 10:42:21 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-969] SchemaTool fails with class table inheritance if id columnName is not &quot;id&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-969</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>

&lt;p&gt;In method &lt;b&gt;getSchemaFromMetadata()&lt;/b&gt; within the &lt;em&gt;$class-&amp;gt;isInheritanceTypeJoined()&lt;/em&gt; part the following line&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Doctrine\ORM\Tools\SchemaTool::getSchemaFromMetadata() &amp;#8212; Line 182&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$table-&amp;gt;getColumn($class-&amp;gt;identifier[0])-&amp;gt;setAutoincrement(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;leads to a &lt;em&gt;Doctrine\DBAL\Schema\SchemaException::columnDoesNotExist()&lt;/em&gt; if a columnName other then &lt;em&gt;id&lt;/em&gt; is used for the id field, as not the columnName (but the field name) is passed to &lt;em&gt;$table-&amp;gt;getColumn()&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Should rather be &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$table-&amp;gt;getColumn($columnName)-&amp;gt;setAutoincrement(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12280">DDC-969</key>
            <summary>SchemaTool fails with class table inheritance if id columnName is not &quot;id&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ayhan">ayhan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 Jan 2011 20:05:37 +0000</created>
                <updated>Sun, 23 Jan 2011 10:13:31 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 10:13:31 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15167" author="beberlei" created="Sun, 23 Jan 2011 10:13:31 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This works&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// Fetch two channels in an array
&lt;/span&gt;$channels = .......

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

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

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

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This also works&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// Fetch two channels in an array
&lt;/span&gt;$channels = .......

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

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

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

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This does not work (channels are removed)&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// Fetch two channels in an array
&lt;/span&gt;$channels = .......

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

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

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

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

&lt;p&gt;This last piece of code generates following SQL code (summarized): &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;DELETE FROM user_channels WHERE userId = 1
INSERT INTO user_channels (userId, channelId) VALUES (1, 2);
DELETE FROM user_channels WHERE userId = 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

&lt;p&gt;But yes, I overwrite the previous content of the association variable &quot;User::$channels&quot; with a Doctrine ArrayCollection.
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;User Entity&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/** @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt;) */
class User
{
    /**
     * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=50) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;

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

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

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

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

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

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

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

<item>
            <title>[DDC-996] Empty field names lead to weird exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-996</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Empty field names (possible in xml and yml) lead to weird exception messages, they should throw a MappingException::missingFieldName exception.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12316">DDC-996</key>
            <summary>Empty field names lead to weird exception</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Jan 2011 08:14:58 +0000</created>
                <updated>Sun, 23 Jan 2011 08:23:53 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 08:23:53 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15164" author="beberlei" created="Sun, 23 Jan 2011 08:23:53 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-960] Locking @Version with MappedSuperClass and Single Table Inheritance results in wrong queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-960</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using a @version field for locking purposes in one of the fields of a MappedSuperClass, things go wrong. Here is my situation:&lt;/p&gt;

&lt;p&gt;SpecificUser extends of BaseUser&lt;br/&gt;
There is one mapped superclass containing things like createdOn, createdBy and finally the @version field named version.&lt;/p&gt;

&lt;p&gt;Now, when I change a record, the following queries are created. The last one is faulty:&lt;/p&gt;

&lt;p&gt;Query: UPDATE specificuser SET firstname = ? WHERE id = ?&lt;br/&gt;
Query: UPDATE baseuser SET version = version + 1 WHERE id = ? AND version = ?&lt;br/&gt;
Query: SELECT version FROM specificuser WHERE id = ?    &amp;lt;======= should be: SELECT version FROM baseuser WHERE id = ?&lt;/p&gt;</description>
                <environment>Windows 7 using Zend Server</environment>
            <key id="12265">DDC-960</key>
            <summary>Locking @Version with MappedSuperClass and Single Table Inheritance results in wrong queries</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="jackvangalen">Jack van Galen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Dec 2010 05:39:19 +0000</created>
                <updated>Sun, 23 Jan 2011 07:00:53 +0000</updated>
                    <resolved>Sun, 23 Jan 2011 07:00:53 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15066" author="beberlei" created="Thu, 30 Dec 2010 16:35:40 +0000"  >&lt;p&gt;You say Single Table Inheritance but specificuser and baseuser are two different tables? How does that work? With single table inheritance both specificuser and baseuser are in the same table.&lt;/p&gt;

&lt;p&gt;Can you post your mappings? I am not convinced of this bug yet &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="15104" author="jackvangalen" created="Tue, 4 Jan 2011 04:26:09 +0000"  >&lt;p&gt;Oops, my mistake. I meant to say &apos;class table inheritance&apos;. The definitions that I used (slightly modified and translated to English) are below.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt; 
namespace framework{

	/** @MappedSuperclass */
	class DbTable {

		/**
		 * @Id @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;, length=&lt;span class=&quot;code-quote&quot;&gt;&quot;10&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;, nullable=&quot;&lt;/span&gt;&quot;)
		 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
		 */
		&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

		/** @Version @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;version&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;) */
		&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $version;
		
		/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetimetz&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;createdon&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;) */
		&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $createdon;

	}
	
}


namespace custom\tables{

	/**
	* @Entity
	*/
	class specificuser &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; generated\tables\baseuser {
		
	}

}


namespace custom\tables{

	/**
	 * @Entity
	 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
	 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;specificuser&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;custom\tables\specificuser&quot;&lt;/span&gt;})
	 */
	class baseuser &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; generated\tables\baseuser {
	
	}
	
}


namespace generated\tables{

	class specificuser &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; custom\tables\baseuser {
	}
	
}


namespace generated\tables{

	class user &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; framework\DbTable {

		/**
		*@Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
		*/
        &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $username;
		
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
</comment>
                    <comment id="15162" author="beberlei" created="Sun, 23 Jan 2011 07:00:53 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

<item>
            <title>[DDC-980] SQL alias behavior inconsistent in UPDATE ... WHERE (subselect)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-980</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using a DQL UPDATE with a subselect in the WHERE clause (such as what the size() function generates), the subselect is trying to reference an alias that is not defined in the main UPDATE clause. Using the size() function similarly in a SELECT statement works fine, the problem is only occurring for me when I try an UPDATE. I have not tried it with INSERT or DELETE, but I would suspect a similar inconsistency with anything other than the more common usage with SELECT.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q = $em-&amp;gt;createQuery(&apos;UPDATE Event e SET e.no_speakers = 1, e.no_credits = 1 WHERE size(e.Instances) = 0&apos;);
print $q-&amp;gt;getSQL();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;UPDATE Event SET no_speakers = 1, no_credits = 1 WHERE (SELECT COUNT(*) FROM Instance c0_ WHERE c0_.Event_id = c1_.id) = 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And, $q-&amp;gt;execute() results in:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;PHP Fatal error:  Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;c1_.id&apos; in &apos;where clause&apos;&apos; in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/v3-lf/library/Doctrine/DBAL/Connection.php:657
Stack trace: #0 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/v3-lf/library/Doctrine/DBAL/Connection.php(657): PDO-&amp;gt;exec(&apos;UPDATE Event...&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12294">DDC-980</key>
            <summary>SQL alias behavior inconsistent in UPDATE ... WHERE (subselect)</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="lfeistel">Lee Feistel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 Jan 2011 08:49:26 +0000</created>
                <updated>Thu, 13 Jan 2011 15:19:26 +0000</updated>
                    <resolved>Thu, 13 Jan 2011 15:19:26 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15135" author="beberlei" created="Thu, 13 Jan 2011 14:24:44 +0000"  >&lt;p&gt;Would something like the following work on ALL database vendors?&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;UPDATE Event SET no_speakers = 1, no_credits = 1 WHERE (SELECT COUNT(*) FROM Instance c0_ WHERE c0_.Event_id = Event.id) = 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15136" author="beberlei" created="Thu, 13 Jan 2011 15:19:26 +0000"  >&lt;p&gt;It does work. Fixed!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-117] Allow @Id on @ManyToOne fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-117</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sometimes, a @ManyToOne field has to be the Primary Key, or part of the Primary Key. Adding @Id to the @ManyToOne does not help, an additional property with duplicates the referenced id is needed:&lt;/p&gt;

&lt;p&gt;(userId and User field in the Phonenumber class - to be able to set @Id on userId):&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/d51e021e2&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/d51e021e2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Allowing @Id on @ManyToOne fields (which would make the JoinColumn a PK) would help here. Any maybe this would also fix &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-116&quot; title=&quot;array_combine error when using combined Primary Key&quot;&gt;&lt;del&gt;DDC-116&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10344">DDC-117</key>
            <summary>Allow @Id on @ManyToOne fields</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Nov 2009 09:19:06 +0000</created>
                <updated>Sun, 9 Jan 2011 15:10:40 +0000</updated>
                    <resolved>Sun, 2 Jan 2011 06:04:58 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>8</votes>
                        <watches>11</watches>
                        <comments>
                    <comment id="11039" author="nicokaiser" created="Mon, 7 Dec 2009 13:09:23 +0000"  >&lt;p&gt;Thanks for your reply on doctrine-user!&lt;/p&gt;

&lt;p&gt;My previous workaround was something like this:&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/private/uoawwvf75onnvph8bj1fwg&quot; class=&quot;external-link&quot;&gt;http://pastie.org/private/uoawwvf75onnvph8bj1fwg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead of just having a $User property in the Phonenumber entity (which is mapped by the userId field in the phonenumber table), I have an additional $userId property, which is also mapped to the userId DB field. This way I could make $userId @Id (and thus add it to the PKs), but I had to manually update it when I set the $User (see the TODO annotations in the Pastie code).&lt;/p&gt;

&lt;p&gt;I see &quot;EntityManager#find(...)&quot; would have to be able to also get objects as identifiers, e.g. (int, User), which may have major implications... &lt;/p&gt;


&lt;p&gt;However I think to support constructions like this is very important as it&apos;s a very common pattern, especially for OneToOne associations with no additional identifier field (PK = FK)... &lt;/p&gt;</comment>
                    <comment id="11219" author="romanb" created="Thu, 17 Dec 2009 20:35:50 +0000"  >&lt;p&gt;We might need to introduce the concept of an IdClass for this in order to be implemented decently.&lt;/p&gt;</comment>
                    <comment id="13321" author="mstoehr" created="Tue, 15 Jun 2010 06:09:03 +0000"  >&lt;p&gt;I just ran into this exact issue. Is there any decent way to work around this issue as the pastie.org-Link is already gone?&lt;/p&gt;</comment>
                    <comment id="13323" author="nicokaiser" created="Tue, 15 Jun 2010 06:44:33 +0000"  >&lt;p&gt;In an Entity (e.g. &quot;Phonenumber&quot;) with PrimaryKey userId you can do something like this:&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;/**
 * @ManyToOne(targetEntity=&quot;Entities\User&quot;, inversedBy=&quot;Phonenumbers&quot;)
 * @JoinColumn(name=&quot;userId&quot;, referencedColumnName=&quot;id&quot;)
 */
protected $User;

/**
 * @Id
 * @Column(name=&quot;userId&quot;, type=&quot;integer&quot;)
 */
protected $userId;

public function setUser(\Entities\User $user)
{
    $this-&amp;gt;User = $user;
    $this-&amp;gt;userId = $user-&amp;gt;getId();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13830" author="beberlei" created="Sat, 7 Aug 2010 14:10:01 +0000"  >&lt;p&gt;I took the time today and tried what is possible to hack in this regard and came up with a pretty trivial solution for this. This is a very early draft of this functionality as it might be included in 2.1&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/commits/DDC-117&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commits/DDC-117&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What works?&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Association Only Composite Primary Keys (Reference with SourceArticle to TargetArticle)&lt;/li&gt;
	&lt;li&gt;Mixed Composite Primary Keys (ArticleTranslation with Article + Language)&lt;/li&gt;
	&lt;li&gt;Single Association Primary Keys (Article and ArticleDetails)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="13831" author="mstoehr" created="Sat, 7 Aug 2010 14:16:19 +0000"  >&lt;p&gt;Wow, great work, Benjamin. Will try it out ASAP and when it works, I&apos;ll owe you a beer. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="13867" author="s9e" created="Sun, 8 Aug 2010 18:36:10 +0000"  >&lt;p&gt;I&apos;m having troubles with user-defined column names used in SAPK. The schema tool complains that the column name doesn&apos;t exist. I&apos;ve reduced it to a small testcase based on DDC117Test.&lt;/p&gt;</comment>
                    <comment id="13868" author="s9e" created="Sun, 8 Aug 2010 18:36:46 +0000"  >&lt;p&gt;SAPK with user-defined column names&lt;/p&gt;</comment>
                    <comment id="13948" author="beberlei" created="Sun, 15 Aug 2010 13:00:05 +0000"  >&lt;p&gt;I fixed another bunch of issues with hydration and updating of assoc-id entities.&lt;/p&gt;

&lt;p&gt;@s9e i will now tackle your issue.&lt;/p&gt;</comment>
                    <comment id="13949" author="beberlei" created="Sun, 15 Aug 2010 13:16:26 +0000"  >&lt;p&gt;@s9e you forgot to define the @JoinColumn annotation correctly. that is necessary when you rename the ID column on the other side. See my current commit, it works for me!&lt;/p&gt;

&lt;p&gt;The commit is: &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/772e5924898326de2c769c4cb0c6874fde4edc45&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/772e5924898326de2c769c4cb0c6874fde4edc45&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13956" author="beberlei" created="Sun, 15 Aug 2010 14:21:13 +0000"  >&lt;p&gt;Add current version of the patch diffed against the master from today, for easier testing and review.&lt;/p&gt;</comment>
                    <comment id="13960" author="s9e" created="Sun, 15 Aug 2010 18:18:27 +0000"  >&lt;p&gt;@Benjamin Eberlei - Actually it&apos;s the other way around. I have defined @JoinColumn on both sides of the relationship, and SchemaTool doesn&apos;t like that. After removing @JoinColumn from the inverse side, SchemaTool processes the entities as expected, so I&apos;m not sure whether it should be considered a bug or a feature. If @JoinColumn should only be defined on the owning side, please add a note to the manual.&lt;/p&gt;

&lt;p&gt;Anyway, the schema now works but I&apos;m still having troubles persisting through cascade. Test attached.&lt;/p&gt;</comment>
                    <comment id="13961" author="beberlei" created="Mon, 16 Aug 2010 03:21:45 +0000"  >&lt;p&gt;the @joinColumn is explained in the association mapping chapter. There are examples for each cases, showing where to put the annotation and where not.&lt;/p&gt;

&lt;p&gt;The Persist Cascade i pick up next then.&lt;/p&gt;</comment>
                    <comment id="13973" author="mjh_ca" created="Tue, 17 Aug 2010 07:07:00 +0000"  >&lt;p&gt;Hi Benjamin, great work on this.  Testing it out now.  One problem (do you want a ticket opened?).  Using the latest &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; branch, schema tool crates both a PRIMARY KEY and a UNIQUE KEY (at least in MySQL) on the same columns.  The UNIQUE KEY is really not necessary, right?&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/** @Entity */
class Foo {
    /**
     * @Id @Column(type=&quot;integer&quot;)
     * @GeneratedValue
     */
    protected $id;
}

/** @Entity */
class Bar {
    /**
     * @Id
     * @OneToOne(targetEntity=&quot;Foo&quot;)
     * @JoinColumn(name=&quot;foo_id&quot;, referencedColumnName=&quot;id&quot;)
     */
    protected $fooId;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Produces:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;CREATE TABLE Bar (foo_id INT NOT NULL, UNIQUE INDEX Bar_foo_id_uniq (foo_id), PRIMARY KEY(foo_id)) ENGINE = InnoDB;
CREATE TABLE Foo (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;CREATE TABLE Bar (foo_id INT NOT NULL, PRIMARY KEY(foo_id)) ENGINE = InnoDB;
CREATE TABLE Foo (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13974" author="beberlei" created="Tue, 17 Aug 2010 07:14:22 +0000"  >&lt;p&gt;No, all the issues on this ticket. I branch them into subtickets if necessary.&lt;/p&gt;</comment>
                    <comment id="14730" author="mjh_ca" created="Sun, 14 Nov 2010 05:12:16 +0000"  >&lt;p&gt;Hi Benjamin - would you mind doing a merge from current master to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; branch?  Been using it for devel and it is working quite well but commit 140ddf5098a7ffdf6bc3 on Sept 27 causes a merge conflict.  Looks like it is easy to resolve but it would be great if it could be merged into your &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; so extra steps aren&apos;t required to clone/checkout &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="15045" author="beberlei" created="Tue, 28 Dec 2010 11:29:06 +0000"  >&lt;p&gt;I updated the branch to integrate with the current master and attached a new patch to the ticket.&lt;/p&gt;</comment>
                    <comment id="15046" author="beberlei" created="Tue, 28 Dec 2010 12:01:35 +0000"  >&lt;p&gt;@S9e: Yes this is obvious, it works only with Sequence as ID Generation strategy (for example with PostgreSQL)&lt;/p&gt;

&lt;p&gt;The problem is, during persist MySQL and SQLite don&apos;t know the value of the primary key yet. However for the @id + @ManyToOne patch to work it is necessary that all the dependencies primary keys are already known. That is why two step flush procedures are sometimes necessary.&lt;/p&gt;

&lt;p&gt;1. persist non fk+pk entities and flush them&lt;br/&gt;
2. persist fk+pk entities then flush them&lt;/p&gt;</comment>
                    <comment id="15082" author="beberlei" created="Sat, 1 Jan 2011 15:49:03 +0000"  >&lt;p&gt;Patch is now finished and will be merged into master tomorrow.&lt;/p&gt;</comment>
                    <comment id="15095" author="beberlei" created="Sun, 2 Jan 2011 06:04:58 +0000"  >&lt;p&gt;Merged into master and scheduled for 2.1.&lt;/p&gt;

&lt;p&gt;Please test this patch extensively, there are tons of examples in tests/Doctrine/Tests/Models/DDC117 and tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php&lt;/p&gt;</comment>
                    <comment id="15115" author="henrikbjorn" created="Sun, 9 Jan 2011 12:05:40 +0000"  >&lt;p&gt;@Benjamin&lt;/p&gt;

&lt;p&gt;I have created a OneToOne relation on a User -&amp;gt; Profile where the profile is specified as the inverse side so i can have user_id be the primary key. And it all works as expected except that when i create a new User (The Profile object is getting created in the user constructor) and persist it (the relation have cascade-all specified)  i end up with the error &quot;The given entity has no identity.&quot;. But if i persist the user without creating the profile inside it and fliush and then create a Profile object and persist and flush that it all work.&lt;/p&gt;

&lt;p&gt;It seems like it dosent know that the User should be saved first so that it have an id and then save the profile. Dont know if this is a bug or it is expected behavior.&lt;/p&gt;</comment>
                    <comment id="15116" author="beberlei" created="Sun, 9 Jan 2011 15:10:40 +0000"  >&lt;p&gt;expected behavior, you are using the id generator &quot;assigned&quot; which means on persist the id has to be assigned. In your case it isnt, because the related object has not been assigned an id itself, thus failing.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="11898">DDC-795</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10902" name="ddc117-20101228.diff" size="28758" author="beberlei" created="Tue, 28 Dec 2010 11:29:06 +0000" />
                    <attachment id="10742" name="ddc117test_cascade_persist.patch" size="1173" author="s9e" created="Sun, 15 Aug 2010 18:18:43 +0000" />
                    <attachment id="10741" name="ddc117_20100815.patch" size="29539" author="beberlei" created="Sun, 15 Aug 2010 14:21:13 +0000" />
                </attachments>
            <subtasks>
            <subtask id="11559">DDC-658</subtask>
            <subtask id="11898">DDC-795</subtask>
            <subtask id="12121">DDC-881</subtask>
            <subtask id="12212">DDC-922</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-546] New fetch mode EXTRA_LAZY for collections</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-546</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A new fetch mode EXTRA_LAZY for one-to-many and many-to-many associations could have the following effects on PersistentCollection methods:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;count() : Does not initialize the collection but issues a straight SQL count query.&lt;/li&gt;
	&lt;li&gt;remove($key) : Does not initialize the collection but issues straight SQL instead.&lt;/li&gt;
	&lt;li&gt;removeElement($element) : Does not initialize the collection but issues straight SQL instead.&lt;/li&gt;
	&lt;li&gt;contains($element) : Does not initialize the collection but issues straight SQL instead.&lt;/li&gt;
	&lt;li&gt;containsKey($key)  : Does not initialize the collection but issues straight SQL instead.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This mode would usually be useful for (potentially) large collections.&lt;/p&gt;

&lt;p&gt;We need to work out concrete use-case examples and implementation proposals before implementation.&lt;/p&gt;

&lt;p&gt;The semantics of the mentioned methods with EXTRA_LAZY need to be carefully worked out, i.e. what happens to already managed instances in case of the remove operations and stuff like that.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11277">DDC-546</key>
            <summary>New fetch mode EXTRA_LAZY for collections</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Apr 2010 11:36:53 +0000</created>
                <updated>Sun, 2 Jan 2011 09:16:27 +0000</updated>
                    <resolved>Sun, 2 Jan 2011 09:15:12 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="12869" author="mjh_ca" created="Fri, 7 May 2010 15:54:35 +0000"  >&lt;p&gt;Wow, this is an excellent idea.  I was just thinking how it is unfortunate that there aren&apos;t ways to manipulate large collections without resorting to DQL.&lt;/p&gt;

&lt;p&gt;If nothing else, having access to a count() would be particularly great.&lt;/p&gt;</comment>
                    <comment id="12871" author="romanb" created="Fri, 7 May 2010 16:49:50 +0000"  >&lt;p&gt;@Marc: You might then also be interested in a related ticket: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-547&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-547&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This would basically allow you to craft special implementations that inherit from PersistentCollection that are &quot;optimized&quot; in some way for a specific association (i.e. write your own custom SQL query when count() is invoked). Your wrapper class is then used by Doctrine instead of the default one, thats the idea. Of course implementing such a custom collection and overriding methods needs to be done carefully to fully preserve the public API contract (PersistentCollection wrappers are supposed to be &quot;invisible&quot; to the user after all). So this would be an advanced feature. EXTRA_LAZY I think is a pretty easy feature, accessible for all users with no further knowledge required. It just means that the collection delays initialization even more, whereever possible, which is a good thing for large collections which you normally don&apos;t really want to load, yet it allows you to use the normal OO API of your domain model without resorting to special (DQL) queries.&lt;/p&gt;</comment>
                    <comment id="12872" author="romanb" created="Fri, 7 May 2010 16:51:51 +0000"  >&lt;p&gt;Oh, I just saw you&apos;re watching that one already &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; sorry for the noise&lt;/p&gt;</comment>
                    <comment id="12996" author="romanb" created="Wed, 19 May 2010 06:31:39 +0000"  >&lt;p&gt;Rescheduling for beta3 as we&apos;re running out of time.&lt;/p&gt;</comment>
                    <comment id="13471" author="beberlei" created="Wed, 30 Jun 2010 16:17:04 +0000"  >&lt;p&gt;Additional features that have been requested by users:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Fetch entries in this collection in batches, i.e. only in 20 steps, issue a limit 0,21 and check if there is more&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I don&apos;t know about the remove() and removeElement() operations, would they register with the UoW or directly execute the DELETE or UPDATE stements themselves?&lt;/p&gt;</comment>
                    <comment id="13536" author="romanb" created="Wed, 7 Jul 2010 11:17:16 +0000"  >&lt;p&gt;Pushing back to beta4.&lt;/p&gt;</comment>
                    <comment id="13569" author="romanb" created="Mon, 12 Jul 2010 11:48:51 +0000"  >&lt;p&gt;Moved to 2.1 due to lack of time for larger new stuff for 2.0.&lt;/p&gt;</comment>
                    <comment id="14908" author="beberlei" created="Sat, 4 Dec 2010 13:46:25 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/tree/DDC-546&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/tree/DDC-546&lt;/a&gt; first prototype implementation with tests.&lt;/p&gt;

&lt;p&gt;Missing:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;XML and YAML Mapping support.&lt;/li&gt;
	&lt;li&gt;Contains() support.&lt;/li&gt;
	&lt;li&gt;RemoveElement() support&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Necessary for later scheduling (only make sense when persisting keys):&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;ContainsKey() support&lt;/li&gt;
	&lt;li&gt;RemoveKey() support&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="15053" author="beberlei" created="Wed, 29 Dec 2010 06:31:53 +0000"  >&lt;p&gt;I updated the branch to include XML, YAML support, refactored a little bit and added contains() support.&lt;/p&gt;

&lt;p&gt;The RemoveElement() support should be put into its own ticket that relates to the EntityManager#link() / EntityManager#unlink() functionality.&lt;/p&gt;</comment>
                    <comment id="15100" author="beberlei" created="Sun, 2 Jan 2011 09:15:12 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                    <comment id="15101" author="beberlei" created="Sun, 2 Jan 2011 09:16:27 +0000"  >&lt;p&gt;Usage would be inside a @OneToMany or @ManyToMany definition set&lt;/p&gt;

&lt;p&gt;Annotations/XML:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EXTRA_LAZY&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;YAML:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;fetch: EXTRA_LAZY
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10362">DDC-128</issuekey>
        </issuelink>
                    </outwardlinks>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10273">DDC-80</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-949] strange behavior with boolean types when using findOneBy() in a CLI phpunit test</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-949</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I do not see this behavior when running findByOne() calls via the Apache SAPI. No clue really what could possibly cause this. Not sure how to get the error logger to output something in a phpunit test (never really figured out how phpunit supports debugging). Essentially if I run the tests with SQLite the case with &apos;false&apos; fails and when I run with PostgreSQL the case with 0 fails. Essentially in the fail case I get an instance of $this, just like when I pass: false.&lt;/p&gt;

&lt;p&gt;Tell me if this report is useless in the current state and then I will work on separating it out into a standalone CLI script without Symfony2 and phpunit. But I dont want to spend more time on this if it isnt necessary.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12254">DDC-949</key>
            <summary>strange behavior with boolean types when using findOneBy() in a CLI phpunit test</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sat, 25 Dec 2010 08:06:21 +0000</created>
                <updated>Sun, 2 Jan 2011 07:14:01 +0000</updated>
                    <resolved>Sun, 2 Jan 2011 03:44:35 +0000</resolved>
                                            <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15030" author="beberlei" created="Tue, 28 Dec 2010 04:37:29 +0000"  >&lt;p&gt;Cannot reproduce.&lt;/p&gt;
</comment>
                    <comment id="15031" author="beberlei" created="Tue, 28 Dec 2010 04:37:59 +0000"  >&lt;p&gt;Attached simpler testcase for reproduce.&lt;/p&gt;</comment>
                    <comment id="15033" author="lsmith" created="Tue, 28 Dec 2010 05:16:30 +0000"  >&lt;p&gt;further testing shows this issue only exists with false and there I can reproduce it on the CLI and via apache. it seems I am hitting: &lt;a href=&quot;http://bugs.php.net/bug.php?id=33876&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/bug.php?id=33876&lt;/a&gt;&lt;br/&gt;
however the issue also happens with sqlite for the same reason false gets casted to an empty string when not telling PDO explicitly to handle the parameter as a boolean.&lt;/p&gt;</comment>
                    <comment id="15081" author="lsmith" created="Sat, 1 Jan 2011 13:05:15 +0000"  >&lt;p&gt;as explained in the previous comment, the issue is caused by &quot;false&quot; and not by &quot;true&quot; as in the test case.&lt;/p&gt;</comment>
                    <comment id="15087" author="beberlei" created="Sun, 2 Jan 2011 03:44:35 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;

&lt;p&gt;This issue occured, because BasicEntityPersister did not pass the PARAM: typehints to the DBAL connection.&lt;/p&gt;

&lt;p&gt;Adding this fixes the issue with Booleans on PostgreSQL, however I just realized it also exists for Oracle OCI and needs an adjustment in DBAL to be fixable.&lt;/p&gt;</comment>
                    <comment id="15098" author="lsmith" created="Sun, 2 Jan 2011 06:28:50 +0000"  >&lt;p&gt;I am also seeing the issue with SQLite.&lt;/p&gt;</comment>
                    <comment id="15099" author="lsmith" created="Sun, 2 Jan 2011 07:14:01 +0000"  >&lt;p&gt;ok .. i can confirm the issue is fixed on sqlite and postgresql&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10901" name="DDC949Test.php" size="821" author="beberlei" created="Tue, 28 Dec 2010 04:37:59 +0000" />
                    <attachment id="10898" name="DoctrineORMBugTest.php" size="4562" author="lsmith" created="Sat, 25 Dec 2010 08:06:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-922] Persisting an entity with an 1:n collection of related entites fails if the FK ist part of a composite PK</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-922</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you got two Entities A and B where A is a sample Entity with a 1:n relation to the Entity B&lt;br/&gt;
and B has a composite PK with the FK (A id) and a custom field 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;EntityA:
  type: entity
  table: entity_a
  repositoryClass: EntityARepository
  id:
    id:
      type: integer
      generator:
        strategy: AUTO
  fields:
    handle:
      type: string
      length: 32
      unique: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
 oneToMany:
    entites_b:
      targetEntity: EntityB
      mappedBy: entity_a
      cascade: [persist]
&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;EntityB:
  type: entity
  table: entity_b
  repositoryClass: EntityBRepository
  id:
    description:
      type: string
      length: 255
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      generator:
        strategy: NONE
    entitiy_a_id:
      type: integer
      length: 11
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      generator:
        strategy: NONE
  fields:
    value:
      type: string
      length: 255
  manyToOne:
    entitiy_a:
      targetEntity: EntitiyA
      inversedBy: entities_b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; EntityA
{
    &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; $handle;
    
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $b_coll;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addB(EntityB $ent) 
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b_coll-&amp;gt;add($ent);
        $b-&amp;gt;setA($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; EntityB
{
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $description;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $entity_a_id;
    
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $value;
    
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $entity_a;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setA(EntityA $ent)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entity_a = $ent;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;If you try to persist an object of A holding one or more references to objects of B, the objects get correctly persistet. This means, that every inserted record of B has a correctly filled field &quot;entity_a_id&quot;. The objects of B also have a correct reference to A holding now the new A record with its autoinc id.&lt;br/&gt;
But the object property &quot;entity_a_id&quot; stays empty. This leads to a collection of unusable EntityB objects (in memory), since on another persist of EntityA the values of entity_a_id are still not set correctly but the state is managed which leads to an &quot;update B ... where entity_a_id=0&quot;&lt;br/&gt;
We&apos;ve tried to set the entity_a_id with an event handler on postPersist. On a persist of EntityA the collection entities wanted to update their entity_a_ids from 0 to the correct one.&lt;/p&gt;
</description>
                <environment>Doctrine 2 RC 1 with sfDoctrine2Plugin using ORM, DBAL, Common and Symfony/Component for RC 1</environment>
            <key id="12212">DDC-922</key>
            <summary>Persisting an entity with an 1:n collection of related entites fails if the FK ist part of a composite PK</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10344">DDC-117</parent>
                        <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="branleb">Florian Zumkeller-Quast</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Dec 2010 11:52:36 +0000</created>
                <updated>Sun, 2 Jan 2011 06:05:33 +0000</updated>
                    <resolved>Sun, 2 Jan 2011 06:05:33 +0000</resolved>
                            <version>2.0-RC1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14941" author="beberlei" created="Fri, 10 Dec 2010 03:20:44 +0000"  >&lt;p&gt;Fixed formating&lt;/p&gt;</comment>
                    <comment id="14942" author="beberlei" created="Fri, 10 Dec 2010 03:22:35 +0000"  >&lt;p&gt;When dealing with foreign keys as composite keys you are currently forced to make use of the &quot;Assigned Id Generator&quot;.&lt;/p&gt;

&lt;p&gt;This means you have to make sure the IDs are set to their values before calling -&amp;gt;persist().&lt;/p&gt;</comment>
                    <comment id="14943" author="beberlei" created="Fri, 10 Dec 2010 03:23:48 +0000"  >&lt;p&gt;This issue will be fixed when &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; is merged into master. That will happen for the 2.1 release.&lt;/p&gt;</comment>
                    <comment id="15097" author="beberlei" created="Sun, 2 Jan 2011 06:05:33 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-881] DDC-117: Linked Objects with composite key</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-881</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m currently playing around with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt;. I came across a general&lt;br/&gt;
problem which occurs with relations.&lt;/p&gt;

&lt;p&gt;Given the following two classes, should a&lt;br/&gt;
@OneToOne/@OneToMany/@ManyToMany relation consider a composite ID or is&lt;br/&gt;
that not planned with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;In the past, we assumed that an object is identified unique with an @Id&lt;br/&gt;
column. However, if we support composite keys, an object needs to be&lt;br/&gt;
identified by two or more columns, which we need to take into&lt;br/&gt;
consideration when building queries and foreign keys. Is that correct?&lt;/p&gt;

&lt;div class=&quot;code panel&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 Document {
	/**
	 * @Id
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

	/**
	 * @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; $version;

	/**
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Content&quot;&lt;/span&gt;)
	 * Enter description here ...
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; unknown_type
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $content;
}

/**
 * @Entity
 */
class Content {
	/**
	 * @Id
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

	/**
	 * @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; $version;

	/**
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Document&quot;&lt;/span&gt;)
	 */

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

&lt;p&gt;I know this might become a bit tricky, because $content refers to a&lt;br/&gt;
single instance of Content, but we actually need two columns to identify&lt;br/&gt;
it. That&apos;s how it looks if generated with Doctrine2 (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt;):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;mysql&amp;gt; describe Document;
+------------+---------+------+-----+---------+-------+
| Field      | Type    | Null | Key | Default | Extra |
+------------+---------+------+-----+---------+-------+
| id         | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| version    | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| content_id | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | YES  | MUL | NULL    |       |
+------------+---------+------+-----+---------+-------+
&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;mysql&amp;gt; describe Content;
+-------------+---------+------+-----+---------+-------+
| Field       | Type    | Null | Key | Default | Extra |
+-------------+---------+------+-----+---------+-------+
| id          | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| version     | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| document_id | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | YES  | MUL | NULL    |       |
+-------------+---------+------+-----+---------+-------+
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;However, to make my example work, the tables would need to look the&lt;br/&gt;
following:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;mysql&amp;gt; describe Content;
+------------------+---------+------+-----+---------+-------+
| Field            | Type    | Null | Key | Default | Extra |
+------------------+---------+------+-----+---------+-------+
| id               | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| version          | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| document_id      | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | YES  | MUL | NULL    |       |
| document_version | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | YES  |     | NULL    |       |
+------------------+---------+------+-----+---------+-------+
&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;mysql&amp;gt; describe Document;
+-----------------+---------+------+-----+---------+-------+
| Field           | Type    | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+-------+
| id              | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| version         | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | NO   | PRI | NULL    |       |
| content_id      | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | YES  | MUL | NULL    |       |
| content_version | &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) | YES  |     | NULL    |       |
+-----------------+---------+------+-----+---------+-------+
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;It would be nice if we could discuss this one, as I feel it is important for an ORM.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12121">DDC-881</key>
            <summary>DDC-117: Linked Objects with composite key</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10344">DDC-117</parent>
                        <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Nov 2010 03:20:26 +0000</created>
                <updated>Sun, 2 Jan 2011 06:05:12 +0000</updated>
                    <resolved>Sun, 2 Jan 2011 06:05:12 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14775" author="beberlei" created="Thu, 18 Nov 2010 03:25:13 +0000"  >&lt;p&gt;Hm i think this issue appears becaues &quot;version&quot; in your mapping is defined twice in the &quot;Content&quot; entity.&lt;/p&gt;

&lt;p&gt;You have rename the join column and it should work. Howevr ClassMetadata should throw an exception.&lt;/p&gt;</comment>
                    <comment id="14776" author="felicitus" created="Thu, 18 Nov 2010 03:28:22 +0000"  >&lt;p&gt;So in theory, doctrine should handle my example with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt;? Will try that out later with unique field names and report back. If that would work already, this would be amazing!&lt;/p&gt;</comment>
                    <comment id="14778" author="beberlei" created="Thu, 18 Nov 2010 03:34:19 +0000"  >&lt;p&gt;btw your mapping is somewhat wrong. you cannot have two @ManyToOne that connect the same two entities with each other. One has to be @OneToMany&lt;/p&gt;</comment>
                    <comment id="14806" author="felicitus" created="Wed, 24 Nov 2010 10:30:35 +0000"  >&lt;p&gt;Benjamin, I finally had time to check out more things. In fact, Doctrine with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; completely ignores multiple foreign keys.&lt;/p&gt;

&lt;p&gt;Even if I replace @ManyToOne with @OneToMany, and version with fversion in Content, Doctrine still only creates a reference (and columns!) with content_id only. I would have expected that that I find at least content_id and content_version within the Document table&lt;/p&gt;

&lt;p&gt;I also tried to specify mappedBy=&quot;document,version&quot;, but this also didn&apos;t work.&lt;/p&gt;

&lt;p&gt;So again the question: Is my initial example meant to be possible with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt;, or is it not?&lt;/p&gt;
</comment>
                    <comment id="14807" author="felicitus" created="Wed, 24 Nov 2010 11:11:13 +0000"  >&lt;p&gt;I just created a better test.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;User.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * @Entity
 */
class User {
	/**
	 * @Id
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;
	
	/**
	 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;PhoneNumber&quot;&lt;/span&gt;,mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $phoneNumbers;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;PhoneNumber.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * @Entity
 */
class PhoneNumber {
	/**
	 * @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;
	
	/**
	 * @Id
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;,cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $user;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $phonenumber;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setId ($id) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id = $id;
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUser (User $user) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user = $user;
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setPhoneNumber ($phoneNumber) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;phonenumber = $phoneNumber;
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;PhoneCall.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php 
/**
 * @Entity
 */
class PhoneCall {
	/**
	 * @Id
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
	
	/**
	 * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;PhoneNumber&quot;&lt;/span&gt;,cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $phonenumber;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;,nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $callDate;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setPhoneNumber (PhoneNumber $phoneNumber) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;phonenumber = $phoneNumber;
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is a very basic mapping example, where one user may have many phone numbers. Also we have a PhoneCall entity which stores the call made. Since a single phone number isn&apos;t just identified by id, but also by user_id, Doctrine should create two fields in PhoneCall for that relation: phonenumber_id and phonenumber_user_id, so that we can retrieve the PhoneNumber object by PhoneCall&apos;s phonenumber property.&lt;/p&gt;

&lt;p&gt;If you agree that my example should be working, I&apos;m willing to write a test case and see if I can contribute code to make that happen.&lt;/p&gt;</comment>
                    <comment id="14808" author="felicitus" created="Wed, 24 Nov 2010 12:05:12 +0000"  >&lt;p&gt;I&apos;m preparing a real-world test script; no need to respond for now.&lt;/p&gt;</comment>
                    <comment id="14837" author="felicitus" created="Thu, 25 Nov 2010 06:13:40 +0000"  >&lt;p&gt;As promised, here&apos;s the real-world test script. Note that I adjusted the code for the example entities due to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-891&quot; title=&quot;DDC-117: No sequence generation with composite foreign key&quot;&gt;DDC-891&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Test Script&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/* Create two test users: albert and alfons */
$albert = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User;
$albert-&amp;gt;setName(&lt;span class=&quot;code-quote&quot;&gt;&quot;albert&quot;&lt;/span&gt;);
$em-&amp;gt;persist($albert);

$alfons = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User;
$alfons-&amp;gt;setName(&lt;span class=&quot;code-quote&quot;&gt;&quot;alfons&quot;&lt;/span&gt;);
$em-&amp;gt;persist($alfons);

/* Assign two phone numbers to each user */
$phoneAlbert1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PhoneNumber();
$phoneAlbert1-&amp;gt;setUser($albert);
$phoneAlbert1-&amp;gt;setId(1);
$phoneAlbert1-&amp;gt;setPhoneNumber(&lt;span class=&quot;code-quote&quot;&gt;&quot;albert home: 012345&quot;&lt;/span&gt;);
$em-&amp;gt;persist($phoneAlbert1);

$phoneAlbert2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PhoneNumber();
$phoneAlbert2-&amp;gt;setUser($albert);
$phoneAlbert2-&amp;gt;setId(2);
$phoneAlbert2-&amp;gt;setPhoneNumber(&lt;span class=&quot;code-quote&quot;&gt;&quot;albert mobile: 67890&quot;&lt;/span&gt;);
$em-&amp;gt;persist($phoneAlbert2);

$phoneAlfons1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PhoneNumber();
$phoneAlfons1-&amp;gt;setId(1);
$phoneAlfons1-&amp;gt;setUser($alfons);
$phoneAlfons1-&amp;gt;setPhoneNumber(&lt;span class=&quot;code-quote&quot;&gt;&quot;alfons home: 012345&quot;&lt;/span&gt;);
$em-&amp;gt;persist($phoneAlfons1);

$phoneAlfons2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PhoneNumber();
$phoneAlfons2-&amp;gt;setId(2);
$phoneAlfons2-&amp;gt;setUser($alfons);
$phoneAlfons2-&amp;gt;setPhoneNumber(&lt;span class=&quot;code-quote&quot;&gt;&quot;alfons mobile: 67890&quot;&lt;/span&gt;);
$em-&amp;gt;persist($phoneAlfons2);

/* We call alfons and albert once on their mobile numbers */
$call1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PhoneCall();
$call1-&amp;gt;setPhoneNumber($phoneAlfons2);
$em-&amp;gt;persist($call1);

$call2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PhoneCall();
$call2-&amp;gt;setPhoneNumber($phoneAlbert2);
$em-&amp;gt;persist($call2);

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

&lt;p&gt;During the flush, Doctrine fails with&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Integrity constraint violation: 1062 Duplicate entry &apos;2&apos; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; key &apos;PhoneCall_phonenumber_id_uniq&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;because Doctrine does not create the composite primary key (which is id and user_id) as foreign key (Doctrine only adds  id).&lt;/p&gt;</comment>
                    <comment id="15048" author="beberlei" created="Tue, 28 Dec 2010 16:34:58 +0000"  >&lt;p&gt;The problem here is your @OneToOne relation. It implicitly sets a unique index. The primary key generated by your mapping is ok.&lt;/p&gt;

&lt;p&gt;Try to modify your code stating @OneToOne(unique=false)&lt;/p&gt;

&lt;p&gt;Additionally you have to specifiy the join columns. You are using the default, which obviously doesn&apos;t work for a composite approach (that is not default):&lt;/p&gt;

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

    /**
     * @Id
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    /**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;DDC881PhoneNumber&quot;&lt;/span&gt;,cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;})
     * @JoinColumns({
     *  @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;phonenumber_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;),
     *  @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $phonenumber;
    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;,nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $callDate;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setPhoneNumber(DDC881PhoneNumber $phoneNumber)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;phonenumber = $phoneNumber;
    }

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

&lt;p&gt;That would be the right approach if there were not a bug in SchemaTool i need to fix for this to work &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="15052" author="beberlei" created="Wed, 29 Dec 2010 04:31:50 +0000"  >&lt;p&gt;This is a really tricky issue, we need to think about it a little longer.&lt;/p&gt;</comment>
                    <comment id="15096" author="beberlei" created="Sun, 2 Jan 2011 06:05:12 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-966] SchemaTool does not check for inherited fields in STI sub-classes and overwrites their column definitions to DEFAULT NULL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-966</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 * @Table(
 *     name=&lt;span class=&quot;code-quote&quot;&gt;&quot;eav_attribute&quot;&lt;/span&gt;,
 *     uniqueConstraints={
 *         @UniqueConstraint(columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;core_project_id&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;})
 *     }
 * )
 * @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;datatype&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;datetime&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;AttributeDatetime&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;decimal&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;AttributeDecimal&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;AttributeInt&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;AttributeString&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;text&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;AttributeText&quot;&lt;/span&gt;
 * })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class AbstractAttribute
{
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;    
    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;

    /**
     * @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; $is_unique;

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

/**
 * @Entity
 */
class AttributeDatetime &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; AbstractAttribute
{
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected SQL-dump:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;name VARCHAR(255) NOT NULL,
is_unique TINYINT(1) NOT NULL,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;SQL-dump created by SchemaTool:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;name VARCHAR(255) DEFAULT NULL,
is_unique TINYINT(1) DEFAULT NULL,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This behaviour is problematic, especially for columns which are part of a unique constraint.&lt;/p&gt;

&lt;p&gt;Reason:&lt;/p&gt;

&lt;p&gt;SchemaTool doesn&apos;t really check for inherited fields in STI sub classes in method getSchemaFromMetadata() and passes all fields (incl. the inherited) to method _gatherColumn() where finally the column definition of the parent class will be overwritten.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine\ORM\Tools\SchemaTool&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _gatherColumn($class, array $mapping, $table)
{
    &lt;span class=&quot;code-comment&quot;&gt;// Lines 309 - 311
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($class-&amp;gt;isInheritanceTypeSingleTable() &amp;amp;&amp;amp; count($class-&amp;gt;parentClasses) &amp;gt; 0) {
        $options[&apos;notnull&apos;] = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A quick fix:&lt;/p&gt;

&lt;p&gt;Change that if-clause above to&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($class-&amp;gt;isInheritanceTypeSingleTable() &amp;amp;&amp;amp; count($class-&amp;gt;parentClasses) &amp;gt; 0 &amp;amp;&amp;amp; ! isset($mapping[&apos;inherited&apos;])) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;p&gt;Only pass not inherited fields to the _gatherColumn() method, as done with CTI sub classes.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12274">DDC-966</key>
            <summary>SchemaTool does not check for inherited fields in STI sub-classes and overwrites their column definitions to DEFAULT NULL</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="ayhan">ayhan</reporter>
                        <labels>
                    </labels>
                <created>Sat, 1 Jan 2011 12:30:28 +0000</created>
                <updated>Sun, 2 Jan 2011 05:52:25 +0000</updated>
                    <resolved>Sun, 2 Jan 2011 04:19:49 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15088" author="beberlei" created="Sun, 2 Jan 2011 04:19:49 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="15094" author="ayhan" created="Sun, 2 Jan 2011 05:52:25 +0000"  >&lt;p&gt;Wow, that was fast!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-965] Check for ID in CMF should be done after Event invocation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-965</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12272">DDC-965</key>
            <summary>Check for ID in CMF should be done after Event invocation</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, 1 Jan 2011 06:25:31 +0000</created>
                <updated>Sun, 2 Jan 2011 04:25:57 +0000</updated>
                    <resolved>Sun, 2 Jan 2011 04:25:57 +0000</resolved>
                            <version>2.0</version>
                <version>Git Master</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15089" author="beberlei" created="Sun, 2 Jan 2011 04:25:57 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-955] PostgresSQL + No identifier / primary key for Specified Entity &apos;Table&apos;. Every Entity must have for an identifier / primary key.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-955</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;PostgreSQL error map from reverse engineering is not recognized by the primary keys in PostgreSQL and throws the following error: &quot;No identifier / primary key for Specified Entity &apos;Table&apos;. Every Entity must have for an identifier / primary key.&quot;&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="12260">DDC-955</key>
            <summary>PostgresSQL + No identifier / primary key for Specified Entity &apos;Table&apos;. Every Entity must have for an identifier / 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="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="johnksft">John Carlos Espitia Rivera</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Dec 2010 14:23:11 +0000</created>
                <updated>Thu, 30 Dec 2010 17:20:57 +0000</updated>
                    <resolved>Thu, 30 Dec 2010 17:20:57 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15071" author="beberlei" created="Thu, 30 Dec 2010 17:20:57 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-929&quot; title=&quot;A index has to be named as &amp;quot;primary&amp;quot; to be detected Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass()&quot;&gt;&lt;del&gt;DDC-929&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-874] orm:convert-mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-874</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a Postgres SQL database.&lt;br/&gt;
The Base has only one table &quot;User&quot; with two attributes (name and id).&lt;br/&gt;
&quot;Id&quot; is primary key.&lt;/p&gt;

&lt;p&gt;The failure to execute the task:&lt;br/&gt;
php orm doctrine: convert-mapping - from-database yml / home / cristian / database.yml&lt;/p&gt;

&lt;p&gt;is:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine \ ORM \ Mapping \ MappingException&amp;#93;&lt;/span&gt;&lt;br/&gt;
  No identifier / primary key for Specified Entity &apos;User&apos;. Every Entity must have for an identifier / primary key&lt;/p&gt;

&lt;p&gt;Script to create the table:&lt;/p&gt;

&lt;p&gt;CREATE TABLE &quot;User&quot;&lt;br/&gt;
(&lt;br/&gt;
  id serial NOT NULL,&lt;br/&gt;
  name character varying (55),&lt;br/&gt;
  CONSTRAINT &quot;User_pkey&quot; PRIMARY KEY (id)&lt;br/&gt;
)&lt;br/&gt;
WITH (&lt;br/&gt;
  OIDS = FALSE&lt;br/&gt;
)&lt;br/&gt;
ALTER TABLE &quot;User&quot; OWNER TO postgres;&lt;/p&gt;</description>
                <environment>Ubuntu 10.10.</environment>
            <key id="12093">DDC-874</key>
            <summary>orm:convert-mapping</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="csrinaldi">Cristian Rinaldi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2010 14:36:13 +0000</created>
                <updated>Thu, 30 Dec 2010 17:20:15 +0000</updated>
                    <resolved>Thu, 30 Dec 2010 17:20:15 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15070" author="beberlei" created="Thu, 30 Dec 2010 17:20:15 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-929&quot; title=&quot;A index has to be named as &amp;quot;primary&amp;quot; to be detected Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass()&quot;&gt;&lt;del&gt;DDC-929&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
            <subtask id="12224">DDC-929</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-929] A index has to be named as &quot;primary&quot; to be detected Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-929</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Condition&lt;/p&gt;

&lt;p&gt;if (isset($indexes&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; in_array($column-&amp;gt;getName(), $indexes&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getColumns())) {&lt;/p&gt;

&lt;p&gt;needs the primary key to be named as primary. Discovered this when reverse engineering an existing database.&lt;/p&gt;

&lt;p&gt;Fix, that worked for me:&lt;/p&gt;

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


&lt;p&gt;if (isset($indexes&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; in_array($column-&amp;gt;getName(), $indexes&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getColumns())) {&lt;br/&gt;
                $fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt; = true;&lt;/p&gt;

&lt;p&gt;With:&lt;/p&gt;

&lt;p&gt;$primary = false;&lt;/p&gt;

&lt;p&gt;	foreach ($indexes as $index)&lt;br/&gt;
	{&lt;br/&gt;
		if ($index-&amp;gt;isPrimary())&lt;br/&gt;
		{&lt;br/&gt;
			if (in_array($column-&amp;gt;getName(), $index-&amp;gt;getColumns()))&lt;/p&gt;
			{
				$primary = true;
				break;
			}
&lt;p&gt;		}&lt;br/&gt;
	}&lt;/p&gt;

&lt;p&gt;            if ($primary){    &lt;br/&gt;
		$fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt; = true;&lt;/p&gt;</description>
                <environment>FreeBSD, PostgreSQL 8.4</environment>
            <key id="12224">DDC-929</key>
            <summary>A index has to be named as &quot;primary&quot; to be detected Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass()</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12093">DDC-874</parent>
                        <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="teuzz">Jiri Helmich</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Dec 2010 02:33:56 +0000</created>
                <updated>Thu, 30 Dec 2010 17:19:55 +0000</updated>
                    <resolved>Thu, 30 Dec 2010 17:19:55 +0000</resolved>
                            <version>2.0-RC2</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15069" author="beberlei" created="Thu, 30 Dec 2010 17:19:55 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-961] First letters are missing in M:N tables</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-961</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When I define M:N relation and update the schema by SchemaTool then the joining table is created without first letters (e.g. &lt;tt&gt;rticle_ag&lt;/tt&gt; instead of &lt;tt&gt;article_tag&lt;/tt&gt;). Relevant part from the source 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-html&quot;&gt;&amp;lt;?php
/** @entity */
class Article {
	/** @manyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Tag&quot;&lt;/span&gt;) */
	public $tags;
}

/** @entity */
class Tag {
	/** @manyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Article&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;tags&quot;&lt;/span&gt;) */
	public $articles;
}

$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
$tool-&amp;gt;updateSchema(array(
	$em-&amp;gt;getClassMetadata(&apos;Article&apos;),
	$em-&amp;gt;getClassMetadata(&apos;Tag&apos;),
));
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can download the complete example at &lt;a href=&quot;http://www.notorm.com/static/doctrine2-notorm/&quot; class=&quot;external-link&quot;&gt;http://www.notorm.com/static/doctrine2-notorm/&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Windows, MySQL</environment>
            <key id="12266">DDC-961</key>
            <summary>First letters are missing in M:N tables</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="vrana">Jakub Vr&#225;na</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Dec 2010 06:23:55 +0000</created>
                <updated>Thu, 30 Dec 2010 16:32:42 +0000</updated>
                    <resolved>Thu, 30 Dec 2010 16:32:42 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15064" author="beberlei" created="Thu, 30 Dec 2010 16:23:02 +0000"  >&lt;p&gt;Your entities are not namespaced are they?&lt;/p&gt;</comment>
                    <comment id="15065" author="beberlei" created="Thu, 30 Dec 2010 16:32:42 +0000"  >&lt;p&gt;Yes, this is related to entities in global namespaces only. That is why nobody realized it before.&lt;/p&gt;

&lt;p&gt;Fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-795] Wrong SQL statement when using loadOneToManyCollection</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-795</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the following SQL&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
CREATE TABLE `article` (
  `articleID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL AUTO_INCREMENT,
  `reference` varchar(255) DEFAULT NULL,
  `addDt` datetime DEFAULT NULL,
  PRIMARY KEY (`articleID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


CREATE TABLE `articleRelated` (
  `articleID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  `relatedArticleID` &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(11) NOT NULL,
  PRIMARY KEY (`articleID`,`relatedArticleID`),
  KEY `a1` (`articleID`),
  KEY `a2` (`relatedArticleID`),
  CONSTRAINT `a1` FOREIGN KEY (`articleID`) REFERENCES `article` (`articleID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `a2` FOREIGN KEY (`relatedArticleID`) REFERENCES `article` (`articleID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And these 2 models&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Article.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * Model &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; article
 * 
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;article&quot;&lt;/span&gt;) 
 * @Entity
 */
class App_Model_Article
{

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer articleID
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;articleID&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) 
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;) 
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_articleID = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string reference
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;reference&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, length=255)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_reference = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; datetime addDt
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;addDt&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_addDt = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_ArticleRelated&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_article&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_articleRelatedRefArticle = array();

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_ArticleRelated&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_relatedArticle&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_articleRelatedRefRelatedArticle = array();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;ArticleRelated.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php

/**
 * Model &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; articleRelated
 * 
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;articleRelated&quot;&lt;/span&gt;) 
 * @Entity
 */
class App_Model_ArticleRelated
{

    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_Article&quot;&lt;/span&gt;) 
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;articleID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;articleID&quot;&lt;/span&gt;) 
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_article = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_Article&quot;&lt;/span&gt;) 
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;relatedArticleID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;articleID&quot;&lt;/span&gt;) 
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_relatedArticle = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I do the following &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$firstArticle = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_entityManager-&amp;gt;find(&apos;App_Model_Article&apos;, 54);
      
$related = $firstArticle-&amp;gt;getArticleRelated(&apos;article&apos;);
foreach ($related as $art) {
       	var_dump($art);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;it generates the following 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 , t1.articleID AS articleID0, t1.relatedArticleID AS relatedArticleID2 FROM articleRelated t1 WHERE articleID = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I tracked the problem down to the following method&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Doctrine/ORM/Persisters/BasicEntityPersister.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _getSelectColumnListSQL()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_selectColumnListSql !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_selectColumnListSql;
        }

        $columnList = &apos;&apos;;

        &lt;span class=&quot;code-comment&quot;&gt;// Add regular columns to select list
&lt;/span&gt;        foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;fieldNames as $field) {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($columnList) $columnList .= &apos;, &apos;;
            $columnList .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getSelectColumnSQL($field, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class);
        }

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_selectColumnListSql = $columnList . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getSelectJoinColumnsSQL($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class);
		
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_selectColumnListSql;
    }
&lt;span class=&quot;code-comment&quot;&gt;//....&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Because $this-&amp;gt;_class-&amp;gt;fieldNames is empty for my class, $columnList will also be empty. &lt;br/&gt;
$this-&amp;gt;_getSelectJoinColumnsSQL($this-&amp;gt;_class) generates &lt;br/&gt;
&quot;, t1.articleID AS articleID0, t1.relatedArticleID AS relatedArticleID2&quot;&lt;br/&gt;
so $this-&amp;gt;_selectColumnListSql == &quot;, t1.articleID AS articleID0, t1.relatedArticleID AS relatedArticleID2&quot;&lt;/p&gt;

&lt;p&gt;I fixed the problem by adding trim:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_selectColumnListSql = trim($columnList . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getSelectJoinColumnsSQL($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class), &apos;,&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11898">DDC-795</key>
            <summary>Wrong SQL statement when using loadOneToManyCollection</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10344">DDC-117</parent>
                        <priority id="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="tbo">Van Hauwaert Bert</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Sep 2010 06:07:26 +0000</created>
                <updated>Tue, 28 Dec 2010 13:06:22 +0000</updated>
                    <resolved>Tue, 28 Dec 2010 13:06:22 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14315" author="beberlei" created="Fri, 10 Sep 2010 02:49:31 +0000"  >&lt;p&gt;Foreign Keys as Primary Keys are currently not supported (except for the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; experimental branch, scheduled for 2.1)&lt;/p&gt;

&lt;p&gt;See: &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/limitations-and-known-issues/en#current-limitations:foreign-keys-as-identifiers&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/limitations-and-known-issues/en#current-limitations:foreign-keys-as-identifiers&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14320" author="tbo" created="Fri, 10 Sep 2010 12:19:43 +0000"  >&lt;p&gt;Sorry Benjamin, I should have mentioned that I work with that branch. &lt;/p&gt;</comment>
                    <comment id="14346" author="beberlei" created="Sun, 12 Sep 2010 03:41:04 +0000"  >&lt;p&gt;Ah ok, i&apos;ll move and downgrade priority because there is so much to do on the master branch before release.&lt;/p&gt;</comment>
                    <comment id="15047" author="beberlei" created="Tue, 28 Dec 2010 13:06:22 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; branch.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="10344">DDC-117</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-837] Two children in inheritance with same property name causes error in hydration</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-837</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-258&quot; title=&quot;DiscriminatorMap Ordering Affects Mapping&quot;&gt;&lt;del&gt;DDC-258&lt;/del&gt;&lt;/a&gt;.  The issue seems to be fixed with regular column types (string, int, etc) but the same issue has cropped up when we have a OneToOne relationship in two child classes that share the same property name.  I have modified the DDC258TestCase class to demonstrate the error.&lt;/p&gt;

&lt;p&gt;To summarize: two classes that inherit from the same class happen to have a property with the same name.  Both of them are oneToOne relationships.  Querying for the objects, one object type (depending on discriminatorMap order) will be hydrate correctly but the other will always be null.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12001">DDC-837</key>
            <summary>Two children in inheritance with same property name causes error in hydration</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="mridgway">Michael Ridgway</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Oct 2010 14:59:37 +0000</created>
                <updated>Tue, 28 Dec 2010 08:59:35 +0000</updated>
                    <resolved>Tue, 28 Dec 2010 08:59:35 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14558" author="beberlei" created="Wed, 13 Oct 2010 02:07:04 +0000"  >&lt;p&gt;This is not a bug, its documented behavior and is technically not feasible.&lt;/p&gt;</comment>
                    <comment id="14560" author="mridgway" created="Wed, 13 Oct 2010 09:19:26 +0000"  >&lt;p&gt;Why would this not be feasible on relationships even though it is on regular column types?  I feel like this is the same issue as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-258&quot; title=&quot;DiscriminatorMap Ordering Affects Mapping&quot;&gt;&lt;del&gt;DDC-258&lt;/del&gt;&lt;/a&gt;.  I understand a child can&apos;t have a property named the same as the parent&apos;s, but two children should be able to have properties with the same name (and currently can if it&apos;s not a relationship).&lt;/p&gt;</comment>
                    <comment id="14568" author="beberlei" created="Thu, 14 Oct 2010 13:52:23 +0000"  >&lt;p&gt;oh maybe i am wrong &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="15042" author="beberlei" created="Tue, 28 Dec 2010 08:59:35 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10823" name="DDC258Test.php" size="5354" author="mridgway" created="Tue, 12 Oct 2010 14:59:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-928] Using uninitialised variable in lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-928</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A call:&lt;/p&gt;

&lt;p&gt;$metadata-&amp;gt;setSequenceGeneratorDefinition($definition);&lt;/p&gt;

&lt;p&gt;is performed a line above the definition of the $definition variable.&lt;/p&gt;

&lt;p&gt;Fix: Switch those two lines:&lt;/p&gt;

&lt;p&gt;//          $metadata-&amp;gt;setSequenceGeneratorDefinition($definition); //was here&lt;br/&gt;
            $definition = array(&lt;br/&gt;
                &apos;sequenceName&apos; =&amp;gt; is_array($column&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;sequence&amp;#39;&amp;#93;&lt;/span&gt;) ? $column&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;sequence&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;:$column&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;sequence&amp;#39;&amp;#93;&lt;/span&gt;&lt;br/&gt;
            );&lt;br/&gt;
            $metadata-&amp;gt;setSequenceGeneratorDefinition($definition); //belongs here&lt;/p&gt;

&lt;p&gt;On line 191 in RC2 release.&lt;/p&gt;</description>
                <environment>FreeBSD</environment>
            <key id="12223">DDC-928</key>
            <summary>Using uninitialised variable in lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="teuzz">Jiri Helmich</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Dec 2010 02:14:30 +0000</created>
                <updated>Tue, 28 Dec 2010 06:20:48 +0000</updated>
                    <resolved>Tue, 28 Dec 2010 06:20:48 +0000</resolved>
                            <version>2.0-RC2</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15037" author="beberlei" created="Tue, 28 Dec 2010 06:20:48 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-617] ObjectHydrator issue with OneToMany relationship</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-617</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m pretty new to this ORM thing but I am having a weird issue with a DQL query I think should work (or throw an exception). I have the following code:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;namespace Lms\Entities;
/**
 *
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;)
 */
class User {

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __constructor() {
		$social_media_links = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection;
	}
	/**
	 * @Id
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
	 * @GeneratedValue
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=TRUE, length=1024) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $mission_statement;

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

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

	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=TRUE, length=8) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $initial;

	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=TRUE) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $email;

	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=TRUE) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $company;

	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=TRUE, length=1024) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $picture;

	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;text&quot;&lt;/span&gt;, nullable=TRUE) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $bio;

	&lt;span class=&quot;code-comment&quot;&gt;// unidirectional one to many relationship with social media link
&lt;/span&gt;	/**
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;SocialMediaLink&quot;&lt;/span&gt;)
	 * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Users_Socialmedialinks&quot;&lt;/span&gt;,
	 *      joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)},
	 *      inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;socialmedialink_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)}
	 *      )
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $social_media_links;
	

    /**
     * Add social_media_links
     *
     * @param SocialMediaLink $socialMediaLinks
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addSocialMediaLinks(\SocialMediaLink $socialMediaLinks)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;social_media_links[] = $socialMediaLinks;
    }

    /**
     * Get social_media_links
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine\Common\Collections\Collection $socialMediaLinks
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSocialMediaLinks()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;social_media_links;
    }
}
&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;namespace Lms\Entities;

/**
 *
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;SocialMediaLink&quot;&lt;/span&gt;)
 */
class SocialMediaLink {

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

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

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

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

&lt;p&gt;And when I execute:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;		$sml = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT s FROM Lms\Entities\User u JOIN u.social_media_links  AS s WHERE u.id = ?1 AND s.id = ?2&quot;&lt;/span&gt;)
					-&amp;gt;setParameter(1, 1)
					-&amp;gt;setParameter(2, 1)
					-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I get the following trace:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;1) DoctrineExtensions\PHPUnit\UserTestCase::testEditSocialMediaLink
class_parents(): object or string expected

C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\Mapping\ClassMetadataFactory.php:201
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\Mapping\ClassMetadataFactory.php:224
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\Mapping\ClassMetadataFactory.php:148
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\EntityManager.php:235
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php:220
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php:75
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\Internal\Hydration\AbstractHydrator.php:98
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\AbstractQuery.php:530
C:\xampp\htdocs\lms-user-sml-feature\system\application\libraries\Doctrine\ORM\AbstractQuery.php:360
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following data is in the database:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-xml&quot;&gt;&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;dataset&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;table name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;id&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;mission_Statement&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;first_name&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;last_name&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;initial&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;email&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;company&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;picture&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;bio&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;row&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;Mission Statement 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;First Name 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;Last Name 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;IN1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;email1@email.com&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;Company 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;Picture 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;Bio 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/row&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
	
	&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;table name=&lt;span class=&quot;code-quote&quot;&gt;&quot;socialmedialink&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;id&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;title&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;link&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;

		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;row&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;Social Media Title 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;Social Media Link 1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/row&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
	
	&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;table name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users_socialmedialinks&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;user_id&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;column&amp;gt;&lt;/span&gt;socialmedialink_id&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;

		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;row&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;1&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/row&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/dataset&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>XAMPP 1.7.3 on Windows Vista</environment>
            <key id="11427">DDC-617</key>
            <summary>ObjectHydrator issue with OneToMany relationship</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="numan">Numan S</reporter>
                        <labels>
                    </labels>
                <created>Sun, 30 May 2010 17:01:11 +0000</created>
                <updated>Tue, 28 Dec 2010 04:25:07 +0000</updated>
                    <resolved>Tue, 28 Dec 2010 04:25:07 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13084" author="numan" created="Sun, 30 May 2010 18:22:47 +0000"  >&lt;p&gt;After messing around with it a little bit, the following will work:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;	
		$sml = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT u,s FROM Lms\Entities\User u JOIN u.social_media_links AS s WHERE u.id = ?1 AND s.id = ?2&quot;&lt;/span&gt;)
					-&amp;gt;setParameter(1, 1)
					-&amp;gt;setParameter(2, 1)
					-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13824" author="romanb" created="Sat, 7 Aug 2010 07:26:59 +0000"  >&lt;p&gt;Hydration does not (yet?) support such kinds of queries where the root entity/schema name is not selected.&lt;/p&gt;</comment>
                    <comment id="14394" author="beberlei" created="Wed, 15 Sep 2010 16:32:32 +0000"  >&lt;p&gt;@roman i think this should be solved in conjunction with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-736&quot; title=&quot;Nasty ordering issue with fetch-joins&quot;&gt;&lt;del&gt;DDC-736&lt;/del&gt;&lt;/a&gt; and throw an exception if the users tries to do this. Is this possible in linear time?&lt;/p&gt;</comment>
                    <comment id="15029" author="beberlei" created="Tue, 28 Dec 2010 04:25:07 +0000"  >&lt;p&gt;Fixed, a QueryException will now be thrown if attempting to select one or more identification variables without picking at least one root.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10620" name="SocialMediaLink.php" size="1149" author="numan" created="Sun, 30 May 2010 17:01:11 +0000" />
                    <attachment id="10619" name="User.php" size="6871" author="numan" created="Sun, 30 May 2010 17:01:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-931] SchemaTool-&gt;dropSchema fails if the given schema doesn&apos;t exist</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-931</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;SchemaTool-&amp;gt;dropSchema&apos;s documentation says:&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; 
Drops the database schema for the given classes.

In any way when an exception is thrown it is supressed since drop was issued for all classes of the schema and some probably just don&apos;t exist.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;However, with a recent upgrade to 2.0-RC2, this doesn&apos;t work anymore. A PDO exception isn&apos;t caught if the specified table doesn&apos;t exist already.&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; 
exception &apos;PDOException&apos; with message &apos;SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table &apos;UserAddress&apos;&apos; in /usr/share/php/Doctrine/DBAL/Connection.php:577
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;I&apos;m not sure if this was caused by the ORM update or if it&apos;s maybe somewhere inside DBAL, which I upgraded at the same time.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12227">DDC-931</key>
            <summary>SchemaTool-&gt;dropSchema fails if the given schema doesn&apos;t exist</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Dec 2010 18:59:32 +0000</created>
                <updated>Wed, 22 Dec 2010 17:11:12 +0000</updated>
                    <resolved>Wed, 22 Dec 2010 17:11:12 +0000</resolved>
                            <version>2.0-RC2</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14998" author="beberlei" created="Wed, 22 Dec 2010 17:11:12 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-944] MappingException::mappingNotFound() calls are wrong in ClassMetadataInfo</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-944</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As you can see in:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php&lt;/a&gt;&lt;br/&gt;
and:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/MappingException.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/MappingException.php&lt;/a&gt;&lt;br/&gt;
mappingNotFound() accepts now only 1 argument, but is called with 2; this leads to cryptic errors when the a field does not exist like:&lt;br/&gt;
Doctrine\ORM\Mapping\MappingException: No mapping found for field &apos;EntityClassName&apos;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12242">DDC-944</key>
            <summary>MappingException::mappingNotFound() calls are wrong in ClassMetadataInfo</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="giorgiosironi">Giorgio Sironi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Dec 2010 03:56:57 +0000</created>
                <updated>Tue, 21 Dec 2010 18:29:21 +0000</updated>
                    <resolved>Tue, 21 Dec 2010 18:29:21 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14993" author="beberlei" created="Tue, 21 Dec 2010 18:29:21 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>