<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 18 18:05:33 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.x%22&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.x%22</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="52" total="52"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-1852] Doctrine\ORM\Tools\SchemaValidator should check validity of lifecycle callbacks</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1852</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The schema validator should analyze mapped lifecycle callbacks and:&lt;/p&gt;

&lt;p&gt; a) if some lifecycle callbacks were defined, but no @HasLifecycleCallbacks annotation/mapping was set, warn the user&lt;br/&gt;
 b) if some lifecycle callbacks were defined, but methods are not public, warn the user&lt;/p&gt;</description>
                <environment></environment>
            <key id="13752">DDC-1852</key>
            <summary>Doctrine\ORM\Tools\SchemaValidator should check validity of lifecycle callbacks</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jun 2012 09:47:12 +0000</created>
                <updated>Thu, 20 Sep 2012 06:20:48 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.4</fixVersion>
                <fixVersion>2.x</fixVersion>
                <fixVersion>Git Master</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18038" author="ocramius" created="Mon, 4 Jun 2012 22:25:23 +0000"  >&lt;p&gt;Existing PR at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/361&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/361&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1774] [GH-334] Command fixes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1774</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of hhamon:&lt;/p&gt;

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

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

&lt;p&gt;This patch can be backported on all branches.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13624">DDC-1774</key>
            <summary>[GH-334] Command fixes</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, 11 Apr 2012 07:10:35 +0000</created>
                <updated>Fri, 4 May 2012 18:02:40 +0000</updated>
                    <resolved>Fri, 4 May 2012 18:01:58 +0000</resolved>
                                            <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17840" author="beberlei" created="Wed, 11 Apr 2012 17:38:42 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-334&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/334&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/334&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1729] Translate queries into graphs of value objects (instead of array hydration?)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1729</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In decoupled applications the model layer returns &quot;data-transfer-objects&quot; through the boundary into the controller/view layer. It would make sense to have Doctrine directly generate any data-transfer/value-object from native and dql queries.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13564">DDC-1729</key>
            <summary>Translate queries into graphs of value objects (instead of array hydration?)</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Mar 2012 22:35:35 +0000</created>
                <updated>Sat, 9 Jun 2012 11:26:40 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18067" author="beberlei" created="Sat, 9 Jun 2012 11:26:40 +0000"  >&lt;p&gt;Example:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$dql = &quot;SELECT &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CustomerAddressView(c.id, c.name, a.id, a.street, a.number, a.city, a.code)
             FROM Customer c INNER JOIN c.address a WHERE c.id = ?1&quot;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This supersedes &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1819&quot; title=&quot;Allow ResultSetMapping to be used for objects that are not entities&quot;&gt;DDC-1819&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;1. One additional property in ResultSetMapping =&amp;gt; $viewModelClass?&lt;br/&gt;
2. Changes to Parser (new ... syntax)&lt;br/&gt;
3. Changes to sQL Walker?&lt;br/&gt;
4. Changes to Hydration (Only object hydration!)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1598] ProxyFactory makes assumptions on identifier getter code</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1598</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As of &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L214&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L214&lt;/a&gt;&lt;br/&gt;
and&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L237&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L237&lt;/a&gt;&lt;br/&gt;
the current ProxyFactory isn&apos;t actually checking if the identifier getter has logic in it.&lt;br/&gt;
Current checks aren&apos;t enough/valid.&lt;/p&gt;

&lt;p&gt;In my opinion the check should be matching following:&lt;/p&gt;

&lt;p&gt;(public|protected)\s+function\s+getFieldname\s*&amp;#40;\s*&amp;#41;\s+&lt;/p&gt;
{\s*\$this\s*-&amp;gt;Fieldname\s*;\s*}

&lt;p&gt;Not really experienced with regex, but currently cannot come up with a more secure check.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13356">DDC-1598</key>
            <summary>ProxyFactory makes assumptions on identifier getter code</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Jan 2012 17:28:03 +0000</created>
                <updated>Mon, 16 Jan 2012 09:56:15 +0000</updated>
                    <resolved>Mon, 16 Jan 2012 08:28:11 +0000</resolved>
                            <version>2.0</version>
                <version>2.0.1</version>
                <version>2.0.2</version>
                <version>2.0.3</version>
                <version>2.0.4</version>
                <version>2.0.5</version>
                <version>2.0.6</version>
                <version>2.0.7</version>
                <version>2.1</version>
                <version>2.1.1</version>
                <version>2.1.2</version>
                <version>2.1.3</version>
                <version>2.1.4</version>
                <version>2.1.5</version>
                <version>2.2-BETA1</version>
                <version>2.2-BETA2</version>
                <version>Git Master</version>
                                <fixVersion>2.2</fixVersion>
                <fixVersion>2.3</fixVersion>
                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17247" author="beberlei" created="Sun, 15 Jan 2012 11:19:31 +0000"  >&lt;p&gt;Can you explain why you think this is necessary?&lt;/p&gt;

&lt;p&gt;You are right an id method with logic could exist in 4 lines of code, but for what purpose? &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="17250" author="ocramius" created="Sun, 15 Jan 2012 12:40:31 +0000"  >&lt;p&gt;First of all it is a question of concept. Doctrine &lt;b&gt;shouldn&apos;t&lt;/b&gt; assume anything about entities outside of their fields. It already introduces a level of complication when we explain how to clone/serialize objects, which was very confusing.&lt;/p&gt;

&lt;p&gt;Asking for the purpose of an identifier field getter method is in my opinion again an attempt of making assumptions over user&apos;s code...&lt;/p&gt;

&lt;p&gt;What if the user wrote something like:&lt;/p&gt;

&lt;p&gt;public function getIdentifierField1()&lt;br/&gt;
 {&lt;br/&gt;
    return $this-&amp;gt;identifierField1? $this-&amp;gt;_myInitializationStuff() : null;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;private function _myInitializationStuff() &lt;br/&gt;
{&lt;br/&gt;
    //open files, check stuff, make things difficult for the D2 team &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;For instance, opening file handlers, sockets, whatever... This is a case that would break the entity because of optimization introduced by the ProxyFactory. (not to mention when getIdentifierField1 does some conversion, like return $this-&amp;gt;identifierField1 + self::OFFSET_REQUIRED_BY_WEBSERVICE;&lt;/p&gt;

&lt;p&gt;I&apos;m not arguing about the validity of this optimization, but that the checks are too lazy.&lt;/p&gt;

&lt;p&gt;I&apos;ve read something about moving the ProxyFactory to common and using code scanner tools, and the check should be about applying the optimization only when the form is&lt;/p&gt;

&lt;p&gt;return $this-&amp;gt;identifierField1;&lt;/p&gt;

&lt;p&gt;That&apos;s why I put the example of the regex. That would probably not be as safe as using some reflection-based tool, but surely more than just checking if the code is &amp;lt;= 4 lines...&lt;/p&gt;</comment>
                    <comment id="17251" author="ocramius" created="Sun, 15 Jan 2012 13:03:58 +0000"  >&lt;p&gt;Also don&apos;t know what stuff like EAccelerator (known in this Jira as of it&apos;s fantastic idea about stripping comments) would make the check of the 4 lines like.&lt;/p&gt;</comment>
                    <comment id="17280" author="beberlei" created="Mon, 16 Jan 2012 08:28:03 +0000"  >&lt;p&gt;This argument is void i just seen&lt;/p&gt;

&lt;p&gt;A method:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getIdentifierField1()
{
   &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;identifierField1? $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_myInitializationStuff() : &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
} 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will only used when the id is not set anyways.&lt;/p&gt;

&lt;p&gt;In any other case Ids are Immutable and changing them in your code would break a lot more than just this smart proxy method generation.&lt;/p&gt;</comment>
                    <comment id="17283" author="ocramius" created="Mon, 16 Jan 2012 09:28:51 +0000"  >&lt;p&gt;Nope, this code actually works only if the ID &lt;b&gt;is&lt;/b&gt; set &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
I&apos;m not talking about changing IDs, it&apos;s just that getters and setters don&apos;t always reflect the class attributes...&lt;/p&gt;</comment>
                    <comment id="17284" author="ocramius" created="Mon, 16 Jan 2012 09:56:15 +0000"  >&lt;p&gt;As of IRC there&apos;s 3 ways (for now) to get this solved:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Some code scanner/stronger checks (difficult/problems with private methods/slow)&lt;/li&gt;
	&lt;li&gt;Regex (as of description)&lt;/li&gt;
	&lt;li&gt;Adding configuration (per-entity or per-method. Probably too messy)&lt;/li&gt;
	&lt;li&gt;Documenting it as &quot;magic&quot; of proxies and let the users be aware of it&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1543] Support for Mapping Files on Traits</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1543</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;With PHP 5.4 and traits coming we should find a way where you can add xml and yml configurations for a trait and upon loading an entity X, it also loads the trait configuration of this entity.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13277">DDC-1543</key>
            <summary>Support for Mapping Files on Traits</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Dec 2011 17:08:06 +0000</created>
                <updated>Sat, 17 Dec 2011 17:08:06 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1530] HIDDEN values cannot be used in WhereClause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1530</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT  u, u.name AS HIDDEN n FROM User u WHERE n = ?1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is broken. Error:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;sclr16&apos; in &apos;where clause
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On a query like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT s0_.id AS id0, s0_.a AS a1, s0_.b AS b2, s0_.c AS c3, s0_.d AS d4, s0_.e AS e5, s0_.f AS f6, s0_.g AS g7, s0_.h AS h8, s0_.i AS i9, s0_.j AS j10, s0_.k AS k11, s0_.l AS l12, s0_.m AS m13, s0_.n AS n14, s0_.o AS o15, 123456789 AS sclr16, s0_.p AS p17 FROM myEntity s0_ WHERE s0_.a = 1 AND sclr16 &amp;lt;= ? ORDER BY sclr16 ASC 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13254">DDC-1530</key>
            <summary>HIDDEN values cannot be used in WhereClause</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Dec 2011 17:23:37 +0000</created>
                <updated>Wed, 25 Jan 2012 21:40:26 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17068" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:20:23 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                    <comment id="17209" author="craue" created="Mon, 9 Jan 2012 23:45:52 +0000"  >&lt;p&gt;It occurs even if the value is not HIDDEN.&lt;/p&gt;</comment>
                    <comment id="17212" author="beberlei" created="Tue, 10 Jan 2012 10:39:26 +0000"  >&lt;p&gt;@Christian this sounds like a completly different error, please explain why you think this belongs here or open a new ticket.&lt;/p&gt;</comment>
                    <comment id="17213" author="craue" created="Tue, 10 Jan 2012 10:47:38 +0000"  >&lt;p&gt;Benjamin: Because I get exactly the same error message regardless of using HIDDEN. So HIDDEN doesn&apos;t seem to be liable here.&lt;/p&gt;</comment>
                    <comment id="17214" author="beberlei" created="Tue, 10 Jan 2012 11:12:24 +0000"  >&lt;p&gt;Can you paste your DQL and SQL?&lt;/p&gt;</comment>
                    <comment id="17215" author="craue" created="Tue, 10 Jan 2012 12:22:18 +0000"  >&lt;p&gt;Code:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$queryBuilder
	-&amp;gt;select(&apos;myEntity, 123456789 AS distance&apos;)
	-&amp;gt;where(&apos;distance &amp;lt;= 10&apos;)
;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;DQL:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT myEntity, 123456789 AS distance FROM MyCompany\MyBundle\Entity\MyEntity myEntity WHERE distance &amp;lt;= 10
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;SQL:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT s0_.id AS id0, s0_.a AS a1, s0_.b AS b2, s0_.c AS c3, s0_.d AS d4, s0_.e AS e5, s0_.f AS f6, s0_.g AS g7, s0_.h AS h8, s0_.i AS i9, s0_.j AS j10, s0_.k AS k11, s0_.l AS l12, s0_.m AS m13, s0_.n AS n14, s0_.o AS o15, 123456789 AS sclr16, s0_.p AS p17 FROM myEntity s0_ WHERE sclr16 &amp;lt;= 10
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="17217" author="beberlei" created="Wed, 11 Jan 2012 11:33:32 +0000"  >&lt;p&gt;That is expected behavior, ANSI SQL defines SELECT to be evaluated &lt;b&gt;AFTER&lt;/b&gt; WHERE.&lt;/p&gt;

&lt;div class=&quot;code panel&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 1234 AS foo FROM `test` HAVING foo = 1234
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;DQL has a HAVING clause as well, not sure it works without the group by. Please try.&lt;/p&gt;</comment>
                    <comment id="17320" author="craue" created="Sat, 21 Jan 2012 14:04:28 +0000"  >&lt;p&gt;So we might just close this issue then?&lt;/p&gt;</comment>
                    <comment id="17335" author="beberlei" created="Wed, 25 Jan 2012 21:40:26 +0000"  >&lt;p&gt;Its not a bug, just the error message is supposed to be improved (if possible) in a cheap way.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1521] No way reuse parameters in custom function twice</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1521</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There is custom function:&lt;/p&gt;

&lt;div class=&quot;code panel&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 DistanceFunction &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; FunctionNode
{
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $fromLat;
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $fromLng;
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $toLat;
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $toLng;

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function parse(\Doctrine\ORM\Query\Parser $parser)
	{
		$parser-&amp;gt;match(Lexer::T_IDENTIFIER);
		$parser-&amp;gt;match(Lexer::T_OPEN_PARENTHESIS);

		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;fromLat = $parser-&amp;gt;ArithmeticPrimary();
		$parser-&amp;gt;match(Lexer::T_COMMA);

		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;fromLng = $parser-&amp;gt;ArithmeticPrimary();
		$parser-&amp;gt;match(Lexer::T_COMMA);

		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;toLat = $parser-&amp;gt;ArithmeticPrimary();
		$parser-&amp;gt;match(Lexer::T_COMMA);

		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;toLng = $parser-&amp;gt;ArithmeticPrimary();

		$parser-&amp;gt;match(Lexer::T_CLOSE_PARENTHESIS);
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
	{
		$fromLat = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;fromLat-&amp;gt;dispatch($sqlWalker);
		$fromLng = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;fromLng-&amp;gt;dispatch($sqlWalker);
		$toLat = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;toLat-&amp;gt;dispatch($sqlWalker);
		$toLng = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;toLng-&amp;gt;dispatch($sqlWalker);

		$earthDiameterInKM = 1.609344 * 3956 * 2;

		$sql = &lt;span class=&quot;code-quote&quot;&gt;&quot;($earthDiameterInKM * ASIN(SQRT(POWER(&quot;&lt;/span&gt; .
			&lt;span class=&quot;code-quote&quot;&gt;&quot;SIN(($fromLat - ABS($toLat)) * PI() / 180 / 2), 2) + &quot;&lt;/span&gt; .
			&lt;span class=&quot;code-quote&quot;&gt;&quot;COS($fromLat * PI() / 180) * COS(ABS($toLat) * PI() / 180) * &quot;&lt;/span&gt; .
			&lt;span class=&quot;code-quote&quot;&gt;&quot;POWER(SIN(($fromLng - $toLng) * PI() / 180 / 2), 2) &quot;&lt;/span&gt; .
			&lt;span class=&quot;code-quote&quot;&gt;&quot;)))&quot;&lt;/span&gt;;

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

&lt;p&gt;and the usage of 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;$em
	-&amp;gt;createQuery(&apos;SELECT DISTANCE(a.latitude, a.longitude, :lat, :lng) FROM Ololo:AbstractArea a WHERE a = 2&apos;)
	-&amp;gt;setParameter(&apos;lat&apos;, 1)
	-&amp;gt;setParameter(&apos;lng&apos;, 2)
	-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;what this function generate:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(12733.129728 * ASIN(SQRT(POWER(SIN((t0_.latitude - ABS(?)) * PI() / 180 / 2), 2) + COS(t0_.latitude * PI() / 180) * COS
(ABS(?) * PI() / 180) * POWER(SIN((t0_.longitude - ?) * PI() / 180 / 2), 2) )))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and exception raised: &quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens&quot;&lt;/p&gt;


&lt;p&gt;Don&apos;t know, does it affects on master branch (does they support native named parameters?).&lt;/p&gt;</description>
                <environment>sf2</environment>
            <key id="13243">DDC-1521</key>
            <summary>No way reuse parameters in custom function twice</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="koc">Konstantin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Dec 2011 21:35:20 +0000</created>
                <updated>Mon, 16 Jan 2012 03:20:15 +0000</updated>
                    <resolved>Mon, 16 Jan 2012 03:20:15 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17060" author="guilhermeblanco" created="Tue, 20 Dec 2011 05:06:13 +0000"  >&lt;p&gt;Issue cannot be reproduced on master.&lt;br/&gt;
Marking ticket as &quot;cannot reproduce&quot;.&lt;/p&gt;

&lt;p&gt;Added coverage on this commit: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/f6eb83705adc9603a87e8d194aa7f29e8ab36ebe&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/f6eb83705adc9603a87e8d194aa7f29e8ab36ebe&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17061" author="guilhermeblanco" created="Tue, 20 Dec 2011 05:18:19 +0000"  >&lt;p&gt;Ok, it seems this is only reproduceable on MySQL and PgSQL.&lt;/p&gt;

&lt;p&gt;Reopening and trying a fix.&lt;/p&gt;</comment>
                    <comment id="17076" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:45 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                    <comment id="17270" author="guilhermeblanco" created="Mon, 16 Jan 2012 03:20:15 +0000"  >&lt;p&gt;This issue is invalid.&lt;/p&gt;

&lt;p&gt;Whenever you want to point to an InputParameter, you have to call the dispatch() function.&lt;br/&gt;
Unfortunately, you cannot assign to a variable and reuse it freely. That way, Doctrine would only be notified once about the existence of a parameter, while actually you&apos;d be using in multiple places.&lt;/p&gt;

&lt;p&gt;The funny part is that pdo_sqlite addresses the issue internally, but other drivers don&apos;t. That was why I was unable to verify the issue in the first time.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1505] EntityManager-&gt;find returning null for entity on the inverse side of a OneToOne association </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1505</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;BasicEntityPersister.getJoinSQLForJoinColumns treats joinColumn nullable setting as defaulting to false:&lt;/p&gt;

&lt;p&gt;             if(isset($joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;)&lt;/p&gt;
{
                 return &apos;LEFT JOIN&apos;;
             }&lt;br/&gt;
&lt;br/&gt;
I think it should be:&lt;br/&gt;
&lt;br/&gt;
             if(!isset($joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;) || $joinColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;){                 return &apos;LEFT JOIN&apos;;             }</description>
                <environment></environment>
            <key id="13210">DDC-1505</key>
            <summary>EntityManager-&gt;find returning null for entity on the inverse side of a OneToOne association </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="asm89">Alexander</assignee>
                                <reporter username="chrisrichard">Chris Richard</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Nov 2011 02:57:57 +0000</created>
                <updated>Sun, 18 Dec 2011 21:19:50 +0000</updated>
                    <resolved>Sun, 18 Dec 2011 21:19:50 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                <fixVersion>Git Master</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17004" author="beberlei" created="Thu, 15 Dec 2011 22:07:43 +0000"  >&lt;p&gt;Assigned to asm&lt;/p&gt;</comment>
                    <comment id="17030" author="beberlei" created="Sun, 18 Dec 2011 20:35:04 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-226&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/226&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/226&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17031" author="asm89" created="Sun, 18 Dec 2011 20:35:14 +0000"  >&lt;p&gt;Should be fixed as soon as this is pulled:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/226&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/226&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17032" author="beberlei" created="Sun, 18 Dec 2011 21:00:04 +0000"  >&lt;p&gt;Related Pull Request was closed: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/226&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/226&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1450] UnitOfWork Transaction Rollback Support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1450</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The UnitOfWork does not handle the case very well where a rollback is necessary. Can this be optimized?&lt;/p&gt;</description>
                <environment></environment>
            <key id="13122">DDC-1450</key>
            <summary>UnitOfWork Transaction Rollback Support</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Oct 2011 07:51:09 +0000</created>
                <updated>Tue, 20 Dec 2011 22:21:37 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17073" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:37 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1445] Improve error messages</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1445</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Error messages throughout ClassMetadata validation and UnitOfWork cycles can be significantly improved.&lt;/p&gt;

&lt;p&gt;Work is being done on: &lt;a href=&quot;https://github.com/doctrine/doctrine2/tree/ImproveErrorMessages&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/tree/ImproveErrorMessages&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13110">DDC-1445</key>
            <summary>Improve error messages</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 22 Oct 2011 08:48:50 +0000</created>
                <updated>Tue, 20 Dec 2011 22:21:04 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17070" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:04 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1415] EventListener delegate on entity basis</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1415</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="13080">DDC-1415</key>
            <summary>EventListener delegate on entity basis</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Oct 2011 21:22:28 +0000</created>
                <updated>Tue, 20 Dec 2011 22:22:59 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16970" author="beberlei" created="Mon, 12 Dec 2011 15:46:34 +0000"  >&lt;p&gt;Removed from master, as i dont like the api at all&lt;/p&gt;</comment>
                    <comment id="17077" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:59 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1398] loading one item at a time when indexBy and EXTRA_LAZY fetch mode is used on a collection</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1398</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;collection-&amp;gt;get($key)&lt;/p&gt;

&lt;p&gt;Atm in 2.1.2 this is loading the entire collection. It would be really handy that it would extra lazy load only one item using the association and indexBy fields and given key value (if collection is not initialized and the key havent been loaded yet ofc)&lt;/p&gt;

&lt;p&gt;Am i making sense with this? &lt;/p&gt;</description>
                <environment></environment>
            <key id="13053">DDC-1398</key>
            <summary>loading one item at a time when indexBy and EXTRA_LAZY fetch mode is used on a collection</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="hypno">Reio Piller</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Sep 2011 18:34:38 +0000</created>
                <updated>Sat, 10 Mar 2012 16:30:19 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="17075" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:20 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                    <comment id="17526" author="gcaseres" created="Mon, 5 Mar 2012 22:02:25 +0000"  >&lt;p&gt;Is there any fix for this? i have the same problem.&lt;/p&gt;</comment>
                    <comment id="17544" author="deatheriam" created="Sat, 10 Mar 2012 16:29:38 +0000"  >&lt;p&gt;It makes a perfect sense here, I wish it was possible, it would give us a room for even more optimization. Any input on the issue from the developers?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1393] Skipping tables or columns in database driver or SchemaTool</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1393</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There should be a sane way to skip sources of errors in SchemaTool and the DatabaseDriver.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13040">DDC-1393</key>
            <summary>Skipping tables or columns in database driver or SchemaTool</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Sep 2011 12:23:10 +0000</created>
                <updated>Tue, 20 Dec 2011 22:21:26 +0000</updated>
                                    <version>2.1.1</version>
                <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16502" author="beberlei" created="Sat, 24 Sep 2011 13:17:52 +0000"  >&lt;p&gt;Idea:&lt;/p&gt;

&lt;p&gt;Develop a datastructure of sorts that allows saving information about skipping tables and columns therein when reverse engeneering.&lt;/p&gt;</comment>
                    <comment id="16953" author="guilhermeblanco" created="Fri, 9 Dec 2011 04:48:47 +0000"  >&lt;p&gt;This is not possible unless you take advantage of Topological Sorting to map class dependencies like we do inside of UnitOfWork AFTER creating the ClassMetadata.&lt;/p&gt;

&lt;p&gt;The necessity of having this is mandatory because we can never skip classes that have associations to other ones though FK.&lt;br/&gt;
You may try that, but it doesn&apos;t compensate the effort. I&apos;d rather mark this bug as won&apos;t fix, but I&apos;m leaving for you do that. =)&lt;/p&gt;</comment>
                    <comment id="17072" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:26 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1373] Map file with specific class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1373</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi there,&lt;br/&gt;
