<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed May 22 20:42:43 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.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.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="23" total="23"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-1268] generate:entities creates bad method names with OneToMany</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1268</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi. I noticed a minor bug in the &lt;b&gt;generate:entities&lt;/b&gt; console task. I&apos;ve got a &lt;b&gt;Region&lt;/b&gt; entity that had the following property:&lt;/p&gt;

&lt;div class=&quot;code panel&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\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;District&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;region&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $districts;

&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;districts = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I ran the &lt;b&gt;generate:entities&lt;/b&gt; task it created the following methods:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * Add districts
 *
 * @param Fenix\StudyBundle\Entity\District $districts
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addDistricts(\Fenix\StudyBundle\Entity\District $districts)
{
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;districts[] = $districts;
}

/**
 * Get districts
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine\Common\Collections\Collection 
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDistricts()
{
    &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;districts;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The second method&apos;s name is correct, but what about &lt;b&gt;addDistricts&lt;/b&gt;? Since it allows me to add a single &lt;b&gt;District&lt;/b&gt; entity it should be as follows:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * Add district
 *
 * @param Fenix\StudyBundle\Entity\District $district
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addDistrict(\Fenix\StudyBundle\Entity\District $district)
{
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;districts[] = $district;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In other words, the term after &quot;add&quot; (as well as the parameter&apos;s name) should be the entity&apos;s name, not the property&apos;s one.&lt;/p&gt;</description>
                <environment>Ubuntu 11.04, PHP 5.3.5, Symfony 2.0 RC4</environment>
            <key id="12812">DDC-1268</key>
            <summary>generate:entities creates bad method names with OneToMany</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="alessandro1997">Alessandro Desantis</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jul 2011 09:53:55 +0000</created>
                <updated>Tue, 4 Dec 2012 09:22:06 +0000</updated>
                    <resolved>Tue, 12 Jul 2011 21:50:05 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16140" author="beberlei" created="Mon, 11 Jul 2011 10:04:43 +0000"  >&lt;p&gt;The problem is that making singular out of a word is not an easy task and i will not try to make this work somehow. The Entity Generator result is a helper, not necessarily generating the final result of a class. This is one case where the Code Generation will not nmake you happy, so just change it.&lt;/p&gt;</comment>
                    <comment id="16141" author="alessandro1997" created="Mon, 11 Jul 2011 11:28:47 +0000"  >&lt;p&gt;Couldn&apos;t you just use the target Entity&apos;s name (and not the property&apos;s one) in the &quot;add&quot; method?&lt;/p&gt;</comment>
                    <comment id="16142" author="beberlei" created="Mon, 11 Jul 2011 11:39:29 +0000"  >&lt;p&gt;The shortname you mean? Yeah that would be an option you are right, i reopen the ticket&lt;/p&gt;</comment>
                    <comment id="16162" author="beberlei" created="Tue, 12 Jul 2011 21:50:05 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;

&lt;p&gt;This is sort of a BC break for 2.1, however since this is just a tool and generating code i think its acceptable&lt;/p&gt;</comment>
                    <comment id="16165" author="alessandro1997" created="Tue, 12 Jul 2011 23:47:04 +0000"  >&lt;p&gt;Thanks a lot &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="16199" author="matthewmatician" created="Sat, 23 Jul 2011 21:36:05 +0000"  >&lt;p&gt;Another option for a semantic method name would be to use &apos;addTo&apos; as the prefix, as in &apos;addToDistricts&apos;.&lt;/p&gt;

&lt;p&gt;The problem with using the target Entity&apos;s name (instead of the property&apos;s) is that sometimes you need to have multiple properties that map to the same target Entity.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1098] Cascading delete is broken for all relationships other than inheritance relationships, at least on MySQL 5.0</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1098</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The console tools do not generate the proper DDL statements for the constraints declared as part of the relationship annotations.&lt;/p&gt;

&lt;p&gt;Take this entity field declaration, e.g. :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;     /**
  * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;\persistentData\model\core\invoiceCreator\AnalogOrderInvoiceLineItem&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;partialInvoice&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;})
  */

 &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $analogOrderInvoiceLineItems;
 &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This declaration should generate some sort of ON DELETE CASCADE constraint, or at least actually cascade the delete, in whatever way. It does not. I reviewed the generated DDL statements with &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;doctrine orm:schema-tool:create --dump-sql
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And it clearly showed that no &quot;ON DELETE CASCADE&quot; was generated. Neither did Doctrine 2 perform a cascading delete otherwise.&lt;/p&gt;

&lt;p&gt;The delete simply does not cascade.&lt;/p&gt;


&lt;p&gt;Subsequently, I end up getting errors like:&lt;/p&gt;

&lt;p&gt;Exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails &lt;br/&gt;
(`invoiceCreatorDB/AnalogOrderInvoiceLineItem`, CONSTRAINT `AnalogOrderInvoiceLineItem_ibfk_1` FOREIGN KEY (`partialInvoice_dbID`) REFERENCES `PartialInvoice` (`dbID`))&apos;&lt;/p&gt;


&lt;p&gt;The query that caused the error is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;DELETE FROM PartialInvoice where dbID = &apos;2&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;(PartialInvoice is the entity containing the above field declaration).&lt;/p&gt;


&lt;p&gt;It seems that the cascading delete feature is fundamentally broken.&lt;/p&gt;</description>
                <environment>Debian Linux 6.0, MySQL 5.0.51a</environment>
            <key id="12528">DDC-1098</key>
            <summary>Cascading delete is broken for all relationships other than inheritance relationships, at least on MySQL 5.0</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Apr 2011 05:46:55 +0000</created>
                <updated>Tue, 27 Sep 2011 14:37:45 +0000</updated>
                    <resolved>Tue, 27 Sep 2011 14:37:45 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15677" author="beberlei" created="Mon, 4 Apr 2011 06:20:03 +0000"  >&lt;p&gt;This is expected, cascade remove is working with in memory instances of the to be deleted objects. This way lifecycle events are triggered.&lt;/p&gt;

&lt;p&gt;If you want to perform this operation on the databse level you have to set onDelete=&quot;CASCADE&quot; as an option of the join column:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-joincolumn&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-joincolumn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This difference should be explained in the docs on Working with Associations, 8.6 Transitive persistence / Cascade Operations i guess.&lt;/p&gt;</comment>
                    <comment id="15683" author="dalvarez" created="Tue, 5 Apr 2011 05:38:14 +0000"  >&lt;p&gt;Good idea.&lt;/p&gt;

&lt;p&gt;I believe that it is normal to expect that declared cascade behaviours refer to persistent state, and not only to in-memory object graphs.&lt;/p&gt;


&lt;p&gt;That declared cascade behaviours are only applicable to objects in main memory is a fundamental limitation that&lt;/p&gt;

&lt;p&gt;1) should be prominently documented, whereas, as of now, the information it is not visible at all&lt;/p&gt;

&lt;p&gt; 2) is IMO a highly questionable design in the first place, considering the principal focus of a ORM-solution as an interface to access &lt;b&gt;persistent&lt;/b&gt; data&lt;/p&gt;


&lt;p&gt;The current documentation states:&lt;/p&gt;

&lt;p&gt;&quot;Persisting, removing, detaching and merging individual entities can become pretty cumbersome, especially when a large object graph with collections is involved. Therefore Doctrine 2 provides a mechanism for transitive persistence through cascading of these operations. Each association to another entity or a collection of entities can be configured to automatically cascade certain operations. By default, no operations are cascaded.&lt;/p&gt;