AbsractFileDriver is using the filename to know the managed class.&lt;/p&gt;

&lt;p&gt;It&apos;s a cool feature because it&apos;s allow loading on-demand.&lt;br/&gt;
The problem is, that the filename must be the name of the Class.&lt;/p&gt;

&lt;p&gt;It should be great to be able to manually map XML/YAML File description to a Class, like :&lt;br/&gt;
$drivers-&amp;gt;addMappingFile ( array ( &quot;filename&quot; =&amp;gt; &quot;class&quot;, &quot;filename2&quot; =&amp;gt; &quot;class2&quot;) );&lt;/p&gt;

&lt;p&gt;This feature is simple to implement, just add a new array inside AbsractFileDriver to know the mapping.&lt;br/&gt;
When using the current method with addPaths, parse the folder to get traditional XML/YAML file where filename corresponding to classname and add it to the mapping array.&lt;/p&gt;

&lt;p&gt;AbsractFileDriver-&amp;gt;getAllClassNames () just return value of mapping array.&lt;br/&gt;
The mapping array is store inside cache.&lt;/p&gt;

&lt;p&gt;With this new feature, it allow developers to create a pretty folder that contains entities mapping.&lt;/p&gt;

&lt;p&gt;Armetiz.&lt;/p&gt;</description>
                <environment>Debian LAMP - PHP5.3 - Apache 2</environment>
            <key id="13015">DDC-1373</key>
            <summary>Map file with specific class</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Sep 2011 12:08:01 +0000</created>
                <updated>Tue, 14 Feb 2012 22:53:37 +0000</updated>
                                    <version>2.1.1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17078" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:23:45 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1370] preInsert, postInsert, prePersist, postPersist, preUpdate, postUpdate code and documentation of events</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1370</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently we have a set of Lifecycle events, but they seem to be misleading both in actual implementation and documentation.&lt;/p&gt;

&lt;p&gt;One good example is prePersist and postPersist, which is only fired when you&apos;re creating new entities. It should be renamed to preInsert and postInsert.&lt;br/&gt;
As of preUpdate and postUpdate, they seem quite valid.&lt;/p&gt;

&lt;p&gt;But if we rename prePersist and postPersist to (pre|post)Insert, we may have a situation where you wanna cover both insert and update.&lt;br/&gt;
For this, (pre|post)Persist should be reinstated, but acting differently from what it does currently.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13007">DDC-1370</key>
            <summary>preInsert, postInsert, prePersist, postPersist, preUpdate, postUpdate code and documentation of events</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Sep 2011 20:03:57 +0000</created>
                <updated>Tue, 20 Dec 2011 22:23:54 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16459" author="rdohms" created="Fri, 9 Sep 2011 20:07:39 +0000"  >&lt;p&gt;Also, documentation for post* methods is broken at the website:&lt;/p&gt;

&lt;p&gt;&quot;Changes in here are not relevant to the persistence in the database, but you can use this events to&quot; &lt;/p&gt;

&lt;p&gt;It cuts off in mid-sentence.&lt;/p&gt;</comment>
                    <comment id="16954" author="guilhermeblanco" created="Fri, 9 Dec 2011 04:51:27 +0000"  >&lt;p&gt;RDohms, this paragraph was already sorted out.&lt;/p&gt;

&lt;p&gt;The actual ticket is still valid here.&lt;/p&gt;</comment>
                    <comment id="17079" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:23:54 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1320] Ship Immutable date time with Doctrine Common, use in ORM - Should implement __toString()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1320</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12904">DDC-1320</key>
            <summary>Ship Immutable date time with Doctrine Common, use in ORM - Should implement __toString()</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 6 Aug 2011 17:05:04 +0000</created>
                <updated>Mon, 31 Oct 2011 19:16:21 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16745" author="beberlei" created="Mon, 31 Oct 2011 19:16:21 +0000"  >&lt;p&gt;Has to be pushed back as immutable date time cannot be implemented in userland that well.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="12896">DDC-1316</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1308] Add cache for transient information and invalidation for ClassMetadata</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1308</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Two different things have to be improved in the caching:&lt;/p&gt;

&lt;p&gt;1. The information isTransient() has to be moved to the ClassMetadataFactory and cached there.&lt;br/&gt;
2. The information getAllClassMetadataNames() can be cached&lt;br/&gt;
3. A debug/development mode should be introduced, leading to filemtime caching and checks so that you can use ApcCache and such in development.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12882">DDC-1308</key>
            <summary>Add cache for transient information and invalidation for ClassMetadata</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 31 Jul 2011 18:45:24 +0000</created>
                <updated>Tue, 20 Dec 2011 22:20:51 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17069" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:20:51 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1285] Select by multiple ids</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1285</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;How do you look at adding findByIds(array $ids) to EntityManager and UnitOfWork? This would allow fetching multiple entities from a database at one request and would be very useful for caching - there would be even some kind of IdentityMap kept in memcached or any other caching engine, that supports multiple id retrieval: i&apos;ve been using such an architecture in multiple projects and it turned out to be very effective. There were two basic methods - findIdsByFilter(array $filter) and findEntitiesByIds(array $ids). The latter one had a caching proxy, replicating entities to a cache storage. If this idea proceeds - I&apos;d be glad to cover it with more details.&lt;/p&gt;

&lt;p&gt;This topic on StackOverflow could also help:&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/276709/design-pattern-for-memcached-data-caching&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/276709/design-pattern-for-memcached-data-caching&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12842">DDC-1285</key>
            <summary>Select by multiple ids</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="serge.smertin">Serge Smertin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Jul 2011 12:30:34 +0000</created>
                <updated>Fri, 11 Jan 2013 01:13:32 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17071" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:21:15 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1265] Evaluate skip operations / loading through events</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1265</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12809">DDC-1265</key>
            <summary>Evaluate skip operations / loading through events</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jul 2011 22:22:39 +0000</created>
                <updated>Tue, 6 Sep 2011 18:10:37 +0000</updated>
                    <resolved>Tue, 6 Sep 2011 18:10:37 +0000</resolved>
                                            <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16442" author="beberlei" created="Tue, 6 Sep 2011 18:10:37 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-17&quot; title=&quot;Ability to skip the operation from a pre-operation event handler&quot;&gt;DDC-17&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1264] Add more math related DQL funcs (trig, round, stuff?)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1264</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12808">DDC-1264</key>
            <summary>Add more math related DQL funcs (trig, round, stuff?)</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jul 2011 22:22:04 +0000</created>
                <updated>Sat, 9 Jul 2011 22:22:04 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1262] Have proxies copy docblocks aswell</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1262</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Whenever a Proxy is generated it does not copy the docblocks.&lt;/p&gt;

&lt;p&gt;This means when you do something like &quot;$refl = new ReflectionObject($proxy)&quot; you might be in trouble.&lt;/p&gt;

&lt;p&gt;However if we add docblocks then we have to make sure that proxies do not magically appear as entities by throwing an exception in the AnnotationDriver.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12805">DDC-1262</key>
            <summary>Have proxies copy docblocks aswell</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jul 2011 12:29:21 +0000</created>
                <updated>Sat, 9 Jul 2011 12:29:21 +0000</updated>
                                    <version>2.0.6</version>
                <version>2.1</version>
                <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1229] generate entity interactive dialog: id column</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1229</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;according to Stof, this bug &lt;a href=&quot;https://github.com/sensio/SensioGeneratorBundle/issues/21&quot; class=&quot;external-link&quot;&gt;https://github.com/sensio/SensioGeneratorBundle/issues/21&lt;/a&gt; comes from the doctrine tools implementation:&lt;/p&gt;


&lt;p&gt;in the dialog, i first specified that i want a field id of type integer. the result was&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;Duplicate definition of column &apos;id&apos; on entity &apos;Liip\DemoBundle\Entity\Event&apos; in a field or discriminator column mapping.&lt;/p&gt;

&lt;p&gt;and no file was created.&lt;/p&gt;

&lt;p&gt;The dialog should tell me i can not create a field named id. (Or better ask first if i want my id column named id or something else.)&lt;/p&gt;

&lt;p&gt;It would be nice if it would write some file even if its not valid, with a warning on top. As it is, i lost all my work of specifying fields. (Luckily was just playing around)&lt;/p&gt;</description>
                <environment></environment>
            <key id="12751">DDC-1229</key>
            <summary>generate entity interactive dialog: id column</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dbu">David Buchmann</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Jun 2011 07:06:45 +0000</created>
                <updated>Tue, 28 Jun 2011 19:42:25 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16092" author="beberlei" created="Tue, 28 Jun 2011 19:42:25 +0000"  >&lt;p&gt;not a bug, its a feature (though a dumb one). Improvement in a next version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1219] Remove dependancy on Collection interface in Domain Objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1219</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes.&lt;br/&gt;
I &apos;m not talking about PersistentCollection here, fully aware of that being tied into Doctrine, but those are injected, this is all about code dependency on ArrayCollection.&lt;/p&gt;