&lt;p&gt;The following cascade options exist:&lt;/p&gt;

&lt;p&gt;persist : Cascades persist operations to the associated entities.&lt;br/&gt;
remove : Cascades remove operations to the associated entities.&lt;br/&gt;
merge : Cascades merge operations to the associated entities.&lt;br/&gt;
detach : Cascades detach operations to the associated entities.&lt;br/&gt;
all : Cascades persist, remove, merge and detach operations to associated entities.&quot;&lt;/p&gt;


&lt;p&gt;How are users supposed to understand, that the &quot;remove&quot; option is limited to in-memory object graphs, if all the docs say is &quot;Cascades remove operations to the associated entities.&quot;. From a user standpoint, the entities &lt;b&gt;are&lt;/b&gt; associated, and even the more so being persistent, aren&apos;t they?&lt;/p&gt;</comment>
                    <comment id="15684" author="dalvarez" created="Tue, 5 Apr 2011 05:38:52 +0000"  >&lt;p&gt;Also, we obviously have a different understanding of the word &quot;fixed&quot;.&lt;/p&gt;</comment>
                    <comment id="15686" author="beberlei" created="Tue, 5 Apr 2011 07:35:10 +0000"  >&lt;p&gt;Persist remove works, it fetches the association and deletes the objects, pulling them into memory.&lt;/p&gt;

&lt;p&gt;As to the ticket, i wanted to mark it as invalid and must have missclicked.&lt;/p&gt;</comment>
                    <comment id="15691" author="dalvarez" created="Tue, 5 Apr 2011 18:20:26 +0000"  >&lt;p&gt;If it works, why is there an exception?&lt;/p&gt;

&lt;p&gt;The situation was pretty isolated. The entity to be deleted was merge()d, and then remove()d. &quot;remove&quot; was declared as a cascade option.&lt;/p&gt;

&lt;p&gt;Doctrine simply issued a &quot;DELETE FROM \x where dbID = &apos;1&apos;&quot;, but did not remove the associated entity, instead violating the integrity constraint.&lt;/p&gt;</comment>
                    <comment id="16510" author="dalvarez" created="Sun, 25 Sep 2011 14:44:24 +0000"  >&lt;p&gt;I think we are referring to the same end result: After all, persistent state needs to be modified one way or the other. Otherwise it would not make any sense.&lt;/p&gt;

&lt;p&gt;Still, the cascading delete does not work for me. It does not modify persistent state in any way.&lt;/p&gt;

&lt;p&gt;E. g. I have a use case where the following association is declared within an entity class, say A.&lt;/p&gt;


&lt;p&gt;   /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@OneToOne(targetEntity=&quot;B&quot;, inversedBy=&quot;a&quot;, cascade=
{&quot;persist&quot;, &quot;remove&quot;, &quot;detach&quot;, &quot;merge&quot;}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;@JoinColumn(name=&quot;b_dbID&quot;, referencedColumnName=&quot;dbID&quot;)&lt;br/&gt;
    */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  protected $b;&lt;/p&gt;


&lt;p&gt;Here, the cascade option &quot;remove&quot; is set.&lt;/p&gt;

&lt;p&gt;Now, if I remove a persistent instance of this class, like so:&lt;/p&gt;

&lt;p&gt;$doctrineEntityManager-&amp;gt;merge($a);&lt;/p&gt;

&lt;p&gt;$doctrineEntityManager-&amp;gt;remove($a);&lt;/p&gt;

&lt;p&gt;it will delete that particular entity instance from the database, but none of the entity instances associated with it through the association.&lt;/p&gt;

&lt;p&gt;I made sure that also &quot;merge&quot; was activated for the association - just in case it matters to be able to pull the object graph into memory first.&lt;/p&gt;

&lt;p&gt;Funnily enough, inheritance relationships declare a ON DELETE CASCADE at the database level. Just that all non-inheritance associations rely on that other in-memory mechanism, that, in the scenario above, does not work. I don&apos;t get it why the same mechanism cannot be used for both scenarios - after all its about deleting dependent database rows in both cases.&lt;/p&gt;

&lt;p&gt;Am I doing it wrongly? How is this mechanism supposed to work? Could you please verify it does work? (For me, it does not, at least not as described above).&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="16511" author="dalvarez" created="Sun, 25 Sep 2011 14:46:29 +0000"  >&lt;p&gt;Oh yes, I forgot to mention I am now using version 2.1.1 of Doctrine. The last post was tested using version 2.1.1.&lt;/p&gt;</comment>
                    <comment id="16512" author="dalvarez" created="Sun, 25 Sep 2011 14:50:25 +0000"  >&lt;p&gt;Updated the issue data to reflect the current environment.&lt;/p&gt;</comment>
                    <comment id="16513" author="beberlei" created="Sun, 25 Sep 2011 15:54:05 +0000"  >&lt;p&gt;Can you give an example domain for this bug? since it seems to have to do either with merge or inheritance.&lt;/p&gt;

&lt;p&gt;following questions:&lt;/p&gt;

&lt;p&gt;1. does it work for you without inheritance&lt;br/&gt;
2. does it work by grabbing an entity using find, then remove.&lt;/p&gt;</comment>
                    <comment id="16525" author="dalvarez" created="Mon, 26 Sep 2011 03:24:22 +0000"  >&lt;p&gt;Thanks for your quick reply.&lt;/p&gt;

&lt;p&gt;I have now tested quite a number of different scenarios, both scenarios that involve inheritance, and scenarios that do not.&lt;/p&gt;

&lt;p&gt;Inheritance was just the matter in the original issue because the initial observation was that, at the database level, only inheritance relationships would declare an ON DELETE CASCADE constraint. Inheritance does not really have an effect on the basic problem that delete operations are not cascaded.&lt;/p&gt;

&lt;p&gt;As the application code I use involves a lot of inheritance, and since you explicitly mentioned it, I included inheritance in the tests, too, just to see if it made a difference. I performed the tests based on two different data models - first one where the target entity class of the association would inherit from another entity class, and a second one where it does not.&lt;/p&gt;

&lt;p&gt;In the end, inheritance did not matter. The results were the same whether the target entity inherits from a base class or not.&lt;/p&gt;

&lt;p&gt;What did matter is the way in which the delete was performed.&lt;/p&gt;

&lt;p&gt;I have accidentally given you wrong information about the way I actually deleted the entity instances in my last post. Since calling the remove method is the regular way I delete objects in my application, I blindly assumed it would be the same in this scenario. Unfortunately, I overlooked a special case here. In that case, the delete is performed using a DQL DELETE query.&lt;/p&gt;

&lt;p&gt;It seems that, for deletions performed using DQL queries, the cascade options are not respected. This is only logical, since - assuming that DQL gets compiled down straight to SQL and has no side effects on the in-memory objects - there will not be any in-memory object graph, and therefore any technique based purely on in-memory objects cannot possibly work for DQL.&lt;/p&gt;

&lt;p&gt;A solution would be to declare ON DELETE CASCADE constraints at the database level too (as already done in case of inheritance relationships) for associations that declare &quot;remove&quot; as a cascade option, so that the SQL resulting from the compilation of DQL DELETE queries will have the expected semantics, and maybe the onDelete annotation would be mandatory here.&lt;/p&gt;


&lt;p&gt;Here are the details of the tests I performed:&lt;/p&gt;



&lt;p&gt;First, here are the entity models used for the test:&lt;/p&gt;


&lt;p&gt;Here&apos;s the first, simple, model:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php

namespace persistentData\model;

/**
 * @Entity
 */

class Something {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
   
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\SomethingElse&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;thing&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;})
    * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing_dbID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;dbID&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $otherThing;
}