&lt;p&gt;Seems like some of the UnitOfWork code is cable of handling other types of arrays, like:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    // If $actualData[$name] is not a Collection then use an ArrayCollection.
    if ( ! $actualData[$name] instanceof Collection) {
        $actualData[$name] = new ArrayCollection($actualData[$name]);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But in __cascade* functions this is not the case in all but two:&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;    if ($relatedEntities instanceof Collection) {
        if ($relatedEntities instanceof PersistentCollection) {
            // Unwrap so that foreach() does not initialize
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;2 however have:&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;    if (($relatedEntities instanceof Collection || is_array($relatedEntities))) {
        if ($relatedEntities instanceof PersistentCollection) {
            // Unwrap so that foreach() does not initialize
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Would it be an idea to do &quot;instanceof Traversable&quot; instead of &quot; instanceof Collection&quot;? &lt;/p&gt;</description>
                <environment></environment>
            <key id="12730">DDC-1219</key>
            <summary>Remove dependancy on Collection interface in Domain Objects</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="anderom">Andr&#233; R.</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jun 2011 11:13:39 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                    <version>2.1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16035" author="anderom" created="Tue, 21 Jun 2011 11:21:07 +0000"  >&lt;p&gt;Note: If the fist code block is always performed before the last 2 blocks then there is no issue here, just a need to make it more clear in Doc that this is possible but that you should not rely custom implementation as PersistentCollection will be injected when loaded from db.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1216] A way to mark an entity to always use result cache. Like @UseResultCache class annotation.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1216</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;So that even associations, find(), findBy() etc will be affected. Very useful for entities that are being used on every request.&lt;/p&gt;

&lt;p&gt;Is that thinkable?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12726">DDC-1216</key>
            <summary>A way to mark an entity to always use result cache. Like @UseResultCache class annotation.</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="hypno">Reio Piller</reporter>
                        <labels>
                    </labels>
                <created>Sun, 19 Jun 2011 12:49:04 +0000</created>
                <updated>Fri, 6 Apr 2012 13:07:25 +0000</updated>
                                    <version>2.x</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17780" author="holtkamp" created="Fri, 6 Apr 2012 13:07:25 +0000"  >&lt;p&gt;During development, I tried to have the out-of-the-box ORM layer handle as much of the queries as possible, essentially I used the Repository functions a lot: &lt;/p&gt;

&lt;p&gt;For example, having a specific Repository extend the Doctrine EntityRepository and do something like:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
    public function findByName($name)
    {
        $criteria = array(&apos;_name&apos; =&amp;gt; $name);
        return parent::findBy($criteria);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Now all functionality is developed, I am optimizing performance and I find myself having to refer my Repository to my DAO layer which uses DQL, so I can enable the DQL Result Cache...&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; 
    public function findByName($name)
    {
       //Use the DAO so we can enable DQL ResultSet caching
        return $this-&amp;gt;_getDao()-&amp;gt;loadByName($name);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;It would be nice to be able to configure &apos;DQL Result Cache = on&apos; on Repository level as well...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1200] Derived Id Generator</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1200</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For usage with the foreign key as primary key features described in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-117&quot; title=&quot;Allow @Id on @ManyToOne fields&quot;&gt;&lt;del&gt;DDC-117&lt;/del&gt;&lt;/a&gt; a derived id generator would be tons of useful. It is essentially a post generate id generator (sort of late pre insert though) assigned generator.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12705">DDC-1200</key>
            <summary>Derived Id Generator</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Jun 2011 20:46:56 +0000</created>
                <updated>Wed, 9 Nov 2011 21:41:30 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="16788" author="yourwebmaker" created="Wed, 9 Nov 2011 21:41:30 +0000"  >&lt;p&gt;When this will be fixed?&lt;/p&gt;

&lt;p&gt;I think this is related to &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/7e1cfa9c4c99af31&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/7e1cfa9c4c99af31&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12891">DDC-1315</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1178] Have access to &quot;original&quot; metadata in events subscribed to loadClassMetadata</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1178</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you subscribe to loadClassMetadata you will usually modify the metadata for some classes.&lt;br/&gt;
The problem is, that that data has to be loaded from somewhere. But later down the chain you can&apos;t get to it. Now data specific to what you need in your loadClassMetadata  would ideally reside in the same location.&lt;br/&gt;
If we take for example a file, than all data for a specific entity is in the same file.&lt;/p&gt;

&lt;p&gt;My proposal would be to add function get(Original|Raw)MappingData into interface Doctrine\ORM\Mapping\Driver\Driver which would either return raw data or data in a object specific for that Driver or null if it doesn&apos;t make sense for that driver. Please note, that when loading from e.g XmlDriver we should return simplexmlnode or dom node as loadClassMetadata  should be in its own namespace and not pollute the Doctrine one.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12676">DDC-1178</key>
            <summary>Have access to &quot;original&quot; metadata in events subscribed to loadClassMetadata</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 May 2011 17:56:21 +0000</created>
                <updated>Fri, 27 May 2011 18:31:28 +0000</updated>
                                    <version>2.x</version>
                                <fixVersion>2.x</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15892" author="gediminasm" created="Fri, 27 May 2011 18:31:28 +0000"  >&lt;p&gt;Sounds logic, each driver would expect NULL or data (wrapped specifically for the driver used)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-952] Several features to batch eager selects more efficently</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-952</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This ticket aggregates several strategies to optimize batching of eager selects.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12257">DDC-952</key>
            <summary>Several features to batch eager selects more efficently</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Dec 2010 18:14:21 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15074" author="beberlei" created="Fri, 31 Dec 2010 06:47:18 +0000"  >&lt;p&gt;Requirements for batching of eager loads:&lt;/p&gt;

&lt;p&gt;1. Since we are using an IN() query for this we can only support this feature for entities that have a single column primary key.&lt;br/&gt;
2. If we want to support composite keys we need to build it as WHERE ( (id1 = ? AND id2 = ?) OR (id1 = ? AND id2 = ?)) but this is currently not possible with the way how internally the $criteria array is used.&lt;/p&gt;</comment>
                    <comment id="15075" author="beberlei" created="Fri, 31 Dec 2010 07:38:56 +0000"  >&lt;p&gt;Next item to think about: What if an exception or event breaks the flow and &quot;triggerEagerLoads()&quot; is never called?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
            <subtask id="10197">DDC-53</subtask>
            <subtask id="11731">DDC-733</subtask>
            <subtask id="11736">DDC-734</subtask>
            <subtask id="12076">DDC-865</subtask>
            <subtask id="12249">DDC-914</subtask>
            <subtask id="12269">DDC-963</subtask>
            <subtask id="12453">DDC-1060</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-947] Optmize Code-Generation Strategies</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-947</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should optimize code-generation somehow.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12251">DDC-947</key>
            <summary>Optmize Code-Generation Strategies</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Dec 2010 06:22:17 +0000</created>
                <updated>Tue, 29 Mar 2011 14:38:48 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15630" author="beberlei" created="Tue, 29 Mar 2011 14:38:48 +0000"  >&lt;p&gt;Descheduled to 2.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-896] Use PDepend for Code-Generation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-896</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Our current code-generation tool has many shortcomings and due to its hard to test nature also many (known and unknown) bugs, as well as high maintenance.&lt;/p&gt;

&lt;p&gt;Since people are overusing this tool and I am sort of annoyed by how much time goes into this we should rewrite this in a two-step procedure:&lt;/p&gt;

&lt;p&gt;1. Move code into Common so we can share it between ORM, Mongo and CouchDB.&lt;br/&gt;
2. Use PDepend to read an entities source file (it generates an AST) and modify the AST with the required changes.&lt;/p&gt;

&lt;p&gt;This gives us the advantage of having to maintaining less code for this stuff.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12169">DDC-896</key>
            <summary>Use PDepend for Code-Generation</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 27 Nov 2010 13:51:06 +0000</created>
                <updated>Sat, 27 Nov 2010 13:51:19 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-838] SchemaTool - ignores the attribute uniq in relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-838</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Mapper&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Default_Model_Test&quot;&lt;/span&gt; table=&lt;span class=&quot;code-quote&quot;&gt;&quot;test&quot;&lt;/span&gt;&amp;gt;
  &amp;lt;id name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;generator strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;/&amp;gt;
  &amp;lt;/id&amp;gt;
  &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;blabla&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;blabla&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;/&amp;gt;
  &amp;lt;one-to-one field=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt; target-entity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Users_Model_User&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;join-column name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users_id&quot;&lt;/span&gt; referenced-column-name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; on-delete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt; on-update=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt; unique=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/one-to-one&amp;gt;
&amp;lt;/entity&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;SQL&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE test (id INT AUTO_INCREMENT NOT NULL, users_id INT DEFAULT NULL, blabla TINYINT(1) NOT NULL, UNIQUE INDEX test_users_id_uniq (users_id), PRIMARY KEY(id)) ENGINE = InnoDB;
ALTER TABLE test ADD FOREIGN KEY (users_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Actual:&lt;br/&gt;
UNIQUE INDEX test_users_id_uniq (users_id)&lt;/p&gt;

&lt;p&gt;Expected:&lt;br/&gt;
INDEX test_users_id (users_id)&lt;/p&gt;</description>
                <environment>Ubuntu, PHP 5.3.2, MySQL </environment>
            <key id="12005">DDC-838</key>
            <summary>SchemaTool - ignores the attribute uniq in relations</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="gektor">gektor</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Oct 2010 12:01:46 +0000</created>
                <updated>Fri, 29 Oct 2010 09:23:04 +0000</updated>
                                    <version>2.0-BETA4</version>
                                <fixVersion>2.x</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14564" author="beberlei" created="Thu, 14 Oct 2010 03:35:46 +0000"  >&lt;p&gt;Verified, i just don&apos;t understand why you are using a one-to-one relation and then &quot;deactivate&quot; the database constraint for this. You could easily use Many-To-One&lt;/p&gt;</comment>
                    <comment id="14566" author="gektor" created="Thu, 14 Oct 2010 08:25:18 +0000"  >&lt;p&gt;You are right. It&apos;s not a bug, it&apos;s feature.&lt;/p&gt;</comment>
                    <comment id="14612" author="beberlei" created="Fri, 29 Oct 2010 09:23:04 +0000"  >&lt;p&gt;This might still be a good improvement to allow the flexibility, but its not a bug. Updating to &quot;Minor Improvmenet for 2.x&quot;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-821] Consider adding Query-Join as another join method for DQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-821</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Some ORM systems support an alternative to fetch-join queries, called a &quot;query-join&quot;.  See &lt;a href=&quot;http://www.avaje.org/ebean/introquery_joinquery.html&quot; class=&quot;external-link&quot;&gt;http://www.avaje.org/ebean/introquery_joinquery.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A query-join accomplishes the same as a fetch-join (hydrating a larger object graph across all associations types) but executes more than one SQL query in sequence in order to hydrate the requested portions of the graph in a result set.  The first query retrieves data from the base entity/table and the next queries retrieve the data for the requested associations.&lt;/p&gt;

&lt;p&gt;In some cases this approach is more efficient to a fetch-join:&lt;/p&gt;

&lt;p&gt;(1) &lt;b&gt;No data duplication in the SQL result&lt;/b&gt; as occurs in a fetch-join on to-many associations.  Instead, this data is loaded through a second query.  This saves network traffic, memory and general overhead in hydrating the returned results.  In the case where large TEXT data is included in result sets, the savings here may be substantial.&lt;/p&gt;

&lt;p&gt;(2) &lt;b&gt;setFirstResult() and setMaxResult() are again effective (for pagination)&lt;/b&gt; and more importantly more efficient on these query-joins.  The current DoctrineExtension solution to enable pagination on fetch-joins requires a series of queries to determine the target primary keys of the root entity of the query.  The primary key lookup query requires DISTINCT or GROUP BY &amp;#8211; which often triggers filesorts, temporary tables, etc (at least on MySQL) and greatly slows down the query.  Query joins would not require this. &lt;/p&gt;

&lt;p&gt;Possible implementation example:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-comment&quot;&gt;// existing fetch-join
&lt;/span&gt;$query = $em-&amp;gt;createQuery(&apos;SELECT c, o FROM Customers c JOIN c.orders o&apos;);
$query-&amp;gt;setFirstResult(10)-&amp;gt;setMaxResult(20); &lt;span class=&quot;code-comment&quot;&gt;// doesn&apos;t &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; what you&apos;d hope it would &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt;, no ability to use &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; pagination
&lt;/span&gt;$customersAndOrders = $query-&amp;gt;getResult(); &lt;span class=&quot;code-comment&quot;&gt;// array of Customer objects with Orders hydrated
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// proposed query-join
&lt;/span&gt;$query = $em-&amp;gt;createQuery(&apos;SELECT c, o FROM Customers c QUERY JOIN c.orders o&apos;);
$query-&amp;gt;setFirstResult(10)-&amp;gt;setMaxResult(20); &lt;span class=&quot;code-comment&quot;&gt;// now works &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; pagination
&lt;/span&gt;$customersAndOrders = $query-&amp;gt;getResult(); &lt;span class=&quot;code-comment&quot;&gt;// array of Customer objects with Orders hyrdated
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; would execute a series of queries -- i.e. in SQL
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// SELECT ... FROM customers LIMIT 10, 20
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// SELECT ... FROM orders WHERE customer_id IN (.....)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and/or,  could there be a way to trigger a &quot;query-join&quot; against an existing array of entities?  for example&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $em-&amp;gt;createQuery(&apos;SELECT c FROM Customers c&apos;); &lt;span class=&quot;code-comment&quot;&gt;// single query to fetch customers
&lt;/span&gt;$customers = $query-&amp;gt;getResult(); &lt;span class=&quot;code-comment&quot;&gt;// array of Customer objects
&lt;/span&gt;$em-&amp;gt;join($customers, &apos;orders&apos;); &lt;span class=&quot;code-comment&quot;&gt;// fetch and hydrate the &apos;orders&apos; association on each Customer using a single query&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Perhaps at some point in the future Doctrine/DBAL could even make use of asynchronous queries (i.e. mysqlnd supports this) to allow these query-joins to run in parallel and the result would be more efficient paginated resultsets.&lt;/p&gt;

&lt;p&gt;Thoughts/feedback?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11962">DDC-821</key>
            <summary>Consider adding Query-Join as another join method for DQL</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Sep 2010 15:14:23 +0000</created>
                <updated>Wed, 29 Dec 2010 00:49:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14494" author="beberlei" created="Thu, 30 Sep 2010 03:50:53 +0000"  >&lt;p&gt;There is another approach for this using several subqueries to build an IN clause, the Paginator extension supports this: &lt;a href=&quot;http://github.com/beberlei/DoctrineExtensions&quot; class=&quot;external-link&quot;&gt;http://github.com/beberlei/DoctrineExtensions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I rather go the extension approach than changing the DQL for this feature.&lt;/p&gt;</comment>
                    <comment id="14497" author="beberlei" created="Thu, 30 Sep 2010 04:31:13 +0000"  >&lt;p&gt;I just saw your second example, that is rather cool though and gets +1 from me.&lt;/p&gt;

&lt;p&gt;I had the same idea for &quot;not initialized proxies&quot;, i.e.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$em-&amp;gt;getUnitOfWork()-&amp;gt;initializeProxies(&apos;Customer&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15051" author="mjh_ca" created="Wed, 29 Dec 2010 00:49:46 +0000"  >&lt;p&gt;Second example is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-734&quot; title=&quot;Possibility to fetch all outstanding proxies of an Entity&quot;&gt;&lt;del&gt;DDC-734&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-810] Issue with detaching entities and updating when using change notification</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-810</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;More information coming soon. Attaching a test case&lt;/p&gt;</description>
                <environment></environment>
            <key id="11931">DDC-810</key>
            <summary>Issue with detaching entities and updating when using change notification</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Sep 2010 12:43:08 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                    <version>2.0-BETA4</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14415" author="beberlei" created="Mon, 20 Sep 2010 05:09:49 +0000"  >&lt;p&gt;From reading the issue i know what the bug is, indeed this sucks.&lt;/p&gt;</comment>
                    <comment id="14487" author="romanb" created="Tue, 28 Sep 2010 16:27:00 +0000"  >&lt;p&gt;@Jon: Any more information coming?&lt;/p&gt;

&lt;p&gt;@Benjamin: Can you summarize the essence of the issue shortly?&lt;/p&gt;</comment>
                    <comment id="14489" author="beberlei" created="Wed, 29 Sep 2010 03:02:12 +0000"  >&lt;p&gt;@Roman: The UnitOfWork (may) still be pushed as a listener into that entity, and still recieve noticies of update. Which may throw notices because the oid hashes are removed everywhere. Additionally you cant serialize the thing because you still got the UoW inside there.&lt;/p&gt;</comment>
                    <comment id="14524" author="jwage" created="Mon, 4 Oct 2010 19:48:17 +0000"  >&lt;p&gt;I don&apos;t have anymore information currently. The issue was relayed to me. I will try and find some more information and report back.&lt;/p&gt;</comment>
                    <comment id="15669" author="beberlei" created="Sun, 3 Apr 2011 14:38:51 +0000"  >&lt;p&gt;There is no way to &quot;fix&quot; this issue, i am turning it into a feature request. There needs to be a &quot;postDetach&quot; event that is triggered where the developer can detach the change notification objects.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10804" name="DDC810Test.php" size="4266" author="jwage" created="Fri, 17 Sep 2010 12:43:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-763] Cascade merge on associated entities can insert too many rows through &quot;Persistence by Reachability&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-763</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I think that the UnitOfWork needs to maintain a map of spl_object_hash($newEntity)-&amp;gt;$managedEntity for entities that were persisted via reachability during a merge.  doMerge should then only call persistNew if the original entity has not already been persisted (if it has already been persisted it should merge the managed entity from the map).  The map should be maintained until a flush() or until the UnitOfWork is cleared.  The reasoning is as follows.&lt;/p&gt;

&lt;p&gt;Imagine we have a simple doctor object with no associations:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$doctor = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctor();
$em-&amp;gt;persist($doctor);
$em-&amp;gt;persist($doctor);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After the first persist() $doctor is MANAGED so the second persist has no effect and this results in a single Doctor row.&lt;/p&gt;

&lt;p&gt;If we do the same thing using merge and persistence by reachability:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$doctor = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctor();
$em-&amp;gt;merge($doctor);
$em-&amp;gt;merge($doctor);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;we get 2 Doctor rows being added.&lt;/p&gt;

&lt;p&gt;Obviously in this particular case we should use the return value from the first merge() as the parameter of the second merge which would give correct behaviour.&lt;/p&gt;

&lt;p&gt;However, now imagine one Doctor has many Patients and many Patients have one Doctor, all the associations have cascade merge enabled, and further assume that $d1 (Doctor id=1) is already in the database.  We now attempt to create two patients and assign them to the existing doctor:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$d1= &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctor(); $d1-&amp;gt;id = 1; &lt;span class=&quot;code-comment&quot;&gt;// This is a DETACHED entity
&lt;/span&gt;
$p1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Patient();
$p2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Patient();

$d1-&amp;gt;patients-&amp;gt;add($p1); $p1-&amp;gt;doctor = $d1;
$d1-&amp;gt;patients-&amp;gt;add($p2); $p2-&amp;gt;doctor = $d1;

$em-&amp;gt;merge($p1);
$em-&amp;gt;merge($p2);

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

&lt;p&gt;This actually results in 4 rows being added to the &apos;patients&apos; table instead of 2, I think because $p1 and $p2 are getting persisted both as the root objects and then again from the patient-&amp;gt;doctor-&amp;gt;patients array.  Since the cascade merging happens internally we can&apos;t replace the array contents with the managed return values without walking through the object graph (in which case there is no point in using cascade merge in the first place).  Maintaining a map in UnitOfWork will allow doMerge to ensure it doesn&apos;t persist the same entities twice.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure, but this might be relevant for cascade persist too.&lt;/p&gt;

&lt;p&gt;P.S. Another bug report on this can be found at &lt;a href=&quot;http://code.google.com/p/flextrine2/issues/detail?id=32&quot; class=&quot;external-link&quot;&gt;http://code.google.com/p/flextrine2/issues/detail?id=32&lt;/a&gt; (it basically says the same thing with different entities).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11812">DDC-763</key>
            <summary>Cascade merge on associated entities can insert too many rows through &quot;Persistence by Reachability&quot;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Aug 2010 05:55:30 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14135" author="beberlei" created="Sun, 29 Aug 2010 04:59:05 +0000"  >&lt;p&gt;@Roman A possible fix for this in my opinion is another map in UnitOfWork $mergedEntities = array(); and a patch like this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index 242d84b..1d0d8b3 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -1340,6 +1340,10 @@ class UnitOfWork &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; PropertyChangedListener
             &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;; &lt;span class=&quot;code-comment&quot;&gt;// Prevent infinite recursion
&lt;/span&gt;         }
 
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;mergedEntities[$oid])) {
+            &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;mergedEntities[$oid];
+        }
+
         $visited[$oid] = $entity; &lt;span class=&quot;code-comment&quot;&gt;// mark visited
&lt;/span&gt; 
         $class = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;getClassMetadata(get_class($entity));
@@ -1468,6 +1472,8 @@ class UnitOfWork &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; PropertyChangedListener
 
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cascadeMerge($entity, $managedCopy, $visited);
 
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;mergedEntities[$oid] = $managedCopy;
+
         &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $managedCopy;
     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14139" author="ccapndave" created="Sun, 29 Aug 2010 05:38:51 +0000"  >&lt;p&gt;I have tested this patch with my application and it fixes the problem in all my relevant test cases apart from one.  The test case that&apos;s failing is one that persists a bi-directional many to many relationship, so the associations interweave with each other (if you know what I mean).&lt;/p&gt;

&lt;p&gt;I wonder if perhaps doMerge need to continue cascading even if it finds an item in $this-&amp;gt;mergedEntities&lt;/p&gt;

&lt;p&gt;This is the Flextrine code that fails - it results in no entries in movie_artist.  This might also be related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-758&quot; title=&quot;When merging many to many entites back into the repository changes to the associations are not respected&quot;&gt;&lt;del&gt;DDC-758&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;m1 = new Movie();&lt;br/&gt;
m1.title = &quot;Movie 1&quot;;&lt;/p&gt;

&lt;p&gt;m2 = new Movie();&lt;br/&gt;
m2.title = &quot;Movie 2&quot;;&lt;/p&gt;

&lt;p&gt;a1 = new Artist();&lt;br/&gt;
a1.name = &quot;Artist 1&quot;;&lt;/p&gt;

&lt;p&gt;a2 = new Artist();&lt;br/&gt;
a2.name = &quot;Artist 2&quot;;&lt;/p&gt;

&lt;p&gt;m1.artists.addItem(a1); a1.movies.addItem(m1);&lt;br/&gt;
m1.artists.addItem(a2); a2.movies.addItem(m1);&lt;/p&gt;

&lt;p&gt;m2.artists.addItem(a1); a1.movies.addItem(m2);&lt;br/&gt;
m2.artists.addItem(a2); a2.movies.addItem(m2);&lt;/p&gt;

&lt;p&gt;// These translate to cascade merges on the server &lt;br/&gt;
em.persist(m1);&lt;br/&gt;
em.persist(m2);&lt;br/&gt;
em.persist(a1);&lt;br/&gt;
em.persist(a2);&lt;/p&gt;

&lt;p&gt;// Now flush&lt;br/&gt;
em.flush();&lt;/p&gt;</comment>
                    <comment id="14140" author="ccapndave" created="Sun, 29 Aug 2010 05:40:26 +0000"  >&lt;p&gt;P.S. This test passes if I translate em.persist() to $em-&amp;gt;persist() (not cascading) on the server instead of translating it to a cascade merge; not sure if that helps&lt;/p&gt;</comment>
                    <comment id="14149" author="romanb" created="Mon, 30 Aug 2010 06:17:09 +0000"  >&lt;p&gt;I&apos;d really like to avoid introducing an additional instance variable just to solve this issue but I did not find the time yet to really look into it.&lt;/p&gt;

&lt;p&gt;Does someone have a unit test for this already and can attach it to the issue? &lt;/p&gt;</comment>
                    <comment id="14198" author="romanb" created="Tue, 31 Aug 2010 14:56:58 +0000"  >&lt;p&gt;Rescheduling for RC1.&lt;/p&gt;</comment>
                    <comment id="14356" author="ccapndave" created="Mon, 13 Sep 2010 07:27:17 +0000"  >&lt;p&gt;Here is a functional test case containing three tests:&lt;/p&gt;

&lt;p&gt;testMultiMerge tests basic merging of two new entities, checking that only a single entity ends up in the database.  This passes with Benjamin&apos;s patch.&lt;/p&gt;

&lt;p&gt;testMultiCascadeMerge tests the more complex case of merging a OneToMany association. This also passes with Benjamin&apos;s patch.&lt;/p&gt;

&lt;p&gt;testManyToManyPersistByReachability tests the ManyToMany case described above and this fails with Benjamin&apos;s patch, probably because doMerge doesn&apos;t cascade down entities that it has already merged and some ManyToMany associations are being ignored.  Its a bit hard to be certain what is causing this as even without Benjamin&apos;s patch this test would fail due to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-758&quot; title=&quot;When merging many to many entites back into the repository changes to the associations are not respected&quot;&gt;&lt;del&gt;DDC-758&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="14397" author="beberlei" created="Wed, 15 Sep 2010 16:38:30 +0000"  >&lt;p&gt;@Roman i thought about this issue, its not possible without that additional map of merged entities. There is no way we can get that information from other sources. &lt;/p&gt;

&lt;p&gt;Problem is rather that the use-case probably only applies in mass-merging scenarios and client-server serialization.&lt;/p&gt;</comment>
                    <comment id="14442" author="ccapndave" created="Tue, 21 Sep 2010 19:48:39 +0000"  >&lt;p&gt;Added another failing test case - adding the same entity from different ends of a many to many bi-directional association to check that there isn&apos;t an integrity constraint violation caused by Doctrine trying to add the same row twice.&lt;/p&gt;</comment>
                    <comment id="14443" author="ccapndave" created="Tue, 21 Sep 2010 20:14:42 +0000"  >&lt;p&gt;Attached a patch for this issue.&lt;/p&gt;</comment>
                    <comment id="14444" author="beberlei" created="Wed, 22 Sep 2010 03:13:36 +0000"  >&lt;p&gt;can you comment why all the additionall stuff is necessary compared to my patch?&lt;/p&gt;</comment>
                    <comment id="14445" author="ccapndave" created="Wed, 22 Sep 2010 06:05:40 +0000"  >&lt;p&gt;It fixes the two additional test cases - testManyToManyPersistByReachability and testManyToManyDuplicatePersistByReachability.&lt;/p&gt;

&lt;p&gt;testManyToManyPersistByReachability was failing with your original patch because there are ManyToMany cases where an entity may have already been merged, but its still necessary to add it to an association and continue to cascade.  Running the following with the original patch will miss out some of the associations.&lt;/p&gt;

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

$m2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Movie();
$m2-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Movie 2&quot;&lt;/span&gt;;

$a1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Artist();
$a1-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Artist 1&quot;&lt;/span&gt;;

$a2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Artist();
$a2-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Artist 2&quot;&lt;/span&gt;;

$m1-&amp;gt;artists-&amp;gt;add($a1); $a1-&amp;gt;movies-&amp;gt;add($m1);
$m1-&amp;gt;artists-&amp;gt;add($a2); $a2-&amp;gt;movies-&amp;gt;add($m1);
$m2-&amp;gt;artists-&amp;gt;add($a1); $a1-&amp;gt;movies-&amp;gt;add($m2);
$m2-&amp;gt;artists-&amp;gt;add($a2); $a2-&amp;gt;movies-&amp;gt;add($m2);

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

&lt;p&gt;The other change in my patch is to protect against this case.  It ensures that the following code doesn&apos;t add the same entity twice to a collection.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$em-&amp;gt;merge($m1);
$em-&amp;gt;merge($m2);
$em-&amp;gt;merge($a2);
$em-&amp;gt;merge($a2);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14627" author="beberlei" created="Sun, 31 Oct 2010 02:19:03 +0000"  >&lt;p&gt;I am not sure if the issue here is rather multiple calls to merge that contain different parts of the same object-graph.&lt;/p&gt;

&lt;p&gt;There should be a very simple fix for this, call -&amp;gt;clear() after each merge.&lt;/p&gt;

&lt;p&gt;I am not sure if this patch drags us into a blackhole of issues with merging.&lt;/p&gt;</comment>
                    <comment id="14649" author="ccapndave" created="Sun, 31 Oct 2010 08:48:37 +0000"  >&lt;p&gt;Calling -&amp;gt;clear() and -&amp;gt;flush() after each merge is a workaround for the simple case, but unless I am misunderstanding I don&apos;t think its a solution for cases where the merging is happening automatically in cascadeMerge.  I&apos;ve actually encountered this issue in another project and scenario to do with creating REST APIs and merging JSON objects into entities, and applying the patch fixed it so a) I think this issue might be a more common that we first thought and b) the patch basically seems to work (plus it doesn&apos;t introduce any failing cases in the existing test suite).  I can actually still find one edge case to do with cascading merging interlinked many to many associations that this doesn&apos;t fix, but I was planning to open that as a new ticket after this   My feeling is that the current merge already has issues and this definitely improves it.&lt;/p&gt;</comment>
                    <comment id="14652" author="beberlei" created="Mon, 1 Nov 2010 02:45:36 +0000"  >&lt;p&gt;It cannot happen inside a single merge, single merges use the $visited to avoid infinite recursions, each entity can only be merged once inside a single merge operation.&lt;/p&gt;</comment>
                    <comment id="14713" author="beberlei" created="Wed, 10 Nov 2010 17:50:54 +0000"  >&lt;p&gt;Added a note into the documentation about using EntityManager#clear between merging of entities which share subgraphs and cascade merge.&lt;/p&gt;

&lt;p&gt;Handling this issue in UnitOfwork will be declared an improvement, not a bug anymore and be scheduled for later releases. The required changes to the core are to dangerous and big.&lt;/p&gt;</comment>
                    <comment id="14714" author="ccapndave" created="Thu, 11 Nov 2010 03:49:15 +0000"  >&lt;p&gt;Where in the docs is that?&lt;/p&gt;

&lt;p&gt;Just to summarize, the equivalent operation to having multiple merges and a single flush is to call merge followed by flush each time, with the whole thing surrounded by a transaction?  Does this have a big impact on performance?&lt;/p&gt;</comment>
                    <comment id="14715" author="ccapndave" created="Thu, 11 Nov 2010 04:49:18 +0000"  >&lt;p&gt;Ben - even given the decision not to implement this (and I do understand your thinking, as it is a major change), is there any reason not to implement the bit that ensures that the same entity isn&apos;t added to a collection twice during a merge?  I can&apos;t think of a situation where this should be allowed, and I have a use case where I get &apos;DUPLICATE KEY&apos; errors if this isn&apos;t there.&lt;/p&gt;

&lt;p&gt;Please see attached patch.&lt;/p&gt;</comment>
                    <comment id="14716" author="beberlei" created="Thu, 11 Nov 2010 06:35:37 +0000"  >&lt;p&gt;What bit of that huge patch is that? Can you extract it into another ticket if thats possible?&lt;/p&gt;</comment>
                    <comment id="14717" author="beberlei" created="Thu, 11 Nov 2010 06:36:52 +0000"  >&lt;p&gt;I added it to &quot;Working with Objects&quot; and the descripton of Merge. Its not yet live on the site.&lt;/p&gt;

&lt;p&gt;Using this current workaround has a performance impact, since more SELECT statements have to be issued against the database. &lt;/p&gt;</comment>
                    <comment id="14718" author="ccapndave" created="Thu, 11 Nov 2010 08:30:42 +0000"  >&lt;p&gt;Apologies for not being clear - only the 3rd patch (multipleaddmerge.diff) is relevant to the &apos;DUPLICATE KEY&apos; error I am now talking about, but I&apos;ll put it in a nother ticket if you prefer.&lt;/p&gt;</comment>
                    <comment id="14719" author="beberlei" created="Thu, 11 Nov 2010 08:35:47 +0000"  >&lt;p&gt;please add a new ticket, patch looks good.&lt;/p&gt;</comment>
                    <comment id="14720" author="ccapndave" created="Thu, 11 Nov 2010 08:51:11 +0000"  >&lt;p&gt;Created as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-875&quot; title=&quot;Merge can sometimes add the same entity twice into a collection&quot;&gt;&lt;del&gt;DDC-875&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10812" name="0149-DDC-763.patch" size="16017" author="ccapndave" created="Tue, 21 Sep 2010 20:14:42 +0000" />
                    <attachment id="10811" name="DDC763Test.php" size="6795" author="ccapndave" created="Tue, 21 Sep 2010 19:48:39 +0000" />
                    <attachment id="10858" name="multipleaddmerge.diff" size="1161" author="ccapndave" created="Thu, 11 Nov 2010 04:49:18 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-745] DateTime with SQLite</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-745</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I was using 2.0.0-Beta3 no problems found.&lt;br/&gt;
Then upgraded to Beta4 and the following:&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine\DBAL\Types\ConversionException&apos; with message &apos;Could not convert database value &quot;2010-08-07 00:00:00.000&quot; to Doctrine Type datetime&apos; in &lt;/p&gt;

&lt;p&gt;I guess it&apos;s an ORM&apos;s problem.&lt;/p&gt;

&lt;p&gt;I&apos;ve traced to:&lt;br/&gt;
call stack:&lt;br/&gt;
Doctrine\DBAL\Types\DateTimeType-&amp;gt;convertToPHPValue()&lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;_processSQLResult()&lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;_createEntity()&lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;load()&lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;findOneBy()&lt;/p&gt;


&lt;p&gt;in Doctrine\DBAL\Types\DateTimeType-&amp;gt;convertToPHPValue() i receive the values:&lt;br/&gt;
$value  = &quot;2010-08-07 00:00:00.000&quot;&lt;br/&gt;
$platform-&amp;gt;getDateTimeFormatString() = &quot;Y-m-d H:i:s&quot;&lt;/p&gt;

&lt;p&gt;I&apos;m new to Doctrine, maybe is my problem but it was working before i&apos;ve upgraded everything.&lt;br/&gt;
I&apos;ll also try to find out what is going on, but just to let you guys know.&lt;/p&gt;

&lt;p&gt;=================0&lt;br/&gt;
System:&lt;br/&gt;
Windows 7 - Portuguese Regional Settings&lt;br/&gt;
XAMPP&lt;br/&gt;
SQLite database&lt;/p&gt;</description>
                <environment>Windows 7 - Portuguese Regional Settings&lt;br/&gt;
XAMPP&lt;br/&gt;
SQLite database</environment>
            <key id="11757">DDC-745</key>
            <summary>DateTime with SQLite</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="darkfly">Rui Lima</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Aug 2010 05:04:24 +0000</created>
                <updated>Fri, 13 Aug 2010 05:19:10 +0000</updated>
                    <resolved>Thu, 12 Aug 2010 09:28:43 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13932" author="darkfly" created="Thu, 12 Aug 2010 09:28:43 +0000"  >&lt;p&gt;I took a closer look to my problem.&lt;br/&gt;
I used and external tool to update the field, and instead of &apos;2010-08-07 00:00:00&apos; the tool inserted &apos;2010-08-07 00:00:00.000&apos;&lt;/p&gt;

&lt;p&gt;So, there is no problem.&lt;br/&gt;
Thanks and sorry.&lt;/p&gt;</comment>
                    <comment id="13938" author="beberlei" created="Thu, 12 Aug 2010 17:01:29 +0000"  >&lt;p&gt;Does sqlite allow microseconds by default?&lt;/p&gt;</comment>
                    <comment id="13941" author="darkfly" created="Fri, 13 Aug 2010 05:19:10 +0000"  >&lt;p&gt;I don&apos;t quite understand you question.&lt;/p&gt;

&lt;p&gt;both of the following works:&lt;br/&gt;
update tb_user set registerdate=&apos;2010-08-07 00:00:00&apos;&lt;br/&gt;
update tb_user set registerdate=&apos;2010-08-07 00:00:00.000&apos;&lt;/p&gt;

&lt;p&gt;And here: &lt;a href=&quot;http://www.sqlite.org/lang_datefunc.html&quot; class=&quot;external-link&quot;&gt;http://www.sqlite.org/lang_datefunc.html&lt;/a&gt;&lt;br/&gt;
we can see that   YYYY-MM-DDTHH:MM:SS.SSS  is one of the supported formats.&lt;/p&gt;

&lt;p&gt;On other hand when i execute:&lt;br/&gt;
select DATETIME(&apos;NOW&apos;)      -&lt;del&gt;//&lt;/del&gt;&amp;gt;2010-08-13 09:14:21&lt;/p&gt;

&lt;p&gt;So i guess the default is with no miliseconds.&lt;/p&gt;

&lt;p&gt;Could we make possible to specify the datetime format in the annotation reference?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-717] Do not use files when using proxy autogeneration</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-717</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Proxy classes are generated in less than 1ms for me. I prefer to not have a &quot;build&quot; step to reducing loading time by a milisecond, so I use autogenerate.&lt;/p&gt;

&lt;p&gt;For users like me, wouldn&apos;t it be nicer if we wouldn&apos;t even have to configure a proxy dir and those files were never written (since they&apos;re not read more than once anyway)?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11676">DDC-717</key>
            <summary>Do not use files when using proxy autogeneration</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jakajancar">Jaka Jancar</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Jul 2010 17:52:55 +0000</created>
                <updated>Mon, 4 Jul 2011 21:47:47 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13668" author="jakajancar" created="Thu, 22 Jul 2010 18:32:00 +0000"  >&lt;p&gt;This very minimal patch removes the use of these temporary files:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;--- library/Doctrine/ORM/Proxy/ProxyFactory.php	(revision 2)
+++ library/Doctrine/ORM/Proxy/ProxyFactory.php	(working copy)
@@ -78,9 +78,8 @@
         $fqn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyNamespace . &apos;\\&apos; . $proxyClassName;
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_autoGenerate &amp;amp;&amp;amp; ! class_exists($fqn, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
-            $fileName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . &apos;.php&apos;;
-            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
-            require $fileName;
+            $file = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, self::$_proxyClassTemplate);
+            eval(&apos;?&amp;gt;&apos;.$file);
         }
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getMetadataFactory()-&amp;gt;hasMetadataFor($fqn)) {
@@ -144,6 +143,9 @@
 
         $file = str_replace($placeholders, $replacements, $file);
 
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($fileName === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
+            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $file;
+
         file_put_contents($fileName, $file);
     }
 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13671" author="beberlei" created="Fri, 23 Jul 2010 03:14:30 +0000"  >&lt;p&gt;The proxy dir is used for the &quot;doctrine orm:generate-proxies&quot; command in the case of &quot;autogenerate= false&quot;, so you need to define it anyways.&lt;/p&gt;

&lt;p&gt;You have to use proxies, the option is not for Proxy yes/no. If you have autogenerate=false and doctrine requires a proxy for a use case but can&apos;t find it you will get a fatal error.&lt;/p&gt;</comment>
                    <comment id="13672" author="beberlei" created="Fri, 23 Jul 2010 03:15:54 +0000"  >&lt;p&gt;I just saw the eval() keyword, ieeks &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; It could maybe be a convenience option for those that don&apos;t want to use proxy direcotiries, however i am not sure.&lt;/p&gt;</comment>
                    <comment id="13675" author="jakajancar" created="Fri, 23 Jul 2010 03:22:32 +0000"  >&lt;p&gt;eval() is no different than writing code to a file and using require().&lt;/p&gt;

&lt;p&gt;When using runtime-generated proxies, there are no benefits (that I know of) from writing them to a file. The disadvantages are:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;slower because of write disk access&lt;/li&gt;
	&lt;li&gt;has problems with high concurrency, unless special care is taken (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-716&quot; title=&quot;Proxy autogeneration fails with concurrent requests&quot;&gt;&lt;del&gt;DDC-716&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;potentially has permission problems if code is executed by different users (e.g. nobody for a daemon and www-data for http)&lt;/li&gt;
	&lt;li&gt;requires setup of a writable directory&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is a nicer patch, which makes _generateProxyClass() return a string, just like other _generate* 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;--- library/Doctrine/ORM/Proxy/ProxyFactory.php	(revision 2)
+++ library/Doctrine/ORM/Proxy/ProxyFactory.php	(working copy)
@@ -78,9 +78,8 @@
         $fqn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyNamespace . &apos;\\&apos; . $proxyClassName;
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_autoGenerate &amp;amp;&amp;amp; ! class_exists($fqn, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
-            $fileName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . &apos;.php&apos;;
-            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
-            require $fileName;
+            $code = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($className), $proxyClassName);
+            eval($code);
         }
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getMetadataFactory()-&amp;gt;hasMetadataFor($fqn)) {
@@ -107,19 +106,19 @@
         foreach ($classes as $class) {
             $proxyClassName = str_replace(&apos;\\&apos;, &apos;&apos;, $class-&amp;gt;name) . &apos;Proxy&apos;;
             $proxyFileName = $proxyDir . $proxyClassName . &apos;.php&apos;;
-            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($class, $proxyClassName, $proxyFileName, self::$_proxyClassTemplate);
+            $code = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateProxyClass($class, $proxyClassName);
+            file_put_contents($proxyFileName, &lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;?php\n&quot;&lt;/span&gt; . $code);
         }
     }
 
     /**
      * Generates a proxy class file.
      *
-     * @param $class
-     * @param $originalClassName
+     * @param ClassMetadata $class
      * @param $proxyClassName
-     * @param $file The path of the file to write to.
+     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string The code of the generated methods.
      */