/**
 * @Entity
 */

class SomethingElse {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\Something&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $thing;
}

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There is an entity class &quot;Something&quot; which refers to an entity class &quot;SomethingElse&quot; with a bidirectional one-to-one association&lt;br/&gt;
The association declares a typical set of cascade options I use, including &quot;remove&quot;. That&apos;s it.&lt;/p&gt;

&lt;p&gt;Here is the second model, where the target entity class of the association inherits from another entitiy class.&lt;br/&gt;
Except for the inheritance, this second model is functionally identical to the first:&lt;/p&gt;

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

namespace persistentData\model;

/**
 * @Entity
 */

class Something {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
   
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\SomethingElse&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;thing&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;detach&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;merge&quot;&lt;/span&gt;})
    * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing_dbID&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;dbID&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $otherThing;
}


/**
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;doctrineTypeDiscriminator&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=64)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;baseClassForSomethingElse&quot;&lt;/span&gt;   = &lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\BaseClassForSomethingElse&quot;&lt;/span&gt;,
 *                    &lt;span class=&quot;code-quote&quot;&gt;&quot;somethingElse&quot;&lt;/span&gt;               = &lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\SomethingElse&quot;&lt;/span&gt;})
 */

&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class BaseClassForSomethingElse {
   
   /**
    * @Id
    * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;)
    * @GeneratedValue
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dbID;
}



/**
 * @Entity
 */

class SomethingElse &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; BaseClassForSomethingElse {
   
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;persistentData\model\Something&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherThing&quot;&lt;/span&gt;)
    */
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $thing;
}

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;I used the Doctrine command-line tools to generate the proxy classes and update the database model. Consequently, the following tables were generated:&lt;/p&gt;

&lt;p&gt;For the simple model:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;mysql&amp;gt; describe Something;
+-----------------+------------+------+-----+---------+----------------+
| Field           | Type       | Null | Key | Default | Extra          |
+-----------------+------------+------+-----+---------+----------------+
| dbID            | bigint(20) | NO   | PRI | NULL    | auto_increment |
| otherThing_dbID | bigint(20) | YES  | UNI | NULL    |                |
+-----------------+------------+------+-----+---------+----------------+


mysql&amp;gt; describe SomethingElse;
+-------+------------+------+-----+---------+----------------+
| Field | Type       | Null | Key | Default | Extra          |
+-------+------------+------+-----+---------+----------------+
| dbID  | bigint(20) | NO   | PRI | NULL    | auto_increment |
+-------+------------+------+-----+---------+----------------+
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;And for the model involving inheritance:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
mysql&amp;gt; describe Something;
+-----------------+------------+------+-----+---------+----------------+
| Field           | Type       | Null | Key | Default | Extra          |
+-----------------+------------+------+-----+---------+----------------+
| dbID            | bigint(20) | NO   | PRI | NULL    | auto_increment |
| otherThing_dbID | bigint(20) | YES  | UNI | NULL    |                |
+-----------------+------------+------+-----+---------+----------------+


mysql&amp;gt; describe SomethingElse;
+-------+------------+------+-----+---------+-------+
| Field | Type       | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| dbID  | bigint(20) | NO   | PRI | NULL    |       |
+-------+------------+------+-----+---------+-------+


mysql&amp;gt; describe BaseClassForSomethingElse;
+---------------------------+-------------+------+-----+---------+----------------+
| Field                     | Type        | Null | Key | Default | Extra          |
+---------------------------+-------------+------+-----+---------+----------------+
| dbID                      | bigint(20)  | NO   | PRI | NULL    | auto_increment |
| doctrineTypeDiscriminator | varchar(64) | NO   |     | NULL    |                |
+---------------------------+-------------+------+-----+---------+----------------+
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;Using doctrine, I then created some sample entity instances:&lt;/p&gt;

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


$somethingElse = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SomethingElse();

$doctrineEntityManager-&amp;gt;persist($somethingElse);


$something-&amp;gt;otherThing = $somethingElse;

$doctrineEntityManager-&amp;gt;persist($something);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;The database ends up with the following content:&lt;/p&gt;


&lt;p&gt;For the simple model:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;mysql&amp;gt; select * from Something;
+------+-----------------+
| dbID | otherThing_dbID |
+------+-----------------+
|    2 |               2 |
+------+-----------------+
1 row in set (0.00 sec)


mysql&amp;gt; select * from SomethingElse;
+------+
| dbID |
+------+
|    2 |
+------+
1 row in set (0.00 sec)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;And for the model involving inheritance:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;mysql&amp;gt; select * from Something;
+------+-----------------+
| dbID | otherThing_dbID |
+------+-----------------+
|    1 |               1 |
+------+-----------------+
1 row in set (0.00 sec)

mysql&amp;gt; select * from SomethingElse;
+------+
| dbID |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

mysql&amp;gt; select * from BaseClassForSomethingElse;
+------+---------------------------+
| dbID | doctrineTypeDiscriminator |
+------+---------------------------+
|    1 | somethingElse             |
+------+---------------------------+
1 row in set (0.00 sec)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;We now have an entity instance of class &quot;Something&quot;, which refers to an entity instance of class &quot;SomethingElse&quot;. The database with the model involving inheritance is identical, except for the implementation detail that the entity instance of class &quot;SomethingElse&quot; inherits from an entity instance of class &quot;BaseClassForSomethingElse&quot;.&lt;/p&gt;


&lt;p&gt;This is the setup. Now to the program code:&lt;/p&gt;


&lt;p&gt;This code deletes both entity instances correctly, as expected, including the base class row in case of the second data model:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $doctrineEntityManager-&amp;gt;createQuery(&apos;SELECT something
                                                FROM \persistentData\model\Something something
                                               WHERE something.dbID = 2&apos;);

$something = $query-&amp;gt;getSingleResult();

$doctrineEntityManager-&amp;gt;remove($something);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;This code will also work correctly, having the exact same effect as the code above:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$something = $doctrineEntityManager-&amp;gt;find(&apos;persistentData\model\Something&apos;, 2);

$doctrineEntityManager-&amp;gt;remove($something);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;However, this code will not work:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $doctrineEntityManager-&amp;gt;createQuery(&apos;DELETE
                                                FROM \persistentData\model\Something something
                                               WHERE something.dbID = 2&apos;);

$something = $query-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;The code deletes the entity instance of class &quot;Something&quot;, but will not delete the dependent data object of class &quot;SomethingElse&quot;.&lt;/p&gt;


&lt;p&gt;It seems like the cascade option for the cascading delete is completely ignored by any delete operations performed through DQL queries (as opposed to e. g. calling the remove method on the entity manager).&lt;/p&gt;

&lt;p&gt;In the trivial example above, the query could simply be replaced by a call to the remove method, of course. Fortunately, in the application I am developing, this is possible, so I can resort to that.&lt;br/&gt;
But for queries involving more complex WHERE clauses, it will not be easily possible, except maybe by first performing a SELECT query to have the WHERE clause evaluated, and then iterating over the result object-by-object to delete them.&lt;/p&gt;