-    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _generateProxyClass($class, $proxyClassName, $fileName, $file)
+    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _generateProxyClass(ClassMetadata $class, $proxyClassName)
     {
         $methods = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateMethods($class);
         $sleepImpl = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateSleep($class);
@@ -142,9 +141,9 @@
             $methods, $sleepImpl
         );
 
-        $file = str_replace($placeholders, $replacements, $file);
+        $file = str_replace($placeholders, $replacements, self::$_proxyClassTemplate);
 
-        file_put_contents($fileName, $file);
+        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $file;
     }
 
     /**
@@ -244,8 +243,7 @@
 
     /** Proxy class code template */
     &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; $_proxyClassTemplate =
-&apos;&amp;lt;?php
-
+&apos;
 namespace &amp;lt;namespace&amp;gt;;
 
 /**
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13679" author="beberlei" created="Sat, 24 Jul 2010 06:21:53 +0000"  >&lt;p&gt;Scheduled usage of eval() for 2.1, if the following conditions exist:&lt;/p&gt;

&lt;p&gt;1. Autogenerate is set to TRUE&lt;br/&gt;
2. No Proxy Directory is configured.&lt;/p&gt;</comment>
                    <comment id="13681" author="jakajancar" created="Sat, 24 Jul 2010 06:26:14 +0000"  >&lt;p&gt;Great, this is even better. This way you can have 1) autogenerated in ram-only, 2) autogenerated in files and 3) pregenerated.&lt;/p&gt;

&lt;p&gt;And the minimal amount of config needed to get up and running is reduced, which is always nice.&lt;/p&gt;</comment>
                    <comment id="13682" author="beberlei" created="Sat, 24 Jul 2010 06:34:49 +0000"  >&lt;p&gt;you should know though, eval is dead slow. It generates the necessary proxies on EACH request and that cannot be cached in APC.&lt;/p&gt;</comment>
                    <comment id="13684" author="jakajancar" created="Sat, 24 Jul 2010 06:46:26 +0000"  >&lt;p&gt;It&apos;s no slower than current autogeneration (file_put_contents+require). TBH, I don&apos;t know why anyone would want to use that over eval(), but I don&apos;t mind it being there.&lt;/p&gt;

&lt;p&gt;Pre-generation is, of course, a different thing. Seems like a valid tradeoff to offer: build/a bit of config/better perfomance vs. no build/no config/potentially slower.&lt;/p&gt;</comment>
                    <comment id="13685" author="beberlei" created="Sat, 24 Jul 2010 07:52:39 +0000"  >&lt;p&gt;Yes, that is because file_put_contents + require is a development only strategy. The manual clearly states that autogenerate has to be false in production.&lt;/p&gt;</comment>
                    <comment id="13933" author="romanb" created="Thu, 12 Aug 2010 09:39:12 +0000"  >&lt;p&gt;Using eval() instead of producing and requiring the file in the case of enabled auto-generation of proxy classes sounds like a good improvement for 2.1 to make proxies more transparent during deveopment and for anyone for whom performance is no issue.&lt;/p&gt;

&lt;p&gt;I&apos;m increasing the priority as I think it is easy to implement for 2.1 and a good enhancement.&lt;/p&gt;</comment>
                    <comment id="15243" author="k-fish" created="Wed, 9 Feb 2011 04:09:51 +0000"  >&lt;p&gt;A note on why having the proxies written to a file can be useful even with autogenerate being on: it makes it really easy to check the proxy code being generated. I use that a lot currently.&lt;/p&gt;

&lt;p&gt;The solution suggested, giving three possibilities is cool, though.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-691] doctrine.readOnly query hint</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-691</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Setting such a query hint to TRUE should result in all entities being retrieved by that query to be read-only for the purposes of change-tracking. Note that the entities themselves need not necessarily be read-only in general.&lt;/p&gt;

&lt;p&gt;This feature is a flush performance tweak that can be used to query for objects but not let the returned objects run through change-tracking on flush. Any other managed objects are tracked as usual so you can do a read-only query for 100 entities and persist a new entity in the same unit of work with optimal flushing performance.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11628">DDC-691</key>
            <summary>doctrine.readOnly query hint</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10612">DDC-209</parent>
                        <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Jul 2010 10:17:19 +0000</created>
                <updated>Thu, 31 May 2012 08:16:43 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>5</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="17106" author="koc" created="Mon, 26 Dec 2011 19:54:15 +0000"  >&lt;p&gt;Any news?&lt;br/&gt;
Why query hint? What about temporary switching like fetch mode changing via query object?&lt;/p&gt;</comment>
                    <comment id="18031" author="acid24" created="Thu, 31 May 2012 08:16:43 +0000"  >&lt;p&gt;Any news on this?&lt;/p&gt;

&lt;p&gt;I think this is a must have feature. Thanks for all your work.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-676] Find a way to test serialize/unserialize of all ClassMetadata properties in isolation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-676</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should find a way, using PHPUnit Data Providers or anything else, to check the serialize/unserialize of every property in the ClassMetadata instance, since errors here can be very subtle but dangerous.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11604">DDC-676</key>
            <summary>Find a way to test serialize/unserialize of all ClassMetadata properties in isolation</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 05:26:20 +0000</created>
                <updated>Sun, 29 Aug 2010 05:05:50 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-668] add upsert support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-668</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Didnt find anything in the docs on this. Is D2 capable of doing an UPSERT &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; in case I am trying to persist an object that may or may not have been saved previously. Different RDBMS support different syntax for this case. Like MySQL has INSERT .. ON DUPLICATE KEY UPDATE (or even INSERT IGNORE) while the SQL standard defines a MERGE syntax which seems to be gaining support. Of course you can always fallback to a SELECT FOR UPDATE (or if you want to be hacky an INSERT which catches duplicate key violations .. but probably not a good idea since many RDBMS rollback on a failure inside a transaction).&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Upsert&quot; class=&quot;external-link&quot;&gt;http://en.wikipedia.org/wiki/Upsert&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See also &lt;a href=&quot;http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011&quot; class=&quot;external-link&quot;&gt;http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011&lt;/a&gt; asking for MERGE support&lt;/p&gt;

&lt;p&gt;Ideally there would be a way to define on a model or model instance level if merge logic should be applied.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11585">DDC-668</key>
            <summary>add upsert support</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Jul 2010 17:20:19 +0000</created>
                <updated>Tue, 20 Dec 2011 22:22:01 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="13543" author="robertb" created="Fri, 9 Jul 2010 01:16:50 +0000"  >&lt;p&gt;Doctrine_Record defines a replace() method. &lt;/p&gt;

&lt;p&gt;In the MySQL Doctrine implementation, however, it is not the same as INSERT .. ON DUPLICATE KEY UPDATE. The replace() method implemented in Doctrine_Connection_Mysql uses the REPLACE INTO syntax, which is a DELETE and then INSERT when the key exists. This is fine, except for tables that use auto-increment fields. The delete-then-insert operation yields a new auto-incremented value, whereas INSERT .. ON DUPLICTATE KEY UPDATE would not.&lt;/p&gt;</comment>
                    <comment id="13544" author="lsmith" created="Fri, 9 Jul 2010 02:34:53 +0000"  >&lt;p&gt;MySQL (and SQLite) REPLACE is a no go. It causes way too much disc I/O and worse yet totally screws up the on disk data structures because of the deleting.&lt;/p&gt;</comment>
                    <comment id="16238" author="beberlei" created="Sun, 31 Jul 2011 08:48:13 +0000"  >&lt;p&gt;Scheduled for 2.2&lt;/p&gt;</comment>
                    <comment id="16239" author="beberlei" created="Sun, 31 Jul 2011 09:09:56 +0000"  >&lt;p&gt;Evaluating this makes me sad, except MySQL support for this is rather non-existant, and the oracle merge is aiming at batch operations.&lt;/p&gt;</comment>
                    <comment id="16681" author="beberlei" created="Sat, 22 Oct 2011 11:08:32 +0000"  >&lt;p&gt;Should this be done with&lt;/p&gt;

&lt;p&gt;1. Select first, then insert&lt;br/&gt;
2. Catch and evaluate exception then update&lt;/p&gt;

&lt;p&gt;I am leaning towards 1.&lt;/p&gt;</comment>
                    <comment id="17074" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:01 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-667] Lock Timeout Query Hint for DQL Queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-667</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;After the implementation of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-178&quot; title=&quot;Query Hint for LOCK mechanisms plus support in $em-&amp;gt;find()&quot;&gt;&lt;del&gt;DDC-178&lt;/del&gt;&lt;/a&gt; there is now only outstanding the support for locking queries based on a given timeout.&lt;/p&gt;

&lt;p&gt;This will be a DQL query feature only and be available via a query hint:&lt;/p&gt;

&lt;div class=&quot;code panel&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-&amp;gt;setHint(Query::LOCK_TIMEOUT, $timeoutMs);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It will be only working on Oracle.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11583">DDC-667</key>
            <summary>Lock Timeout Query Hint for DQL Queries</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Jul 2010 08:40:43 +0000</created>
                <updated>Thu, 16 Sep 2010 15:20:18 +0000</updated>
                                    <version>2.0-BETA2</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14157" author="romanb" created="Mon, 30 Aug 2010 06:32:49 +0000"  >&lt;p&gt;If this is to be implemented for 2.0, it needs to happen for RC1, therefore rescheduling to RC1. Feel free to reschedule to 2.x if necessary.&lt;/p&gt;</comment>
                    <comment id="14407" author="beberlei" created="Thu, 16 Sep 2010 15:20:18 +0000"  >&lt;p&gt;Only oracle supports lock timeouts and no other vendor seems to plan to support it. I move to 2.x, but i guess this would rather be an issue of user extension.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-658] Reverse engineering with Oracle (DBDriver and Associations as Identifier)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-658</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am playing with reverse engineering with Oracle and I have some problems:&lt;/p&gt;

&lt;p&gt;My schema:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;drop table PHONE_NUMBER;
drop table CUSTOMER;

create table CUSTOMER (
   CUSTOMER_ID             NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   CUSTOMER_LASTNAME       VARCHAR2(50)                    not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   CUSTOMER_MODIFIED       DATE,
   constraint PK_CUSTOMER primary key (CUSTOMER_ID)
         using index
       tablespace TBS_INDEX
       storage
       (
           initial 100K
           next 100K
       )
)
storage
(
    initial 100K
    next 100K
)
tablespace TBS_DATA;

create table PHONE_NUMBER (
   PHONE_NUMBER_ID         NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   CUSTOMER_ID             NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   PHONE_NUMBER            VARCHAR2(50)                    not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   PHONE_NUMBERMODIFIED    DATE,
   constraint PK_PHONE_NUMBER primary key (PHONE_NUMBER_ID, CUSTOMER_ID)
         using index
       tablespace TBS_INDEX
       storage
       (
           initial 100K
           next 100K
       )
)
storage
(
    initial 100K
    next 100K
)
tablespace TBS_DATA;

alter table PHONE_NUMBER
   add constraint PHONE_NUMBER__CUSTOMER foreign key (CUSTOMER_ID)
      references CUSTOMER (CUSTOMER_ID);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I obtain &quot;Fatal error: Uncaught exception &apos;Doctrine\ORM\Mapping\MappingException&apos; with message &apos;Property &quot;customerId&quot; in &quot;PhoneNumber&quot; was already declared, but it must be declared only once&apos;&quot;&lt;/p&gt;

&lt;p&gt;It&apos;s because a foreign key is a component of the primary key.&lt;/p&gt;</description>
                <environment>Ubuntu 10.04 + Oracle 11g Entreprise + PHP 5.3.2 + Doctrine2 Git (up-to-date) </environment>
            <key id="11559">DDC-658</key>
            <summary>Reverse engineering with Oracle (DBDriver and Associations as Identifier)</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10344">DDC-117</parent>
                        <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mikaelkael">Mickael Perraud</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Jun 2010 10:48:25 +0000</created>
                <updated>Sun, 11 Dec 2011 05:39:00 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13435" author="mikaelkael" created="Mon, 28 Jun 2010 04:44:25 +0000"  >&lt;p&gt;This is the continuation of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-616&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-616&lt;/a&gt;. Only the schema is different.&lt;/p&gt;</comment>
                    <comment id="13436" author="beberlei" created="Mon, 28 Jun 2010 04:52:22 +0000"  >&lt;p&gt;just for understanding this scenario:&lt;/p&gt;

&lt;p&gt;Is this a One-To-One relation and the TABLE_TEST2 &quot;inherits&quot; the primary key from its parent TABLE_TEST1?&lt;/p&gt;

&lt;p&gt;If yes, this construct is not yet supported by Doctrine 2, we still need to include an ID-Generator that supports this kind of schema.&lt;/p&gt;</comment>
                    <comment id="13437" author="mikaelkael" created="Mon, 28 Jun 2010 05:42:41 +0000"  >&lt;p&gt;Change for a more understandable use case. Note that it&apos;s not my real use case and that I work on legacy database on which I can&apos;t change the structure.&lt;/p&gt;</comment>
                    <comment id="15083" author="beberlei" created="Sat, 1 Jan 2011 15:50:02 +0000"  >&lt;p&gt;updated the issue topic to get a better grasp of what needs to be done here.&lt;/p&gt;</comment>
                    <comment id="15966" author="waldo2188" created="Thu, 9 Jun 2011 14:26:50 +0000"  >&lt;p&gt;I have the same error with Mysql whit the same condition.&lt;/p&gt;</comment>
                    <comment id="16923" author="beberlei" created="Mon, 28 Nov 2011 12:11:09 +0000"  >&lt;p&gt;More details on the work to be done:&lt;/p&gt;

&lt;p&gt;The relevant code is in Doctrine/ORM/Mapping/Driver/DatabaseDriver.php only.&lt;/p&gt;

&lt;p&gt;The idea is currently many-to-many tables are detected by checking that the table has foreign keys on all the primary key columns (no additional columns!)&lt;/p&gt;

&lt;p&gt;Now with the 2.1 feature of foreign key/primary key entities this is not necessarily true anymore. You can have the primary keys being foreign keys BUT have additional columns that are not part of the primary key. This has to be detected.&lt;/p&gt;

&lt;p&gt;If a foreign key-primary-key entity is found that has additional columns a ClassMetadata has to be created and the associations have to be created with the &quot;id&quot; =&amp;gt; true flag in mapManyToOne().&lt;/p&gt;</comment>
                    <comment id="16962" author="scott459" created="Sun, 11 Dec 2011 05:39:00 +0000"  >&lt;p&gt;For what it&apos;s worth, I&apos;m getting this error when I have a PK that is a single column and not a FK.&lt;/p&gt;

&lt;p&gt;  PRIMARY KEY (`id`),&lt;br/&gt;
  UNIQUE KEY `cycle_station_id` (`cycle`,`station_id`),&lt;br/&gt;
  KEY `station_id_idx` (`station_id`),&lt;br/&gt;
  KEY `readings` (`readings`),&lt;br/&gt;
  KEY `source` (`source`),&lt;br/&gt;
  KEY `temperature_min_max` (`temperature_max`,`temperature_min`),&lt;br/&gt;
  KEY `station_id_cycle` (`station_id`,`cycle`,`updated_at`),&lt;br/&gt;
  CONSTRAINT `compiled_1_station_id_stations_id` FOREIGN KEY (`station_id`) REFERENCES `stations` (`id`),&lt;br/&gt;
  CONSTRAINT `compiled_1_station_id_stations_id_1` FOREIGN KEY (`station_id`) REFERENCES `stations` (`id`) ON DELETE CASCADE&lt;br/&gt;
) ENGINE=InnoDB AUTO_INCREMENT=160833690 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-624] Partial object query that leaves out an association to avoid loading it fetches the association anyway.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-624</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Assuming:&lt;/p&gt;

&lt;p&gt;Customer &amp;lt;onetoone&amp;gt; Cart&lt;/p&gt;

&lt;p&gt;where Cart is the owning side.&lt;/p&gt;

&lt;p&gt;Since the association from Customer to Cart can not be lazy, it would make sense to leave out the association in a query to avoid loading the carts like this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;select partial c.{id,name, ... anything except cart} from Customer c&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But this is ignored and the carts of all customers are fetched anyway. Query::HINT_FORCE_PARTIAL_LOAD is an alternative solution, however it has the disadvantage that it disables lazy-loading for &lt;b&gt;all&lt;/b&gt; queried objects. If partial querying would honor associations this would allow more fine-grained control.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11442">DDC-624</key>
            <summary>Partial object query that leaves out an association to avoid loading it fetches the association anyway.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Jun 2010 12:13:06 +0000</created>
                <updated>Fri, 11 Nov 2011 09:28:13 +0000</updated>
                                    <version>2.0-BETA1</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="14085" author="romanb" created="Thu, 26 Aug 2010 08:06:33 +0000"  >&lt;p&gt;Might need to be pushed back to a 2.0.x / 2.x.x bugfix release. Not clear yet.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="13141">DDC-1465</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-547] Consider allowing custom PersistentCollection implementations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-547</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should consider allowing the configuration of custom PersistentCollection implementations on a per-association basis.&lt;br/&gt;
This could allow users to craft optimized (SQL) behavior for for some of their collections to improve performance without changing the domain model code.&lt;/p&gt;

&lt;p&gt;For this, PersistentCollection needs to be designed for inheritance.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11278">DDC-547</key>
            <summary>Consider allowing custom PersistentCollection implementations</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Apr 2010 11:39:21 +0000</created>
                <updated>Fri, 24 Dec 2010 05:10:38 +0000</updated>
                                    <version>2.0-BETA1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>6</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="14082" author="romanb" created="Thu, 26 Aug 2010 08:03:27 +0000"  >&lt;p&gt;Rescheduled for 2.1. Might be 2.x.&lt;/p&gt;</comment>
                    <comment id="15010" author="beberlei" created="Fri, 24 Dec 2010 05:10:38 +0000"  >&lt;p&gt;Reschedule for 2.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-445] Evaluate possible ways in which stored procedures can be used</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-445</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should evaluate the current situation of stored procedure support as well as where we want to go with it / how far we want to support it, if at all.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11094">DDC-445</key>
            <summary>Evaluate possible ways in which stored procedures can be used</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Mar 2010 12:27:42 +0000</created>
                <updated>Fri, 24 Dec 2010 04:49:52 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12373" author="beberlei" created="Fri, 19 Mar 2010 12:48:10 +0000"  >&lt;p&gt;I think this relates to the usage of Custom Persisters&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10999">DDC-391</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-391] Allow to specifiy custom Entity and Collection Persister classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-391</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It should be allowed to overwrite the default persisters for collections and entities. This should go along the lines of Hibernate which allows to set the custom implementations like:&lt;/p&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;entity persister=&lt;span class=&quot;code-quote&quot;&gt;&quot;persisterClass&quot;&lt;/span&gt; /&amp;gt;
&amp;lt;OneToMany persister=&lt;span class=&quot;code-quote&quot;&gt;&quot;persisterClass&quot;&lt;/span&gt; /&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Annotation&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity(persister=&lt;span class=&quot;code-quote&quot;&gt;&quot;persisterClass&quot;&lt;/span&gt;)
 * @OneToMany(persister=&lt;span class=&quot;code-quote&quot;&gt;&quot;persisterClass&quot;&lt;/span&gt;)
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10999">DDC-391</key>
            <summary>Allow to specifiy custom Entity and Collection Persister classes</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 6 Mar 2010 07:07:22 +0000</created>
                <updated>Mon, 24 Sep 2012 08:30:25 +0000</updated>
                                    <version>2.0-ALPHA4</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>5</votes>
                        <watches>7</watches>
                        <comments>
                    <comment id="12997" author="romanb" created="Wed, 19 May 2010 06:32:18 +0000"  >&lt;p&gt;Rescheduling for beta3.&lt;/p&gt;</comment>
                    <comment id="13538" author="romanb" created="Wed, 7 Jul 2010 11:18:14 +0000"  >&lt;p&gt;Pushing back to beta4.&lt;/p&gt;</comment>
                    <comment id="13570" author="romanb" created="Mon, 12 Jul 2010 11:49:44 +0000"  >&lt;p&gt;Moved to 2.1 due to lack of time for any larger new features for 2.0.&lt;/p&gt;</comment>
                    <comment id="14559" author="beberlei" created="Wed, 13 Oct 2010 02:43:57 +0000"  >&lt;p&gt;implemented this in a feature branch for now, it really doesnt touch any other runtime code so maybe we can still merge this before RC1&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/tree/OverridePersisters&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/tree/OverridePersisters&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15369" author="gediminasm" created="Fri, 25 Feb 2011 10:14:30 +0000"  >&lt;p&gt;Is this forgotten? you should merge it since it does not affect any other parts of ORM, this is a great feature&lt;/p&gt;</comment>
                    <comment id="15390" author="beberlei" created="Sat, 26 Feb 2011 08:50:32 +0000"  >&lt;p&gt;This has not been forgotten, but the Persister is due for a heavy refactoring for 2.2 probably, when we will make it use the SQL Query object that we are working on.&lt;/p&gt;

&lt;p&gt;So I cannot merge this, because the API will probably break big time.&lt;/p&gt;</comment>
                    <comment id="15500" author="jonaswouters" created="Wed, 16 Mar 2011 09:31:23 +0000"  >&lt;p&gt;Does that mean we will not see this feature before 2.2? &lt;/p&gt;</comment>
                    <comment id="15501" author="beberlei" created="Wed, 16 Mar 2011 12:15:24 +0000"  >&lt;p&gt;Yes, that is correct. I dont want to add it as experimental/undocumented feature because people will take it for granted and make us responsible for possible bc breaks.&lt;/p&gt;

&lt;p&gt;I will update the target version accordingly.&lt;/p&gt;

&lt;p&gt;Sorry for disappointing you, but this feature is fundamentally important at the core of the library. That means we have to get it right and not rush into it.&lt;/p&gt;</comment>
                    <comment id="15509" author="gediminasm" created="Thu, 17 Mar 2011 04:32:11 +0000"  >&lt;p&gt;Just as I thought that first you will want to make a query builder object for all persisters. since now they use plain sql. Thanks for all your work on this&lt;/p&gt;</comment>
                    <comment id="17218" author="adambro" created="Wed, 11 Jan 2012 13:28:00 +0000"  >&lt;p&gt;I might be mistaken, but AFAICS mentioned Persister heavy refactoring did not made through to 2.2 version. Is there any plan to have it in 2.3 or at any later stage?&lt;/p&gt;</comment>
                    <comment id="17229" author="guilhermeblanco" created="Fri, 13 Jan 2012 04:49:35 +0000"  >&lt;p&gt;@Adam I refactored all Persisters optimizing their code, but I could not complete the move from SQL string generation to Doctrine\DBAL\Query.&lt;br/&gt;
We missed it, yes. I may reschedule for 2.3&lt;/p&gt;</comment>
                    <comment id="18599" author="burnred" created="Wed, 5 Sep 2012 13:10:35 +0000"  >&lt;p&gt;Why is it still missing in 2.3? I would require this for an extension that uses its own overridden entity persister and using a custom persister is the solution that you guys recomend for not overriding the entity manager.&lt;/p&gt;</comment>
                    <comment id="18700" author="sstok" created="Sun, 23 Sep 2012 12:10:47 +0000"  >&lt;p&gt;Any change seeing this soon? I really need this for a security feature.&lt;/p&gt;

&lt;p&gt;What is making this so hard? just adding an setEntityPersister($entityName, $object) should do the trick.&lt;br/&gt;
I don&apos;t need any fancy stuff, just a way to limit the fields in the SELECT list.&lt;/p&gt;

&lt;p&gt;Edit: OK, I&apos;m shot I CAN NOT overwrite the entity manager as the UnitOfWork is private!&lt;br/&gt;
Got any other idea?&lt;/p&gt;</comment>
                    <comment id="18705" author="st_koegel" created="Mon, 24 Sep 2012 08:30:25 +0000"  >&lt;p&gt;Any chance you could add this quickly? I need this feature urgently to complete an extension using a custom persister. Thanks in advance.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11094">DDC-445</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="11650">DDC-699</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-298] Allow Entity to hold a collection of a single primitive type</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-298</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sometimes you want to save arbitrary information for an entity using a key -&amp;gt; value array-structure. JPA supports this by means of the @ElementCollection annotation with allows to specify HashMaps for example.&lt;/p&gt;

&lt;p&gt;I propose a new AssocationMapping called &quot;ElementMapping&quot; / &quot;ElementCollection&quot; and annotations (options):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ElementCollection
+ elementTable
+ keyType
+ keyLength
+ keyColumnDefinition
+ valueType
+ valueLength
+ valueColumnDefinition
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The key and value definitions are necessary for converting and schema generation.&lt;/p&gt;

&lt;p&gt;The implementation would make use of the PersistentCollection at all times and work as any other persistent collection just with primitive types.&lt;/p&gt;

&lt;p&gt;Restrictions for a first implementation:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Only available as a Lazy-Load Collection, no hydration with the source entity&lt;/li&gt;
	&lt;li&gt;Can&apos;t be used in queries alike &quot;entity.colname.key = ?1&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Use-Case:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$entity-&amp;gt;options[&apos;foo&apos;] = &apos;bar&apos;;
$entity-&amp;gt;options[&apos;bar&apos;] = &apos;baz&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This could be done for 2.0 imho, adding the necessary changes and optimizations could then be scheduled for 2.1&lt;/p&gt;</description>
                <environment></environment>
            <key id="10829">DDC-298</key>
            <summary>Allow Entity to hold a collection of a single primitive type</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Feb 2010 22:54:51 +0000</created>
                <updated>Fri, 24 Dec 2010 05:05:59 +0000</updated>
                                    <version>2.1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="11585" author="beberlei" created="Tue, 2 Feb 2010 22:57:00 +0000"  >&lt;p&gt;In this implementation Schema-Tool would generate a table:&lt;/p&gt;

&lt;p&gt;elementTable (entity_id-1, ..., entity_id-n, key, value) and using the Platform Type Generation of keyType and valueType&lt;/p&gt;</comment>
                    <comment id="11586" author="beberlei" created="Tue, 2 Feb 2010 23:04:43 +0000"  >&lt;p&gt;Column Names should be Change-able also since there could be people who name their primary keys &quot;key&quot; and &quot;value&quot; o_O&lt;/p&gt;</comment>
                    <comment id="11587" author="beberlei" created="Tue, 2 Feb 2010 23:05:43 +0000"  >&lt;p&gt;Ordering could be implemented on top of this using the @OrderColumn JPA implementation by adding another column to the table with a numeric order that will be &quot;order by&quot;&apos;d on select time.&lt;/p&gt;</comment>
                    <comment id="15009" author="beberlei" created="Fri, 24 Dec 2010 05:05:59 +0000"  >&lt;p&gt;Pushed back&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-222] Create unit tests for CLI components</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-222</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="10649">DDC-222</key>
            <summary>Create unit tests for CLI components</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Dec 2009 20:04:28 +0000</created>
                <updated>Sat, 30 Oct 2010 13:36:35 +0000</updated>
                                    <version>2.0-ALPHA3</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13006" author="romanb" created="Wed, 19 May 2010 06:56:56 +0000"  >&lt;p&gt;Whats the status here? Do we have any?&lt;/p&gt;</comment>
                    <comment id="13016" author="guilhermeblanco" created="Wed, 19 May 2010 22:02:17 +0000"  >&lt;p&gt;Since we moved to Symfony Console I don&apos;t think this is needed anymore.&lt;br/&gt;
The purpose of this ticket was actually to test our own CLI support, which was dropped. &lt;/p&gt;

&lt;p&gt;I&apos;m closing the ticket due to this. Reopen if you have any other comment.&lt;/p&gt;</comment>
                    <comment id="13021" author="beberlei" created="Thu, 20 May 2010 05:03:53 +0000"  >&lt;p&gt;I think we do need some basic functional tests of our Commands, they have been subject to many bugs in the past becaues they are not tested.&lt;/p&gt;</comment>
                    <comment id="13373" author="beberlei" created="Sat, 19 Jun 2010 18:30:36 +0000"  >&lt;p&gt;Fixed another fatal error in the command due to missing namespace dependency. We need tests for all the commands, there have been dozens of issues on these things so far.&lt;/p&gt;

&lt;p&gt;This commit shows a simple approach on how testing is easily possible for symfony commands:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/51e6681934a7cf4448b85c5670c04045f66c6056&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/51e6681934a7cf4448b85c5670c04045f66c6056&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14079" author="romanb" created="Thu, 26 Aug 2010 07:58:29 +0000"  >&lt;p&gt;Can we expect some more tests for beta4 or is it unlikely that you find the time? Should we move this further back or does someone else want to step in?&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10929">DDC-359</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-213] Persist order of collections</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-213</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A Collection is like a php array, an ordered map. Hence there should be the possibility to persist this order.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10620">DDC-213</key>
            <summary>Persist order of collections</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Dec 2009 17:40:38 +0000</created>
                <updated>Tue, 16 Oct 2012 07:43:02 +0000</updated>
                                    <version>2.0</version>
                                <fixVersion>2.x</fixVersion>
                                        <due></due>
                    <votes>10</votes>
                        <watches>8</watches>
                        <comments>
                    <comment id="13042" author="shurakai" created="Fri, 21 May 2010 19:50:28 +0000"  >&lt;p&gt;Roman, I&apos;d like to do this one as I have currently a use case for this. Do you have any idea of how to do this? What I&apos;m wondering is whether it is possible to implement this without user intervention. (This would simply mean &quot;store the entities as they were added&quot;). But this would need another column in DB that we&apos;d have to add within oneToMany / manyToMany relationships, but in this case one could save a serialized array holding &quot;entityId =&amp;gt; position&quot; key / value pairs.&lt;/p&gt;

&lt;p&gt;Afterwards, one could easily rebuild / reorder the collection via $collection-&amp;gt;set($entity, $order&lt;span class=&quot;error&quot;&gt;&amp;#91;$entity-&amp;gt;identifier&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;If you&apos;ve got another thought about this, please don&apos;t hesitate to point me into the right direction!&lt;/p&gt;</comment>
                    <comment id="13043" author="beberlei" created="Sat, 22 May 2010 02:54:25 +0000"  >&lt;p&gt;this won&apos;t be implemented until 2.1, since its a pretty complex feature. &lt;/p&gt;

&lt;p&gt;Changes are probably required in:&lt;/p&gt;

&lt;p&gt;1. CollectionPersister - Add a new collection persister that takes the position into account&lt;br/&gt;
2. SchemaTool - Add a &apos;col_position&apos; column to either the many-to-many or the one-to-many tables.&lt;br/&gt;
3. EntityPersister - Use and extend current order-by support to make the sorting happen&lt;/p&gt;

&lt;p&gt;You can implement this already though with some performance hit in update scenarios. If you use the ORDER BY support and implement an API around your entity that abstracts those changes and always sets a &quot;position&quot; field on the many entity that is supposed to be sorted.&lt;/p&gt;</comment>
                    <comment id="13044" author="romanb" created="Sat, 22 May 2010 05:35:48 +0000"  >&lt;p&gt;I don&apos;t think we necessarily need a new collection persister. Simply adjusting the ManyToManyPersister to be able to deal with it might be sufficient.&lt;/p&gt;

&lt;p&gt;For OneToMany, that is always persisted from the &quot;many&quot; side, thus there is no collection persister, we would need to adjust the normal persisters.&lt;/p&gt;

&lt;p&gt;They key element for the user should be a new annotation (or corresponding xml/yaml element) @OrderColumn. By default the order should not be persistent, only when an @OrderColumn annotation is present. The name of the order column can have a default, i.e. &quot;position&quot;. Thus this enhancement of persisting the order should be fully backwards compatible.&lt;/p&gt;</comment>
                    <comment id="13045" author="romanb" created="Sat, 22 May 2010 05:41:07 +0000"  >&lt;p&gt;On another note, the getInsertDiff/getDeleteDiff methods of PersistentCollection should already be &quot;ready&quot; for this. That is, when an element in the collection changed only its position, this is already tracked as a change. However the ManyToManyPersister issues no &quot;UPDATE&quot; queries, it simply deletes and inserts. A position change may be more effectively persisted with an UPDATE.&lt;/p&gt;</comment>
                    <comment id="14493" author="beberlei" created="Thu, 30 Sep 2010 03:23:11 +0000"  >&lt;p&gt;From a mailinglist entry, required check/changepoints:&lt;/p&gt;

&lt;p&gt;1. ClassMetadata of Many-To-Many associations have to be extended to publish the required datastructure to the ORM.&lt;br/&gt;
2. All Metadata Mapping Drivers have to be extended&lt;br/&gt;
3. Persisters\ManyToManyCollectionPersister has to be extended to save the key in the many to many table if desired by the user.&lt;br/&gt;
4. Schema-Tool has to be extended to create the additional column.&lt;br/&gt;
5. PersistentCollection has to be extended so that lazy loading of collections with additional key works.&lt;br/&gt;
6. Array- and ObjectHydrator have to be extended to allow fetch join of collections with key column.&lt;br/&gt;
7. Discuss wheather to support this for One-To-Many also with the key-column on the many side. This is much more tricky internally though.&lt;/p&gt;</comment>
                    <comment id="15006" author="beberlei" created="Fri, 24 Dec 2010 04:48:03 +0000"  >&lt;p&gt;Push back to 2.x, we will have support for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-250&quot; title=&quot;ArrayCollection Key Column @indexBy&quot;&gt;&lt;del&gt;DDC-250&lt;/del&gt;&lt;/a&gt; first and for this at a later release.&lt;/p&gt;</comment>
                    <comment id="17377" author="armetiz" created="Tue, 7 Feb 2012 17:25:33 +0000"  >&lt;p&gt;Hi there,&lt;br/&gt;
I&apos;m looking for this feature.&lt;/p&gt;

&lt;p&gt;Benjamin Eberlei said that : &quot;You can implement this already&quot;, but I don&apos;t understand the &quot;how to&quot;.&lt;/p&gt;

&lt;p&gt;Also,&lt;br/&gt;
The problem should be solve if RDBMS had a &quot;natural&quot; order. An order based on item position inside table.&lt;/p&gt;

&lt;p&gt;To get this feature without any change on Doctrine, I have remplace the PK defined by the target &amp;amp; mapped field identifier. The new PK is a new field with type &quot;integer&quot; and with auto-increment enable.&lt;br/&gt;
In this configuration, Doctrine use the &quot;natural&quot; order of the RDBMS. And I can change order of my item inside Collection and persist it.&lt;/p&gt;

&lt;p&gt;It&apos;s an very bad solution, but It work before an official support.&lt;/p&gt;

&lt;p&gt;Waiting for advices, and solutions,&lt;/p&gt;

&lt;p&gt;Thomas.&lt;/p&gt;</comment>
                    <comment id="17379" author="armetiz" created="Wed, 8 Feb 2012 10:41:00 +0000"  >&lt;p&gt;Answering to Benjamin Eberlei on the &quot;7. Discuss wheather to support this for One-To-Many also with the key-column on the many side. This is much more tricky internally though.&quot;.&lt;/p&gt;

&lt;p&gt;I think that for One-To-Many relations, if user want to store the collection order, Doctrine can store the One-To-Many as Many-To-Many with a &quot;model&quot; limitation. &lt;br/&gt;
In that case, if storing order collection for Many-To-Many work, it should work for One-To-Many.&lt;/p&gt;

&lt;p&gt;What do you think about it ?&lt;/p&gt;</comment>
                    <comment id="17486" author="ndm" created="Wed, 29 Feb 2012 05:41:55 +0000"  >&lt;p&gt;I think that it must be possible to have two keys ordering : the order isn&apos;t obligatory reversible.&lt;/p&gt;

&lt;p&gt;For exemple  with user and group : &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;You can order groups for one user : with preference by exemple, or importance.&lt;/li&gt;
	&lt;li&gt;And  with a different order,  users for a group : rank by example.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And maybe more, if you decide to add multi-order : an user show group by his rank in it, if his rank is identical, the order is make by love preference, and after by the importance given by the user (not necessary a number, if we imagine filter on them).&lt;/p&gt;

&lt;p&gt;So a default order can be choice with parametized fields and could be : &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
@ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;)
...
@JoinFields ( rank: { type: &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;} , preference:{type:&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;}, importance:{type: string, length: 40} )
@OrderByJoinFields({&lt;span class=&quot;code-quote&quot;&gt;&quot;rank&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;preference&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;importance&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;ASC&quot;&lt;/span&gt; } )
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;In this case the order must be optional and would be clean if another order appears in the same scope (DQL...). And manytomany became virtual entities act as other entities except they don&apos;t appears permetting in the same time a better conception.&lt;/p&gt;

&lt;p&gt;So if the solution take in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-181&quot; class=&quot;external-link&quot;&gt;DDC-181&lt;/a&gt; will become the only solution. This would a good idea to document this. Because, this seems to me a very important point.&lt;/p&gt;

&lt;p&gt;My last point is &lt;b&gt;even an unique ordering field&lt;/b&gt; created in the join table will be a &lt;b&gt;big and usefull improvement&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Thank a lot for your beautiful work.&lt;/b&gt;&lt;/p&gt;</comment>
                    <comment id="17487" author="armetiz" created="Wed, 29 Feb 2012 07:05:59 +0000"  >&lt;p&gt;In my point of view, a collection can be order in a single way only.&lt;br/&gt;
If you want to add more than one order between User &amp;amp; Group, it&apos;s a new collection, a new relation.&lt;br/&gt;
Like : &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;User.memberOf() : Group[]&lt;/li&gt;
	&lt;li&gt;Group.members() : User[]&lt;/li&gt;
	&lt;li&gt;Group.importantMembers() : User[]&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And it&apos;s your role to keep a consistency between members &amp;amp; importantMembers array.&lt;/p&gt;

&lt;p&gt;Because ManyToMany join table is the reflection of a state of an ArrayCollection. It&apos;s not a usefull feature to be able to store all of the state of an ArrayCollection, even the order of this Array. It&apos;s just a normal feature that is really missing &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/tongue.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Thomas.&lt;/p&gt;</comment>
                    <comment id="17488" author="ndm" created="Wed, 29 Feb 2012 10:14:27 +0000"  >&lt;p&gt;I don&apos;t think:&lt;/p&gt;

&lt;p&gt;If you have three collection, you &lt;b&gt;duplicate one relation 3 times&lt;/b&gt; and it&apos;s easy in consequence &lt;b&gt;to lost the data integrity and unicity&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;By example :&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Thomas have rank 10 in Admin&lt;/li&gt;
	&lt;li&gt;Thomas think the admin group has importance noted 3 on all of his groups.&lt;/li&gt;
	&lt;li&gt;If a responsable of admin group decide to delete Thomas from it.&lt;/li&gt;
	&lt;li&gt;Thomas, in his ordered list of groups, think always to be in group admin.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So in my idea, the &lt;b&gt;many to many relation&lt;/b&gt; isn&apos;t just an array collection, but &lt;b&gt;should be an virtual entity&lt;/b&gt;. In UML or in Merise method this is a common problem to have a parametized relation. I think an orm should just implement this.&lt;/p&gt;
</comment>
                    <comment id="17489" author="armetiz" created="Wed, 29 Feb 2012 10:43:59 +0000"  >&lt;p&gt;Hum,&lt;br/&gt;
I agree with you.. In a SQL Schema, it&apos;s a good choice to add many fields in a ManyToMany join table to description &quot;order&quot;.&lt;/p&gt;</comment>
                    <comment id="17535" author="armetiz" created="Wed, 7 Mar 2012 15:12:35 +0000"  >&lt;p&gt;I just want to add a piece of Doctrine ORM Document : &lt;/p&gt;

&lt;p&gt;&quot;When working with collections, keep in mind that a Collection is essentially an &lt;b&gt;ordered map&lt;/b&gt; (just like a PHP array). That is why the remove operation accepts an index/key. removeElement is a separate method that has O ( n) complexity using array_search, where n is the size of the map.&quot;&lt;/p&gt;</comment>
                    <comment id="17636" author="armetiz" created="Fri, 23 Mar 2012 09:45:13 +0000"  >&lt;p&gt;Hi there,&lt;br/&gt;
After several discussions. on IRC, I have changed my point of view.&lt;/p&gt;

&lt;p&gt;Doctrine Documentation says : &quot;When working with collections, keep in mind that a Collection is essentially an ordered map (just like a PHP array)&quot;.&lt;br/&gt;
So, I think that Doctrine have to be able to store or not the order of a Collection. By adding a new field on the Joined table to store the position of each elements.&lt;/p&gt;

&lt;p&gt;But I not agree with @Nicolas. Because in his case, he&apos;s talking about Association Class : &lt;a href=&quot;http://etutorials.org/Programming/UML/Chapter+6.+Class+Diagrams+Advanced+Concepts/Association+Class/&quot; class=&quot;external-link&quot;&gt;http://etutorials.org/Programming/UML/Chapter+6.+Class+Diagrams+Advanced+Concepts/Association+Class/&lt;/a&gt;&lt;br/&gt;
Because he&apos;s talking of a business logic, he&apos;s talking of a dedicated Entity class.&lt;/p&gt;

&lt;p&gt;What do you think about it ?&lt;/p&gt;

&lt;p&gt;Thomas;&lt;/p&gt;
</comment>
                    <comment id="18593" author="armetiz" created="Fri, 31 Aug 2012 13:43:00 +0000"  >&lt;p&gt;Any news ? &lt;/p&gt;</comment>
                    <comment id="18841" author="mnapoli" created="Tue, 16 Oct 2012 07:43:02 +0000"  >&lt;p&gt;Hi, any news on this?&lt;/p&gt;

&lt;p&gt;If I may add any info to this feature request, maybe something like JPA/Hibernate could be a good start?&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;http://docs.oracle.com/javaee/6/api/javax/persistence/OrderColumn.html&quot; class=&quot;external-link&quot;&gt;http://docs.oracle.com/javaee/6/api/javax/persistence/OrderColumn.html&lt;/a&gt; or &lt;a href=&quot;http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections.html#collections-indexed&quot; class=&quot;external-link&quot;&gt;http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections.html#collections-indexed&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The idea in Hibernate is that you persist the order of the list in an extra column. This column is not a field of the entity however.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="10523">DDC-181</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10718">DDC-250</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-128] Consider adding EntityManager#link/unlink methods for direct association manipulation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-128</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A problem when working with collection-valued associations is that almost all operations except add($obj) require the collection to become initialized in order for the operation to be performed properly. While this is all correct and beautiful OO-wise it may be problematic at times with regards to performance. Hence we might want to consider to provide some convenient methods along the lines of link/unlink (name suggestions?) which allow more direct, less OO collection manipulation. Such methods obviously would bypass the normal object lifecycle and the changes done through these methods will not be reflected in the in-memory objects and collections, unless the user keeps them in-synch himself.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10362">DDC-128</key>
            <summary>Consider adding EntityManager#link/unlink methods for direct association manipulation</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sat, 7 Nov 2009 13:31:39 +0000</created>
                <updated>Wed, 29 Dec 2010 06:32:36 +0000</updated>
                                    <version>2.0-ALPHA2</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="11174" author="beberlei" created="Fri, 11 Dec 2009 13:48:10 +0000"  >&lt;p&gt;Questions&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;I suppose link and unlinked entities would then handled by UnitOfwork commit also?&lt;/li&gt;
	&lt;li&gt;Since the collection is not initialized, one does not know upfront if the action will be successful, what happens if:
	&lt;ul&gt;
		&lt;li&gt;an entity is linked with a collection, although they are already connected.&lt;/li&gt;
		&lt;li&gt;an entity is unlinked from a collection it is not in.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Regarding the naming, i like link/unlink.&lt;/p&gt;
</comment>
                    <comment id="11211" author="romanb" created="Thu, 17 Dec 2009 13:56:23 +0000"  >&lt;p&gt;What do you mean by &quot;handled by UnitOfWork commit&quot; ? Whether the SQL is &quot;scheduled&quot; or executed immediately? Interesting question.&lt;br/&gt;
Scheduling would probably be better but also more difficult.&lt;/p&gt;

&lt;p&gt;As far as usage is concerned, I currently imagine it 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;&lt;span class=&quot;code-comment&quot;&gt;// EntityManager#link($sourceObj, $field, $targetObj)
&lt;/span&gt;$user = $em-&amp;gt;getReference($userId); &lt;span class=&quot;code-comment&quot;&gt;// $userId probably from request parameters
&lt;/span&gt;$address = $em-&amp;gt;getReference($addressId); &lt;span class=&quot;code-comment&quot;&gt;// $addressId probably from request parameters
&lt;/span&gt;$em-&amp;gt;link($user, &apos;addresses&apos;, $address);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&quot;What happens if: an entity is linked with a collection, although they are already connected.&quot;&lt;/p&gt;

&lt;p&gt;Probably an SQL error which results in an exception from the driver. Depends on the database constraints though.&lt;/p&gt;

&lt;p&gt;&quot;What happens if: an entity is unlinked from a collection it is not in&quot;&lt;/p&gt;

&lt;p&gt;Probably nothing, at least not from the SQL side. An exception could be thrown from Doctrine itself if the update affected 0 rows.&lt;/p&gt;

&lt;p&gt;Thanks for these initial questions. Thats definitely food for thought. Keep it coming.&lt;/p&gt;</comment>
                    <comment id="14080" author="romanb" created="Thu, 26 Aug 2010 08:00:25 +0000"  >&lt;p&gt;Pushed back.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11277">DDC-546</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-93] It would be nice if we could have support for ValueObjects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-93</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class User {
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $address;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $city;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $state;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We could have:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class User {
	/**
	 * @Component(class=&lt;span class=&quot;code-quote&quot;&gt;&quot;Address&quot;&lt;/span&gt;)
	 */
	 &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $address;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It would my life a lot easier....&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;&lt;a name=&quot;Notesforimplementation&quot;&gt;&lt;/a&gt;Notes for implementation&lt;/h2&gt;