&lt;p&gt;Is this behaviour (cascade options being bypassed by DQL queries) intended? At least it is logical according to your explanation of the in-memory object-graph approach.&lt;br/&gt;
It would be a pain to understand though, with no clear mention of this fundamental restriction being available in the docs.&lt;/p&gt;

&lt;p&gt;However, I found a mention of an &quot;onDelete&quot; option in the &quot;transitive persistence&quot; section of the reference documentation&lt;/p&gt;

&lt;p&gt;&quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt; To rely on the database level cascade operations for the delete operation instead, you can configure each join column with the onDelete option. See the respective mapping driver chapters for more information.&quot;&lt;/p&gt;

&lt;p&gt;Do I &lt;b&gt;have&lt;/b&gt; to rely on that, even if cascade=&quot;remove&quot; is declared?&lt;/p&gt;


&lt;p&gt;The annotation reference explains the onDelete annotation as &quot;onDelete: Cascade Action (Database-level)&quot;. However, this is misleading, because a cascade option is understood to be one of &quot;persist&quot;/&quot;remove&quot;/&quot;detach&quot;/&quot;merge&quot;/&quot;all&quot; throughout the annotation reference. Only the Doctrine 1.2 docs contain a mention of &quot;database-level cascades&quot; (&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_1/ru/defining-models:transitive-persistence:database-level-cascades&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_1/ru/defining-models:transitive-persistence:database-level-cascades&lt;/a&gt;). Reading the source, I assume the syntax would be onDelete=&quot;cascade&quot;, but from the docs this is not evident.&lt;/p&gt;

&lt;p&gt;Personally, I would opt for generally using ON DELETE CASCADE constraints at the database level - either exclusively, or in addition to anything that might happen in the object domain. This is IMO the only efficient way to make the declared cascade=&lt;/p&gt;
{&quot;remove&quot;}
&lt;p&gt; constraint be generally effective.&lt;/p&gt;


&lt;p&gt;Please clarify if the behaviour is intended, and if declaring onDelete=&quot;cascade&quot; is mandatory to have DQL queries cascade delete operations.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="16526" author="dalvarez" created="Mon, 26 Sep 2011 03:32:49 +0000"  >&lt;p&gt;Wrapped the code in code blocks and the MySQL tables into noformat-blocks.&lt;/p&gt;</comment>
                    <comment id="16531" author="beberlei" created="Tue, 27 Sep 2011 07:25:51 +0000"  >&lt;p&gt;Ah ok, using DELETE makes all the difference. This is actually the exepcted behavior. Cascade Operations are purely in-memory operations and dont trigger on DELETE statements. That is waht the join column on-delete definitions are for.&lt;/p&gt;

&lt;p&gt;This is documented in the DQL chapter, but should probably be documented in the cascade section aswell: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#delete-queries&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#delete-queries&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16532" author="dalvarez" created="Tue, 27 Sep 2011 14:36:22 +0000"  >&lt;p&gt;Thanks for the clarification. Doctrine 2 really is one complex beast to tame.&lt;/p&gt;

&lt;p&gt;Maybe a note in the architecture section could point out that anything involving DQL belongs to the database domain as opposed to the object domain. As DQL is toutet as an object-query-language it is quite contrary to the principle of least astonishment that cascade constraints defined at the object-domain-level are ignored. Bypassing object-domain constraints basically makes DQL a mere SQL abstraction rather than a fully-blown object-query-language aware of the object domain constraints. This is a very fundamental architectural tenet.&lt;/p&gt;

&lt;p&gt;I will close this issue as invalid, because it does work as intended by the creators, even if the behaviour IMO constitutes a questionable design choice, being highly counter-intuitive without compensating for it by giving adequate other benefits to the user that would necessarily depend on that design choice.&lt;/p&gt;</comment>
                    <comment id="16533" author="dalvarez" created="Tue, 27 Sep 2011 14:37:45 +0000"  >&lt;p&gt;Works as intended, though maybe not as to be expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1333] doctrine-mapping.xsd allows only one &lt;id&gt; element</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1333</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The metadata XSD at &lt;a href=&quot;http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd&lt;/a&gt; defines the &amp;lt;id&amp;gt; element on line 66 as &amp;lt;xs:element name=&quot;id&quot; type=&quot;orm:id&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot; /&amp;gt;. This allows for no more than one &amp;lt;id&amp;gt; element though the documentation at &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/xml-mapping.html#defining-identity-and-generator-strategies&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/xml-mapping.html#defining-identity-and-generator-strategies&lt;/a&gt; states that more than one &amp;lt;id&amp;gt; element is allowed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12923">DDC-1333</key>
            <summary>doctrine-mapping.xsd allows only one &lt;id&gt; element</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="andrew.mcconnell">Andrew McConnell</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Aug 2011 13:37:19 +0000</created>
                <updated>Sun, 21 Aug 2011 13:07:29 +0000</updated>
                    <resolved>Sun, 21 Aug 2011 13:07:29 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16366" author="beberlei" created="Sun, 21 Aug 2011 13:07:29 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1340] Missing argument 3 for OptimisticLockException::lockFailedVersionMissmatch()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1340</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;UnitOfWork.php line 1409&lt;/p&gt;
&lt;div class=&quot;code panel&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;throw&lt;/span&gt; OptimisticLockException::lockFailedVersionMissmatch($entityVersion, $managedCopyVersion);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;OptimisticLockException.php line 54&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function lockFailedVersionMissmatch($entity, $expectedLockVersion, $actualLockVersion)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No 3rd param in call or default in method declaration.&lt;/p&gt;

&lt;p&gt;Warning: Missing argument 3 for Doctrine\ORM\OptimisticLockException::lockFailedVersionMissmatch(), called in /mnt/hgfs/Sites/library/Doctrine2/lib/Doctrine/ORM/UnitOfWork.php on line 1409 and defined in /mnt/hgfs/Sites/library/Doctrine2/lib/Doctrine/ORM/OptimisticLockException.php on line 54&lt;/p&gt;</description>
                <environment>Doctrine\ORM::VERSION = 2.1.0RC3</environment>
            <key id="12937">DDC-1340</key>
            <summary>Missing argument 3 for OptimisticLockException::lockFailedVersionMissmatch()</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="ambis">Matti Niemel&#228;</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Aug 2011 14:50:49 +0000</created>
                <updated>Sun, 21 Aug 2011 13:04:27 +0000</updated>
                    <resolved>Sun, 21 Aug 2011 13:04:27 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16365" author="beberlei" created="Sun, 21 Aug 2011 13:04:27 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1021] Automatically infer type when DateTime is used as parameter in queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1021</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given &lt;tt&gt;$date instanceof \DateTime&lt;/tt&gt;, instead of this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;createQuery(&apos; ... p.date &amp;gt;= :pdate&apos;)
  -&amp;gt;setParameters(array(&apos;pdate&apos; =&amp;gt; $date), array(&apos;pdate&apos; =&amp;gt; &apos;datetime&apos;))
  -&amp;gt;execute()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I would love to be able to use this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityManager-&amp;gt;createQuery(&apos; ... p.date &amp;gt;= :pdate&apos;)
  -&amp;gt;execute(array(&apos;pdate&apos; =&amp;gt; $date))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Even when using &lt;tt&gt;setParameters()&lt;/tt&gt; - which you need to do, e.g. when using &lt;tt&gt;getSingleResult()&lt;/tt&gt;, it would be nice to be able to leave that out for DateTime instances - seems to be about the only thing that is not handled transparently.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12363">DDC-1021</key>
            <summary>Automatically infer type when DateTime is used as parameter in queries</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="k-fish">Karsten Dambekalns</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Feb 2011 16:50:14 +0000</created>
                <updated>Tue, 16 Aug 2011 05:35:10 +0000</updated>
                    <resolved>Tue, 16 Aug 2011 05:35:10 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16343" author="guilhermeblanco" created="Tue, 16 Aug 2011 05:35:10 +0000"  >&lt;p&gt;This was already fixed by ParameterTypeInferer released in 2.1&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