&lt;p&gt;Value objects can come in two forms: &lt;/p&gt;

&lt;p&gt;a) as embedded value objects&lt;br/&gt;
b) as collections of value objects&lt;/p&gt;

&lt;p&gt;An implementation should concentrate on a) first. The following things all concentrate on a).&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;DQLSupport&quot;&gt;&lt;/a&gt;DQL Support&lt;/h3&gt;

&lt;p&gt;&lt;b&gt;Conditions:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;1. &quot;select f from Foo f where f.embedded.value = ?1&quot; (setParameter(1, $scalarValue))&lt;br/&gt;
2. &quot;select f from Foo f where f.embedded = ?1&quot; (setParameter(1, $embeddedValueObject))&lt;/p&gt;

&lt;p&gt;At least Nr.1 &lt;b&gt;must&lt;/b&gt; be possible in a first implementation.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Selecting:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;1. &quot;select f from Foo f&quot; must explode embedded value objects in the SQL SELECT clause.&lt;br/&gt;
2. &quot;select f.embedded from Foo f&quot; must explode the columns of the embedded object in the SQL SELECT clause.&lt;/p&gt;

&lt;p&gt;At least Nr. 1 &lt;b&gt;must&lt;/b&gt; be possible in a first implementation, obviously.&lt;/p&gt;

&lt;p&gt;Components affected (among others): Parser, SqlWalker, ...&lt;/p&gt;


&lt;h3&gt;&lt;a name=&quot;Persisters&quot;&gt;&lt;/a&gt;Persisters&lt;/h3&gt;

&lt;p&gt;The persisters need to take embedded value objects into account when persisting as well as loading entities.&lt;/p&gt;

&lt;p&gt;Components affected (among others): Persisters, UnitOfWork, ...&lt;/p&gt;


&lt;h3&gt;&lt;a name=&quot;Metadata&quot;&gt;&lt;/a&gt;Metadata&lt;/h3&gt;

&lt;p&gt;ClassMetadataInfo needs to be extended with a field (probably an array) that contains the mappings of embedded values.&lt;br/&gt;
New annotations as well as XML/YAML elements are needed.&lt;/p&gt;

&lt;p&gt;Components affected (among others): ClassMetadataInfo, AnnotationDriver, YamlDriver, XmlDriver, doctrine-mapping.xsd, ...&lt;/p&gt;


&lt;h3&gt;&lt;a name=&quot;ChangeTracking&quot;&gt;&lt;/a&gt;Change Tracking&lt;/h3&gt;

&lt;p&gt;If value objects are supposed to be immutable this is easy and might require no or few changes. If, however, we want to track changes in mutable value objects it might get more complicated.&lt;/p&gt;

&lt;p&gt;Components affected (among others): UnitOfWork, ...&lt;/p&gt;

</description>
                <environment></environment>
            <key id="10295">DDC-93</key>
            <summary>It would be nice if we could have support for ValueObjects</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="ablock">Avi Block</reporter>
                        <labels>
                    </labels>
                <created>Sun, 1 Nov 2009 14:27:35 +0000</created>
                <updated>Sun, 14 Apr 2013 10:18:46 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>37</votes>
                        <watches>31</watches>
                        <comments>
                    <comment id="10511" author="beberlei" created="Thu, 5 Nov 2009 13:06:26 +0000"  >&lt;p&gt;formated snippets nicely&lt;/p&gt;</comment>
                    <comment id="11150" author="trashofmasters" created="Wed, 9 Dec 2009 17:59:53 +0000"  >&lt;p&gt;I need this feature too.&lt;/p&gt;

&lt;p&gt;But I would suggest using the same annotation used by JPA&lt;/p&gt;

&lt;p&gt;@Embeddable&lt;/p&gt;

&lt;p&gt;+1&lt;/p&gt;</comment>
                    <comment id="11215" author="alan" created="Thu, 17 Dec 2009 19:07:36 +0000"  >&lt;p&gt;You should also take into consideration different storage strategies of ValueObjects.&lt;/p&gt;

&lt;p&gt;Martin Fowler points out -  in &#8222;PoEAA&quot;  - two approaches: &lt;a href=&quot;http://martinfowler.com/eaaCatalog/embeddedValue.html&quot; class=&quot;external-link&quot;&gt;Embedded Value (which is the one presented above)&lt;/a&gt; and &lt;a href=&quot;http://martinfowler.com/eaaCatalog/serializedLOB.html&quot; class=&quot;external-link&quot;&gt;Serialized LOB&lt;/a&gt; .&lt;br/&gt;
Both have their pros and cons, that&apos;s why Doctrine2 should give developers choice of selecting the fittest solution.&lt;/p&gt;</comment>
                    <comment id="11216" author="ablock" created="Thu, 17 Dec 2009 19:09:27 +0000"  >&lt;p&gt;Of course technically we can similate a serialized LOB with a new Doctrine 2 type.&lt;/p&gt;</comment>
                    <comment id="11217" author="alan" created="Thu, 17 Dec 2009 19:44:31 +0000"  >&lt;p&gt;I don&apos;t like that idea - Its so not generic.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;VO as a pattern&lt;/b&gt; is important building block of &lt;em&gt;domain model&lt;/em&gt;, which clearly indicates that &lt;b&gt;VO as a feature of Doctrine2&lt;/b&gt; should be tailor-made.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;To anyone of dev-team reading this issue: without VOs Doctrine is not yet DDD-ready, please hurry &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="11230" author="romanb" created="Fri, 18 Dec 2009 13:58:19 +0000"  >&lt;p&gt;Serialized LOB is not very useful IMHO and has lots of problems (many mentioned in PoEEA already).&lt;/p&gt;

&lt;p&gt;@Alan: I appreciate your nice reminder and I&apos;m sure you mean it in a friendly way, but please keep in mind that noone is paid to work on this project. It all happens in free/spare time and the current state of the project already consumed at least 1 1/2 years spending many hours weekly on this project from me alone. Not to speak of the others.&lt;/p&gt;

&lt;p&gt;Thus, there is no point in demanding something or telling us to hurry. The best way to get a feature in is to provide a (&lt;b&gt;good&lt;/b&gt;) patch that we find worth including.&lt;/p&gt;

&lt;p&gt;I started to add notes to this issue to collect all the things that need to be done for this feature.&lt;/p&gt;

&lt;p&gt;In the meantime, its not too hard/ugly to get a half-way decent embedded value yourself:&lt;/p&gt;

&lt;div class=&quot;code panel&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 @HasLifecycleCallbacks */
class Foo {
    &lt;span class=&quot;code-comment&quot;&gt;// annotations not shown
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $embedded;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $value1; &lt;span class=&quot;code-comment&quot;&gt;// never reveal to &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $value2; &lt;span class=&quot;code-comment&quot;&gt;// never reveal to &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $value3; &lt;span class=&quot;code-comment&quot;&gt;// never reveal to &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;
&lt;/span&gt;
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getEmbedded() {
       &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;embedded;
   }

   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setEmbedded($embedded) {
       $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;embedded = $embedded;
   }
   
   /** @PrePersist @PreUpdate */
   function _destructEmbedded() {
       &lt;span class=&quot;code-comment&quot;&gt;// destruct $embedded into $value1, $value2, $value3
&lt;/span&gt;   }