&lt;p&gt;and the following models:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;use Doctrine\ORM\Mapping as ORM;

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

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

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

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

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;use Doctrine\ORM\Mapping as ORM;

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

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

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

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

&lt;p&gt;Execute the following DQL 2 times:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $entityManager-&amp;gt;createQuery(&apos;
			SELECT 
				f, fl 
			FROM 
				Bug_Model_Foo f 
			JOIN 
				f._fooLocaleRefFoo fl&apos;);
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $query-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

<item>
            <title>[DDC-1313] DriverChain::getAllClassNames() is very inefficient in some scenarios</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1313</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In Symfony a driver gets registered multiple times. This leads to getAllClassNames() to be invoked multiple times on the same driver.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12889">DDC-1313</key>
            <summary>DriverChain::getAllClassNames() is very inefficient in some scenarios</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Aug 2011 19:44:51 +0000</created>
                <updated>Mon, 1 Aug 2011 19:47:04 +0000</updated>
                    <resolved>Mon, 1 Aug 2011 19:47:04 +0000</resolved>
                                            <fixVersion>2.1.1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16260" author="beberlei" created="Mon, 1 Aug 2011 19:47:04 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1282] getDateAddDaysExpression() casts $days to integer preventing column based add expressions.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1282</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Take the following:&lt;/p&gt;

&lt;p&gt;		$qb = $this-&amp;gt;createQueryBuilder(&apos;a&apos;);&lt;br/&gt;
		$qb-&amp;gt;select(&apos;partial a.&lt;/p&gt;
{dsid,rid,activeStartDate}&apos;);&lt;br/&gt;
		$qb-&amp;gt;leftJoin(&apos;a.clinic&apos;, &apos;c&apos;);&lt;br/&gt;
		$qb-&amp;gt;leftJoin(&apos;a.patient&apos;, &apos;p&apos;);&lt;br/&gt;
		$qb-&amp;gt;where(&apos;c.autoAppointmentReminders = 1&apos;);&lt;br/&gt;
		$qb-&amp;gt;andWhere(&apos;a.enabled = 1&apos;);&lt;br/&gt;
		$qb-&amp;gt;andWhere(&lt;br/&gt;
				$qb-&amp;gt;expr()-&amp;gt;eq(&lt;br/&gt;
					&apos;a.activeStartDate&apos;,&lt;br/&gt;
					&quot;DATE_ADD(CURRENT_DATE(), c.appointmentRemindersDaysInAdvance, &apos;day&apos;)&quot;));&lt;br/&gt;
&lt;br/&gt;
Which generates the DQL: SELECT partial a.{dsid,rid,activeStartDate}
&lt;p&gt; FROM VetLogic\Entity\Appointment a LEFT JOIN a.clinic c LEFT JOIN a.patient p WHERE c.autoAppointmentReminders = 1 AND a.enabled = 1 AND a.activeStartDate = DATE_ADD(CURRENT_DATE(), c.appointmentRemindersDaysInAdvance, &apos;day&apos;)&lt;/p&gt;

&lt;p&gt;And SQL: SELECT a0_.rid AS rid0, a0_.dsid AS dsid1, a0_.activeStartDate AS activeStartDate2, a0_.dsid AS dsid3, a0_.dsid AS dsid4, a0_.clinicRid AS clinicRid5, a0_.dsid AS dsid6, a0_.patientRid AS patientRid7, a0_.dsid AS dsid8, a0_.rid AS rid9 FROM appointment a0_ LEFT JOIN clinic c1_ ON a0_.dsid = c1_.dsid AND a0_.clinicRid = c1_.rid LEFT JOIN patient p2_ ON a0_.dsid = p2_.dsid AND a0_.patientRid = p2_.rid WHERE c1_.autoAppointmentReminders = 1 AND a0_.enabled = 1 AND a0_.activeStartDate = DATE_ADD(CURRENT_DATE, INTERVAL0 DAY)&lt;/p&gt;

&lt;p&gt;The DATE_ADD(CURRENT_DATE, INTERVAL0 DAY) is generated incorrectly because getDateAddDaysExpression($date, $days) casts $days to an integer.&lt;/p&gt;

&lt;p&gt;The fix is simply to remove (int) from return &apos;DATE_ADD(&apos; . $date . &apos;, INTERVAL &apos; . (int)$days . &apos; DAY)&apos;;&lt;/p&gt;

&lt;p&gt;Note: I only checked the MySQL platform so I&apos;m not sure if other platforms are affected.&lt;/p&gt;</description>
                <environment>MySQL</environment>
            <key id="12837">DDC-1282</key>
            <summary>getDateAddDaysExpression() casts $days to integer preventing column based add expressions.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://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>Wed, 20 Jul 2011 19:28:18 +0000</created>
                <updated>Sun, 31 Jul 2011 10:06:24 +0000</updated>
                    <resolved>Sun, 31 Jul 2011 10:06:24 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16244" author="beberlei" created="Sun, 31 Jul 2011 10:06:24 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

<item>
            <title>[DDC-1301] EXTRA_LAZY collection count throws exception on OneToMany association</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1301</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Calling count() on an EXTRA_LAZY collection throws an exception. &lt;/p&gt;

&lt;p&gt;Notice: Undefined index: iUserId in /../vendor/doctrine/lib/Doctrine/ORM/Persisters/OneToManyPersister.php line 142 &lt;/p&gt;