   /** @PostLoad */
   function _constructEmbedded() {
      &lt;span class=&quot;code-comment&quot;&gt;// construct $embedded from $value1, $value2, $value3 
&lt;/span&gt;   }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Several variations of this are possible, also with an external event listener instead of callbacks but in that case you might need to use reflection to get at the values.&lt;/p&gt;</comment>
                    <comment id="11295" author="alan" created="Fri, 25 Dec 2009 12:10:42 +0000"  >&lt;p&gt;I want to share my thoughts on possible VOs collections implementations.&lt;/p&gt;

&lt;p&gt;1. As it was mentioned earlier &lt;em&gt;serialized (C)LOB&lt;/em&gt; is one solution. Implementation of storing/retrieving object graphs alone is quite simple, but it&apos;s complex in terms of SELECTs with conditions.&lt;br/&gt;
Composing SQL condition would result in some nasty constructions e.g. &lt;tt&gt;vo_collection_column LIKE &apos;%foo%bar%&apos;&lt;/tt&gt; which output format would depend on serialization target (CSV, XML, YAML, PHP serialized objects etc.). Also in most cases it would be impossible to obtain eligible result.&lt;/p&gt;

&lt;p&gt;I&apos;m not taking Regexp or XPath operators into consideration as only few RDBMS support them.&lt;/p&gt;

&lt;p&gt;2. The second solution is to break VOs graph into separate related table... or tables if we consider that &lt;b&gt;VO can contain another VO(s)&lt;/b&gt;. It&apos;s not so fast as &lt;em&gt;serialized LOB&lt;/em&gt; but more flexible and it utilize power of RDMS,&lt;br/&gt;
But there is one catch: Doctrine2 must preserve nature of VO. To make it happen during Entities persisting - if any change in dependant VOs graph has been made - all associated VOs rows in database should be deleted and the new/changed VOs graph should be inserted in their place.&lt;br/&gt;
I know it could be inefficient while dealing with large object graphs, yet faster than comparing VOs one-by-one.&lt;/p&gt;

&lt;p&gt;In conclusion:&lt;br/&gt;
&lt;em&gt;serialized LOB&lt;/em&gt; is extremely fast in CRUD-like operations on aggregates, however very search unfriendly.  &lt;br/&gt;
Separate ValueObjects tables are better where  &lt;em&gt;serialized LOB&lt;/em&gt; lacks, but slower in exploitation.&lt;/p&gt;

&lt;p&gt;I can&apos;t tell which approach is superior, because each of them is valid under different circumstances.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;@Alan: I appreciate your nice reminder and I&apos;m sure you mean it in a friendly way  &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;Of course I do.&lt;/p&gt;</comment>
                    <comment id="12131" author="beberlei" created="Sat, 13 Mar 2010 06:20:04 +0000"  >&lt;p&gt;It would be easy to implement value objects in userland using the XML capabilities of many RDBMS:&lt;/p&gt;

&lt;p&gt;1. Implement an Xpath function on the Dql Parser&lt;br/&gt;
2. Implement a User-Defined Type for each value object that handles the translation from and to XML.&lt;/p&gt;

&lt;p&gt;The second point can be heavily optimized when value objects are immutable with an own identiy map of value types inside the Type flyweight instance.&lt;/p&gt;</comment>
                    <comment id="12139" author="ablock" created="Sat, 13 Mar 2010 19:54:54 +0000"  >&lt;p&gt;I more or less suggested something similar above.&lt;/p&gt;</comment>
                    <comment id="12141" author="beberlei" created="Sun, 14 Mar 2010 04:47:41 +0000"  >&lt;p&gt;ah, my bad - i must have overseen this &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="12978" author="jkleijn" created="Sun, 16 May 2010 11:50:31 +0000"  >&lt;p&gt;+1&lt;/p&gt;

&lt;p&gt;This would be awesome.&lt;/p&gt;</comment>
                    <comment id="14689" author="mpdude" created="Tue, 9 Nov 2010 05:48:24 +0000"  >&lt;p&gt;Don&apos;t forget (especially with regard to SLOBs) that values might in turn contain references to Entities.&lt;/p&gt;

&lt;p&gt;Example: An &quot;Order&quot; might be an @Entity and might have a field (an array) of OrderLineItems as value. Each OrderLineItem might e. g. carry quantity or disconunt and references a Product (@Entity).&lt;/p&gt;

&lt;p&gt;So even if you don&apos;t need the traversal from Product to all the Orders it is contained in, serializing the OrderLineItems needs a way to &quot;cut off&quot; the object graph at the transition towards the Product &lt;b&gt;but&lt;/b&gt; must place some kind of referral there so that upon unserialization (of the OrderLineItem list, that is, during Order load) the Product references in every OrderLineItem are at least initialized with proxies again.&lt;/p&gt;

&lt;p&gt;Don&apos;t know whether/how referential integrity (OrderLineItems &amp;lt;-&amp;gt; Products) would make sense or could be implemented here.&lt;/p&gt;</comment>
                    <comment id="15002" author="beberlei" created="Fri, 24 Dec 2010 04:24:27 +0000"  >&lt;p&gt;Pushed back to 2.x, this feature is probably the largest feature request we have and we&apos;d rather focus on small improvements for 2.1&lt;/p&gt;</comment>
                    <comment id="15124" author="zampano" created="Tue, 11 Jan 2011 10:45:33 +0000"  >&lt;p&gt;Several thinks to consider/not to oversee here:&lt;/p&gt;

&lt;p&gt;1) There are value objects with identity. I know that is not DDD-conform but only at first sight. It means they are technically entities but are treated like VOs.&lt;br/&gt;
Common examples are Zipcode or country. As they have identity (e.g. Zipcode: de-40723) they are entities but are created and interchanged like normal VOs.&lt;br/&gt;
On the google DDD-List they were often referenced aS Lookup Entities.&lt;/p&gt;


&lt;p&gt;2) In virtually all (business) cases a collection of VO is an Entity. How else could you reference (add or remove) single elements of that list?&lt;br/&gt;
There are exceptions here like a undefinded number of VOs in a collection, but in that case you can only add or remove a quantity of it.&lt;br/&gt;
As a true collection (say 3 addresses for a client = Entity ClientAdresses) you would have to give them some kind of identity, even if it is only having &lt;br/&gt;
a sequential number in that collection.&lt;/p&gt;

&lt;p&gt;@Matthias: OrderLineItems is an example of actually being an Entity.&lt;/p&gt;</comment>
                    <comment id="15906" author="else" created="Fri, 3 Jun 2011 19:17:58 +0000"  >&lt;p&gt;Hi guys. I face this in my own way. Hope you won&apos;t wake up your neighbours with loud laugh.&lt;/p&gt;

&lt;p&gt;Every @Entity extends my BaseEntity object which provide kind of wrap for value with ValueBase object. So when want to get/set value from entity you call $entity-&amp;gt;getData() where you won&apos;t get value  &quot;data&quot; but wrapping ValueBase for value &quot;data&quot;. Then you can get bare value by getValue(). Name of value class is in annotation and would be child of ValueBase. &lt;/p&gt;

&lt;p&gt;There&apos;s also parent class Base for EntityBase and ValueBase. In my case class Base is something like HTML element. So in the end you can use $entity-&amp;gt;renderHtml() or $value-&amp;gt;renderHtml() no matter if you&apos;re rendering value or @Entity. There&apos;s more features like validation, filtering and hydration value/entity from HTML forms, but it&apos;s extra.&lt;/p&gt;

&lt;p&gt;Implementation:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;&quot;Base.php&quot;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
 /* @MappedSuperclass */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Base {
  /* there&apos;re methods like _getParent(), _getPropertyName(), etc. used in code behind */
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;&quot;ValueBase.php&quot;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class ValueBase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base { 
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getValue() {
        &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;_getParent()-&amp;gt;{$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getPropertyName()};
   }
   
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setValue($value) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getParent()-&amp;gt;{$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getPropertyName()} = $value;
   }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;&quot;EntityBase.php&quot;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
/** @MappedSuperclass */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class EntityBase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __call($name, $arguments) {
        /* get property object */
        $pattern = &apos;/^get(.*)$/u&apos;;
        preg_match($pattern, $name, $matches);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($matches[1])) {
            $propertyName = lcfirst($matches[1]);
            &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;get($propertyName);
        }

        /* set entity */
        $pattern = &apos;/^set(.*)$/u&apos;;
        preg_match($pattern, $name, $matches);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($matches[1])) {
            $propertyName = lcfirst($matches[1]);
            &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;set($propertyName, $arguments[0]);
        }
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function get($propertyName) {
	    $property = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getElementProperty($propertyName);

	    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($property == &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
		&lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Exception(sprintf(&lt;span class=&quot;code-quote&quot;&gt;&quot;There isn&apos;t property like &apos;%s&apos;.&quot;&lt;/span&gt;, $propertyName));

	    /* &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; collections and entities */
	    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($property[&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;] == &lt;span class=&quot;code-quote&quot;&gt;&quot;collection&quot;&lt;/span&gt; || $property[&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;] == &lt;span class=&quot;code-quote&quot;&gt;&quot;entity&quot;&lt;/span&gt;) {
		$element = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;{$propertyName};
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($element != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
		    $element-&amp;gt;_setParent($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
		    $element-&amp;gt;_setPropertyName($propertyName);
		} elseif ($property[&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;] == &lt;span class=&quot;code-quote&quot;&gt;&quot;entity&quot;&lt;/span&gt;) {
		    $element = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $property[&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;];
		    $element-&amp;gt;_setParent($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
		    $element-&amp;gt;_setPropertyName($propertyName);
		    $element-&amp;gt;_setNullEntity();
		    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;{$propertyName} = $element;
		}
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $element;
	    }
	    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	    /* &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; values */
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_loadedEntities[$propertyName])) {
		    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_loadedEntities[$propertyName] = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $property[&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;, $propertyName);
		}
		&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;_loadedEntities[$propertyName];
	    }
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function set($propertyName, $value) {
        $property = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getElementProperty($propertyName);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($property == &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Exception(sprintf(&lt;span class=&quot;code-quote&quot;&gt;&quot;There isn&apos;t property like &apos;%s&apos;.&quot;&lt;/span&gt;, $propertyName));

        /* &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; collections and entities */
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($property[&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;] == &lt;span class=&quot;code-quote&quot;&gt;&quot;collection&quot;&lt;/span&gt; || $property[&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;] == &lt;span class=&quot;code-quote&quot;&gt;&quot;entity&quot;&lt;/span&gt;) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;{$propertyName} = $value;
        }
        /* &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; values */ &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Exception(sprintf(&lt;span class=&quot;code-quote&quot;&gt;&quot;Can&apos;t call set on value property &apos;%s&apos;.&quot;&lt;/span&gt;, $propertyName));
        }

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

&lt;p&gt;Note that there&apos;s something i call &quot;NullEntity&quot;. Instead of getting bare &quot;null&quot; you&apos;ll get @Entity child of EntityBase, where is set property nullEntity. Then there&apos;s posibility to work with null entity (for example renderHtml with empty inputs).&lt;/p&gt;

&lt;p&gt;It would be nice, if this is support by Doctrine natively, because i have some performace problems with my implementation. If it&apos;s interest in my whole code i can send you. But of course there&apos;s some security holes so i&apos;ll send it privetely. Thanks for understand and for Doctrine of course.&lt;/p&gt;</comment>
                    <comment id="16166" author="mathiasverraes" created="Wed, 13 Jul 2011 06:22:23 +0000"  >&lt;p&gt;Note that Roman&apos;s workaround presented here does 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;   /** @PrePersist @PreUpdate */
   function _destructEmbedded() {
       &lt;span class=&quot;code-comment&quot;&gt;// destruct $embedded into $value1, $value2, $value3
&lt;/span&gt;   }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine tracks changes and does not perform updates when no changes are found. $embedded is not mapped, so it&apos;s not tracked and won&apos;t be taken into account by Doctrine when updating. Therefore, if $embedded is the only value that was changed, the PreUpdate event won&apos;t be triggered.&lt;/p&gt;

&lt;p&gt;The easiest thing to do is to simply destruct the VO on every mutation:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setEmbedded($embedded) {
       $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;embedded = $embedded;
       $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_destructEmbedded();
   }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The downside is that you need to remember to call the method in every setter, but apart from that, there are no side effects, it always works and it&apos;s just one line of code &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;_constructEmbedded() keeps working as is, postLoad will always be triggered.&lt;/p&gt;</comment>
                    <comment id="17022" author="dbenjamin" created="Sun, 18 Dec 2011 10:45:26 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;This feature would be awesome ! &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
VOs are really essential in a good domain design.&lt;/p&gt;

&lt;p&gt;If you plan to implement this, please remember that you can have nested VOs.&lt;br/&gt;
Take the design for a Booking process for instance, you would have a DateRange object embedding two DateTime objects (in the simplest case).&lt;/p&gt;

&lt;p&gt;I have no doubts that you&apos;ve already took this in consideration, but i prefer pointing this out, just in case &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="17311" author="beberlei" created="Fri, 20 Jan 2012 16:34:06 +0000"  >&lt;p&gt;work has been started, &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/265&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/265&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19036" author="mpdude" created="Fri, 23 Nov 2012 08:36:53 +0000"  >&lt;p&gt;Does the new &quot;complex sql types&quot; feature help here - I mean, could that be used to map a value object to more than one column in the database?&lt;/p&gt;</comment>
                    <comment id="19520" author="songoko20000" created="Sun, 10 Feb 2013 11:52:55 +0000"  >&lt;p&gt;@Benjamin Eberlei The request seems to be closed in the link you provided! Does that mean that this feature won&apos;t be implemented?!&lt;/p&gt;</comment>
                    <comment id="19524" author="ocramius" created="Sun, 10 Feb 2013 18:11:36 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=songoko20000&quot; class=&quot;user-hover&quot; rel=&quot;songoko20000&quot;&gt;songoko songowan&lt;/a&gt; no, it just probably wasn&apos;t the correct way of implementing this&lt;/p&gt;</comment>
                    <comment id="19980" author="danielpitts" created="Thu, 11 Apr 2013 18:58:11 +0000"  >&lt;p&gt;I&apos;m curious if any effort is currently being put into this.  I would really love to have this feature available.&lt;/p&gt;</comment>
                    <comment id="19981" author="ocramius" created="Thu, 11 Apr 2013 19:02:30 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=danielpitts&quot; class=&quot;user-hover&quot; rel=&quot;danielpitts&quot;&gt;Daniel Pitts&lt;/a&gt; this is being developed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2374&quot; title=&quot;[GH-634] [WIP] Value objects&quot;&gt;DDC-2374&lt;/a&gt; ( &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/634&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/634&lt;/a&gt; )&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="11530">DDC-648</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="14731">DDC-2374</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-54] Trigger postLoad events and callbacks after associations have been initialized</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-54</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the postLoad events and callbacks are triggered after the entity has been created and filled with its &quot;primitive&quot; state but before associations are available. The postLoad events and callbacks should be postponed so that they are triggered after associations have been initialized.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10198">DDC-54</key>
            <summary>Trigger postLoad events and callbacks after associations have been initialized</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="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Oct 2009 18:34:38 +0000</created>
                <updated>Thu, 11 Oct 2012 10:37:46 +0000</updated>
                                    <version>2.0-ALPHA2</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>6</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="14159" author="romanb" created="Mon, 30 Aug 2010 06:36:48 +0000"  >&lt;p&gt;If this is to be included in 2.0 it needs to happen for RC1. However, it is not clear yet whether it will be done in time.&lt;/p&gt;</comment>
                    <comment id="14454" author="beberlei" created="Thu, 23 Sep 2010 17:57:07 +0000"  >&lt;p&gt;How would you solve this Roman? I thought of adding a query hint so that the postLoad inside unit of work is not triggered and gathering all the entities that have a post load event in an array inside the object hydrator, then iterating it after taking the snapshots of all collections inside hydrateAll&lt;/p&gt;</comment>
                    <comment id="14461" author="romanb" created="Fri, 24 Sep 2010 14:37:25 +0000"  >&lt;p&gt;@Benjamin: Not sure what you would use the query hint for but in general that is the approach I had in mind, yes. You can&apos;t get around iterating over the entities after the actual hydration.&lt;/p&gt;</comment>
                    <comment id="14477" author="beberlei" created="Mon, 27 Sep 2010 16:45:30 +0000"  >&lt;p&gt;The query hint would do something like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        &lt;span class=&quot;code-comment&quot;&gt;//TODO: These should be invoked later, after hydration, because associations may not yet be loaded here.
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($class-&amp;gt;lifecycleCallbacks[Events::postLoad]) &amp;amp;&amp;amp; !isset($hints[&apos;hydrationPostLoad&apos;])) {
            $class-&amp;gt;invokeLifecycleCallbacks(Events::postLoad, $entity);
        }
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;evm-&amp;gt;hasListeners(Events::postLoad) &amp;amp;&amp;amp; !isset($hints[&apos;hydrationPostLoad&apos;])) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;evm-&amp;gt;dispatchEvent(Events::postLoad, &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; LifecycleEventArgs($entity, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em));
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;another way would be to move that code out of UoW::createEntity completly and have the persisters call it when they use that method.&lt;/p&gt;</comment>
                    <comment id="14486" author="romanb" created="Tue, 28 Sep 2010 16:11:38 +0000"  >&lt;p&gt;Leaving that code in UoW does not make sense to me, if it is moved, it needs to be moved completely. Why do you think the persisters should do it? Initially I thought collecting the affected entities during hydration and then when hydration is done iterating over them and triggering the postLoad events.&lt;/p&gt;</comment>
                    <comment id="14488" author="beberlei" created="Tue, 28 Sep 2010 16:30:04 +0000"  >&lt;p&gt;Yes but postLoad has to be triggered for non Hydrated entities (i.e. Persister) also&lt;/p&gt;</comment>
                    <comment id="14620" author="beberlei" created="Sat, 30 Oct 2010 11:36:57 +0000"  >&lt;p&gt;Moved back&lt;/p&gt;</comment>
                    <comment id="17849" author="cakper" created="Sun, 15 Apr 2012 19:51:18 +0000"  >&lt;p&gt;Hi Gyus, I need access to associations in postLoad or similar event, and my idea is to dispatch new event after full initialisation of object, what do You think about it? If I can help please let me know &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; It&apos;s important for me.&lt;/p&gt;</comment>
                    <comment id="18731" author="brizzz" created="Tue, 25 Sep 2012 21:41:06 +0000"  >&lt;p&gt;Now in my PostLoad access to associations is work fine. Why this issue is still in Unresolved status?&lt;/p&gt;</comment>
                    <comment id="18822" author="chives" created="Thu, 11 Oct 2012 10:37:46 +0000"  >&lt;p&gt;What do you (Roman and Benjamin) think about adding postHydrate event which would be called within ObjectHydrator::hydrateAllData() on every entity collected during hydration? I could prepare a patch for this. I personally think this would be better than adding a hint that changes behaviour of postLoad event.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-17] Ability to skip the operation from a pre-operation event handler</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-17</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In Doctrine 1.1 it is possible to skip the operation in the event handlers in Doctrine_Record_Listener using Doctrine_Event::skipOperation.&lt;/p&gt;

&lt;p&gt;This no longer seems to be possible in Doctrine 2.0 Alpha 1, for example when handling a preRemove event to implement soft-delete behaviour. Perhaps a method could be added to \Doctrine\Common\EventArgs\LifecycleEventArgs to skip the operation, at least before the operation.&lt;/p&gt;

&lt;p&gt;Without this implementing soft-delete would require the user to update deleted_at and deleted_by himself and then save the record. It could no longer be done automatically when removing a record because the record is then removed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10089">DDC-17</key>
            <summary>Ability to skip the operation from a pre-operation event handler</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Sep 2009 17:09:23 +0000</created>
                <updated>Thu, 26 Aug 2010 08:03:54 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10095" author="romanb" created="Sun, 20 Sep 2009 19:46:03 +0000"  >&lt;p&gt;The problem is, full support for soft-delete throughout the system is not feasible and very fragile. Simple soft-delete through skipping the delete operation is the easiest part. Then you will probably want to modify all DQL queries so that they adhere to it automatically and then there will always be still queries that do NOT go through DQL, like even internal lazy-load queries or native queries or others, which would need to be modified also.&lt;/p&gt;

&lt;p&gt;To sum it up, implementing soft-delete &quot;inside&quot; doctrine is absolutely not worth the effort and imho a bad idea and I&apos;m certainly not willing to make lots of adjustments to the core that have a negative impact on performance just to make this soft-delete possible.&lt;/p&gt;

&lt;p&gt;I really recommend handling &quot;soft&quot; deletes yourself, the normal way, by simply abstracting entity retrieval and persistence through a DAO/repository layer. As a nice side-effect you get less magic and it still works when you swap out doctrine for another persistence provider.&lt;/p&gt;

&lt;p&gt;I am willing to add support for skipping deletes and maybe some other operations through events but I&apos;m not willing to go any further, as explained above.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-4] Implement support for Concrete Table Inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-4</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;A first implementation could probably live without support for polymorphic queries (requires SQL UNIONs to be generated). &lt;/p&gt;</description>
                <environment></environment>
            <key id="10033">DDC-4</key>
            <summary>Implement support for Concrete Table Inheritance</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Sep 2009 18:44:46 +0000</created>
                <updated>Fri, 24 Dec 2010 04:48:20 +0000</updated>
                                    <version>2.1</version>
                                <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>