&lt;p&gt;I&apos;ve found that this is caused by looking up the fieldName for iUserId on the targetEntity, while it should be looked up at the sourceEntity. The current tests pass because all entities have a mapping of `id&apos; -&amp;gt; $id.&lt;/p&gt;

&lt;p&gt;Tests + fix coming up.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12864">DDC-1301</key>
            <summary>EXTRA_LAZY collection count throws exception on OneToMany association</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="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Jul 2011 08:11:54 +0000</created>
                <updated>Thu, 28 Jul 2011 21:28:11 +0000</updated>
                    <resolved>Thu, 28 Jul 2011 21:28:11 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16225" author="asm89" created="Thu, 28 Jul 2011 09:12:18 +0000"  >&lt;p&gt;PR with tests and fix: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/97&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/97&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1275] ResultSetMappingBuilder does not set foreign keys</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1275</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The ResultSetMappingBuilder has a fatal flaw: Its not setting foreign keys as of right now.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12823">DDC-1275</key>
            <summary>ResultSetMappingBuilder does not set foreign keys</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jul 2011 17:41:25 +0000</created>
                <updated>Thu, 28 Jul 2011 21:25:06 +0000</updated>
                    <resolved>Thu, 28 Jul 2011 21:25:06 +0000</resolved>
                                            <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

INSERT INTO `fooBar` (`fooID`, `barID`)
VALUES
	(1, 1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;the following models:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;use Doctrine\ORM\Mapping as ORM;

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

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

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

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

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;use Doctrine\ORM\Mapping as ORM;

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

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

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

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

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;use Doctrine\ORM\Mapping as ORM;

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

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

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

&lt;p&gt;and using the following DQL:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT 
	f, b, fb 
FROM 
	Bug_Model_Foo f 
JOIN 
	f._fooBarRefFoo fb
JOIN
	fb._bar b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will result in the following sql query:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT f0_.fooID AS fooID0, f0_.fooReference AS fooReference1, , b1_.barID AS barID2, b1_.barReference AS barReference3, f2_.fooID AS fooID4, f2_.barID AS barID5 FROM foo f0_ INNER JOIN fooBar f2_ ON f0_.fooID = f2_.fooID INNER JOIN bar b1_ ON f2_.barID = b1_.barID
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;there are 2 comma&apos;s between &quot;f0_.fooReference AS fooReference1&quot; and &quot;b1_.barID AS barID2&quot; resulting in an invalid query.&lt;/p&gt;

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

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

<item>
            <title>[DDC-1215] doctrine:generate:entities creates entities incorrect visibility of properties for subclasses</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1215</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;ve created a symfony bundle with an entity that I want to use as a base across mutiple other 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;/**
* @orm\Entity
* @orm\HasLifecycleCallbacks()
*/
class Base
{
/**
* @orm\Id
* @orm\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
* @orm\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
*/
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
/**
* @orm\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&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;, length=&lt;span class=&quot;code-quote&quot;&gt;&quot;150&quot;&lt;/span&gt;)
*/
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;
/**
* @orm\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&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;, length=&lt;span class=&quot;code-quote&quot;&gt;&quot;150&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;

&lt;p&gt;I have another entity in another bundle that extends 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;class Extended &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \Test\Entity\Base
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I run doctrine:generate:entites it incorrectly generates the extended class - it sets all inherited properties as &apos;private&apos; which then causes PHP to raise an exception because properties on an extended class have more restrictive visibility than from the base class.&lt;/p&gt;

&lt;p&gt;It probably shouldn&apos;t be auto-generating the properties in the extended class at all, or generating getters/setters since that then overrides my base implementation by default.&lt;/p&gt;</description>
                <environment>Fedora 14, PHP 5.3.5</environment>
            <key id="12724">DDC-1215</key>
            <summary>doctrine:generate:entities creates entities incorrect visibility of properties for subclasses</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="jboosh">james brown</reporter>
                        <labels>
                    </labels>
                <created>Sun, 19 Jun 2011 09:34:11 +0000</created>
                <updated>Tue, 26 Jul 2011 21:01:25 +0000</updated>
                    <resolved>Tue, 26 Jul 2011 21:01:25 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16214" author="beberlei" created="Tue, 26 Jul 2011 21:01:25 +0000"  >&lt;p&gt;Should be fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1280] Generated proxy classes have mixed line endings on Windows</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1280</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When Doctrine\ORM\Proxy\ProxyFactory generates proxy classes on Windows, it mixes LF an CR/LF line endings. This is causing VCS issues in our mixed Windows/Linux dev team (we keep the proxies under version control for deployment purposes).&lt;/p&gt;

&lt;p&gt;This seems to be a regression. It did not happen with Doctrine 2.0.x.&lt;/p&gt;

&lt;p&gt;It is caused by the template string in the static property $_proxyClassTemplate using LF, while the string concatenations in the methods use the PHP_EOL constant, which resolves to CR/LF on Windows.&lt;/p&gt;

&lt;p&gt;Other code generators like Doctrine\ORM\Tools\EntityGenerator use &quot;\n&quot; instead of PHP_EOL.&lt;/p&gt;

&lt;p&gt;I propose to always use &quot;\n&quot; in favour of PHP_EOL. It&apos;s easier to implement in this case and every editor/IDE on Windows can handle Unix line endings nowadays.&lt;/p&gt;</description>
                <environment>WinXP SP3, PHP 5.3.6</environment>
            <key id="12833">DDC-1280</key>
            <summary>Generated proxy classes have mixed line endings on Windows</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="literal">Stan Imbt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 17 Jul 2011 01:55:13 +0000</created>
                <updated>Tue, 26 Jul 2011 20:34:19 +0000</updated>
                    <resolved>Tue, 26 Jul 2011 20:34:19 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16212" author="beberlei" created="Tue, 26 Jul 2011 20:34:19 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1276] Merging persistent collections broken if managed and merged collection are the same object</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1276</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When FLOW3 maps request arguments to entities, it works on clones of the changed entities while entities, which are not affected by the request arguments stay the original objects. If the entity has a persistent collection which is not changed and therefore not cloned, the call to $repository-&amp;gt;update() (which internally calls $em-&amp;gt;merge()) eventually clears the $managedCol in $uow-&amp;gt;doMerge() (line 1460 in current master), but if the $mergeCol is the same object, this is obviously wrong behavior as no related entities exist anymore in the entity to merge.&lt;/p&gt;

&lt;p&gt;Made up example code (not sure if this simple example works as I have no test setup I could use for it)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @entity
 * @scope prototype
 */
class A {}

/**
 * @entity
 * @scope prototype
 */
class B {
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \Doctrine\Common\Collection\ArrayCollection&amp;lt;A&amp;gt;
     * @ManyToMany
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $relation;
}

$b = $repository-&amp;gt;find(); &lt;span class=&quot;code-comment&quot;&gt;// assume $b has some A in relation
&lt;/span&gt;$anotherB = clone $b;
$em-&amp;gt;merge($anotherB);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After this relation of $b is empty&lt;/p&gt;</description>
                <environment>FLOW3</environment>
            <key id="12824">DDC-1276</key>
            <summary>Merging persistent collections broken if managed and merged collection are the same object</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="liwo">Lienhart Woitok</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jul 2011 18:45:35 +0000</created>
                <updated>Tue, 26 Jul 2011 20:19:35 +0000</updated>
                    <resolved>Tue, 26 Jul 2011 20:19:35 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16209" author="beberlei" created="Tue, 26 Jul 2011 20:19:35 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;This is extremly annoying since it renders the generator unusable when aforementioned bundle is active. It always fails with this message:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine\ORM\Mapping\MappingException&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;No identifier/primary key specified for Entity &apos;Stof\DoctrineExtensionsBundle\Entity\Translation&apos;. Every Entity must have an&lt;br/&gt;
identifier/primary key.&lt;/p&gt;

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

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

<item>
            <title>[DDC-1244] [regression] Entities generator fails to update entities without any namespace, always append the generated definitions to the end of the class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1244</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If Entities have no namespace set (e.g. custom AutoLoader) schema tool fails to find the original methods and properties and always append the definitions to the end of the file, which leads to duplications of class definitions.&lt;/p&gt;

&lt;p&gt;This is because in &lt;b&gt;\Doctrine\ORM\Tools\EntitiesGenerator.php&lt;/b&gt; at line 441:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;441: $lastSeenClass = $lastSeenNamespace . &apos;\\&apos; . $token[1];&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$lastSeenClass is always prefixed with &quot;\&quot; when checking for existing definitions&lt;/p&gt;

&lt;p&gt;it could be fixed as:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;441: $lastSeenClass =  $lastSeenNamespace. ($lastSeenNamespace ? &apos;\\&apos; : &apos;&apos;) . $token[1];&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;I had an environment where the classes without any specified namespace are autoloaded from Entities directory, which makes generate-entities fail to work properly since Doctrine 2.0.4&lt;/p&gt;</description>
                <environment>Zend_Framework 1.11, Doctrine 2.x, YAML mapping</environment>
            <key id="12771">DDC-1244</key>
            <summary>[regression] Entities generator fails to update entities without any namespace, always append the generated definitions to the end of the 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="venimus">venimus</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Jul 2011 16:17:40 +0000</created>
                <updated>Tue, 12 Jul 2011 21:50:20 +0000</updated>
                    <resolved>Tue, 12 Jul 2011 21:50:20 +0000</resolved>
                            <version>2.0.4</version>
                <version>2.0.5</version>
                <version>2.0.6</version>
                <version>2.0.7</version>
                <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16163" author="beberlei" created="Tue, 12 Jul 2011 21:50:20 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1243] Problem to generate code for subclasses without identifiers.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1243</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using inheritance with identifier in the superclass, results in an error trying to generate code.&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;/**
 * Demo\TestInheritanceBundle\Entity\TestBase
 *
 * @ORM\Table()
 * @ORM\Entity
 * @ORM\InheritanceType(&quot;JOINED&quot;)
 * @ORM\DiscriminatorColumn(name=&quot;discr&quot;, type=&quot;string&quot;)
 * @ORM\DiscriminatorMap({&quot;test&quot; = &quot;Test&quot;})
 */
class TestBase
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name=&quot;id&quot;, type=&quot;integer&quot;)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy=&quot;AUTO&quot;)
     */
    private $id;
}

class Test
{
}

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

&lt;p&gt;will throw an exception because the DisconnectedClassMetadataFactory disables the code that examines the parent classes.&lt;br/&gt;
I&apos;ve created a simple function that can be used to figure out if a parent has defined an identifier that can be used by the subclass.&lt;/p&gt;

&lt;p&gt;Patch attached.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12770">DDC-1243</key>
            <summary>Problem to generate code for subclasses without identifiers.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://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="asannes">Asbj&#248;rn Sannes</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Jul 2011 11:26:56 +0000</created>
                <updated>Tue, 12 Jul 2011 21:47:50 +0000</updated>
                    <resolved>Tue, 12 Jul 2011 21:47:50 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16104" author="venimus" created="Fri, 1 Jul 2011 14:33:29 +0000"  >&lt;p&gt;you should also check if there is a parentclass registered&lt;/p&gt;
&lt;div class=&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;19: if ( ! $this-&amp;gt;driver-&amp;gt;isTransient($parentClass) &amp;amp;&amp;amp; !empty($this-&amp;gt;loadedMetadata[$parentClass])) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16105" author="asannes" created="Fri, 1 Jul 2011 14:43:24 +0000"  >&lt;p&gt;Updated patch with suggestion from venimus to check if the parent class is loaded before using it.&lt;/p&gt;</comment>
                    <comment id="16160" author="beberlei" created="Tue, 12 Jul 2011 21:47:50 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="12795">DDC-1254</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="11023" name="check-inherited-parents-for-identifier.patch" size="1655" author="asannes" created="Fri, 1 Jul 2011 11:26:56 +0000" />
                    <attachment id="11024" name="check-inherited-parents-for-identifier2.patch" size="1703" author="asannes" created="Fri, 1 Jul 2011 14:43:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1240] Missing exception message</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1240</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Message in constructor should be assigned to exception message&lt;/p&gt;

&lt;p&gt;Index: OptimisticLockException.php&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; OptimisticLockException.php	(revision 5)&lt;br/&gt;
+++ OptimisticLockException.php	(working copy)&lt;br/&gt;
@@ -33,6 +33,7 @@&lt;/p&gt;

&lt;p&gt;     public function __construct($msg, $entity)&lt;/p&gt;
     {
+        $this-&amp;gt;message = $msg;
         $this-&amp;gt;entity = $entity;
     }
</description>
                <environment></environment>
            <key id="12766">DDC-1240</key>
            <summary>Missing exception message</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="yaroslav">Yaroslav Zenin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Jul 2011 07:03:23 +0000</created>
                <updated>Tue, 12 Jul 2011 21:02:04 +0000</updated>
                    <resolved>Tue, 12 Jul 2011 21:02:04 +0000</resolved>
                            <version>2.x</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16158" author="beberlei" created="Tue, 12 Jul 2011 21:02:04 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1250] Ambiguous column in query using one-to-one self-referencing bidirectional association</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1250</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This example worked fine with 2.0.6. I suppose it is related to: &lt;br/&gt;
  &quot;Furthermore inverse OneToOne associations previously always executed an additional query, which is now replaced with a join.&quot;&lt;/p&gt;

&lt;p&gt;When I try to get object using EntityRepository I receive following error:&lt;br/&gt;
Fatal error:  Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1052 Column &apos;declined_clients_history_id&apos; in where clause is ambiguous&apos; in /usr/share/php/Doctrine/DBAL/Connection.php:613&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 /usr/share/php/Doctrine/DBAL/Connection.php(613): PDOStatement-&amp;gt;execute()&lt;br/&gt;
#1 /usr/share/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(569): Doctrine\DBAL\Connection-&amp;gt;executeQuery(&apos;SELECT t0.id AS...&apos;, Array, Array)&lt;br/&gt;
#2 /usr/share/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(644): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;load(Array, NULL, Array)&lt;br/&gt;
#3 /usr/share/php/Doctrine/ORM/UnitOfWork.php(2015): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;loadOneToOneEntity(Array, Object(Entities\ClientsHistory), NULL)&lt;br/&gt;
#4 /usr/share/php/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php(208): Doctrine\ORM\UnitOfWork-&amp;gt;createEntity(&apos;Entities\Client...&apos;, Array, Array)&lt;br/&gt;
#5 /usr/share/php/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php(398): Doctrine\ORM\Internal\Hydration\Ob in /usr/share/php/Doctrine/DBAL/Connection.php&amp;lt;/b&amp;gt; on line 613&lt;/p&gt;

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

&lt;p&gt;Entities\ClientsHistory:&lt;br/&gt;
  type: entity&lt;br/&gt;
  table: clients_history&lt;br/&gt;
  fields:&lt;br/&gt;
    id:&lt;br/&gt;
      id: true&lt;br/&gt;
      type: integer&lt;br/&gt;
      unsigned: false&lt;br/&gt;
      nullable: false&lt;br/&gt;
      generator:&lt;br/&gt;
        strategy: IDENTITY&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;...skiped...&amp;#93;&lt;/span&gt;&lt;br/&gt;
  oneToOne:&lt;br/&gt;
    declinedClientsHistory:&lt;br/&gt;
      targetEntity: Entities\ClientsHistory&lt;br/&gt;
      joinColumn:&lt;br/&gt;
        name: declined_clients_history_id&lt;br/&gt;
        referencedColumnName: id&lt;br/&gt;
      inversedBy: declinedBy&lt;br/&gt;
    declinedBy:&lt;br/&gt;
      targetEntity: Entities\ClientsHistory&lt;br/&gt;
      mappedBy: declinedClientsHistory&lt;br/&gt;
  lifecycleCallbacks: {  }&lt;br/&gt;
  repositoryClass: Entities\ClientsHistoryRepository&lt;/p&gt;

&lt;p&gt;Query which lead to error:&lt;br/&gt;
SELECT t0.id AS id1, t0.odate AS odate2, t0.oper AS oper3, t0.type AS type4, t0.transaction_sum AS transaction_sum5, t0.sum AS sum6, t0.balance AS balance7, t0.descr AS descr8, t0.admin AS admin9, t0.payment_id AS payment_id10, t0.balance_operation_id AS balance_operation_id11, t0.payment_id AS payment_id12, t0.declined_clients_history_id AS declined_clients_history_id13, t14.id AS id15, t14.odate AS odate16, t14.oper AS oper17, t14.type AS type18, t14.transaction_sum AS transaction_sum19, t14.sum AS sum20, t14.balance AS balance21, t14.descr AS descr22, t14.admin AS admin23, t14.payment_id AS payment_id24, t14.balance_operation_id AS balance_operation_id25, t14.payment_id AS payment_id26, t14.declined_clients_history_id AS declined_clients_history_id27, t14.id_clients AS id_clients28, t14.id_domains AS id_domains29, t0.id_clients AS id_clients30, t0.id_domains AS id_domains31 FROM clients_history t0 LEFT JOIN clients_history t14 ON t14.declined_clients_history_id = t0.id  WHERE declined_clients_history_id = ?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12790">DDC-1250</key>
            <summary>Ambiguous column in query using one-to-one self-referencing bidirectional association</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="saniok">Alexandr Torchenko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jul 2011 14:39:01 +0000</created>
                <updated>Sat, 9 Jul 2011 20:14:19 +0000</updated>
                    <resolved>Sat, 9 Jul 2011 20:14:19 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16133" author="beberlei" created="Sat, 9 Jul 2011 13:38:33 +0000"  >&lt;p&gt;What kind of operation are you using that leads to this error? $em-&amp;gt;find ( parent) or something more complex?&lt;/p&gt;</comment>
                    <comment id="16135" author="beberlei" created="Sat, 9 Jul 2011 19:53:17 +0000"  >&lt;p&gt;I could reproduce it, it happens when you do a DQL without fetching the related One To One.&lt;/p&gt;</comment>
                    <comment id="16136" author="beberlei" created="Sat, 9 Jul 2011 20:14:19 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1257] Duplicate PHP methods generated from XML metadata lifecycle-callbacks</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1257</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If lifecycle callbacks are added to XML metadata like so:&lt;/p&gt;

&lt;div class=&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;lifecycle-callbacks&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;lifecycle-callback type=&lt;span class=&quot;code-quote&quot;&gt;&quot;prePersist&quot;&lt;/span&gt; method=&lt;span class=&quot;code-quote&quot;&gt;&quot;validate&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;lifecycle-callback type=&lt;span class=&quot;code-quote&quot;&gt;&quot;preUpdate&quot;&lt;/span&gt; method=&lt;span class=&quot;code-quote&quot;&gt;&quot;validate&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/lifecycle-callbacks&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;tt&gt;validate()&lt;/tt&gt; method will appear twice in an entity generated from this metadata.&lt;/p&gt;</description>
                <environment>Zend Server 5.1.0, PHP 5.3.5, Apache 2.2.10, Linux (SUSE)</environment>
            <key id="12800">DDC-1257</key>
            <summary>Duplicate PHP methods generated from XML metadata lifecycle-callbacks</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="skl">Stephen Lang</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jul 2011 10:41:58 +0000</created>
                <updated>Sat, 9 Jul 2011 13:16:54 +0000</updated>
                    <resolved>Sat, 9 Jul 2011 13:16:54 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16132" author="beberlei" created="Sat, 9 Jul 2011 13:16:54 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1251] EntityGenerator uses non-existing constant T_AMPERSAND</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1251</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As per &lt;a href=&quot;http://www.php.net/manual/en/tokens.php&quot; class=&quot;external-link&quot;&gt;http://www.php.net/manual/en/tokens.php&lt;/a&gt; - the T_AMPERSAND token does not exist. I&apos;m not sure what was the intent, but the entity generator fails on the following code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            $elems = array_map(function($el) {
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $el;
            }, $elems);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Due to the way notices are handled in Symfony, this basically stops the execution of the generator entirely. Not so great.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;  [ErrorException]                                                                                            
  Notice: Use of undefined constant T_AMPERSAND - assumed &apos;T_AMPERSAND&apos; in ./vendor/doctrine/lib/Doctrine/ORM/Tools/EntityGenerator.php line 454
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

<item>
            <title>[DDC-1022] Wakeup behavior difference between proxy and eager-loaded instance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1022</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When an object is reconstituted from the persistent storage the unserialize trick is used. That means &lt;tt&gt;__wakeup()&lt;/tt&gt; is called, which is useful to do further initialization as needed.&lt;/p&gt;

&lt;p&gt;If the object is lazy loaded a proxy is generated. That proxy is generated with &lt;tt&gt;new&lt;/tt&gt; and thus no &lt;tt&gt;_&lt;em&gt;wakeup()&lt;/tt&gt; is called. When the proxy is eventually initialized still no call to &lt;tt&gt;&lt;/em&gt;_wakeup()&lt;/tt&gt; is done, thus initialization code that is &quot;usually&quot; executed is not called when an object is lazy-loaded.&lt;/p&gt;

&lt;p&gt;That is a semantical error.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12364">DDC-1022</key>
            <summary>Wakeup behavior difference between proxy and eager-loaded instance</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="k-fish">Karsten Dambekalns</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Feb 2011 04:15:50 +0000</created>
                <updated>Sat, 9 Jul 2011 12:39:36 +0000</updated>
                    <resolved>Sat, 9 Jul 2011 12:39:36 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15385" author="beberlei" created="Sat, 26 Feb 2011 07:08:33 +0000"  >&lt;p&gt;__wakeup() shouldn&apos;t be used as per definition of an entity, &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/cookbook/implementing-wakeup-or-clone.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/cookbook/implementing-wakeup-or-clone.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For post initialization &quot;postLoad()&quot; should be used.&lt;/p&gt;</comment>
                    <comment id="15395" author="k-fish" created="Sat, 26 Feb 2011 12:18:11 +0000"  >&lt;p&gt;You write &lt;cite&gt;shouldn&apos;t be used&lt;/cite&gt;, but that seems somewhat strange, given that the page you point to explicitly says &lt;cite&gt;However, it is quite easy to make use of these methods in a safe way by guarding the custom wakeup or clone code with an entity identity check, as demonstrated in the following sections.&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;And still the issue remains that eager-loaded instances created with the unserialize trick &lt;b&gt;do&lt;/b&gt; call &lt;tt&gt;wakeup()&lt;/tt&gt; (of course) but this does not happen when being lazy-loaded. &lt;em&gt;Inconsistency&lt;/em&gt;, it screams... &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="16129" author="beberlei" created="Sat, 9 Jul 2011 09:31:09 +0000"  >&lt;p&gt;I changed my mind, this is valid&lt;/p&gt;</comment>
                    <comment id="16130" author="beberlei" created="Sat, 9 Jul 2011 12:39:36 +0000"  >&lt;p&gt;Fixed in 2.0.7, 2.1.1 and in master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>