<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed May 22 20:55:57 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://doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DDC+AND+resolution+%3D+Unresolved+AND+fixVersion+is+EMPTY+ORDER+BY+priority+DESC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DDC+AND+resolution+%3D+Unresolved+AND+fixVersion+is+EMPTY+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="294" total="294"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-2332] [UnitOfWork::doPersist()] The spl_objact_hash() generate not unique hash!</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2332</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I created fixtures and some data was inserted many times without calling the &lt;tt&gt;Task&lt;/tt&gt; entity PrePersist event listener.&lt;/p&gt;

&lt;p&gt;I printed the used and generated hash and I saw a &lt;tt&gt;Proxies&amp;#95;&lt;em&gt;CG&lt;/em&gt;_\Asitly\ProjectManagementBundle\Entity\User&lt;/tt&gt; hash equal a &lt;tt&gt;Task&lt;/tt&gt; entity hash!&lt;/p&gt;</description>
                <environment>Symfony 2.1.8, php 5.4.7 and php 5.4.12, Windows 7</environment>
            <key id="14666">DDC-2332</key>
            <summary>[UnitOfWork::doPersist()] The spl_objact_hash() generate not unique hash!</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://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="fchris82">Kriszti&#225;n Ferenczi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Mar 2013 11:20:00 +0000</created>
                <updated>Mon, 1 Apr 2013 21:47:37 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19808" author="ocramius" created="Tue, 5 Mar 2013 11:23:09 +0000"  >&lt;p&gt;Please provide either a code example or a test case. As it stands, this issue is incomplete&lt;/p&gt;</comment>
                    <comment id="19809" author="beberlei" created="Tue, 5 Mar 2013 11:35:10 +0000"  >&lt;p&gt;Are you calling EntityManager#clear() inbetween? Because PHP reuses the hashes. The ORM accounts for this.&lt;/p&gt;</comment>
                    <comment id="19811" author="beberlei" created="Tue, 5 Mar 2013 12:37:54 +0000"  >&lt;p&gt;This is not a reproduce case, i don&apos;t want to execute your whole project. &lt;/p&gt;

&lt;p&gt;I want to know, what is the actual bug that you see? Can you just print a list of all the hashes? Because the hashes dont differ at the end, bu tjust somewhere in the middle.&lt;/p&gt;</comment>
                    <comment id="19813" author="fchris82" created="Tue, 5 Mar 2013 12:47:24 +0000"  >&lt;p&gt;I attached a hashlogs.txt file. The last Task class hash is 0000000050ab4aba0000000058e1cb12 ( line 3 129 )&lt;/p&gt;

&lt;p&gt;This is not unique, view the line 2 760 . The Task is not being saved and the program don&apos;t call the prePersist listener. The &quot;UnitOfWork&quot; believe the entity has been saved because the &lt;tt&gt;isset($this-&amp;gt;entityStates&lt;span class=&quot;error&quot;&gt;&amp;#91;$oid&amp;#93;&lt;/span&gt;)&lt;/tt&gt; is true. But it is an other entity.&lt;/p&gt;</comment>
                    <comment id="19816" author="fchris82" created="Wed, 6 Mar 2013 01:23:24 +0000"  >&lt;p&gt;The &lt;tt&gt;EntityManager::clear()&lt;/tt&gt; fix the problem, but this is not &quot;good&quot; and &quot;beautiful&quot; solution. Shows no sign of that conflicts were and this is causing the problem. I was looking for the problem 7 hours.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11510" name="hashlogs.txt" size="331693" author="fchris82" created="Tue, 5 Mar 2013 12:47:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2237] oracle IN statement with more than 1000 values</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2237</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If I have a query with a IN statement with more tahn 1000 values I get an sql error.&lt;/p&gt;

&lt;p&gt;I&apos;ve try IN with implode:&lt;br/&gt;
select * from test where id IN(&apos; . implode(&apos;,&apos;, $values) . &apos;)&lt;br/&gt;
and I&apos;ve also try with executeQuery:&lt;br/&gt;
select * from test where id IN(:test)&lt;br/&gt;
  executeQuery($sql, array($values), array(\Doctrine\DBAL\Connection::PARAM_INT_ARRAY))&lt;/p&gt;</description>
                <environment></environment>
            <key id="14376">DDC-2237</key>
            <summary>oracle IN statement with more than 1000 values</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://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="mdrolet">Marc Drolet</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jan 2013 16:34:25 +0000</created>
                <updated>Tue, 2 Apr 2013 12:30:05 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19281" author="mdrolet" created="Fri, 11 Jan 2013 16:47:29 +0000"  >&lt;p&gt;Here is the way I&apos;ve implement the solution on my side: (for oracle)&lt;/p&gt;

&lt;p&gt;into Doctrine/DBAL/Statement.php, I&apos;ve add this 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;
/**
     * Binds a parameter value to the statement.
     * This is implemented &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; way &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; oracle only. Other drivers are redirected to bindValue method.
     *
     * The value will be bound with to the type provided (that required to be a table type).
     *
     * @param &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; $name The name or position of the parameter.
     * @param Array $value The value of the parameter.
     * @param &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; $type The name of the type to use to bind.
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; TRUE on success, FALSE on failure.
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function bindList($name, Array $value, $type)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&apos;oracle&apos; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;platform-&amp;gt;getName())
        {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;bindValue($name, $value, $type);
        }
        &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
        {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;stmt-&amp;gt;bindList($name, $value, $type);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;into Doctrine/DBAL/Driver/Statement.php I&apos;ve add:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
/**
     * @TODO: docs
     */
    function bindList($param, Array $values, $type);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;into Doctrine/DBAL/Driver/OCI8/OCI8Statement.php I&apos;ve add this 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;
/**
     * {@inheritdoc}
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function bindList($param, Array $value, $type)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!($list = oci_new_collection($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_dbh, $type)))
        {
            &lt;span class=&quot;code-comment&quot;&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; OCI8Exception::fromErrorInfo($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;errorInfo());
&lt;/span&gt;        }

        foreach ($value as $entry)
        {
            $list-&amp;gt;append($entry);
        }
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!oci_bind_by_name($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sth, $param, $list, -1, OCI_B_NTY))
        {
            &lt;span class=&quot;code-comment&quot;&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; OCI8Exception::fromErrorInfo($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;errorInfo());
&lt;/span&gt;        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;// NOTE: we should probably add the bindList to all driver Statement object. &lt;/p&gt;

&lt;p&gt;into your code you can use it this way:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$sql = &quot;
    SELECT *
    FROM test
    WHERE id IN
    (
        SELECT *
        FROM
        (
            CAST (: p_ids AS list_int_type)
        )
    )
&quot;;
$stmt = connection-&amp;gt;prepare($sql);
$stmt-&amp;gt;bindList(&apos;: p_ids&apos;, $ids, &apos;list_int_type&apos;);
$stmt-&amp;gt;execute();
$rs = $stmt-&amp;gt;fetchAll(PDO::FETCH_ASSOC);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;NOTE:&lt;br/&gt;
list_int_type need to be a valid oracle data type. You can create one with the name you want.&lt;br/&gt;
example:&lt;br/&gt;
you can have 2 type of accepted array of values:  integer and string&lt;br/&gt;
let&apos;s say we create one for string named: list_str_type  and one for integer list_int_type&lt;/p&gt;

&lt;p&gt; create or replace type list_str_type as table of varchar2(4000);&lt;br/&gt;
 create or replace type list_int_type as table of number;&lt;/p&gt;</comment>
                    <comment id="19924" author="beberlei" created="Mon, 1 Apr 2013 21:44:51 +0000"  >&lt;p&gt;Hey &lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=mdrolet&quot; class=&quot;user-hover&quot; rel=&quot;mdrolet&quot;&gt;Marc Drolet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;thanks for the feedback and the solution, however i would like to have something generic that is working independent of the database driver. This code is very specific.&lt;/p&gt;

&lt;p&gt;Can you point me to some documentation why oci collection works with more than 1000 elements and how it works in PHP?&lt;/p&gt;</comment>
                    <comment id="19929" author="mdrolet" created="Tue, 2 Apr 2013 12:30:05 +0000"  >&lt;p&gt;Hi Benjamin,&lt;/p&gt;

&lt;p&gt;The limitation is not from the oci driver, it&apos;s an oracle limitation.  There are a couple of possible solution/implementation that can be done but the one I&apos;ve provide is the one that perform better for the test I&apos;ve done and from what I can found over the blogs I&apos;ve read.&lt;/p&gt;

&lt;p&gt;I can&apos;t find the exact documentation of oracle.  oracle doc is so poor. &lt;br/&gt;
Here is the best description link I can provide that describe some possible implementation.&lt;br/&gt;
&lt;a href=&quot;http://vsadilovskiy.wordpress.com/substituting-a-collection-for-in-list-performance-study/&quot; class=&quot;external-link&quot;&gt;http://vsadilovskiy.wordpress.com/substituting-a-collection-for-in-list-performance-study/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I don&apos;t know if there is similar limitation with other database.  With the implementation I&apos;ve provided, It will be possible to implement the proper solution depending on the database limitation you face otherwise it will execute the generic IN. What&apos;s bad, we need to create the type into the database.&lt;/p&gt;

&lt;p&gt;NOTE: In my case, I can not perform a sub-query, I get the my collection from a web service call.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2441] Incorrect SQL Query being generated</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2441</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The following DQL :&lt;/p&gt;

&lt;p&gt;SELECT s,ba,c,mno,ss,sws,ccs,cns,cws FROM WLCoreBundle:SIM s INNER JOIN s.billingAccount ba LEFT JOIN s.connection c INNER JOIN s.status ss LEFT JOIN s.workflowStatus sws INNER JOIN c.customerStatus ccs INNER JOIN c.networkStatus cns LEFT JOIN c&lt;br/&gt;
.workflowStatus cws INNER JOIN s.mno mno ORDER BY c.msisdn ASC&lt;/p&gt;

&lt;p&gt;Produces the following SQL :&lt;/p&gt;

&lt;p&gt;SELECT * FROM (SELECT c0_.id AS id0, c0_.iccid AS iccid1, c0_.created AS created2, c0_.updated AS updated3, c0_.spreference AS spreference4, c1_.id ASid5, c1_.account_number AS account_number6, c1_.name AS name7, c1_.address1 AS address18, c1_.address2 AS address29, c1_.address3 AS address310, c1_.address4 AS address411, c1_.address5 AS address512, c1_.address6 AS address613, c1_.email_address AS email_address14, c1_.spreference AS spreference15, c2_.id AS id16, c2_.msisdn AS msisdn17, c2_.local AS local18, c2_.imsi AS imsi19, c2_.data AS data20, c2_.fax AS fax21, c2_.api AS api22, c2_.activation_date AS activation_date23, c2_.contract_end_date AS contract_end_date24, c2_.created AS created25, c2_.updated AS updated26, c2_.spreference AS spreference27, c3_.id AS id28, c3_.ident AS ident29, c3_.label AS label30, c3_.description AS description31, c4_.id AS id32, c4_.ident AS ident33, c4_.label AS label34, c4_.description AS description35, c4_.customer_label AS customer_label36, c4_.customer_description AS customer_description37, c5_.id AS id38, c5_.ident AS ident39, c5_.label AS label40, c5_.description AS description41, c6_.id AS id42, c6_.ident AS ident43, c6_.label AS label44, c6_.description AS description45, c7_.id AS id46, c7_.ident AS ident47, c7_.label AS label48, c7_.description AS description49, c7_.customer_label AS customer_label50, c7_.customer_description AS customer_description51, c8_.id AS id52, c8_.name AS name53, c8_.email_address AS email_address54, c8_.is_active AS is_active55, c8_.spreference AS spreference56, c0_.billing_account AS billing_account57, c0_.customerHierarchy AS customerHierarchy58, c0_.mno AS mno59, c0_.status AS status60, c0_.workflow_status AS workflow_status61, c1_.customer_hierarchy AS customer_hierarchy62, c1_.country AS country63, c1_.tax_rate AS tax_rate64, c1_.currency AS currency65, c1_.status AS status66, c1_.priority AS priority67, c2_.sim AS sim68, c2_.customer_status AS customer_status69, c2_.network_status AS network_status70, c2_.workflow_status AS workflow_status71, ROW_NUMBER() OVER (ORDER BY msisdn17 ASC) AS doctrine_rownum FROM core_sim c0_ WITH (NOLOCK) INNER JOIN core_billing_account c1_ ON c0_.billing_account = c1_.id LEFT JOIN core_connection c2_ ON c0_.id = c2_.sim INNER JOIN core_sim_status c3_ ON c0_.status = c3_.id LEFT JOIN core_sim_workflow_status c4_ ON c0_.workflow_status = c4_.id INNER JOIN core_connection_customer_status c5_ ON c2_.customer_status = c5_.id INNER JOIN core_connection_network_status c6_ ON c2_.network_status = c6_.id LEFT JOIN core_connection_workflow_status c7_ ON c2_.workflow_status = c7_.id INNER JOIN core_mno c8_ ON c0_.mno = c8_.id) AS doctrine_tbl WHERE doctrine_rownum BETWEEN 1 AND 10&lt;/p&gt;

&lt;p&gt;Which returns an error :&lt;/p&gt;

&lt;p&gt; SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 11.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Invalid column name &apos;msisdn17&apos;.&lt;/p&gt;

&lt;p&gt;Same query works fine in Doctrine 2.3&lt;/p&gt;</description>
                <environment>Using Doctrine in Symfony 2.2.1 on Windows Platform</environment>
            <key id="14847">DDC-2441</key>
            <summary>Incorrect SQL Query being generated</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://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="manseuk">Paul Mansell</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 May 2013 16:31:03 +0000</created>
                <updated>Thu, 9 May 2013 21:33:34 +0000</updated>
                                    <version>2.4</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-851] Automerge of detached entities passed to doctrine</title>
                <link>http://doctrine-project.org/jira/browse/DDC-851</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is a feature request.&lt;/p&gt;

&lt;p&gt;Currently it is not possible to assign a detached entity to a relationship. You have to manually &quot;merge&quot; it, and only then you are able to assign it to relationships of managed objects.&lt;/p&gt;

&lt;p&gt;This can become complicated to do. The way it is now, when assigning an entity to a relationship in a process using a large number of entities, the entity&apos;s state needs to be checked and the entity possibly merged - all in userland code. This adds a level of complexity and potential for errors, while it could be solved transparently and elegantly within the ORM. There are ways to implement it in userland code, too, with moderate effort (see below), but this does not change the fact that responsibility for implementing a purely technical feature is delegated to the user, who could be spending his time much better writing business code. And if the user actually implements it, it will clutter the application with non-problem-domain code.&lt;/p&gt;

&lt;p&gt;To keep things simple, I propose Doctrine be extended to simply auto-merge any detached entities passed to it. That would save the programmer the manual tracking of object states and merge() calls.&lt;/p&gt;

&lt;p&gt;This would be especially handy when using cascades, as keeping track of deep object graphs in userland code would duplicate substantial ORM functionality.&lt;/p&gt;

&lt;p&gt;In programs that work with massive amounts of data, it is practically impossible to keep all entities managed due to resource constraints (see e.g. the batch processing patterns documented in the Doctrine 2 reference at &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/batch-processing/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/batch-processing/en&lt;/a&gt;). In a situation like that, one would probably simply flush and clear the entity manager regularly. Doctrine 2 currently forces the user to manually &quot;merge&quot; all persistent objects he/she still holds references to and wants to assign e.g. to other newly created persistable objects. I can not think of any reason why Doctrine 2 should not be able to do it automatically.&lt;/p&gt;


&lt;p&gt;Below is another comment originally attached to the GitHub proposal, containing a userland implementation of the feature as a temporary fix, for whoever cares.&lt;/p&gt;

&lt;p&gt;Here is a userland implementation for the functionality I am proposing, though I feel it is technical clutter that belongs into the ORM. Changing doctrine to be able to auto-merge unmanaged entities would be ideal. I thought I&apos;d share this, for use as long as Doctrine 2 does not provide equivalent functionality. The implementation assumes all entities inherit from a base class (named &quot;YourEntityBaseClass here&quot;) and intercepts the assignment to ToOne-relationships in a __set() method provided in that base class. For ToMany-relationships we extend ArrayCollection to intercept calls to add() and set() to accomplish the same.&lt;/p&gt;

&lt;p&gt;As an alternative to defining a __set() method in a base class you could also implement the interception by changing any mutator methods you define in your entities. But that would bloat your code quickly as you define more and more relationship attributes on your entities.&lt;/p&gt;

&lt;p&gt;The following __set() method implementation relies on reflection to parse the DocBlock-Comment with the Annotation and determine whether or not the property to be set is a ToOne-relationship.&lt;/p&gt;

&lt;div class=&quot;code panel&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 __set($name, &amp;amp;$value) {
      
      $reflectionClass = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ReflectionClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
      
      $property = $reflectionClass-&amp;gt;getProperty($name);

      &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (   self::isToOneRelationship($property)
          &amp;amp;&amp;amp; $value !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
            
         $value = self::mergeIfDetached($value);
      }
      
      $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name = $value;
   }

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

&lt;p&gt;The following is an implementation of mergeIfDetached(), that assumes there is a __get defined on the entity, to be able to access the protected mapped properties.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function mergeIfDetached(YourEntityBaseClass $dataObject) {

   $doctrineEntityManager = DB::getDoctrineEntityManager();

   &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($doctrineEntityManager-&amp;gt;getUnitOfWork()-&amp;gt;getEntityState($dataObject) == \Doctrine\ORM\UnitOfWork::STATE_DETACHED) {
       
      $dataObject = $doctrineEntityManager-&amp;gt;merge($dataObject);
   }

   &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $dataObject;
}

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

&lt;p&gt;For your purposes, consider DB to be just a class holding a reference to the Doctrine entity manager.&lt;/p&gt;

&lt;p&gt;Here are the helper methods for the reflection:&lt;/p&gt;

&lt;div class=&quot;code panel&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;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function isToOneRelationship(ReflectionProperty $property) {

      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; self::matchDoctrineAnnotation($property, self::$doctrineToOneRelationshipAnnotation);
   }

   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function matchDoctrineAnnotation(ReflectionProperty $property, $pattern) {
      
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; preg_match(&apos;/\@&apos; . $pattern . &apos;/&apos;, $property-&amp;gt;getDocComment()) != 0;
   }

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

&lt;p&gt;Here is the drop-in-replacement class for use with ToMany-Relationships. It uses the static reloadIfDetached method defined in the entity base class:&lt;/p&gt;

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


class Collection &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ArrayCollection {
   
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function set($key, $value) {
       
       $value = YourEntityBaseClass::mergeIfDetached($value);
       
       parent::set($key, $value);
    }


    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function add($value) {
       
       $value = YourEntityBaseClass::mergeIfDetached($value);
       
       &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parent::add($value);
    }
}

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

&lt;p&gt;This approach keeps the amount of unnecessary code to a minimum, so that merges are not scattered throughout the problem-domain code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12049">DDC-851</key>
            <summary>Automerge of detached entities passed to doctrine</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Sun, 31 Oct 2010 22:52:26 +0000</created>
                <updated>Thu, 30 Dec 2010 05:55:17 +0000</updated>
                                    <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15057" author="dalvarez" created="Wed, 29 Dec 2010 18:53:03 +0000"  >&lt;p&gt;I have to note that the code I listed above turned out to be broken. There is nothing that guarantees that a data object just merged will not become detached again after being merged on assignment, unless the object is immediately persisted afterwards.&lt;/p&gt;

&lt;p&gt;The correct solution would be to merge all data objects found through relationships for a given data object, right from the persistence manager, immediately before calling persist() on the data object.&lt;/p&gt;

&lt;p&gt;I am currently using this solution (save() saves a data object safely for use within long-running batch jobs):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function save(DataObject $dataObject) {
      
      self::mergeRelatedDataObjectsIfDetached($dataObject);
      
      self::$doctrineEntityManager-&amp;gt;persist($dataObject);
   }
   

   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function merge(DataObject $dataObject) {
      
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; self::$doctrineEntityManager-&amp;gt;merge($dataObject);
   }


  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function mergeRelatedDataObjectsIfDetached(DataObject $dataObject) {
      
      $reflectionClass = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ReflectionClass($dataObject);
      
      $properties = $reflectionClass-&amp;gt;getProperties();
      
      foreach ($properties as $property) {

         $propertyName = $property-&amp;gt;getName();
         
         $propertyValue = $dataObject-&amp;gt;__get($propertyName);
         
         
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (MetadataReader::isToOneRelationship($property)) {
            
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (   $propertyValue !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
                &amp;amp;&amp;amp; ! $propertyValue &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy
                &amp;amp;&amp;amp; self::isDetached($propertyValue)) {
               
               $relatedDataObject = self::merge($propertyValue);
               
               $dataObject-&amp;gt;__set($propertyName, $relatedDataObject);
            }
         }
         &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (MetadataReader::isToManyRelationship($property)) {
               
               $relatedDataObjects = $propertyValue-&amp;gt;toArray();
               
               foreach ($relatedDataObjects as $index =&amp;gt; $relatedDataObject) {
                  
                  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $relatedDataObject &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy
                      &amp;amp;&amp;amp; self::isDetached($relatedDataObject)) {
                     
                     $relatedDataObject = self::merge($relatedDataObject);
                     
                     
                     &lt;span class=&quot;code-comment&quot;&gt;// Replace the entry in the collection with the merged copy.
&lt;/span&gt;                     
                     $propertyValue-&amp;gt;set($index, $relatedDataObject);
                  }
               }
            }
         }
      }
   }
   
   
   &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function isDetached(DataObject $dataObject) {
      
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; self::$doctrineEntityManager-&amp;gt;getUnitOfWork()-&amp;gt;getEntityState($dataObject) == UnitOfWork::STATE_DETACHED;
   }

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


&lt;p&gt;I still wish there would be an automerge feature, kind of Hibernate&apos;s &quot;update&quot;.&lt;/p&gt;</comment>
                    <comment id="15058" author="dalvarez" created="Wed, 29 Dec 2010 18:55:14 +0000"  >&lt;p&gt;Wrapped the code sections into proper code blocks...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-813] Validate Schema should complain on bi-directional relationships with mapped superclasses</title>
                <link>http://doctrine-project.org/jira/browse/DDC-813</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;@ManyToOne and @OneToOne on mapped superclasses have to be unidirectional. The Schema Validator should verify this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11948">DDC-813</key>
            <summary>Validate Schema should complain on bi-directional relationships with mapped superclasses</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 21 Sep 2010 18:13:26 +0000</created>
                <updated>Mon, 29 Oct 2012 09:13:47 +0000</updated>
                                    <version>2.0-BETA4</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-803] Create subselect queries within join statements</title>
                <link>http://doctrine-project.org/jira/browse/DDC-803</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="11919">DDC-803</key>
            <summary>Create subselect queries within join statements</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="martijn">Martijn Evers</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Sep 2010 08:58:51 +0000</created>
                <updated>Tue, 14 Sep 2010 08:58:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-785] Post-Post-Persist event</title>
                <link>http://doctrine-project.org/jira/browse/DDC-785</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;postPersist/postUpdate events are triggered in the middle of a unitOfWork, and querying the DB in such events causes infinite loops. Doctrine attempts to flush the entity manager before running any query, which triggers flushing of entities, and postPersist/postUpdate events are triggered again.&lt;/p&gt;

&lt;p&gt;I did not checked, but the flush() before each query may be a performance problem too, if doctrine has to determine what has changed, depending on the changetracking policy.&lt;/p&gt;

&lt;p&gt;Also, it would be great if postPersist / postUpdate events were triggered after all entities have been persisted. It looks like that entities are flushed by groups of same &apos;type&apos;, and that events for a type are triggered once all of the elements of that group have been flushed, potentially before entities of an other type have been flushed : postPersist / postUpdate events are triggered while some other entities are still not flushed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11874">DDC-785</key>
            <summary>Post-Post-Persist event</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="arnaud-lb">arnaud-lb</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Sep 2010 16:08:16 +0000</created>
                <updated>Fri, 14 Jan 2011 03:11:48 +0000</updated>
                                    <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14250" author="beberlei" created="Fri, 3 Sep 2010 03:10:08 +0000"  >&lt;p&gt;That is documented and for perfomance reasons we cannot move the preUpdate/postUpdate/prePersist/postPersist events to other locations inside the UnitOfWork.&lt;/p&gt;

&lt;p&gt;There is an onFlush event that allows for more flexibility and is triggered before any update/insert/delete is done by the UnitOfWork.&lt;/p&gt;
</comment>
                    <comment id="14274" author="arnaud-lb" created="Sat, 4 Sep 2010 08:09:58 +0000"  >&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;I understand that. Is there any chance of getting some onPostFlush or similar, which would be triggered like onFlush, but after all update/insert/delete ? Or just some post-something event which is allowed to issue db queries.&lt;/p&gt;</comment>
                    <comment id="14458" author="gediminasm" created="Fri, 24 Sep 2010 10:02:13 +0000"  >&lt;p&gt;onFlush you can store your entity for furher processing and on postPersist you can check if there are no more insertions and process the entity if it needs additional query&lt;br/&gt;
I have faced all these issues and you can check &lt;a href=&quot;http://github.com/l3pp4rd/DoctrineExtensions/tree/master/lib/DoctrineExtensions/Translatable/&quot; class=&quot;external-link&quot;&gt;http://github.com/l3pp4rd/DoctrineExtensions/tree/master/lib/DoctrineExtensions/Translatable/&lt;/a&gt;&lt;br/&gt;
for a solution to your problem&lt;/p&gt;</comment>
                    <comment id="15140" author="gediminasm" created="Fri, 14 Jan 2011 03:11:48 +0000"  >&lt;p&gt;I think this issue should be closed since the main reason of opening it was the possibility to execute additional queries when inserts were pending in unit of work. In current release it does not cause a flush during an additional query execution anymore.  &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-779] Doctrine\ORM\Configuration should be immutable after construction of EntityManager</title>
                <link>http://doctrine-project.org/jira/browse/DDC-779</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the Doctrine\ORM\Configuration instance is not immutable after construction of the EM, which can lead to funny behavior when changing essential dependencies such as caches or others.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11850">DDC-779</key>
            <summary>Doctrine\ORM\Configuration should be immutable after construction of EntityManager</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Aug 2010 16:23:27 +0000</created>
                <updated>Mon, 30 Aug 2010 16:23:27 +0000</updated>
                                    <version>2.0-BETA3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-769] Disabling discriminator column in WHERE clause</title>
                <link>http://doctrine-project.org/jira/browse/DDC-769</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Per default Doctrine 2 adds an IN(...)-part to the query when hydrating an entity where a discriminator column is defined. While this makes sense as a default behavior, it would be pretty helpful if one could disable the WHERE-clause for discriminator columns alltogether for performance optimization.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11830">DDC-769</key>
            <summary>Disabling discriminator column in WHERE clause</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="lstrojny">Lars Strojny</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Aug 2010 10:41:56 +0000</created>
                <updated>Tue, 7 Sep 2010 06:49:13 +0000</updated>
                                    <version>2.0-BETA3</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14094" author="romanb" created="Thu, 26 Aug 2010 12:39:43 +0000"  >&lt;p&gt;That would obviously produce wrong results. Maybe you can elaborate more with an example.&lt;/p&gt;</comment>
                    <comment id="14299" author="lstrojny" created="Tue, 7 Sep 2010 06:49:13 +0000"  >&lt;p&gt;I use ENUM(&quot;foo&quot;,&quot;bar&quot;) as discriminator columns. That means, the column will contain the right values out of the box, no further result set limiting required with WHERE.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1270] Incorrect  QueryBuilder example</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1270</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the QueryBuilder section of the documentation (&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/query-builder.html#the-expr-class&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/query-builder.html#the-expr-class&lt;/a&gt;) there&apos;s an example with statements 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; 
$qb-&amp;gt;expr()-&amp;gt;select(&apos;u&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;But this doesn&apos;t work anymore.&lt;/p&gt;

</description>
                <environment></environment>
            <key id="12814">DDC-1270</key>
            <summary>Incorrect  QueryBuilder example</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="a.bogomazov">Alex Bogomazov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jul 2011 13:50:30 +0000</created>
                <updated>Mon, 11 Jul 2011 17:49:28 +0000</updated>
                                    <version>2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16149" author="mridgway" created="Mon, 11 Jul 2011 17:49:28 +0000"  >&lt;p&gt;PR at &lt;a href=&quot;https://github.com/doctrine/orm-documentation/pull/35&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/orm-documentation/pull/35&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1269] Unexpected behavior while using association on a non primary key field</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1269</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We have association on non primary key. Something like this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Entities\Payment:
  type: entity
  table: payments
  fields:
    id: 
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      generator:
        strategy: IDENTITY
[-- skipped --]
  manyToOne:
    order:
      targetEntity: Entities\Order
      inversedBy: payments
      joinColumn:
        name: scode
        referencedColumnName: scode
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Entities\Order:
  type: entity
  table: h_orders
  fields:
    id:
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      generator:
        strategy: IDENTITY
    scode:
      type: integer
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
[-- skipped --]
  oneToMany:
    payments:
      targetEntity: Entities\Payment
      mappedBy: order
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I try to fetch Order from Payment with lazy loading I receive empty Order object with null properties. If I use eager fetching Order object is valid.&lt;br/&gt;
SQL generated for lazy loading seems to be valid, so I suppose the problem is in mapping result to the object. At the same time lazy loading works fine with 2.0.6 version.&lt;/p&gt;




&lt;p&gt;Another problem appears while persisting new Payment. &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$payment = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entities\Payment();
...
$order = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;getRepository(&apos;\Entities\Order&apos;)-&amp;gt;find(46320);
$payment-&amp;gt;setOrder($order);
$order-&amp;gt;addPayments($payment);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($payment);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I get this error: Fatal error: Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1048 Column &apos;scode&apos; cannot be null&apos; in /usr/share/php/Doctrine/DBAL/Statement.php:131&lt;/p&gt;

&lt;p&gt;I found issue which is still open and looks like mine &amp;#8211; &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1114&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1114&lt;/a&gt;. What do you think about this? &lt;/p&gt;</description>
                <environment></environment>
            <key id="12813">DDC-1269</key>
            <summary>Unexpected behavior while using association on a non primary key field</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="saniok">Alexandr Torchenko</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jul 2011 13:03:18 +0000</created>
                <updated>Wed, 13 Jul 2011 13:26:20 +0000</updated>
                                    <version>2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16153" author="beberlei" created="Tue, 12 Jul 2011 20:26:04 +0000"  >&lt;p&gt;Formatting, please add a second ticket for the second issue.&lt;/p&gt;</comment>
                    <comment id="16154" author="beberlei" created="Tue, 12 Jul 2011 20:40:11 +0000"  >&lt;p&gt;I don&apos;t think its supported to use a non primary id for foreign key matching. I cant tell for sure though since i wasnt responsible to design this part of the Doctrine code. I would strongly suggest not to do this.&lt;/p&gt;</comment>
                    <comment id="16156" author="beberlei" created="Tue, 12 Jul 2011 20:42:09 +0000"  >&lt;p&gt;Marked as improvement. The problem is we cannot detect this invalid mapping, so no exception is thrown during compilation of the mappings,&lt;/p&gt;</comment>
                    <comment id="16157" author="beberlei" created="Tue, 12 Jul 2011 20:45:23 +0000"  >&lt;p&gt;This kind of mapping error is already acknowledged by the schema-validator console task.&lt;/p&gt;</comment>
                    <comment id="16169" author="saniok" created="Wed, 13 Jul 2011 13:20:02 +0000"  >&lt;p&gt;Should I create second ticket?&lt;/p&gt;

&lt;p&gt;Please confirm that I understood correctly. Should we avoid such mapping as it is considered as invalid.&lt;/p&gt;</comment>
                    <comment id="16170" author="beberlei" created="Wed, 13 Jul 2011 13:26:20 +0000"  >&lt;p&gt;Yes, it will not work at all. You dont need to create the second ticket as that error steams from the mapping error.&lt;/p&gt;

&lt;p&gt;You will see an error message when calling ./doctrine orm:schema:validate with this mapping.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12563">DDC-1114</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1263] @ManyToOne Arbitrary References</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1263</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Could it be possible to allow for arbitrary many to one entities through a &quot;class + id&quot; construct as join columns?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12807">DDC-1263</key>
            <summary>@ManyToOne Arbitrary References</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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:17:25 +0000</created>
                <updated>Sat, 9 Jul 2011 22:17:25 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1259] Atomic creation of Proxy files</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1259</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;From 265e5086ea51ebcafc73f91abc64334d17e2f416 Mon Sep 17 00:00:00 2001
From: Karsten Dambekalns &amp;lt;karsten@typo3.org&amp;gt;
Date: Wed, 25 May 2011 12:11:55 +0200
Subject: [PATCH 4/5] Use temporary file and rename &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; proxy class creation

Instead of a simple file_put_contents() the proxy class code is written to a
temporary file and renamed to the &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; filename. This allows file access even
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; only allowed by the directory permission.
---
 lib/Doctrine/ORM/Proxy/ProxyFactory.php |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
index f0cf19c..b2d42fb 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php
+++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -152,7 +152,15 @@ class ProxyFactory
 
         $file = str_replace($placeholders, $replacements, $file);
 
-        file_put_contents($fileName, $file, LOCK_EX);
+        $temporaryFileName = $fileName . uniqid( ) . &apos;.temp&apos;;
+        $result = file_put_contents( $temporaryFileName, $file );
+
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($result === FALSE) &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \RuntimeException(&apos;The temporary proxy class file &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos; . $temporaryFileName . &apos;&quot;&lt;/span&gt; could not be written.&apos;);
+        $i = 0;
+        &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt;(!rename( $temporaryFileName, $fileName ) &amp;amp;&amp;amp; $i &amp;lt; 5) {
+            $i++;
+        }
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($result === FALSE) &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \RuntimeException(&apos;The proxy class file &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos; . $fileName . &apos;&quot;&lt;/span&gt; could not be written.&apos;);
     }
 
     /**
-- 
1.7.4.1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12802">DDC-1259</key>
            <summary>Atomic creation of Proxy files</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 8 Jul 2011 13:29:04 +0000</created>
                <updated>Sat, 9 Jul 2011 19:44:50 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16134" author="beberlei" created="Sat, 9 Jul 2011 19:44:50 +0000"  >&lt;p&gt;Nette Framework uses a safe stream: &lt;a href=&quot;https://github.com/nette/nette/blob/master/Nette/Utils/SafeStream.php&quot; class=&quot;external-link&quot;&gt;https://github.com/nette/nette/blob/master/Nette/Utils/SafeStream.php&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1235] Provide fluent interfaces in stub methods</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1235</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Or maybe some template-files could be provided for all stubs.&lt;/p&gt;

&lt;div class=&quot;code panel&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;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; $_setMethodTemplate =
&apos;/**
 * &amp;lt;description&amp;gt;
 *
 * @param &amp;lt;variableType&amp;gt;$&amp;lt;variableName&amp;gt;
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function &amp;lt;methodName&amp;gt;(&amp;lt;methodTypeHint&amp;gt;$&amp;lt;variableName&amp;gt;)
{
&amp;lt;spaces&amp;gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;&amp;lt;fieldName&amp;gt; = $&amp;lt;variableName&amp;gt;;

&amp;lt;spaces&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;&amp;lt;/spaces&amp;gt;
}&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment></environment>
            <key id="12757">DDC-1235</key>
            <summary>Provide fluent interfaces in stub methods</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="h-andreas">Andreas H&#246;rnicke</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Jun 2011 07:58:16 +0000</created>
                <updated>Mon, 29 Oct 2012 09:18:11 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18895" author="stof" created="Mon, 29 Oct 2012 09:18:11 +0000"  >&lt;p&gt;@beberlei this should be closed as it is the case since 2.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1217] Use the DBAL ReservedKeywordsValidator in orm:validate-schema</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1217</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DBAL provides a ReservedKeywordsValidator to check whether a word is reserved. But this tool is not used by the ORM when validating the schema. It would be useful to use it to avoid WTF from users getting a PDOException when creating their schema because of this.&lt;br/&gt;
The other solution if you don&apos;t want to add this in orm:validate-schema would be to create a dedicated command.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12727">DDC-1217</key>
            <summary>Use the DBAL ReservedKeywordsValidator in orm:validate-schema</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Jun 2011 22:04:34 +0000</created>
                <updated>Mon, 20 Jun 2011 22:04:34 +0000</updated>
                                    <version>2.0.6</version>
                <version>Git Master</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1201] DQL Example about count(*) related entity is wrong</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1201</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL Example about count&lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; related entity is wrong&lt;/p&gt;</description>
                <environment></environment>
            <key id="12706">DDC-1201</key>
            <summary>DQL Example about count(*) related entity is wrong</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 10 Jun 2011 13:31:19 +0000</created>
                <updated>Mon, 10 Oct 2011 10:00:44 +0000</updated>
                                    <version>2.1.1</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16568" author="gedrox" created="Mon, 10 Oct 2011 10:00:18 +0000"  >&lt;p&gt;Also similar DQL in documentation URL &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results&lt;/a&gt; fails parsing stage:&lt;/p&gt;

&lt;div class=&quot;code panel&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 = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT u, &apos;some scalar string&apos;, count(u.groups) AS num FROM User u JOIN u.groups g GROUP BY u.id&quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with 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;  [Doctrine\ORM\Query\QueryException]                                                                                                                         
  [Semantical Error] line 0, col 40 near &apos;localizations)&apos;: Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected. 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Should be &quot;count(g.id)&quot; instead of &quot;count(u.groups)&quot;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1197] Proxies should handle variable argument lists</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1197</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is a contingency issue for &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/60&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/60&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&quot;Fix to allow for proxy generated classes to respect methods in parent which may use func_get_args internally. Previously they would be passed nothing and thus fail. Also reduces need to build up argumentString. &quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12699">DDC-1197</key>
            <summary>Proxies should handle variable argument lists</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 5 Jun 2011 08:52:14 +0000</created>
                <updated>Sun, 5 Jun 2011 08:52:14 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1164] doctrine:schema:update --force == doctrine:schema:create</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1164</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine:schema:update --force is the same as doctrine:schema:create.&lt;/p&gt;

&lt;p&gt;Under the hood, this may not be true, but they basically accomplish the same task. Schema:create should be removed, as it is redundant. &lt;/p&gt;

&lt;p&gt;Just look at django, one command to update db:&lt;/p&gt;

&lt;p&gt;./manage.py syncdb&lt;/p&gt;

&lt;p&gt;Not saying that django gets everything correct, but the one command to synchronize the database is consistent. doctrine:schema:update should be smart enough to do all of the work, instead of relying on the redundant doctrine:schema:create.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12657">DDC-1164</key>
            <summary>doctrine:schema:update --force == doctrine:schema:create</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="xaav">Geoff</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 May 2011 23:37:51 +0000</created>
                <updated>Fri, 20 May 2011 23:37:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1154] Proxies should take convention while loading *ToOne associations to reduce 1 extra query</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1154</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Read the IRC log:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;[2:38pm] guilhermeblanco: beberlei: ping
[2:38pm] guilhermeblanco: I&apos;m curious about a feature &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; Doctrine supports
[2:38pm] guilhermeblanco: &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; on a proxy:
[2:38pm] guilhermeblanco: $proxy-&amp;gt;getOneToOneAssoc()
[2:39pm] guilhermeblanco: shouldn&apos;t Doctrine already populate the assoc entity?
[2:39pm] guilhermeblanco: it would be an &lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join
[2:39pm] beberlei: how would doctrine know it needs it?
[2:39pm] guilhermeblanco: beberlei: it always repass the ClassMetadata to Persister
[2:40pm] guilhermeblanco: so all needed item is to also pass the fieldname/assocname
[2:40pm] beberlei: but how would doctrine know getOneToOneASsoc() really returns &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; assoc
[2:40pm] beberlei: it could contain any logic
[2:40pm] guilhermeblanco: it wouldn&apos;t... but as soon as we trigger __load($fieldName)
[2:40pm] guilhermeblanco: we know that we could populate not only the Proxy, but also assoc
[2:40pm] beberlei: by convention?
[2:40pm] guilhermeblanco: ya
[2:41pm] beberlei: sounds good, can you open a ticket?
[2:41pm] guilhermeblanco: getUser() would trigger __load(&apos;user&apos;)
[2:41pm] guilhermeblanco: sure!
[2:41pm] guilhermeblanco: I&apos;ll pastie &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; as content... it would be awesome to have
[2:41pm] guilhermeblanco: I see a lot of queries here that could be optimized 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12642">DDC-1154</key>
            <summary>Proxies should take convention while loading *ToOne associations to reduce 1 extra query</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Tue, 17 May 2011 17:58:37 +0000</created>
                <updated>Tue, 17 May 2011 17:58:37 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1143] deprecated or missing method, $cacheDriver-&gt;setManageCacheIds(true);</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1143</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/caching.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/caching.html&lt;/a&gt;&lt;br/&gt;
mentions $cacheDriver-&amp;gt;setManageCacheIds(true);.&lt;br/&gt;
But method absent from V 2.04, possibly just needs a version note next to it.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12625">DDC-1143</key>
            <summary>deprecated or missing method, $cacheDriver-&gt;setManageCacheIds(true);</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="raiz">raiz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 May 2011 13:27:47 +0000</created>
                <updated>Tue, 10 May 2011 13:27:47 +0000</updated>
                                    <version>2.0.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1144] How insert a AES_ENCRYPT value in a table field</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1144</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi there,&lt;br/&gt;
I&apos;m trying to insert an encrypted data:&lt;/p&gt;

&lt;p&gt;Because &apos;&quot;INSERT statements are not allowed in DQL, ....&quot; i processed like this:&lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
...&lt;br/&gt;
// controller&lt;br/&gt;
$membre = new \Entity\TMembre();&lt;br/&gt;
$membre-&amp;gt;setPassword($password);&lt;br/&gt;
$em-&amp;gt;persist($membre);&lt;br/&gt;
$em-&amp;gt;flush();&lt;br/&gt;
...&lt;br/&gt;
?&amp;gt;&lt;br/&gt;
//entity&lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
namespace Entity;&lt;br/&gt;
/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;TMembre&lt;br/&gt;
 *&lt;/li&gt;
	&lt;li&gt;@Table(name=&quot;t_membre&quot;)&lt;/li&gt;
	&lt;li&gt;@Entity(repositoryClass=&quot;Repository\TMembreRepository&quot;)&lt;br/&gt;
 */&lt;br/&gt;
class TMembre&lt;br/&gt;
{&lt;br/&gt;
    /**&lt;/li&gt;
	&lt;li&gt;Set password     *&lt;/li&gt;
	&lt;li&gt;@param string $password     */&lt;br/&gt;
    public function setPassword($password)
    {
    	$this-&amp;gt;email = &quot;AES_ENCRYPT(&apos;&quot;.$email.&quot;&apos;,&apos;&quot;._MYSQL_CRYPT.&quot;&apos;)&quot;; =&amp;gt; insert this entire string without executing encryption
    	$this-&amp;gt;email = new \Doctrine\ORM\Query\Expr\Func(&quot;AES_ENCRYPT&quot;,array(&quot;&apos;&quot;.$email.&quot;&apos;&quot;,&quot;&apos;&quot;._MYSQL_CRYPT.&quot;&apos;&quot;)); =&amp;gt; does not work
    }
&lt;p&gt;}&lt;br/&gt;
?&amp;gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;How can i do ?&lt;br/&gt;
Add this method to Doctrine\ORM\Query\Expr class ?&lt;/p&gt;

&lt;p&gt;/**&lt;br/&gt;
    public function aesEncrypt($value)&lt;/p&gt;
    {
       return &quot;AES_ENCRYPT(&apos;&quot;.$value.&quot;&apos;,&apos;&quot;._MYSQL_CRYPT.&quot;&apos;)&quot;
    }

&lt;p&gt;Best regards&lt;/p&gt;

&lt;p&gt;David&lt;/p&gt;</description>
                <environment>Win XP, MySql5, Php5.3, ZendFramework 1.11.4</environment>
            <key id="12626">DDC-1144</key>
            <summary>How insert a AES_ENCRYPT value in a table field</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="dquintard">dquintard</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 May 2011 19:58:28 +0000</created>
                <updated>Tue, 10 May 2011 19:58:28 +0000</updated>
                                    <version>2.0.4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1137] SchemaTool#getUpdateSchemaSql() does not respect database identifier in table names</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1137</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given two databases, &apos;foo&apos; and &apos;bar&apos;, with entities in /Entities/Foo/ annotated as follows:&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;/**
 * Test
 *
 * @Table(name=&quot;foo.test&quot;)
 * @Entity
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Create an EntityManager instance with &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;$connectionOptions = array( 
    &apos;dbname&apos; =&amp;gt; &apos;Foo&apos;, 
    &apos;driver&apos; =&amp;gt; &apos;pdo_mysql&apos;, 
    &amp;lt;..etc..&amp;gt;
);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Use EntityManager#getClassMetaData( &quot;Entities\\Foo&lt;br class=&quot;atl-forced-newline&quot; /&gt;Test&quot; ) to pass to SchemaTool#createSchema() and Doctrine appropriately creates a database table foo.test&lt;/p&gt;

&lt;p&gt;Use EntityManager#getClassMetaData( &quot;Entities\\Foo&lt;br class=&quot;atl-forced-newline&quot; /&gt;Test&quot; ) to pass to SchemaTool#updateSchema() and Doctrine fails with Exception&lt;br/&gt;
-&amp;gt; SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;test&apos; already exists&lt;/p&gt;

&lt;p&gt;Inserting&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;die( print_r( $fromSchema, 1 ) . print_r( $toSchema, 1 ) . print_r( $schemaDiff, 1 ) );&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;into Doctrine/ORM/Tools/SchemaTool.php line 632 shows $fromSchema outputs&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;[_tables:protected] =&amp;gt; Array
        (
            [test]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but $toSchema outputs&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;[_tables:protected] =&amp;gt; Array
        (
            [foo.test]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which causes $schemaDiff to output&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[newTables] =&amp;gt; Array
        (
            [foo.test]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In summary, Doctrine/DBAL/Schema/Comparator considers foo.test a new table, because Doctrine/DBAL/Schema/AbstractSchemaManager lists its table as &quot;test&quot; rather than &quot;foo.test&quot;. &lt;/p&gt;
</description>
                <environment>Linux 2.6.18-194.32.1.el5.centos.plus x86_64 GNU/Linux&lt;br/&gt;
</environment>
            <key id="12614">DDC-1137</key>
            <summary>SchemaTool#getUpdateSchemaSql() does not respect database identifier in table names</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="hlomas">Hugh Lomas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 May 2011 17:23:11 +0000</created>
                <updated>Sat, 14 May 2011 10:10:20 +0000</updated>
                                    <version>2.0.4</version>
                                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15808" author="hlomas" created="Thu, 5 May 2011 18:37:09 +0000"  >&lt;p&gt;It seems that changing AbstractSchemaManager.php to the following corrected the issue for me, however I am not sure of any repercussions that may arise as a result, being unfamiliar with the codebase.&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine/DBAL/Schema/AbstractSchemaManager.php line 228&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;return new Table( $tableName, $columns, $indexes, $foreignKeys, false, array());&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine/DBAL/Schema/AbstractSchemaManager.php line 228&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;return new Table( &lt;font color=&quot;green&quot;&gt;$this-&amp;gt;_conn-&amp;gt;getDatabase() . &quot;.&quot; . &lt;/font&gt; $tableName, $columns, $indexes, $foreignKeys, false, array());&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    <comment id="15850" author="beberlei" created="Sat, 14 May 2011 10:10:09 +0000"  >&lt;p&gt;Multi databases are not supported by schema manager and schema tool yet.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1106] Wrong inversedBy in example</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1106</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;on page &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html&lt;/a&gt;&lt;br/&gt;
section :  8.1. Association Example Entities, first example. Please see the .jpg in attachement(it explains clearly what I think is an error)&lt;br/&gt;
Regards.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12547">DDC-1106</key>
            <summary>Wrong inversedBy in example</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="cristobal">cristobal castro</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Apr 2011 20:09:29 +0000</created>
                <updated>Thu, 7 Apr 2011 20:09:29 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10967" name="screen-shot.zip" size="200671" author="cristobal" created="Thu, 7 Apr 2011 20:09:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1038] there are tabs in the code base</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1038</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;a quick search through the ORM code base finds quite a few tabs. other doctrine projects there might also be some, though in common i only found some inside the LGPL license file.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12397">DDC-1038</key>
            <summary>there are tabs in the code base</summary>
                <type id="3" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 16 Feb 2011 11:34:41 +0000</created>
                <updated>Wed, 16 Feb 2011 11:34:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1032] ensure the dateformat Y-m-d gets used by the MsSQL-Server 2005</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1032</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;To ensure that the MsSQL-Server 2005 (and maybe higher) uses the format that is specified in the MsSqlPlatform class (Y-m-d)&lt;br/&gt;
set it via &apos;SET DATEFORMAT ymd&apos; .&lt;/p&gt;

&lt;p&gt;This should be done directly after the connection has be opened.&lt;/p&gt;</description>
                <environment>php5.3.5; MsSQL-Server 2005; W2K8; Apache2; MS pdo_sqlsrv_ts_vc6 driver</environment>
            <key id="12386">DDC-1032</key>
            <summary>ensure the dateformat Y-m-d gets used by the MsSQL-Server 2005</summary>
                <type id="5" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12379">DDC-1028</parent>
                        <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="le_shatai">Martin Weise</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Feb 2011 11:09:21 +0000</created>
                <updated>Mon, 14 Feb 2011 11:10:57 +0000</updated>
                                    <version>2.0.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15306" author="le_shatai" created="Mon, 14 Feb 2011 11:10:57 +0000"  >&lt;p&gt;Issue created as wished from Juozas Kaziukenas.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1025] Please repalce &apos;Doctrine\XXX\YYY&apos; with &apos;\Doctrine\XXX\YYY&apos; in code and document</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1025</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It will help us use the namespace and code autocomplete in some IDE.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12370">DDC-1025</key>
            <summary>Please repalce &apos;Doctrine\XXX\YYY&apos; with &apos;\Doctrine\XXX\YYY&apos; in code and document</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="wsyb">ben yan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Feb 2011 21:33:28 +0000</created>
                <updated>Tue, 13 Dec 2011 20:41:16 +0000</updated>
                                    <version>2.0.1</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>7</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="15717" author="matthieu" created="Fri, 8 Apr 2011 17:51:14 +0000"  >&lt;p&gt;Hi, do you have any more information about this ?&lt;/p&gt;

&lt;p&gt;I&apos;m confused because the php documentation uses the Doctrine\XXX way, and everywhere I&apos;ve seen, it is used like that.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="15718" author="k-fish" created="Mon, 11 Apr 2011 04:41:27 +0000"  >&lt;p&gt;The issue is simple and logical. &lt;img class=&quot;emoticon&quot; src=&quot;http://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;When an IDE (I am using PhpStorm and it does it like this) sees a namespace in a file, upon seeing namespaces afterwards, it sees them as absolute if they have a leading backslash, or relative when it does not. This affects the resolution of classes for type navigation, code inspection, ...  The same rules as for actual PHP code should be used within comments.&lt;/p&gt;

&lt;p&gt;Here is an 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;namespace Foo;

class Bar {

  /**
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Baz
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $baz;

  /**
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \Quux
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $quux;

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

&lt;p&gt;The IDE will think $baz is \Foo\Baz and $quux will be seen as being \Quux. Now if you have some reference to Doctrine here, and it was relative, the IDE would assume it&apos;s \Foo\Doctrine\...&lt;/p&gt;</comment>
                    <comment id="15719" author="beberlei" created="Mon, 11 Apr 2011 04:57:42 +0000"  >&lt;p&gt;Well yes, but since all our code examples have no leading namespace argument this means the code is in the default namespace, making Doctrine\XXX\YY a relative namespace that is actually valid.&lt;/p&gt;</comment>
                    <comment id="15720" author="k-fish" created="Mon, 11 Apr 2011 05:46:52 +0000"  >&lt;p&gt;Yes, but the source code docblocks are what is meant here as far as I am concerned.&lt;/p&gt;</comment>
                    <comment id="15838" author="morfi" created="Fri, 13 May 2011 11:08:57 +0000"  >&lt;p&gt;Example (Entitymanager.php):&lt;/p&gt;


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

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
  * The used Configuration.
  *
  * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Doctrine\ORM\Configuration
  */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $config;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result:&lt;br/&gt;
&lt;b&gt;Doctrine\ORM\Doctrine\ORM\Configuration&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Should 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;/**
  * The used Configuration.
  *
  * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Configuration
  */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $config;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
  * The used Configuration.
  *
  * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \Doctrine\ORM\Configuration
  */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $config;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15887" author="mvrhov" created="Fri, 27 May 2011 09:36:15 +0000"  >&lt;p&gt;Why don&apos;t you take this to the PhpStorm tracker as it surely is a bug in IDE?&lt;/p&gt;</comment>
                    <comment id="15888" author="k-fish" created="Fri, 27 May 2011 12:43:39 +0000"  >&lt;p&gt;Miha, what makes you think it&apos;s an IDE bug? In a class in namespace Foo another class named Bar is \Foo\Bar, but \Bar is \Bar. Why is it a bug if the IDE follows the namespace resolution rules?&lt;/p&gt;
</comment>
                    <comment id="16146" author="mridgway" created="Mon, 11 Jul 2011 17:34:05 +0000"  >&lt;p&gt;The issue is that PHPStorm and NetBeans have different class resolution rules. I also use PHPStorm and most of Doctrine does not resolve auto-completion correctly because of this issue.&lt;/p&gt;

&lt;p&gt;I&apos;d be willing to work on this if it would be accepted.&lt;/p&gt;</comment>
                    <comment id="16535" author="andrewmackrodt" created="Thu, 29 Sep 2011 11:58:52 +0000"  >&lt;p&gt;I&apos;ve been evaluating PhpStorm and also came across this issue; I believe the problem is due to Doctrine rather than being a bug with the IDE although it would be nice if PhpStorm would assume namespaces are absolute if they&apos;re not resolved upon an initial lookup.&lt;/p&gt;

&lt;p&gt;I created a quick c# app to append the beginning forward slash to any @var or @return attributes within Doctrine&apos;s source. It&apos;s working for me with Doctrine 2.1.2 and PhpStorm (IntelliJ): &lt;a href=&quot;http://pastebin.com/4HxiWvJA&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/4HxiWvJA&lt;/a&gt; - hopefully this will be of use for anyone else using these IDEs;. Note: the application doesn&apos;t detect multiple line annotations although the only one I&apos;m aware of is the getAST method in Doctrine\ORM\Query.php.&lt;/p&gt;</comment>
                    <comment id="16978" author="beberlei" created="Tue, 13 Dec 2011 20:41:09 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-215&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/215&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/215&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16979" author="beberlei" created="Tue, 13 Dec 2011 20:41:16 +0000"  >&lt;p&gt;This issue is referenced in Github Pull-Request GH-216&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/216&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/216&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1016] Example code does not reflect real code</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1016</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#entity-state&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#entity-state&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the switch cases all the UnitOfWork constants are invalid.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
UnitOfWork::NEW instead of being UnitOfWork::STATE_NEW&lt;/p&gt;</description>
                <environment>Website</environment>
            <key id="12355">DDC-1016</key>
            <summary>Example code does not reflect real code</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="thoth">thoth</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Feb 2011 17:10:50 +0000</created>
                <updated>Thu, 3 Feb 2011 17:10:50 +0000</updated>
                                    <version>2.0.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1011] Finding out if a model is persist</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1011</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;To find out if a model is persist, is missing in the documentation of doctrine 2.&lt;/p&gt;

&lt;p&gt;To become the state of an model you must call the entitymanager-&amp;gt;getUnitOfWork()-&amp;gt;getEntityState(model) &lt;/p&gt;</description>
                <environment></environment>
            <key id="12345">DDC-1011</key>
            <summary>Finding out if a model is persist</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="ronny.deter@erento.com">Ronny Deter</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 03:57:24 +0000</created>
                <updated>Wed, 2 Feb 2011 03:57:24 +0000</updated>
                                    <version>2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-998] Code example for custom AST functions incorrect</title>
                <link>http://doctrine-project.org/jira/browse/DDC-998</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language&lt;/a&gt; the code example is slightly incorrect.&lt;/p&gt;

&lt;p&gt;Mistakes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Lexer::T_ABS doesn&apos;t exist anymore, I assume Lexer::T_IDENTIFIER is what one wants to use&lt;/li&gt;
	&lt;li&gt;Missing use for \Doctrine\ORM\Query\Lexer&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Additionally, the section should tell the user that he best has a look at lib/Doctrine/ORM/Query/AST/Functions/* to learn how to write custom functions. It also could be noted that stored procedures can be called with custom functions.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12318">DDC-998</key>
            <summary>Code example for custom AST functions incorrect</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Jan 2011 19:46:54 +0000</created>
                <updated>Sun, 23 Jan 2011 19:46:54 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-999] DQL always needs a FROM clause, should be changed</title>
                <link>http://doctrine-project.org/jira/browse/DDC-999</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sometimes a developer needs to issue a query without a FROM clause. This especially occurs using the QueryBuilder, when you may or may not have a table to select from, but call a stored procedure always.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = $em&amp;gt;createQuery(&apos;SELECT (1+1)&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above query fails because the lexer expects T_FROM. If you replace (1+1) with a stored procedure, this example makes more sense.&lt;/p&gt;

&lt;p&gt;One might argue about that you should use DBAL directly, but I disagree, because it always can happen that you end up in a situation 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;$qb = $em-&amp;gt;createQueryBuilder();

$qb-&amp;gt;select(&lt;span class=&quot;code-quote&quot;&gt;&quot;SOMEFANCYPROCEDURE()&quot;&lt;/span&gt;);

&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($condition) {
  $qb = $qb-&amp;gt;from(&lt;span class=&quot;code-quote&quot;&gt;&quot;additionalTable t&quot;&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12319">DDC-999</key>
            <summary>DQL always needs a FROM clause, should be changed</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Jan 2011 20:25:54 +0000</created>
                <updated>Sun, 23 Jan 2011 20:26:34 +0000</updated>
                                    <version>2.0</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-993] Cookbook: Overriding the ID Generator during a database migration</title>
                <link>http://doctrine-project.org/jira/browse/DDC-993</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you need to override the ID Generator, e.g. during a migration, you can do that in your migration script as follows:&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Overriding the ID generator&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;$em-&amp;gt;getClassMetadata(&apos;foo\bar\Entity&apos;)-&amp;gt;setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());&lt;br/&gt;
$em-&amp;gt;getClassMetadata(&apos;foo\bar\Entity&apos;)-&amp;gt;setIdGeneratorType(constant(&apos;Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE&apos;));&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Make sure that both calls equal to the same generator type. You can now modify the @Id fields in your entities. Additionally, make sure that you set the IdGenerator &lt;b&gt;after&lt;/b&gt; you created the database using e.g. SchemaTool-&amp;gt;create().&lt;/p&gt;</description>
                <environment></environment>
            <key id="12311">DDC-993</key>
            <summary>Cookbook: Overriding the ID Generator during a database migration</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Jan 2011 13:33:27 +0000</created>
                <updated>Sun, 28 Oct 2012 15:33:51 +0000</updated>
                                    <version>2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18892" author="kosen" created="Sat, 27 Oct 2012 21:36:37 +0000"  >&lt;p&gt;Hi, this doesn&apos;t seem to work for me. I have written a small database export / import utility. As long as I use the automatic ID generation, everything works flawlessly, but I&apos;m trying to preserve the existing IDs. I do exactly what you&apos;ve suggested in your post. It works for @OneToOne relations, but I get the following error messages when persisting entities that are parts of @ManyToOne relations:&lt;br/&gt;
Notice: Undefined index: &lt;span class=&quot;error&quot;&gt;&amp;#91;....&amp;#93;&lt;/span&gt; in &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;Doctrine/ORM/UnitOfWork.php on line 2655&lt;br/&gt;
I&apos;m using version 2.2.2&lt;br/&gt;
Am I doing something wrong?&lt;/p&gt;</comment>
                    <comment id="18894" author="kosen" created="Sun, 28 Oct 2012 15:33:51 +0000"  >&lt;p&gt;Never mind. I&apos;ve upgraded to Doctrine 2.3.0 and it works as expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-972] MySql MyISAM support</title>
                <link>http://doctrine-project.org/jira/browse/DDC-972</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We can not set MySql Engine for MyISAM. MySqlPlatform has a _getCreateTableSQL where you can pass some options with the engine param.&lt;br/&gt;
Not able to set it up from yml, xml or annotation schema.&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12284">DDC-972</key>
            <summary>MySql MyISAM support</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="nisnardi">nicolas isnardi</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Jan 2011 18:25:07 +0000</created>
                <updated>Fri, 13 Jul 2012 09:53:50 +0000</updated>
                                    <version>2.0</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="15866" author="cedrictailly" created="Thu, 19 May 2011 10:55:00 +0000"  >&lt;p&gt;I have the same problem and I didn&apos;t found documentation to select the engine for a given table.&lt;/p&gt;

&lt;p&gt;I tried to understand the code by myself and made modifications of my Doctrine v2.0.5, perhaps this is not the best one but here is a beginning of a solution :&lt;/p&gt;

&lt;p&gt;-------------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;@ ORM\Mapping\Driver\DoctrineAnnotations.php:100&lt;/p&gt;

&lt;p&gt;  final class Table extends Annotation &lt;/p&gt;
{
      public $name;
      public $schema;
      public $indexes;
      public $uniqueConstraints;
      public $engine;
  }

&lt;p&gt;@ ORM\Mapping\Driver\AnnotationDriver.php:144&lt;/p&gt;

&lt;p&gt;  $primaryTable = array(&lt;br/&gt;
      &apos;name&apos; =&amp;gt; $tableAnnot-&amp;gt;name,&lt;br/&gt;
      &apos;schema&apos; =&amp;gt; $tableAnnot-&amp;gt;schema,&lt;br/&gt;
      &apos;engine&apos; =&amp;gt; $tableAnnot-&amp;gt;engine&lt;br/&gt;
  );&lt;/p&gt;

&lt;p&gt;@ ORM\Tools\SchemaTool.php:133&lt;/p&gt;

&lt;p&gt;  $table = $schema-&amp;gt;createTable($class-&amp;gt;getQuotedTableName($this-&amp;gt;_platform));&lt;/p&gt;

&lt;p&gt;  if ( isset($class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;) )&lt;br/&gt;
    $table-&amp;gt;addOption(&quot;engine&quot;,$class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;-------------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;...and to define for instance the MyISAM engine in annotations :&lt;/p&gt;

&lt;p&gt;  /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Entity&lt;/li&gt;
	&lt;li&gt;@Table(engine=&quot;MyISAM&quot;)&lt;br/&gt;
   */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Because there is no foreign key on MyISAM tables, there are still problems on the schema creation/update when Doctrine executes the corresponding &quot;alter table&quot; SQL commands.&lt;/p&gt;</comment>
                    <comment id="18298" author="gabrielnn77" created="Thu, 12 Jul 2012 13:34:20 +0000"  >&lt;p&gt;in Doctrine 2.2.2 will be&lt;/p&gt;

&lt;p&gt;Doctrine/ORM/Tools/SchemaTool.php-149-                  ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Tools/SchemaTool.php-150-                  if ( isset($class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;) )&lt;br/&gt;
Doctrine/ORM/Tools/SchemaTool.php-151-                          $table-&amp;gt;addOption(&quot;engine&quot;,$class-&amp;gt;table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;engine&amp;quot;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
Doctrine/ORM/Tools/SchemaTool.php-152-                  ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;Doctrine/ORM/Mapping/ClassMetadataInfo.php-1719-                ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Mapping/ClassMetadataInfo.php-1720-                if (isset($table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;engine&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
Doctrine/ORM/Mapping/ClassMetadataInfo.php-1721-                        $this-&amp;gt;table[&apos;engine&apos;] = $table[&apos;engine&apos;];
Doctrine/ORM/Mapping/ClassMetadataInfo.php-1722-                }
&lt;p&gt;Doctrine/ORM/Mapping/ClassMetadataInfo.php-1723-                ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;Doctrine/ORM/Mapping/Table.php-42-      ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Mapping/Table.php-43-      /** @var string */&lt;br/&gt;
Doctrine/ORM/Mapping/Table.php-44-    public $engine;&lt;br/&gt;
Doctrine/ORM/Mapping/Table.php-45-      ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;Doctrine/ORM/Mapping/Driver/AnnotationDriver.php-181-                   ///     PATCH   ------------------------------------&lt;br/&gt;
Doctrine/ORM/Mapping/Driver/AnnotationDriver.php-182-                   $primaryTable&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;engine&amp;#39;&amp;#93;&lt;/span&gt; = $tableAnnot-&amp;gt;engine;&lt;br/&gt;
Doctrine/ORM/Mapping/Driver/AnnotationDriver.php-183-                   ///     PATCH   ------------------------------------&lt;/p&gt;


&lt;p&gt;i found a problem in ManyToMany relations, the intermediate table will be InnoDB&lt;/p&gt;</comment>
                    <comment id="18299" author="beberlei" created="Fri, 13 Jul 2012 08:23:21 +0000"  >&lt;p&gt;You can do all tables as MyISAM already through metadata using @Table(options=&lt;/p&gt;
{&quot;engine&quot;: &quot;MyISAM&quot;}
&lt;p&gt;) except Many-To-Many Join Tables. But you could create a listener to the &quot;postSchemaGenerate&quot; event and accept the schema instance there, modify everything accordingly.&lt;/p&gt;</comment>
                    <comment id="18300" author="stof" created="Fri, 13 Jul 2012 08:50:47 +0000"  >&lt;p&gt;should we add the support of the options for the @JoinTable annotation ?&lt;/p&gt;</comment>
                    <comment id="18303" author="beberlei" created="Fri, 13 Jul 2012 09:53:50 +0000"  >&lt;p&gt;Yes, that is probably what this ticket boils down to &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-948] incorrect link from the types page to known vendor issues</title>
                <link>http://doctrine-project.org/jira/browse/DDC-948</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/types.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/types.html&lt;/a&gt; links to &lt;a href=&quot;http://www.doctrine-project.org/docs/dbal/2.0/en/known-vendor-issues&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/dbal/2.0/en/known-vendor-issues&lt;/a&gt; instead of &lt;a href=&quot;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/known-vendor-issues.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/dbal/2.0/en/reference/known-vendor-issues.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also noticed that the documentation still says &quot;Doctrine DBAL v2.0.0-BETA4 documentation&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12253">DDC-948</key>
            <summary>incorrect link from the types page to known vendor issues</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Sat, 25 Dec 2010 07:23:30 +0000</created>
                <updated>Sat, 25 Dec 2010 07:35:23 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15016" author="lsmith" created="Sat, 25 Dec 2010 07:35:23 +0000"  >&lt;p&gt;err sorry .. this is of course a DBAL doc issue not and ORM issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-946] Evaluate optional use of igbinary for serialization</title>
                <link>http://doctrine-project.org/jira/browse/DDC-946</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Igbinary is supposed to be faster and better than serialize/unserialize(). We should check if its relevant for us (metadata and query caching for example):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/phadej/igbinary&quot; class=&quot;external-link&quot;&gt;https://github.com/phadej/igbinary&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12246">DDC-946</key>
            <summary>Evaluate optional use of igbinary for serialization</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Dec 2010 12:13:01 +0000</created>
                <updated>Wed, 22 Dec 2010 12:17:56 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14997" author="beberlei" created="Wed, 22 Dec 2010 12:17:56 +0000"  >&lt;p&gt;&lt;a href=&quot;http://ilia.ws/archives/211-Igbinary,-The-great-serializer.html#extended&quot; class=&quot;external-link&quot;&gt;http://ilia.ws/archives/211-Igbinary,-The-great-serializer.html#extended&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-930] A table cannot have more than one many to many relationship with the same table when using reverse engineer</title>
                <link>http://doctrine-project.org/jira/browse/DDC-930</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is caused by taking the join column name as the identifier while generating a property name for annotation. The mapping driver detects that the same property is already defined and ends the convert process. A little bit smarter approach for me was to take the local table name. But this assumes a specific style of join table naming convention.&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass()&lt;/p&gt;

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

&lt;p&gt;$associationMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt; = Inflector::camelize(str_replace(&apos;_id&apos;, &apos;&apos;, strtolower(current($otherFk-&amp;gt;getColumns()))));&lt;/p&gt;

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

&lt;p&gt;$name = explode(&quot;_&quot;,$myFk-&amp;gt;getLocalTableName());&lt;br/&gt;
if (count($name) &amp;gt; 1)&lt;br/&gt;
{&lt;br/&gt;
	array_shift($name);&lt;br/&gt;
}&lt;br/&gt;
$name = implode(&quot;_&quot;, $name);&lt;/p&gt;

&lt;p&gt;                    $associationMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt; = Inflector::camelize(str_replace(&apos;_id&apos;, &apos;&apos;, strtolower($name)));&lt;/p&gt;


&lt;p&gt;Maybe to switch to this behavior with an additional option?&lt;/p&gt;</description>
                <environment>FreeBSD, PostgreSQL 8.4</environment>
            <key id="12225">DDC-930</key>
            <summary>A table cannot have more than one many to many relationship with the same table when using reverse engineer</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="teuzz">Jiri Helmich</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Dec 2010 02:52:49 +0000</created>
                <updated>Mon, 13 Dec 2010 02:52:49 +0000</updated>
                                    <version>2.0-RC2</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-923] Add note about DateTime Query Parameter Type Hint</title>
                <link>http://doctrine-project.org/jira/browse/DDC-923</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="12215">DDC-923</key>
            <summary>Add note about DateTime Query Parameter Type Hint</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 10 Dec 2010 03:11:43 +0000</created>
                <updated>Fri, 10 Dec 2010 03:11:43 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-919] subselect</title>
                <link>http://doctrine-project.org/jira/browse/DDC-919</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i&apos;d like to see more example in documentation with this subselects&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;23:08&amp;#93;&lt;/span&gt; &amp;lt;beberlei&amp;gt; can you open a tciket on jira? then i dont forget to do that when i have time&lt;/p&gt;</description>
                <environment></environment>
            <key id="12208">DDC-919</key>
            <summary>subselect</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="mungiu">Mungiu Dragos</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2010 16:16:56 +0000</created>
                <updated>Sun, 20 Mar 2011 13:45:51 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15543" author="lopezdonaque" created="Sun, 20 Mar 2011 13:45:51 +0000"  >&lt;p&gt;Subselect as columns or FROM clause should have mor examples.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1484] GH-162: ProxyFactory creates proxy&apos;s parent structure if it doesn&apos;t exist</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1484</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/162&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/162&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wheeee, nested proxies can be generated without hassle!&lt;/p&gt;</description>
                <environment></environment>
            <key id="13163">DDC-1484</key>
            <summary>GH-162: ProxyFactory creates proxy&apos;s parent structure if it doesn&apos;t exist</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 8 Nov 2011 23:50:39 +0000</created>
                <updated>Tue, 26 Jun 2012 20:40:34 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16802" author="beberlei" created="Sun, 13 Nov 2011 15:47:40 +0000"  >&lt;p&gt;Marked as improvement&lt;/p&gt;</comment>
                    <comment id="18090" author="beberlei" created="Sat, 16 Jun 2012 07:55:43 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-162&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/162&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/162&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18143" author="beberlei" created="Tue, 26 Jun 2012 20:40:33 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-162&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/162&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/162&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1475] Documentation for One-To-Many, Bidirectional Association does not have YAML example</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1475</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When you are looking for a config example for the bidirectional mapping of an one-to-many association you will just find an example with XML, but not with YAML or PHP. It would be nice if somebody could add an example or a link to the bidirectional one-to-one association, because it should be the same, right?&lt;/p&gt;

&lt;p&gt;Here the link to the example: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#one-to-many-bidirectional&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#one-to-many-bidirectional&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13154">DDC-1475</key>
            <summary>Documentation for One-To-Many, Bidirectional Association does not have YAML example</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="naitsirch">Christian Stoller</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Nov 2011 11:33:59 +0000</created>
                <updated>Mon, 7 Nov 2011 11:35:13 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1465] Fetching partial objects doesn&apos;t work if HINT_FORCE_PARTIAL_LOAD is not explicitly used</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1465</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using the DQL &quot;partial&quot; keyword is not enough to get a partial entity as a result.&lt;br/&gt;
The DQL hint HINT_FORCE_PARTIAL_LOAD must be used as well.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q = $em-&amp;gt;createQuery(&apos;SELECT partial r.{id,comment} FROM Entities\Rating r WHERE r.id=3&apos;);
$r = $q-&amp;gt;getResult() /* HYDRATE_OBJECT is the &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; hydration mode */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here, $r contains the full Entity, a SELECT * has been sent&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q = $em-&amp;gt;createQuery(&apos;SELECT partial r.{id,comment} FROM Entities\Rating r WHERE r.id=3&apos;);
$q-&amp;gt;setHint(Doctrine\ORM\Query::HINT_FORCE_PARTIAL_LOAD, 1);

$r = $q-&amp;gt;getResult() /* HYDRATE_OBJECT is the &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; hydration mode */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here, $r contains only the selected fields, hence a true partial Entity&lt;/p&gt;</description>
                <environment></environment>
            <key id="13141">DDC-1465</key>
            <summary>Fetching partial objects doesn&apos;t work if HINT_FORCE_PARTIAL_LOAD is not explicitly used</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="jpauli">Julien Pauli</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Nov 2011 11:08:02 +0000</created>
                <updated>Fri, 11 Nov 2011 09:28:12 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                            <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11442">DDC-624</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1459] Move DDC-331, DDC-448, DDC-493, DDC-513, DDC-698 Tests into SQLGeneration Testsuite</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1459</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="13131">DDC-1459</key>
            <summary>Move DDC-331, DDC-448, DDC-493, DDC-513, DDC-698 Tests into SQLGeneration Testsuite</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 29 Oct 2011 17:06:43 +0000</created>
                <updated>Wed, 1 Aug 2012 21:04:34 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1443] Subscribers reachs maximum nesting level when creating association on pre/postPersist with cascade persist</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1443</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Suppose a situation where:&lt;/p&gt;

&lt;p&gt;A -&amp;gt; B&lt;/p&gt;

&lt;p&gt;Where the OneToOne unidirectional association contains cascade persist.&lt;/p&gt;

&lt;p&gt;If I decide to save an entity B that should create an A instance, it goes into maximum nesting level no matter if I track prePersist or postPersist.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13108">DDC-1443</key>
            <summary>Subscribers reachs maximum nesting level when creating association on pre/postPersist with cascade persist</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Thu, 20 Oct 2011 16:57:36 +0000</created>
                <updated>Sat, 29 Oct 2011 07:27:24 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16676" author="guilhermeblanco" created="Thu, 20 Oct 2011 18:54:45 +0000"  >&lt;p&gt;Failing test case&lt;/p&gt;</comment>
                    <comment id="16677" author="guilhermeblanco" created="Thu, 20 Oct 2011 20:10:08 +0000"  >&lt;p&gt;Uploading a new version, now passing successfully, but consuming the onFlush event (which should not be ideal).&lt;/p&gt;</comment>
                    <comment id="16720" author="beberlei" created="Sat, 29 Oct 2011 07:27:24 +0000"  >&lt;p&gt;Ah yes, this never worked. The transaction stuff will fix that. You have to use scheduleForInsert() something inside prePersist.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11080" name="DDC1443Test.php" size="3664" author="guilhermeblanco" created="Thu, 20 Oct 2011 20:10:08 +0000" />
                    <attachment id="11079" name="DDC1443Test.php" size="3383" author="guilhermeblanco" created="Thu, 20 Oct 2011 18:54:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1441] Metadata cannot be loaded for not registered proxy objects</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1441</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We are using several Doctrine managers in our project with the same entity classes and different database tables.&lt;/p&gt;

&lt;p&gt;The problem appears when we are willing to merge entity with lazy associations from one manager to another. The second entity manager instance hasn&apos;t got the proxy object metadata defined yet so it fails with Doctrine\ORM\Mapping\MappingException exception &quot;Class EntityProxy is not a valid entity or mapped super class.&quot;.&lt;/p&gt;

&lt;p&gt;If both entity managers share the proxy objects the problem can be fixed by calling &lt;/p&gt;

&lt;div class=&quot;code panel&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;getProxyFactory()-&amp;gt;getProxy(&apos;Entity&apos;, -1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which will register the entity metadata for the proxy classname as well.&lt;/p&gt;

&lt;p&gt;Still if the proxy configuration differs, there is no fix found without changing the Doctrine ORM code.&lt;/p&gt;

&lt;p&gt;The fix inside the Doctrine would be to detect Proxy classes before loading the metadata and load the metadata for it&apos;s parent class instead. Please see the diff attached with proposed solution.&lt;/p&gt;

&lt;p&gt;Also I think this issue could arise when unserialized entity objects will be merged into the entity manager. I will try creating test case for this.&lt;/p&gt;</description>
                <environment>MySQL, Ubuntu, PHP 5.3.6</environment>
            <key id="13106">DDC-1441</key>
            <summary>Metadata cannot be loaded for not registered proxy objects</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Oct 2011 13:02:43 +0000</created>
                <updated>Thu, 5 Apr 2012 08:39:55 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16913" author="gedrox" created="Thu, 24 Nov 2011 14:45:46 +0000"  >&lt;p&gt;Test case attached.&lt;/p&gt;</comment>
                    <comment id="17768" author="gedrox" created="Thu, 5 Apr 2012 08:39:55 +0000"  >&lt;p&gt;See my pull request in &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/332&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/332&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11116" name="DDC1441Test.php" size="2539" author="gedrox" created="Thu, 24 Nov 2011 14:45:46 +0000" />
                    <attachment id="11077" name="not-loaded-proxy-patch.diff" size="1096" author="gedrox" created="Thu, 20 Oct 2011 13:02:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1438] Add test for DDC-1437</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1438</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Add test for &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1437&quot; title=&quot;Strange behavior  with proxied classes,expected to get entity, but returned identifier.&quot;&gt;&lt;del&gt;DDC-1437&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13103">DDC-1438</key>
            <summary>Add test for DDC-1437</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 19 Oct 2011 10:09:29 +0000</created>
                <updated>Wed, 19 Oct 2011 10:09:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1429] Add a method to the unit of work that merges any detached entity into UoW without calling SQL</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1429</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is for those that know what they are doing &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13094">DDC-1429</key>
            <summary>Add a method to the unit of work that merges any detached entity into UoW without calling SQL</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 17 Oct 2011 22:05:01 +0000</created>
                <updated>Mon, 17 Oct 2011 22:05:01 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1390]  Lazy loading does not work for the relationships of an entity instance, whose class inherits from another entity class</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1390</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Lazy loading does not work for the relationships of an instance of an entity, whose class inherits from another entity class.&lt;/p&gt;

&lt;p&gt;Assume there are two entity classes, A and B, where A inherits from B.&lt;/p&gt;

&lt;p&gt;Now let $a be an instance of A, e. g. the result of &quot;SELECT a FROM \A WHERE a.id = 1&quot;.&lt;/p&gt;

&lt;p&gt;Outputting $a will confirm it is a valid instance of a proxy object inheriting from A.&lt;/p&gt;

&lt;p&gt;Assume that the database row corresponding to $a contains a non-null foreign key that actually links to an existing row in another table, corresponding to another entity instance of a different class.&lt;/p&gt;

&lt;p&gt;Now, $a-&amp;gt;someRelationship will always returns null in this scenario. I assume this is unintended behaviour, because clearly, the other entity should be lazily loaded on accessing it, and there is a value in the database.&lt;/p&gt;

&lt;p&gt;The fetch annotation attribute on that relationship has not been explicitly set, so I assume it is set to the default value, which, according to the docs, should be &quot;lazy&quot;.&lt;/p&gt;

&lt;p&gt;The loading only fails when accessing the relationships of an entity instance, whose class inherits from another entity class. For entity instances, whose classes do not inherit from another entity class, lazy loading of their relationships works as expected.&lt;/p&gt;

&lt;p&gt;I had a look at the proxy objects and verified that they are present and override the __get method with an implementation containing a call to the load() method. Still, the loading won&apos;t work for some reason.&lt;/p&gt;

&lt;p&gt;This could be related to Bug &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1389&quot; title=&quot;Querying subclass entities using DQL results in broken SQL being generated&quot;&gt;&lt;del&gt;DDC-1389&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1389&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1389&lt;/a&gt;) which also happens exclusively in an inheritance scenario. Maybe the current implementation of inheritance is generally wrong or incomplete.&lt;/p&gt;</description>
                <environment>Debian Linux 6.0, MySQL 5.0.51a</environment>
            <key id="13036">DDC-1390</key>
            <summary> Lazy loading does not work for the relationships of an entity instance, whose class inherits from another entity class</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://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="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Sep 2011 17:22:51 +0000</created>
                <updated>Sun, 6 Jan 2013 08:59:31 +0000</updated>
                                    <version>2.1.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16760" author="beberlei" created="Mon, 31 Oct 2011 22:31:10 +0000"  >&lt;p&gt;Did this get fixed with the correction of your data?&lt;/p&gt;</comment>
                    <comment id="16762" author="dalvarez" created="Tue, 1 Nov 2011 06:22:55 +0000"  >&lt;p&gt;No it did not. This issue is completely unrelated to the other one.&lt;/p&gt;

&lt;p&gt;For this, I have manually implemented workarounds, fetching the associations using DQL queries. Lazy loading in the inheritance scenario above still would not work.&lt;/p&gt;</comment>
                    <comment id="16763" author="beberlei" created="Tue, 1 Nov 2011 11:22:56 +0000"  >&lt;p&gt;So A is an entity in a hierachy A -&amp;gt; B, and &quot;someRelationship&quot; is a field on A or on B &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; towards an Entity C that is in an inheritance hierachy or not? &lt;/p&gt;

&lt;p&gt;Could you post parts of the mappings (entity docblock and the relationship)?&lt;/p&gt;</comment>
                    <comment id="16772" author="dalvarez" created="Sun, 6 Nov 2011 17:05:25 +0000"  >&lt;p&gt;Hey, thanks for taking care of this.&lt;/p&gt;

&lt;p&gt;I attached the entities involved in the szenario to this issue.&lt;/p&gt;

&lt;p&gt;I had problems lazy loading entities through the following associations:&lt;/p&gt;

&lt;p&gt;  Run.invoiceCreatorResult&lt;br/&gt;
  Run.commissionNoteCreatorResult&lt;br/&gt;
  Run.consumerInvoiceExporterResult&lt;/p&gt;

&lt;p&gt;as well as&lt;/p&gt;

&lt;p&gt;  InvoiceCreatorResult.dataVersion&lt;br/&gt;
  CommissionNoteCreatorResult.dataVersion&lt;br/&gt;
  ConsumerInvoiceExporterResult.dataVersion&lt;/p&gt;


&lt;p&gt;In this scenario, InvoiceCreatorResult, CommissionNoteCreatorResult and ConsumerInvoiceExporterResult all inherit from Result, which in turn inherits from a mapped superclass DataObject. Run and DataVersion inherit from DataObject directly.&lt;/p&gt;

&lt;p&gt;The associations where lazy loading does not work are associations both to and from the entity classes InvoiceCreatorResult, CommissionNoteCreatorResult and ConsumerInvoiceExporterResult.&lt;/p&gt;</comment>
                    <comment id="16859" author="beberlei" created="Fri, 18 Nov 2011 13:52:28 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Now let $a be an instance of A, e. g. the result of &quot;SELECT a FROM \A WHERE a.id = 1&quot;.&lt;/p&gt;

&lt;p&gt;Outputting $a will confirm it is a valid instance of a proxy object inheriting from A.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Just a short Q on understanding: Why is $a a proxy of A if you select it explicitly?&lt;/p&gt;</comment>
                    <comment id="16861" author="beberlei" created="Fri, 18 Nov 2011 14:21:35 +0000"  >&lt;p&gt;This a working test-case with a model that i believe resembles yours exactly.&lt;/p&gt;

&lt;p&gt;I also put your models into another test and ran schema validation on them, which works out without problems.&lt;/p&gt;

&lt;p&gt;From the workflow with proxies, maybe &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1452&quot; title=&quot;ObjectHydrator bug: hydration of entity with self (cyclic) relation through ref entity&quot;&gt;&lt;del&gt;DDC-1452&lt;/del&gt;&lt;/a&gt; might be related to your issue?&lt;/p&gt;</comment>
                    <comment id="16871" author="dalvarez" created="Fri, 18 Nov 2011 17:47:53 +0000"  >&lt;p&gt;Regarding the proxy question, I just ment the query to be an example to further illustrate the type of $a. It was redundant and unnecessary though and probably misleading. Sorry for that. I did not select anything in the actual scenario. $a is merely some object of type A. No queries are involved.&lt;/p&gt;</comment>
                    <comment id="16873" author="dalvarez" created="Fri, 18 Nov 2011 18:16:24 +0000"  >&lt;p&gt;Have you been able to make the tests fail with the original data provided?&lt;/p&gt;

&lt;p&gt;If not, I could set up a test case and post it.&lt;/p&gt;</comment>
                    <comment id="16874" author="beberlei" created="Fri, 18 Nov 2011 18:38:02 +0000"  >&lt;p&gt;No i only checked the validity of mappings with the original data. If you could setup a testcase that would be really great.&lt;/p&gt;</comment>
                    <comment id="16890" author="dalvarez" created="Sat, 19 Nov 2011 16:05:52 +0000"  >&lt;p&gt;I will set up a test case and upload it. I&apos;ll see if I can do it one of the next evenings.&lt;/p&gt;</comment>
                    <comment id="17011" author="beberlei" created="Sat, 17 Dec 2011 13:26:19 +0000"  >&lt;p&gt;I tried again, also extended &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1390&quot; title=&quot; Lazy loading does not work for the relationships of an entity instance, whose class inherits from another entity class&quot;&gt;DDC-1390&lt;/a&gt;, but it was impossible for me to reproduce this. I ran this against master, 2.1.x and 2.1.1 specifically.&lt;/p&gt;</comment>
                    <comment id="19217" author="dalvarez" created="Sat, 5 Jan 2013 18:42:17 +0000"  >&lt;p&gt;Sorry, I got swamped with work. Now I am working on this dedicatedly, testing against the latest release. Will let you know once I have a testcase.&lt;/p&gt;</comment>
                    <comment id="19218" author="beberlei" created="Sun, 6 Jan 2013 08:59:31 +0000"  >&lt;p&gt;Good to hear, thanks for the persistent work on this.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11100" name="CommissionNoteCreatorResult.php" size="891" author="dalvarez" created="Sun, 6 Nov 2011 16:56:50 +0000" />
                    <attachment id="11101" name="ConsumerInvoiceExporterResult.php" size="353" author="dalvarez" created="Sun, 6 Nov 2011 16:56:50 +0000" />
                    <attachment id="11096" name="DataObject.php" size="1338" author="dalvarez" created="Sun, 6 Nov 2011 16:54:35 +0000" />
                    <attachment id="11102" name="DataVersion.php" size="1314" author="dalvarez" created="Sun, 6 Nov 2011 16:58:35 +0000" />
                    <attachment id="11112" name="DDC1390Test.php" size="2412" author="beberlei" created="Fri, 18 Nov 2011 14:21:35 +0000" />
                    <attachment id="11099" name="InvoiceCreatorResult.php" size="835" author="dalvarez" created="Sun, 6 Nov 2011 16:55:13 +0000" />
                    <attachment id="11098" name="Result.php" size="1669" author="dalvarez" created="Sun, 6 Nov 2011 16:54:35 +0000" />
                    <attachment id="11097" name="Run.php" size="1817" author="dalvarez" created="Sun, 6 Nov 2011 16:54:35 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1380] Standardize proxy class naming</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1380</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;see &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/125&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/125&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13024">DDC-1380</key>
            <summary>Standardize proxy class naming</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Sep 2011 11:14:10 +0000</created>
                <updated>Sun, 18 Sep 2011 11:14:10 +0000</updated>
                                    <version>2.x</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1371] Optimistic Locking using hash column or all columns</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1371</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We can implement optimistic locking using hash values or other all columns of an entity&lt;/p&gt;</description>
                <environment></environment>
            <key id="13008">DDC-1371</key>
            <summary>Optimistic Locking using hash column or all columns</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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 Sep 2011 08:32:39 +0000</created>
                <updated>Sat, 10 Sep 2011 08:32:39 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1357] Queries with multiple joins resulting in multiple scalar results for each top level entity only retain one scalar value for each entity</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1357</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Consider this 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;select g.id, u.id, u.status, count(p.phonenumber) numPhones from Group
     * g join g.user u join u.phonenumbers p group by g.id, u.status, u.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;With data:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;phonenumbers:
    [1, 2, 3, 4, 5, 6]
users:
    [{id: 1, status: developer, phonenumbers: [1, 2]},
     {id: 2, status: developer, phonenumbers: [3]},
     {id: 3, status: developer, phonenumbers: [4, 5, 6]}]
groups:
    [{id: 1, users: [1, 2]]},
     {id:2, users: [3]}]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result currently is:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;array(
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 1,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 1 },
                object(CmsUser) { &apos;id&apos; =&amp;gt; 2 }
            )
         },
        &apos;numPhones&apos; =&amp;gt; 1
    ),
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 2,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 3 }
            )
        },
        &apos;numPhones&apos; =&amp;gt; 3
    )
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that the first entry contains only one value numPhones =&amp;gt; 1, even though there are two users associated with that group. One of whom has 2 phone numbers and the other has 1.&lt;/p&gt;

&lt;p&gt;The result I would expect is:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;array(
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 1,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 1 },
                object(CmsUser) { &apos;id&apos; =&amp;gt; 2 }
            )
         },
        &apos;numPhones&apos; =&amp;gt; array(2, 1)
    ),
    array(
        0 =&amp;gt; object(CmsGroup) {
            &apos;id&apos; =&amp;gt; 2,
            &apos;users&apos; =&amp;gt; Collection(
                object(CmsUser) { &apos;id&apos; =&amp;gt; 3 }
            )
        },
        &apos;numPhones&apos; =&amp;gt; array(3)
    )
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The difference is that numPhones for each row now contains an array of the&lt;br/&gt;
scalar values matching the corresponding users.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12991">DDC-1357</key>
            <summary>Queries with multiple joins resulting in multiple scalar results for each top level entity only retain one scalar value for each entity</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="naderman">Nils Adermann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Sep 2011 22:46:17 +0000</created>
                <updated>Thu, 1 Sep 2011 22:50:05 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16410" author="naderman" created="Thu, 1 Sep 2011 22:49:22 +0000"  >&lt;p&gt;You can find a test case for the correct result here: &lt;a href=&quot;https://github.com/naderman/doctrine2/commit/a1ca3d9847cbc514fc951fb0b221b26fe03a6619&quot; class=&quot;external-link&quot;&gt;https://github.com/naderman/doctrine2/commit/a1ca3d9847cbc514fc951fb0b221b26fe03a6619&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1347] Github-PR-110 by shesek: Support NULL in EntityRepository&apos;s magic findBy and findOneBy methods</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1347</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 &lt;/p&gt;
{username}
&lt;p&gt;:&lt;/p&gt;

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

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

&lt;p&gt;The magic `findBy` and `findOneBy` methods don&apos;t support passing NULL as the value, because &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;we cannot (yet) transform it into IS NULL&amp;quot;&amp;#93;&lt;/span&gt;(&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L207&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L207&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;However, `BasicEntityPersister::_getSelectConditionSQL()` &lt;span class=&quot;error&quot;&gt;&amp;#91;does support that&amp;#93;&lt;/span&gt;(&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L1229&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L1229&lt;/a&gt;). It seems like leftovers from when there was no support for it. I tried it locally (after applying this change) and it does seem to work well.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12968">DDC-1347</key>
            <summary>Github-PR-110 by shesek: Support NULL in EntityRepository&apos;s magic findBy and findOneBy methods</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 25 Aug 2011 18:02:49 +0000</created>
                <updated>Thu, 25 Aug 2011 18:02:49 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1342] Github-PR-109: Remove trailing spaces</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1342</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;alOneh created a pull request on Github: &lt;/p&gt;

&lt;p&gt;Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/109&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/109&lt;/a&gt;&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12941">DDC-1342</key>
            <summary>Github-PR-109: Remove trailing spaces</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 21 Aug 2011 14:12:43 +0000</created>
                <updated>Sun, 21 Aug 2011 14:12:43 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2128] [GH-507] Now MetaDataFilter takess also regexp. For example whern you want to</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2128</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 catalinux:&lt;/p&gt;

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

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

&lt;p&gt;extract metadata if you would filter like this: --filter=&quot;Article&quot;&lt;br/&gt;
would extract also for &quot;ArticleItems&quot; (article_items table). Now you&lt;br/&gt;
can use --filter=&quot;Article$&quot; if you want only that table (articl)&lt;/p&gt;</description>
                <environment></environment>
            <key id="14199">DDC-2128</key>
            <summary>[GH-507] Now MetaDataFilter takess also regexp. For example whern you want to</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 6 Nov 2012 12:46:51 +0000</created>
                <updated>Sun, 6 Jan 2013 10:00:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2104] BasicEntityPersister::load() doesn&apos;t allow for cache usage</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2104</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;BasicEntityPersister::load() calls:&lt;br/&gt;
$stmt = $this-&amp;gt;_conn-&amp;gt;executeQuery($sql, $params, $types);&lt;br/&gt;
on line 665 of master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php&lt;/p&gt;

&lt;p&gt;The executeQuery function has an optional fourth parameter to pass a QueryCacheProfile variable to use caching on the query.  This is ignored/not implemented by BasicEntityPersister::load()&lt;/p&gt;</description>
                <environment>This is a new feature,  not a bug</environment>
            <key id="14169">DDC-2104</key>
            <summary>BasicEntityPersister::load() doesn&apos;t allow for cache usage</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="dmcfaul">Dan McFaul</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Oct 2012 19:43:26 +0000</created>
                <updated>Mon, 12 Nov 2012 14:51:07 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2102] Make optional SubselectFromClause</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2102</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Subselect ::= SimpleSelectClause &lt;span class=&quot;error&quot;&gt;&amp;#91;SubselectFromClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;WhereClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;GroupByClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;HavingClause&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;OrderByClause&amp;#93;&lt;/span&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14166">DDC-2102</key>
            <summary>Make optional SubselectFromClause</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Oct 2012 11:32:54 +0000</created>
                <updated>Thu, 25 Oct 2012 11:32:54 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2100] Getting Started: Code First PHP fatal error:Call to undefined method Bug::setDescription()</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2100</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html&lt;/a&gt;&lt;br/&gt;
in file create_bug.php&lt;br/&gt;
$bug-&amp;gt;setDescription(&quot;Something does not work!&quot;);&lt;br/&gt;
but the class Bug do not have setDescription function.&lt;/p&gt;

&lt;p&gt;ps:&lt;br/&gt;
try find &quot;setDescription&quot; on that page. there is only one .&lt;/p&gt;</description>
                <environment>ubuntu 1204 php5.3.8</environment>
            <key id="14164">DDC-2100</key>
            <summary>Getting Started: Code First PHP fatal error:Call to undefined method Bug::setDescription()</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="bronze1man">bronze1man</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Oct 2012 14:28:15 +0000</created>
                <updated>Wed, 24 Oct 2012 14:30:06 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2093] Doctrine Criteria does not support sorting by relationed field</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2093</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-none&quot;&gt;
// Here I call Criteria filter
public function getWalletsActive() {
	$criteria = Criteria::create()
		-&amp;gt;where(Criteria::expr()-&amp;gt;eq(&quot;isRemoved&quot;, &quot;0&quot;))
		-&amp;gt;orderBy(array(&quot;currency.id&quot; =&amp;gt; &quot;ASC&quot;));
	return $this-&amp;gt;wallets-&amp;gt;matching($criteria);
}

// Relation
/**
 * @var Currency
 *
 * @ORM\ManyToOne(targetEntity=&quot;Currency&quot;)
 * @ORM\JoinColumns({
 * @ORM\JoinColumn(name=&quot;id_currency&quot;, referencedColumnName=&quot;id&quot;)
 * })
 */
protected $currency;

// File BasicEntityPersister.php
// This cause the problem:
if ( ! isset($this-&amp;gt;_class-&amp;gt;fieldMappings[$fieldName])) {
    throw ORMException::unrecognizedField($fieldName);
}
// There are no relations in $this-&amp;gt;_class-&amp;gt;fieldMappings at all!
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14150">DDC-2093</key>
            <summary>Doctrine Criteria does not support sorting by relationed field</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="nick4fake">Bogdan Yurov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Oct 2012 09:10:02 +0000</created>
                <updated>Sun, 6 Jan 2013 18:29:28 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19237" author="beberlei" created="Sun, 6 Jan 2013 18:29:28 +0000"  >&lt;p&gt;Mark as improvement.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2087] Select colum Hydration</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2087</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Simple way to select colum&lt;br/&gt;
for example I want select id&apos;s of entity&apos;s to save in cache or in other select query&lt;br/&gt;
Or i vant select one distinct field.&lt;/p&gt;

&lt;p&gt;SELECT u.id FROM User as u&lt;/p&gt;

&lt;p&gt;getResult give&lt;/p&gt;

&lt;p&gt;array( &lt;br/&gt;
0=&amp;gt;array(&apos;id&apos; =&amp;gt; 1),&lt;br/&gt;
1=&amp;gt;array(&apos;id&apos; =&amp;gt; 2),&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;but how can take this&lt;/p&gt;

&lt;p&gt;array( &lt;br/&gt;
0=&amp;gt; 1,&lt;br/&gt;
0=&amp;gt; 2,&lt;br/&gt;
)&lt;/p&gt;</description>
                <environment></environment>
            <key id="14140">DDC-2087</key>
            <summary>Select colum Hydration</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ivan1986">Ivan Borzenkov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Oct 2012 09:47:54 +0000</created>
                <updated>Thu, 18 Oct 2012 09:56:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18848" author="ivan1986" created="Thu, 18 Oct 2012 09:55:04 +0000"  >&lt;p&gt;for example&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/11327798/change-the-getresult-array-key-for-the-primary-key-value&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/11327798/change-the-getresult-array-key-for-the-primary-key-value&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;this code would be good add in library&lt;br/&gt;
(and array key maybe too )&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2048] [GH-457] Fixes case when an entity has a relationship with a class with joined inheritance</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2048</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 Fran6co:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="14080">DDC-2048</key>
            <summary>[GH-457] Fixes case when an entity has a relationship with a class with joined inheritance</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 29 Sep 2012 16:11:00 +0000</created>
                <updated>Sat, 29 Sep 2012 16:11:00 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2042] Metadata association overriding : allow to override &apos;targetEntity&apos;</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2042</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;While associating object to an descriminated table I wasn&apos;t enable to fix the entityTarget (only one can be set in entity annotation).&lt;/p&gt;

&lt;p&gt;It could be resolve by adding the possibility to override &apos;targetEntity&apos; value in Doctrine\ORM\Mapping\ClassMetadataInfo::ClassMetadataInfo().&lt;/p&gt;

&lt;p&gt;Such as :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if (isset($overrideMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
    $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt; = $overrideMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That would need to add a control on the new targetEntity in Doctrine\ORM\Mapping\ClassMetadataInfo::_validateAndCompleteAssociationMapping().&lt;/p&gt;

&lt;p&gt;Such as :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if ( ! ClassLoader::classExists($mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;) ) {&lt;br/&gt;
throw MappingException::invalidTargetEntityClass($mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;targetEntity&amp;#39;&amp;#93;&lt;/span&gt;, $this-&amp;gt;name, $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;cro.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14067">DDC-2042</key>
            <summary>Metadata association overriding : allow to override &apos;targetEntity&apos;</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="cro">Charles Rouillon</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Sep 2012 08:57:40 +0000</created>
                <updated>Wed, 26 Sep 2012 08:59:38 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2043] Extra cache operation in DBAL\Cache\ResultCacheStatement.php</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2043</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is the closeCursor() method in DBAL\Cache\ResultCacheStatement.php:&lt;/p&gt;

&lt;div class=&quot;code panel&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 closeCursor()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;statement-&amp;gt;closeCursor();
        &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;emptied &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
            $data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;resultCache-&amp;gt;fetch($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cacheKey);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $data) {
                $data = array();
            }
            $data[$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;realKey] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data;

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;resultCache-&amp;gt;save($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cacheKey, $data, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;lifetime);
            unset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We are using Memcache and I noticed an extra GET operation on all cache misses. In the code above I believe the fetch call is not necessary and that the code would do the same without it. &lt;br/&gt;
Also, may I ask why is the SQL used as a key in the cached data?&lt;/p&gt;</description>
                <environment>CentOS, PHP 5.3.10</environment>
            <key id="14069">DDC-2043</key>
            <summary>Extra cache operation in DBAL\Cache\ResultCacheStatement.php</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="bogdan.albei">Bogdan Albei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Sep 2012 11:59:59 +0000</created>
                <updated>Wed, 26 Sep 2012 14:18:04 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18733" author="stof" created="Wed, 26 Sep 2012 14:12:15 +0000"  >&lt;p&gt;The SQL is used as a key because it is what identifies the query which is done (well, the statement and the parameters)&lt;/p&gt;</comment>
                    <comment id="18734" author="bogdan.albei" created="Wed, 26 Sep 2012 14:18:04 +0000"  >&lt;p&gt;The cacheKey already identifies the query(or at least it should). Would we have cases where different queries would want to use the same cache key?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2021] Array Data in Member OF</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2021</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi.&lt;br/&gt;
First sorry for my bad english.&lt;br/&gt;
In &lt;br/&gt;
SELECT u.id FROM CmsUser u WHERE :groupId MEMBER OF u.groups&lt;br/&gt;
DQL we can&apos;t use Array of groupId like&lt;/p&gt;</description>
                <environment></environment>
            <key id="14024">DDC-2021</key>
            <summary>Array Data in Member OF</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="vahid4134">vahid sohrabloo</reporter>
                        <labels>
                        <label>array</label>
                        <label>dql</label>
                    </labels>
                <created>Sun, 9 Sep 2012 09:10:02 +0000</created>
                <updated>Sun, 9 Sep 2012 09:10:02 +0000</updated>
                                    <version>2.2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2007] [GH-434] allowed to pass filter objects to the configurator</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2007</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 bamarni:&lt;/p&gt;

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

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

&lt;p&gt;If &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-2004&quot; title=&quot;Allowing objects as filters&quot;&gt;&lt;del&gt;DDC-2004&lt;/del&gt;&lt;/a&gt; gets approved.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14004">DDC-2007</key>
            <summary>[GH-434] allowed to pass filter objects to the configurator</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 31 Aug 2012 13:30:27 +0000</created>
                <updated>Wed, 5 Sep 2012 17:18:24 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1999] Lazy loading doesn&apos;t get the field type when generating sql</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1999</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When calling with lazy loading the Sql generated doesn&apos;t convert the parameters according to their types. After debugging the problem I found that the problem is in the getType($field, $value) function in the BasicEntityPersister as it is it will never be able to return the filed type when called for lazy loading for oneToMany or ManyToMany. I put a quick fix for my self&lt;/p&gt;
&lt;div class=&quot;code panel&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;private&lt;/span&gt; function getType($field, $value)
    {

        &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;) {
           &lt;span class=&quot;code-comment&quot;&gt;//here we have original code
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:

            	$type = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
               &lt;span class=&quot;code-comment&quot;&gt;// my fix starts here
&lt;/span&gt;            	$fieldParts = explode(&apos;.&apos;, $field);
            	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (count($fieldParts &amp;gt; 1)) {
	            	foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;associationMappings as $mapping) {
						&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;joinColumnFieldNames&apos;][$fieldParts[1]])) {
							$targetClass  = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;targetEntity&apos;]);

							&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($targetClass-&amp;gt;fieldNames[$fieldParts[1]])) {
								$type = $targetClass-&amp;gt;fieldMappings[$targetClass-&amp;gt;fieldNames[$fieldParts[1]]][&apos;type&apos;];
							}

							&lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
						}
	            	}
            	}
&lt;span class=&quot;code-comment&quot;&gt;//my fix end here
&lt;/span&gt;        }

       &lt;span class=&quot;code-comment&quot;&gt;//here we have original code
&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $type;
    }


&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;i have only added that check in the default case of the switch. I am not sure if that is the most elegant way. I hope that helps and that it will be fixed soon. Thanks for the great work &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13992">DDC-1999</key>
            <summary>Lazy loading doesn&apos;t get the field type when generating sql</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="vigor_bg">victor Velkov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Aug 2012 06:50:27 +0000</created>
                <updated>Wed, 29 Aug 2012 20:15:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18564" author="beberlei" created="Wed, 29 Aug 2012 11:49:20 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=fabio.bat.silva&quot; class=&quot;user-hover&quot; rel=&quot;fabio.bat.silva&quot;&gt;Fabio B. Silva&lt;/a&gt; &lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=guilhermeblanco&quot; class=&quot;user-hover&quot; rel=&quot;guilhermeblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; do we have a current best practice/policy regarding casting of join column types? There are some issues regarding it, this is another one.&lt;/p&gt;</comment>
                    <comment id="18581" author="guilhermeblanco" created="Wed, 29 Aug 2012 20:15:29 +0000"  >&lt;p&gt;We avoid the manual breakdown of path expressions.&lt;br/&gt;
Also, in BasicEntityPersister it is done behind the scenes and can get into weird scenarios. Personally speaking, I don&apos;t see how we can easily fix this issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2002] [GH-432] Add DBAL\TypeAwareObject type inference.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2002</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 Romain-Geissler:&lt;/p&gt;

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

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

&lt;p&gt;DBAL allows you to define custom field types for your entities, and those are seamlessly converted from PHP to SQL value. However, you can&apos;t those custom types as parameters without type hinting it :&lt;/p&gt;

&lt;p&gt;```php&lt;br/&gt;
$qb-&amp;gt;select(&apos;e&apos;)&lt;br/&gt;
   -&amp;gt;from(&apos;Entity&apos;, &apos;e&apos;)&lt;br/&gt;
   -&amp;gt;where(&apos;e.customField = :customFieldValue&apos;)&lt;br/&gt;
   -&amp;gt;setParameter(&apos;customFieldValue&apos;,$customFieldValue,$customFieldDBALType);&lt;br/&gt;
   //this third argument is for now compulsory&lt;br/&gt;
:&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;In my case, ``$customFieldValue`` is an object that won&apos;t work well if converted with the default string type. I added a new DBAL interface (see doctrine/dbal#193 ) and tweaked the parameter type inference so that custom values can advertise their DBAL type.&lt;/p&gt;

&lt;p&gt;There is currently no way to dynamically override the parameter type inference logic, this is one design that allows it in some cases. &lt;/p&gt;</description>
                <environment></environment>
            <key id="13997">DDC-2002</key>
            <summary>[GH-432] Add DBAL\TypeAwareObject type inference.</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 29 Aug 2012 16:05:38 +0000</created>
                <updated>Wed, 5 Sep 2012 17:21:34 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18589" author="beberlei" created="Thu, 30 Aug 2012 13:27:31 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-432&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/432&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/432&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1996] [GH-429] Ensure a parameter mapping entry exists for InstanceOf DQL expressions</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1996</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 craigmarvelley:&lt;/p&gt;

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

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

&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;This is a possible fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1995&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1995&lt;/a&gt;, in that it resolves the issue for me but I&apos;m afraid I haven&apos;t had time to test it extensively with more complex queries than the use case I gave in that ticket.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br/&gt;
Craig&lt;/p&gt;</description>
                <environment></environment>
            <key id="13983">DDC-1996</key>
            <summary>[GH-429] Ensure a parameter mapping entry exists for InstanceOf DQL expressions</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 22 Aug 2012 14:23:10 +0000</created>
                <updated>Wed, 22 Aug 2012 14:23:10 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1991] Add parameter indexBy to EntityRepository-&gt;createQueryBuilder()</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1991</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;createQueryBuilder() currently doesn&#8217;t have a parameter to set the third option on the FROM fragment: indexBy. Right now you have to read it, create a new From with the read properties and your desired indexBy value and replace the existing one on the QueryBuilder.&lt;/p&gt;

&lt;p&gt;Should be ten minutes&#8217; work including tests. Thanks a lot!&lt;/p&gt;</description>
                <environment></environment>
            <key id="13977">DDC-1991</key>
            <summary>Add parameter indexBy to EntityRepository-&gt;createQueryBuilder()</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="corphi">Philipp Cordes</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Aug 2012 07:52:31 +0000</created>
                <updated>Mon, 20 Aug 2012 07:52:31 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1986] findBy hydration with limit and offset with Oracle database (oci8 driver)</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1986</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I tried to use the findBy method with limit and offset parameters against an Oracle database using oci8 driver.&lt;/p&gt;

&lt;p&gt;The query seems to executed successfully but the hydrator fails when hydrating data as there is a DOCTRINE_ROWNUM column appending the &quot;limit&quot; clause.&lt;/p&gt;

&lt;p&gt;Here is the exception thrown :  &quot;Notice: Undefined index: DOCTRINE_ROWNUM in &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 183&quot;&lt;/p&gt;

&lt;p&gt;I was thinking about something like this to fix this issue &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;add an attribute (platformExtraColumns) to the platform class, storing every column added by methods like doModifyLimitQuery&lt;/li&gt;
	&lt;li&gt;check in hydrator method hydrateRowData if the column exists among the extra columns attribute of the custom platform&lt;/li&gt;
	&lt;li&gt;don&apos;t use the column if true&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Maybe there is a better approach, what are your thoughts?&lt;/p&gt;</description>
                <environment>composer.json require :&lt;br/&gt;
&lt;br/&gt;
&amp;quot;php&amp;quot;: &amp;quot;&amp;gt;=5.3.3&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/symfony&amp;quot;: &amp;quot;2.1.*&amp;quot;,&lt;br/&gt;
&amp;quot;doctrine/orm&amp;quot;: &amp;quot;&amp;gt;=2.2.3,&amp;lt;2.4-dev&amp;quot;,&lt;br/&gt;
&amp;quot;doctrine/doctrine-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;twig/extensions&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/assetic-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/swiftmailer-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;symfony/monolog-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;sensio/distribution-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;sensio/framework-extra-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;sensio/generator-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;jms/security-extra-bundle&amp;quot;: &amp;quot;1.2.*&amp;quot;,&lt;br/&gt;
&amp;quot;jms/di-extra-bundle&amp;quot;: &amp;quot;1.1.*&amp;quot;,&lt;br/&gt;
&amp;quot;twitter/bootstrap&amp;quot;: &amp;quot;master&amp;quot;,&lt;br/&gt;
&amp;quot;friendsofsymfony/rest-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;,&lt;br/&gt;
&amp;quot;doctrine/doctrine-fixtures-bundle&amp;quot;: &amp;quot;dev-master&amp;quot;</environment>
            <key id="13970">DDC-1986</key>
            <summary>findBy hydration with limit and offset with Oracle database (oci8 driver)</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="benja-m-1">Benjamin Grandfond</reporter>
                        <labels>
                        <label>oracle</label>
                    </labels>
                <created>Fri, 17 Aug 2012 09:57:38 +0000</created>
                <updated>Tue, 8 Jan 2013 09:33:00 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18524" author="benja-m-1" created="Fri, 17 Aug 2012 10:36:35 +0000"  >&lt;p&gt;I implemented it in my forks :&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/benja-M-1/doctrine2/commit/c8d899b14446accf869ddc0043f4235284375755&quot; class=&quot;external-link&quot;&gt;https://github.com/benja-M-1/doctrine2/commit/c8d899b14446accf869ddc0043f4235284375755&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/benja-M-1/dbal/commit/b9423c8d46a2bcdaa5a1f0b26a9a28259b1e44a2&quot; class=&quot;external-link&quot;&gt;https://github.com/benja-M-1/dbal/commit/b9423c8d46a2bcdaa5a1f0b26a9a28259b1e44a2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It works for me, but I didn&apos;t write unit tests.&lt;/p&gt;</comment>
                    <comment id="18537" author="benja-m-1" created="Fri, 24 Aug 2012 13:12:43 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Did you have time to have a look at this issue?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18538" author="stof" created="Fri, 24 Aug 2012 13:33:52 +0000"  >&lt;p&gt;Please send a pull request when you submit a fix. It is the proper way to submit them for review. When we want to see things waiting for review, we look at the list of pending PRs, not at all comments of the issue tracker to find links in them.&lt;/p&gt;

&lt;p&gt;And I can tell you that this change has a big issue: it introduces a state in the database platform whereas it is currently stateless. This is likely to cause some issues when using more than 1 query (which is a common use case).&lt;/p&gt;</comment>
                    <comment id="18555" author="benja-m-1" created="Wed, 29 Aug 2012 07:38:06 +0000"  >&lt;p&gt;Hi Christophe thank you for your feedback.&lt;/p&gt;

&lt;p&gt;I didn&apos;t send a PR because I wanted someone sharing his thoughts about what I suggested in this current issue. However I don&apos;t really understand the stateless argument, can you explain a bit more?&lt;/p&gt;

&lt;p&gt;Otherwise how would do you proceed to tell Doctrine not to hydrate platform-specific columns?&lt;/p&gt;
</comment>
                    <comment id="18556" author="stof" created="Wed, 29 Aug 2012 08:17:48 +0000"  >&lt;p&gt;If you run several queries, they will be affected by the extra columns of previous requests, which is wrong&lt;/p&gt;</comment>
                    <comment id="18557" author="beberlei" created="Wed, 29 Aug 2012 08:22:43 +0000"  >&lt;p&gt;I think the ObjectHydrator catches this by skipping undefined columns, i think we might just have overoptimized the SimpleObjectHydrator a little bit.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1971] [GH-419] Add ODM embedded-like functionality</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1971</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 djlambert:&lt;/p&gt;

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

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

&lt;p&gt;This PR adds ODM embedded-like functionality to the ORM.&lt;/p&gt;

&lt;p&gt;Including the new &lt;b&gt;@MappedAssociation&lt;/b&gt; annotation on a field having a one-to-one association adds a discriminator column to the table for storing the class name of a &quot;mapped&quot; entity.&lt;/p&gt;

&lt;p&gt;This allows a class or mapped superclass with a one-to-one identifying association to be extended by additional entities without requiring any code changes (as is required with the discriminator map when using inheritance).&lt;/p&gt;

&lt;p&gt;I apologize if this is the incorrect way to submit a feature request. Currently just the annotation driver has been updated, I wanted to get feedback before continuing with the remaining drivers. Models and tests are included.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13947">DDC-1971</key>
            <summary>[GH-419] Add ODM embedded-like functionality</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 7 Aug 2012 21:41:06 +0000</created>
                <updated>Tue, 14 Aug 2012 21:33:31 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1965] Multiple Index fails if index name not specified</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1965</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;@ORM\Table(name=&quot;applications&quot;, indexes={@ORM\Index(name=&quot;csl_idx&quot;, columns=&lt;/p&gt;
{&quot;createdAt&quot;, &quot;status&quot;, &quot;loanType&quot;}), @ORM\Index(name=&quot;s_idx&quot;, columns={&quot;status&quot;}), @ORM\Index(name=&quot;l_idx&quot;, columns={&quot;loanType&quot;})})&lt;br/&gt;
&lt;br/&gt;
the above Annotation creates 3 different indexes BUT when: &lt;br/&gt;
* @ORM\Table(name=&quot;applications&quot;, indexes={@ORM\Index(columns={&quot;createdAt&quot;, &quot;status&quot;, &quot;loanType&quot;}
&lt;p&gt;), @ORM\Index(columns=&lt;/p&gt;
{&quot;status&quot;}
&lt;p&gt;), @ORM\Index(columns=&lt;/p&gt;
{&quot;loanType&quot;}
&lt;p&gt;)})&lt;/p&gt;

&lt;p&gt;index-names not specified Symfony2 schemaUpdate tools shows only the last Index&lt;/p&gt;
</description>
                <environment>Ubuntu 11.04, PHP 5.3.6 with Suhosin-patch, Symfony 2.0.15</environment>
            <key id="13906">DDC-1965</key>
            <summary>Multiple Index fails if index name not specified</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="pont">Pont</reporter>
                        <labels>
                        <label>Cli</label>
                    </labels>
                <created>Thu, 2 Aug 2012 07:17:04 +0000</created>
                <updated>Thu, 2 Aug 2012 07:17:04 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1960] mapping joins in native queries breaks if select columns are starting with columns from joined table</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1960</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using a simple Testcase like in &lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/native-sql.html&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/native-sql.html&lt;/a&gt; there are two Tables:&lt;/p&gt;

&lt;p&gt;*) users:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
   Column   |  Type   | Modifiers | Storage  | Description 
------------+---------+-----------+----------+-------------
 u_id       | integer | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | plain    | 
 u_name     | text    | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | extended | 
 address_id | integer | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | plain    | 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;*) address:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
  Column  |  Type   | Modifiers | Storage  | Description 
----------+---------+-----------+----------+-------------
 a_id     | integer | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | plain    | 
 a_street | text    | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | extended | 
 a_city   | text    | not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;  | extended | 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;address_id is a foreign key to address;&lt;/p&gt;

&lt;p&gt;Now i created the Entities and setup a native query using ResultSetMappingBuilder:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$rsm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Query\ResultSetMappingBuilder($entityManager);
$rsm-&amp;gt;addRootEntityFromClassMetadata(&apos;MyProject\Entity\Users&apos;, &apos;u&apos;);
$rsm-&amp;gt;addJoinedEntityFromClassMetadata(&apos;MyProject\Entity\Address&apos;, &apos;a&apos;, &apos;u&apos;, &apos;address&apos;);

$query = &apos;
    SELECT
        u.*,
        a.*
    FROM
        users u
    LEFT JOIN address a ON (u.address_id = a.a_id)
&apos;;

/** @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt; \Doctrine\ORM\NativeQuery */
$&lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt; = $entityManager-&amp;gt;createNativeQuery($query, $rsm);

$ret = $&lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt;-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This returns the Entities correctly:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
array(2) {
  [0] =&amp;gt;
  class MyProject\Entity\Users#61 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;Smith&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    class MyProject\Entity\Address#63 (4) {
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $street =&amp;gt;
      string(8) &lt;span class=&quot;code-quote&quot;&gt;&quot;Broadway&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city =&amp;gt;
      string(8) &lt;span class=&quot;code-quote&quot;&gt;&quot;New York&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $users =&amp;gt;
      class Doctrine\ORM\PersistentCollection#64 (9) {
        ...
      }
    }
  }
  [1] =&amp;gt;
  class MyProject\Entity\Users#66 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(7) &lt;span class=&quot;code-quote&quot;&gt;&quot;Sherlok&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    class MyProject\Entity\Address#67 (4) {
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $street =&amp;gt;
      string(13) &lt;span class=&quot;code-quote&quot;&gt;&quot;Oxford Street&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city =&amp;gt;
      string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;London&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $users =&amp;gt;
      class Doctrine\ORM\PersistentCollection#68 (9) {
        ...
      }
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;BUT if you change the order of the select columns starting with ones from address you get borked Data:&lt;/p&gt;

&lt;div class=&quot;code panel&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 = &apos;
    SELECT
        a.*,
        u.*
    FROM
        users u
    LEFT JOIN address a ON (u.address_id = a.a_id)
&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
array(2) {
  [0] =&amp;gt;
  class MyProject\Entity\Users#61 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;Smith&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    class MyProject\Entity\Address#63 (4) {
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $street =&amp;gt;
      string(13) &lt;span class=&quot;code-quote&quot;&gt;&quot;Oxford Street&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city =&amp;gt;
      string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;London&quot;&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $users =&amp;gt;
      class Doctrine\ORM\PersistentCollection#64 (9) {
        ...
      }
    }
  }
  [1] =&amp;gt;
  class MyProject\Entity\Users#66 (3) {
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id =&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name =&amp;gt;
    string(7) &lt;span class=&quot;code-quote&quot;&gt;&quot;Sherlok&quot;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $address =&amp;gt;
    NULL
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This happens because the function Doctrine\ORM\Internal\Hydration\AbstractHydrator::_gatherRowData does not consider the Mapping i set up. Instead it just add the columns as they get starting with address ones.&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Internal\Hydration\ObjectHydrator::_hydrateRow then knows the Mapping and ignores the first Address as there is no User to map on, cycling to the next row will then add the address of the second row to the user from the first one.&lt;/p&gt;

&lt;p&gt;There are multiple ways to fix this. One would be to consider the mapping in _gatherRowData, the second to rewrite the _hydrateRow generating the Entities first and then the mapping in a second foreach loop.&lt;/p&gt;

&lt;p&gt;This bugger had me for 2 days until i finally figured it out.&lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;</description>
                <environment>ubuntu kernel 2.6.32-40-server&lt;br/&gt;
php 5.3.10-1ubuntu2ppa6~lucid with Suhosin-Patch (cli)&lt;br/&gt;
apache 2 2.2.14-5ubuntu8.9&lt;br/&gt;
postgres 9.1.4-1~lucid4</environment>
            <key id="13900">DDC-1960</key>
            <summary>mapping joins in native queries breaks if select columns are starting with columns from joined table</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="dready">Thomas Subera</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Jul 2012 11:23:21 +0000</created>
                <updated>Wed, 21 Nov 2012 23:48:37 +0000</updated>
                                    <version>2.1.4</version>
                <version>2.1.7</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19022" author="frederes" created="Wed, 21 Nov 2012 23:30:34 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Has same issue with using DQL /createQuery() ! Try all the day to find where was my mistake but seems to be a CRITICAL bug !&lt;br/&gt;
How did you solve this ?&lt;/p&gt;


&lt;p&gt;Doctrine version used : 2.3.1-DEV&lt;/p&gt;

&lt;p&gt;&amp;lt;code&amp;gt;&lt;br/&gt;
$query = $this-&amp;gt;getEntityManager()-&amp;gt;createQuery(&quot;&lt;br/&gt;
            SELECT cc, oc&lt;br/&gt;
            FROM  category cc&lt;br/&gt;
                JOIN cc.offer_category oc&lt;br/&gt;
            WHERE cc.catalog = :catalog_id&lt;br/&gt;
            ORDER BY oc.name ASC&lt;br/&gt;
            &quot;)&lt;br/&gt;
            -&amp;gt;setParameter(&quot;:catalog_id&quot;, $catalog_id)&lt;br/&gt;
            ;&lt;/p&gt;

&lt;p&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;

&lt;p&gt;Problem is that the order of the Aliases (cc, oc) is not considered on building SQL .&lt;br/&gt;
In my case, in the ObjectHydrator::hydrateRowData method :&lt;/p&gt;

&lt;p&gt;$rowData = $this-&amp;gt;gatherRowData($row, $cache, $id, $nonemptyComponents);&lt;/p&gt;

&lt;p&gt;returns &lt;/p&gt;

&lt;p&gt;Array&lt;br/&gt;
(&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;oc&amp;#93;&lt;/span&gt; =&amp;gt; Array&lt;br/&gt;
          (&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; =&amp;gt; 14&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; =&amp;gt; toto&lt;br/&gt;
        )&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;cc&amp;#93;&lt;/span&gt; =&amp;gt; Array&lt;br/&gt;
        (&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;catalog_id&amp;#93;&lt;/span&gt; =&amp;gt; 1&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;offer_category_id&amp;#93;&lt;/span&gt; =&amp;gt; 14&lt;br/&gt;
        )&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;As &quot;oc&quot; is a mapping, on the first loop the $parentAlias is not yet known and so :&lt;br/&gt;
&amp;lt;code&amp;gt;&lt;br/&gt;
if ($this-&amp;gt;_rsm-&amp;gt;isMixed &amp;amp;&amp;amp; isset($this-&amp;gt;_rootAliases&lt;span class=&quot;error&quot;&gt;&amp;#91;$parentAlias&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                    echo &quot;parentObject 1\n&quot;;
                    $first = reset($this-&amp;gt;_resultPointers);
                    $parentObject = $first[key($first)];
                }
&lt;p&gt; else if (isset($this-&amp;gt;_resultPointers&lt;span class=&quot;error&quot;&gt;&amp;#91;$parentAlias&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                    echo $parentAlias.&quot; parentObject 2\n&quot;;
                    $parentObject = $this-&amp;gt;_resultPointers[$parentAlias];
                }
&lt;p&gt; else &lt;/p&gt;
{
                    // HERE : on first loop, for &quot;oc&quot;, parent not yet known so skipped !!!
                    continue;
                }
&lt;p&gt;&amp;lt;/code&amp;gt;&lt;/p&gt;

&lt;p&gt;using a workaround on ObjectHydrator::hydrateRowData like this :&lt;br/&gt;
$rowData = array_reverse($rowData);&lt;/p&gt;

&lt;p&gt;make it work...&lt;/p&gt;

&lt;p&gt;Sorry for my dirty explanation... &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11215" name="testcase.zip" size="5941" author="dready" created="Tue, 31 Jul 2012 11:23:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1957] DB -&gt; Entity: Reverse engeniering with two relations between two tables</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1957</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i use the cli from the symfony 2.1 project to reverse from DB to Entity:&lt;/p&gt;

&lt;p&gt;php app/console doctrine:mapping:convert xml ./src/Acme/StoreBundle/Resources/config/doctrine/metadata/orm --from-database --force&lt;/p&gt;

&lt;p&gt;and i get tis error:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine\ORM\Mapping\MappingException&amp;#93;&lt;/span&gt;&lt;br/&gt;
Property &quot;radUser&quot; in &quot;RadAttribute&quot; was already declared, but it must be declared only once&lt;/p&gt;

&lt;p&gt;so i have a table &quot;radUser&quot; with two m:n relations to the same table &quot;radAttributes&quot;:&lt;/p&gt;

&lt;p&gt;Table radUser:&lt;br/&gt;
check =&amp;gt; radAttributes&lt;br/&gt;
reply =&amp;gt; radAttributes&lt;/p&gt;

&lt;p&gt;so doctrine reverse mapping try to generate the radAttribute entity with two mapping to radUser with the same field name &quot;radUser&quot;, what can i do to prevent this issue ?&lt;/p&gt;</description>
                <environment>windows 7, php 5.3, symfony 2.1</environment>
            <key id="13895">DDC-1957</key>
            <summary>DB -&gt; Entity: Reverse engeniering with two relations between two tables</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="skydiablo">sky diablo</reporter>
                        <labels>
                        <label>Cli</label>
                    </labels>
                <created>Sun, 29 Jul 2012 16:13:10 +0000</created>
                <updated>Sun, 29 Jul 2012 16:14:25 +0000</updated>
                                    <version>2.2</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1954] Specialized Batch Insert Mode for the Entity Manager</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1954</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;While it is already possible to speed up batch inserts by using raw SQL, that has the disadvantage to maintain a separate set of code that needs to be kept in sync with your schema.&lt;/p&gt;

&lt;p&gt;Therefore, it would be nice if the entity manager would provide a special batch insert mode where it can skip the change tracking related features, collection snapshots, etc. This might already be good enough for many people.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13892">DDC-1954</key>
            <summary>Specialized Batch Insert Mode for the Entity Manager</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Jul 2012 11:35:32 +0000</created>
                <updated>Sun, 29 Jul 2012 11:35:32 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1645] Paths to Annotations classes are not considered</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1645</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, my battle is described here: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/db9c77b6bc000f13&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/db9c77b6bc000f13&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I follow bugtracker tutorial I think that there is an error when working with Annotations, see these examples:&lt;/p&gt;

&lt;p&gt;Start a new bugtracker project as described in tutorial from scratch, create folders and files as tutorial expose, then do following changes:&lt;/p&gt;

&lt;p&gt;1) put Product, Bug, User class files at root level, same level as bootstraps files and create_xxxxx files&lt;br/&gt;
2) Create &apos;entities&apos; folder, but leave it empty.&lt;br/&gt;
3) Create &apos;yaml&apos; and &apos;xml&apos; at root level too and add related files.&lt;br/&gt;
4) Open bootstrap and edit paths to Product, Bug and User class files to read from root files as in 1) so they can be read from scripts.&lt;/p&gt;

&lt;p&gt;1) YAML&lt;br/&gt;
   a) When using YAML as mapping driver you need a path to Setup::createYAMLMetadataConfiguration( ) method, I use this&lt;br/&gt;
         Setup::createYAMLMetadataConfiguration(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/yaml&quot;), $isDevMode);&lt;br/&gt;
        where &quot;yaml&quot; directory is same level as bootstraps and create_xxxxx files are. When executing script to create a product&lt;br/&gt;
        Doctrine work as expected, creating a row inside table correctly.&lt;br/&gt;
   b) If you comment line where class Product is included, the object can&apos;t be found at runtime and will throw an exception as expected.&lt;br/&gt;
   c) With uncommented require Product line, change yaml name folder to anything, and Doctrine throw an exception (MappingException) as expected&lt;/p&gt;

&lt;p&gt;so Setup method path argument is considered correctly, Doctrine engine must know where yaml files for classes are.&lt;/p&gt;

&lt;p&gt;2) XML&lt;br/&gt;
   a) When using XML as mapping driver you need a path to Setup::createXMLMetadataConfiguration( ) method, I use this&lt;br/&gt;
         Setup::createXMLMetadataConfiguration(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/xml&quot;), $isDevMode);&lt;br/&gt;
        where &quot;xml&quot; directory is same level as bootstraps and create_xxxxx files are. When executing script to create a product&lt;br/&gt;
        Doctrine work as expected, creating a row inside table correctly.&lt;br/&gt;
   b) If you comment line where class Product is included, the object can&apos;t be found at runtime and will throw an exception as expected.&lt;br/&gt;
   c) With uncommented require Product line, change xml name folder to anything, and Doctrine throw an exception (MappingException) as expected&lt;/p&gt;

&lt;p&gt;so Setup method path argument is considered correctly again, Doctrine engine must know where xml files for classes are.&lt;/p&gt;

&lt;p&gt;3) Annotations&lt;br/&gt;
   a) When using Annotations as mapping driver you need a path to Setup::createAnnotationsMetadataConfiguration( ) method, I use this&lt;br/&gt;
         Setup::createAnnotationsMetadataConfiguration(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/entities&quot;), $isDevMode);&lt;br/&gt;
        where &quot;entities&quot; directory is same level as bootstraps and create_xxxxx files are (but remember THEY ARE EMPTY). When executing script to create a product&lt;br/&gt;
        Doctrine WORK AS EXPECTED, creating a row inside table correctly and still I don&apos;t know how if THERE IS NO Annotations files.&lt;br/&gt;
   b) If you comment line where class Product is included, the object can&apos;t be found at runtime and will throw an exception as expected.&lt;br/&gt;
   c) With uncommented require Product line, change name folder to anything, and Doctrine WILL NOT throw an exception, continue with execution.&lt;br/&gt;
   d) Copy /Product.php to /entities/Product.php, then comment docblocks from /Product class (using // or delete them). When running script Doctrine throw a MappingException with message: &quot;Class Product is not a valid entity or mapped super class&quot;, when as follow concepts from 1) (yaml) and 2) (xml) it should search docblocks from /entities/Product.php file (path argument from Setup), right?&lt;/p&gt;

&lt;p&gt;so Setup method path argument IS NOT CONSIDERED, Doctrine engine use already defined classes to get Annotations docblocks using php reflexion classes, methods and functions.&lt;/p&gt;

&lt;p&gt;How to deal with this? I mean...&lt;/p&gt;

&lt;p&gt;a) Erase path argument from Setup::createAnnotationMetadataConfiguration methos (and similar functions for Annotations) because is not needed, classes and annotations must be defined before.&lt;br/&gt;
b) Add support to find docblocks from path argument when no valid dockblock is found from class definition, so entities classes can live without docblocks because they are found inside Setup path function argument, as YAML and XML do.&lt;/p&gt;

&lt;p&gt;       I know that is easy to follow tutorial guidelines to develop applications in Annotations point of view, load them before Doctrine script start (with require/include or autoloaders, etc) and will work, but I think that is wrong how tutorial and functional logic are given, so a) and b) are my proposed solutions. I think b) should be right, get dockblocks from a class already defined and if are not defined it follow XML and YAML logic: read metadata from other files.&lt;/p&gt;

&lt;p&gt;Attachment: My bugtracker Netbeans project.&lt;/p&gt;

&lt;p&gt;Sorry by my english &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment>openSUSE 12.1 x86, Apache/2.2.21, mysql 5.5.16, PHP 5.3.8 (modules: Core, ctype, curl, date, dom, ereg, filter, gd, hash, http, iconv, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, pcre, PDO, pdo_mysql, pdo_sqlite, Reflection, session, SimpleXML, SPL, SQLite, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zip, zlib )</environment>
            <key id="13432">DDC-1645</key>
            <summary>Paths to Annotations classes are not considered</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="feathersanddown">feathers and down</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Feb 2012 04:54:28 +0000</created>
                <updated>Fri, 10 Feb 2012 04:54:28 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11158" name="bugtracker.zip" size="1764088" author="feathersanddown" created="Fri, 10 Feb 2012 04:54:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1602] Executors for Class Table Inheritance (JOINED) are extremely slow on MySQL</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1602</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Update and delete executors for Class Table Inheritance (JOINED) are extremely slow on MySQL platform. It is most probably due to use of subselect on the temporary table.&lt;br/&gt;
The slowdown is really significant as the table size increases. As an example, lets have a root entity with one subclass:&lt;/p&gt;

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

	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $xyz;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 */
class SubA &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Root
{
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $foo;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now lets perform a simple DQL UPDATE:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;UPDATE Entities\Root r SET r.xyz = 123 WHERE r.id &amp;gt; ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(note: always the upper half of entries)&lt;br/&gt;
Which creates following SQLs:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TEMPORARY TABLE Root_id_tmp (id INT NOT NULL)
INSERT INTO Root_id_tmp (id) SELECT t0.id FROM Root t0 LEFT JOIN SubA s0_ ON t0.id = s0_.id WHERE t0.id &amp;gt; 25000
UPDATE Root SET xyz = 123 WHERE (id) IN (SELECT id FROM Root_id_tmp)
DROP TEMPORARY TABLE Root_id_tmp
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The time spent on this on MySQL 5.5.17 and PostgreSQL 9.1 is:&lt;/p&gt;

&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; no. of entries &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 500   &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 1000  &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 2500 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 5000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 10000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 20000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 50000 &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; &lt;b&gt;MySQL&lt;/b&gt;             &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.26s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  0.35s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 1.1s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 3.68s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 14.13s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 54.44s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 338s &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; &lt;b&gt;PostgreSQL&lt;/b&gt;   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.10s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.10s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.13s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.15s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.22s   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.35s   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 1.01s &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;p&gt;As you can see, MySQL is drastically slower on even relatively small tables. This currently makes Doctrine unusable for this type of inheritance on MySQL. The solution probably would be to avoid subselect in WHERE clause in Doctrine\ORM\Query\Exec\MultiTableUpdateExecutor and Doctrine\ORM\Query\Exec\MultiTableDeleteExecutor.&lt;/p&gt;

&lt;p&gt;Feel free to try/modify the test script yourself, it&apos;s &lt;a href=&quot;https://github.com/Majkl578/doctrine2-slow-executors&quot; class=&quot;external-link&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
                <environment>Debian, MySQL 5.5.17</environment>
            <key id="13362">DDC-1602</key>
            <summary>Executors for Class Table Inheritance (JOINED) are extremely slow on MySQL</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="majkl578">Michael Moravec</reporter>
                        <labels>
                    </labels>
                <created>Sun, 15 Jan 2012 19:45:05 +0000</created>
                <updated>Wed, 27 Jun 2012 17:57:43 +0000</updated>
                                    <version>2.2-BETA2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17269" author="beberlei" created="Sun, 15 Jan 2012 22:59:14 +0000"  >&lt;p&gt;Its not a bug as it works. The performance drawback of JTI is discussed in the manual &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/inheritance-mapping.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/inheritance-mapping.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Changing this would be an improvement where we would hint if databases prefer subselects or joins for different operations. This would increase complexity of the SQL generation since now we are getting along with just one SQL generation strategy.&lt;/p&gt;</comment>
                    <comment id="17938" author="majkl578" created="Fri, 11 May 2012 11:02:42 +0000"  >&lt;p&gt;Any chance to get this implemented before 2.3?&lt;/p&gt;</comment>
                    <comment id="17939" author="majkl578" created="Fri, 11 May 2012 14:03:31 +0000"  >&lt;p&gt;I&apos;ve made a change in DBAL and ORM code to implement a solution issue. It&apos;s currently more likely a proof of concept.&lt;/p&gt;

&lt;p&gt;With the change, my results are (approximately):&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; no. of entries &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 500   &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 1000  &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 2500 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 5000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 10000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 20000 &lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; 50000 &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; &lt;b&gt;MySQL&lt;/b&gt;             &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.17s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  0.19s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.21s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.26s  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.27s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.37s &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0.92s &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;p&gt;Currently only update executor was changed.&lt;br/&gt;
DBAL branch with changes: &lt;a href=&quot;https://github.com/Majkl578/doctrine-dbal/tree/DDC-1602&quot; class=&quot;external-link&quot;&gt;https://github.com/Majkl578/doctrine-dbal/tree/DDC-1602&lt;/a&gt;&lt;br/&gt;
ORM branch with changes: &lt;a href=&quot;https://github.com/Majkl578/doctrine2/tree/DDC-1602&quot; class=&quot;external-link&quot;&gt;https://github.com/Majkl578/doctrine2/tree/DDC-1602&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking forward for your opinions.&lt;/p&gt;</comment>
                    <comment id="18148" author="majkl578" created="Wed, 27 Jun 2012 17:57:43 +0000"  >&lt;p&gt;bump&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1570] GH-243: Add ProxyFactoryInterface to allow custom proxy factories</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1570</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/243&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/243&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;d love to have my custom proxy factory used with ORM, which is not possible at the moment&lt;/p&gt;

&lt;p&gt;(my experimental proxy &lt;a href=&quot;https://github.com/juzna/doctrine2/commit/7822446036201b066e390b2e182cac1dc0c85430&quot; class=&quot;external-link&quot;&gt;https://github.com/juzna/doctrine2/commit/7822446036201b066e390b2e182cac1dc0c85430&lt;/a&gt; and some comments about it &lt;a href=&quot;http://blog.juzna.cz/2011/06/lazy-loading-in-php/&quot; class=&quot;external-link&quot;&gt;http://blog.juzna.cz/2011/06/lazy-loading-in-php/&lt;/a&gt;)&lt;/p&gt;</description>
                <environment></environment>
            <key id="13316">DDC-1570</key>
            <summary>GH-243: Add ProxyFactoryInterface to allow custom proxy factories</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 28 Dec 2011 12:39:03 +0000</created>
                <updated>Wed, 28 Dec 2011 19:49:30 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1564] MySQL Failure when using setFirstResult() and omitting setMaxResults()</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1564</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using setFirstResult() and omitting setMaxResults(), MySQL throws an error. This was very confusing for me until I dumped the SQL statements and found out the reason.&lt;/p&gt;

&lt;p&gt;I know that MySQL doesn&apos;t directly support this, their manual says that you should set the second parameter to LIMIT to a very high number (18446744073709551615 in their example).&lt;/p&gt;

&lt;p&gt;I&apos;d recommend that either throwing an error in the specific platform driver or follow the MySQL example.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13308">DDC-1564</key>
            <summary>MySQL Failure when using setFirstResult() and omitting setMaxResults()</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Dec 2011 11:47:33 +0000</created>
                <updated>Wed, 28 Dec 2011 08:48:17 +0000</updated>
                                    <version>2.1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17125" author="beberlei" created="Wed, 28 Dec 2011 08:48:17 +0000"  >&lt;p&gt;Changed into improvement, i am not sure how this relates to other databases.&lt;/p&gt;

&lt;p&gt;You can just use this workaround yourself so long.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1563] Result cache for repository queries</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1563</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Many related &quot;standing data&quot; tables are very static and seldom change. There should be a metadata config to enable result cache for ALL repository operations.&lt;/p&gt;

&lt;p&gt;@entity(resultCache=@cache(ttl=3600))&lt;/p&gt;</description>
                <environment></environment>
            <key id="13307">DDC-1563</key>
            <summary>Result cache for repository queries</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Dec 2011 11:22:11 +0000</created>
                <updated>Sun, 26 Aug 2012 19:34:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17103" author="beberlei" created="Sun, 25 Dec 2011 13:01:47 +0000"  >&lt;p&gt;This should directly support cache invalidation through a tag. Each repository gets a key with the current version. The version is one part ofthe actual cache datas key. &lt;/p&gt;

&lt;p&gt;A new cache key version is generated:&lt;/p&gt;

&lt;p&gt;1. When none is found during find operation&lt;br/&gt;
2. When any write operation is done.&lt;/p&gt;

&lt;p&gt;For transaction consisteny the rollback operation in UoW needs to reset cache keys and only after a succesful commit operation the new cache key version should be set.&lt;/p&gt;

&lt;p&gt;We may need begin, commit, rollback events in UoW for this.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1553] JTI Joining root tables could include ON ... AND root.id IS NOT NULL for each root in the inheritance</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1553</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Would lead to more optimal queries, while still allowing for LEFT JOIN. Also related to this:&lt;br/&gt;
&lt;a href=&quot;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&quot; class=&quot;external-link&quot;&gt;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13290">DDC-1553</key>
            <summary>JTI Joining root tables could include ON ... AND root.id IS NOT NULL for each root in the inheritance</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="asm89">Alexander</assignee>
                                <reporter username="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Dec 2011 11:21:32 +0000</created>
                <updated>Thu, 22 Dec 2011 11:21:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17085" author="asm89" created="Thu, 22 Dec 2011 11:21:52 +0000"  >&lt;p&gt;Again I can pick this up if this improvement is agreed upon.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1549] GH-232: Recursive check for entity identifiers and hashes</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1549</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/232&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/232&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi all!&lt;br/&gt;
This PR will add a better support for entities with association keys.&lt;/p&gt;

&lt;p&gt;getType will check recursively to find a type for the identifier.&lt;br/&gt;
getIndividualValue will search recursively to find the identifier value&lt;/p&gt;

&lt;p&gt;trygetById improved, using a recursive function to find an id value instead of implode functions (that cause exceptions if the identifier is an object and do not implements __toString method).  &lt;/p&gt;
</description>
                <environment></environment>
            <key id="13284">DDC-1549</key>
            <summary>GH-232: Recursive check for entity identifiers and hashes</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 20 Dec 2011 08:26:06 +0000</created>
                <updated>Thu, 22 Mar 2012 22:07:11 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17120" author="beberlei" created="Wed, 28 Dec 2011 08:03:40 +0000"  >&lt;p&gt;Mark as improvement&lt;/p&gt;</comment>
                    <comment id="17630" author="beberlei" created="Thu, 22 Mar 2012 22:07:11 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-232&amp;#93;&lt;/span&gt; was &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/232&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/232&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1552] JTI Owning table for identifier columns could/should be the entitytable</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1552</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When ordering a JTI entity on id, the generated SQL will use the table of the root entity. This is because the root entity is listed as owner of the field in the _owningTableMap, leading to non-optimal queries.&lt;/p&gt;

&lt;p&gt;More information see:&lt;br/&gt;
&lt;a href=&quot;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&quot; class=&quot;external-link&quot;&gt;https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13289">DDC-1552</key>
            <summary>JTI Owning table for identifier columns could/should be the entitytable</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="asm89">Alexander</assignee>
                                <reporter username="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Dec 2011 11:15:52 +0000</created>
                <updated>Thu, 22 Dec 2011 11:36:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17084" author="asm89" created="Thu, 22 Dec 2011 11:17:04 +0000"  >&lt;p&gt;I can pick this up if it&apos;s agreed upon that this could indeed be improved.&lt;/p&gt;</comment>
                    <comment id="17086" author="ocramius" created="Thu, 22 Dec 2011 11:33:06 +0000"  >&lt;p&gt;The problem here is that joining with a JTI causes LEFT JOINS, which don&apos;t perform very well when it comes to sorting the results.&lt;/p&gt;

&lt;p&gt;Just as a quick reference, here&apos;s where &quot;something&quot; should be changed to get this working:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L316&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L316&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the field is part of the primary key, the field used for sorting results should be the one of the table of the entity itself, and not of the root of the CTI.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1551] postFlush event listeners should be able to get a list of all flushed entities</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1551</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Testing the new Doctrine 2.2 Beta we finally got the postFlush event which is a nice way to handle things after all the DB work has finished. The main problem is that there is no way to get all the flushed entities. In the onFlush event you are able to use the getScheduledEntityUpdates/Inserts/Deletions but as these entities are flushed, those arrays are now empty. To solve this i see 2 aproaches:&lt;/p&gt;

&lt;p&gt;1. Not unseting the array that holds the scheduled entities so the getScheduledEntityUpdates/Inserts/Deletions still have data. Those arrays are reset just before finishing the commit method so maybe unsetting them one by one as they are flushed is not necessary&lt;br/&gt;
2. Unset the arrays but at the same time, fill another &quot;flushedEntities&quot; array with the flushed entities and then be able to get that array with a getFlushedEntities method&lt;/p&gt;

&lt;p&gt;I can make a patch if necessary, just wanted to know if that sounds ok before starting it &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13287">DDC-1551</key>
            <summary>postFlush event listeners should be able to get a list of all flushed entities</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="acasademont">Albert Casademont</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Dec 2011 11:52:22 +0000</created>
                <updated>Wed, 23 May 2012 19:09:26 +0000</updated>
                                    <version>2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>8</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17971" author="jasper@nerdsweide.nl" created="Wed, 23 May 2012 19:08:43 +0000"  >&lt;p&gt;I agree that Doctrine\ORM\Event\PreFlushEventArgs should contain a record of flushed entities, preferably reachable by entity-insertions/updates/deletions and collection-updates/deletions.&lt;/p&gt;

&lt;p&gt;I have a project (using Doctrine 2.1) which wrapped the flush call in my own. My flush dispatches custom preFlush/postFlush events (as they didn&apos;t exist in Doctrine 2.1), where my postFlushEventArgs does contain such a record. I&apos;ve just upgraded my project to use Doctrine 2.2 and stumbled upon:&lt;/p&gt;

&lt;p&gt;Catchable fatal error: Argument 1 passed to Nw\Event\EntityEvent::postFlush() must be an instance of Nw\Event\Args\PostFlushEventArgs, instance of Doctrine\ORM\Event\PostFlushEventArgs given.&lt;/p&gt;

&lt;p&gt;It seems I&apos;ve now hooked into Doctrine&apos;s postFlush (because I named the events the same way). I have renamed my events to work around this error, but I&apos;d rather see my behavior implemented natively.&lt;/p&gt;

&lt;p&gt;PS: Using Doctrine 2.2.2 to be precise &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1538] GH-217: [BUG] Schema Manager had no way to define extra options</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1538</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Pull-Request was automatically synchronized: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/217&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/217&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Schema Manager had no way to define extra options (&quot;comment&quot; option for example). It is possible to add these options via Annotations. After the fix adding `@ORM\Column(type=&quot;string&quot;, options=&lt;/p&gt;
{&quot;comment&quot; = &quot;test&quot;}
&lt;p&gt;)` starts to work producing valid SQL schema with COMMENT output.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13266">DDC-1538</key>
            <summary>GH-217: [BUG] Schema Manager had no way to define extra options</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 14 Dec 2011 16:45:03 +0000</created>
                <updated>Sat, 17 Dec 2011 11:52:55 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1513] Missing documentation for using references in Docs</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1513</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am in the process of switching over from Doctrine 2.0.7 to Doctrine 2.1 and one of the major missing components in my entities was the new use of using the mapping entity.&lt;/p&gt;

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

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
&amp;lt;?php
namespace My\Project\Entities;
use Doctrine\ORM\Mapping\Entity as ORM;
/**
 * @ORM\Entity(...)
 */
class Something
{
// Doctrine annotations here
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The nessecity for this to be included in the entities is (as far as I can tell) nowhere to be found in the docs, so I am a little curious as to how people are supposed to know. I have also had a look here: &lt;a href=&quot;http://www.doctrine-project.org/blog/doctrine-2-1-beta-release&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/blog/doctrine-2-1-beta-release&lt;/a&gt; and can see no references too it.&lt;/p&gt;

&lt;p&gt;Am I missing something; or is it really just missing from the docs?&lt;/p&gt;</description>
                <environment></environment>
            <key id="13225">DDC-1513</key>
            <summary>Missing documentation for using references in Docs</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="base">Thomas Gray</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Nov 2011 22:37:58 +0000</created>
                <updated>Tue, 29 Nov 2011 08:27:22 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16925" author="ebernhardson" created="Mon, 28 Nov 2011 22:43:56 +0000"  >&lt;p&gt;I also glanced through the docs and didn&apos;t find it.  I would suggest it be added to the Annotations Reference page: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/annotations-reference.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/annotations-reference.html&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16926" author="base" created="Tue, 29 Nov 2011 08:27:22 +0000"  >&lt;p&gt;Ahh, so there are some docs about it; &lt;a href=&quot;http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html&lt;/a&gt; however they do not seem to be that clear; nor well linked too.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1507] State change detection for version incrementation (for optimistic locking) in combination with orphanRemoval</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1507</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As i understand the documentation correctly, orphanRemoval associations have the meaning of a &quot;part of&quot; relationship. In the example (&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#orphan-removal&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#orphan-removal&lt;/a&gt;) the adresses are part of the contact.&lt;/p&gt;

&lt;p&gt;In my opinion we should reason that the state of the adress consists of the states of all nested contacts. As a consequence we should flag the contact as &quot;dirty&quot; when the adresses change.&lt;/p&gt;

&lt;p&gt;This is relevant for optimistic locking scenarios or event handlers. In my application i tried to use optimistic locking for &quot;contacts&quot;, which does not work if i don&apos;t change anything in the contact but only in the nested addresses.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13212">DDC-1507</key>
            <summary>State change detection for version incrementation (for optimistic locking) in combination with orphanRemoval</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="georgwaechter">Georg W&#228;chter</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Nov 2011 11:48:40 +0000</created>
                <updated>Sun, 27 Nov 2011 13:04:57 +0000</updated>
                                    <version>2.1.4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16921" author="beberlei" created="Sun, 27 Nov 2011 08:47:25 +0000"  >&lt;p&gt;This is still only an approvement, you can workaround this and handle is in your domain code.&lt;/p&gt;</comment>
                    <comment id="16922" author="georgwaechter" created="Sun, 27 Nov 2011 13:04:57 +0000"  >&lt;p&gt;Not in all cases. The first problem is that my domain code can&apos;t modify the version property, doctrine seems to block any manipulations to it. So i&apos;m not able to increment the variable myself.&lt;/p&gt;

&lt;p&gt;The only solution is to implement optimistic locking on my own or to add a dummy persistent boolean field that gets inversed by my domain code .. which would trigger the doctrine implementation for the optimistic locking.&lt;/p&gt;

&lt;p&gt;I think it&apos;s clear that the second option shouldn&apos;t be a choice. If doctrine doesn&apos;t handle the overall case exactly it should allow me to increment the version number myself.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1506] Possible Regression with OneToOne relation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1506</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\Entity
 */
class Top
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * @ORM\OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;LevelOne&quot;&lt;/span&gt;, orphanRemoval=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $levelOne;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }

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

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

/**
 * @ORM\Entity
 */
class LevelOne
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * @ORM\OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;LevelTwo&quot;&lt;/span&gt;, orphanRemoval=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $levelTwo;

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

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

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

/**
 * @ORM\Entity
 */
class LevelTwo
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setId($id)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id = $id;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;trying to clone objects&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$top = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Top();
        $top-&amp;gt;setLevelOne(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; LevelOne());
        $top-&amp;gt;getLevelOne()-&amp;gt;setLevelTwo(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; LevelTwo());
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($top);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();
        
        $newTop = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Top();
        $newTop-&amp;gt;setLevelOne(clone $top-&amp;gt;getLevelOne());
        $newTop-&amp;gt;getLevelOne()-&amp;gt;setId(&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
        $newTop-&amp;gt;getLevelOne()-&amp;gt;getLevelTwo()-&amp;gt;setId(&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
        
        var_dump($newTop-&amp;gt;getLevelOne()-&amp;gt;getId());
        var_dump($newTop-&amp;gt;getLevelOne()-&amp;gt;getLevelTwo()-&amp;gt;getId());
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($newTop);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the output is:&lt;br/&gt;
NULL&lt;br/&gt;
NULL&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;PDOException&amp;#93;&lt;/span&gt;                                                                                             &lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1&apos; for key &apos;UNIQ_82A72CD0778BC57F&apos; &lt;br/&gt;
(it duplicates level two entity)&lt;br/&gt;
I worked for a while with entities, in a certain set of entity properties it completely persisted into database, but without relation between level one and level two.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13211">DDC-1506</key>
            <summary>Possible Regression with OneToOne relation</summary>
                <type id="5" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="13135">DDC-1461</parent>
                        <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="n3b">Maxim</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Nov 2011 10:06:02 +0000</created>
                <updated>Wed, 23 Nov 2011 10:06:02 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1947] Update EBNF with arbitrary joins</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1947</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Arbitrary joins need to be documented in EBNF&lt;/p&gt;</description>
                <environment></environment>
            <key id="13883">DDC-1947</key>
            <summary>Update EBNF with arbitrary joins</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Jul 2012 12:10:35 +0000</created>
                <updated>Thu, 26 Jul 2012 12:10:35 +0000</updated>
                                    <version>2.3</version>
                <version>Git Master</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1938] [GH-406] [WIP] - DCOM-96 - Moving proxy generation and autoloading to common</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1938</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 Ocramius:&lt;/p&gt;

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

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

&lt;p&gt;This PR is related to doctrine/common#168. &lt;/p&gt;

&lt;p&gt;In this PR, the `ProxyFactory` has been reduced to an object builder and it&apos;s public API has been kept intact (While the proxy `Autoloader` has been moved to doctrine/common). It would be interesting to define what this builder could do with the `ProxyFactory` to get its own customizations introduced.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13872">DDC-1938</key>
            <summary>[GH-406] [WIP] - DCOM-96 - Moving proxy generation and autoloading to common</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 21 Jul 2012 23:26:43 +0000</created>
                <updated>Sat, 26 Jan 2013 23:53:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19408" author="beberlei" created="Fri, 25 Jan 2013 16:25:23 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-247&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/common/pull/247&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/247&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19422" author="beberlei" created="Sat, 26 Jan 2013 23:53:35 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-247&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/common/pull/247&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/247&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1924] Let SQLFilters know the query type it is being applied to</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1924</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m making an access control system and would like to automatically filter all queries based current user, targetEntity type and query type. Query type is relevant as different permissions are needed by the user for SELECT, UPDATE, DELETE and INSERT queries.&lt;/p&gt;

&lt;p&gt;I can access the first two things in my filter easily enough, but I cannot find a way to have the filter know what type of query the filter is being applied to.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13851">DDC-1924</key>
            <summary>Let SQLFilters know the query type it is being applied to</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://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="shne">Jan Knudsen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Jul 2012 09:23:12 +0000</created>
                <updated>Fri, 13 Jul 2012 10:59:35 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18301" author="beberlei" created="Fri, 13 Jul 2012 09:42:32 +0000"  >&lt;p&gt;The Filter API only makes sense for SELECT clauses. Doctrine itself does not use DQL to do updates internally, so you need to use other mechanisms (EventListener) to prevent this operations if they are not allowed for a user.&lt;/p&gt;</comment>
                    <comment id="18302" author="shne" created="Fri, 13 Jul 2012 09:51:55 +0000"  >&lt;p&gt;But I can make custom DQL to update rows and would like to automatically filter this too.&lt;/p&gt;

&lt;p&gt;e.g. $em-&amp;gt;createQuery(&quot;UPDATE SomeEntity se SET se.field = &quot;updated!&quot;)-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;The lifecycle events preUpdate etc. are not called when doing custom DQL queries.&lt;/p&gt;

&lt;p&gt;Maybe it is bad practice and discouraged to do updates, inserts and deletes as custom DQL queries, but I would like to ensure that the other people in my organization can&apos;t accidentally bypass the Access Control, even if they make use of such bad practice.&lt;/p&gt;

&lt;p&gt;And if the filter API only makes sense for Select statements, why are filters applied to update/delete/etc. statements too?&lt;/p&gt;</comment>
                    <comment id="18304" author="beberlei" created="Fri, 13 Jul 2012 10:41:38 +0000"  >&lt;p&gt;Well, they are applied to DQL UPDATE/DELETE. But not not UPDATE/DELETE that works through the internals of Doctrine. So yes, you can use it to filter DQL DELETE/UPDATE, but doctrine does not do that internally.&lt;/p&gt;

&lt;p&gt;So you have to have two strategies, a DQL/SQL Filter - and Lifecycle events.&lt;/p&gt;</comment>
                    <comment id="18305" author="shne" created="Fri, 13 Jul 2012 10:59:19 +0000"  >&lt;p&gt;Which is fine by me. I already implemented the checks using lifecycle events before opening this issue. The access control is automatically handled when using the entitymanager and not custom DQL.&lt;/p&gt;

&lt;p&gt;Now I would also like to filter the custom DQL, but currently I can&apos;t, because as originally stated, the filter needs to know which type of query it is being applied to.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1923] Type conversion error with oracle</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1923</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;https://github.com/symfony/symfony/pull/4730&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/pull/4730&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13850">DDC-1923</key>
            <summary>Type conversion error with oracle</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="asm89">Alexander</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Jul 2012 10:40:41 +0000</created>
                <updated>Thu, 12 Jul 2012 10:40:41 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1913] Updates for Fedora packaging</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1913</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am packaging the DoctrineDBAL PEAR package for Fedora and would like to have the following updates:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;package.xml role for LICENSE changed from &quot;data&quot; to &quot;doc&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;package.xml role for UPGRADE* changed from &quot;data&quot; to &quot;doc&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;package.xml role for Doctrine/ORM/README.markdown changed from &quot;data&quot; to &quot;doc&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;add some content to Doctrine/ORM/README.markdown (when building RPM this file throws a warning because it is empty)&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;doctrine.bat should only be installed on Windows OS&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Fedora</environment>
            <key id="13830">DDC-1913</key>
            <summary>Updates for Fedora packaging</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="siwinski">Shawn Iwinski</reporter>
                        <labels>
                    </labels>
                <created>Sat, 7 Jul 2012 03:40:25 +0000</created>
                <updated>Sat, 7 Jul 2012 03:56:52 +0000</updated>
                                    <version>2.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1899] [GH-385] set metadata for interface to be able to fetch entites by interface name</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1899</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 Burgov:&lt;/p&gt;

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

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

&lt;p&gt;using the new ResolveTargetEntity functionality we noticed we needed another feature:&lt;/p&gt;

&lt;p&gt;From the Symfony Bundle defining the interface, we&apos;d like to be able to fetch entities by this very interface name, e.g.:&lt;/p&gt;

&lt;p&gt;``` php&lt;br/&gt;
$em-&amp;gt;find(&apos;Foo\BarBundle\Entity\PersonInterface&apos;, 1);&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;``` php&lt;br/&gt;
$em-&amp;gt;getRepository(&apos;Foo\BarBundle\Entity\PersonInterface&apos;)-&amp;gt;findAll();&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;This PR sets metadata for the interface when metadata for a class is loaded that the interface is configured for&lt;/p&gt;</description>
                <environment></environment>
            <key id="13808">DDC-1899</key>
            <summary>[GH-385] set metadata for interface to be able to fetch entites by interface name</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 29 Jun 2012 10:22:55 +0000</created>
                <updated>Sat, 7 Jul 2012 15:02:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1894] Cannot view Doctrine 2.2 QueryBuilder documentation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1894</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Visiting the following page:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.QueryBuilder.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.QueryBuilder.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;always redirects back to &lt;a href=&quot;http://www.doctrine-project.org/api/orm/2.2/&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/api/orm/2.2/&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Chrome, Firefox, Safari on OS X</environment>
            <key id="13803">DDC-1894</key>
            <summary>Cannot view Doctrine 2.2 QueryBuilder documentation</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dteoh">Douglas Teoh</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jun 2012 06:09:24 +0000</created>
                <updated>Wed, 27 Jun 2012 06:09:24 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1882] AbstractQuery#getResultCacheId() should be public to be able to manage the cache</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1882</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The method getResultCacheId of Doctrine\ORM\AbstractQuery should be public.&lt;/p&gt;

&lt;p&gt;I&apos;m trying to customize the cache refresh mechanism to clear previously cached objects in my app.&lt;br/&gt;
To do that I&apos;m adding a prefix to define regions in the cache.&lt;br/&gt;
To be able to set the Id&apos;s correctly (adding region prefixes) I need to get the &quot;normal&quot; hash doctrine were used in the normal scenario (trying to avoid introduce new code).&lt;br/&gt;
That&apos;s why I will prefer the method to be public.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13788">DDC-1882</key>
            <summary>AbstractQuery#getResultCacheId() should be public to be able to manage the cache</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="ignaciolarranaga">Ignacio Larranaga</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jun 2012 17:37:43 +0000</created>
                <updated>Tue, 19 Jun 2012 17:38:39 +0000</updated>
                                    <version>2.1.6</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18099" author="ignaciolarranaga" created="Tue, 19 Jun 2012 17:38:39 +0000"  >&lt;p&gt;Attaching the patch despite is a trivial change.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11198" name="AbstractQuery.patch" size="762" author="ignaciolarranaga" created="Tue, 19 Jun 2012 17:38:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1879] Orphans are neither nulled nor removed when merging a graph of detached entities</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1879</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging a graph of detached entities, the created entitied are created and the updated entities are updated but the non-present entities (which exist in the database but are not in the graph) are neither removed nor have them their association column nullified.&lt;/p&gt;

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

&lt;p&gt;In my code I have 2 entities : Parent and Child. There is a OneToMany(cascade=&lt;/p&gt;
{&quot;all&quot;}
&lt;p&gt;, orphanRemoval=true) relation defined in Parent.&lt;/p&gt;

&lt;p&gt;In my database I have a Parent row with an id of 1, which has 3 Children with ids 1,2,3.&lt;/p&gt;

&lt;p&gt;When I write the following code, I expect the Parent with id 1 and the Child  with id 2 to be updated, a new Child to be created and the Child with id 1 and 3 to be deleted.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$parent = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Parent(); $parent-&amp;gt;id = 1  &lt;span class=&quot;code-comment&quot;&gt;// detached entity
&lt;/span&gt;$existing_child = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Child(); $child-&amp;gt;id = 2 &lt;span class=&quot;code-comment&quot;&gt;// detached entity
&lt;/span&gt;$new_child = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Child(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; entity
&lt;/span&gt;$dinner-&amp;gt;addChild($existing_child);
$dinner-&amp;gt;addChild($new_child);

$em-&amp;gt;merge($dinner);

$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The objects I expect to be created and updated have the correct behaviour but the old children are not touched, they are still present in the database.&lt;/p&gt;</description>
                <environment>Doctrine 2.2.2&lt;br/&gt;
PHP 5.3.10 with Suhosin-Patch&lt;br/&gt;
mysql  Ver 14.14 Distrib 5.5.15, for osx10.7&lt;br/&gt;
Mac OS X 10.7 Lion</environment>
            <key id="13784">DDC-1879</key>
            <summary>Orphans are neither nulled nor removed when merging a graph of detached entities</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="systho">Philippe Van Eerdenbrugghe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Jun 2012 15:56:06 +0000</created>
                <updated>Wed, 23 Jan 2013 22:24:05 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19384" author="ocramius" created="Wed, 23 Jan 2013 22:24:02 +0000"  >&lt;p&gt;I don&apos;t think this is valid. Orphan removal scheduling is handled only when an unit of work is available.&lt;/p&gt;

&lt;p&gt;What&apos;s the state of `$dinner` before your example? Can you `var_dump` it?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1860] Make usage of Composer for CLI optional</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1860</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There&apos;s two problems with current CLI implementation:&lt;/p&gt;

&lt;p&gt; 1 - composer `autoload.php` file is hardcoded, which means that it is making assumptions about where `doctrine/orm` has been installed, and it also makes the assumption that `doctrine/orm` is not the main package.&lt;br/&gt;
 2 - composer is a requirement, while requiring it should just fail silently and allow the end user to use his own autoloading strategy&lt;/p&gt;</description>
                <environment></environment>
            <key id="13763">DDC-1860</key>
            <summary>Make usage of Composer for CLI optional</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Sat, 9 Jun 2012 09:06:53 +0000</created>
                <updated>Sat, 9 Jun 2012 12:56:33 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18072" author="ocramius" created="Sat, 9 Jun 2012 12:56:33 +0000"  >&lt;p&gt;Merged at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/365&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/365&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1859] Implement console command to convert DQL into object running NativeQuery</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1859</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As per our conversation during SFLive Paris 2012, we should create a command that receives a DQL and exposes back to you a PHP code of an object holding a conversion to NativeQuery, which is faster.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13762">DDC-1859</key>
            <summary>Implement console command to convert DQL into object running NativeQuery</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 8 Jun 2012 10:02:01 +0000</created>
                <updated>Fri, 8 Jun 2012 10:02:01 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1829] [GH-352] Add the posibility to add a custom Comparator for Schema tool</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1829</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 catacgc:&lt;/p&gt;

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

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

&lt;p&gt;See catacgc/dbal#153&lt;/p&gt;</description>
                <environment></environment>
            <key id="13716">DDC-1829</key>
            <summary>[GH-352] Add the posibility to add a custom Comparator for Schema tool</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 21 May 2012 11:31:59 +0000</created>
                <updated>Tue, 22 May 2012 17:47:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1820] [GH-348] [DDC-1819][WIP] Arbitrary object hydrator</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1820</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 marijn:&lt;/p&gt;

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

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

&lt;p&gt;Initial work (in progress) on a test suite for the arbitrary object hydrator, as discussed in &lt;a href=&quot;http://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;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;. Any tips are appreciated. I&apos;m not too sure what the test suite should and should not cover. &lt;/p&gt;

&lt;p&gt;Other questions I have include:&lt;/p&gt;

&lt;p&gt;1. Should the `HYDRATE_ARBITRARY_OBJECT` constant be added to the `AbstractQuery` class or the `NativeQuery` class? It only makes sense in the former but it might be missed when more constants are added in the future...&lt;br/&gt;
2. Should I use data providers in my tests for the result set data?&lt;br/&gt;
3. Should my tests be added to a `DDC1819` namespace?&lt;br/&gt;
4. Should I add functional tests?&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://www.doctrine-project.org/jira/browse/DDC-1819&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1819&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13697">DDC-1820</key>
            <summary>[GH-348] [DDC-1819][WIP] Arbitrary object hydrator</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 14 May 2012 10:25:15 +0000</created>
                <updated>Sun, 27 May 2012 10:52:38 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1813] Save column types in ClassMetadataInfo#columnTypes array instead of ClassMetadataInfo#fieldMappings[&apos;type&apos;]</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1813</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Because you save column types in fieldmappings only, type information is not saved for join columns.&lt;/p&gt;

&lt;p&gt;Not having type info for join columns, makes it impossible to do call &apos;convertToPhpValue&apos; on join columns.&lt;/p&gt;

&lt;p&gt;For example see a demo of problem here:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/347&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/347&lt;/a&gt;&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13686">DDC-1813</key>
            <summary>Save column types in ClassMetadataInfo#columnTypes array instead of ClassMetadataInfo#fieldMappings[&apos;type&apos;]</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="rivaros">ross neacoders</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 May 2012 11:36:16 +0000</created>
                <updated>Sun, 6 May 2012 11:36:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1817] Allowing to specify MySQL Collation on Field Basis</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1817</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice to be able to specify which collation to use on a field basis.&lt;/p&gt;

&lt;p&gt;This would for example be useful when you have case-sensitive (utf8_bin), and case-insensitive (utf8_general_ci) values. Right now, this needs to be manually added to migration files (which is ok for projects, but it is not so nice for distributable libraries).&lt;/p&gt;</description>
                <environment></environment>
            <key id="13691">DDC-1817</key>
            <summary>Allowing to specify MySQL Collation on Field Basis</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="johannes">Johannes Schmitt</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 May 2012 20:13:01 +0000</created>
                <updated>Tue, 8 May 2012 20:13:01 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1814] Save quoted info in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings[&apos;fieldname&apos;][&apos;quoted&apos;]</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1814</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Similar to &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1813&quot; title=&quot;Save column types in ClassMetadataInfo#columnTypes array instead of ClassMetadataInfo#fieldMappings[&amp;#39;type&amp;#39;]&quot;&gt;DDC-1813&lt;/a&gt; I propose saving &apos;quote&apos; status in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldname&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;quoted&amp;#39;&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Otherwise you have quotation info only for fieldColumns and not association columns&lt;/p&gt;</description>
                <environment></environment>
            <key id="13687">DDC-1814</key>
            <summary>Save quoted info in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings[&apos;fieldname&apos;][&apos;quoted&apos;]</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="rivaros">ross neacoders</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 May 2012 11:39:54 +0000</created>
                <updated>Sun, 6 May 2012 11:39:54 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1806] DQL with and without fetch join cause</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1806</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When running following DQL in newly cleared EntityManager, with the provided entities (see attached archive or gist at &lt;a href=&quot;https://gist.github.com/2473775&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/2473775&lt;/a&gt; ), results in different fetched association:&lt;/p&gt;

&lt;p&gt;DQL without join:&lt;br/&gt;
SELECT a FROM Entity\A a WHERE a.id = :id&lt;/p&gt;

&lt;p&gt;SQL without join:&lt;br/&gt;
SELECT a0_.a_id AS a_id0, a0_.id AS id1 FROM a a0_ WHERE a0_.a_id = ?&lt;/p&gt;

&lt;p&gt;Result without join:&lt;br/&gt;
$query-&amp;gt;getOneOrNullResult()&lt;del&gt;&amp;gt;getB()&lt;/del&gt;&amp;gt;getName(); // &apos;correct&apos;&lt;/p&gt;


&lt;p&gt;DQL with fetch join:&lt;br/&gt;
SELECT a, b FROM Entity\A a LEFT JOIN a.b b WHERE a.id = :id&lt;/p&gt;

&lt;p&gt;SQL with fetch join:&lt;br/&gt;
SELECT a0_.a_id AS a_id0, b1_.id AS id1, b1_.name AS name2, a0_.id AS id3 FROM a a0_ LEFT JOIN b b1_ ON a0_.id = b1_.id WHERE a0_.a_id = ?&lt;/p&gt;

&lt;p&gt;Result with fetch join:&lt;br/&gt;
$query-&amp;gt;getOneOrNullResult()&lt;del&gt;&amp;gt;getB()&lt;/del&gt;&amp;gt;getName(); // &apos;wrong&apos; (different result)&lt;/p&gt;


&lt;p&gt;The problem seems to be strictly related with how the `@JoinColumn` is configured.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13675">DDC-1806</key>
            <summary>DQL with and without fetch join cause</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Tue, 1 May 2012 21:09:00 +0000</created>
                <updated>Tue, 1 May 2012 21:15:33 +0000</updated>
                                    <version>2.2</version>
                <version>2.2.1</version>
                <version>2.2.2</version>
                <version>Git Master</version>
                                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17900" author="ocramius" created="Tue, 1 May 2012 21:15:32 +0000"  >&lt;p&gt;Attaching failing test from &lt;a href=&quot;https://github.com/Ocramius/doctrine2/compare/DDC-1806&quot; class=&quot;external-link&quot;&gt;https://github.com/Ocramius/doctrine2/compare/DDC-1806&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11188" name="DDC1806Test.php" size="2518" author="ocramius" created="Tue, 1 May 2012 21:15:32 +0000" />
                    <attachment id="11187" name="gist2473775-d202a38fdfb91921ef010df36322fb646561593a.tar.gz" size="19832" author="ocramius" created="Tue, 1 May 2012 21:09:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1812] Modify ResultSetMapping#addMetaResult function definition</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1812</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Give correct names to arguments&lt;/p&gt;
&lt;div class=&quot;code panel&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 addMetaResult($alias, $columnName, $fieldName, $isIdentifierColumn = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$alias - should be $tableAlias&lt;br/&gt;
$columnName should be $columnAlias&lt;br/&gt;
$fieldName should be $columnName&lt;/p&gt;

&lt;p&gt;Here are some exmple calls from code:&lt;br/&gt;
AbstractEntityInheritancePersister.php&lt;br/&gt;
79: $this-&amp;gt;_rsm-&amp;gt;addMetaResult(&apos;r&apos;, $columnAlias, $joinColumnName); &lt;br/&gt;
SqlWalker.php&lt;br/&gt;
$this-&amp;gt;_rsm-&amp;gt;addMetaResult($dqlAlias, $columnAlias, $discrColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt;); &lt;br/&gt;
$this-&amp;gt;_rsm-&amp;gt;addMetaResult($dqlAlias, $columnAlias, $srcColumn, (isset($assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&lt;/span&gt; === true)); &lt;br/&gt;
$this-&amp;gt;_rsm-&amp;gt;addMetaResult($dqlAlias, $columnAlias, $srcColumn); &lt;/p&gt;




</description>
                <environment></environment>
            <key id="13685">DDC-1812</key>
            <summary>Modify ResultSetMapping#addMetaResult function definition</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="rivaros">ross neacoders</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 May 2012 11:28:54 +0000</created>
                <updated>Sun, 6 May 2012 11:28:54 +0000</updated>
                                    <version>2.2</version>
                <version>2.2.1</version>
                <version>2.2.2</version>
                <version>Git Master</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1803] Paginator usage with a DQL query that is using 2 time the same named binded value failed</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1803</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I use a dql query where I bind a named parameter 2 time in the same query for different joined fields.  The query work but the count query failed saying that there are missing bind variable.&lt;/p&gt;

&lt;p&gt;ex:&lt;br/&gt;
$qb = $this-&amp;gt;getQueryBuilder()&lt;br/&gt;
            -&amp;gt;select(&apos;&lt;br/&gt;
                partial fl.&lt;/p&gt;
{id, title, listing_date, abstract}
&lt;p&gt;,&lt;br/&gt;
                partial fla.&lt;/p&gt;
{id},&lt;br/&gt;
                partial ca.{id}
&lt;p&gt;,&lt;br/&gt;
                partial ds.&lt;/p&gt;
{id}
&lt;p&gt;            &apos;)&lt;br/&gt;
            -&amp;gt;from(&apos;Fo_Listing&apos;, &apos;fl&apos;)&lt;br/&gt;
            -&amp;gt;join(&apos;fl.listing_properties&apos;, &apos;flp&apos;)&lt;br/&gt;
            -&amp;gt;join(&apos;flp.property&apos;, &apos;fp&apos;)&lt;br/&gt;
            -&amp;gt;leftjoin(&apos;fl.listing_assets&apos;, &apos;fla&apos;)&lt;br/&gt;
            -&amp;gt;leftjoin(&apos;fla.asset&apos;, &apos;ca&apos;)&lt;br/&gt;
            -&amp;gt;leftjoin(&apos;ca.ds&apos;, &apos;ds&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;fp.id = :propertyId&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;propertyId&apos;, $id)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fl.object_status_id &amp;lt;&amp;gt; :deleted&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;deleted&apos;, CoRefObjectStatus::DELETE)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fl.publishing_status_id = :published&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;published&apos;, CoRefPublishingStatus::PUBLISHED)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fp.object_status_id &amp;lt;&amp;gt; :deleted&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;deleted&apos;, CoRefObjectStatus::DELETE)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;fp.publishing_status_id = :published&apos;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;published&apos;, CoRefPublishingStatus::PUBLISHED)&lt;br/&gt;
            -&amp;gt;add(&apos;orderBy&apos;, &apos;fl.listing_date DESC, fl.published_date DESC&apos;)&lt;br/&gt;
            -&amp;gt;setMaxResults($onTheMarketLimit);&lt;/p&gt;

&lt;p&gt;        $onTheMarket = new Paginator($qb, $fetchJoin = true);&lt;/p&gt;

&lt;p&gt;To make it work, I&apos;ve renamed the second usage of the named variable with a 2 at the end.  deleted2 and published2.&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="13669">DDC-1803</key>
            <summary>Paginator usage with a DQL query that is using 2 time the same named binded value failed</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mdrolet">Marc Drolet</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Apr 2012 12:41:44 +0000</created>
                <updated>Fri, 25 Jan 2013 15:29:52 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19385" author="ocramius" created="Wed, 23 Jan 2013 22:27:08 +0000"  >&lt;p&gt;This seems to be quite old. &lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=mdrolet&quot; class=&quot;user-hover&quot; rel=&quot;mdrolet&quot;&gt;Marc Drolet&lt;/a&gt; is it still valid with the latest ORM?&lt;/p&gt;</comment>
                    <comment id="19406" author="mdrolet" created="Fri, 25 Jan 2013 15:27:21 +0000"  >&lt;p&gt;I&apos;ll try to test this problem on an updated version and I&apos;ll let you know.&lt;br/&gt;
The bug entry is also quite old and I&apos;ve a local modified version of the paginator here to make it work with oracle, so it can take some time before I can test this out on the current doctrine version.&lt;/p&gt;</comment>
                    <comment id="19407" author="ocramius" created="Fri, 25 Jan 2013 15:29:48 +0000"  >&lt;p&gt;Ok, marking as awaiting feedback&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1792] [GH-340] add public has() method to filter collection.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1792</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 pjedrzejewski:&lt;/p&gt;

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

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

&lt;p&gt;Sorry if there is any reason why this is not implemented already.&lt;br/&gt;
This is useful when some feature, for example `soft-deleteable` filter may be optional.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13650">DDC-1792</key>
            <summary>[GH-340] add public has() method to filter collection.</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 19 Apr 2012 18:03:16 +0000</created>
                <updated>Fri, 4 May 2012 17:58:14 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1787] Fix for JoinedSubclassPersister, multiple inserts with versioning throws an optimistic locking exception</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1787</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Attached is a small patch for a bug in the file JoinedSubclassPersister.php. When persisting multiple new entities that are subclasses of a baseclass (joined), and having the @Version attribute set, only for the last one a query is run to fetch the new value of the version field. The other one is tested with NULL, and throws an optimistic locking exception.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13644">DDC-1787</key>
            <summary>Fix for JoinedSubclassPersister, multiple inserts with versioning throws an optimistic locking exception</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="jack@actinum.nl">Jack van Galen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Apr 2012 19:40:56 +0000</created>
                <updated>Wed, 18 Apr 2012 19:40:56 +0000</updated>
                                    <version>2.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11185" name="JoinedSubclassPersister.php.patch" size="744" author="jack@actinum.nl" created="Wed, 18 Apr 2012 19:40:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1785] Paginator problem with SQL Server around DISTINCT keyword.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1785</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;PDOException: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 10.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Incorrect syntax near the keyword &apos;DISTINCT&apos;. (uncaught exception)&lt;/p&gt;</description>
                <environment></environment>
            <key id="13642">DDC-1785</key>
            <summary>Paginator problem with SQL Server around DISTINCT keyword.</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 18 Apr 2012 08:06:55 +0000</created>
                <updated>Sat, 19 Jan 2013 18:50:37 +0000</updated>
                                    <version>2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18847" author="camason" created="Thu, 18 Oct 2012 08:44:54 +0000"  >&lt;p&gt;There are four major issues with this:&lt;/p&gt;

&lt;p&gt;1: SQLServerPlatform.php modifies the query to prepend &apos;SELECT ROW_NUMBER() OVER ($over)&apos;, which is inserted before the DISTINCT keyword.&lt;/p&gt;

&lt;p&gt;2: The order needs to be placed inside the OVER($over) block. At this point, the regex is using the exact column name rather than the alias, so the outer query cannot ORDER.&lt;/p&gt;

&lt;p&gt;3: The DISTINCT queries select only the ID columns - as OVER() required the sort column to be available in the outer query, IDs alone will not work.&lt;/p&gt;

&lt;p&gt;4: SQL Server cannot DISTINCT on TEXT columns. 2005,2008 and 2012 recommend using VARCHAR(MAX) instead, which does support it. That doesn&apos;t help us with 2003. We work around that with a custom TEXT type that casts as varchar.&lt;/p&gt;

&lt;p&gt;Incidentally, 2012 supports LIMIT, which gets rid of this issue altogether.&lt;/p&gt;

&lt;p&gt;Edit: Added #3&lt;/p&gt;</comment>
                    <comment id="18849" author="camason" created="Thu, 18 Oct 2012 13:31:11 +0000"  >&lt;p&gt;I have a (very hacky) implementation working that uses regexes to correct the query so that it will execute. This also required modification in the ORM paginator, to select all columns instead of just IDs.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/CraigMason/dbal/commit/4ecd018c73e387904f78d81f1d327e34e905c5f1&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/dbal/commit/4ecd018c73e387904f78d81f1d327e34e905c5f1&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/CraigMason/doctrine2/commit/b416d3b2a38495e4435bde872b19fec371fe5657&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/doctrine2/commit/b416d3b2a38495e4435bde872b19fec371fe5657&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is certainly not a patch - more guidance.&lt;/p&gt;

&lt;p&gt;One interesting point... I had to wrap the whole query in a second SELECT *, as the WHERE IN confusingly returns non-distinct rows when part of the first inner query. No idea why this happens, but moving it out one layer makes it operate correctly.&lt;/p&gt;</comment>
                    <comment id="18886" author="camason" created="Thu, 25 Oct 2012 11:35:00 +0000"  >&lt;p&gt;Updated, view all commits for this experimental branch here: &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/CraigMason/dbal/commits/mssql-distinct&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/dbal/commits/mssql-distinct&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18897" author="camason" created="Mon, 29 Oct 2012 20:13:49 +0000"  >&lt;p&gt;This got waaaay too messy with regex alone due to the complicated nesting. As such, I have written the basis of a new SqlWalker class which can be used to create DISTINCT queries based on the root identifiers. It&apos;s not proper DISTINCT support, but it&apos;s a step forward.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/CraigMason/DoctrineSqlServerExtensions&quot; class=&quot;external-link&quot;&gt;https://github.com/CraigMason/DoctrineSqlServerExtensions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve also added a Paginator (which was the original issue I had!)&lt;/p&gt;

&lt;p&gt;The current SqlWalker always sticks the ORDER BY on the end of the query, which just doesn&apos;t work properly with SqlServer. Is a vendor-specific walker breaking the DQL abstraction? Should this type of code be on the Platform object in the DBAL?&lt;/p&gt;

&lt;p&gt;Anyway, this repo fixes our immediate problem, and it would be good to revisit this in a wider context. Hopefully we can get some good SQL server support - there are plenty of other issues to deal with (UTF-8/UCS2, nvarchar etc)&lt;/p&gt;</comment>
                    <comment id="19339" author="beberlei" created="Sat, 19 Jan 2013 18:50:37 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=camason&quot; class=&quot;user-hover&quot; rel=&quot;camason&quot;&gt;Craig Mason&lt;/a&gt; We don&apos;t have an SQL Server expert on the team, so if you want really good support you should join and help us with it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1760] [GH-324] simplified __call method</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1760</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 brikou:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="13599">DDC-1760</key>
            <summary>[GH-324] simplified __call method</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 3 Apr 2012 15:34:06 +0000</created>
                <updated>Sat, 7 Apr 2012 07:25:24 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17756" author="beberlei" created="Wed, 4 Apr 2012 19:59:07 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-324&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/324&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/324&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17794" author="beberlei" created="Fri, 6 Apr 2012 13:50:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-324&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/324&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/324&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17820" author="beberlei" created="Sat, 7 Apr 2012 07:21:04 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-324&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/324&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/324&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1756] Allow for master table only models on joined subclass inheritance</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1756</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Think of a joined subclass inheritance setup where abstract base class A has many concrete child classes C1 ... CN. For each child class a table necessarily has to created. Yet if there are many child classes not defining any additional fields you will get many &quot;id only&quot; child tables. This leads to unnecessary join and insert overhead on database operations as well as a bunch of quite senseless tables in your schema that need to be maintained.&lt;/p&gt;

&lt;p&gt;While there are already tickets requesting support for mixed inheritance mapping (e.g. &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-138&quot; title=&quot;Allow for mixed inheritance mapping&quot;&gt;DDC-138&lt;/a&gt;) I want to propose another - obviously easy to implement - solution that addresses the &quot;id only table&quot; problem. The basic idea is to extend ClassMetadata by a flag &quot;hasOwnTable&quot; which is true by default and applicable for child classes of a joined subclass tree. Setting this flag to &amp;lt;false&amp;gt; would lead to...&lt;br/&gt;
1.) no child table creation for corresponding model&lt;br/&gt;
2.) no joins to this table while rendering SQL from DQL statements&lt;br/&gt;
3.) no INSERT, UPDATE and DELETE statements for this table in methods executeInserts(), update() and delete() on Doctrine\ORM\Persisters\JoinedSubclassPersister.&lt;/p&gt;

&lt;p&gt;(3) can easily be implemented since the mentioned methods all loop on ClassMetadata::parentClasses. For those classes which set the flag &quot;hasOwnTable&quot; to false the operation will be skipped. On the other hand (2) doesn&apos;t seem to a big deal either. Extending SqlWalker::_generateClassTableInheritanceJoins() by means of a flag test seems to be enough. Of course setting the flag to &amp;lt;false&amp;gt; while defining additional fields on child class level must be rejected.&lt;/p&gt;

&lt;p&gt;If you go for this feature I would be pleased to provide an implementation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13595">DDC-1756</key>
            <summary>Allow for master table only models on joined subclass inheritance</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="markus.woessner">Markus W&#246;&#223;ner</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Apr 2012 11:41:01 +0000</created>
                <updated>Tue, 3 Apr 2012 11:41:01 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1750] [GH-319] [WIP] Added support to Multiple ID Generators</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1750</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 guilhermeblanco:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="13588">DDC-1750</key>
            <summary>[GH-319] [WIP] Added support to Multiple ID Generators</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 1 Apr 2012 16:55:51 +0000</created>
                <updated>Sun, 27 May 2012 17:15:44 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17724" author="beberlei" created="Sun, 1 Apr 2012 20:19:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17725" author="beberlei" created="Sun, 1 Apr 2012 20:48:16 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17726" author="beberlei" created="Mon, 2 Apr 2012 04:21:38 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17730" author="beberlei" created="Mon, 2 Apr 2012 19:15:14 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17733" author="beberlei" created="Tue, 3 Apr 2012 03:42:14 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17734" author="beberlei" created="Tue, 3 Apr 2012 03:55:21 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17752" author="beberlei" created="Wed, 4 Apr 2012 19:59:03 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17787" author="beberlei" created="Fri, 6 Apr 2012 13:50:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17816" author="beberlei" created="Sat, 7 Apr 2012 07:21:04 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-319&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/319&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/319&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2305] [GH-584] QueryBuilder::addCriteria improvements</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2305</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 chEbba:&lt;/p&gt;

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

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

&lt;p&gt;1. Fix problem with different comparisons on the same field in QueryExpressonVisitor (now index value is added).&lt;br/&gt;
2. Add criteria field aliasing. Usually oject criteria has &quot;filed = value&quot; notation while DQL has &quot;alias.field = value&quot;.&lt;br/&gt;
First level fields are added with alias, second+ level fields (object.field, parent.object.field) are truncated to the second level (object.field) without alias. Alias map can be implemented in future.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14499">DDC-2305</key>
            <summary>[GH-584] QueryBuilder::addCriteria improvements</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 19 Feb 2013 17:59:48 +0000</created>
                <updated>Tue, 19 Feb 2013 18:00:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19569" author="beberlei" created="Tue, 19 Feb 2013 18:00:03 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-584&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/584&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/584&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2290] Infer custom Types from the field for query parameters</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2290</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using a mapping Type that declares &lt;tt&gt;convertToDatabaseValue&lt;/tt&gt;, the method is not always called in queries.&lt;/p&gt;

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

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

&lt;p&gt;(with &lt;tt&gt;entity.field&lt;/tt&gt; being of custom type &apos;the_mapping_type&apos;)&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Type::convertToDatabaseValue()&lt;/tt&gt; is correctly called when using:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$query-&amp;gt;setParameter(&apos;1&apos;, &apos;foo&apos;, &apos;the_mapping_type&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But it is not called when using:&lt;/p&gt;

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

&lt;p&gt;which gives a query that returns invalid results.&lt;/p&gt;

&lt;p&gt;Like other mapping types in this situation, there is no reason the type is not inferred automatically from the field.&lt;/p&gt;

&lt;p&gt;I have written a failing test case in Doctrine\Tests\ORM\Functional\TypeValueSqlTest:&lt;/p&gt;

&lt;div class=&quot;code panel&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 testQueryParameterWithoutType()
    {
        $entity = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CustomTypeUpperCase();
        $entity-&amp;gt;lowerCaseString = &apos;foo&apos;;

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($entity);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();

        $id = $entity-&amp;gt;id;

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();

        $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;SELECT c.id from Doctrine\Tests\Models\CustomType\CustomTypeUpperCase c where c.lowerCaseString = ?1&apos;);
        $query-&amp;gt;setParameter(&apos;1&apos;, &apos;foo&apos;);

        $result = $query-&amp;gt;getResult();

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertCount(1, $result);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($id, $result[0][&apos;id&apos;]);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14470">DDC-2290</key>
            <summary>Infer custom Types from the field for query parameters</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="mnapoli">Matthieu Napoli</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Feb 2013 11:36:49 +0000</created>
                <updated>Fri, 8 Feb 2013 12:54:06 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19494" author="mnapoli" created="Fri, 8 Feb 2013 11:38:48 +0000"  >&lt;p&gt;See also &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2224&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2224&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19495" author="mnapoli" created="Fri, 8 Feb 2013 12:54:06 +0000"  >&lt;p&gt;The test is in this branch: &lt;a href=&quot;https://github.com/myc-sense/doctrine2/tree/DDC-2290&quot; class=&quot;external-link&quot;&gt;https://github.com/myc-sense/doctrine2/tree/DDC-2290&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2275] [GH-568] Fixed plural variable names to singular when generating add or remove methods for entities</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2275</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 alexcarol:&lt;/p&gt;

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

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

&lt;p&gt;Changed generateEntityStubMethod so that variable names in add or remove methods are singular too&lt;/p&gt;

&lt;p&gt;Edited tests for EntityGenerator so that variable names are checked too&lt;/p&gt;</description>
                <environment></environment>
            <key id="14454">DDC-2275</key>
            <summary>[GH-568] Fixed plural variable names to singular when generating add or remove methods for entities</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 4 Feb 2013 01:47:46 +0000</created>
                <updated>Mon, 4 Feb 2013 01:47:46 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2264] Add support for custom Oracle SID / Service name in PDO_Oracle driver</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2264</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Some Oracle customer databases are set up having different settings for their &quot;DBNAME&quot; and &quot;SID&quot; / &quot;SERVICE&quot; property. (DBNAME != SID)&lt;/p&gt;

&lt;p&gt;So, hereing it&apos;s currently not possible to connect via the PDO_Oracle driver (Class: Doctrine\DBAL\Driver\PDOOracle\Driver) as it uses the DBNAME value by default as value for SID / SERVICE in the _constructPdoDsn() method. (DBNAME = SID)&lt;/p&gt;

&lt;p&gt;A solution would be to add an additional config param like &quot;servicename&quot; and pass it&apos;s value into _constructPdoDsn().&lt;/p&gt;

&lt;p&gt;An updated version of the method could look like:&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;private function _constructPdoDsn(array $params)&lt;br/&gt;
{&lt;br/&gt;
    $dsn = &apos;oci:&apos;;&lt;br/&gt;
    if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;host&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;host&amp;#39;&amp;#93;&lt;/span&gt; != &apos;&apos;) {&lt;br/&gt;
        $dsn .= &apos;dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)&apos; .&lt;br/&gt;
               &apos;(HOST=&apos; . $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;host&amp;#39;&amp;#93;&lt;/span&gt; . &apos;)&apos;;&lt;/p&gt;

&lt;p&gt;        if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;port&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
            $dsn .= &apos;(PORT=&apos; . $params[&apos;port&apos;] . &apos;)&apos;;
        }
&lt;p&gt; else &lt;/p&gt;
{
            $dsn .= &apos;(PORT=1521)&apos;;
        }

&lt;p&gt;		if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;servicename&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;servicename&amp;#39;&amp;#93;&lt;/span&gt; != &apos;&apos;)&lt;/p&gt;
		{
			$servicename	=	$params[&apos;servicename&apos;];
		}
&lt;p&gt;		else&lt;/p&gt;
		{
			$servicename	=	$params[&apos;dbname&apos;];
		}

&lt;p&gt;        if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;service&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;service&amp;#39;&amp;#93;&lt;/span&gt; == true) &lt;/p&gt;
{
            $dsn .= &apos;))(CONNECT_DATA=(SERVICE_NAME=&apos; . $servicename . &apos;)))&apos;;
        }
&lt;p&gt; else &lt;/p&gt;
{
            $dsn .= &apos;))(CONNECT_DATA=(SID=&apos; . $servicename . &apos;)))&apos;;
        }

&lt;p&gt;    } else &lt;/p&gt;
{
        $dsn .= &apos;dbname=&apos; . $params[&apos;dbname&apos;];
    }

&lt;p&gt;    if (isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;charset&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
        $dsn .= &apos;;charset=&apos; . $params[&apos;charset&apos;];
    }

&lt;p&gt;    return $dsn;&lt;br/&gt;
}&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;The only workaround for me is right now to use the &quot;standard&quot; PHP OCI / OCI8 functions with the correct SID / Service in it&apos;s DSN.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14430">DDC-2264</key>
            <summary>Add support for custom Oracle SID / Service name in PDO_Oracle driver</summary>
                <type id="3" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="michl">Michl Schmid</reporter>
                        <labels>
                        <label>oracle</label>
                    </labels>
                <created>Tue, 29 Jan 2013 10:16:55 +0000</created>
                <updated>Tue, 29 Jan 2013 10:16:55 +0000</updated>
                                    <version>2.0</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2249] Default value sequence </title>
                <link>http://doctrine-project.org/jira/browse/DDC-2249</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I want to have a column on a table that by default it takes the value from a sequence.&lt;/p&gt;

&lt;p&gt;I&apos;ve tried to do something like this:&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ORM\Column(type=&quot;integer&quot;, unique=&quot;true&quot;)&lt;/li&gt;
	&lt;li&gt;@ORM\GeneratedValue(strategy=&quot;SEQUENCE&quot;)&lt;/li&gt;
	&lt;li&gt;@ORM\SequenceGenerator(sequenceName=&quot;seq_categorias&quot;, initialValue=1, allocationSize=100)&lt;br/&gt;
     */&lt;br/&gt;
    protected $id_categoria;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But this doesn&apos;t work, it creates de sequence but not the link between the table column and the sequence. Is there any possibility to do something like this? Or any autoincrement default value instead?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment>Symfony 2, linux</environment>
            <key id="14394">DDC-2249</key>
            <summary>Default value sequence </summary>
                <type id="3" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="mdev">Maria</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jan 2013 18:44:07 +0000</created>
                <updated>Sat, 19 Jan 2013 18:44:07 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2239] Allow dynamic modification of select queries (either filter the AST or query)</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2239</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I had built and used the following for doctrine 1: &lt;a href=&quot;http://web.archive.org/web/20110705035547/http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/record-based-retrieval-security-template/en#record-based-retrieval-security-template&quot; class=&quot;external-link&quot;&gt;http://web.archive.org/web/20110705035547/http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/record-based-retrieval-security-template/en#record-based-retrieval-security-template&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;d like to build something similar for D2 based projects.&lt;/p&gt;

&lt;p&gt;ocramius in IRC suggested a bug report/Improvement request. Figured that perhaps a custom event &quot;dql_parse&quot; or &quot;ast_render&quot; passing the AST or Query as a parameter.&lt;/p&gt;

&lt;p&gt;I&apos;m under a tight timeline and am willing to pay for aid/feature implementation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14379">DDC-2239</key>
            <summary>Allow dynamic modification of select queries (either filter the AST or query)</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="gnat">Nathanael Noblet</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jan 2013 22:03:46 +0000</created>
                <updated>Fri, 11 Jan 2013 22:03:46 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2223] unable to use scalar function when a scalar expression is expected</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2223</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;the DQL Parser don&apos;t parse properly functions when a ScalarExpression is needed like of all case functions.&lt;/p&gt;

&lt;p&gt;In fact first function token is interpreted as a T_IDENTIFIER and enter on line 1663 of Doctrine\ORM\Query\Parser class. in search of math operator, when not found this case considere that the token is a row element with no consid&#233;ration of the functions procession treated after.&lt;/p&gt;

&lt;p&gt;fix of this bug consist to enclose the line 1672 by a if (!$this-&amp;gt;_isFunction()).&lt;/p&gt;</description>
                <environment>(not affected by this bug)</environment>
            <key id="14349">DDC-2223</key>
            <summary>unable to use scalar function when a scalar expression is expected</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="alexises">Alexis Lameire</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Fri, 4 Jan 2013 13:21:34 +0000</created>
                <updated>Fri, 4 Jan 2013 13:21:34 +0000</updated>
                                    <version>Git Master</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2219] computeChangeSets array_merging for associationMappings problem ?</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2219</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Is this normal that when i call &quot;$changeset = $unitOfWork-&amp;gt;getEntityChangeSet($myObject);&quot;, it only return changes of root Object, all changes in sub collection (OneToMany) are less (not merging in the changeset) ?&lt;/p&gt;

&lt;p&gt;Is there an issue for that?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14343">DDC-2219</key>
            <summary>computeChangeSets array_merging for associationMappings problem ?</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="yohann.poli">yohann.poli</reporter>
                        <labels>
                        <label>unitofwork</label>
                    </labels>
                <created>Wed, 2 Jan 2013 15:42:17 +0000</created>
                <updated>Mon, 7 Jan 2013 08:52:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19207" author="ocramius" created="Wed, 2 Jan 2013 15:44:23 +0000"  >&lt;p&gt;Changesets of collections are computed separately from those of entities.&lt;/p&gt;</comment>
                    <comment id="19208" author="yohann.poli" created="Wed, 2 Jan 2013 16:34:33 +0000"  >&lt;p&gt;Have to call the compute method for each collection of the entity ?&lt;/p&gt;</comment>
                    <comment id="19221" author="beberlei" created="Sun, 6 Jan 2013 09:05:34 +0000"  >&lt;p&gt;Yes you have to, but this kind of operation seems weird. What are you trying to achieve.&lt;/p&gt;</comment>
                    <comment id="19243" author="yohann.poli" created="Mon, 7 Jan 2013 08:52:53 +0000"  >&lt;p&gt;I manage a complex entity who have a collection entity (each entity in this collection have another collection entity) attributes and i need to now if the flush method has &quot;really&quot; execute an update.&lt;/p&gt;

&lt;p&gt;For example if the level 3 entity is update, i have to know in the root entity all changes apply in child...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2193] Named native query bug?</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2193</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;@NamedNativeQueries is a useful thing, but I have found some problems during my using.&lt;br/&gt;
1&#12289;Normal&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
 /**
 * @NamedNativeQueries({
 *      @NamedNativeQuery(
 *          name            = &lt;span class=&quot;code-quote&quot;&gt;&quot;fetchMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          resultSetMapping= &lt;span class=&quot;code-quote&quot;&gt;&quot;mappingMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          query            = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT * FROM test &quot;&lt;/span&gt;
 *      )
 * })
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;2&#12289;Error&#65292;cannot connect to the server&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
 /**
 * @NamedNativeQueries({
 *      @NamedNativeQuery(
 *          name            = &lt;span class=&quot;code-quote&quot;&gt;&quot;fetchMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          resultSetMapping= &lt;span class=&quot;code-quote&quot;&gt;&quot;mappingMultipleJoinsEntityResults&quot;&lt;/span&gt;,
 *          query            = &quot;SELECT * 
            FROM test &quot;
 *      )
 * })
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;3&#12289;Cannot use alias.The same problem as the second one.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
.......
 query            = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a as test FROM test &quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14303">DDC-2193</key>
            <summary>Named native query bug?</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dingdangjyz">dingdangjyz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Dec 2012 01:43:00 +0000</created>
                <updated>Mon, 31 Dec 2012 04:02:50 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19125" author="fabio.bat.silva" created="Wed, 12 Dec 2012 13:56:30 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;Doctrine does not change the native query at all&lt;br/&gt;
The problem seems related with database connection.&lt;/p&gt;

&lt;p&gt;Could you provide more details please?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19127" author="dingdangjyz" created="Thu, 13 Dec 2012 01:12:44 +0000"  >&lt;p&gt;Doctrine\Common\Lexer.php&lt;/p&gt;

&lt;p&gt;Hello, after checking&#65292; I found the problem should be here. As long as SQL wrap, or fill in alias, it will be error. It seems to be the preg_split problem?&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
        $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE;
        $matches = preg_split($regex, $input, -1, $flags);

        foreach ($matches as $match) {
            &lt;span class=&quot;code-comment&quot;&gt;// Must remain before &apos;value&apos; assignment since it can change content
&lt;/span&gt;            $type = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getType($match[0]);

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tokens[] = array(
                &apos;value&apos; =&amp;gt; $match[0],
                &apos;type&apos;  =&amp;gt; $type,
                &apos;position&apos; =&amp;gt; $match[1],
            );
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19128" author="fabio.bat.silva" created="Thu, 13 Dec 2012 10:59:21 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;Could you try to add a failing test case please ?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19133" author="dingdangjyz" created="Fri, 14 Dec 2012 02:06:21 +0000"  >&lt;p&gt;xp php5.3.8 Apache&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?php

namespace Models\Entities;

/**
 * @Entity
 * @Table
 *
 * @NamedNativeQueries({
 *      @NamedNativeQuery(
 *          name             = &lt;span class=&quot;code-quote&quot;&gt;&quot;find-hotel-item&quot;&lt;/span&gt;,
 *          resultSetMapping = &lt;span class=&quot;code-quote&quot;&gt;&quot;mapping-find-item&quot;&lt;/span&gt;,
 *          query            = &quot;SELECT Top 1 VEI_SN AS SN 
            FROM tourmanager.dbo.VEndorInfo vi 
INNER JOIN tourmanager.dbo.VEndorInfo2 vi2 ON 
vi.VEI_SN = vi2.VEI2_VEI_SN LEFT OUTER JOIN tourmanager.dbo.HotelInfo hi 
ON hi.hotelid = vi2.VEI2_VEI_SN INNER JOIN tourmanager.dbo.HotelInfo2 
hi2 ON hi2.hotelid = vi2.VEI2_VEI_SN AND hi2.LGC = 1 &quot;
 *      )
 * })
 *
 * @SqlResultSetMappings({
 *      @SqlResultSetMapping(
 *          name    = &lt;span class=&quot;code-quote&quot;&gt;&quot;mapping-find-item&quot;&lt;/span&gt;,
 *          entities= {
 *              @EntityResult(
 *                  entityClass = &lt;span class=&quot;code-quote&quot;&gt;&quot;HTHotelItem&quot;&lt;/span&gt;,
 *                  fields = {
 *                      @FieldResult(name = &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;,   column=&lt;span class=&quot;code-quote&quot;&gt;&quot;SN&quot;&lt;/span&gt;)
 *                  }
 *              )
 *          }
 *      )
 * })
 *
 */

class HTHotelItem{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
        
    /** @name */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;
    
    /** @city */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $city;
    
    /** @url */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $url;
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata){
        $metadata-&amp;gt;addNamedNativeQuery(array(
            &apos;name&apos;              =&amp;gt; &apos;find-hotel-item&apos;,
            &apos;query&apos;             =&amp;gt; &apos;SELECT h FROM HTHotelItem h&apos;,
            &apos;resultSetMapping&apos;  =&amp;gt; &apos;\\Models\\Entities\\HTHotelItem&apos;
        ));
    }
    
    function getId(){
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }
    
    function getName(){
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name;
    }
    
    function getCity(){
        &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;city;
    }
    
    function getUrl(){
        &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;url;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19134" author="dingdangjyz" created="Fri, 14 Dec 2012 07:59:21 +0000"  >&lt;p&gt;@NamedNativeQueries query  &lt;/p&gt;

&lt;p&gt;If we write the long SQL, it will be fault. NO error massage.&lt;br/&gt;
1251 charecter must be wrong.&lt;br/&gt;
I still insist it is the problem of preg_split in &lt;br/&gt;
Doctrine\Common\Lexer.php&lt;/p&gt;</comment>
                    <comment id="19152" author="fabio.bat.silva" created="Sun, 16 Dec 2012 20:50:10 +0000"  >&lt;p&gt;Can&apos;t reproduce,&lt;/p&gt;

&lt;p&gt;Could you try to change the attached test case and make it fail.&lt;/p&gt;


&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19178" author="beberlei" created="Mon, 24 Dec 2012 09:22:16 +0000"  >&lt;p&gt;The Doctrine\Common\Lexer is never used in combination with native queries, only with the Annotation Parser, so i cannot be the preg_split that causes your SQL to be broken. Or do you get annotation errors?&lt;/p&gt;

&lt;p&gt;Also what database are you using? maybe its related to the DBAL sql parsing?&lt;/p&gt;</comment>
                    <comment id="19195" author="dingdangjyz" created="Mon, 31 Dec 2012 04:02:50 +0000"  >&lt;p&gt;I&apos;m sorry my English is too bad. &lt;/p&gt;

&lt;p&gt;I think it&apos;s Doctrine \ is \ Lexer. PHP preg_split the function of the problem in this file.&lt;br/&gt;
My system environment is xp/apache 5.3 + / php_pdo_sqlsrv_53 / mssql2000&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11363" name="DDC2193Test.php" size="2501" author="fabio.bat.silva" created="Sun, 16 Dec 2012 20:48:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2183] Second Level Cache improvements</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2183</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hibernate has a second level cache feature that is much more advanced than Doctrines result cache.&lt;/p&gt;

&lt;p&gt;With NoSQL in-memory databases such as Riak or MongoDB we could need a much more powerful cache to make Doctrine faaaaaasst. This ticket tracks the design and implementation of that feature.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14289">DDC-2183</key>
            <summary>Second Level Cache improvements</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 3 Dec 2012 22:44:09 +0000</created>
                <updated>Mon, 3 Dec 2012 22:44:09 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2184] [GH-530] Singular form of generated methods should end with &apos;y&apos; when property ends with &apos;ies&apos;</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2184</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In Doctrine 2.3 the &apos;add&apos; and &apos;remove&apos; methods in oneToMany associations have another problem (in earlier versions like 2.2 this worked correct). The singular form is not correctly detected if the property ends with &apos;ies&apos; like &apos;entries&apos; which should be transformed to &apos;entry&apos;.&lt;br/&gt;
I have this YAML definition:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Archive:
  type: entity
  fields:
    id:
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      generator:
        strategy: IDENTITY
  oneToMany:
    entries:
      targetEntity: Entry
      mappedBy: archive
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This generates these 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;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addEntrie(\Entry $entries) { ... }
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeEntrie(\Entry $entries) { ... }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Because in the EntityGenerator only the plural &apos;s&apos; is removed. It would be nice if an ending of &apos;ies&apos; could be replaced by &apos;y&apos;. So that we get these 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;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addEntry(\Entry $entries) { ... }
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeEntry(\Entry $entries) { ... }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;My fork already has the changes &lt;a href=&quot;https://github.com/naitsirch/doctrine-orm2/commit/a3adfccb4927d61da7debae46ed0fff61e4212f8&quot; class=&quot;external-link&quot;&gt;https://github.com/naitsirch/doctrine-orm2/commit/a3adfccb4927d61da7debae46ed0fff61e4212f8&lt;/a&gt;&lt;br/&gt;
I have opened a pull request here &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/530&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/530&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14290">DDC-2184</key>
            <summary>[GH-530] Singular form of generated methods should end with &apos;y&apos; when property ends with &apos;ies&apos;</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://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>Tue, 4 Dec 2012 09:14:25 +0000</created>
                <updated>Sun, 6 Jan 2013 10:02:11 +0000</updated>
                                    <version>2.3</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19104" author="naitsirch" created="Tue, 4 Dec 2012 09:25:11 +0000"  >&lt;p&gt;Sorry, I accidently clicked on the button &apos;Request Feedback&apos; &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/sad.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;
Now the status has changed to &apos;Awaiting Feedback&apos;&lt;/p&gt;</comment>
                    <comment id="19226" author="beberlei" created="Sun, 6 Jan 2013 09:45:52 +0000"  >&lt;p&gt;Mark as improvement&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="14236">DDC-2150</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="14256">DDC-2160</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2185] Better explain DQL &quot;WITH&quot; and implications for the collection filtering API</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2185</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Available documentation is a bit thin regarding the &quot;WITH&quot; clause on JOIN expressions. Only a single example is provided in&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WITH seems to allow to only &quot;partially&quot; load a collection, so the collection in memory does not fully represent the associations available in the database.&lt;/p&gt;

&lt;p&gt;The resulting collection is marked as &quot;initialized&quot; and it seems there is no way to tell later on whether/how (with which expression) the collection has been initialized.&lt;/p&gt;

&lt;p&gt;When using the collection filtering API, the &quot;initialized&quot; flag on the collection will lead to in-memory processing. If a collection has been loaded WITH a restricting clause and another filter is applied later, results may not be what one might expect.&lt;/p&gt;

&lt;p&gt;I assume this is by design (no idea how the collection could be &quot;partially&quot; loaded and behave correctly under all conditions), so filing it as a documentation issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14291">DDC-2185</key>
            <summary>Better explain DQL &quot;WITH&quot; and implications for the collection filtering API</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="mpdude">Matthias Pigulla</reporter>
                        <labels>
                        <label>collection</label>
                        <label>documentation</label>
                        <label>dql</label>
                        <label>filtering</label>
                    </labels>
                <created>Tue, 4 Dec 2012 11:35:02 +0000</created>
                <updated>Mon, 17 Dec 2012 14:07:03 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19153" author="mpdude" created="Mon, 17 Dec 2012 14:07:03 +0000"  >&lt;p&gt;An additional observation:&lt;/p&gt;

&lt;p&gt;If you eager-load a collection using WITH, for the resulting entities that collection is marked as initialized as described above.&lt;/p&gt;

&lt;p&gt;Should you happen to come across the same entity during hydration in another (later) context where you explicitly eager load the same association &lt;b&gt;without&lt;/b&gt; the WITH restriction (or with another one), the collection on that (existing) entity won&apos;t be re-initialized and still contains the associated objects found during the first query.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2170] Decorator base classes for query related objects</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2170</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;tt&gt;Doctrine\ORM\Query&lt;/tt&gt; should not be directly extendable but it would be nice to decorate query objects and add additional methods. Use cases are e.g. doctrine-fun (see &lt;a href=&quot;https://github.com/lstrojny/doctrine-fun/blob/master/src/Doctrine/Fun/Query.php&quot; class=&quot;external-link&quot;&gt;https://github.com/lstrojny/doctrine-fun/blob/master/src/Doctrine/Fun/Query.php&lt;/a&gt;) or even cases where users want to add domain specific methods. As &lt;tt&gt;Doctrine\ORM\Query&lt;/tt&gt; is final it is not so easy to decorate correctly. I would propose:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Add a new interfaces: &lt;tt&gt;Doctrine\ORM\QueryInterface&lt;/tt&gt; that provides a contract for all methods &lt;tt&gt;Doctrine\ORM\Query&lt;/tt&gt; provides&lt;/li&gt;
	&lt;li&gt;Add a decorator base class &lt;tt&gt;Doctrine\ORM\QueryDecorator&lt;/tt&gt; as an extension point&lt;/li&gt;
	&lt;li&gt;Some for &lt;tt&gt;NativeQuery&lt;/tt&gt; and &lt;tt&gt;QueryBuilder&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14273">DDC-2170</key>
            <summary>Decorator base classes for query related objects</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="lstrojny">Lars Strojny</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Nov 2012 01:30:18 +0000</created>
                <updated>Mon, 26 Nov 2012 01:31:19 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19062" author="lstrojny" created="Mon, 26 Nov 2012 01:31:19 +0000"  >&lt;p&gt;Related:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/524&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/524&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/doctrine/common/pull/229&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/229&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2166] Improve Identifier hashing in IdentiyMap</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2166</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There are currently some drawbacks with identifier hashing:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;They only work on one level for derived keys&lt;/li&gt;
	&lt;li&gt;The code is suspect to high performance requirements&lt;/li&gt;
	&lt;li&gt;Composite Keys might be suspect to weird bugs if they contain spaces.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There is a PR by goetas (&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/232&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/232&lt;/a&gt;) that solves some issues, however adds a performance hit.&lt;/p&gt;

&lt;p&gt;We should move the conditional logic of this code out and use a strategy pattern to improve both performance and robustness of this code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14268">DDC-2166</key>
            <summary>Improve Identifier hashing in IdentiyMap</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 25 Nov 2012 13:38:29 +0000</created>
                <updated>Sun, 25 Nov 2012 13:38:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2154] Traits and Code Generation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2154</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;See &lt;a href=&quot;https://github.com/doctrine/DoctrineBundle/issues/106#issuecomment-10479116&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/DoctrineBundle/issues/106#issuecomment-10479116&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14242">DDC-2154</key>
            <summary>Traits and Code Generation</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 18 Nov 2012 13:11:41 +0000</created>
                <updated>Sun, 18 Nov 2012 13:11:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2141] Query should not be final</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2141</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The Query class should not be marked final as this makes it impossible to Mock it.&lt;/p&gt;
</description>
                <environment>All</environment>
            <key id="14219">DDC-2141</key>
            <summary>Query should not be final</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="tarjei">Tarjei Huse</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Nov 2012 09:59:23 +0000</created>
                <updated>Tue, 13 Nov 2012 09:59:23 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1099] Tutorial :: Getting started code sample entity manager</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1099</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;see pull request 24 on github.com&lt;/p&gt;</description>
                <environment></environment>
            <key id="12529">DDC-1099</key>
            <summary>Tutorial :: Getting started code sample entity manager</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Apr 2011 05:53:22 +0000</created>
                <updated>Mon, 11 Jul 2011 17:44:40 +0000</updated>
                                    <version>Git Master</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16148" author="mridgway" created="Mon, 11 Jul 2011 17:44:40 +0000"  >&lt;p&gt;This issue should be closed: &lt;a href=&quot;https://github.com/doctrine/orm-documentation/pull/24&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/orm-documentation/pull/24&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1088] Description for SequenceGenerator annotation options is wrong</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1088</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On paragraph 4.8.1.1 SequenceGenerator, the correct example should be:&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;br/&gt;
class User {&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Id&lt;/li&gt;
	&lt;li&gt;@GeneratedValue(strategy=&quot;SEQUENCE&quot;)&lt;/li&gt;
	&lt;li&gt;@SequenceGenerator(sequenceName=&quot;tablename_seq&quot;, initialValue=1, allocationSize=100)&lt;br/&gt;
     */&lt;br/&gt;
    protected $id = null;&lt;br/&gt;
}&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>N/A</environment>
            <key id="12514">DDC-1088</key>
            <summary>Description for SequenceGenerator annotation options is wrong</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="iksela">Alexandre Mathieu</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Mar 2011 04:55:17 +0000</created>
                <updated>Wed, 30 Mar 2011 04:55:17 +0000</updated>
                                    <version>2.x</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1089] Annotations reference examples are inaccurate and confusing</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1089</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In chapter 19 of the reference guide some coding examples seem to be inaccurate or incorrect. Especially when it comes to the bidirectional many-to-many associations, this might be confusing.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
The code fragment on &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-manytomany&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/annotations-reference.html#annref-manytomany&lt;/a&gt; has the following issues:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;it does not include class declarations although the collections associated are both mentioned. It should be clear to which target entity they belong and therefore their classes should be declared.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;from the context it seems that the associated classes should probably be User and Group, and the owning side is User. So the association should probably be inversed by &apos;users&apos;, although the example mentions &apos;features&apos;.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the mapping for the inverse side maps a collection called $features, although this should probably be $users. Also the class declaration for the Group class is missing.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Some other code fragments in chapter 19 have similar issues. I think they could easily be replaced by the examples from the earlier chapters, like for the bidirectional man-to-many association the example from chapter 5:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#many-to-many-bidirectional&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#many-to-many-bidirectional&lt;/a&gt;&lt;/p&gt;</description>
                <environment>N.A.</environment>
            <key id="12515">DDC-1089</key>
            <summary>Annotations reference examples are inaccurate and confusing</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="mvl">Maarten van Leeuwen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Mar 2011 05:38:14 +0000</created>
                <updated>Wed, 30 Mar 2011 06:00:37 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1072] Private property mapping can cause issues, suggest changing to protected</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1072</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The documentation recommends using private variables in entities. This can be problematic on entities with relations when using caching drivers as the proxy objects cannot access private variables and so the caching driver can throw notices like &lt;/p&gt;

&lt;p&gt;...apc_store(): &quot;_id&quot; returned as member variable from __sleep() but &lt;br/&gt;
does not exist in ... &lt;/p&gt;

&lt;p&gt;Making member variables protected resolves this issue when caching is enabled.&lt;/p&gt;

&lt;p&gt;This information would be helpful on the documentation so others can be made aware of this issue. We spent a few days trying to debug the issue before understanding exactly what was going on.&lt;/p&gt;</description>
                <environment>not applicable</environment>
            <key id="12474">DDC-1072</key>
            <summary>Private property mapping can cause issues, suggest changing to protected</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="kevbradwick">Kevin Bradwick</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Mar 2011 12:59:02 +0000</created>
                <updated>Thu, 17 Mar 2011 12:59:02 +0000</updated>
                                    <version>2.0.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1739] [GH-314] [WIP] Doctrine\Common metadata drivers reuse</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1739</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 Ocramius:&lt;/p&gt;

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

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

&lt;p&gt;This PR is strictly related with &lt;a href=&quot;https://github.com/doctrine/common/pull/98&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/98&lt;/a&gt; and tests won&apos;t pass until the doctrine-common submodule points to a merged version of it (will do so later, so &lt;b&gt;please don&apos;t merge now&lt;/b&gt; ).&lt;/p&gt;

&lt;p&gt;Basically, I just stripped any code duplicate of what already available in dcom master under Doctrine\Common\Persistence\Mapping\Driver.&lt;/p&gt;

&lt;p&gt;Tests are OK on my environment when using the new commons submodule.&lt;/p&gt;

&lt;p&gt;(This is a cleanup for #263, where I sadly did pull from the remote branch after rebasing)&lt;/p&gt;

&lt;p&gt;Tests are still failing.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13577">DDC-1739</key>
            <summary>[GH-314] [WIP] Doctrine\Common metadata drivers reuse</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 30 Mar 2012 16:10:32 +0000</created>
                <updated>Sat, 7 Apr 2012 07:21:02 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17678" author="beberlei" created="Fri, 30 Mar 2012 17:56:45 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17680" author="beberlei" created="Fri, 30 Mar 2012 19:37:27 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17684" author="beberlei" created="Fri, 30 Mar 2012 19:55:57 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17687" author="beberlei" created="Fri, 30 Mar 2012 20:01:01 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17710" author="beberlei" created="Sun, 1 Apr 2012 09:02:14 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17747" author="beberlei" created="Wed, 4 Apr 2012 19:59:02 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17792" author="beberlei" created="Fri, 6 Apr 2012 13:50:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17809" author="beberlei" created="Sat, 7 Apr 2012 07:21:02 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-314&amp;#93;&lt;/span&gt; was synchronize&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/314&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/314&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1732] Unserialized non-initialized proxy classes should throw an exception when a method is called</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1732</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When we serialize entities in a session, we often have pointers to uninitialized proxies.&lt;br/&gt;
These proxies have $_entityPersister == null.&lt;/p&gt;

&lt;p&gt;The problem is that if you happen to call by mistake a method on such a proxy, you&apos;re not aware that this is an uninitialized proxy, and the business methods are called, with null values for every property.&lt;/p&gt;

&lt;p&gt;I think the proxy should throw an exception in that case.&lt;br/&gt;
Attached, a patch with the proposed modification.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13568">DDC-1732</key>
            <summary>Unserialized non-initialized proxy classes should throw an exception when a method is called</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="benjamin">Benjamin Morel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Mar 2012 19:29:13 +0000</created>
                <updated>Wed, 28 Mar 2012 19:29:13 +0000</updated>
                                    <version>2.2</version>
                <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                                <attachments>
                    <attachment id="11173" name="ProxyFactory.php.patch" size="679" author="benjamin" created="Wed, 28 Mar 2012 19:29:13 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1728] There is no exact alternative function like MONTH in mysql </title>
                <link>http://doctrine-project.org/jira/browse/DDC-1728</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i am not able to extract only month from the date field using doctrine2 using &apos;MONTH&apos; function&lt;/p&gt;</description>
                <environment>Ubuntu 11.10</environment>
            <key id="13563">DDC-1728</key>
            <summary>There is no exact alternative function like MONTH in mysql </summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="sudheeshms1">Sudheesh MS</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Mar 2012 13:44:12 +0000</created>
                <updated>Tue, 27 Mar 2012 13:44:12 +0000</updated>
                                    <version>2.2.0-RC1</version>
                <version>2.2</version>
                <version>2.2.1</version>
                                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1721] LIKE clausule should accept functions on the pattern</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1721</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Example:&lt;br/&gt;
SELECT .... WHERE upper(n.title) LIKE upper(:filter)&lt;/p&gt;

&lt;p&gt;should be a valid SQL, now is rejected because the walker only accept a variable or an string expression.&lt;/p&gt;

&lt;p&gt;I&apos;m adding a patch to address this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13548">DDC-1721</key>
            <summary>LIKE clausule should accept functions on the pattern</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="ignaciolarranaga">Ignacio Larranaga</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Mar 2012 17:40:33 +0000</created>
                <updated>Thu, 24 Jan 2013 18:06:45 +0000</updated>
                                    <version>2.1.6</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17625" author="ignaciolarranaga" created="Wed, 21 Mar 2012 19:30:31 +0000"  >&lt;p&gt;Sorry the Parser has to be modified also to allow expressions to be recognized, I&apos;m attaching the necessary patch.&lt;/p&gt;</comment>
                    <comment id="17626" author="beberlei" created="Thu, 22 Mar 2012 19:31:32 +0000"  >&lt;p&gt;I am sure there is a reason why the walker doesn&apos;t accept this such as not all supported vendors allowing functions in right hand side LIKE expressions, but i am not sure about this.&lt;/p&gt;</comment>
                    <comment id="18764" author="darkangel" created="Wed, 3 Oct 2012 09:46:44 +0000"  >&lt;p&gt;This is not possible either:&lt;/p&gt;

&lt;p&gt;WHERE CASE WHEN p.name IS NULL THEN u.username ELSE p.name END LIKE :name&lt;/p&gt;</comment>
                    <comment id="19403" author="thomas303" created="Thu, 24 Jan 2013 18:06:45 +0000"  >&lt;p&gt;In my case it worked when using &quot;=&quot; instead of &quot;LIKE&quot;.&lt;/p&gt;

&lt;p&gt;//works:&lt;br/&gt;
(CASE WHEN (Book.id = BookFrom.id) THEN BookTo.displayName ELSE BookFrom.displayName END) = :name&lt;/p&gt;

&lt;p&gt;//&lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 1217: Error: Expected =, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, &amp;gt;, &amp;gt;=, !=, got &apos;LIKE&apos; &lt;br/&gt;
(CASE WHEN (Book.id = BookFrom.id) THEN BookTo.displayName ELSE BookFrom.displayName END) LIKE :name&lt;/p&gt;

&lt;p&gt;So the LIKE operator only needs to be allowed here.&lt;/p&gt;

&lt;p&gt;I&apos;m wondering which vendor should not be able to handle that:&lt;br/&gt;
The CASE WHEN ... THEN ... END is documented in DQL, and allowed.&lt;br/&gt;
LIKE itself is allowed.&lt;br/&gt;
If an RDBMs cannot use CASE WHEN and LIKE in combination, this would be a strange limitation.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11172" name="Parser.patch" size="847" author="ignaciolarranaga" created="Wed, 21 Mar 2012 19:30:31 +0000" />
                    <attachment id="11171" name="SqlWalker.patch" size="891" author="ignaciolarranaga" created="Wed, 21 Mar 2012 17:40:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1714] Prevent inverse side lazy loading owning side of the oneToOne relationsip if owning side&apos;s id is an assosiationKey of inversed side</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1714</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue was originally discussed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-357&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-357&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Say there is User and UserData with oneToOne bidirectional relationship. When we fetch User objects, UserData is lazy loaded right away. &lt;/p&gt;

&lt;p&gt;If we were to set UserData &apos;s id as asssosiationKey of User, then user_id becomes the id of UserData and User object can already know that UserData owning side&apos;s id will equal it&apos;s own User-&amp;gt;id.&lt;/p&gt;

&lt;p&gt;Can this be implemented?&lt;/p&gt;</description>
                <environment></environment>
            <key id="13540">DDC-1714</key>
            <summary>Prevent inverse side lazy loading owning side of the oneToOne relationsip if owning side&apos;s id is an assosiationKey of inversed side</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="dwalter">David</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Mar 2012 23:56:32 +0000</created>
                <updated>Sun, 18 Mar 2012 23:56:32 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1720] SqlWalter private variables should be protected to allow walker extensions</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1720</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m attaching a patch with the suggestion.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13547">DDC-1720</key>
            <summary>SqlWalter private variables should be protected to allow walker extensions</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="ignaciolarranaga">Ignacio Larranaga</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Mar 2012 16:44:52 +0000</created>
                <updated>Wed, 21 Mar 2012 16:45:25 +0000</updated>
                                    <version>2.1.6</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11170" name="SqlWalker.patch" size="2632" author="ignaciolarranaga" created="Wed, 21 Mar 2012 16:44:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1702] EBNF for IN expressions should be updated for 2.2</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1702</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Following the changes made for &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1472&quot; title=&quot;WHERE &amp;lt;&amp;lt;function&amp;gt;&amp;gt; IN ... doesn&amp;#39;t work&quot;&gt;&lt;del&gt;DDC-1472&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1416&quot; title=&quot;bug in simple test with sub query&quot;&gt;&lt;del&gt;DDC-1416&lt;/del&gt;&lt;/a&gt;, the EBNF for InExpression should have been updated. It now takes an ArithmeticExpression instead of a SingleValuePathExpression.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13525">DDC-1702</key>
            <summary>EBNF for IN expressions should be updated for 2.2</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="pschwisow">Patrick Schwisow</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Mar 2012 17:40:48 +0000</created>
                <updated>Tue, 13 Mar 2012 17:45:54 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17563" author="pschwisow" created="Tue, 13 Mar 2012 17:45:54 +0000"  >&lt;p&gt;I marked this as &quot;Major&quot; because this change represents a BC break.  Because EBNF was not updated, I initially believed this to be a bug in ORM and wasted a lot of time debugging Doctrine code before I discovered this change was intentional.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1681] loadRelated() - Method to efficiently load sets of related entities in &quot;sub&quot;-select strategies</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1681</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As per Request of Seldaek &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13496">DDC-1681</key>
            <summary>loadRelated() - Method to efficiently load sets of related entities in &quot;sub&quot;-select strategies</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Mar 2012 20:14:44 +0000</created>
                <updated>Mon, 5 Mar 2012 21:22:52 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17522" author="seldaek" created="Mon, 5 Mar 2012 20:43:09 +0000"  >&lt;p&gt;Sample:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$result = $queryBuilder-&amp;gt;select(&apos;a&apos;)-&amp;gt;from(&apos;User&apos;, &apos;a&apos;)-&amp;gt;getQuery()-&amp;gt;getResult();
$result-&amp;gt;loadRelated(&apos;roles&apos;); &lt;span class=&quot;code-comment&quot;&gt;// loads all a.roles&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Would be the equivalent of:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$result = $queryBuilder-&amp;gt;select(&apos;a, r&apos;)-&amp;gt;from(&apos;User&apos;, &apos;a&apos;)-&amp;gt;join(&apos;a.roles&apos;, &apos;r&apos;)-&amp;gt;getQuery()-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Except that the above does one simple query without join, then one WHERE IN query with all ids from the collection.&lt;br/&gt;
The latter obviously does a join and retrieves everything in one - more complex - query.&lt;/p&gt;

&lt;p&gt;Bonus points if you can loadRelated multiple relations at once.&lt;/p&gt;</comment>
                    <comment id="17523" author="stof" created="Mon, 5 Mar 2012 21:09:31 +0000"  >&lt;p&gt;I see an issue here: if you do a WHERE IN with the multiple ids, how do you know which entity the role is related to ?&lt;/p&gt;

&lt;p&gt;and btw, the interface you suggested above would require breaking the BC: ``$result`` is an array right now.&lt;/p&gt;</comment>
                    <comment id="17524" author="seldaek" created="Mon, 5 Mar 2012 21:15:47 +0000"  >&lt;p&gt;The interface is just an example mimicking the way it worked in D1, take it with a grain of salt.&lt;/p&gt;

&lt;p&gt;As for the implementation, if you assume the roles table has a user_id and role column, then you can do WHERE user_id IN (1, 2, 3) and you&apos;ll get back the user ids so you know where to attach them. It might still require some joining in some cases, but the point is to keep the joins out of the main query.&lt;/p&gt;</comment>
                    <comment id="17525" author="guilhermeblanco" created="Mon, 5 Mar 2012 21:22:52 +0000"  >&lt;p&gt;The one to be implemented would 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;$result = $queryBuilder-&amp;gt;select(&apos;a&apos;)-&amp;gt;from(&apos;User&apos;, &apos;a&apos;)-&amp;gt;getQuery()-&amp;gt;getResult();
$em-&amp;gt;loadRelated($result, &apos;roles&apos;); &lt;span class=&quot;code-comment&quot;&gt;// loads all a.roles&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason for that is not all the times you have a PersistentCollection. You may have an ArrayCollection too.&lt;br/&gt;
I just don&apos;t know yet how to handle array and ArrayCollection situations, since you may not know which class you&apos;re trying to fetch.&lt;br/&gt;
Maybe I can try to grab the first item of array and retrieve Association information from ClassMetadata retrieved via get_class on first item. That would solve the problem.&lt;/p&gt;

&lt;p&gt;Any other ideas, feel free to give me.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-265] Possibility for Nested Inheritance</title>
                <link>http://doctrine-project.org/jira/browse/DDC-265</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be great if Doctrine had the possibility to define a further inharitance in a subclass.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
There is a class DataObject managing things like created- and lastedit-&lt;br/&gt;
timestamps, archiving objects before updates, ...&lt;br/&gt;
One of the sub-objects is Content.&lt;br/&gt;
There are several types of content.&lt;br/&gt;
Written directly to a database field, read from a textfile on server,&lt;br/&gt;
executed php file on server, loaded from another server via xmlrpc and&lt;br/&gt;
so on. &lt;/p&gt;

&lt;p&gt;I&apos;d like to use a single table inheritance to map all information of&lt;br/&gt;
the different content objects in one table.&lt;br/&gt;
If I understand the model right the only alternate solution would be&lt;br/&gt;
to write each single content object to the discriminator map of&lt;br/&gt;
DataObject. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10756">DDC-265</key>
            <summary>Possibility for Nested Inheritance</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="quest">Michael F&#252;rmann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Jan 2010 06:27:37 +0000</created>
                <updated>Wed, 16 Jan 2013 08:16:23 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11437" author="beberlei" created="Thu, 21 Jan 2010 09:30:09 +0000"  >&lt;p&gt;The DataObject you describe is a no-go for Doctrine 2. Its just a very bad practice.&lt;/p&gt;

&lt;p&gt;Inheritance Mapping is for REAL inheritance only, otherwise you shouldnt go with a relational database in the first place.&lt;/p&gt;

&lt;p&gt;You should use the Event system for such changes, it offers you roughly the same possibilities and keeps you from having to use inheritance mapping. You could still create an abstract data object and define the fields that will be used in each &quot;implementation&quot; and then in events 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-keyword&quot;&gt;if&lt;/span&gt; ($entity &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; DataObject) {
     $entity-&amp;gt;updated();
     $archiver-&amp;gt;makeSnapshot($entity);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12380" author="jwage" created="Sat, 20 Mar 2010 01:54:15 +0000"  >&lt;p&gt;With this patch I think you could setup a nice similar model where you can introduce new children of this parent class and have it added to the discriminator map from the child instead of having to modify the parents mapping information.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-447&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-447&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="10399">DDC-138</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-586] Repo does not find &quot;unflushed&quot; object</title>
                <link>http://doctrine-project.org/jira/browse/DDC-586</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The problem is this:&lt;/p&gt;

&lt;p&gt;$bar = new \entity\content\ContentTag();&lt;br/&gt;
$bar-&amp;gt;setName(&apos;bar&apos;);&lt;br/&gt;
$em-&amp;gt;persist($bar);&lt;/p&gt;

&lt;p&gt;$existingTag = $em-&amp;gt;getRepository(&apos;entity\content\ContentTag&apos;)-&amp;gt;findOneByName(&apos;bar&apos;);&lt;/p&gt;

&lt;p&gt;Seeing as in EntityRepository &quot;find()&quot; queries the Unit of Work first, and &quot;findBy()&quot; goes directly to the persister, only remotely stored objects will be found. Now if I want a tag object to attach related tags, it would have to query by name to see if an object already exist, BUT it wont find one as the UoW has not been committed, resulting in a new one being created, ultimately resulting in a PDO error on the unique name constraint.&lt;/p&gt;

&lt;p&gt;This can be &quot;solved&quot; by inserting a flush, but it is impossible to know whether a flush is required, without knowledge of what comes next. I.e. for one part to know it has to flush, it has to know another wants to fetch an object you just created.&lt;/p&gt;

&lt;p&gt;This causes an unacceptable amount of coupling.&lt;/p&gt;

&lt;p&gt;Somehow the repo will have to be able execute DQL against the objects in the UoW.  This does not have to be full support (straight away), but it should fail (throw an exception) if the possibility exists that the UoW contains items that are excluded (e.g. the operation is not supported and the UoW still contains items).&lt;/p&gt;

&lt;p&gt;For right now, this means the EntityManager should throw an exception if DQL is executed on the type when the UoW is not empty. Until the time that the EntityManager can query the UoW using DQL. The alternative would be to &quot;flush&quot; before every operation that goes to the database for data.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11358">DDC-586</key>
            <summary>Repo does not find &quot;unflushed&quot; object</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="jkleijn">John Kleijn</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 May 2010 05:04:34 +0000</created>
                <updated>Thu, 26 Aug 2010 08:01:27 +0000</updated>
                                    <version>2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12946" author="romanb" created="Fri, 14 May 2010 07:04:31 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;you mention a good point, however, this currently only affects findBy queries made through a repository. A DQL query already triggers a flush when there are pending insertions but this still has its own problems. First of, querying against the objects in the UoW is not a viable solution in my eyes.&lt;/p&gt;

&lt;p&gt;For a regular find() (by identifier) the situation is clear anyway, you &lt;b&gt;must&lt;/b&gt; flush prior to a lookup on an entity you previously persisted in the same request because, by definition, generated primary key values are only guaranteed to be available after the next flush.&lt;/p&gt;

&lt;p&gt;Automatic flushing if the UoW has pending inserts (new objects) and a query is executed (either through DQL or a repository) currently has its own set of problems, namely that it is still subject to infinite recursion if such a query is triggered in an event (listener) that executes during commit of a UoW, and secondly, that it will easily lead to double-flushes that cause unnecessary overhead (currently a flush() even if nothing needs to be done is not free because the UoW actually has to check whether nothing needs to be done). Both of these problems could be addressed with some sort of flags, but the question still is whether its not better to flush manually in the first place.&lt;br/&gt;
That would mean, in your example, you should flush after persisting the new objects, irrespectively of what code comes next, you persisted (a) new object(s) and you want to make sure these are fully available to the rest of the script.&lt;/p&gt;</comment>
                    <comment id="12947" author="romanb" created="Fri, 14 May 2010 07:13:00 +0000"  >&lt;p&gt;Furthermore, automatic flushing when there is no transaction active is probably also not a great idea, as it may split a single unit of work (that was supposed to be atomic) into 2 without the user knowing about it. So auto-flushing should better only happen when a transaction is active (i.e. explicit transaction demarcation is used).&lt;/p&gt;</comment>
                    <comment id="12948" author="jkleijn" created="Fri, 14 May 2010 07:27:40 +0000"  >&lt;p&gt;That would mean, in every example, you should flush after persisting new objects, period. If I flush in some cases and not in others, I&apos;m asking for issues that may not be caught by tests. It&apos;s an inconsistency that I personally am not comfortable with.&lt;/p&gt;

&lt;p&gt;Could be that I&apos;m overlooking something, I&apos;ve just started playing with D2.&lt;/p&gt;

&lt;p&gt;Why is querying against registered objects not viable? It&apos;s not easy, granted, but it doesn&apos;t seem impossible. There should probably be a layer between the UoW and the &quot;persisters&quot; (Data Mappers?).&lt;/p&gt;

&lt;p&gt;RE: the UoW double flush: state management on the UoW as a whole should prevent that. i.e. after a commit the whole UoW is clean? Just a suggestion, as I said, still getting my bearings.&lt;/p&gt;

&lt;p&gt;On a side note I just want to say that what I&apos;ve seen so far, for the better part, pleases me greatly. Kudos.&lt;/p&gt;</comment>
                    <comment id="12949" author="romanb" created="Fri, 14 May 2010 08:16:03 +0000"  >&lt;p&gt;@&quot;That would mean, in every example, you should flush after persisting new objects, period.&quot;&lt;/p&gt;

&lt;p&gt;Yes, if you want the objects to be visible to queries in the same request. Generally, you should flush when you complete a unit of work and that is usually not the whole request (but can be).&lt;/p&gt;

&lt;p&gt;I don&apos;t want to &quot;query&quot; against registered objects because it is a) not easy b) likely a lot of code and c) very likely error-prone. And in addition I don&apos;t see this helping with solving any inconsistency. If you want to use find() you have to flush anyway because you can not find() without having the identifier in the first place, which is only available after a flush.&lt;/p&gt;

&lt;p&gt;@RE: the UoW double flush:&lt;/p&gt;

&lt;p&gt;Yes, like I said, it can be done but it is a compromise. Having a &quot;clean/dirty&quot; flag &lt;b&gt;in addition&lt;/b&gt; to calculating the changesets of the work to do (which implicitly tells us whether the UoW is dirty) adds more code and more potential for errors. Forget to update the flag in one location and you get flushes that don&apos;t do anything, because the flag was not updated. A dirty-flag for the UoW is not really required for proper working. It is similar to the approach of maintaining a separate counter for the number of elements in a collection implementation: can make many size/count requests faster but complicates the internal implementation and increases the likelihood for errors (and lock contention for the counter in a thread-safe/concurrent implementation, an interesting case where performance goes against scalability, but I digress and that does not apply to php obviously). That said, I am not strongly opposed to doing this.&lt;/p&gt;

&lt;p&gt;If you&apos;re interested in how this is specified by &quot;big brother&quot;, take a look at section 3.8.7 of the JPA 2 specification. Shortly, with the default behavior it requires the implementation to ensure that unflushed changes are visible to queries which can be achieved by flushing these to the database automatically but &lt;b&gt;only&lt;/b&gt; if a transaction is active, otherwise the implementation must not flush to the database. There is alternatively also a &quot;MANUAL&quot; flush mode, in that case the effect of updates made to entities in the UoW upon queries is unspecified. We do not have different flush modes anymore, however, in Doctrine.&lt;/p&gt;

&lt;p&gt;So I see two possible ways to go here:&lt;/p&gt;

&lt;p&gt;1) More effort, more code, (really better?)&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Maintaining a dirty flag in the UoW (this could be done anyway at some point, even if 2) is chosen)&lt;/li&gt;
	&lt;li&gt;Maintaining a flag to avoid infinite recursion triggered from events within a UoW commit/flush&lt;/li&gt;
	&lt;li&gt;Flushing automatically when querying while there are pending inserts &lt;b&gt;and a transaction is active&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;2) No effort, less code&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Removing the current auto-flush on DQL queries which is still subject to infinite recursion&lt;/li&gt;
	&lt;li&gt;No automatic flushes, anywhere (less magic, so to speak?)&lt;/li&gt;
	&lt;li&gt;Clearly documenting that new, unflushed entities are not visible in subsequent queries issued in the same request, and if this is desired, a flush should be issued.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;That&apos;s how I see it. Now we need some votes and volunteers for the implementation &lt;img class=&quot;emoticon&quot; src=&quot;http://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; Personally, I am not sure yet about which version I prefer, 2) does not sound too bad for me.&lt;/p&gt;
</comment>
                    <comment id="12950" author="romanb" created="Fri, 14 May 2010 08:20:18 +0000"  >&lt;p&gt;In Nr. 1) the case with the infinite recursion may actually be more problematic. I think you simply &lt;b&gt;can not see&lt;/b&gt; unflushed new objects in queries made &lt;b&gt;during&lt;/b&gt; a UoW commit.&lt;/p&gt;</comment>
                    <comment id="12956" author="jkleijn" created="Fri, 14 May 2010 10:47:17 +0000"  >&lt;p&gt;When there&apos;s no in-memory objects inclusion, I&apos;d say 2) as well. Again, I have no idea how this is implemented currently, but I would prefer something like this:&lt;/p&gt;

&lt;p&gt;$repo-&amp;gt;start();&lt;/p&gt;

&lt;p&gt;$repo-&amp;gt;register($object);&lt;/p&gt;

&lt;p&gt;$repo-&amp;gt;commit();&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Commit instead of flush: &quot;flush&quot; has little semantic value IMO, &quot;commit&quot; leaves no questions: you&apos;re committing your changes (which implies that they are not, before)&lt;/li&gt;
	&lt;li&gt;Operating on the repo leaves no question to what you are committing: changes of the associated type and relations configured to cascade, made after start()&lt;/li&gt;
	&lt;li&gt;Register instead of persist: &quot;persist&quot; is misleading as the object is not immediately persisted, and as my example shows, may not be.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The way I see it &quot;start&quot; would create a UoW associated with the repo, &quot;commit&quot; would calculate changes and write (the enitity manager would make sure references in other UoWs are removed).&lt;/p&gt;

&lt;p&gt;Because the way it is currently implemented (or so it seems), it&apos;s unclear when to flush and when not to flush, and unclear what I&apos;m flushing at any one point in the code (because it is not locally isolated). If I have to decide whether to flush in some bit of client code, I am apparently making an assumption about the target entity, i.e. coupling.&lt;/p&gt;

&lt;p&gt;I know, you already went beta, so it&apos;s unlikely you would consider such a large change, but anyway, for your consideration.&lt;/p&gt;

&lt;p&gt;Finally, I realize I&apos;m borderline nagging now as you&apos;ve made it clear you see nothing it, but a Repository (as in the PoEAA pattern, p 322) may provide a method of fetching native in-memory objects using criteria, acting as a &quot;buffer&quot; between code and database. The Repository in D2 does effectively nothing but delegate to the UoW (or mostly to the underlying persister). Ref PoEAA 327 for an example of an in-memory strategy. As a final point of critique, the Repository does not always seem to be used as entry point for data requests, which is the whole point of the pattern. Most of what&apos;s in EntityManager, should be in EntityRepository (&quot;manager&quot; is a bit to abstract a concept to expect clear responsibilities anyway). EntityManager::find() delegates to EntityRepository, but pretty much everything else is the other way around. EntityManager would be better off named DataGateway, as that accurately describes its intended function.&lt;/p&gt;

&lt;p&gt;I admit, it would be very difficult to use DQL on in memory objects, but it would be far superior and if it work lead to much more predictable behaviour. It&apos;s the ONLY way the data store is ever going to be truly transparent. A few examples (DQL from the docs):&lt;/p&gt;

&lt;p&gt;SELECT &lt;br/&gt;
u, &lt;br/&gt;
UPPER(u.name) nameUpper &lt;br/&gt;
FROM MyProject\Model\User u&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Fetch everything from the db&lt;/li&gt;
	&lt;li&gt;Select all objects from the User UoW&lt;/li&gt;
	&lt;li&gt;Iterate over the in memory ones and &lt;b&gt;modify&lt;/b&gt; the name property to upper case&lt;/li&gt;
	&lt;li&gt;Merge the results and return&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;SELECT u FROM User u WHERE u.id = ?1 OR u.nickname LIKE ?2 ORDER BY u.surname DESC&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Execute against database&lt;/li&gt;
	&lt;li&gt;Iterate over the User UoW, indexing by &quot;surname&quot;, adding items that match the criteria&lt;/li&gt;
	&lt;li&gt;Merge the results and return&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;With joins it could get more complex, provided you want to intelligently merge results into existing objects. Question is whether that is really needed, but there&apos;s obviously a performance benefit. Actually this may already be implemented.&lt;/p&gt;

&lt;p&gt;I suspect there are edge cases, rooted in DQL still being based on SQL, but in theory it should be possible. Likely you would still want to do start(), and delegate to the driver to start an actual transaction to prevent inconsistent reads... The only way to find out if it&apos;s truly feasible is to to try it, I think.&lt;/p&gt;

&lt;p&gt;Ramble, ramble, ramble, I&apos;m done. &lt;img class=&quot;emoticon&quot; src=&quot;http://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; I know I seem critical, but it&apos;s positive critique, I love the direction you went with D2.&lt;/p&gt;</comment>
                    <comment id="12957" author="romanb" created="Fri, 14 May 2010 11:26:45 +0000"  >&lt;p&gt;Maybe I was not clear, with approach Nr.1 there would be in-memory objects inclusion (of new objects), in fact, there always is, due to the identity map. When you query for objects and some of them are already in memory, these are used, not again reconstructed.&lt;/p&gt;

&lt;p&gt;The EntityRepository provided by Doctrine is just a convenient mechanism for writing your own repositories. There are many different understandings for what a repository is, you can make it whatever you want it to be. Is a PoEAA repository the same as a DDD repository? Anyway, the repository could be stripped of the project, it is optional, the state management is handled by the EntityManager and UnitOfWork. These are the core components. I agree that the delegation from EntityManager#find to the repository is suboptimal in this regard and should be the other way around.&lt;/p&gt;

&lt;p&gt;Now to your question: &quot;When should I flush?&quot;. Generally, you should flush at the end of a transaction, which in turn is a unit of work. That means, use explicit transaction demarcation. begin() ... flush() commit(). I&apos;ve added some control abstractions recently that should make this even easier. I can only recommend to explicitly demarcate your transaction boundaries. As you probably know, you can not talk to your database outside of a transaction anyway. The default behavior (flush() wrapping all its stuff in a transaction) is for convenience mostly and so as not to alienate or confuse people even more who are used to autocommit mode.&lt;/p&gt;

&lt;p&gt;Concerning the naming, we mostly stick with the JPA specification and I, for one, really like the naming and I don&apos;t want to invent new names. PoEAA is far more abstract (and the examples far too specific) than what is specified in JPA, so I recommend giving that a read. The patterns in PoEAA obviously and intentionally leave a lot of room for different variants of implementation and also leave open a lot of open questions (many of the difficult questions especially, it is for a reason that the author recommends using an existing tool instead of writing your own). In my opinion it is just not feasible to query in-memory objects in a generic way, all the examples in PoEAA do not have generic but rather concrete code examples, which is obviously a lot easier. The feasible strategy, and that is what we do, is to do in-memory lookups only when querying by PK, otherwise the query is executed and afterwards nevertheless any objects reused that are already in memory (based on the PK) and not reconstructed. This is the approach we use.&lt;/p&gt;

&lt;p&gt;Thanks for your input, I do see that you are an experienced fellow in object-relational persistence, maybe we can see you as a committer some day? &lt;img class=&quot;emoticon&quot; src=&quot;http://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="12958" author="romanb" created="Fri, 14 May 2010 11:35:43 +0000"  >&lt;p&gt;@ &quot;SELECT u, UPPER(u.name) nameUpper FROM MyProject\Model\User u&quot;&lt;/p&gt;

&lt;p&gt;This selects all users and their names in uppercase, the uppercase names are scalar values, the users are not modified! Scalar values are separate from objects.&lt;/p&gt;

&lt;p&gt;@ &quot;... and unclear what I&apos;m flushing at any one point in the code&quot;&lt;/p&gt;

&lt;p&gt;flush() means: Synchronize the in-memory state of my objects with the database, making any changes that are only in-memory persistent. Nothing more, nothing less.&lt;/p&gt;

&lt;p&gt;Again, objects are always reused based on the identity map and the state that is in-memory prevails, unless you use refresh() or execute a query with the Query::HINT_REFRESH query hint. All objects you fetch from DQL, be it as a root object or as a joined association, are first looked up in-memory (but after the SQL query has been issued!).&lt;/p&gt;

&lt;p&gt;Maybe we have been talking past each other here, what I refer to as not feasible is querying the in-memory objects first in some way, even before the SQL query. This is just too complicated and error-prone, except for the simple case of a PK lookup and that is where we do it already.&lt;/p&gt;</comment>
                    <comment id="12959" author="jkleijn" created="Fri, 14 May 2010 12:11:07 +0000"  >&lt;p&gt;&amp;gt; Scalar values are separate from objects.&lt;/p&gt;

&lt;p&gt;Right. Bad example.&lt;/p&gt;

&lt;p&gt;&amp;gt; flush() means: Synchronize the in-memory state of my objects with the database, making any changes that are only in-memory persistent. Nothing more, nothing less.&lt;/p&gt;

&lt;p&gt;I realize that it means that, but commit() would be more obvious.&lt;/p&gt;

&lt;p&gt;&amp;gt; Maybe we have been talking past each other here, what I refer to as not feasible is querying the in-memory objects first in some way, even before the SQL query. This is just too complicated and error-prone, except for the simple case of a PK lookup and that is where we do it already.&lt;/p&gt;

&lt;p&gt;Fair enough, you don&apos;t think it&apos;s feasible, so we&apos;ll keep it at that. Maybe I&apos;ll give it a shot some time.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-726] DQL should deal correctly with composite primary keys</title>
                <link>http://doctrine-project.org/jira/browse/DDC-726</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL should deal correctly with composite primary keys:&lt;/p&gt;

&lt;div class=&quot;code panel&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 FROM User u WHERE u.CompositeAssocEntity = ?1

Should be converted to:

SELECT ... FROM users u WHERE (u.cae_id1, u.cae_id2) = (?, ?) &lt;span class=&quot;code-comment&quot;&gt;// or something similar&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It  also supports IN expressions:&lt;/p&gt;

&lt;div class=&quot;code panel&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 FROM User u WHERE u.CompositeAssocEntity IN (?1, ?2)

Should be converted to:

SELECT ... FROM users u WHERE (u.cae_id1, u.cae_id2) IN ((?, ?), (?, ?)) &lt;span class=&quot;code-comment&quot;&gt;// or something similar&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;MySQL, SQLite and PgSQL works smoothly.&lt;br/&gt;
Need to check out MSSQL, Oracle and DB2.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11696">DDC-726</key>
            <summary>DQL should deal correctly with composite primary keys</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 30 Jul 2010 14:21:48 +0000</created>
                <updated>Tue, 4 Oct 2011 04:55:25 +0000</updated>
                                                                    <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                            <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12655">DDC-1162</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-687] Add New Entity Attribute &quot;idGetter&quot; to allow accessing the ID without triggering lazy-load</title>
                <link>http://doctrine-project.org/jira/browse/DDC-687</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Often people present us with the use-case that they want to access the ID of a proxy without loading it.&lt;/p&gt;

&lt;p&gt;This has lead to several ugly solutions like mapping the ID to an object and as a foreign key field. There currently exists a simple solution for 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;$id = $em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($entity-&amp;gt;getRelatedProxy());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However we could add a new property here called &quot;idGetter&quot; that would take the name of a method.&lt;/p&gt;

&lt;p&gt;During Proxy Generation then this method is created with magic functionality that:&lt;/p&gt;

&lt;p&gt;1. In case of Single Primary Key returns the single value&lt;br/&gt;
2. In case of Composite Primary Key returns an array of the values in their UoW internal order&lt;br/&gt;
3. Throw an Exception if the method does not exist on the original object&lt;/p&gt;</description>
                <environment></environment>
            <key id="11617">DDC-687</key>
            <summary>Add New Entity Attribute &quot;idGetter&quot; to allow accessing the ID without triggering lazy-load</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 15:00:21 +0000</created>
                <updated>Tue, 25 Jan 2011 08:23:14 +0000</updated>
                                    <version>2.0-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15183" author="stefanklug" created="Tue, 25 Jan 2011 07:26:53 +0000"  >&lt;p&gt;What about an @IdGetter annotation. A function instrumented like this would not trigger the lazy load within the proxy.&lt;/p&gt;

&lt;p&gt;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;class Entity {
    /** @Id **/
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

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

&lt;p&gt;would then result in the proxy implementation&lt;/p&gt;
&lt;div class=&quot;code panel&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 EntityProxy &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Entity {
  
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
        &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;__isInitialized__) {
            &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;_identifier;
         } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
             &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parent::getId();
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;After reading the original post I realized that it proposed nearly the same thing. Nevertheless I&apos;ll leave it here for clarity. I still think that an annotation on a function would be better, than an annotation which gets the function name as a parameter.&lt;/p&gt;

&lt;p&gt;Regards Stefan&lt;/p&gt;</comment>
                    <comment id="15184" author="beberlei" created="Tue, 25 Jan 2011 08:23:14 +0000"  >&lt;p&gt;$this-&amp;gt;_identifier is an array.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-688] Original Entity Data gets overridden by the change set</title>
                <link>http://doctrine-project.org/jira/browse/DDC-688</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When changing data in an entity, the UnitOfWork will call computeChangeSet on a flush event. If there is a changeset, the original data ($this-&amp;gt;_originalEntityData) gets overridden by the new data. However, the _originalEntityData should hold the original data, that was present at the time the entity was reconstituted from the database. This does no longer hold now.&lt;/p&gt;

&lt;p&gt;I think this can simply be fixed by commenting this line, however I do not know of any consequences this may bring with it:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;_originalEntityData&lt;span class=&quot;error&quot;&gt;&amp;#91;$oid&amp;#93;&lt;/span&gt; = $actualData; (in computeChangeSet, after if( $changeSet ));&lt;/p&gt;

&lt;p&gt;Anyway, I ran into this problem while trying to retrieve the original data at the onFlush event of an update.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6; PHP 5.3.2; MySQL 5.1.44</environment>
            <key id="11618">DDC-688</key>
            <summary>Original Entity Data gets overridden by the change set</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="jasper">Jasper Kuperus</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 17:42:36 +0000</created>
                <updated>Tue, 28 Dec 2010 06:38:22 +0000</updated>
                                    <version>2.0-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13855" author="romanb" created="Sun, 8 Aug 2010 09:17:56 +0000"  >&lt;p&gt;This is actually currently expected. You can not get access to the original data in the onFlush event right now. I&apos;m not saying that this will never be possible but it is simply the way it works at the moment.&lt;/p&gt;</comment>
                    <comment id="14937" author="jasper" created="Wed, 8 Dec 2010 18:11:56 +0000"  >&lt;p&gt;Does this mean that it is currently impossible to implement a Versionable mechanism using snapshots?&lt;/p&gt;</comment>
                    <comment id="14938" author="beberlei" created="Thu, 9 Dec 2010 03:44:31 +0000"  >&lt;p&gt;You can hold a map of them yourself if your listener also implements the &quot;postLoad&quot; event:&lt;/p&gt;

&lt;div class=&quot;code panel&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 = $args-&amp;gt;getentity();
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;originalData[spl_object_hash($entity)] = $args-&amp;gt;getEntityManager()-&amp;gt;getUnitOfWork()-&amp;gt;getOriginalData($entity);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15041" author="beberlei" created="Tue, 28 Dec 2010 06:38:22 +0000"  >&lt;p&gt;Changed into possible improvement for the future&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-683] EntityManager#lock() on unitialized proxy coudl be optimized</title>
                <link>http://doctrine-project.org/jira/browse/DDC-683</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you call lock() on an unitiialized proxy, it would be possible to combine the fetch and lock in one operation. Is this feasible from a technical / workflow perspsective?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11611">DDC-683</key>
            <summary>EntityManager#lock() on unitialized proxy coudl be optimized</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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 17:57:37 +0000</created>
                <updated>Wed, 21 Jul 2010 17:33:56 +0000</updated>
                                    <version>2.0-BETA2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13651" author="beberlei" created="Wed, 21 Jul 2010 17:33:56 +0000"  >&lt;p&gt;Ok this is what refresh() with LOCK support is actually needed for:&lt;/p&gt;

&lt;div class=&quot;code panel&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 lock($entity, $lockMode, $lockVersion = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getEntityState($entity) != self::STATE_MANAGED) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; InvalidArgumentException(&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity is not MANAGED.&quot;&lt;/span&gt;);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($entity &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Proxy &amp;amp;&amp;amp; $entity-&amp;gt;__isInitialized__) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;refresh(....); &lt;span class=&quot;code-comment&quot;&gt;// with LOCK!
&lt;/span&gt;        }
        ...
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11609">DDC-681</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-682] ORACLE CHARSET DOCUMENTATION</title>
                <link>http://doctrine-project.org/jira/browse/DDC-682</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Openning an Oracle Database with Doctrine and Symfony doesn&apos;t  support by default utf8 charset.&lt;/p&gt;

&lt;p&gt;To support it, it is necessary to specify charset=AL32UTF8 in the dsn of the database in config/databases.yml.  Analogous to the example shown at&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/d0d22145d8bdc83&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/d0d22145d8bdc83&lt;/a&gt;&lt;br/&gt;
however we have been able to use it fully only with the oracle driver (instead of oci), for example:&lt;/p&gt;

&lt;p&gt;oracle:dbname=//192.168.2.9:1521/nomina_dev;charset=AL32UTF8 &lt;/p&gt;

&lt;p&gt;Documentation by Alexia Vel&#225;squez (alexia.velasquez@hotmail.es, Vladimir T&#224;mara (vtamara@pasosdeJesus.org) and Fernando Guerrero &lt;/p&gt;</description>
                <environment>ORACLE  db  SYMFONY </environment>
            <key id="11610">DDC-682</key>
            <summary>ORACLE CHARSET DOCUMENTATION</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 13:55:31 +0000</created>
                <updated>Sat, 10 Jul 2010 13:55:31 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-678] OneToMany/OneToOne + onDelete=CASCADE may corrupt UoW.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-678</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;OneToMany/OneToOne associations together with an onDelete=CASCADE schema generation hint on the @JoinColumn and appropriate foreign key constraints can potentially result in a corrupt UoW if the associated objects are already managed. We need to add tests for such scenarios and settle on a well-defined behavior in such cases.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11606">DDC-678</key>
            <summary>OneToMany/OneToOne + onDelete=CASCADE may corrupt UoW.</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 10 Jul 2010 07:07:01 +0000</created>
                <updated>Sun, 5 Jun 2011 15:15:44 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14646" author="beberlei" created="Sun, 31 Oct 2010 07:18:22 +0000"  >&lt;p&gt;I think to preserve the semantics the following has to happen:&lt;/p&gt;

&lt;p&gt;&quot;on-delete&quot; =&amp;gt; &quot;cascade&quot; has to implicitly set cascade = remove. This hurts performance of course vs just using the on-delete, however it won&apos;t corrupt the UoW.&lt;/p&gt;</comment>
                    <comment id="15093" author="beberlei" created="Sun, 2 Jan 2011 05:21:14 +0000"  >&lt;p&gt;Not entirely would it hurt performance, you could check if on-delete =&amp;gt; cascade is set. If this is the case you wouldnt need to do an explicit remove using the UnitOfWorks cascade.&lt;/p&gt;</comment>
                    <comment id="15944" author="beberlei" created="Sun, 5 Jun 2011 15:15:44 +0000"  >&lt;p&gt;Changed to improvement&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-138] Allow for mixed inheritance mapping</title>
                <link>http://doctrine-project.org/jira/browse/DDC-138</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Requesting implementation of mixed inheritance mapping (class table inheritance and single table inheritance).&lt;/p&gt;

&lt;p&gt;This would be especially handy when the difference between certain classes is only &quot;implementational&quot; (i.e. a subclass only functions differently/implements abstract methods and does not specify any additional fields). Using class table inheritance would result in tables only containing an id column.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10399">DDC-138</key>
            <summary>Allow for mixed inheritance mapping</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="reinier.kip">Reinier Kip</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Nov 2009 15:55:19 +0000</created>
                <updated>Fri, 24 Dec 2010 04:54:34 +0000</updated>
                                                                    <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                            <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="10756">DDC-265</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2313] Deep clone for DBAL QueryBuilder</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2313</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This is basically a duplicate of another issue I stumbled across lately but cannot find here again. It added a __clone() function to the ORM QueryBuilder to allow this use case:&lt;br/&gt;
Create a base query and derive two different queries from it.&lt;/p&gt;

&lt;p&gt;I adopted the code for the DBAL QueryBuilder which is suffering the same issue (e.g. expressions were not cloned but shared between instances). The code is tested at least for my limited use case.&lt;/p&gt;


&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Deep clone of all expression objects in the SQL parts.&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@return void&lt;br/&gt;
     */&lt;br/&gt;
    public function __clone()&lt;br/&gt;
    {&lt;br/&gt;
        foreach ($this-&amp;gt;sqlParts as $part =&amp;gt; $elements) {&lt;br/&gt;
            if (is_array($this-&amp;gt;sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;$part&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
                foreach ($this-&amp;gt;sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;$part&amp;#93;&lt;/span&gt; as $idx =&amp;gt; $element) 
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {                    if (is_object($element)) {
                        $this-&amp;gt;sqlParts[$part][$idx] = clone $element;
                    }                }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;            } else if (is_object($elements)) &lt;/p&gt;
{
                $this-&amp;gt;sqlParts[$part] = clone $elements;
            }
&lt;p&gt;        }&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;        $params = array();&lt;/p&gt;

&lt;p&gt;        foreach ($this-&amp;gt;params as $param) &lt;/p&gt;
{
            $params[] = clone $param;
        }

&lt;p&gt;        $this-&amp;gt;params = $params;&lt;br/&gt;
    }&lt;/p&gt;</description>
                <environment></environment>
            <key id="14541">DDC-2313</key>
            <summary>Deep clone for DBAL QueryBuilder</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="tcm">Tim Mundt</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Feb 2013 22:33:34 +0000</created>
                <updated>Thu, 21 Feb 2013 22:33:34 +0000</updated>
                                    <version>2.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2321] DbDeploy Support</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2321</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;ul&gt;
	&lt;li&gt;DbDeploy Diff Generation&lt;/li&gt;
	&lt;li&gt;Schema Serialization&lt;/li&gt;
	&lt;li&gt;SchemaTool gets new event when diff is applied, then you can update a &quot;stable&quot; schema xml. On Generation new db deploy script, use current schema vs stable schema vom disc.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14640">DDC-2321</key>
            <summary>DbDeploy Support</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Wed, 27 Feb 2013 17:50:49 +0000</created>
                <updated>Wed, 27 Feb 2013 17:50:49 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1180] Indexed Associations: foreign key (association) cannot be used as indexBy field</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1180</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am trying to index a collection by its entity&apos;s column which is also a foreign key (association). It seems to me that it is not possible at the moment.&lt;/p&gt;

&lt;p&gt;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;/**
 * @Entity
 */
class Hotel
{

    &lt;span class=&quot;code-comment&quot;&gt;// $id column and other stuff
&lt;/span&gt;
    /**
     * @oneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Booking&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;hotel&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;room&quot;&lt;/span&gt;)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Booking[]
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $bookings;
}

/**
 * @Entity
 */
class Booking
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Hotel
     *
     * @Id 
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Hotel&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;bookings&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;hotel_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $hotel;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Room
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Room&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;room_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $room;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Only possible workaround I found is to define another (plain) entity&apos;s property mapped to the same table column and index by it:&lt;/p&gt;

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

    &lt;span class=&quot;code-comment&quot;&gt;// $id column and other stuff
&lt;/span&gt;
    /**
     * @oneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Booking&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;hotel&quot;&lt;/span&gt;, indexBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;roomId&quot;&lt;/span&gt;)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Booking[]
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $bookings;
}

/**
 * @Entity
 */
class Booking
{
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Room
     *
     * @Id
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Room&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;room_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $room;
    
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $roomId
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;room_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $roomId;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Wouldn&apos;t it be easy to support it?&lt;/p&gt;</description>
                <environment>Using Doctrine ORM 2.1.0BETA1</environment>
            <key id="12679">DDC-1180</key>
            <summary>Indexed Associations: foreign key (association) cannot be used as indexBy field</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="sobotka">Petr Sobotka</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 May 2011 21:44:28 +0000</created>
                <updated>Sat, 2 Mar 2013 12:24:58 +0000</updated>
                                    <version>2.1</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15921" author="beberlei" created="Sun, 5 Jun 2011 12:36:53 +0000"  >&lt;p&gt;It is not so easy to implement from the first gimplse and it is not a bug but an improvement/feature request.&lt;/p&gt;</comment>
                    <comment id="19792" author="benjamin" created="Sat, 2 Mar 2013 12:24:58 +0000"  >&lt;p&gt;Related PR: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/204&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/204&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2337] Allow an entity to use its own persister to take advantage of DB level features if necessary</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2337</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a situation where I wanted a single table to use INSERT DELAYED. Its an audit log table where I expect each http request to generate many inserts for. In an effort to not over tax the system I implemented a custom Entity Persister so that it would work. This obviously doesn&apos;t work with all mapping drivers. However if this is a feature that you think is worth integrating I will fork it on github and complete the implementation alongside any changes/improvements requested...&lt;/p&gt;</description>
                <environment></environment>
            <key id="14672">DDC-2337</key>
            <summary>Allow an entity to use its own persister to take advantage of DB level features if necessary</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="gnat">Nathanael Noblet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Mar 2013 20:17:54 +0000</created>
                <updated>Wed, 6 Mar 2013 20:17:54 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11511" name="persister.patch" size="4366" author="gnat" created="Wed, 6 Mar 2013 20:17:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2295] [GH-580] Second cache level POC</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2295</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 FabioBatSilva:&lt;/p&gt;

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

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

&lt;p&gt;Hi guys. &lt;img class=&quot;emoticon&quot; src=&quot;http://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;After a look into some implementations I end up with the following solution for the second level cache..&lt;/p&gt;

&lt;p&gt;There is lot of work todo before merge it, but i&apos;d like to get your thoughts before i go any further on this approach.&lt;br/&gt;
I hope my drafts are good enough to explain the idea :&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;Cache strategies&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;ul&gt;
	&lt;li&gt;READ_ONLY (DEFAULT)   : ReadOnly cache can do reads, inserts and deletes, cannot perform updates or employ any locks.&lt;/li&gt;
	&lt;li&gt;NONSTRICT_READ_WRITE  : Nonstrict Read Write Cache doesn&#8217;t employ any locks but can do reads, inserts , updates and deletes.&lt;/li&gt;
	&lt;li&gt;NONSTRICT_READ_WRITE  : Read Write cache employs locks the entity before update/delete.&lt;/li&gt;
&lt;/ul&gt;



&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;classes / interfaces&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;Region&lt;/b&gt;* :&lt;br/&gt;
    Defines a contract for accessing a entity/collection data cache. (Doesn&#8217;t employ any locks)&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;ConcurrentRegion&lt;/b&gt;* :&lt;br/&gt;
    Defines contract for concurrently managed data region. (Locks the data before update/delete.)&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;RegionAccess&lt;/b&gt;* :&lt;br/&gt;
    Defines a contract to access a cache region&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;ConcurrentRegionAccess&lt;/b&gt;* :&lt;br/&gt;
    Defines contract for regions which hold concurrently managed data.&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;CacheKey / EntityCacheKey / CollectionCacheKey/ QueryCacheKey&lt;/b&gt;*:&lt;br/&gt;
    Defines entity / collection key to be stored in the cache region.&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;EntityEntryStructure / CollectionEntryStructure&lt;/b&gt;*&lt;br/&gt;
    Build cache entries and rebuild entities/colection from cache&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
	&lt;li&gt;*&lt;b&gt;AccessProvider&lt;/b&gt;*&lt;br/&gt;
    Build RegionAccess based on entity / collection cache configuration&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Collection Caching&lt;/p&gt;




&lt;p&gt;The most common use case is to cache entities. But we can also cache relationships.&#160;&lt;br/&gt;
A &#8220;collection cache&#8221; caches the primary keys of entities that are members of a collection (OneToMany/ManyToMany).&#160;&lt;br/&gt;
and each element will be cached into its region.&lt;/p&gt;




&lt;p&gt;Only identifiers will be cached for collection. When a collection is read from the second level cache it will create proxies based on the cached identifiers, if the application needs to access an element, Doctrine will go to the cache to load the element data.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;OPERATIONS&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;



&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;INSERT :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;    *********************************************************************************************&lt;br/&gt;
    UnitOfWork#commit&lt;br/&gt;
        Connection#beginTransaction&lt;br/&gt;
        Persister#executeInserts&lt;br/&gt;
        Connection#commit&lt;br/&gt;
        Persister#afterTransactionComplete&lt;br/&gt;
            -&amp;gt; EntityRegionAccessStrategy#afterInsert&lt;br/&gt;
    *********************************************************************************************&lt;br/&gt;
    METHOD      | READ-ONLY             | NONSTRICT-READ-WRITE      | READ-WRITE                |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    afterInsert | add item to the cache | add item to the cache     | add item to the cache     |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;/p&gt;


&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;UPDATE :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;    *********************************************************************************************&lt;br/&gt;
    UnitOfWork#commit&lt;br/&gt;
        Connection#beginTransaction&lt;br/&gt;
        Persister#update&lt;br/&gt;
            -&amp;gt; TransactionalRegionAccess#lockItem&lt;br/&gt;
            -&amp;gt; execute&lt;br/&gt;
        Connection#commit&lt;br/&gt;
        Persister#afterTransactionComplete&lt;br/&gt;
            -&amp;gt; RegionAccess#afterUpdate&lt;br/&gt;
            -&amp;gt; TransactionalRegionAccess#unlockItem&lt;br/&gt;
    *********************************************************************************************&lt;br/&gt;
    METHOD      | READ-ONLY             | NONSTRICT-READ-WRITE      | READ-WRITE                |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    lockItem    |                       |                           | lock item                 |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    afterUpdate | throws exception      | update item cache         | update item cache         |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    unlockItem  |                       |                           | unlock item               |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;/p&gt;


&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;DELETE :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;    *********************************************************************************************&lt;br/&gt;
    UnitOfWork#commit&lt;br/&gt;
        Connection#beginTransaction&lt;br/&gt;
        Persister#delete&lt;br/&gt;
            -&amp;gt; TransactionalRegionAccess#lockItem&lt;br/&gt;
            -&amp;gt; execute&lt;br/&gt;
        Connection#commit&lt;br/&gt;
        Persister#afterTransactionComplete&lt;br/&gt;
            -&amp;gt; RegionAccess#evict&lt;br/&gt;
    *********************************************************************************************&lt;br/&gt;
    METHOD      | READ-ONLY             | NONSTRICT-READ-WRITE      | READ-WRITE                |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    lockItem    |                       |                           | lock item                 |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;br/&gt;
    evict       | remove item cache     | remove item cache         | remove item cache         |&lt;br/&gt;
    ---------------------------------------------------------------------------------------------&lt;/p&gt;


&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;USAGE :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
```php
&amp;lt;?php

/**
 * @Entity
 * @Cache(&lt;span class=&quot;code-quote&quot;&gt;&quot;NONSTRICT_READ_WRITE&quot;&lt;/span&gt;)
 */
class State
{
    /**
     * @Id
     * @GeneratedValue
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * @Column
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;
    /**
     * @Cache()
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Country&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;country_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $country;
    /**
     * @Cache()
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;City&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;state&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $cities;
}
```

```php
&amp;lt;?php

$em-&amp;gt;persist(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; State($name, $country));
$em-&amp;gt;flush();                                &lt;span class=&quot;code-comment&quot;&gt;// Put into cache
&lt;/span&gt;
$em-&amp;gt;clear();                                &lt;span class=&quot;code-comment&quot;&gt;// Clear entity manager
&lt;/span&gt;
$state   = $em-&amp;gt;find(&apos;Entity\State&apos;, 1);     &lt;span class=&quot;code-comment&quot;&gt;// Retreive item from cache
&lt;/span&gt;$country = $state-&amp;gt;getCountry();             &lt;span class=&quot;code-comment&quot;&gt;// Retreive item from cache
&lt;/span&gt;$cities  = $state-&amp;gt;getCities();              &lt;span class=&quot;code-comment&quot;&gt;// Load from database and put into cache
&lt;/span&gt;
$state-&amp;gt;setName(&lt;span class=&quot;code-quote&quot;&gt;&quot;New Name&quot;&lt;/span&gt;);
$em-&amp;gt;persist($state);
$em-&amp;gt;flush();                                &lt;span class=&quot;code-comment&quot;&gt;// Update item cache
&lt;/span&gt;
$em-&amp;gt;clear();                                &lt;span class=&quot;code-comment&quot;&gt;// Clear entity manager
&lt;/span&gt;
$em-&amp;gt;find(&apos;Entity\State&apos;, 1)-&amp;gt;getCities();   &lt;span class=&quot;code-comment&quot;&gt;// Retreive from cache
&lt;/span&gt;

$em-&amp;gt;getCache()-&amp;gt;containsEntity(&apos;Entity\State&apos;, $state-&amp;gt;getId())  &lt;span class=&quot;code-comment&quot;&gt;// Check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the cache exists
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictEntity(&apos;Entity\State&apos;, $state-&amp;gt;getId());    &lt;span class=&quot;code-comment&quot;&gt;// Remove an entity from cache
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictEntityRegion(&apos;Entity\State&apos;);               &lt;span class=&quot;code-comment&quot;&gt;// Remove all entities from cache
&lt;/span&gt;
$em-&amp;gt;getCache()-&amp;gt;containsCollection(&apos;Entity\State&apos;, &apos;cities&apos;, $state-&amp;gt;getId());   &lt;span class=&quot;code-comment&quot;&gt;// Check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the cache exists        
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictCollection(&apos;Entity\State&apos;, &apos;cities&apos;, $state-&amp;gt;getId());      &lt;span class=&quot;code-comment&quot;&gt;// Remove an entity collection from cache
&lt;/span&gt;$em-&amp;gt;getCache()-&amp;gt;evictCollectionRegion(&apos;Entity\State&apos;, &apos;cities&apos;);                 &lt;span class=&quot;code-comment&quot;&gt;// Remove all collections from cache
&lt;/span&gt;
```
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;TODO :&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
	&lt;li&gt;handle many to many collection&lt;/li&gt;
	&lt;li&gt;handle inheritance&lt;/li&gt;
	&lt;li&gt;remove/add colection items on update&lt;/li&gt;
	&lt;li&gt;improve region tests&lt;/li&gt;
	&lt;li&gt;improve access strategy tests&lt;/li&gt;
	&lt;li&gt;implement xml / yml / php drivers&lt;/li&gt;
	&lt;li&gt;implement transaction region&lt;/li&gt;
	&lt;li&gt;implement transaction  access strategy&lt;/li&gt;
	&lt;li&gt;.... ????&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14481">DDC-2295</key>
            <summary>[GH-580] Second cache level POC</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 14 Feb 2013 01:01:12 +0000</created>
                <updated>Thu, 14 Mar 2013 21:36:42 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2354] [GH-617] Wrong UnitOfWork::computeChangeSet()</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2354</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 fchris82:&lt;/p&gt;

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

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

&lt;p&gt;Sometimes some fields are Proxy when compute &quot;changeSet&quot;. If it is Proxy, some listeners - example Gedmo sortable listener - belive the value has changed and this leads to chaos.&lt;/p&gt;

&lt;p&gt;I check the $actualValue, if it is Proxy, the value didn&apos;t change.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14698">DDC-2354</key>
            <summary>[GH-617] Wrong UnitOfWork::computeChangeSet()</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 16 Mar 2013 16:18:27 +0000</created>
                <updated>Sat, 16 Mar 2013 16:18:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2351] Entity Listener vs. Event Listener</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2351</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Entity Listener and Event Listener don&apos;t get same events. An example is the onFlush event, which Entity Listener doesn&apos;t get. Why are both listeners receiving different events and not same events? &lt;/p&gt;

&lt;p&gt;For consistency I&apos;d like to see that both get same events - if I understand the purpose of Entity Listener correctly: it should be an alternative to Event Listener with same functionality but is bound to an entity. &lt;/p&gt;</description>
                <environment></environment>
            <key id="14695">DDC-2351</key>
            <summary>Entity Listener vs. Event Listener</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="fspillner">Fabian Spillner</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Mar 2013 08:30:12 +0000</created>
                <updated>Fri, 15 Mar 2013 08:45:49 +0000</updated>
                                    <version>Git Master</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19865" author="beberlei" created="Fri, 15 Mar 2013 08:45:49 +0000"  >&lt;p&gt;onFlush and postFlush should be propagated to entity listeners as well&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2352] [GH-615] Update SqlWalker.php</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2352</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 mikemeier:&lt;/p&gt;

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

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

&lt;p&gt;Always be sure that only a-z characters are used for table alias, otherwise use generic &quot;t&quot; for &quot;table&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14696">DDC-2352</key>
            <summary>[GH-615] Update SqlWalker.php</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 15 Mar 2013 12:53:47 +0000</created>
                <updated>Fri, 15 Mar 2013 12:53:47 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1858] LIKE and IS NULL operators not supported in HAVING clause</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1858</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The LIKE and IS NULL operators are not supported in HAVING clause.&lt;/p&gt;

&lt;p&gt;Work:&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu in (3,6)&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu = 3&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu &amp;gt;= 3&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;Don&apos;t work:&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu LIKE 3&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu IS NULL&lt;br/&gt;
SELECT _a.id, count(_photos) as uuuu FROM Acme\CoreBundle\Entity\Member _a LEFT JOIN _a.photos _photos GROUP BY _a HAVING uuuu IS NOT NULL&lt;/p&gt;</description>
                <environment>Win7, Mysql</environment>
            <key id="13760">DDC-1858</key>
            <summary>LIKE and IS NULL operators not supported in HAVING clause</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="abhoryo">PETIT Yoann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Jun 2012 20:04:14 +0000</created>
                <updated>Wed, 20 Mar 2013 16:01:11 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="18053" author="ocramius" created="Fri, 8 Jun 2012 07:00:39 +0000"  >&lt;p&gt;I think this has already been fixed in latest master and 2.1.7. Could you just give it a try and eventually confirm?&lt;/p&gt;</comment>
                    <comment id="18058" author="abhoryo" created="Fri, 8 Jun 2012 07:22:34 +0000"  >&lt;p&gt;Already try with 2.17, 2.20 and 2.2.2. This hasn&apos;t been fixed.&lt;/p&gt;</comment>
                    <comment id="18157" author="bdiang" created="Wed, 4 Jul 2012 08:07:03 +0000"  >&lt;p&gt;I&apos;m also having this issue (2.2.2). Is there any workaround for this?&lt;/p&gt;

&lt;p&gt;Column aliases also are not supported in HAVING clause:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb-&amp;gt;select(&apos;p&apos;, &apos;COUNT(p.field) as FieldCount&apos;)
            -&amp;gt;from(&apos;Entity&apos;, &apos;p&apos;)
            -&amp;gt;groupBy(&apos;p.id&apos;)
   -&amp;gt;having(&apos;FieldCount IS NULL&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Above code causes error &quot;FieldCount is not pointing to class&quot; and IS NULL causes &quot;Expected =, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, &amp;gt;, &amp;gt;=, !=, got &apos;IS&apos;&quot;&lt;/p&gt;</comment>
                    <comment id="18575" author="beberlei" created="Wed, 29 Aug 2012 12:59:35 +0000"  >&lt;p&gt;Its not a bug as the EBNF says that this is not possible.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=guilhermeblanco&quot; class=&quot;user-hover&quot; rel=&quot;guilhermeblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; Is this something we should support or not?&lt;/p&gt;</comment>
                    <comment id="18576" author="stof" created="Wed, 29 Aug 2012 13:06:17 +0000"  >&lt;p&gt;Another place where it is not supported is in the CASE clause.&lt;/p&gt;

&lt;p&gt;I would vote +1 for supporting it&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2363] Duplicated record with orphanRemoval and proxy</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2363</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There is a problem that causes duplicate records are created when EntityManager has to remove an entity due to orphanRemoval. The problem occurs only with a double flush and referred object is a proxy.&lt;/p&gt;

&lt;p&gt;I&apos;m trying to submit a pull request for this ticket. Please, stand by.&lt;/p&gt;</description>
                <environment>Tested both Mac OS X and Ubuntu</environment>
            <key id="14713">DDC-2363</key>
            <summary>Duplicated record with orphanRemoval and proxy</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="mmenozzi">Manuele Menozzi</reporter>
                        <labels>
                        <label>orphanRemoval</label>
                        <label>proxy</label>
                    </labels>
                <created>Fri, 22 Mar 2013 15:07:11 +0000</created>
                <updated>Fri, 22 Mar 2013 15:07:11 +0000</updated>
                                    <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2364] [GH-625] [DDC-2363] Duplicated record with orphanRemoval and proxy</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2364</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 mmenozzi:&lt;/p&gt;

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

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

&lt;p&gt;See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2363&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2363&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14714">DDC-2364</key>
            <summary>[GH-625] [DDC-2363] Duplicated record with orphanRemoval and proxy</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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>Fri, 22 Mar 2013 17:39:26 +0000</created>
                <updated>Fri, 22 Mar 2013 17:39:26 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2372] [GH-632] entity generator - ignore trait properties and methods</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2372</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 Padam87:&lt;/p&gt;

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

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

&lt;p&gt;Fixes:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1825&quot; title=&quot;generate entities with traits&quot;&gt;DDC-1825&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-2154&quot; title=&quot;Traits and Code Generation&quot;&gt;DDC-2154&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14728">DDC-2372</key>
            <summary>[GH-632] entity generator - ignore trait properties and methods</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 26 Mar 2013 19:54:23 +0000</created>
                <updated>Tue, 26 Mar 2013 19:54:23 +0000</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2210] PHP warning in ProxyFactory when renaming proxy file</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2210</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Getting a PHP Warning: &lt;/p&gt;

&lt;p&gt;&lt;tt&gt;rename(**&lt;b&gt;/models/Proxies&amp;#95;&lt;em&gt;CG&lt;/em&gt;&lt;em&gt;AF_Model_Component_Group.php.50d2dd2c079bb9.35271255,&lt;/b&gt;**/models/Proxies&amp;#95;_CG&lt;/em&gt;_AF_Model_Component_Group.php):&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;in &lt;tt&gt;ProxyFactory&lt;/tt&gt; line 194.&lt;/p&gt;

&lt;p&gt;I haven&apos;t more information in the warning.&lt;/p&gt;

&lt;p&gt;This is the moment when the ProxyFactory writes the proxy to a temporary file and then tries to rename the temp file to the correct file.&lt;/p&gt;

&lt;p&gt;This warning appears randomly, but mostly on pages with lots of concurrent AJAX requests. I guess this happens because several requests try to write the proxy file at the same time. I get this warning but the app works fine.&lt;/p&gt;

&lt;p&gt;This happens in dev environment, on a Windows machine.&lt;/p&gt;


&lt;p&gt;I don&apos;t know why rename generates a warning, it should just return false... The &lt;a href=&quot;http://fr2.php.net/manual/en/function.rename.php&quot; class=&quot;external-link&quot;&gt;doc&lt;/a&gt; doesn&apos;t say anything about warnings (except for long file names, but I checked even with the full path this is around 135 characters, not 255).&lt;/p&gt;</description>
                <environment>Windows</environment>
            <key id="14329">DDC-2210</key>
            <summary>PHP warning in ProxyFactory when renaming proxy file</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="mnapoli">Matthieu Napoli</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Dec 2012 10:02:50 +0000</created>
                <updated>Thu, 28 Mar 2013 15:51:48 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19171" author="beberlei" created="Sat, 22 Dec 2012 12:04:44 +0000"  >&lt;p&gt;Thats why you shouldn&apos;t generate proxies at runtime. The problem happens on windows, because the atomic rename operation doesn&apos;t work as perfectly there as on linux.&lt;/p&gt;

&lt;p&gt;We cannot fix this in Doctrine.&lt;/p&gt;</comment>
                    <comment id="19180" author="mnapoli" created="Mon, 24 Dec 2012 10:38:46 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt; What do you mean &quot;you shouldn&apos;t generate proxies at runtime&quot;? I&apos;m not in production, this is in dev. And I&apos;m using the default configuration.&lt;/p&gt;

&lt;p&gt;What I don&apos;t understand is why will Doctrine regenerate proxies on every request? The warning is reproductible, and even when no PHP entity has been touched.&lt;/p&gt;</comment>
                    <comment id="19183" author="mnapoli" created="Thu, 27 Dec 2012 13:44:22 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt; To simplify my previous message (I don&apos;t want to bury you under questions) I&apos;ll sum it up like that:&lt;/p&gt;

&lt;p&gt;What can I do?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="19772" author="mnapoli" created="Thu, 28 Feb 2013 13:03:37 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt; ping: what can be done?&lt;/p&gt;

&lt;p&gt;Can we suppress the error with &lt;tt&gt;@rename($tmpFileName, $fileName);&lt;/tt&gt; ?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L287&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L287&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can make a PR if you think that&apos;s a valid solution.&lt;/p&gt;</comment>
                    <comment id="19773" author="ocramius" created="Thu, 28 Feb 2013 13:06:43 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=matthieu&quot; class=&quot;user-hover&quot; rel=&quot;matthieu&quot;&gt;Matthieu Napoli&lt;/a&gt; no, if you have warnings, please disable them via ini setting. With error suppression there, we may have further problems identifying more serious issues.&lt;/p&gt;

&lt;p&gt;About proxy generation: that happens EVERY time in dev environments. Generate them once and disable it afterwards.&lt;/p&gt;</comment>
                    <comment id="19774" author="mnapoli" created="Thu, 28 Feb 2013 13:30:13 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=ocramius&quot; class=&quot;user-hover&quot; rel=&quot;ocramius&quot;&gt;Marco Pivetta&lt;/a&gt; OK I can disable the auto generation then (I&apos;ll have to remember to regenerate them when I edit the model).&lt;/p&gt;

&lt;p&gt;Thanks for the feedback&lt;/p&gt;

&lt;p&gt;Is that possible to make those proxies generate only if the entity file has been modified since the last generation? (only asking if can and should be done, I can look for implementing it myself if that&apos;s the case)&lt;/p&gt;</comment>
                    <comment id="19775" author="ocramius" created="Thu, 28 Feb 2013 13:33:19 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=mnapoli&quot; class=&quot;user-hover&quot; rel=&quot;mnapoli&quot;&gt;Matthieu Napoli&lt;/a&gt; that would be very obnoxious when changing entities often. I wouldn&apos;t do that (generating only if not already available)&lt;/p&gt;</comment>
                    <comment id="19776" author="mnapoli" created="Thu, 28 Feb 2013 13:57:38 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=ocramius&quot; class=&quot;user-hover&quot; rel=&quot;ocramius&quot;&gt;Marco Pivetta&lt;/a&gt; Yes but for now they are regenerated at every request when in dev mode (at least with the default configuration &lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html#obtaining-an-entitymanager&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html#obtaining-an-entitymanager&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Which one is worse: generating every proxy class at every request, or generate only those which changed (in dev environment of course, not prod)?&lt;/p&gt;

&lt;p&gt;If neither of these options are good (i.e. auto generation should be disabled), I don&apos;t understand why the docs say to enable auto generation when in dev environment.&lt;/p&gt;</comment>
                    <comment id="19777" author="ocramius" created="Thu, 28 Feb 2013 14:27:35 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=mnapoli&quot; class=&quot;user-hover&quot; rel=&quot;mnapoli&quot;&gt;Matthieu Napoli&lt;/a&gt; that&apos;s because in dev environments you shouldn&apos;t care about that one exception (usually happens when you got concurrent requests). &lt;/p&gt;

&lt;p&gt;It is worse to generate only on changes: that&apos;s a lot of additional checks, variables to keep in memory and additional logic that is not needed.&lt;/p&gt;

&lt;p&gt;Let&apos;s keep it as it is (generating at each request) for dev environments: works fine &lt;img class=&quot;emoticon&quot; src=&quot;http://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;Another (eventual) solution for dev environments would be not to write the proxy file, but to eval it.&lt;/p&gt;</comment>
                    <comment id="19782" author="mnapoli" created="Thu, 28 Feb 2013 15:19:31 +0000"  >&lt;p&gt;eval it would be a good solution IMO, no more &quot;woops the directory is not writable&quot; and it&apos;s more neutral for the user filesystem (but not as easy to debug). But OK, I see what you mean, it works let&apos;s keep it that way.&lt;/p&gt;

&lt;p&gt;Actually the problem on my setup is that PHP errors are turned into exceptions, so on an (poorly designed) AJAX treeview (lots of nodes to load =&amp;gt; lots of requests), I end up with some nodes not loaded because of the exception. And it feels weird to either silently log all PHP warnings or silently ignore the specific warning for the rename.&lt;/p&gt;</comment>
                    <comment id="19783" author="ocramius" created="Thu, 28 Feb 2013 15:26:37 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=mnapoli&quot; class=&quot;user-hover&quot; rel=&quot;mnapoli&quot;&gt;Matthieu Napoli&lt;/a&gt; I&apos;d go with `eval` then. Needs refactoring of the abstract proxy factory and of the proxy generator (proxy generator should no longer write files).&lt;/p&gt;</comment>
                    <comment id="19784" author="ocramius" created="Thu, 28 Feb 2013 15:28:30 +0000"  >&lt;p&gt;Re-opening: the proxy factory could directly `eval()` the produced proxy code. The ProxyGenerator should no longer write the generated files to disk automatically.&lt;/p&gt;</comment>
                    <comment id="19901" author="mnapoli" created="Thu, 28 Mar 2013 15:51:48 +0000"  >&lt;p&gt;I&apos;ve opened a PR: &lt;a href=&quot;https://github.com/doctrine/common/pull/269&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/269&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2385] [GH-640] [Paginator]Add hidden field ordering for postgresql</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2385</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 denkiryokuhatsuden:&lt;/p&gt;

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

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

&lt;p&gt;In postgresql environment, when some hidden fields are used in orderBy clause,&lt;br/&gt;
they&apos;re not property added because $rsm-&amp;gt;scalarMappings don&apos;t have information about them.&lt;/p&gt;

&lt;p&gt;This change fixes above.&lt;/p&gt;

&lt;p&gt;I&apos;m afraid I&apos;m not sure which branch this will be merged, but anyway here&apos;s a patch.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14750">DDC-2385</key>
            <summary>[GH-640] [Paginator]Add hidden field ordering for postgresql</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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 Apr 2013 10:01:27 +0000</created>
                <updated>Tue, 2 Apr 2013 10:01:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1605] No documentation about the usage of indexes with YAML and XML</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1605</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am missing documentation about how to handle indexes in YAML and XML definition files. I had to search in the code to learn how to do that.&lt;br/&gt;
Please add some documentation about it.&lt;/p&gt;

&lt;p&gt;This issue is related to #&lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-160&quot; title=&quot;Index annotation documentation&quot;&gt;&lt;del&gt;DDC-160&lt;/del&gt;&lt;/a&gt; where the reporter asked for documentation about indexes in annotation mapping.&lt;/p&gt;

&lt;p&gt;EDIT:&lt;br/&gt;
Maybe an example how I have done it with YAML would be helpful for others:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
User:
  type: entity
  fields:
    id:
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      generator:
        strategy: IDENTITY
    email:
      type: string
      length: 150
      unique: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    active:
      type: &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;
  indexes:
    indexActiveField: { name: idx_user_active, columns: [ active ] }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;indexActiveField&lt;/tt&gt; is the name of the index used by doctrine and &lt;tt&gt;idx_user_active&lt;/tt&gt; is the name of the index in the database. The rest should be clear.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13366">DDC-1605</key>
            <summary>No documentation about the usage of indexes with YAML and XML</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://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="naitsirch">Christian Stoller</reporter>
                        <labels>
                        <label>documentation</label>
                    </labels>
                <created>Mon, 16 Jan 2012 10:24:00 +0000</created>
                <updated>Mon, 8 Apr 2013 20:29:19 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18738" author="naitsirch" created="Thu, 27 Sep 2012 19:26:58 +0000"  >&lt;p&gt;Hi. I got an email notification that arbuscula has changed the status to &quot;Awaiting Feedback&quot;. Do you need any feedback from me?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2119] Problem with inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS </title>
                <link>http://doctrine-project.org/jira/browse/DDC-2119</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I tried to create inheritance entities with save policy table per class.&lt;br/&gt;
Simple fileds was created normally, but a field with ManyToOne type was lost.&lt;/p&gt;

&lt;p&gt;I had found a solution.&lt;/p&gt;

&lt;p&gt;In Doctrine\ORM\Tools\SchemaTool&lt;br/&gt;
...&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _gatherRelationsSql($class, $table, $schema)
    {
        foreach ($class-&amp;gt;associationMappings as $fieldName =&amp;gt; $mapping) {

           &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;])) { // - old version
&lt;/span&gt;
	/**
             * SSW
             * It&apos;s the solution
             */
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;]) &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeNone() &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeTablePerClass() ) {
                &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
            }            

            $foreignClass = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;targetEntity&apos;]);
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But it was enough. In DQL query a simple query was made wrong.&lt;/p&gt;

&lt;p&gt;I had found a solution again.&lt;br/&gt;
In Doctrine\ORM\Query\SqlWalker&lt;br/&gt;
...&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function walkSelectExpression($selectExpression)
...

                &lt;span class=&quot;code-comment&quot;&gt;// original =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;])){
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// It&apos;s the solution
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;]) &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeNone() &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeTablePerClass()) {
                    $tableName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;inherited&apos;])-&amp;gt;table[&apos;name&apos;];
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                    $tableName = $class-&amp;gt;table[&apos;name&apos;];
                }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This problems are topical for inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS. &lt;/p&gt;

&lt;p&gt;I don&apos;t know, may be my solutions are wrong. But some programmers want to correctly work with INHERITANCE_TYPE_TABLE_PER_CLASS.&lt;/p&gt;

&lt;p&gt;Sorry for my english.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14189">DDC-2119</key>
            <summary>Problem with inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS </summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sergsw">SergSW</reporter>
                        <labels>
                        <label>dql</label>
                        <label>schematool</label>
                    </labels>
                <created>Sat, 3 Nov 2012 18:57:00 +0000</created>
                <updated>Mon, 8 Apr 2013 20:43:37 +0000</updated>
                                    <version>2.1</version>
                                                <component>DQL</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18924" author="fabio.bat.silva" created="Mon, 5 Nov 2012 22:17:32 +0000"  >&lt;p&gt;Hi SergSW &lt;/p&gt;

&lt;p&gt;Could you try to write a failing test case ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18950" author="sergsw" created="Tue, 6 Nov 2012 23:55:43 +0000"  >&lt;p&gt;SSW/TestBundle with the problem&lt;/p&gt;</comment>
                    <comment id="18951" author="sergsw" created="Wed, 7 Nov 2012 00:06:03 +0000"  >&lt;p&gt;I install the Symfony v2.0.18. and made small TestBundle.&lt;br/&gt;
I made schema database, by CLI &quot;console doctrine:schema:update --force&quot;&lt;br/&gt;
Result: Database schema updated successfully!&lt;br/&gt;
But I saw that I lost a field &apos;user_id&apos; in a table &apos;AttachTree&apos; (see Attach)&lt;/p&gt;</comment>
                    <comment id="18952" author="sergsw" created="Wed, 7 Nov 2012 00:06:32 +0000"  >&lt;p&gt;MySQL dump&lt;/p&gt;</comment>
                    <comment id="18971" author="beberlei" created="Mon, 12 Nov 2012 14:33:25 +0000"  >&lt;p&gt;Adjusted example formatting, don&apos;t apologize for your English, thanks for the report!&lt;/p&gt;</comment>
                    <comment id="19176" author="beberlei" created="Mon, 24 Dec 2012 09:08:14 +0000"  >&lt;p&gt;What version of 2.1 are you using? We don&apos;t actually support 2.1 anymore. Inheritance has always worked as used in hundrets of unit-tests, this changes look quite major a bug to have been missed before. I can&apos;t really explain whats happening here.&lt;/p&gt;</comment>
                    <comment id="19371" author="ocramius" created="Wed, 23 Jan 2013 21:36:22 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=sergsw&quot; class=&quot;user-hover&quot; rel=&quot;sergsw&quot;&gt;SergSW&lt;/a&gt; news?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11345" name="dump.sql" size="4947" author="sergsw" created="Wed, 7 Nov 2012 00:06:32 +0000" />
                    <attachment id="11344" name="SSWTestBundle.rar" size="5526" author="sergsw" created="Tue, 6 Nov 2012 23:55:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2217] Return a lazy collection from PersistentCollection::match($criteria)</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2217</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In 2.3, &lt;tt&gt;PersistentCollection::match()&lt;/tt&gt; has been implemented by doing the query directly. But sometimes, the only meaningful information about the matched collection would be its length. In this case, it would be great to handle it in the same way than extra lazy collections are handled: the matched collection would be initialized lazily, and could do the count in an extra lazy way (if the original collection was extra lazy).&lt;br/&gt;
This would of course not change anything in the case where the original collection was already initialized.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14341">DDC-2217</key>
            <summary>Return a lazy collection from PersistentCollection::match($criteria)</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Dec 2012 14:13:33 +0000</created>
                <updated>Thu, 28 Mar 2013 23:59:52 +0000</updated>
                                                                            <due></due>
                    <votes>4</votes>
                        <watches>3</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2374] [GH-634] [WIP] Value objects</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2374</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 beberlei:&lt;/p&gt;

&lt;p&gt;  Url: &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;

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

&lt;p&gt;This pull request takes a different approach than GH-265 to implement ValueObjects. Instead of changing most of the code in every layer, we just inline embedded object class metadata into an entities metadata and then use a reflection proxy that looks like &quot;ReflectionProperty&quot; to do the rewiring.&lt;/p&gt;

&lt;p&gt;The idea is inspired from Symfony Forms &apos;property_path&apos; option, where you can write and read values to different parts of an object graph.&lt;/p&gt;

&lt;p&gt;This is a WIP, there have been no further tests made about the consequences of this approach. The implementation is up for discussion.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14731">DDC-2374</key>
            <summary>[GH-634] [WIP] Value objects</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 26 Mar 2013 23:13:41 +0000</created>
                <updated>Sun, 14 Apr 2013 10:18:46 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                            <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10295">DDC-93</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2213] Paginator does not work with composite primary key entity</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2213</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Paginator does not work with composed primary key.&lt;/p&gt;

&lt;p&gt;&quot;Single id is not allowed on composite primary key in entity&quot; exception is thrown here &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php#L90&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php#L90&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Only first column values are fetched while retrieving primary keys here&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/Paginator.php#L173&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/Paginator.php#L173&lt;/a&gt;&lt;/p&gt;</description>
                <environment>php 5.4</environment>
            <key id="14332">DDC-2213</key>
            <summary>Paginator does not work with composite primary key entity</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="thestanislav">Stanislav Anisimov</reporter>
                        <labels>
                        <label>composed</label>
                        <label>key</label>
                        <label>paginator</label>
                    </labels>
                <created>Tue, 25 Dec 2012 13:24:27 +0000</created>
                <updated>Wed, 23 Jan 2013 21:20:21 +0000</updated>
                                    <version>2.3.1</version>
                                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="19369" author="ocramius" created="Wed, 23 Jan 2013 21:20:21 +0000"  >&lt;p&gt;Limitation was confused by issue reporter and considered bug&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2401] INDEX BY not working on multiple columns</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2401</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;According to the docs on this page: &lt;br/&gt;
&lt;a href=&quot;http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#using-index-by&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#using-index-by&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following &quot;multi-dimensional index&quot; should be perfectly possible, with a default hydration mode:&lt;br/&gt;
SELECT b as business, p as product FROM Businesses b INDEX BY b.id JOIN Products p WITH b.id = p.businessid INDEX BY p.id&lt;/p&gt;

&lt;p&gt;However, b.id is completely ignored (it is a numeric primary key).&lt;/p&gt;

&lt;p&gt;I tried to go further, giving 2 products a matching barcode and indexing by barcode and then a (unique, numeric) productid. Only the barcode worked as a key and only one of the products with a matching barcode was selected. I used this query to test:&lt;br/&gt;
SELECT p FROM Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/p&gt;

&lt;p&gt;I also flagged the docs, because I don&apos;t think a userid should/could be starting from 0.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14784">DDC-2401</key>
            <summary>INDEX BY not working on multiple columns</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="quintenvk">Quintenvk</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Apr 2013 15:54:58 +0000</created>
                <updated>Thu, 18 Apr 2013 20:17:31 +0000</updated>
                                    <version>2.3.3</version>
                                                <component>Documentation</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20047" author="fabio.bat.silva" created="Thu, 18 Apr 2013 13:41:30 +0000"  >&lt;p&gt;Hi Quintenvk&lt;/p&gt;

&lt;p&gt;Could you please try to write a failing test case ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="20054" author="quintenvk" created="Thu, 18 Apr 2013 18:40:34 +0000"  >&lt;p&gt;I added a testcase. Please note that the database settings are to be configured in Core/simplys/simplys.php, and that the dump is in dummy.sql.&lt;/p&gt;

&lt;p&gt;Apart from that all should run well immediately.&lt;/p&gt;</comment>
                    <comment id="20055" author="quintenvk" created="Thu, 18 Apr 2013 18:42:02 +0000"  >&lt;p&gt;Fabio,&lt;/p&gt;

&lt;p&gt;Please check the zip I just attached. I hope this helps you in finding the problem.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Quinten&lt;/p&gt;</comment>
                    <comment id="20056" author="fabio.bat.silva" created="Thu, 18 Apr 2013 19:28:37 +0000"  >&lt;p&gt;Thanks Quintenvk,&lt;/p&gt;

&lt;div class=&quot;code panel&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 p.barcode, p.id, p.name FROM \core\Simplys\Entity\Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In this DQL you are trying to index by scalar values, &lt;br/&gt;
I think we does not support that, and a single dimensional array is the expected result in this case.&lt;/p&gt;

&lt;p&gt;Also the &lt;a href=&quot;http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#using-index-by&quot; class=&quot;external-link&quot;&gt;INDEX BY&lt;/a&gt; documentations seems wrong to me.&lt;/p&gt;


&lt;p&gt;The given 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 u.id, u.status, upper(u.name) nameUpper FROM User u INDEX BY u.idJOIN u.phonenumbers p INDEX BY p.phonenumber &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Show the following result :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;array
  0 =&amp;gt;
    array
      1 =&amp;gt;
        object(stdClass)[299]
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Doctrine\Tests\Models\CMS\CmsUser&apos; (length=33)
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;id&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1
          ..
      &apos;nameUpper&apos; =&amp;gt; string &apos;ROMANB&apos; (length=6)
  1 =&amp;gt;
    array
      2 =&amp;gt;
        object(stdClass)[298]
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Doctrine\Tests\Models\CMS\CmsUser&apos; (length=33)
          &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;id&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 2
          ...
      &apos;nameUpper&apos; =&amp;gt; string &apos;JWAGE&apos; (length=5)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which IMHO represents another DQL, 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; SELECT u, p , upper(u.name) nameUpper FROM User u INDEX BY u.id JOIN u.phonenumbers p INDEX BY p.phonenumber&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20057" author="quintenvk" created="Thu, 18 Apr 2013 19:34:33 +0000"  >&lt;p&gt;Thanks for your reply Fabio. &lt;br/&gt;
Do you think there could be alternatives (apart from a foreach-loop) to achieve the expected result?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Quinten&lt;/p&gt;</comment>
                    <comment id="20058" author="fabio.bat.silva" created="Thu, 18 Apr 2013 19:47:06 +0000"  >&lt;p&gt;Not sure if it&apos;s exactly the result you need but you can try &lt;/p&gt;

&lt;p&gt;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;SELECT p, b FROM \core\Simplys\Entity\Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or 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;SELECT PARTIAL p.{id, barcode, name}, b.{id, attributesYouNeed} FROM \core\Simplys\Entity\Products p INDEX BY p.barcode JOIN p.businessid b INDEX BY p.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And than :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$result = $query-&amp;gt;getArrayResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20059" author="quintenvk" created="Thu, 18 Apr 2013 19:58:55 +0000"  >&lt;p&gt;Both produce the same result as the query I had. I think i&apos;ll move on to loops after a bit more research, too bad it can&apos;t be done (at least for now) though... Would&apos;ve been nice.&lt;/p&gt;

&lt;p&gt;Thanks for your help though!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11524" name="Testcase.zip" size="2020276" author="quintenvk" created="Thu, 18 Apr 2013 18:40:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2405] Changing strategy generates bad query.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2405</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For (unit, acceptance, functional) testing purpose I need to change the strategy of my GameStuff Entity class.&lt;/p&gt;

&lt;p&gt;In previous version is was using php instruction below, but since doctrine orm 2.3, it doesn&apos;t work anymore.&lt;/p&gt;

&lt;p&gt;$orm-&amp;gt;getClassMetaData(&apos;Entities\GameStuff&apos;)-&amp;gt;setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);&lt;/p&gt;

&lt;p&gt;will trigger:&lt;/p&gt;

&lt;p&gt;Doctrine\DBAL\DBALException: An exception occurred while executing &apos;INSERT INTO vbank_accounts (game_id, updated_at, created_at) VALUES (?, ?, ?)&apos; with params &lt;/p&gt;
{&quot;1&quot;:1000010, &quot;2&quot;:0,&quot;3&quot;:&quot;2013-04-19 17:16:05&quot;,&quot;4&quot;:&quot;2013-04-19 17:16:05&quot;}
&lt;p&gt;:&lt;/p&gt;

&lt;p&gt;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&lt;/p&gt;</description>
                <environment></environment>
            <key id="14790">DDC-2405</key>
            <summary>Changing strategy generates bad query.</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://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="gedingun">Van Rotemberg</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Apr 2013 15:33:18 +0000</created>
                <updated>Sun, 21 Apr 2013 14:50:37 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="20070" author="beberlei" created="Sat, 20 Apr 2013 07:46:22 +0000"  >&lt;p&gt;The problem is that changing ClassMetadata after generating it from the cache is not really supported and depends on the Internal State of other classes. Have you tried creating a completly new EntityManager and then directly setting this? It could be that the SQL for the entity was already generated inside Doctrine, with the ID Generator information at IDENTITY_AUTO.&lt;/p&gt;</comment>
                    <comment id="20079" author="gedingun" created="Sun, 21 Apr 2013 11:29:49 +0000"  >&lt;p&gt;&amp;gt; The problem is that changing ClassMetadata after generating it from the cache is not really supported&lt;/p&gt;

&lt;p&gt;Yeah, it is a problem indeed, why set ticket status to resolved ?&lt;br/&gt;
Do you think it&apos;s normal to have a public method that trigger a fatal error ?&lt;/p&gt;

&lt;p&gt;Please fix it or put setIdGeneratorType as private, or AT LEAST add a context exception ...&lt;/p&gt;</comment>
                    <comment id="20080" author="ocramius" created="Sun, 21 Apr 2013 11:49:12 +0000"  >&lt;p&gt;Almost every interaction with metadata outside the `loadClassMetadata` event will cause unexpected problems. I don&apos;t think throwing an exception there helps in any way.&lt;/p&gt;</comment>
                    <comment id="20082" author="gedingun" created="Sun, 21 Apr 2013 14:49:26 +0000"  >&lt;p&gt;@marco pivetta&lt;/p&gt;

&lt;p&gt;The generation of the actual exception comes from DBALException on the query excetion and point a bad generated query (Invalid parameter number),&lt;br/&gt;
when the problem comes from setting ClassMetada, and concerns a problem of cache generated after loadClassMetadata.&lt;/p&gt;

&lt;p&gt;Adding an exception is just the fast way pointing where the problem comes from and that &quot;setting metadata after loadMetadata is not supported anymore&quot;. (It will spare developper&apos;s time that used to set metadata, but also help future contribution)&lt;/p&gt;

&lt;p&gt;&amp;gt; Please fix it or put setIdGeneratorType as private, or AT LEAST add a context exception ...&lt;br/&gt;
Note: BTW, my favorite solution would be to fix it (re-generate cache, or edit cache, or disable cache or whatever)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-776] Persisters use a fixed &quot;SELECT&quot; SQL statements</title>
                <link>http://doctrine-project.org/jira/browse/DDC-776</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am currently trying to work with BINARY columns with Doctrine 2 and MSSQL. In order to get my Entities working I had to create a custom Mapping Type for Binary columns. All went well in this case and I&apos;ve got it running.&lt;/p&gt;

&lt;p&gt;The problem arises when I am attempting to use Associative mapping (OneToOne/ManyToMany). The problem is, in order to do a select for an SQL column, I had to create a DQL function called &quot;CONVERT&quot; so that I use WHERE statements:&lt;/p&gt;

&lt;p&gt;            return $this-&amp;gt;createQueryBuilder(&apos;u&apos;)&lt;br/&gt;
                -&amp;gt;where(&quot;u.id = CONVERT(&apos;binary&apos;, :id, 1)&quot;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;id&apos;, $id)&lt;br/&gt;
                -&amp;gt;getQuery()&lt;br/&gt;
                -&amp;gt;getSingleResult();&lt;/p&gt;

&lt;p&gt;As you see, I must do this in order to get a result.&lt;/p&gt;

&lt;p&gt;However, when I&apos;m using associative mapping; this is what it does:&lt;/p&gt;

&lt;p&gt;        return &apos;SELECT &apos; . $this-&amp;gt;_getSelectColumnListSQL() &lt;br/&gt;
             . &apos; FROM &apos; . $this-&amp;gt;_class-&amp;gt;getQuotedTableName($this-&amp;gt;_platform) . &apos; &apos;&lt;br/&gt;
             . $this-&amp;gt;_getSQLTableAlias($this-&amp;gt;_class-&amp;gt;name)&lt;br/&gt;
             . $joinSql&lt;br/&gt;
             . ($conditionSql ? &apos; WHERE &apos; . $conditionSql : &apos;&apos;)&lt;br/&gt;
             . $orderBySql &lt;br/&gt;
             . $lockSql;&lt;/p&gt;

&lt;p&gt;As you can see, its some what hard coded and I cannot change it without changing the actual code in &lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister.php&lt;/p&gt;

&lt;p&gt;So, I would first like to know if there was maybe a way you could allow us to customize the SELECT statement that the persisters use - or maybe (though I&apos;m not sure how this will be done) make them use user-defined repository functions?&lt;/p&gt;

&lt;p&gt;Like $myRepo-&amp;gt;find($identifier)&lt;/p&gt;

&lt;p&gt;Not entirely sure if I explained this properly and I do realize my circumstance is highly odd - but this does seem like a limitation and because of this I cannot use associative mapping.&lt;/p&gt;</description>
                <environment>Windows 7, Apache 2.2, MSSQL Server, PHP 5.3.3</environment>
            <key id="11845">DDC-776</key>
            <summary>Persisters use a fixed &quot;SELECT&quot; SQL statements</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="aarondm">Aaron DM</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Aug 2010 13:52:27 +0000</created>
                <updated>Tue, 23 Apr 2013 12:09:39 +0000</updated>
                                    <version>2.0-BETA3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="20094" author="locs" created="Tue, 23 Apr 2013 12:09:39 +0000"  >&lt;p&gt;Hi, i try to make my custom type for binary field in MSSQL.&lt;br/&gt;
I don&apos;t find own, can you please show me your custom type binary?&lt;br/&gt;
Thks a lot.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1149] Optimize OneToMany and ManyToMany without join</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1149</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt;)
 */
class User {

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

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

    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Language&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;,fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $languages;

}

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_languages&quot;&lt;/span&gt;)
 */
class Language {

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

    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;languages&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $user;

    /**
     * @Column
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $user_id;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$users = $em-&amp;gt;getRepository(&apos;User&apos;)-&amp;gt;findAll();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Result:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT t0.user_id AS user_id1, t0.email AS email2 FROM users t0
SELECT t0.user_language_id AS user_language_id1, t0.user_id AS user_id2, t0.user_id AS user_id3 FROM user_languages t0 WHERE t0.user_id = ?
array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.user_language_id AS user_language_id1, t0.user_id AS user_id2, t0.user_id AS user_id3 FROM user_languages t0 WHERE t0.user_id = ?
array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.user_language_id AS user_language_id1, t0.user_id AS user_id2, t0.user_id AS user_id3 FROM user_languages t0 WHERE t0.user_id = ?
array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}

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

&lt;p&gt;Need result:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT t0.user_id AS user_id1, t0.email AS email2 FROM users t0
SELECT u0_.user_language_id AS user_language_id0, u0_.user_id AS user_id1, u0_.user_id AS user_id2 FROM user_languages u0_ WHERE u0_.user_id IN (1, 2, 3)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12634">DDC-1149</key>
            <summary>Optimize OneToMany and ManyToMany without join</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://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="morfi">Andrey Kolyshkin</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 May 2011 09:01:18 +0000</created>
                <updated>Sat, 30 Mar 2013 19:18:40 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>5</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="15827" author="beberlei" created="Thu, 12 May 2011 09:58:46 +0000"  >&lt;p&gt;Sure you are on git master? this should be optimized already with fetch=EAGER&lt;/p&gt;</comment>
                    <comment id="15828" author="morfi" created="Thu, 12 May 2011 11:15:22 +0000"  >&lt;p&gt;Attach test file&lt;/p&gt;

&lt;p&gt;I run&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;git clone git:&lt;span class=&quot;code-comment&quot;&gt;//github.com/doctrine/doctrine2.git
&lt;/span&gt;git clone git:&lt;span class=&quot;code-comment&quot;&gt;//github.com/doctrine/common.git
&lt;/span&gt;git clone git:&lt;span class=&quot;code-comment&quot;&gt;//github.com/doctrine/dbal.git&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and run testDoctrine.php&lt;/p&gt;

&lt;p&gt;Result&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
SELECT t0.user_id AS user_id1 FROM users t0

SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?

array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?

array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?

array(1) {
  [0]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt;
}
array(1) {
  [0]=&amp;gt;
  NULL
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16571" author="guilhermeblanco" created="Mon, 10 Oct 2011 17:44:07 +0000"  >&lt;p&gt;Please instead of using fetch=&quot;EAGER&quot;, please use fetch=&quot;EXTRA_LAZY&quot;. It would fix your issue.&lt;br/&gt;
I have successfully tested this situation in 2.2-DEV and it works like a charm. =)&lt;/p&gt;</comment>
                    <comment id="19895" author="fludimir" created="Mon, 25 Mar 2013 20:39:03 +0000"  >&lt;p&gt;Doctrine ORM 2.3.3  (Symfony2.2) - using LAZY or EXTRA_LAZY fetch mode there are only one query for:&lt;/p&gt;
 &lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$users = $em-&amp;gt;getRepository(&apos;User&apos;)-&amp;gt;findAll();&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but additional &lt;b&gt;users_count&lt;/b&gt; queries for&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;foreach($users as $user) $user-&amp;gt;languages-&amp;gt;toArray()&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And if use fetch EAGER - for some reason there are &lt;b&gt;2 x users_count&lt;/b&gt; queries , ie each query&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT t0.post_id AS post_id1, t0.user_id AS user_id2 FROM posts t0 WHERE t0.user_id = ?&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;with unique user_id executed twice&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10991" name="testDoctrine.php" size="1544" author="morfi" created="Thu, 12 May 2011 11:15:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1940] Doctrine DQL: erroneous sql generation from dql join with &quot;WITH&quot; or &quot;WHERE&quot; clause</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1940</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m having big troubles while developing a quietly advanced DQL query for a tiny DMS: The schema: DmsObject is a superclass for which two subclasses exist (document and folder) UserRights and GroupRight (which are associative entities in the db, pointing respectively to user and group tables). User and Group represent (obvious) the dms &quot;actors&quot;.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
SELECT o, ur, gr 
from module\EDMS\business\DmsObject o 
join o.userRights ur 
join o.groupRights gr
WHERE o.ownerUser=ur.user
AND o.ownerGroup=gr.group
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The WHERE condition is WRONG! Doctrine switches the two tables. I&apos;ve already checked the mapping (it&apos;s ok!) and checked also where the fk&apos;s point in the database (ok!).&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
...
LEFT JOIN dms_folder d1_ 
    ON d0_.id = d1_.id 
LEFT JOIN dms_document d2_ 
    ON d0_.id = d2_.id 
INNER JOIN dms_user_object_rights d3_ 
    ON d0_.id = d3_.document_id 
INNER JOIN dms_group_object_rights d4_ 
    ON d0_.id = d4_.document_id 
WHERE d0_.sys_group_owner = d3_.user_id 
    AND d0_.sys_user_owner = d4_.group_id
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This seems to be a bug in the DQL translator.&lt;/p&gt;</description>
                <environment>LAMP, debian squeeze</environment>
            <key id="13875">DDC-1940</key>
            <summary>Doctrine DQL: erroneous sql generation from dql join with &quot;WITH&quot; or &quot;WHERE&quot; clause</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="noise085">Enea Bette</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Jul 2012 11:38:08 +0000</created>
                <updated>Sun, 14 Apr 2013 15:27:06 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>7</watches>
                        <comments>
                    <comment id="18406" author="beberlei" created="Sun, 29 Jul 2012 09:33:35 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=noise085&quot; class=&quot;user-hover&quot; rel=&quot;noise085&quot;&gt;Enea Bette&lt;/a&gt; Can you attach the entities (stripped down to the fields we need here)?&lt;/p&gt;

&lt;p&gt;Can you check guilherme? This looks really weird.&lt;/p&gt;

&lt;p&gt;It should 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;
WHERE d0_.sys_user_owner = d3_.user_id AND d0_.sys_group_owner = d4_.group_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="18412" author="guilhermeblanco" created="Sun, 29 Jul 2012 15:49:59 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=noise085&quot; class=&quot;user-hover&quot; rel=&quot;noise085&quot;&gt;Enea Bette&lt;/a&gt; Can you please provide your entities?&lt;br/&gt;
I can try to reproduce the issue, but I need your entities as a base for a failing unit test.&lt;/p&gt;</comment>
                    <comment id="19982" author="hugohenrique" created="Thu, 11 Apr 2013 19:19:22 +0000"  >&lt;p&gt;I&apos;m having a similar problem with the query:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT um, p FROM Ciwwic\AppBundle\Entity\Provider p LEFT JOIN Ciwwic\UserBundle\Entity\UserMeta um WITH um.user = p.id WHERE p.id = 30&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When you run this query DQL she returns an empty array. &lt;br/&gt;
I getting solve my problem by adding WHERE clauses example as:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT p, um FROM Ciwwic\AppBundle\Entity\Provider p LEFT JOIN Ciwwic\UserBundle\Entity\UserMeta um WHERE p.id = 30 AND um.user = 30&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20011" author="fabio.bat.silva" created="Sun, 14 Apr 2013 15:27:06 +0000"  >&lt;p&gt;Hi Enea&lt;/p&gt;

&lt;p&gt;If i got it correctly&lt;br/&gt;
Your associations &lt;b&gt;DmsObject#ownerUser&lt;/b&gt; and &lt;b&gt;DmsObject#ownerGroup&lt;/b&gt; are flipped.&lt;br/&gt;
Note that &lt;b&gt;ownerUser&lt;/b&gt; points to &lt;b&gt;sys_group_owner&lt;/b&gt; and &lt;b&gt;ownerGroup&lt;/b&gt; to &lt;b&gt;sys_user_owner&lt;/b&gt;&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\User&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_group_owner&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;ID&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $ownerUser;
/**
 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\Group&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_user_owner&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;ID&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $ownerGroup;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It should 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;/**
 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\User&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_user_owner&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;ID&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $ownerUser;

/**
 * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;library\system\business\Group&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
 * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sys_group_owner&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;ID&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $ownerGroup;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="14374">DDC-2235</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="11213" name="Entities.rar" size="6730" author="noise085" created="Mon, 30 Jul 2012 07:06:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2420] [GH-656] [DDC-2235] Fix for using a LEFT JOIN onto an entity with single table inheritance</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2420</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 tarnfeld:&lt;/p&gt;

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

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

&lt;p&gt;Possible fix for the bug &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-2235&quot; title=&quot;Single table inheritance discriminator in WHERE when using arbitrary join syntax&quot;&gt;&lt;del&gt;DDC-2235&lt;/del&gt;&lt;/a&gt;. I&apos;d love to hear some opinions on whether this is the right way to go about this issue. I&apos;m not particularly familiar with the internals of doctrine so there may be a better solution.&lt;/p&gt;

&lt;p&gt;------&lt;/p&gt;

&lt;p&gt;The issue is when using DQL to perform a left join on an entity using single&lt;br/&gt;
table inheritance, doctrine tries to insert an `IN()` predicate into the `WHERE`&lt;br/&gt;
clause for all of the discriminator values. That makes sense and is valid, so&lt;br/&gt;
it would be wrong to remove that behaviour.&lt;/p&gt;

&lt;p&gt;However when using a &lt;b&gt;left&lt;/b&gt; join having an `IN()` in the main where clause makes&lt;br/&gt;
the `LEFT JOIN` pretty much useless, as it implicitly creates a `WHERE NOT NULL`&lt;br/&gt;
clause. This commit attempts to fix that by including an `OR IS NULL` in the&lt;br/&gt;
query if the join is a `LEFT JOIN`.&lt;/p&gt;

&lt;p&gt;I&apos;ve added some regression tests to ensure this bug never creeps back in. They fail on master (highlighting the bug) and pass after these commits have been applied. I&apos;ve also included a couple of other queries as tests to be sure only this one case has been affected.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14817">DDC-2420</key>
            <summary>[GH-656] [DDC-2235] Fix for using a LEFT JOIN onto an entity with single table inheritance</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Apr 2013 23:09:35 +0000</created>
                <updated>Sun, 28 Apr 2013 23:09:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2406] Merging of new detached entities with PrePersist lifecycle callback breaks</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2406</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Merging of new detached entities with PrePersist lifecycle callback breaks:&lt;/p&gt;

&lt;p&gt;Code snippet:&lt;/p&gt;
&lt;div class=&quot;code panel&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 A
    {
       /**
        *  @ORM\ManyToOne(targetEntity= ...
        *  @ORM\JoinColumn(name=&quot; ...
        */
        &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $b;
        
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getB()
        {
            &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;b;
        }
        
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setB($b)
        {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b = $b;
        }
        
        /**
         *
         * @ORM\PrePersist
         *
         * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
         */
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function onPrePersist()
        {
           &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;getB() === &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(&apos;B instance must be defined);
           }
           ....
        }
    }
    
    class B 
    {
    }
    
    $a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; A();
    $b = $em-&amp;gt;find(&apos;B&apos;, 1);
    $a-&amp;gt;setB($b);
    $em-&amp;gt;persist($a); &lt;span class=&quot;code-comment&quot;&gt;// works fine as B instance is set
&lt;/span&gt;    $em-&amp;gt;detach($a);
    
    $a = $em-&amp;gt;merge($a) &lt;span class=&quot;code-comment&quot;&gt;// breaks in onPrePersist&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason it happens is that the merge operation is trying to persist a new entity created by uow::newInstance($class) without populating its properties first:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
 &lt;span class=&quot;code-comment&quot;&gt;// If there is no ID, it is actually NEW.
&lt;/span&gt;    ....
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $id) {
        $managedCopy = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;newInstance($class);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;persistNew($class, $managedCopy);
    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	....
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This should happen first for the $managedCopy:&lt;/p&gt;
&lt;div class=&quot;code panel&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;// Merge state of $entity into existing (managed) entity
&lt;/span&gt;    foreach ($class-&amp;gt;reflClass-&amp;gt;getProperties() as $prop) {
        ....
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14791">DDC-2406</key>
            <summary>Merging of new detached entities with PrePersist lifecycle callback breaks</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="deatheriam">Oleg Namaka</reporter>
                        <labels>
                        <label>merge,</label>
                        <label>prePersist</label>
                    </labels>
                <created>Fri, 19 Apr 2013 17:01:32 +0000</created>
                <updated>Wed, 1 May 2013 12:24:53 +0000</updated>
                                    <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="20123" author="fabio.bat.silva" created="Sun, 28 Apr 2013 20:57:08 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=beberlei&quot; class=&quot;user-hover&quot; rel=&quot;beberlei&quot;&gt;Benjamin Eberlei&lt;/a&gt;, Is this an expected behavior ?&lt;/p&gt;

&lt;p&gt;I mean.. This issue is about dispatch the event before copy the original values into the managed instance. &lt;br/&gt;
But overall, should &lt;b&gt;$em-&amp;gt;detach()&lt;/b&gt; trigger &lt;b&gt;@PrePersist&lt;/b&gt; events ?&lt;/p&gt;</comment>
                    <comment id="20137" author="beberlei" created="Wed, 1 May 2013 08:48:08 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=fabio.bat.silva&quot; class=&quot;user-hover&quot; rel=&quot;fabio.bat.silva&quot;&gt;Fabio B. Silva&lt;/a&gt; he talks about $em-&amp;gt;merge() on a detached entity calling pre persist. This should only happen on a NEW entity, not on a DETACHED one.&lt;/p&gt;</comment>
                    <comment id="20146" author="deatheriam" created="Wed, 1 May 2013 12:22:24 +0000"  >&lt;p&gt;I tend to disagree with the statement above about pre persist that should not happen on a detached entity being merged back in. If this event handler contains a business logic that this entity needs to be checked against and the detached entity was modified before the merge operation in a way that invalidates it in the prePersist than I will end up with the invalid entity in the identity map. If the merge operation calls persist it must run the prePersist event handler as well for consistency.&lt;/p&gt;

&lt;p&gt;If there is a logic that prevents persisting invalid entities why should it bypassed in the merge operation?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2078] [GH-479] [WIP][Mapping] Ported some of the yaml driver to use Symfony config</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2078</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 kimhemsoe:&lt;/p&gt;

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

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

&lt;p&gt;Looking for some input. How much validation and normailization should i push to the configuration ? Should i use default values so we can remove alot of lines from the driver ?&lt;/p&gt;

&lt;p&gt;Is the way im allowing to extend the configuration good enough for Gedmo and others (untested)?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14128">DDC-2078</key>
            <summary>[GH-479] [WIP][Mapping] Ported some of the yaml driver to use Symfony config</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 14 Oct 2012 23:46:55 +0000</created>
                <updated>Wed, 1 May 2013 12:57:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-349] Add support for specifying precedence in joins in DQL</title>
                <link>http://doctrine-project.org/jira/browse/DDC-349</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This request is in followup to my doctrine-user message &quot;Doctrine 2.0: Nested joins&apos;.&lt;br/&gt;
I am a bit surprised by the responses in that defining precedences in joins by placing parenthesis around join expressions is not well-known. Although not in the original SQL92 specification it is a major and important feature offered by all the RDBMS&apos;s that Doctrine 2 supports, and oftenly performs better than using subselects or alike. Doctrine 1 did not support it, but imho Doctrine 2 should support it to be a mature allround ORM.&lt;/p&gt;

&lt;p&gt;As a short example the following is a SQL statement with a nested join, where the nesting is absolutely necessary to return only a&apos;s together with either both b&apos;s and c&apos;s or no b&apos;s and c&apos;s at all:&lt;/p&gt;

&lt;p&gt;SELECT *&lt;br/&gt;
  FROM a A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    b B&lt;br/&gt;
    INNER JOIN c C ON C.b_id = B.id&lt;br/&gt;
  ) ON B.a_id = A.id&lt;/p&gt;

&lt;p&gt;In order for Doctrine 2 to support this the BNF should be something like:&lt;br/&gt;
Join ::= [&quot;LEFT&quot; &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;OUTER&amp;quot;&amp;#93;&lt;/span&gt; | &quot;INNER&quot;] &quot;JOIN&quot; ( &quot;(&quot; JoinAssociationPathExpression &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;AS&amp;quot;&amp;#93;&lt;/span&gt; AliasIdentificationVariable Join &quot;)&quot; | JoinAssociationPathExpression &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;AS&amp;quot;&amp;#93;&lt;/span&gt; AliasIdentificationVariable ) &lt;span class=&quot;error&quot;&gt;&amp;#91;(&amp;quot;ON&amp;quot; | &amp;quot;WITH&amp;quot;) ConditionalExpression&amp;#93;&lt;/span&gt;&lt;br/&gt;
instead of the current:&lt;br/&gt;
Join ::= [&quot;LEFT&quot; &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;OUTER&amp;quot;&amp;#93;&lt;/span&gt; | &quot;INNER&quot;] &quot;JOIN&quot; JoinAssociationPathExpression &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;AS&amp;quot;&amp;#93;&lt;/span&gt; AliasIdentificationVariable &lt;span class=&quot;error&quot;&gt;&amp;#91;(&amp;quot;ON&amp;quot; | &amp;quot;WITH&amp;quot;) ConditionalExpression&amp;#93;&lt;/span&gt; &lt;/p&gt;

&lt;p&gt;This would allow DQL like:&lt;/p&gt;

&lt;p&gt;SELECT A, B, C&lt;br/&gt;
  FROM a A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    A.b B&lt;br/&gt;
    INNER JOIN B.c C&lt;br/&gt;
  ) WITH B.something = &apos;value&apos; AND C.something = &apos;othervalue&apos;&lt;/p&gt;

&lt;p&gt;What further needs to be done is that the DQL parser loosly couples the ConditionalExpression to any of the previously parsed JoinAssociationPathExpression&apos;s instead of tieing it explicitely to the JoinAssociationPathExpression that preceedes it according to the old BNF notation. The new BNF should however not require any changes to the hydrator. Therefore I have the feeling that improving the DQL parser for nested joins does not require extensive work, while the benefit of running these kind of queries is considerable.&lt;/p&gt;

&lt;p&gt;As an extra substantiation here are links to (BNF) FROM clause documentations of the RDBMS&apos;s that Doctrine 2 supports, they all show support for nested joins:&lt;br/&gt;
MySQL: &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/join.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/join.html&lt;/a&gt;&lt;br/&gt;
PostgreSQL: &lt;a href=&quot;http://www.postgresql.org/docs/8.4/interactive/sql-select.html#SQL-FROM&quot; class=&quot;external-link&quot;&gt;http://www.postgresql.org/docs/8.4/interactive/sql-select.html#SQL-FROM&lt;/a&gt; and &lt;a href=&quot;http://www.postgresql.org/docs/8.1/interactive/explicit-joins.html&quot; class=&quot;external-link&quot;&gt;http://www.postgresql.org/docs/8.1/interactive/explicit-joins.html&lt;/a&gt;&lt;br/&gt;
MSSQL: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms177634.aspx&quot; class=&quot;external-link&quot;&gt;http://msdn.microsoft.com/en-us/library/ms177634.aspx&lt;/a&gt;&lt;br/&gt;
Oracle: &lt;a href=&quot;http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_10002.htm#CHDDCHGF&quot; class=&quot;external-link&quot;&gt;http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_10002.htm#CHDDCHGF&lt;/a&gt;&lt;br/&gt;
SQLite: &lt;a href=&quot;http://www.sqlite.org/syntaxdiagrams.html#single-source&quot; class=&quot;external-link&quot;&gt;http://www.sqlite.org/syntaxdiagrams.html#single-source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I surely hope you will consider implementing this improvement because it would save me and others from the hassle of writing raw SQL queries or executing multiple (thus slow) queries in DQL for doing the same. Thanks anyway for the great product so far!&lt;/p&gt;</description>
                <environment></environment>
            <key id="10915">DDC-349</key>
            <summary>Add support for specifying precedence in joins in DQL</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="dennis.verspuij">Dennis Verspuij</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Feb 2010 09:52:45 +0000</created>
                <updated>Wed, 1 May 2013 18:46:53 +0000</updated>
                                    <version>2.0-ALPHA4</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12650" author="guilhermeblanco" created="Tue, 13 Apr 2010 00:04:10 +0000"  >&lt;p&gt;This seems to be a valid issue to me.&lt;/p&gt;

&lt;p&gt;This implementation is the actual solution to associations retrieval that are inherited (type joined).&lt;/p&gt;

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

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

class Foo &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base {}

class Bar {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $foo;
}

&lt;span class=&quot;code-comment&quot;&gt;// This causes the CTI to link as INNER JOIN, which makes the result become 0
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// il &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; you have no Foo&apos;s defined (although it should ignore &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;)
&lt;/span&gt;$q = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;SELECT b, f FROM Bar b LEFT JOIN b.foo f&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12654" author="romanb" created="Tue, 13 Apr 2010 04:40:05 +0000"  >&lt;p&gt;Yes, this is a possible solution for &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-512&quot; title=&quot;LEFT JOIN of extended null entity cause empty result [testcase included]&quot;&gt;&lt;del&gt;DDC-512&lt;/del&gt;&lt;/a&gt; but on the &lt;b&gt;SQL level&lt;/b&gt;. I still don&apos;t see this as appropriate for DQL, it just doesnt make sense to me, DQL joins object associations, there is no precedence.&lt;/p&gt;</comment>
                    <comment id="12656" author="romanb" created="Tue, 13 Apr 2010 05:46:00 +0000"  >&lt;p&gt;So, no, this has nothing to do with &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-512&quot; title=&quot;LEFT JOIN of extended null entity cause empty result [testcase included]&quot;&gt;&lt;del&gt;DDC-512&lt;/del&gt;&lt;/a&gt;. &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-512&quot; title=&quot;LEFT JOIN of extended null entity cause empty result [testcase included]&quot;&gt;&lt;del&gt;DDC-512&lt;/del&gt;&lt;/a&gt; can even be fixed differently as outlined in my comments there.&lt;/p&gt;</comment>
                    <comment id="12657" author="romanb" created="Tue, 13 Apr 2010 05:52:20 +0000"  >&lt;p&gt;On a side note I would still like to know/see the following for this issue:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Some realisitic DQL examples where this feature would be essential, i.e. there is no other way to do it.&lt;br/&gt;
   This also means explaining what the impact on the resulting object graph is and why it makes sense.&lt;/li&gt;
	&lt;li&gt;Which other ORMs support this on the OQL/Criteria level?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So far, my stance on this issue is:&lt;/p&gt;

&lt;p&gt; 1) It doesnt make sense (semantically) in DQL&lt;br/&gt;
 2) Its rarely needed&lt;br/&gt;
 3) When you really need it you can use a NativeQuery anyway and use this nesting in SQL, where it probably belongs and makes more sense&lt;br/&gt;
 4) It would (unnecessarily) complicate DQL&lt;/p&gt;

&lt;p&gt;Thus I am currently leaning towards &quot;Wont fix&quot; for this issue.&lt;/p&gt;</comment>
                    <comment id="12662" author="dennis.verspuij" created="Tue, 13 Apr 2010 13:53:13 +0000"  >&lt;p&gt;Hi Roman. I understand your doubts, and I have been breaking my head over&lt;br/&gt;
creating a realistic example the last few hours that would hopefully convince&lt;br/&gt;
you for implementing this feature. But actually I cannot find one that you wouldn&apos;t&lt;br/&gt;
consider to be trivial. I do have a number of very complex optimized queries written&lt;br/&gt;
for sportskickoff dot com (using Doctrine 1.2) but they are probably hard to understand&lt;br/&gt;
because they may not be selfdescribing. Below is one example literally ripped from&lt;br/&gt;
the application. Still they often can be broken down to my example query in this&lt;br/&gt;
ticket&apos;s description, but applied grouping, additional other joins on the root component&lt;br/&gt;
and/or other criteria made them impossible to rewrite using subselects or choosing&lt;br/&gt;
another root component. Most often they just performed way best using the nested&lt;br/&gt;
syntax and saved me a number of additional queries.&lt;/p&gt;

&lt;p&gt;SELECT A.id, A.username, A.balance, COALESCE(SUM(B.stake), 0) AS sumstake, COUNT(B.id) AS nrbets&lt;br/&gt;
FROM account A&lt;br/&gt;
LEFT JOIN (&lt;br/&gt;
  bet B&lt;br/&gt;
  INNER JOIN game G ON G.id = :GAMEID AND B.timestampcompletion BETWEEN G.timestampstart AND G.timestampend&lt;br/&gt;
) ON B.accountid = A.id AND B.timestampcompletion IS NOT NULL&lt;br/&gt;
WHERE A.Status &amp;amp; :ACTIVEORDISQUALIFIED = :ACTIVE&lt;br/&gt;
GROUP BY A.id, A.username, A.balance&lt;br/&gt;
ORDER BY A.balance DESC, sumstake ASC, nrbets ASC, A.username ASC&lt;/p&gt;

&lt;p&gt;But let&apos;s put it another way. I would also like this feature to be supported in DQL&lt;br/&gt;
because I just do not want to use native queries. Why would I want to use native&lt;br/&gt;
queries if it can be done using DQL? In DQL I work with class names and field&lt;br/&gt;
names, and they may differ from the underlying table and column names. Doctrine&lt;br/&gt;
takes care of that mapping based on my schema/annotations and I do not&lt;br/&gt;
have to &quot;know&quot; these mappings. In native queries I suddenly do have to &quot;know&quot;&lt;br/&gt;
these mappings. I use Doctrine because it makes my application portable and&lt;br/&gt;
enables me to work with my database in an OOP way like I do in my model,&lt;br/&gt;
abstracting things. The need for native queries partly reverts the benefits Doctrine&lt;br/&gt;
offers in the first place.&lt;/p&gt;

&lt;p&gt;Btw, I recall to have successfully used the nested join syntax in HQL (.NET Hibernate)&lt;br/&gt;
but I cannot find examples on the web or a BNF notation.&lt;/p&gt;

&lt;p&gt;Furthermore, in reply to your stances:&lt;br/&gt;
1) It indeed doesnt make sense (semantically) in DQL, it only makes the result&lt;br/&gt;
  set different, but not the way data is hydrated into objects;&lt;br/&gt;
2) Its indeed rarely needed for inserting, updating and populating basic lists but&lt;br/&gt;
  it allows you to better select what combinations of associated rows are joined&lt;br/&gt;
  and which not in more optimized queries without having to use native queries,&lt;br/&gt;
  or because they perform better than using subseletcs and alike.&lt;br/&gt;
3) Not having to use native queries is just an extra reason for using Doctrine and&lt;br/&gt;
  maintains the abstraction the ORM provides througout on&apos;es whole application&lt;br/&gt;
4) Why would it complicate DQL, if people do not know about or understand&lt;br/&gt;
  the feature it wouldn&apos;t matter because not using parenthesises is the default&lt;br/&gt;
  way to specify joins?&lt;/p&gt;

&lt;p&gt;Well, this is it, can&apos;t find any more words to promote and make you enthusiastic.... lol.&lt;/p&gt;</comment>
                    <comment id="12663" author="dennis.verspuij" created="Tue, 13 Apr 2010 17:48:39 +0000"  >&lt;p&gt;Ok, I have not given up yet... &lt;img class=&quot;emoticon&quot; src=&quot;http://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;, here&apos;s a &quot;stupid&quot; example.&lt;/p&gt;

&lt;p&gt;Imagine a book store that sells books of various authors and keeps track of those sales.&lt;br/&gt;
Let&apos;s say you would have an admin page that lists all authors, and for each author&lt;br/&gt;
its also shows the books and their sales dates since january 1st, but only for those&lt;br/&gt;
books that were actually sold and contain an A in its name. An optimized SQL query&lt;br/&gt;
to fetch all the information at once would be something like:&lt;/p&gt;

&lt;p&gt;SELECT A.&lt;b&gt;, B.&lt;/b&gt;, S.*&lt;br/&gt;
  FROM author A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    book B&lt;br/&gt;
    INNER JOIN sale S ON S.book_id = B.id AND S.dt &amp;gt;= &apos;2010-01-01&apos;&lt;br/&gt;
  ) ON B.author_id = A.id AND A.name LIKE &apos;%A%&apos;&lt;/p&gt;

&lt;p&gt;In DQL it would then be something like:&lt;/p&gt;

&lt;p&gt;SELECT A.&lt;b&gt;, B.&lt;/b&gt;, S.*&lt;br/&gt;
  FROM author A&lt;br/&gt;
  LEFT JOIN (&lt;br/&gt;
    book B&lt;br/&gt;
    INNER JOIN sale S WITH S.dt &amp;gt;= &apos;2010-01-01&apos;&lt;br/&gt;
  ) WITH A.name LIKE &apos;%A%&apos;&lt;/p&gt;

&lt;p&gt;If the database would contain thousands of books, but sales for just a&lt;br/&gt;
few books, this will definitely perform better than using subselects.&lt;br/&gt;
Off course one would like to fetch array graphs instead of objects for&lt;br/&gt;
further optimization, but this hopefully shows my point.&lt;/p&gt;

&lt;p&gt;I have attached a test casefor a similar query, though without the additional&lt;br/&gt;
join constraints for clarity. I surely hope you can consider it.&lt;/p&gt;

&lt;p&gt;One last note, you shouldn&apos;t be afraid that nesting joins is not in the&lt;br/&gt;
ansi SQL spec. Select queries are about record sets and products&lt;br/&gt;
between these sets, tables are just the basic means of providing record&lt;br/&gt;
sets to the query. This is an important terminological difference to think about.&lt;br/&gt;
Specifying precedence with parenthesis around joins is a logical and&lt;br/&gt;
natural evolution of the ansi sql standard. For example views are a good&lt;br/&gt;
proof of this concept, I could define book B INNER JOIN sale S as a view&lt;br/&gt;
and LEFT JOIN that to authors to get effectively the same result&lt;br/&gt;
set as the above example. The database server would internally perform the&lt;br/&gt;
same query (though may additionally take indexes on the view into account).&lt;br/&gt;
That said, rdbm&apos;s that support this syntax would certainly never drop the&lt;br/&gt;
feature, as its not a feature but just plain logical and smart querying!&lt;/p&gt;

&lt;p&gt;P.S. I had a hard time finding out how to run the test cases, I could not find&lt;br/&gt;
it in the Doctrine 2 documentation, development wiki, cookbook or any other&lt;br/&gt;
place, while finally it was as easy as running phpunit  Doctrine_Tests_AllTests&lt;br/&gt;
from within the tests/ directory, or just phpunit  Doctrine_Tests_ORM_Functional_Ticket_DDC349Test&lt;br/&gt;
for my test. Could you please add some info about this somewhere, it might&lt;br/&gt;
save others some googling.&lt;/p&gt;</comment>
                    <comment id="12664" author="dennis.verspuij" created="Tue, 13 Apr 2010 17:50:11 +0000"  >&lt;p&gt;Test case as SVN patch using a parenthesized join.&lt;br/&gt;
Just remove the parenthesises from the query to have it fail...&lt;/p&gt;</comment>
                    <comment id="13083" author="romanb" created="Sat, 29 May 2010 06:37:17 +0000"  >&lt;p&gt;@&quot;The need for native queries partly reverts the benefits Doctrine offers in the first place.&quot;&lt;/p&gt;

&lt;p&gt;That is something I hugely disagree with. Neither SQL abstraction, nor database vendor independence is the main purpose of an ORM like Doctrine 2.&lt;br/&gt;
It is the &lt;b&gt;state management of your objects, the transparent change tracking, lazy-loading and synchronization of the object state with the database state&lt;/b&gt; and nothing of this gets lost when using native queries.&lt;/p&gt;

&lt;p&gt;We could rip out DQL and any other querying mechanism except a basic find() (and lazy-loading, of course), only providing the native query facility and even only supporting MySQL and would still retain all the core ORM functionality.&lt;/p&gt;

&lt;p&gt;NativeQuery is one of the best and core &quot;features&quot; of the project. It is even the &lt;b&gt;foundation&lt;/b&gt; for DQL. A DQL query is nothing more than an additional (beautiful) abstraction but what comes out is a native query + a ResultSetMapping, the same thing you can build yourself in the first place, &lt;b&gt;even using the mapping metadata to construct the query&lt;/b&gt;. Nothing forces you to hardcode table and column names in native queries if you don&apos;t want that. Just use the mapping metadata, DQL does the same.&lt;/p&gt;

&lt;p&gt;SQL abstraction and database vendor independence is icing on the cake, not the heart of the ORM.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12797">DDC-1256</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10569" name="DDC349Test.patch" size="5354" author="dennis.verspuij" created="Tue, 13 Apr 2010 17:50:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2167] [GH-522] [DDC-2166] Refactor identity hash generation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2167</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 beberlei:&lt;/p&gt;

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

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

&lt;p&gt;This work prepares for the merge of GH-232, allowing more complex and robust identifier hash generation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14269">DDC-2167</key>
            <summary>[GH-522] [DDC-2166] Refactor identity hash generation</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 25 Nov 2012 17:57:03 +0000</created>
                <updated>Wed, 1 May 2013 21:33:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2254] Exporting and restoring a query.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2254</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When you have a queryBuilder and you want to break it down using getDQLParts, You can&apos;t restore it by looping over the parts and adding them.&lt;/p&gt;

&lt;p&gt;This is what I am doing:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$parts = $qb-&amp;gt;getDQLParts();

&lt;span class=&quot;code-comment&quot;&gt;// save the parts and use them in a different environment.
&lt;/span&gt;
$newQb = $em-&amp;gt;createQueryBuilder();
foreach ($parts as $name =&amp;gt; $part) {
  $newQb-&amp;gt;add($name, $part);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>OSX</environment>
            <key id="14406">DDC-2254</key>
            <summary>Exporting and restoring a query.</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="nousefreak">Dries De Peuter</reporter>
                        <labels>
                        <label>dql</label>
                        <label>rebuild</label>
                        <label>restore</label>
                        <label>save</label>
                    </labels>
                <created>Wed, 23 Jan 2013 20:02:34 +0000</created>
                <updated>Sat, 4 May 2013 11:43:53 +0000</updated>
                                    <version>Git Master</version>
                <version>2.3.2</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19363" author="nousefreak" created="Wed, 23 Jan 2013 20:21:11 +0000"  >&lt;p&gt;I wrote a test showing the issue.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/NoUseFreak/doctrine2/commit/8574b79fd3d245532bbe7e310c5cbe083892057a&quot; class=&quot;external-link&quot;&gt;https://github.com/NoUseFreak/doctrine2/commit/8574b79fd3d245532bbe7e310c5cbe083892057a&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20205" author="beberlei" created="Sat, 4 May 2013 11:43:53 +0000"  >&lt;p&gt;This is not a bug, because restoring queries is not yet a feature of the QueryBuilder. Marking as possible improvement for future.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2319] [GH-590] DQL Query: process ArrayCollection values to ease development</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2319</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 michaelperrin:&lt;/p&gt;

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

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

&lt;p&gt;I added some code to ease &quot;where in&quot; parameter binding.&lt;/p&gt;

&lt;p&gt;As you know, when a where condition is added, the object itself can be passed as a parameter and it&apos;s id is automatically retrieved:&lt;/p&gt;

&lt;p&gt;```php&lt;br/&gt;
$queryBuilder = $this&lt;br/&gt;
    -&amp;gt;where(&apos;model.category = :category&apos;)&lt;br/&gt;
    -&amp;gt;setParameter(&apos;category&apos;, $category)&lt;br/&gt;
;&lt;br/&gt;
```&lt;br/&gt;
Where `$category` is an object.&lt;/p&gt;

&lt;p&gt;But it doesn&apos;t work for collections:&lt;br/&gt;
```php&lt;br/&gt;
$queryBuilder = $this&lt;br/&gt;
    -&amp;gt;where(&apos;model.category IN (:categories)&apos;)&lt;br/&gt;
    -&amp;gt;setParameter(&apos;categories&apos;, $categories)&lt;br/&gt;
;&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;Where categories is an `ArrayCollection` object (retrieved from a many to one relation for instance).&lt;/p&gt;

&lt;p&gt;This doesn&apos;t work in the current version of Doctrine, and my PR solved that.&lt;/p&gt;

&lt;p&gt;So far, the only solution is to do the following:&lt;/p&gt;

&lt;p&gt;```php&lt;br/&gt;
$categoryIds = array();&lt;/p&gt;

&lt;p&gt;foreach ($categories as $category) &lt;/p&gt;
{
    $categoryIds[] = $category-&amp;gt;getId();
}

&lt;p&gt;$queryBuilder = $this&lt;br/&gt;
    -&amp;gt;where(&apos;model.category IN (:category_ids)&apos;)&lt;br/&gt;
    -&amp;gt;setParameter(&apos;category_ids&apos;, $categoryIds)&lt;br/&gt;
;&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;And this is pretty borring when you have to do it several times for several entities.&lt;/p&gt;

&lt;p&gt;Note that I didn&apos;t add any unit test for this feature. Can you explain me where I should add the test?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment></environment>
            <key id="14550">DDC-2319</key>
            <summary>[GH-590] DQL Query: process ArrayCollection values to ease development</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 25 Feb 2013 16:03:47 +0000</created>
                <updated>Sat, 4 May 2013 12:52:29 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2424] Removing an inherited entity via a delete cascade constraint does not remove the parent row</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2424</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For a parent class:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Base&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;child1&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Child1&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;child2&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Child2&quot;&lt;/span&gt;})
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and simple Child1 &amp;amp; Child2 entities.&lt;/p&gt;

&lt;p&gt;With another entity (let&apos;s call it ExternalEntity) having a bidirectional OneToOne relation owned by Child1:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Child1 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Base
{
  /**
   * @ORM\OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ExternalEntity&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;xxx&quot;&lt;/span&gt;)
   * @ORM\JoinColumn(onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
   */
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; theForeignKey;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Enough for the context.&lt;br/&gt;
The symptoms:&lt;/p&gt;

&lt;div class=&quot;code panel&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;remove(instanceOfExternalEntity);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; removes the ExternalEntity row and the Child1 row. But a dangling row in the Base table is still there for the now inexistent Child1 instance.&lt;/p&gt;

&lt;p&gt;Though, a manual delete of either the associated Child1 OR Base row and then the ExternalEntity works.&lt;/p&gt;

&lt;p&gt;The problem with the cascading deletion of the parent seems to be only present when deleting through a MYSQL cascading delete from another row which has a foreign key on a child. (Not tested with a foreign key on the parent though)&lt;/p&gt;
</description>
                <environment>Mysql 5.1.66 / Symfony 2.2.1</environment>
            <key id="14824">DDC-2424</key>
            <summary>Removing an inherited entity via a delete cascade constraint does not remove the parent row</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="xaapyks">Bruno Jacquet</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 May 2013 13:59:55 +0000</created>
                <updated>Mon, 6 May 2013 10:19:39 +0000</updated>
                                    <version>2.3.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20201" author="beberlei" created="Sat, 4 May 2013 10:51:03 +0000"  >&lt;p&gt;Can you show the CREATE TABLE and FOREIGN KEY statements of all the tables involved? It seems the cascade of the foreign keys is not propagated between multiple tables?&lt;/p&gt;</comment>
                    <comment id="20220" author="xaapyks" created="Mon, 6 May 2013 10:09:45 +0000"  >&lt;p&gt;CREATE TABLE Base (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;&lt;br/&gt;
CREATE TABLE Child1 (id INT NOT NULL, foreignKey INT NOT NULL, UNIQUE INDEX UNIQ_179B6E88E992F5A (foreignKey), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;&lt;/p&gt;

&lt;p&gt;ALTER TABLE Child1 ADD CONSTRAINT FK_179B6E88E992F5A FOREIGN KEY (foreignKey) REFERENCES ExternalEntity (id) ON DELETE CASCADE;&lt;br/&gt;
ALTER TABLE Child1 ADD CONSTRAINT FK_179B6E8BF396750 FOREIGN KEY (id) REFERENCES Base (id) ON DELETE CASCADE;&lt;/p&gt;</comment>
                    <comment id="20221" author="xaapyks" created="Mon, 6 May 2013 10:14:48 +0000"  >&lt;p&gt;The problem is that, the SQL model never explicitely tells the DB to delete the corresponding Base when Child1 gets removed. It looks like it is handled by the doctrine entity manager layer and not the actual DB engine (Base has no on delete cascade nor foreign key to its children). &lt;br/&gt;
So only doctrine can add the logic here because it knows the entity schema. But in this case, when it is deleted from another table, it looks like the special treatment is not triggered.&lt;/p&gt;</comment>
                    <comment id="20222" author="xaapyks" created="Mon, 6 May 2013 10:19:39 +0000"  >&lt;p&gt;Maybe using &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;, instead of &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; to force the cascading process to be handled by doctrine would workaround the bug... But I prefer to have my DB do the logic work as much as possible.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2147] Custom annotation in MappedSuperclass</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2147</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When you try use custom annotation in mappedsuperclass like here &lt;a href=&quot;http://pastebin.com/YMxKvcLk&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/YMxKvcLk&lt;/a&gt; and then i try get metadata for class i get this error &lt;br/&gt;
Undefined index: fieldName&lt;br/&gt;
ClassMetadataInfo.php  function addInheritedFieldMapping&lt;br/&gt;
Problem is that custom annotation doesnt have fieldName. &lt;br/&gt;
Quick fix is add condition to test if fieldName isset. &lt;/p&gt;</description>
                <environment>Linux 3.6.6-1.fc17.x86_64</environment>
            <key id="14227">DDC-2147</key>
            <summary>Custom annotation in MappedSuperclass</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="kluk">kluk</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Nov 2012 07:46:38 +0000</created>
                <updated>Tue, 7 May 2013 21:24:53 +0000</updated>
                                    <version>2.2.1</version>
                                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18988" author="kluk" created="Thu, 15 Nov 2012 09:24:39 +0000"  >&lt;p&gt;error log from orm:validate-schema&lt;/p&gt;</comment>
                    <comment id="19373" author="ocramius" created="Wed, 23 Jan 2013 21:47:56 +0000"  >&lt;p&gt;Copying from pastebin:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
use \Doctrine\ORM\Mapping as ORM;
use \xxx\Doctrine\Annotation\Entity as re;
use \xxx\Doctrine\Annotation\Forms as rf;
use \Doctrine\Common\Collections;
 
/**
 * @ORM\Entity
 */
class EventPicture &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \Picture
{
 
    /**
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Event&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;eventPicture&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;FK_Event&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $event;
 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
use \Doctrine\ORM\Mapping as ORM;
use \xxx\Doctrine\Annotation\Entity as re;
use \xxx\Doctrine\Annotation\Forms as rf;
use \Doctrine\Common\Collections;
 
/** @ORM\MappedSuperclass */
class Picture &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \xxx\Doctrine\Entity\BaseEntity
{
 
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; type
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
 
    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;,unique=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     *  @rf\FileUpload(fileSize=&lt;span class=&quot;code-quote&quot;&gt;&quot;php&quot;&lt;/span&gt;,uploadType=&lt;span class=&quot;code-quote&quot;&gt;&quot;local&quot;&lt;/span&gt;,fieldName=&lt;span class=&quot;code-quote&quot;&gt;&quot;link&quot;&lt;/span&gt;,formControl=&lt;span class=&quot;code-quote&quot;&gt;&quot;FileUploadField&quot;&lt;/span&gt;,image=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     *
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $link;
 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=kluk&quot; class=&quot;user-hover&quot; rel=&quot;kluk&quot;&gt;kluk&lt;/a&gt; does this happen also with any other simple custom annotation? For example following:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
/**
 * @Annotation 
 * @Target({&lt;span class=&quot;code-quote&quot;&gt;&quot;PROPERTY&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;ANNOTATION&quot;&lt;/span&gt;})
 */
&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; class Entity &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; Annotation
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $value;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19438" author="kluk" created="Wed, 30 Jan 2013 08:28:42 +0000"  >&lt;p&gt;the same error when using simple 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-none&quot;&gt; 
&amp;lt;?php

use \Doctrine\ORM\Mapping as ORM;
use \xxx\Doctrine\Annotation\Entity as re;
use \xxx\Doctrine\Annotation\Forms as rf;
use \Doctrine\Common\Collections;

/** @ORM\MappedSuperclass */
class Picture extends \xxx\Doctrine\Entity\BaseEntity {

    /**
     * @ORM\Id
     * @ORM\Column(type=&quot;integer&quot;)
     * @ORM\GeneratedValue(strategy=&quot;IDENTITY&quot;)
     * @var type
     */
    protected $id;

   
    /**
     * @ORM\Column(type=&quot;integer&quot;)
     * @rf\SetClass({&quot;class&quot;,&quot;hide&quot;})
     */
    public $value;

    /**
     * @ORM\Column(type=&quot;string&quot;,unique=true, nullable=true)
     * @rf\FileUpload(fileSize=&quot;php&quot;,uploadType=&quot;local&quot;,fieldName=&quot;link&quot;,formControl=&quot;FileUploadField&quot;,image=true)
     *
     */
    protected $link;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;When i remove $value , $picture from class everything goes ok.&lt;br/&gt;
Easy fix for me is change ClassMetadataInfo.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;
    /**
     * INTERNAL:
     * Adds a field mapping without completing/validating it.
     * This is mainly used to add inherited field mappings to derived classes.
     *
     * @param array $fieldMapping
     *
     * @return void
     */
    public function addInheritedFieldMapping(array $fieldMapping)
    {
        if(isset($fieldMapping[&apos;fieldName&apos;])){
        $this-&amp;gt;fieldMappings[$fieldMapping[&apos;fieldName&apos;]] = $fieldMapping;
        $this-&amp;gt;columnNames[$fieldMapping[&apos;fieldName&apos;]] = $fieldMapping[&apos;columnName&apos;];
        $this-&amp;gt;fieldNames[$fieldMapping[&apos;columnName&apos;]] = $fieldMapping[&apos;fieldName&apos;];
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But i dont know if this fix can break another part of doctrine.&lt;/p&gt;</comment>
                    <comment id="20211" author="beberlei" created="Sat, 4 May 2013 12:31:51 +0000"  >&lt;p&gt;Can you put the code of your annotations online? I can&apos;t seem to understand why this happens.&lt;/p&gt;</comment>
                    <comment id="20226" author="kluk" created="Tue, 7 May 2013 21:24:53 +0000"  >&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt; 
namespace libs\Doctrine\Annotation\Entity;
use Doctrine\Common\Annotations\Annotation;

/** @Annotation */
class CustomMapping &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Annotation
{
    /**
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $className;
    /**
     * 
     * 
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; IQueryable| string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $dataSource;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                </comments>
                    <attachments>
                    <attachment id="11349" name="error.log" size="2364" author="kluk" created="Thu, 15 Nov 2012 09:24:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2411] Null values get reset when rehydrating an already managed entity</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2411</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Scenario:&lt;/p&gt;

&lt;p&gt;1) You have an entity with a ManyToOne relation (and probably other kinds too, but this is all I have tested) to another entity which is nullable. For example, let&apos;s say you have a Book entity which has an &quot;illustrator&quot; field which refers to a Person entity, representing the person who illustrated the book. If the book is not illustrated then you set the field to null.&lt;/p&gt;

&lt;p&gt;2) You fetch a Book (by ID) which has its illustrator set to a particular Person.&lt;/p&gt;

&lt;p&gt;3) You set that Book&apos;s illustrator to null.&lt;/p&gt;

&lt;p&gt;4) Without flushing, you fetch the Book again, using different criteria: for example, by title. Because entities are Identity Mapped, this will run a query but then locate the same instance in memory, and try to hydrate that instance with the old data it just fetched.&lt;/p&gt;

&lt;p&gt;5) Any fields on the instance that have modified values retain their new values (for example, if we changed the illustrator to a different Person, this would be retained), BUT any fields on the instance which are null get overwritten with the old data (so if we previously set the illustrator to null, without flushing, it would now be reset to the Person value that it had before).&lt;/p&gt;

&lt;p&gt;There seems to be a mistaken assumption here that null values are fields that have not been hydrated, when this is not necessarily the case. Is this the intended behaviour?&lt;/p&gt;

&lt;p&gt;The code that causes this behaviour is here: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/e561f47cb2205565eb873f0643637477bfcfc2ff/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php#L471&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/e561f47cb2205565eb873f0643637477bfcfc2ff/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php#L471&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are wondering why anybody would want to fetch the entity again in step 4, my use case for this is the Symfony Validator (but I presume there could be others).&lt;/p&gt;

&lt;p&gt;If there are any unique constraints (Symfony ones, not Doctrine ones) on the entity, e.g. if we had a unique constraint on the Book title field, then when validating the Book the Symfony Validator would check if there are already any Book entities with the same title as the Book we&apos;re validating. It will find the Book that we are working with, and because entities are identity mapped, it will act upon the same instance, and the situation above occurs.&lt;/p&gt;

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

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;// Create some entities&lt;/p&gt;

&lt;p&gt;$john = new Person();&lt;br/&gt;
$john-&amp;gt;setName(&apos;John Smith&apos;);&lt;/p&gt;

&lt;p&gt;$jane = new Person();&lt;br/&gt;
$jane-&amp;gt;setName(&apos;Jane Jones&apos;);&lt;/p&gt;

&lt;p&gt;$joe = new Person();&lt;br/&gt;
$joe-&amp;gt;setName(&apos;Joe Bloggs&apos;);&lt;/p&gt;

&lt;p&gt;$book = new Book();&lt;br/&gt;
$book-&amp;gt;setId(123);&lt;br/&gt;
$book-&amp;gt;setTitle(&apos;Book Title&apos;);&lt;br/&gt;
$book-&amp;gt;setIllustrator($john);&lt;br/&gt;
$book-&amp;gt;setAuthor($jane);&lt;/p&gt;

&lt;p&gt;$em-&amp;gt;persist($john);&lt;br/&gt;
$em-&amp;gt;persist($jane);&lt;br/&gt;
$em-&amp;gt;persist($joe);&lt;br/&gt;
$em-&amp;gt;persist($book);&lt;br/&gt;
$em-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;// Now let&apos;s try modifying the book&lt;/p&gt;

&lt;p&gt;$book = $bookRepository-&amp;gt;find(123);&lt;br/&gt;
$book-&amp;gt;getIllustrator(); // returns Person &quot;John Smith&quot;&lt;br/&gt;
$book-&amp;gt;getAuthor(); // returns Person &quot;Jane Jones&quot;&lt;/p&gt;

&lt;p&gt;// make some changes&lt;br/&gt;
$book-&amp;gt;setIllustrator(null); // illustrator is now null&lt;br/&gt;
$book-&amp;gt;setAuthor($joe); // author is now &quot;Joe Bloggs&quot;&lt;/p&gt;

&lt;p&gt;// now validate our changes with Symfony Validator&lt;br/&gt;
// note: the same effect can also be observed with&lt;br/&gt;
//     $test = $bookRepository-&amp;gt;findBy(&apos;title&apos;, &apos;Book Title&apos;);&lt;br/&gt;
$validator-&amp;gt;validate($book);&lt;/p&gt;

&lt;p&gt;// what happened to our book??&lt;br/&gt;
$book-&amp;gt;getIllustrator(); // returns Person &quot;John Smith&quot; &amp;lt;- should be null&lt;br/&gt;
$book-&amp;gt;getAuthor(); // returns Person &quot;Joe Bloggs&quot; &amp;lt;- correctly retains the new value&lt;/p&gt;</description>
                <environment></environment>
            <key id="14801">DDC-2411</key>
            <summary>Null values get reset when rehydrating an already managed entity</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="sgarner">Simon Garner</reporter>
                        <labels>
                        <label>hydration</label>
                    </labels>
                <created>Tue, 23 Apr 2013 12:37:56 +0000</created>
                <updated>Thu, 9 May 2013 10:31:16 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="20100" author="fabio.bat.silva" created="Wed, 24 Apr 2013 18:48:14 +0000"  >&lt;p&gt;Hi Simon,&lt;/p&gt;

&lt;p&gt;Could you please try to write a &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php&quot; class=&quot;external-link&quot;&gt;failing test case&lt;/a&gt; or paste your entities ?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="20235" author="beberlei" created="Thu, 9 May 2013 10:31:16 +0000"  >&lt;p&gt;Verified by code review that this issue exists, but it will be very tricky to fix, because the null check is there for other reasons as well.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2190] findBy() support finding by a single DateTime but not by multiple DateTime</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2190</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The following code works:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$repository-&amp;gt;findBy(array(&apos;date&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime()))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but the following code fails as it does not apply the conversion of the &lt;tt&gt;date&lt;/tt&gt; type for each element:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$repository-&amp;gt;findBy(array(&apos;date&apos; =&amp;gt; array(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime(), &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime(&apos;tomorrow&apos;)))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14297">DDC-2190</key>
            <summary>findBy() support finding by a single DateTime but not by multiple DateTime</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Dec 2012 17:39:00 +0000</created>
                <updated>Thu, 9 May 2013 12:47:37 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19228" author="beberlei" created="Sun, 6 Jan 2013 09:48:39 +0000"  >&lt;p&gt;This is actually very hard to implement, the problem is that we only have ARRAY constants for PDO::PARAM_INT and PDO::PARAM_STR - all the other types would require special handling.&lt;/p&gt;</comment>
                    <comment id="20241" author="beberlei" created="Thu, 9 May 2013 12:47:37 +0000"  >&lt;p&gt;Attaching failing testcase.&lt;/p&gt;

&lt;p&gt;The idea is to have something like &quot;datetime[]&quot; as type and detect this in the SQLParserUtils of DBAL.&lt;/p&gt;

&lt;p&gt;Another approach would be to convert the values in the ORM already, before passing to the DBAL.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11526" name="DDC2190Test.php" size="569" author="beberlei" created="Thu, 9 May 2013 12:47:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2339] [GH-605] DDC-2338 Added failing test for composite foreign key persistance</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2339</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 alex88:&lt;/p&gt;

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

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

&lt;p&gt;I&apos;ve added this test regarding ticket &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-2338&quot; title=&quot;Entity with composite foreign keys identifiers should be persisted after related entities without exception&quot;&gt;DDC-2338&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14675">DDC-2339</key>
            <summary>[GH-605] DDC-2338 Added failing test for composite foreign key persistance</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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, 7 Mar 2013 09:40:17 +0000</created>
                <updated>Thu, 9 May 2013 15:23:13 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="20246" author="beberlei" created="Thu, 9 May 2013 15:23:13 +0000"  >&lt;p&gt;This is documented behavior and would just be an improvement&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1884] leftJoin via composite key part not hydrated if joining table solely consists of identifiers</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1884</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Suppose I have the following entities:
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver&quot;&lt;/span&gt;)
 */
class Driver
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    
    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=255);
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;
    
    /**
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;DriverRide&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $driverRides;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver_ride&quot;&lt;/span&gt;)
 */
class DriverRide
{
    /**
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Driver&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;driverRides&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;driver_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $driver;
    
    /**
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Car&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;carRides&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;car&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;brand&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $car;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;car&quot;&lt;/span&gt;)
 */
class Car
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=25)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;NONE&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $brand;
    
    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=255);
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $model;
    
    /**
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;DriverRide&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;car&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $carRides;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And want to query for Cars that a Driver drove in:
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb = $em-&amp;gt;createQueryBuilder();

$qb-&amp;gt;select(&apos;d, dr, c&apos;)
   -&amp;gt;from(&apos;Driver&apos;, &apos;d&apos;)
   -&amp;gt;leftJoin(&apos;d.driverRides&apos;, &apos;dr&apos;)
   -&amp;gt;leftJoin(&apos;dr.car&apos;, &apos;c&apos;)
   -&amp;gt;where(&apos;d.id = ?1&apos;) /* some Driver id */
   -&amp;gt;getQuery()-&amp;gt;getArrayResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Expected results:&lt;/b&gt;&lt;br/&gt;
I expect to get an array with an index &apos;driverRides&apos; with an array of Cars (depending on the data of course).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Actual result:&lt;/b&gt;&lt;br/&gt;
Just an array with Driver data.&lt;/p&gt;

&lt;p&gt;When I started doing some testing I found out I get a different result when I add a third column to the DriverRide table that isn&apos;t part of the composite primary key.&lt;br/&gt;
Now I did get a &apos;driverRides&apos; array, but with just a single row and not three as I expected to get in my case.&lt;/p&gt;

&lt;p&gt;When I removed the composite key and used an auto-generated id-column, everything worked as expected.&lt;/p&gt;

&lt;p&gt;Some test data you might want to use:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;INSERT INTO `car` (`brand`, `model`) VALUES
(&apos;BMW&apos;, &apos;7 Series&apos;),
(&apos;Crysler&apos;, &apos;300&apos;),
(&apos;Mercedes&apos;, &apos;C-&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt;&apos;),
(&apos;Volvo&apos;, &apos;XC90&apos;);

INSERT INTO `driver` (`id`, `name`) VALUES
(1, &apos;John Doe&apos;),
(2, &apos;Foo Bar&apos;);

INSERT INTO `driver_ride` (`driver_id`, `car`) VALUES
(1, &apos;Crysler&apos;),
(1, &apos;Mercedes&apos;),
(1, &apos;Volvo&apos;),
(2, &apos;BMW&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>MAMP</environment>
            <key id="13791">DDC-1884</key>
            <summary>leftJoin via composite key part not hydrated if joining table solely consists of identifiers</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://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="scoolen">Sander Coolen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jun 2012 15:06:08 +0000</created>
                <updated>Thu, 9 May 2013 22:14:27 +0000</updated>
                                    <version>2.2.0-RC1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18195" author="beberlei" created="Thu, 5 Jul 2012 19:11:27 +0000"  >&lt;p&gt;Can you update to at least 2.2.1 and try again, because this fix here &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1652&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1652&lt;/a&gt; look like it could be related to your problem.&lt;/p&gt;</comment>
                    <comment id="18224" author="scoolen" created="Sat, 7 Jul 2012 14:46:47 +0000"  >&lt;p&gt;We&apos;re already using the 2.2.x-dev package. It does look similar to &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-1652&quot; title=&quot;ArrayHydrator with composite primary key&quot;&gt;&lt;del&gt;DDC-1652&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18241" author="scoolen" created="Sun, 8 Jul 2012 12:34:57 +0000"  >&lt;p&gt;Added testcase on 2.1.x (not the right one unfortunately) branch: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/395&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/395&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;BTW I was adding said testcase on master and got an error similar to &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-979&quot; title=&quot;ArrayHydrator::updateResultPointer() must be an array, string given&quot;&gt;&lt;del&gt;DDC-979&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20261" author="beberlei" created="Thu, 9 May 2013 22:14:27 +0000"  >&lt;p&gt;I upgraded the testcase to master locally, and it seems to fail on Array hydration only now, with a notice:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Exception: [PHPUnit_Framework_Error] Argument 1 passed to Doctrine\ORM\Internal\Hydration\ArrayHydrator::updateResultPointer() must be of the type array, string given, called in /home/benny/code/php/workspace/doctrine2/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php on line 196 and defined
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I remember fixing something similar for ObjectHydration (which works for your testcases). Will investigate more when I have time.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1970] DiscriminatorMap recursion when using self-reference</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1970</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;ve ran into a problem with self-referencing entity. When fetching an entity, recursion occurs, fetching every related entity defined by ManyToOne relation&lt;br/&gt;
(in this example $sponsor), ignoring LAZY or EXTRA_LAZY fetch mode - it executes numerous queries.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
/**
 * @ORM\Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Acme\Bundle\UserBundle\Entity\Repository\UserRepository&quot;&lt;/span&gt;)
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;f_user&quot;&lt;/span&gt;)
 * @ORM\InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @ORM\DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;user_person&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;UserPerson&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;user_company&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;UserCompany&quot;&lt;/span&gt;})
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class UserBase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; FOSUser

/* .... */

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; UserBase
     *
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserBase&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;sponsor&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $referrals;

    /**
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserBase&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;referrals&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sponsor_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $sponsor;

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13942">DDC-1970</key>
            <summary>DiscriminatorMap recursion when using self-reference</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="kolah">Krzysztof Kolasiak</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Aug 2012 18:54:11 +0000</created>
                <updated>Fri, 10 May 2013 15:29:53 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18504" author="asm89" created="Tue, 14 Aug 2012 20:17:31 +0000"  >&lt;p&gt;I have changed this into a feature request because you have hit the limitations of using inheritance and self referencing entities.&lt;/p&gt;

&lt;p&gt;Doctrine2 cannot currently lazy load UserBase#$sponsor because we don&apos;t know which proxy we have to insert. It can either be UserPerson or UserCompany. In order to know this Doctrine2 &lt;em&gt;has&lt;/em&gt; to query the actual object to determine its type. The current strategy is then to load the actual entity because we have all data anyway.&lt;/p&gt;

&lt;p&gt;In order to implement this feature we need to insert a proxy instead of the actual entity. If we do that there should be no recursion happening.&lt;/p&gt;</comment>
                    <comment id="19577" author="ocramius" created="Thu, 21 Feb 2013 09:55:30 +0000"  >&lt;p&gt;Reduced priority&lt;/p&gt;</comment>
                    <comment id="20266" author="notprathap" created="Fri, 10 May 2013 15:29:53 +0000"  >&lt;p&gt;It&apos;d be great if this is a configurable option.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2429] Association-Override Problem in XSD Mapping?</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2429</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;From a mailinglist entry:&lt;/p&gt;

&lt;p&gt;I use Doctrine 2.3 in Symfony 2.1.8&lt;/p&gt;

&lt;p&gt;I&apos;m using association-overrides in the XML format between several entities. Eclipse shows up several errors.&lt;/p&gt;

&lt;p&gt;The first error message is shown in every Doctrine file when I declare the file format as such (for example: &lt;a href=&quot;https://github.com/thewholelifetolearn/Social-Library/blob/master/src/SocialLibrary/ReadBundle/Resources/config/doctrine/GraphicNovel.orm.xml&quot; class=&quot;external-link&quot;&gt;https://github.com/thewholelifetolearn/Social-Library/blob/master/src/SocialLibrary/ReadBundle/Resources/config/doctrine/GraphicNovel.orm.xml&lt;/a&gt; )&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt;
&lt;/span&gt;                  xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt;
&lt;/span&gt;                  xsi:schemaLocation=&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping
&lt;/span&gt;                  http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Eclipse shows this error : &lt;br/&gt;
White spaces are required between  publicId and systemId&lt;/p&gt;

&lt;p&gt;The error points to the &quot;doctrine-mapping&quot; line&lt;/p&gt;



&lt;p&gt;The second error comes up when I change the doctype to (file example: &lt;a href=&quot;https://gist.github.com/thewholelifetolearn/5462057&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/thewholelifetolearn/5462057&lt;/a&gt; ):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt;
&lt;/span&gt;                  xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt;
&lt;/span&gt;                  xsi:schemaLocation=&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping
&lt;/span&gt;                  https:&lt;span class=&quot;code-comment&quot;&gt;//raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd&quot;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But then this error is shown:&lt;br/&gt;
cvc-complex-type.2.4.b: The content of element &apos;association-overrides&apos; is not complete. One of &apos;&lt;/p&gt;
{&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping&quot;:association-override, WC[##other:&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping&quot;]}
&lt;p&gt;&apos; is expected.&lt;/p&gt;

&lt;p&gt;The error points on &quot;&amp;lt;association-overrides&amp;gt;&quot; in Novel.orm.xml (line 8)&lt;/p&gt;


&lt;p&gt;Could someone explain me the errors that show up? The first error doesn&apos;t seem to disturb Symfony2 but the second messes around the console commands. But it still generates the database.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14831">DDC-2429</key>
            <summary>Association-Override Problem in XSD Mapping?</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 5 May 2013 16:44:40 +0000</created>
                <updated>Mon, 13 May 2013 16:26:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2220] Add joins to Collection Filtering API</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2220</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The recently added collection filtering API only goes half way in achieving a full fledged solution to filter huge collections. It still lacks joins. Look at the next two snippets:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    $criteria = Criteria::create()
        -&amp;gt;where(Criteria::expr()-&amp;gt;eq(&apos;storeId&apos;, $store-&amp;gt;getId()))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category&apos;, 20))
        -&amp;gt;orderBy(array(&apos;popularity&apos; =&amp;gt; &apos;DESC&apos;));
    &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;BrandCategories-&amp;gt;matching($criteria);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This piece of code works but what if there is a need to filter the BrandCategories collection by Categories with some extra criteria:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    $criteria = Criteria::create()
        -&amp;gt;where(Criteria::expr()-&amp;gt;eq(&apos;storeId&apos;, $store-&amp;gt;getId()))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category&apos;, 20))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category.name&apos;, &apos;Electronics&apos;))
        -&amp;gt;orderBy(array(&apos;popularity&apos; =&amp;gt; &apos;DESC&apos;));
    &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;BrandCategories-&amp;gt;matching($criteria);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That would not work.&lt;/p&gt;

&lt;p&gt;Ideally we should have a possibility to join other entities, the Category entity in our case here:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    $criteria = Criteria::create()
        -&amp;gt;where(Criteria::expr()-&amp;gt;eq(&apos;storeId&apos;, $store-&amp;gt;getId()))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category&apos;, 20))
        -&amp;gt;innerJoin(Criteria::expr()-&amp;gt;field(&apos;Category&apos;, &apos;Category&apos;))
        -&amp;gt;andWhere(Criteria::expr()-&amp;gt;eq(&apos;Category.name&apos;, &apos;Electronics&apos;))
        -&amp;gt;orderBy(array(&apos;popularity&apos; =&amp;gt; &apos;DESC&apos;));
    &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;BrandCategories-&amp;gt;matching($criteria);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What do you think about it, does it make sense to add such functionality?&lt;/p&gt;
</description>
                <environment></environment>
            <key id="14344">DDC-2220</key>
            <summary>Add joins to Collection Filtering API</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="3" iconUrl="http://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="deatheriam">Oleg Namaka</reporter>
                        <labels>
                        <label>api</label>
                        <label>collection</label>
                        <label>filtering</label>
                    </labels>
                <created>Thu, 3 Jan 2013 01:46:59 +0000</created>
                <updated>Thu, 3 Jan 2013 20:21:21 +0000</updated>
                                    <version>2.3.1</version>
                                                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2446] [GH-666] [DDC-2429] Fix xsd definition</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2446</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 FabioBatSilva:&lt;/p&gt;

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

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

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2429&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2429&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14944">DDC-2446</key>
            <summary>[GH-666] [DDC-2429] Fix xsd definition</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 May 2013 14:14:11 +0000</created>
                <updated>Mon, 13 May 2013 14:14:11 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2448] orm:schema-tool:update reports already updated NUMERIC fields</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2448</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a table defined in this way:&lt;/p&gt;

&lt;p&gt;CREATE TABLE `my_table` (&lt;br/&gt;
  `id` int(10) NOT NULL AUTO_INCREMENT,&lt;br/&gt;
  `subtotal` decimal(10,2) DEFAULT NULL,&lt;br/&gt;
  PRIMARY KEY (`id`)&lt;br/&gt;
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;&lt;/p&gt;

&lt;p&gt;When I run&lt;br/&gt;
    php doctrine.php  orm:schema-tool:update --dump-sql&lt;/p&gt;

&lt;p&gt;I get&lt;br/&gt;
ALTER TABLE my_table CHANGE subtotal subtotal NUMERIC(10, 2) DEFAULT NULL;&lt;/p&gt;

&lt;p&gt;While of course the field is already updated. The same happens in SQL Server 2008 and Postgres 9.&lt;/p&gt;</description>
                <environment>PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48) &lt;br/&gt;
Mysql version: 5.5.31-0ubuntu0.12.04.1 (Ubuntu)</environment>
            <key id="14948">DDC-2448</key>
            <summary>orm:schema-tool:update reports already updated NUMERIC fields</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="osvi">Francesco Montefoschi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 May 2013 09:09:13 +0000</created>
                <updated>Tue, 14 May 2013 09:09:13 +0000</updated>
                                    <version>2.3.4</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2449] Amazon Redshift Support</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2449</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice to get doctrine compatible with Amazon Redshift. It uses a Postgres connector but there are some differences. I&apos;m currently facing an issue with the primary id, in Redshift the generation of an id is different from Postgres and so I&apos;m getting errors associated with generating an id.&lt;/p&gt;

&lt;p&gt;Here are some references that might be useful:&lt;br/&gt;
node-orm faced the same issue and seems like they figured it out: &lt;a href=&quot;https://github.com/dresende/node-orm2/issues/39&quot; class=&quot;external-link&quot;&gt;https://github.com/dresende/node-orm2/issues/39&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amazon Manual:&lt;br/&gt;
&lt;a href=&quot;http://awsdocs.s3.amazonaws.com/redshift/latest/redshift-dg.pdf&quot; class=&quot;external-link&quot;&gt;http://awsdocs.s3.amazonaws.com/redshift/latest/redshift-dg.pdf&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Amazon Redshift</environment>
            <key id="14955">DDC-2449</key>
            <summary>Amazon Redshift Support</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="kfuchs">Kirill F</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 May 2013 23:08:21 +0000</created>
                <updated>Wed, 15 May 2013 23:09:12 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1431] Current event system is not flexible enough</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1431</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;According to &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/events.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/events.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Current event system seem to be not as flexible as it could be.&lt;/p&gt;

&lt;p&gt;1. &lt;b&gt;According Lifecycle Events of the entity (marked with @HasLifecycleCallbacks annotation tag)&lt;/b&gt;:&lt;br/&gt;
It would be useful to have access to Entity Manager inside the callbacks. This could be achieved by passing the entity manager as a parameter to all these callbacks. &lt;/p&gt;

&lt;p&gt;Here is the situation:&lt;br/&gt;
I have an entity for a news item. After somehow modifying this entity and before persisting I want to be able to change the inner association of images linked to this news (for example parsed from news body text). From the OO point of view it&apos;s a task of the News entity itself so this should be done a callback. But since inside callback I do not have access to entity manager (to find existing image entities and only if not found creating a new one) I cannot do this.&lt;br/&gt;
This leads to creating a separate event listener which is split from the news entity (and that is not possible, see 2.).&lt;/p&gt;

&lt;p&gt;Passing entity manager to callbacks may improve it&apos;s usefulness.&lt;/p&gt;

&lt;p&gt;2. &lt;b&gt;Currently there is no events to be called before the changes have been computed. And there is no callback to be called after flush has been finished. (preFlush, postFlush)&lt;/b&gt;&lt;br/&gt;
The problem:&lt;br/&gt;
Assume we have a News entity. I want to modify external system (even not written in PHP) via remote call after any change to news being made. This has to be called AFTER the flush has persisted all the changes. Currently the only place to do this is onFlush (which is called before the persisting is done).&lt;br/&gt;
PostPersist, postRemove, postUpdate cannot be used as it&apos;s called after each one entity is modified and we cannot tell when all entites has been processed.&lt;/p&gt;

&lt;p&gt;Also I faced a problem when implementing the event listener for situation 1. If I register the onFlush listener - the entites changeset is already calculated. If I change something according associations I loose this changes. &lt;br/&gt;
If I call $unitOfWork-&amp;gt;computeChangeSet($classMetadata, $entity) or $unitOfWork-&amp;gt;recomputeSingleEntityChangeSet($classMetadata, $entity); I only get the changes being made after previous changeset calculation loosing the initial changes. I think the preFlush could be a lifesaver for this (to be called before computing the changeset for the first time).&lt;/p&gt;


</description>
                <environment>Doctrine 2.1</environment>
            <key id="13096">DDC-1431</key>
            <summary>Current event system is not flexible enough</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="c0ba">Oleg Stepura</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Oct 2011 09:37:45 +0000</created>
                <updated>Tue, 18 Oct 2011 09:40:26 +0000</updated>
                                    <version>2.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
            <subtask id="13119">DDC-1449</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-1532] PostFlush lifecycle event</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1532</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In some cases, the database-id of the newly created record is needed in some postproccessing steps, like sending an e-mail containing a link to the just created entity. I&apos;ve recently seen the added support for PostFlush, but this is not a lifecycle event. &lt;/p&gt;

&lt;p&gt;class SomeEntityClass{&lt;/p&gt;

&lt;p&gt;    /** @PostFlush */&lt;br/&gt;
    function sendSomeEmail()&lt;/p&gt;
{
        sendEmail(&apos;
            &apos;Hi, you&apos;re new invoice can be found online: http://www.example.com/invoices/invoice_&apos;.$this-&amp;gt;id
        &apos;;
    }

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

&lt;p&gt;Perhaps it&apos;s even possible to have multiple PostFlush events, that differentiate between the first time a record is created, and when the record is merely updated.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="13257">DDC-1532</key>
            <summary>PostFlush lifecycle event</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="jack@actinum.nl">Jack van Galen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Dec 2011 11:43:26 +0000</created>
                <updated>Wed, 14 Dec 2011 11:13:14 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16985" author="jack@actinum.nl" created="Wed, 14 Dec 2011 11:13:14 +0000"  >&lt;p&gt;Okay, please ignore this issue, as I now see that the @PostPersist does exactly what I need. I was thrown by the name, because to me, the order in which stuff happens is persist -&amp;gt; flush. The ID&apos;s are only known after flush, so i&apos;d expected something like postflush to exist. Sorry.&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2248] Expire result cache functionality not implemented</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2248</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;According to &lt;a href=&quot;https://doctrine-orm.readthedocs.org/en/latest/reference/dql-doctrine-query-language.html?highlight=expireResultCache&quot; class=&quot;external-link&quot;&gt;documentation&lt;/a&gt; expireResultCache, should force cache to update but it&apos;s not working... Why? Because functionality is not implemented. You can set _expireResultCache variable, but there is no place where this variable is being checked.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14393">DDC-2248</key>
            <summary>Expire result cache functionality not implemented</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nazin">Piotr Niziniecki</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jan 2013 17:25:33 +0000</created>
                <updated>Sat, 19 Jan 2013 17:40:44 +0000</updated>
                                    <version>2.3</version>
                <version>2.3.1</version>
                <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19336" author="ocramius" created="Sat, 19 Jan 2013 17:40:44 +0000"  >&lt;p&gt;A cache profile can be set and cleaned. I suppose that `expireResultCache` is an old piece of code that survived the refactoring. Should just be removed and documented accordingly&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2455] Setting classes in the entity manager</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2455</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am creating my own bundle in Sf2 which will be used for third libraries, but I need to provide some simple and complex queries from this. &lt;br/&gt;
For simple queries i have no problem because I set the repository with the class from the third library.&lt;br/&gt;
Something like this:&lt;/p&gt;

&lt;p&gt;    $this-&amp;gt;repository = $this-&amp;gt;em-&amp;gt;getRepository($className);&lt;br/&gt;
    $result = $this-&amp;gt;repository&lt;br/&gt;
                -&amp;gt;createQueryBuilder(&quot;c&quot;)&lt;br/&gt;
                -&amp;gt;select(&apos;c, d, e&apos;)&lt;br/&gt;
                -&amp;gt;join(&quot;c.groups&quot;, &quot;d&quot;)&lt;br/&gt;
                -&amp;gt;join(&quot;d.users&quot;, &quot;e&quot;)&lt;br/&gt;
                -&amp;gt;where(&quot;e.id = :userId&quot;)&lt;br/&gt;
                -&amp;gt;setParameter(&quot;userId&quot;, $userId);&lt;/p&gt;

&lt;p&gt;    return $result-&amp;gt;getQuery()-&amp;gt;getResult();&lt;/p&gt;

&lt;p&gt;But when I need complex queries i have to work with the Entity Manager instead of working with the Repository. So tables are named as MyBundle (Group), but not how the third library named (sf_group). As a consequence the SQL throws an error saying that my table does not exist.&lt;br/&gt;
This is how I am trying to retrieve:&lt;/p&gt;

&lt;p&gt;    $query = $this-&amp;gt;em-&amp;gt;createQuery(&quot;SELECT p FROM Groups p&quot;);&lt;/p&gt;

&lt;p&gt;I sent the className as the entity to avoid this. Something like:&lt;/p&gt;

&lt;p&gt;    $query = $this-&amp;gt;em-&amp;gt;createQuery(&quot;SELECT p FROM &quot;.$this-&amp;gt;className.&quot; p&quot;);&lt;/p&gt;

&lt;p&gt;However i need a lot of queries with JOINs, so i would have to change every entity name, which is not convenient.&lt;/p&gt;

&lt;p&gt;What another way could I implemment this?&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14962">DDC-2455</key>
            <summary>Setting classes in the entity manager</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="pcastrotigre">Petter Castro</reporter>
                        <labels>
                        <label>entitymanager</label>
                    </labels>
                <created>Thu, 16 May 2013 17:02:30 +0000</created>
                <updated>Thu, 16 May 2013 17:02:30 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2456] [GH-669] Fixed generating column names for self referencing entity.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2456</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 hason:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="14964">DDC-2456</key>
            <summary>[GH-669] Fixed generating column names for self referencing entity.</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 May 2013 10:11:02 +0000</created>
                <updated>Fri, 17 May 2013 10:11:02 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2461] [GH-673] Namespace based command names</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2461</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 hell0w0rd:&lt;/p&gt;

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

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

&lt;p&gt;Symfony console supports auto completion:&lt;br/&gt;
``orm:generate:entities`` could called ``o:g:e``&lt;/p&gt;</description>
                <environment></environment>
            <key id="14969">DDC-2461</key>
            <summary>[GH-673] Namespace based command names</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 May 2013 22:12:50 +0000</created>
                <updated>Fri, 17 May 2013 23:01:44 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20397" author="doctrinebot" created="Fri, 17 May 2013 22:17:25 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-673&amp;#93;&lt;/span&gt; was closed:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/673&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/673&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20398" author="ocramius" created="Fri, 17 May 2013 22:17:42 +0000"  >&lt;p&gt;BC break without advantages&lt;/p&gt;</comment>
                    <comment id="20399" author="doctrinebot" created="Fri, 17 May 2013 22:55:30 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-673&amp;#93;&lt;/span&gt; was reopened:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/673&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/673&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2460] [GH-672] Simplification example</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2460</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 hell0w0rd:&lt;/p&gt;

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

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

&lt;p&gt;Remove doctrine class loader, one bootstrap file&lt;/p&gt;</description>
                <environment></environment>
            <key id="14968">DDC-2460</key>
            <summary>[GH-672] Simplification example</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 May 2013 21:46:17 +0000</created>
                <updated>Fri, 17 May 2013 21:46:17 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2463] [GH-675] Implementation for &apos;IsNot&apos;-Comparison</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2463</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 pmattmann:&lt;/p&gt;

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

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

&lt;p&gt;See PR (&lt;a href=&quot;https://github.com/doctrine/collections/pull/11&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/collections/pull/11&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;This is the required implementation for &apos;IsNotNull&apos;-Filters in Collection-Filtering.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14972">DDC-2463</key>
            <summary>[GH-675] Implementation for &apos;IsNot&apos;-Comparison</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 May 2013 11:19:03 +0000</created>
                <updated>Mon, 20 May 2013 11:19:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2445] [GH-665] oo 	Add Null in ScalarExpression </title>
                <link>http://doctrine-project.org/jira/browse/DDC-2445</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 vahid-sohrabloo:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="14943">DDC-2445</key>
            <summary>[GH-665] oo 	Add Null in ScalarExpression </summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://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="doctrinebot">Doctrine Bot</reporter>
                        <labels>
                    </labels>
                <created>Sun, 12 May 2013 10:40:41 +0000</created>
                <updated>Wed, 22 May 2013 04:21:32 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="20416" author="doctrinebot" created="Wed, 22 May 2013 04:21:32 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-665&amp;#93;&lt;/span&gt; was closed:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/665&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/665&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-878] Don&apos;t explicitly require object members (fields) to be defined in the entity class</title>
                <link>http://doctrine-project.org/jira/browse/DDC-878</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently, Doctrine REQUIRES that a given entity class have protected or private members explicitly defined in the class (even if meta data mapping is handled elsewhere, such as in YAML). This is less than optimal...for example, many class implementations prefer to store all data in a protected $fields member, as an array, accessing the members with getters and setters.&lt;/p&gt;

&lt;p&gt;Doctrine makes this behavior impossible. An exception is thrown if a field defined in meta data is not an explicit member of the class. Instead, it should &apos;take the meta data&apos;s word for it&apos; that the field exists, and is accessible via getters and setters, without explicitly checking for the member. The meta data is already the authoritative source, I don&apos;t see why the double check should (or needs to) be performed (although I am not familiar with Doctrine internals). Since Doctrine recommends making members private, I have to assume it is already hydrating them with the get/set accessors anyway...so it should just rely on them.&lt;/p&gt;

&lt;p&gt;Quick example use case (notice &apos;name&apos; is not actually a member...it is stored in $fields and assume meta data is defined in a separate yaml file):&lt;/p&gt;

&lt;p&gt;class User &lt;/p&gt;
{
protected $fields = array();

public function getName()
{
return $this-&amp;gt;fields[&apos;name&apos;];
}

public function setName($name)
{
$this-&amp;gt;fields[&apos;name&apos;] = $name;
}

}</description>
                <environment></environment>
            <key id="12104">DDC-878</key>
            <summary>Don&apos;t explicitly require object members (fields) to be defined in the entity class</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="nd987">Nick Daugherty</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 01:19:35 +0000</created>
                <updated>Tue, 16 Nov 2010 13:12:24 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14743" author="beberlei" created="Tue, 16 Nov 2010 03:07:56 +0000"  >&lt;p&gt;This maybe a potential optimization for a very future version. However currently we heavily rely on the Reflection support for properties, which kind of makes a change of this a very complex undertaking.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1247] Implement AnnotationDriver::addExcludePath</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1247</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, &lt;br/&gt;
I&apos;ve been having issues with AnnotationDriver crawling in my directories and loading files. &lt;br/&gt;
I have a few classes that require specific libraries loaded, and I don&apos;t want the AnnotationDriver to load them. &lt;/p&gt;

&lt;p&gt;For example, I have my descendant of PHPUnit_Framework_TestCase in libs and the driver just dies, because PHPUnit is not loaded, and I don&apos;t want to load it, to be able to finish the process.&lt;/p&gt;

&lt;p&gt;Solution would be add method &lt;tt&gt;AnnotationDriver::addExcludePath&lt;/tt&gt;, whose name speaks for itself &lt;img class=&quot;emoticon&quot; src=&quot;http://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;Temporarily, I had to extend the AnnotationDriver and overload the crawling process, which is realy annoing, because I had to copy the whole method with all its exceptions and I would have to maintain it, till this will be in Doctrine. Can be viewed here &lt;a href=&quot;https://github.com/Kdyby/Framework/blob/master/libs/Kdyby/Doctrine/Mapping/Driver/AnnotationDriver.php&quot; class=&quot;external-link&quot;&gt;https://github.com/Kdyby/Framework/blob/master/libs/Kdyby/Doctrine/Mapping/Driver/AnnotationDriver.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Filip&lt;/p&gt;</description>
                <environment></environment>
            <key id="12784">DDC-1247</key>
            <summary>Implement AnnotationDriver::addExcludePath</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="hosiplan">Filip Proch&#225;zka</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jul 2011 09:26:49 +0000</created>
                <updated>Wed, 19 Sep 2012 16:10:00 +0000</updated>
                                    <version>Git Master</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="17875" author="juzna" created="Fri, 20 Apr 2012 12:33:23 +0000"  >&lt;p&gt;This behavior really messes with my projects, as it automatically loads all php files. Not just those with classes, but also simple scripts, which can do horrible stuff (e.g. I&apos;ve got scripts to make changes in the source code!)&lt;/p&gt;

&lt;p&gt;Annotations should be read without executing the scripts, e.g. by TokenReflection library: &lt;a href=&quot;https://github.com/Andrewsville/PHP-Token-Reflection&quot; class=&quot;external-link&quot;&gt;https://github.com/Andrewsville/PHP-Token-Reflection&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18546" author="vrtak-cz" created="Mon, 27 Aug 2012 17:05:46 +0000"  >&lt;p&gt;pull &lt;a href=&quot;https://github.com/doctrine/common/pull/176&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/pull/176&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18683" author="stof" created="Wed, 19 Sep 2012 11:13:23 +0000"  >&lt;p&gt;@Jan Tokenizing the file was the way annotations were handled in 2.0. Doctrine 2.1 switched to using Reflection to read annotation because it is faster.&lt;/p&gt;

&lt;p&gt;@Filip I&apos;m wondering why you would have PHPUnit testcases in a path storing entities.&lt;/p&gt;</comment>
                    <comment id="18684" author="hosiplan" created="Wed, 19 Sep 2012 13:39:24 +0000"  >&lt;p&gt;@stof&lt;/p&gt;

&lt;p&gt;&amp;gt; Tokenizing the file was the way annotations were handled in 2.0. Doctrine 2.1 switched to using Reflection to read annotation because it is faster.&lt;/p&gt;

&lt;p&gt;And it is obviousely the wrong one. There is no argument, that could beat the fact, that the result can and should be cached, as it does already. Correct behaviour is much more valuable than few miliseconds on first run.&lt;/p&gt;

&lt;p&gt;&amp;gt; I&apos;m wondering why you would have PHPUnit testcases in a path storing entities.&lt;/p&gt;

&lt;p&gt;I don&apos;t. They are base classes for the actual tests. I agree they might (or should) be somewhere else, but the fact, that they should not be executed, when readed, stays.&lt;/p&gt;</comment>
                    <comment id="18685" author="stof" created="Wed, 19 Sep 2012 16:10:00 +0000"  >&lt;p&gt;@Filip The AnnotationReader is not loading any file. It simply expects a ReflectionClass.&lt;br/&gt;
And for the performances, we are talking about running several times faster here (I don&apos;t have the benchmark results anymore but you could search in the merged PRs on Doctrine Common)&lt;/p&gt;

&lt;p&gt;The ORM AnnotationDriver expects a path in which it should look for annotated classes, to be able to implement getAllClasses() (as it cannot expect all classes to be already loaded). And btw, the behavior was the same in 2.0 when the reader was using tokenization.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1248] Documentation regarding prePersist and postPersist events a bit lacking</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1248</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Please make it more clear that prePersist and postPersist events are called only when creating new entity (that is, prior and after a database insert).&lt;/p&gt;

&lt;p&gt;IRC log:&lt;br/&gt;
helmer&lt;br/&gt;
  Hi. I have a question regarding (pre|post)persist events. Why are the events ignored for second persist (should fire prePersist) + flush (should fire postPersist) in the following pastie: &lt;a href=&quot;http://pastebin.com/V8CrPWkM&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/V8CrPWkM&lt;/a&gt; Is it a bug or am I missing sth?&lt;br/&gt;
Stof&lt;br/&gt;
  helmer: there is no second persist. persist() means saying Doctrine to manage the entity. Once it is managed, you are not persisting it anymore but updating it&lt;br/&gt;
helmer&lt;br/&gt;
  Stof: so basically one could define these two events for themselves as (pre|post)Insert?&lt;br/&gt;
beberlei&lt;br/&gt;
  yes&lt;br/&gt;
helmer&lt;br/&gt;
  thanks beberlei&amp;amp;stof! though a suggestion to docteam .. perhaps make it more clear to people like me, current doc can be kind of misleading ie: &quot;There are two ways for the prePersist event to be triggered. One is obviously when you call EntityManager#persist()&quot; &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/events.html#prepersist&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/events.html#prepersist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pastie code (probably expired by now):&lt;br/&gt;
$entity = new Entity();&lt;/p&gt;

&lt;p&gt;$entity-&amp;gt;setSomething(&apos;xxx&apos;);&lt;br/&gt;
$this-&amp;gt;em-&amp;gt;persist($entity);&lt;br/&gt;
$this-&amp;gt;em-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;$entity-&amp;gt;setSomething(&apos;yyy&apos;);&lt;br/&gt;
$this-&amp;gt;em-&amp;gt;persist($entity);&lt;br/&gt;
$this-&amp;gt;em-&amp;gt;flush();&lt;/p&gt;</description>
                <environment>Browser</environment>
            <key id="12785">DDC-1248</key>
            <summary>Documentation regarding prePersist and postPersist events a bit lacking</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="helmer">Helmer Aaviksoo</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jul 2011 14:43:01 +0000</created>
                <updated>Mon, 4 Jul 2011 14:45:56 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1206] Add option to SchemaTool for ignoring unsupported tables</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1206</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I suggest adding a new feature to SchemaTool, which allows you to ignore tables, which contain unsupported column types.&lt;/p&gt;

&lt;p&gt;Use case:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;You have a legacy database, or a database that is also shared with another application&lt;/li&gt;
	&lt;li&gt;You want to use SchemaTool to speed up development&lt;/li&gt;
	&lt;li&gt;The database contains tables which are not used in the Doctrine 2 application, and contain unsupported column types&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I&apos;ve encountered this already a few  times myself - Basically if you try to use orm:schema-tool:update with a database that contains tables with unsupported column types, it&apos;ll throw an error and you won&apos;t be able to use it at all. Because schema tool is extermely convenient when developing, I think it would be very useful to have support for this feature.&lt;/p&gt;

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

&lt;p&gt;I think this should be doable by just changing SchemaTool/SchemaManager so, that SchemaManager would contain an additional method (or flag) which works like createSchema, but ignores tables that cause an exception, and SchemaTool would include a flag for using this instead of the standard approach.&lt;/p&gt;

&lt;p&gt;I&apos;m looking into implementing this myself, and will submit a patch if this seems like a reasonable approach.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12711">DDC-1206</key>
            <summary>Add option to SchemaTool for ignoring unsupported tables</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="jhartikainen">Jani Hartikainen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Jun 2011 13:06:46 +0000</created>
                <updated>Mon, 5 Mar 2012 19:43:14 +0000</updated>
                                                                    <component>Tools</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15986" author="jhartikainen" created="Wed, 15 Jun 2011 05:33:52 +0000"  >&lt;p&gt;Relevant patches (pull request made):&lt;/p&gt;

&lt;p&gt;DBAL &lt;a href=&quot;https://github.com/jhartikainen/dbal/tree/DDC-1206&quot; class=&quot;external-link&quot;&gt;https://github.com/jhartikainen/dbal/tree/DDC-1206&lt;/a&gt;&lt;br/&gt;
ORM &lt;a href=&quot;https://github.com/jhartikainen/doctrine2/tree/DDC-1206&quot; class=&quot;external-link&quot;&gt;https://github.com/jhartikainen/doctrine2/tree/DDC-1206&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17520" author="maerf0x0" created="Mon, 5 Mar 2012 19:43:14 +0000"  >&lt;p&gt;has there been any progres on this feature? I have POINT  in my DB and would rather ignore the table  than create a custom type. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1198] Add PHPDocs to annotationclasses</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1198</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If an IDE would like to support annotations, it&apos;s currently only possible to display all resolvable classes in a code-hint menu when autocompleting annotations, as&lt;br/&gt;
basically any class can be used for annotations.&lt;/p&gt;

&lt;p&gt;To make it possible for IDEs to detect classes which are explicitly meant to be used as annotations, it would be nice to agree on some common&lt;br/&gt;
way of documenting annotations in PHPDocBlocks.&lt;/p&gt;

&lt;p&gt;Here&apos;s an example of what this could look like:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/pulse00/doctrine2/commit/25a14e9edc406edfd33e54fc38922a191e9cbe83&quot; class=&quot;external-link&quot;&gt;https://github.com/pulse00/doctrine2/commit/25a14e9edc406edfd33e54fc38922a191e9cbe83&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This way IDEs can prioritize annotated classes in code-hints and add additional information to the user. &lt;/p&gt;</description>
                <environment></environment>
            <key id="12701">DDC-1198</key>
            <summary>Add PHPDocs to annotationclasses</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="pulse00">Robert Gruendler</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Jun 2011 11:35:38 +0000</created>
                <updated>Wed, 8 Jun 2011 11:35:38 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1123] Confusing error message when an ID is missing</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1123</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The error message you get when an entity is missing an ID when attempting to persist it is rather confusing.&lt;/p&gt;

&lt;p&gt;&quot;Entity of type Some\Entity\Name is missing an assigned ID.&quot;&lt;/p&gt;

&lt;p&gt;This does not tell me anything at all. I had absolutely no idea what an assigned ID was. I totally randomly noticed that I had mistyped @GeneratedValue as @GenratedValue, and fixing it fixed the issue.&lt;/p&gt;

&lt;p&gt;Perhaps the message makes sense if you&apos;re familiar with Doctrine 2 internals, but I think it should be changed to something more helpful, such as &quot;Entity of type X is missing primary key&quot;. &lt;/p&gt;

&lt;p&gt;Alternatively it could keep the same message, but it could suggest a possible error (&quot;Does the entity have a primary key set?&quot;) or perhaps the documentation could include a reference to it to help debug.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12575">DDC-1123</key>
            <summary>Confusing error message when an ID is missing</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="jhartikainen">Jani Hartikainen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Apr 2011 02:03:30 +0000</created>
                <updated>Tue, 15 Nov 2011 06:48:53 +0000</updated>
                                    <version>2.0.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16832" author="pmliju" created="Tue, 15 Nov 2011 06:48:29 +0000"  >&lt;p&gt;I too came across the same issue. The error message is not up to the mark here. In my case, mapping for primary key was missing the generator strategy,&lt;/p&gt;

&lt;p&gt;&amp;lt;generator strategy=&quot;IDENTITY&quot;/&amp;gt;&lt;/p&gt;

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

<item>
            <title>[DDC-1103] Addding an event before the load of collections</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1103</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;An event triggered when loading collections would be useful for performances. The use case would be batch querying some stuff instead of doing a query per object of the collection in a postLoad event.&lt;br/&gt;
For instance, the Translatable extension from &lt;a href=&quot;https://github.com/l3pp4rd/DoctrineExtensions&quot; class=&quot;external-link&quot;&gt;https://github.com/l3pp4rd/DoctrineExtensions&lt;/a&gt; loads the translations on postLoad which result in many queries. Being able to load them all in a single query would be useful.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12534">DDC-1103</key>
            <summary>Addding an event before the load of collections</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="stof">Christophe Coevoet</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Apr 2011 02:45:57 +0000</created>
                <updated>Tue, 5 Apr 2011 03:20:22 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15680" author="gediminasm" created="Tue, 5 Apr 2011 03:20:22 +0000"  >&lt;p&gt;I think custom persisters will solve these issues, lets wait for them, there are already enough events&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1015] @DiscriminatorColumn is not required anymore</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1015</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Since &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-514&quot; title=&quot;Default for discriminator column&quot;&gt;&lt;del&gt;DDC-514&lt;/del&gt;&lt;/a&gt; there is a default in place for this, thus the description is wrong in stating this is required.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12353">DDC-1015</key>
            <summary>@DiscriminatorColumn is not required anymore</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="k-fish">Karsten Dambekalns</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Feb 2011 10:29:25 +0000</created>
                <updated>Thu, 3 Feb 2011 10:29:25 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1010] Crash when fetching results from qb inside postLoad event</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1010</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I registered an event listener to my entity manager and on a postLoad event, I want to prepare some data in a nice way (fetch translations for my library + store into associative array into entity). Here&apos;s my snippet:&lt;/p&gt;

&lt;div class=&quot;code panel&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 TranslationListener &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; EventSubscriber
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSubscribedEvents()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; array(Events::postLoad);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function postLoad(LifecycleEventArgs $args)
    {
        $em = $args-&amp;gt;getEntityManager();
        $entity = $args-&amp;gt;getEntity();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($entity &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Lib) {
            $qb = $em-&amp;gt;createQueryBuilder();
            $qb = $qb-&amp;gt;select(&apos;T&apos;)-&amp;gt;from(&apos;Translate&apos;, &apos;T&apos;)-&amp;gt;join(&apos;T.locale&apos;, &apos;TT&apos;)-&amp;gt;where(&apos;T.lib = ?1&apos;)-&amp;gt;setParameter(1, $entity-&amp;gt;idLib);
            $res = $qb-&amp;gt;getQuery()-&amp;gt;getResult();
            foreach ($res as $tr) {
                $entity-&amp;gt;tr[$tr-&amp;gt;locale-&amp;gt;idLocale] = $tr;
            }
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When this code is run (eg. getting the Library objects), I got a crash where getResult() is called:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Fatal error: Call to a member function fetch() on a non-object in /home/thepianoguy/testproject/trunk/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php on line 126
Call Stack
#	Time	Memory	Function	Location
1	0.0004	656080	{main}( )	../index.php:0
2	0.1081	18760176	TApplication-&amp;gt;run( )	../index.php:48
3	0.2637	33817288	TApplication-&amp;gt;runService( )	../TApplication.php:382
4	0.2637	33817288	TPageService-&amp;gt;run( )	../TApplication.php:1095
5	0.2698	34788448	TPageService-&amp;gt;runPage( )	../TPageService.php:444
6	0.2715	34986768	TPage-&amp;gt;run( )	../TPageService.php:498
7	0.2716	34989128	TPage-&amp;gt;processNormalRequest( )	../TPage.php:198
8	0.3383	42770128	TControl-&amp;gt;loadRecursive( )	../TPage.php:215
9	0.3383	42770208	ContactUserAddEdit-&amp;gt;onLoad( )	../TControl.php:1286
10	0.3383	42771912	ContactUserAddEdit-&amp;gt;loadData( )	../ContactUserAddEdit.php:56
11	0.3452	43436904	Doctrine\ORM\AbstractQuery-&amp;gt;getResult( )	../ContactUserAddEdit.php:124
12	0.3452	43437296	Doctrine\ORM\AbstractQuery-&amp;gt;execute( )	../AbstractQuery.php:366
13	0.4160	47009328	Doctrine\ORM\Internal\Hydration\AbstractHydrator-&amp;gt;hydrateAll( )	../AbstractQuery.php:537
14	0.4160	47011504	Doctrine\ORM\Internal\Hydration\ObjectHydrator-&amp;gt;_hydrateAll( )	../AbstractHydrator.php:99
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I comment the line 137 in Doctrine/ORM/Internal/Hydration/AbstractHydrator in _cleanup(), my code works fine:&lt;br/&gt;
//        $this-&amp;gt;_stmt = null;&lt;/p&gt;

&lt;p&gt;I think there is a problem when using alredy used entity manager and query builder inside the postLoad event.&lt;/p&gt;</description>
                <environment>PHP 5.3.3-1ubuntu9.3&lt;br/&gt;
KUbuntu 10.10</environment>
            <key id="12342">DDC-1010</key>
            <summary>Crash when fetching results from qb inside postLoad event</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="thepianoguy">Matevz Jekovec</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Feb 2011 05:16:36 +0000</created>
                <updated>Wed, 23 Jan 2013 22:37:11 +0000</updated>
                                    <version>2.0.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15208" author="beberlei" created="Wed, 2 Feb 2011 13:37:34 +0000"  >&lt;p&gt;The hydrator is reused internally, this is potentially dangerous as I figure from your use-case.&lt;/p&gt;</comment>
                    <comment id="15209" author="beberlei" created="Wed, 2 Feb 2011 13:45:15 +0000"  >&lt;p&gt;A workaround is to re-registr the object hydrator under a new name&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$configuration-&amp;gt;setHydrationMode(&lt;span class=&quot;code-quote&quot;&gt;&quot;object2&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\Internal\Hydration\ObjectHydrator&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and use it in your query.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query-&amp;gt;setHydrationMode(&lt;span class=&quot;code-quote&quot;&gt;&quot;object2&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19387" author="ocramius" created="Wed, 23 Jan 2013 22:37:11 +0000"  >&lt;p&gt;Marking as documentation issue, since the user has to be warned that `postLoad` has to use a dedicated hydrator to execute more load operations.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-987] How to register lifecycle callbacks from YAML is not done correctly in the Events section of the documentation.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-987</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/events.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/events.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above URL has an example of how to register lifecycle callbacks from YAML, but actually it does not work. The correct way of doing it is mentioned on the page: &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/yaml-mapping.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/yaml-mapping.html&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12303">DDC-987</key>
            <summary>How to register lifecycle callbacks from YAML is not done correctly in the Events section of the documentation.</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="vanamir">Amir</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jan 2011 16:17:49 +0000</created>
                <updated>Fri, 14 Jan 2011 16:17:49 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-986] bad cli commands in ORM introduction</title>
                <link>http://doctrine-project.org/jira/browse/DDC-986</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I read mini tutorial &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.0/en/reference/introduction.html#mini-tutorial&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.0/en/reference/introduction.html#mini-tutorial&lt;/a&gt; and try run command &quot;doctrine orm:schema-tool --drop&quot;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;TIP When you create new model classes or alter existing ones you can recreate the database schema with the command doctrine orm:schema-tool --drop followed by doctrine orm:schema-tool --create.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It&apos;s not worked for me:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;InvalidArgumentException&amp;#93;&lt;/span&gt;                 &lt;br/&gt;
  Command &quot;orm:schema-tool&quot; is not defined. &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;But command &quot;doctrine orm:schema-tool:drop --force&quot; and &quot;doctrine orm:schema-tool:create&quot; is worked. &lt;br/&gt;
It&apos;s bug in documentation?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12302">DDC-986</key>
            <summary>bad cli commands in ORM introduction</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="stfalcon">Stepan Tanasiychuk</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jan 2011 15:28:27 +0000</created>
                <updated>Sat, 15 Jan 2011 04:22:56 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-977] Allow for multiple filters to be set from the command line</title>
                <link>http://doctrine-project.org/jira/browse/DDC-977</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m working with an existing database with a large number of tables, I would like to generate metadata mappings for a subset of tables using the command below. The Doctrine code states that the &apos;filter&apos; option should be an array but there doesn&apos;t seem to be any way to pass in an array from the command line? Is the command below the syntax intended for the filter option? If so this may be a Symfony issue?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Command&lt;/b&gt;&lt;br/&gt;
php doctrine.php orm:convert-mapping --filter=&quot;TableOne&quot; --filter=&quot;TableTwo&quot; --from-database xml /Path/To/Metadata&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Expected result&lt;/b&gt;&lt;br/&gt;
Processing entity &quot;TableOne&quot;&lt;br/&gt;
Processing entity &quot;TableTwo&quot;&lt;br/&gt;
Exporting &quot;xml&quot; mapping information to &quot;/Path/To/Metadata&quot;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Actual result&lt;/b&gt;&lt;br/&gt;
Processing entity &quot;TableTwo&quot;&lt;br/&gt;
Exporting &quot;xml&quot; mapping information to &quot;/Path/To/Metadata&quot;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Relevant code&lt;/b&gt;&lt;br/&gt;
&lt;a href=&quot;http://j.mp/eJD963&quot; class=&quot;external-link&quot;&gt;http://j.mp/eJD963&lt;/a&gt; (Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php)&lt;br/&gt;
&lt;a href=&quot;http://j.mp/f1ADXm&quot; class=&quot;external-link&quot;&gt;http://j.mp/f1ADXm&lt;/a&gt; (Symfony/Component/Console/Input/ArgvInput.php)&lt;/p&gt;</description>
                <environment>OSX, PHP 5.3, MySQL 5.1</environment>
            <key id="12291">DDC-977</key>
            <summary>Allow for multiple filters to be set from the command line</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="skl">Stephen Lang</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Jan 2011 10:43:11 +0000</created>
                <updated>Tue, 11 Jan 2011 10:44:19 +0000</updated>
                                    <version>Git Master</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15123" author="skl" created="Tue, 11 Jan 2011 10:44:19 +0000"  >&lt;p&gt;Changed priority to minor.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-935] copy function needs implementation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-935</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The (deep)copy function of the entity manager is not yet implemented. I assume this is known, but I could not find any open issue on it. This is a pretty powerfull feature once implemented. The function body is completely empty however. Perhaps the tried code could be added so I and others could try and resolve the known issue with this function (recursion limit reached). &lt;/p&gt;</description>
                <environment></environment>
            <key id="12231">DDC-935</key>
            <summary>copy function needs implementation</summary>
                <type id="3" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="jackvangalen">Jack van Galen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Dec 2010 10:29:00 +0000</created>
                <updated>Sun, 2 Jan 2011 03:13:16 +0000</updated>
                                    <version>2.0-RC2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14970" author="beberlei" created="Wed, 15 Dec 2010 12:07:26 +0000"  >&lt;p&gt;There was never code written for that function. I don&apos;t think its too problematic that this is missing. You only have to implement __clone (and do so safely as the docs/cookbook describes) and then pass this structure to persist. Optionally making use of cascade persist.&lt;/p&gt;</comment>
                    <comment id="15080" author="mstoehr" created="Sat, 1 Jan 2011 12:34:04 +0000"  >&lt;p&gt;I recently came accross this. Is there any best practice if you have to clone an entity who has several associations? I thought of grabbing them and clone them one by one. Or is there a more convenient way?&lt;/p&gt;</comment>
                    <comment id="15086" author="beberlei" created="Sun, 2 Jan 2011 03:12:50 +0000"  >&lt;p&gt;no, except implementing __clone and doing it there.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-900] Insufficient Error Information for orm:validate-schema</title>
                <link>http://doctrine-project.org/jira/browse/DDC-900</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Running &quot;doctrine orm:validate-schema&quot; would return -&amp;gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;Database&amp;#93;&lt;/span&gt; FAIL - The database schema is not in sync with the current mapping file.&lt;/p&gt;

&lt;p&gt;It should have at least return the name of the table/field that is not in sync.&lt;/p&gt;</description>
                <environment>linux, php 5.3.3</environment>
            <key id="12174">DDC-900</key>
            <summary>Insufficient Error Information for orm:validate-schema</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="aurorius">aurorius</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Nov 2010 06:37:16 +0000</created>
                <updated>Mon, 29 Nov 2010 06:37:16 +0000</updated>
                                    <version>2.0-BETA4</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-891] DDC-117: No sequence generation with composite foreign key</title>
                <link>http://doctrine-project.org/jira/browse/DDC-891</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given the following entity definitions, Doctrine does not attempt to manage generated values. For example, in MySQL, it is perfectly possible to create a composite primary key and set auto_increment on one of these. See below the code for issues that occur.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;User.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 */
class User {
	/**
	 * @Id
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;
	
	/**
	 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;PhoneNumber&quot;&lt;/span&gt;,mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;,cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $phoneNumbers;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setName ($name) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $name;
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;PhoneNumber.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 */
class PhoneNumber {
	/**
	 * @Id
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
	
	/**
	 * @Id
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;,cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $user;
	
	/**
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $phonenumber;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUser (User $user) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user = $user;
	}
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setPhoneNumber ($phoneNumber) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;phonenumber = $phoneNumber;
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Invokation&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$albert = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User;
$albert-&amp;gt;setName(&lt;span class=&quot;code-quote&quot;&gt;&quot;albert&quot;&lt;/span&gt;);
$em-&amp;gt;persist($albert);

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

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

&lt;p&gt;The first issue which occurs is that Doctrine does not generate the field &quot;id&quot; within PhoneNumber set to auto_increment.&lt;/p&gt;

&lt;p&gt;The second issue which occurs is that Doctrine becomes confused when inserting a new record into PhoneNumber, because of the following INSERT INTO statement:&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;Insert Statement&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;INSERT INTO PhoneNumber (user_id, phonenumber) VALUES (?, ?)
array(1) {
  [1]=&amp;gt;
  string(19) &lt;span class=&quot;code-quote&quot;&gt;&quot;albert home: 012345&quot;&lt;/span&gt;
}

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12158">DDC-891</key>
            <summary>DDC-117: No sequence generation with composite foreign key</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2010 00:40:24 +0000</created>
                <updated>Thu, 25 Nov 2010 06:05:05 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14830" author="romanb" created="Thu, 25 Nov 2010 02:28:52 +0000"  >&lt;p&gt;I don&apos;t think this will ever be possible.&lt;/p&gt;</comment>
                    <comment id="14831" author="felicitus" created="Thu, 25 Nov 2010 02:32:39 +0000"  >&lt;p&gt;Is there a technical reason for that? I mean, with &lt;a href=&quot;http://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; we are aiming for composite foreign keys, or is &lt;a href=&quot;http://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; cancelled?&lt;/p&gt;</comment>
                    <comment id="14835" author="beberlei" created="Thu, 25 Nov 2010 04:55:19 +0000"  >&lt;p&gt;A composite key is ALWAYS of the type &quot;ASSIGNED&quot; and cannot be a combination of different id generation strategies.&lt;/p&gt;

&lt;p&gt;You could however write a prePersist Listener that does this for you.&lt;/p&gt;</comment>
                    <comment id="14836" author="felicitus" created="Thu, 25 Nov 2010 06:05:05 +0000"  >&lt;p&gt;Okay, maybe this is a feature for 3.0 or so. However, I&apos;d suggest leaving this bug open as this is something which needs to be documented once &lt;a href=&quot;http://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; becomes integrated within the main branch.&lt;/p&gt;

&lt;p&gt;Additionally, Doctrine should complain about different ID generation strategies. Right now it silently ignores it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1444] Be able to set a value also used in relation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1444</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am using a string field for data and for an optional relation too. &lt;br/&gt;
I am not using a ID because the second entity is from a third party application.&lt;/p&gt;

&lt;p&gt;I used two variables in my entity mapping to the same field.&lt;/p&gt;

&lt;p&gt;     /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@var string $an&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@ORM\Column(name=&quot;an&quot;, type=&quot;string&quot;, length=20, nullable=false)&lt;br/&gt;
     */&lt;br/&gt;
    private $an;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;    /**    &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ORM\OneToOne(targetEntity=&quot;DataLinked&quot;)&lt;/li&gt;
	&lt;li&gt;@ORM\JoinColumn(name=&quot;an&quot;, referencedColumnName=&quot;part&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    private $linked;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The getter is working fine.&lt;/p&gt;


&lt;p&gt;The problem occurs when I create a new entity and would like to persist it.&lt;br/&gt;
As the field is used twice, the value of the second variable is erasing the first value.&lt;/p&gt;


&lt;p&gt;At the line 525 of Doctrine\ORM\Persisters\BasicEntityPersister , I added the following test to update a null value only if there is no fieldName existing.&lt;/p&gt;

&lt;p&gt;...&lt;br/&gt;
                foreach ($assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;sourceToTargetKeyColumns&amp;#39;&amp;#93;&lt;/span&gt; as $sourceColumn =&amp;gt; $targetColumn) {&lt;br/&gt;
                    if ($newVal === null) {&lt;br/&gt;
                        if(!isset($this-&amp;gt;_class-&amp;gt;fieldNames&lt;span class=&quot;error&quot;&gt;&amp;#91;$sourceColumn&amp;#93;&lt;/span&gt;) || in_array($sourceColumn, $this-&amp;gt;_class-&amp;gt;identifier)) &lt;/p&gt;
{
                            $result[$owningTable][$sourceColumn] = null;
                        }
&lt;p&gt;                    } else if ($targetClass-&amp;gt;containsForeignIdentifier) {&lt;br/&gt;
...&lt;/p&gt;


&lt;p&gt;(!isset($this-&amp;gt;_class-&amp;gt;fieldNames&lt;span class=&quot;error&quot;&gt;&amp;#91;$sourceColumn&amp;#93;&lt;/span&gt;)   : Test if there is no existing fieldName&lt;br/&gt;
in_array($sourceColumn, $this-&amp;gt;_class-&amp;gt;identifier))    : avoid skipping identifier definition because ID is listed in fieldNames!&lt;/p&gt;

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

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13109">DDC-1444</key>
            <summary>Be able to set a value also used in relation</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="rapotor">Cedric Lahouste</reporter>
                        <labels>
                    </labels>
                <created>Fri, 21 Oct 2011 09:06:06 +0000</created>
                <updated>Fri, 21 Oct 2011 09:06:06 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1423] Improving ReadOnly annotation by caching query results</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1423</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should be able to tell Doctrine that we want the result of requests on ReadOnly marked Entities to be cached. &lt;/p&gt;

&lt;p&gt;For instance:&lt;br/&gt;
$person-&amp;gt;getMoodInformation();&lt;br/&gt;
$person-&amp;gt;getCityInformation();&lt;/p&gt;

&lt;p&gt;CityInformation are not likely to change so it would make sense to cache it and retrieve only MoodInformation (by using an annotation on the concerned Entity).&lt;/p&gt;

&lt;p&gt;What would be even better is to tag which properies we want to hydrate from database and which properties we want to hydrate from cache.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13088">DDC-1423</key>
            <summary>Improving ReadOnly annotation by caching query results</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="jsilvestre">Joseph Silvestre</reporter>
                        <labels>
                    </labels>
                <created>Sun, 16 Oct 2011 10:02:53 +0000</created>
                <updated>Sun, 16 Oct 2011 11:01:50 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1413] Automatically create index for discriminator column</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1413</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice if the command line orm schema-tool would suggest an index on the discriminator column for single inheritance tables.  Since that column would almost always be in the query, I can&apos;t think of a case when you wouldn&apos;t want it to be in an index&lt;/p&gt;</description>
                <environment></environment>
            <key id="13078">DDC-1413</key>
            <summary>Automatically create index for discriminator column</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ajbrown">A.J. Brown</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Oct 2011 15:57:13 +0000</created>
                <updated>Tue, 11 Oct 2011 15:57:13 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1409] Download common 404</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1409</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;404 on Common download link : &lt;a href=&quot;http://www.doctrine-project.org/projects/common/download&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/common/download&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13074">DDC-1409</key>
            <summary>Download common 404</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Oct 2011 13:18:23 +0000</created>
                <updated>Mon, 10 Oct 2011 13:18:23 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1405] Define semantics of comparison operators, particularly with regard to null values</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1405</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The Doctrine 2 reference documentation defines the comparison operators syntactically, as:&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;ComparisonOperator  ::= &quot;=&quot; | &quot;&amp;lt;&quot; | &quot;&amp;lt;=&quot; | &quot;&amp;lt;&amp;gt;&quot; | &quot;&amp;gt;&quot; | &quot;&amp;gt;=&quot; | &quot;!=&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, without experimentation, it is pure guesswork to tell whether e. g. null = null, or e. g. null &amp;lt;&amp;gt; null, or null = 0, or null &amp;lt;&amp;gt; 0 are considered true statements in DQL.&lt;/p&gt;

&lt;p&gt;In SQL semantics, all four statements would be false (or more precisely, null). In PHP semantics, both null == null and null == 0 would be true, while null != null and null != 0 would be false.&lt;/p&gt;

&lt;p&gt;It would be helpful to have the semantics of the comparison operators defined. While comparisons with non-null values behave in a common-sense way, it is hard to guess how queries involving comparison operators on fields allowing null values or null query arguments will filter the results, without knowing the exact semantics of the comparison operators with regard to null values.&lt;/p&gt;

&lt;p&gt;It would be great if this could be clarified in the docs.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13061">DDC-1405</key>
            <summary>Define semantics of comparison operators, particularly with regard to null values</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Oct 2011 23:03:45 +0000</created>
                <updated>Wed, 12 Oct 2011 23:09:44 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1332] Specify Custom ProxyFactory</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1332</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;My tweet:&lt;/p&gt;

&lt;p&gt;&amp;gt; @beberlei Have you heard of overriding the ProxyFactory to allow caching of lazy-loaded entities? Trying to do that now &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;The majority of our data is quite stagnant and so I was shoehorning the capability of the generated proxies to use a custom class.&lt;/p&gt;

&lt;p&gt;My new proxy, in short, will lazy-load the data as normal the first time around, but also stores it in Memcache using an injected adapter.  Upon subsequent lazy-loading, memcache is used rather than a call to the DB.&lt;/p&gt;

&lt;p&gt;I can&apos;t decide if this is better suited for the EntityPersister (which has already been discussed at length), but it seems to fits nicely with a custom proxy.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12921">DDC-1332</key>
            <summary>Specify Custom ProxyFactory</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ericclemmons">Eric Clemmons</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Aug 2011 03:52:31 +0000</created>
                <updated>Mon, 15 Aug 2011 13:46:22 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16337" author="beberlei" created="Mon, 15 Aug 2011 09:59:24 +0000"  >&lt;p&gt;This is the wrong extension point to override the proxy factory. It should be in the persisters.&lt;/p&gt;</comment>
                    <comment id="16339" author="ericclemmons" created="Mon, 15 Aug 2011 13:46:22 +0000"  >&lt;p&gt;Ah, so my doubts were well founded.&lt;/p&gt;

&lt;p&gt;The branch allowing custom EntityPersisters has not been merged in yet, has it?  Or, a better question, will it be?  That will dicate if I need to maintain a separate fork for this functionality or find other means to handle this.&lt;/p&gt;

&lt;p&gt;I know how hesitant we were for adding any extension point, because then we feel we have to support it, which makes me wonder if &quot;LifeCycleCallback::preFetch&quot; or similar is a potential alternative.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1329] Documentation for @JoinColumn may be incorrect</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1329</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The Documentation for @JoinColumn annotation states:&lt;br/&gt;
&quot;This annotation is not required. If its not specified the attributes name and referencedColumnName are inferred from the table and primary key names.&quot;&lt;/p&gt;

&lt;p&gt;However, this seems not to be correct. If you have non-standard name for the @Id columns for a @OneToMany/@ManyToMany the name and referencedColumnName are not correctly inferred.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gist.github.com/e61bf8f4462870ffd4f3&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/e61bf8f4462870ffd4f3&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12918">DDC-1329</key>
            <summary>Documentation for @JoinColumn may be incorrect</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="djones">Damon Jones</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Aug 2011 18:35:50 +0000</created>
                <updated>Sat, 13 Aug 2011 18:35:50 +0000</updated>
                                                                    <component>Documentation</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2134] Add referential integrity check for MySQL to console commands</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2134</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Today I spent some time solving a PHP &apos;White Screen of Death&apos;. I traced it back to a Entity of which the proxy&apos;s __load() function was invoked because af a EXTRA_LAZY association. Due to incorrect database contents (the entry ID was changed due to an update: referential integrity broke), the __load() query resulted in no results. The EntityNotFoundException did for some reason not show up in our logs, probably because the lazy load was triggered by a magic __toString() function.&lt;/p&gt;

&lt;p&gt;The cause is because of the way we populate or tables with domain data: &lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
SET FOREIGN_KEY_CHECKS = 0;
#IMPORT STUFF from CSV
SET FOREIGN_KEY_CHECKS = 1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;MySQL does not trigger any errors when the foreign key checks are turned back on, leaving the table in an inconsistent state. &lt;/p&gt;

&lt;p&gt;To prevent this, I found some information in this post: &lt;a href=&quot;http://www.mysqlperformanceblog.com/2011/11/18/eventual-consistency-in-mysql/&quot; class=&quot;external-link&quot;&gt;http://www.mysqlperformanceblog.com/2011/11/18/eventual-consistency-in-mysql/&lt;/a&gt;, which I used to come with the following queries&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
#Check the constraints of a specific database
SELECT *
	FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE 
		WHERE TABLE_SCHEMA = &apos;databaseName&apos;
		AND REFERENCED_TABLE_NAME IS NOT NULL

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
#Generate table specific queries to find orphaned entries
SELECT CONCAT(
	 &apos;SELECT &apos;, GROUP_CONCAT(DISTINCT CONCAT(K.CONSTRAINT_NAME, &apos;.&apos;, P.COLUMN_NAME,
	  &apos; AS `&apos;, P.TABLE_SCHEMA, &apos;.&apos;, P.TABLE_NAME, &apos;.&apos;, P.COLUMN_NAME, &apos;`&apos;) ORDER BY P.ORDINAL_POSITION), &apos; &apos;,
	 	&apos;FROM &apos;, K.TABLE_SCHEMA, &apos;.&apos;, K.TABLE_NAME, &apos; AS &apos;, K.CONSTRAINT_NAME, &apos; &apos;,
	 		&apos;LEFT OUTER JOIN &apos;, K.REFERENCED_TABLE_SCHEMA, &apos;.&apos;, K.REFERENCED_TABLE_NAME, &apos; AS &apos;, K.REFERENCED_TABLE_NAME, &apos; &apos;,
	 		&apos; ON (&apos;, GROUP_CONCAT(CONCAT(K.CONSTRAINT_NAME, &apos;.&apos;, K.COLUMN_NAME) ORDER BY K.ORDINAL_POSITION),
	 		&apos;) = (&apos;, GROUP_CONCAT(CONCAT(K.REFERENCED_TABLE_NAME, &apos;.&apos;, K.REFERENCED_COLUMN_NAME) ORDER BY K.ORDINAL_POSITION), &apos;) &apos;,
	 		&apos;WHERE &apos;, K.REFERENCED_TABLE_NAME, &apos;.&apos;, K.REFERENCED_COLUMN_NAME, &apos; IS NULL;&apos;
	  )
    INTO OUTFILE &apos;/tmp/verifyDatabaseTableIntegrity.sql&apos;
    FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE K
      INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE P
        ON (K.TABLE_SCHEMA, K.TABLE_NAME) = (P.TABLE_SCHEMA, P.TABLE_NAME)
        AND P.CONSTRAINT_NAME = &apos;PRIMARY&apos;
    WHERE K.TABLE_SCHEMA = &apos;databaseName&apos;
      AND K.REFERENCED_TABLE_NAME IS NOT NULL
      GROUP BY K.CONSTRAINT_NAME;
	
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;By running the generated queries, we can now easily find the records that break referential integrity. &lt;/p&gt;

&lt;p&gt;It might be an idea of adding this functionality to the orm:validate-schema, or a new orm:validate-database-integrity?&lt;/p&gt;</description>
                <environment>MySQL</environment>
            <key id="14208">DDC-2134</key>
            <summary>Add referential integrity check for MySQL to console commands</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="holtkamp">Menno Holtkamp</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Nov 2012 13:08:10 +0000</created>
                <updated>Fri, 9 Nov 2012 17:17:04 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2103] Add support for using AliasResultVariable in WhereClause</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2103</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice if supported writing in DQL:&lt;/p&gt;

&lt;p&gt;SELECT LOWER(a.name) AS name FROM User a WHERE name LIKE ?&lt;/p&gt;

&lt;p&gt;The resulting sql:&lt;/p&gt;

&lt;p&gt;SELECT LOWER(c0_.name) AS sclr0 FROM users c0_ WHERE LOWER(c0_.name) LIKE ?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14167">DDC-2103</key>
            <summary>Add support for using AliasResultVariable in WhereClause</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Oct 2012 12:31:49 +0000</created>
                <updated>Thu, 25 Oct 2012 12:31:49 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2076] Optimization for MEMBER OF</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2076</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently, using MEMBER OF for a ManyToMany collection does a join on the table of the related entity, whereas all it needs is in the join table.&lt;/p&gt;

&lt;p&gt;Using the following DQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; p &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Player p
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; NOT :team MEMBER OF p.targetedBy
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the current generated SQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; NOT EXISTS (&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; 1 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; player_team p1_ INNER JOIN Team t2_ ON p1_.team_id = t2_.id &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; p1_.player_id = p0_.id AND t2_.id = ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;whereas it could drop the join:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; NOT EXISTS (&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; 1 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; player_team p1_ &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; p1_.player_id = p0_.id AND p1_.team_id = ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14126">DDC-2076</key>
            <summary>Optimization for MEMBER OF</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="stof">Christophe Coevoet</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Sun, 14 Oct 2012 08:43:09 +0000</created>
                <updated>Sun, 14 Oct 2012 08:43:09 +0000</updated>
                                    <version>Git Master</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2053] [GH-460] added support to extend strategies for IdGenerators</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2053</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 Powerhamster:&lt;/p&gt;

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

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

&lt;p&gt;Mapping drivers now use extended classmetadata class to find constants of generator types.&lt;br/&gt;
Method completeIdGeneratorMapping is now protected and can be extended&lt;/p&gt;</description>
                <environment></environment>
            <key id="14088">DDC-2053</key>
            <summary>[GH-460] added support to extend strategies for IdGenerators</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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 Oct 2012 18:40:49 +0000</created>
                <updated>Wed, 3 Oct 2012 08:33:52 +0000</updated>
                                    <version>Git Master</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18762" author="beberlei" created="Wed, 3 Oct 2012 08:33:52 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-460&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/460&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/460&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2035] XML Mapping : add attribute &quot;length&quot; for tag &quot;id&quot;</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2035</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;b&gt;XML mapping :&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&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;string&quot;&lt;/span&gt; length=&lt;span class=&quot;code-quote&quot;&gt;&quot;16&quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Generate SQL :&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;id varchar(255) not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;It&apos;s not possible with XML mapping to have :&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; id varchar(16) not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Because tag &quot;id&quot; doesn&apos;t support &quot;length&quot; attribute.&lt;br/&gt;
Please add this attribute&lt;/p&gt;</description>
                <environment>Linux, Doctrine ORM 2.3.0, MySQL</environment>
            <key id="14047">DDC-2035</key>
            <summary>XML Mapping : add attribute &quot;length&quot; for tag &quot;id&quot;</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="seros">Erik M&#252;ller</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Sep 2012 10:59:22 +0000</created>
                <updated>Sat, 29 Sep 2012 19:17:03 +0000</updated>
                                    <version>2.2.3</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18686" author="fabio.bat.silva" created="Thu, 20 Sep 2012 12:45:20 +0000"  >&lt;p&gt;Hi Erik,&lt;/p&gt;

&lt;p&gt;The atribute &quot;id&quot; arealdy support &quot;length&quot; in the current doctrine version&lt;br/&gt;
: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/2.3/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php#L259&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/2.3/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php#L259&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which version are you using ?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2030] better way to detect class parents</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2030</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi!&lt;br/&gt;
Currently i&apos;m heavy using doctrine to generate entities starting form database schema (aprox 500 tables with thousand of relations).&lt;/p&gt;

&lt;p&gt;I&apos;m trying to detect some inheritance cases, but there is a problem.&lt;/p&gt;

&lt;p&gt;Doctrine always uses PHP class inheritance to detect entity hierarchy, but generating entities starting from database, i have not yet any php class.&lt;/p&gt;

&lt;p&gt;There is a better way to detect entities hierarchy? Without php classes... &lt;br/&gt;
Mapping files should be self-sufficient, even without php files.&lt;/p&gt;

&lt;p&gt;The practical case is:&lt;br/&gt;
in &lt;tt&gt;DatabaseDriver&lt;/tt&gt; i&apos;m trying to call &lt;tt&gt;$metadata-&amp;gt;addDiscriminatorMapClass($name, $className)&lt;/tt&gt; method, but it raises an exception if &lt;tt&gt;$classNam&lt;/tt&gt; does not exists.&lt;/p&gt;

&lt;p&gt;Even if i manualy create XML mapping files, and then i try to generate php entityes. There is the same problem. &lt;tt&gt;XmlDriver&lt;/tt&gt; tries to call &lt;tt&gt;setDiscriminatorMap&lt;/tt&gt; method that raises the same exception.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14035">DDC-2030</key>
            <summary>better way to detect class parents</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="goetas">Asmir Mustafic</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 Sep 2012 10:59:17 +0000</created>
                <updated>Thu, 13 Sep 2012 10:59:17 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1993] New method required: ClassMetadataInfo::isAssociationNullable()</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1993</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&apos;m working with Symfony 2.1, and I need to know if an association is nullable for a given entity (to know if a form field should be marked as &apos;required&apos;). So I&apos;d like to have a &lt;tt&gt;isAssociationNullable()&lt;/tt&gt; method in the &lt;tt&gt;ClassMetadataInfo&lt;/tt&gt; class, that should do the same thing that the &lt;tt&gt;isNullable()&lt;/tt&gt; method does for fields.&lt;/p&gt;

&lt;p&gt;You can see more information about the problem on the &lt;a href=&quot;https://github.com/symfony/symfony/issues/5315&quot; class=&quot;external-link&quot;&gt;Symfony issue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13980">DDC-1993</key>
            <summary>New method required: ClassMetadataInfo::isAssociationNullable()</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="gregoire_m">gregoire_m</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Aug 2012 08:24:33 +0000</created>
                <updated>Wed, 22 Aug 2012 08:24:33 +0000</updated>
                                    <version>2.2</version>
                                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1988] Add Any and ManyToAny annotations</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1988</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be really nice to have @Any and @ManyToAny relations/annotations implemented like on Hibernate.&lt;br/&gt;
&lt;a href=&quot;http://docs.jboss.org/hibernate/orm/4.1/javadocs/org/hibernate/annotations/ManyToAny.html&quot; class=&quot;external-link&quot;&gt;http://docs.jboss.org/hibernate/orm/4.1/javadocs/org/hibernate/annotations/ManyToAny.html&lt;/a&gt;&lt;br/&gt;
Right now I&apos;ve implemented these in a Symfony2 bundle (that I&apos;d be happy to share once it&apos;s ready and a bit documented), using listeners on postLoad, preFlush and prePersist&lt;br/&gt;
However I think this is a very common use case that anyone will encounter at least once/twice in every middle/big-sized project, and for this reason I think this should be implemented as a core feature.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13973">DDC-1988</key>
            <summary>Add Any and ManyToAny annotations</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sroddy">Stefano Rodriguez</reporter>
                        <labels>
                    </labels>
                <created>Sat, 18 Aug 2012 08:50:21 +0000</created>
                <updated>Sat, 18 Aug 2012 09:05:49 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1983] Incorrect use statement in 25.1.3. Configuration example (Doctrine Console)</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1983</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The code example here:&lt;br/&gt;
&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/tools.html#configuration-non-pear&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/tools.html#configuration-non-pear&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the second &quot;use&quot; statement it references a &quot;EntityManagerHelper&quot; from the &quot;Doctrine\DBAL\Tools\Console\Helper\&quot; package. However, it does not exist there. It does exist in the &quot;Doctrine\ORM\Tools\Console\Helper\&quot; package though, and replacing it seems to work.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13966">DDC-1983</key>
            <summary>Incorrect use statement in 25.1.3. Configuration example (Doctrine Console)</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="atli">Atli Thor Jonsson</reporter>
                        <labels>
                        <label>Cli</label>
                        <label>documentation</label>
                    </labels>
                <created>Wed, 15 Aug 2012 05:58:31 +0000</created>
                <updated>Wed, 15 Aug 2012 05:58:31 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1950] Useful exception when combining Column with ManyToOne</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1950</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When applying both @Column and @ManyToOne annotations to a field, it blows up with crazy internal errors. It would be great if this case &amp;#8211; and similar cases &amp;#8211; could throw a nice exception which tells the user what he did wrong.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13886">DDC-1950</key>
            <summary>Useful exception when combining Column with ManyToOne</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="igorw">Igor Wiedler</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Jul 2012 20:10:42 +0000</created>
                <updated>Thu, 26 Jul 2012 20:10:42 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1630] Get PersistentCollection::getDeleteDiff is empty when collection changes from 1 item to zero items</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1630</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment>Symfony2</environment>
            <key id="13405">DDC-1630</key>
            <summary>Get PersistentCollection::getDeleteDiff is empty when collection changes from 1 item to zero items</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="lmcd">Lee</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Jan 2012 18:38:16 +0000</created>
                <updated>Sat, 9 Feb 2013 21:52:48 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17380" author="deeky666" created="Thu, 9 Feb 2012 00:23:50 +0000"  >&lt;p&gt;Same problem here. I wanted to write some unit tests, checking the entity relations and ran into exactly the same problem. Maybe my code can provide some more information (Group entity is the owning side, role entity is the inverse side):&lt;/p&gt;

&lt;p&gt;WHAT 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;        /**
         * Test ArrayCollection
         */
        $group = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Group(&apos;Group Test&apos;);
        $em-&amp;gt;persist($group);
        $em-&amp;gt;flush();

        $groups = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
        $groups-&amp;gt;add($group);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;setGroups($groups);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($groups, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;getGroups());

        /**
         * Test PersistentCollection
         */
        $em-&amp;gt;persist($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role);
        $em-&amp;gt;flush();

        $groups = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;getGroups();
        $groups-&amp;gt;removeElement($group); &lt;span class=&quot;code-comment&quot;&gt;// first remove element before adding a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; one
&lt;/span&gt;
        $group = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Group(&apos;Group Test 2&apos;);
        $em-&amp;gt;persist($group);
        $em-&amp;gt;flush();
        $groups-&amp;gt;add($group);        

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;setGroups($groups);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($groups, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;getGroups());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;WHAT WORKS:&lt;/p&gt;

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

        $groups = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
        $groups-&amp;gt;add($group);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;setGroups($groups);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($groups, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;getGroups());

        /**
         * Test PersistentCollection
         */
        $em-&amp;gt;persist($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role);
        $em-&amp;gt;flush();

        $groups = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;getGroups();

        $group2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Group(&apos;Group Test 2&apos;);
        $em-&amp;gt;persist($group2);
        $em-&amp;gt;flush();
        $groups-&amp;gt;add($group2);  &lt;span class=&quot;code-comment&quot;&gt;// first adding a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; element before removing one
&lt;/span&gt;
        $groups-&amp;gt;removeElement($group);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;setGroups($groups);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($groups, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;role-&amp;gt;getGroups());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hope this helps in any way... I tried figuring it out on my own but I am too drunk right now xD&lt;/p&gt;</comment>
                    <comment id="17404" author="beberlei" created="Fri, 10 Feb 2012 20:41:45 +0000"  >&lt;p&gt;Thanks for the report, formatted it&lt;/p&gt;</comment>
                    <comment id="17405" author="beberlei" created="Fri, 10 Feb 2012 20:42:00 +0000"  >&lt;p&gt;Which version is that btw?&lt;/p&gt;</comment>
                    <comment id="17429" author="deeky666" created="Thu, 16 Feb 2012 21:52:05 +0000"  >&lt;p&gt;Occurs in version 2.1.6&lt;/p&gt;</comment>
                    <comment id="17452" author="beberlei" created="Mon, 20 Feb 2012 10:00:07 +0000"  >&lt;p&gt;If group is the owning side, why do you only set Role::$groups? This has to be the other way around or not?&lt;/p&gt;</comment>
                    <comment id="17453" author="beberlei" created="Mon, 20 Feb 2012 10:33:24 +0000"  >&lt;p&gt;@Steve&lt;/p&gt;

&lt;p&gt;I cannot reproduce your issue.&lt;/p&gt;

&lt;p&gt;Attached is a test script.&lt;/p&gt;

&lt;p&gt;Your code is very weird btw, why are you getting and setting groups collection? It is passed by reference so you can just have something like $role-&amp;gt;addGroup() and $role-&amp;gt;removeGroup() and encapsulate the logic?&lt;/p&gt;

&lt;p&gt;Also your tests are pretty useless, you check if two variables which are the same reference to the same collection are the same. Which should always be true.&lt;/p&gt;

&lt;p&gt;@Lee&lt;/p&gt;

&lt;p&gt;Can you provide more details? I cant verify this without more details.&lt;/p&gt;</comment>
                    <comment id="19505" author="asm89" created="Sat, 9 Feb 2013 21:52:48 +0000"  >&lt;p&gt;Can anyone provide us with more feedback?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11164" name="DDC1630Test.php" size="1446" author="beberlei" created="Mon, 20 Feb 2012 10:33:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1555] Reference. 8 Work. with obj. Making &quot;see &quot;Transitive Persistence&quot;&quot; as link</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1555</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;8. Working with Objects:&lt;br/&gt;
&quot;... if the relationships from X to these other entities are mapped with cascade=PERSIST or cascade=ALL (see &quot;Transitive Persistence&quot;).&quot;&lt;br/&gt;
&quot;... with cascade=REMOVE or cascade=ALL (see &quot;Transitive Persistence&quot;).&quot;&lt;br/&gt;
and so on.&lt;br/&gt;
Maybe it&apos;s reasonable to make &quot;Transitive Persistence&quot; as links to &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/working-with-associations.html#transitive-persistence-cascade-operations&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/working-with-associations.html#transitive-persistence-cascade-operations&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13293">DDC-1555</key>
            <summary>Reference. 8 Work. with obj. Making &quot;see &quot;Transitive Persistence&quot;&quot; as link</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="dattaya">Yaroslav Kiliba</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Dec 2011 14:51:35 +0000</created>
                <updated>Thu, 22 Dec 2011 14:55:31 +0000</updated>
                                    <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>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1518] Method chaining in Setters of generated entity classes</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1518</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi.&lt;br/&gt;
It would be nice if the set-methods of the generated entity classes would return the entity instance itself, so that method chaining is possible.&lt;br/&gt;
Example:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;setUsername()
     -&amp;gt;setFirstname()
     -&amp;gt;setEmail();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In PHP 5.4 we can do even more nicer:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User()
     -&amp;gt;setUsername()
     -&amp;gt;setFirstname()
     -&amp;gt;setEmail();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If this is not wanted by everyone, the console tool could get a new argument to define if method chaining should be used or not.&lt;/p&gt;

&lt;p&gt;Implementation of this improvement would be very nice. Thanks.&lt;/p&gt;</description>
                <environment>Symfony2</environment>
            <key id="13236">DDC-1518</key>
            <summary>Method chaining in Setters of generated entity classes</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="naitsirch">Christian Stoller</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Dec 2011 13:45:40 +0000</created>
                <updated>Fri, 2 Dec 2011 13:45:40 +0000</updated>
                                                                    <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1511] Suggestion on the docs for batch processing</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1511</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am refering to the examples on&lt;/p&gt;

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

&lt;p&gt;Let&apos;s say you want to process a bulk of 25 objects and have a batchsize of 20.&lt;br/&gt;
With the code provided the last 5 would not be saved as far as I understand  unless you do another flush after the for-loop.&lt;/p&gt;

&lt;p&gt;This is probably very clear to any experienced Doctrine developer  but maybe it is also confusing for beginners like me (some internet sources say, that flush is executed automatically at the end of the request, but obviously it is not). Maybe this could be mentioned somewhere?&lt;/p&gt;</description>
                <environment>br0wser</environment>
            <key id="13221">DDC-1511</key>
            <summary>Suggestion on the docs for batch processing</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jamie0725">Jamie Wong</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Nov 2011 18:19:19 +0000</created>
                <updated>Fri, 25 Nov 2011 18:19:19 +0000</updated>
                                    <version>2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1494] Query results are overwritten by previous query.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1494</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am running a query that JOINs three tables, with a simple 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;$q = $em-&amp;gt;createQuery(&quot;

SELECT cat, n, c
FROM Project_Model_NoticeCategory cat
JOIN cat.notices n
JOIN n.chapters c
WHERE
c.id = :chapter_id

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

&lt;p&gt;When I do 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;  $q-&amp;gt;setParameter(&apos;chapter_id&apos;, 1);
  $a = $q-&amp;gt;getResult();

  $q-&amp;gt;setParameter(&apos;chapter_id&apos;, 2);
  $b = $q-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$b always has the wrong results. Running the following code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;  $q-&amp;gt;setParameter(&apos;chapter_id&apos;, 1);
  $a = $q-&amp;gt;getResult();

  $q-&amp;gt;setParameter(&apos;chapter_id&apos;, 2);
  $b = $q-&amp;gt;getResult();
  $z = $q-&amp;gt;getArrayResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;BUG Results: $b != $z (getArrayResult IS CORRECT, it refreshes the results) Note: $a==$b (which is wrong)&lt;/p&gt;

&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;There is a chapter table, this has a many-to-many join to notices (these are meta info&lt;br/&gt;
about the chapter &amp;#8211; a little like tagging a blog post) the notices are grouped into&lt;br/&gt;
categories.&lt;/p&gt;

&lt;p&gt;Data model:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;chapter&quot;&lt;/span&gt;)
 */
class Project_Model_Chapter
{
    /**
     * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
 
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $title;

	/**
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Project_Model_Notice&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;chapters&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $notices;
	
	.... /lots of code snipped/ ....
	
}


/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;notice&quot;&lt;/span&gt;)
 */
class Project_Model_Notice
{
	/**
     * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
 
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $title;
	
	/**
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Project_Model_Chapter&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;notices&quot;&lt;/span&gt;)
	 * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;chapter_notice&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $chapters;
	
	/**
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Project_Model_NoticeCategory&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;notices&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $notice_category;
	
	.... /lots of code snipped/ ....
	
}

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;notice_category&quot;&lt;/span&gt;)
 */
class Project_Model_NoticeCategory
{
    /**
     * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $title;
	
	/**
	 * Bidirectional - One-To-Many (INVERSE SIDE)
	 *
	 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Project_Model_Notice&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;notice_category&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $notices;

	.... /lots of code snipped/ ....
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Data fixtures:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$tools = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_NoticeCategory;
$tools-&amp;gt;setTitle(&apos;Tools&apos;);
		
$spanner = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_Notice;
$spanner-&amp;gt;setTitle(&apos;spanner&apos;);
$tools-&amp;gt;addNotice($spanner);
		
$drill = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_Notice;
$drill-&amp;gt;setTitle(&apos;power drill&apos;);
$tools-&amp;gt;addNotice($drill);
		
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($tools);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();

$tools = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_NoticeCategory;
$tools-&amp;gt;setTitle(&apos;Safety&apos;);
		
$gloves = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_Notice;
$gloves-&amp;gt;setTitle(&apos;gloves&apos;);
$tools-&amp;gt;addNotice($gloves);
		
$goggles = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_Notice;
$goggles-&amp;gt;setTitle(&apos;goggles&apos;);
$tools-&amp;gt;addNotice($goggles);
		
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($tools);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;flush();

$chapter1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_Chapter;
$chapter1-&amp;gt;setTitle(&apos;Chapter 1&apos;);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($chapter1);

$chapter2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Project_Model_Chapter;
$chapter2-&amp;gt;setTitle(&apos;Chapter 2&apos;);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;persist($chapter2);

$chapter1-&amp;gt;addNotice($spanner);
$chapter1-&amp;gt;addNotice($gloves);

$chapter2-&amp;gt;addNotice($spanner);
$chapter2-&amp;gt;addNotice($gloves);
$chapter2-&amp;gt;addNotice($drill);
$chapter2-&amp;gt;addNotice($goggles);

&lt;span class=&quot;code-comment&quot;&gt;// now persist and flush everything&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Initial investigation:&lt;/p&gt;

&lt;p&gt;I think it has something to do with HINT_REFRESH ? Stepping through:&lt;/p&gt;

&lt;p&gt;ObjectHydrator-&amp;gt;_hydrateRow&lt;br/&gt;
ObjectHydrator-&amp;gt;_getEntity&lt;/p&gt;

&lt;p&gt;when it requests the Project_Model_Category from the unit of work, it&lt;br/&gt;
seems that the second query is simply grabbing the cached results from&lt;br/&gt;
the first results. This MUST be wrong as the second query uses a&lt;br/&gt;
different query (the ID changes) and all the results are wrong.&lt;/p&gt;
</description>
                <environment>PHP 5.3 + MySQL 5.5</environment>
            <key id="13188">DDC-1494</key>
            <summary>Query results are overwritten by previous query.</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="monk.e.boy">J</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Nov 2011 09:56:12 +0000</created>
                <updated>Sat, 9 Feb 2013 20:26:53 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16834" author="beberlei" created="Tue, 15 Nov 2011 10:19:13 +0000"  >&lt;p&gt;Fixed formatting&lt;/p&gt;</comment>
                    <comment id="16870" author="beberlei" created="Fri, 18 Nov 2011 17:43:12 +0000"  >&lt;p&gt;are you using result caching?&lt;/p&gt;</comment>
                    <comment id="16898" author="monk.e.boy" created="Mon, 21 Nov 2011 14:45:09 +0000"  >&lt;p&gt;This is part of my bootstrap&lt;br/&gt;
,&lt;br/&gt;
,&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;		
$config = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Configuration();
		
$cache = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Cache\ArrayCache;
$config-&amp;gt;setMetadataCacheImpl($cache);
$config-&amp;gt;setQueryCacheImpl($cache);
		
&lt;span class=&quot;code-comment&quot;&gt;// driver: schema
&lt;/span&gt;$driver = $config-&amp;gt;newDefaultAnnotationDriver(
	APPLICATION_PATH . &apos;/models&apos;
);
$config-&amp;gt;setMetadataDriverImpl($driver);

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="16998" author="beberlei" created="Thu, 15 Dec 2011 20:49:29 +0000"  >&lt;p&gt;Cannot reproduce it with the script attached. Can you try to modify this to fail or write your own testcase?&lt;/p&gt;</comment>
                    <comment id="16999" author="beberlei" created="Thu, 15 Dec 2011 20:49:47 +0000"  >&lt;p&gt;Downgraded&lt;/p&gt;</comment>
                    <comment id="19499" author="asm89" created="Sat, 9 Feb 2013 20:26:43 +0000"  >&lt;p&gt;Please provide extra feedback.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11131" name="DDC1494Test.php" size="1591" author="beberlei" created="Thu, 15 Dec 2011 20:49:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1493] Improving in() from ExpressionBuilder</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1493</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Instead of this piece of 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;$literal = $expr-&amp;gt;literal($v);
$expr-&amp;gt;andX(
  $expr-&amp;gt;eq(&apos;at.key&apos;, $expr-&amp;gt;literal($k)),
  $expr-&amp;gt;orX(
    $expr-&amp;gt;eq(&apos;a.valueInt&apos;, $literal),
    $expr-&amp;gt;eq(&apos;a.valueText&apos;, $literal),
    $expr-&amp;gt;eq(&apos;a.valueDate&apos;, $literal)
  )
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I would like to simplify my query by using this syntax:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$expr-&amp;gt;andX(
  $expr-&amp;gt;eq(&apos;at.key&apos;, $expr-&amp;gt;literal($k)),
  $expr-&amp;gt;in($expr-&amp;gt;literal($v), array(&apos;a.valueInt&apos;, &apos;a.valueText&apos;, &apos;a.valueDate&apos;))
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13187">DDC-1493</key>
            <summary>Improving in() from ExpressionBuilder</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="h-andreas">Andreas H&#246;rnicke</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Nov 2011 08:06:02 +0000</created>
                <updated>Tue, 15 Nov 2011 08:06:02 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1916] Centralize the Cache mechanism simplifying the query creation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1916</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;in a big project if you have queries spread out in different&lt;br/&gt;
repositories,&lt;br/&gt;
when you have to modify a cache lifetime, you have to search the query and&lt;br/&gt;
modify the code, than test it.&lt;br/&gt;
Is not so easy also to answer to  &apos;how much is the cache for the query XYZ?&apos; &lt;/p&gt;

&lt;p&gt;the idea:&lt;br/&gt;
Each group of repository (bundle) should have in a single point maybe into its config file a place where you could set the lifetime of the various queries. &lt;/p&gt;

&lt;p&gt;see the code for a better explanation&lt;br/&gt;
&lt;a href=&quot;https://gist.github.com/3075742&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/3075742&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the pro: a better handling of the cache mechanism&lt;br/&gt;
cons: ?&lt;/p&gt;

&lt;p&gt;Do you think is a good approach?&lt;br/&gt;
Have you ever had a similar problem?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;liuggio&lt;/p&gt;</description>
                <environment></environment>
            <key id="13834">DDC-1916</key>
            <summary>Centralize the Cache mechanism simplifying the query creation</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="liuggio">liuggio</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Jul 2012 13:02:07 +0000</created>
                <updated>Mon, 9 Jul 2012 13:15:49 +0000</updated>
                                                                    <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1921] Clarify Identifier definition for CTI entities</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1921</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Reference Guide topic 4.8 Identifers/Primary Keys(&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#identifiers-primary-keys&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#identifiers-primary-keys&lt;/a&gt;) states that: &quot;Every entity class needs an identifier/primary key.&quot;&lt;/p&gt;

&lt;p&gt;However, example in topic 7.3. Class Table Inheritance (&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/inheritance-mapping.html#class-table-inheritance&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/inheritance-mapping.html#class-table-inheritance&lt;/a&gt;) doesn&apos;t contain any definitions for Ids.&lt;/p&gt;

&lt;p&gt;Consider following code:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
/**
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;person&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Person&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;employee&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Employee&quot;&lt;/span&gt;})
 */
class Person
{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }
}

/** @Entity */
class Employee &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Person
{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

    &lt;span class=&quot;code-comment&quot;&gt;// Overrides parent to retrieve &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// create instances and $em-&amp;gt;persist(...)
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// $person &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Person
&lt;/span&gt;$person-&amp;gt;getId(); &lt;span class=&quot;code-comment&quot;&gt;// Returns id.
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// $employee &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Employee
&lt;/span&gt;$employee-&amp;gt;getId(); &lt;span class=&quot;code-comment&quot;&gt;// Returns &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;. Private $id in subclass isn&apos;t assigned.&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Please clarify correct use of identifiers in CTI subclass entities. Should subclasses contain any definitions of identifiers?&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

&lt;p&gt;Ludek&lt;/p&gt;</description>
                <environment></environment>
            <key id="13847">DDC-1921</key>
            <summary>Clarify Identifier definition for CTI entities</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="i3ncls">Ludek Stepan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Jul 2012 13:05:29 +0000</created>
                <updated>Wed, 11 Jul 2012 13:08:48 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1889] generate persisters</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1889</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m not sure if this is really possible..&lt;/p&gt;

&lt;p&gt;but to improve performance we should consider generate custom entity persisters.&lt;/p&gt;

&lt;p&gt;Now entity persister are not cached,  &lt;br/&gt;
if we generate it, we can create performance improvement in hidrators, avoiding checks and sql generation every time that an persister is called.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13796">DDC-1889</key>
            <summary>generate persisters</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="3" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/inprogress.png">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="fabio.bat.silva">Fabio B. Silva</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Jun 2012 13:46:04 +0000</created>
                <updated>Mon, 22 Oct 2012 01:02:08 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18107" author="beberlei" created="Thu, 21 Jun 2012 14:09:53 +0000"  >&lt;p&gt;This should be relatively easy in the first step by ust generate the RSM and SQL statements in the constructor and extending from the default persister.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1888] generate hydrators</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1888</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;To improve performance we should consider generate custom hydrators per entity or per rsm.&lt;/p&gt;

&lt;p&gt;I think that will create a huge performance improvement, avoiding checks every time that an entity/result is hydrated.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13795">DDC-1888</key>
            <summary>generate hydrators</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="fabio.bat.silva">Fabio B. Silva</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Jun 2012 13:39:38 +0000</created>
                <updated>Thu, 21 Jun 2012 13:39:38 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1847] Do not check for type equality in scalars when computing changeset?</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1847</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Decimal type in mysql converts as a string in php. This is great as Decimal has a much higher precision than a float or double and that precision would be lost if converted to a float in PHP. Fine! But when doing calculations (as my numbers do not require an enormous precision gmp_ functions are not necessary) php converts these strings into floats. Then, when computing the changeset, as the value is compared with === is marked as a change even though there is none (&quot;5.00&quot; string vs 5.00 float) and an UPDATE for that row is made. Would it be possible to check only for simple equality &quot;==&quot; instead of type equality &quot;===&quot; when dealing with scalar types?&lt;/p&gt;

&lt;p&gt;Another example of this would be the boolean type, that it is stored as an integer 1 in mysql but converted to a boolean true in php. If during the execution of my code that boolean gets converted to an integer 1, that will trigger an UPDATE also because 1 !== true.&lt;/p&gt;

&lt;p&gt;Should this be my responsability or doctrine should be a little more flexible regarding comparisons? Thanks!!&lt;/p&gt;</description>
                <environment></environment>
            <key id="13743">DDC-1847</key>
            <summary>Do not check for type equality in scalars when computing changeset?</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="acasademont">Albert Casademont</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 May 2012 15:28:40 +0000</created>
                <updated>Fri, 8 Jun 2012 13:08:49 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18057" author="ocramius" created="Fri, 8 Jun 2012 07:14:37 +0000"  >&lt;p&gt;Hi there!&lt;br/&gt;
Actually, doctrine orm converts floats from DB string to double at &lt;a href=&quot;https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Types/FloatType.php#L52&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Types/FloatType.php#L52&lt;/a&gt; . Keeping the correct type in for your fields is up to you, so be sure to cast in every setter &lt;img class=&quot;emoticon&quot; src=&quot;http://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="18061" author="acasademont" created="Fri, 8 Jun 2012 08:22:23 +0000"  >&lt;p&gt;Hi marco!&lt;/p&gt;

&lt;p&gt;Actually i am using DECIMAL (or NUMERIC), not FLOAT, That type is not casted as it would lose precision. Therefore, my problem is when working with DECIMAL (Which is, btw, the type that mysql recommends for storing money values)&lt;br/&gt;
thet&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Types/DecimalType.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Types/DecimalType.php&lt;/a&gt;&lt;/p&gt;

</comment>
                    <comment id="18062" author="ocramius" created="Fri, 8 Jun 2012 10:56:21 +0000"  >&lt;p&gt;Unsure if the cast should happen in the type (just ignorant about the implication in precision), but I&apos;ll suggest it then.&lt;/p&gt;</comment>
                    <comment id="18064" author="acasademont" created="Fri, 8 Jun 2012 11:03:55 +0000"  >&lt;p&gt;It should not happen as the DECIMAL type in MySQL has much more precision than a double or float in PHP. It was previously cast but there was an issue regarding this cast and the cast was deleted&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-121&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DBAL-121&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, in another issue a user points out the same problem i am facing, that i have to cast back to string if i do not want doctrine to issue an UPDATE command for values that have not changed&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-180&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DBAL-180&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As i said, my only point is that maybe, when computing the changeset, the comparison for scalar types should be more relaxed with a == instead of a ===&lt;/p&gt;
</comment>
                    <comment id="18066" author="ocramius" created="Fri, 8 Jun 2012 13:08:49 +0000"  >&lt;p&gt;Don&apos;t think this can be done, as you don&apos;t really know what types (and so also the conversion rules) the user applies to his own model. I wouldn&apos;t do that, leaving the implementor of the entities to have strict checks on types during operations in setters...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1825] generate entities with traits</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1825</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When a trait with included setters and getters is used and generate entities is called, doctrine add another set of getters and setters to the &quot;main&quot; entity where the trait is used.&lt;/p&gt;</description>
                <environment>php 5.4.3, symfony2.1-dev</environment>
            <key id="13708">DDC-1825</key>
            <summary>generate entities with traits</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="lunetics">Matthias Breddin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 May 2012 11:31:24 +0000</created>
                <updated>Sat, 9 Feb 2013 23:06:18 +0000</updated>
                                    <version>2.2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1819] Allow ResultSetMapping to be used for objects that are not entities</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1819</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently &lt;tt&gt;Doctrine\ORM\Query\ResultSetMapping&lt;/tt&gt; can only be used to query the database for entities using the &lt;tt&gt;EntityManager::createNativeQuery&lt;/tt&gt; method. It would be great if we could use this as well for objects that are not entities. That way we can create simple DTO&apos;s and map them to a query using the &lt;tt&gt;ResultSetMapping&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I&apos;ll open a PR If there are no objections.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13694">DDC-1819</key>
            <summary>Allow ResultSetMapping to be used for objects that are not entities</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="marijn">Marijn Huizendveld</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 May 2012 15:13:43 +0000</created>
                <updated>Mon, 14 May 2012 10:26:50 +0000</updated>
                                    <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17941" author="beberlei" created="Fri, 11 May 2012 19:20:38 +0000"  >&lt;p&gt;Good idea. You could make this happen by adding a ArbitraryObjectHydrator that does not use the ClassMetadata but creates ReflectionProperty instances during the hydration.&lt;/p&gt;

&lt;p&gt;Api would then 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;$rsm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ResultSetMapping();
....

$query = $em-&amp;gt;createNativeQuery($sql, $rsm);
$objects = $query-&amp;gt;getResult(Query::HYDRATOR_ARBITRARY_OBJECTS);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="17944" author="marijn" created="Sun, 13 May 2012 23:24:53 +0000"  >&lt;p&gt;Thanks for your input. I&apos;ll try to work on some tests this week. &lt;/p&gt;</comment>
                    <comment id="17945" author="marijn" created="Mon, 14 May 2012 10:26:50 +0000"  >&lt;p&gt;I&apos;ve &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/348&quot; class=&quot;external-link&quot;&gt;started working on the test suite in this PR&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1754] Allow use of Foregin Keys in DQL LIKE condition</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1754</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using a LIKE condition in a WHERE clause, I would like to be able to use the foreign key of a single value association. For example:&lt;/p&gt;

&lt;p&gt;Imagine Product and Department are both entities. Department has the field Name with a unique index. Product is has a ManyToOne association called Department with the Department entity, referencing the field Name.&lt;/p&gt;

&lt;p&gt;I would like to write:&lt;br/&gt;
SELECT FROM Product p WHERE p.Department LIKE &apos;% Tools&apos;&lt;/p&gt;

&lt;p&gt;However, at present I need to write:&lt;br/&gt;
SELECT FROM Product p&lt;br/&gt;
JOIN p.Department d&lt;br/&gt;
WHERE d.name LIKE &apos;% Tools&apos;&lt;/p&gt;

&lt;p&gt;The issue is one of performance. On large record sets the first query runs several magnatudes more quickly than the second, particularly when four or five joins are involved.&lt;/p&gt;

&lt;p&gt;Looking at the DQL grammar from the online docs, the relveant lines are:&lt;/p&gt;

&lt;p&gt;LikeExpression           ::= StringExpression &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;NOT&amp;quot;&amp;#93;&lt;/span&gt; &quot;LIKE&quot; string &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;ESCAPE&amp;quot; char&amp;#93;&lt;/span&gt;&lt;br/&gt;
StringExpression       ::= StringPrimary | &quot;(&quot; Subselect &quot;)&quot;&lt;br/&gt;
StringPrimary          ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression&lt;/p&gt;

&lt;p&gt;The problem is the StateFieldPathExpression in StringPrimary. When used with a LikeExpression a SingleValuedAssociationField should be allowed also.&lt;/p&gt;</description>
                <environment>Php 5.3</environment>
            <key id="13593">DDC-1754</key>
            <summary>Allow use of Foregin Keys in DQL LIKE condition</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="superdweebie">Tim Roediger</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Apr 2012 01:57:41 +0000</created>
                <updated>Mon, 9 Apr 2012 22:47:54 +0000</updated>
                                    <version>2.2.1</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17829" author="beberlei" created="Sat, 7 Apr 2012 08:33:52 +0000"  >&lt;p&gt;This would only work if Department#Name is the primary key. Is it?&lt;/p&gt;

&lt;p&gt;DQL is not about optimized performance in very single edge case. We need to keep some parts open to keep the code simple. This is at best a feature request, not a bug.&lt;/p&gt;</comment>
                    <comment id="17836" author="superdweebie" created="Mon, 9 Apr 2012 22:47:54 +0000"  >&lt;p&gt;Thanks for your reply Benjamin,&lt;/p&gt;

&lt;p&gt;I agree with your assesment that this is more accurately an improvement request than a bug. My appologies it was placed in the wrong category.&lt;/p&gt;

&lt;p&gt;No, Department#Name is not the primary key, but it does have a unique index.&lt;/p&gt;

&lt;p&gt;I&apos;ve worked a little more to understand the DQL grammar. It appears that only one small, simple change is required:&lt;/p&gt;

&lt;p&gt;FROM:&lt;br/&gt;
StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression&lt;/p&gt;

&lt;p&gt;TO:&lt;br/&gt;
StringPrimary ::= SingleValuedPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression&lt;/p&gt;

&lt;p&gt;This would improve consistancy with other aspects of DQL. For example, AggregateExpression COUNT, NullComparisonExpression , GroupByItem, and ArithmeticPrimary all allow a SingleValuedPathExpression rather than the more strict StateFieldPathExpression.&lt;/p&gt;

&lt;p&gt;Bascially my frustration is that as DQL currently stands, foregin keys which are already existant in a db table cannot be used in a LIKE expression without doing an unnessessary JOIN. Foreign keys can already be used in DQL for BETWEEN, IS NULL and comparison expressions, so why not LIKE expressions also? It appears the only thing holding this back is an unrequired restriction in the DQL grammar.&lt;/p&gt;

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

<item>
            <title>[DDC-2308] Naming Strategy for Reverse Engeneering</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2308</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Unfortunately DatabaseDriver::getClassNameForTable() is declared as private method, which makes it quite difficult to change the naming strategy for reverse engeneering.&lt;/p&gt;

&lt;p&gt;IMO this sould be declared protected. An even better way would be to extend the interface of the Naming Strategy objects to support the reverse direction:&lt;/p&gt;

&lt;p&gt;classToTableName -&amp;gt; tableToClassName&lt;br/&gt;
propertyToColumnName -&amp;gt; columnToPropertyName.&lt;/p&gt;

&lt;p&gt;This way we would have a consistent name-mapping&lt;/p&gt;
</description>
                <environment></environment>
            <key id="14511">DDC-2308</key>
            <summary>Naming Strategy for Reverse Engeneering</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="ancpru">Andreas Prucha</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Feb 2013 14:49:27 +0000</created>
                <updated>Thu, 21 Feb 2013 14:49:27 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2301] Support inheritance in ResultSetMappingBuilder</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2301</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;ResultSetMappingBuilder does not support inherited fields. For example, calling &lt;tt&gt;ResultSetMappingBuilder::addRootEntityFromClassMetadata($class, $alias)&lt;/tt&gt; throws an exception to say this.&lt;/p&gt;

&lt;p&gt;I was wondering if there were any reasons as to why this would be difficult to implement? I haven&apos;t had an extensive look at Doctrine&apos;s source but it feels like this has been not implemented on purpose.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment></environment>
            <key id="14488">DDC-2301</key>
            <summary>Support inheritance in ResultSetMappingBuilder</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="rmasters">Ross Masters</reporter>
                        <labels>
                        <label>nativesql</label>
                        <label>resultsetmapping</label>
                    </labels>
                <created>Sat, 16 Feb 2013 22:34:48 +0000</created>
                <updated>Sat, 16 Feb 2013 22:34:48 +0000</updated>
                                    <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2288] Schema Tool doesn&apos;t update collation on table level</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2288</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In Symfony2, when updating the collation option of a table, the schema tool doesn&apos;t recognize the change: &lt;/p&gt;

&lt;p&gt;Changing from:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
* @ORM\Table()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;To:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
* @ORM\Table(options={&lt;span class=&quot;code-quote&quot;&gt;&quot;collate&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;utf8_swedish_ci&quot;&lt;/span&gt;})
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Results in:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
$ php app/console doctrine:schema:update --dump-sql
Nothing to update - your database is already in sync with the current entity metadata.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment></environment>
            <key id="14468">DDC-2288</key>
            <summary>Schema Tool doesn&apos;t update collation on table level</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rickard">Rickard Andersson</reporter>
                        <labels>
                        <label>collation</label>
                        <label>schematool</label>
                    </labels>
                <created>Fri, 8 Feb 2013 09:50:30 +0000</created>
                <updated>Fri, 8 Feb 2013 09:50:30 +0000</updated>
                                                                    <component>Mapping Drivers</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2286] Update documentation for collation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2286</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The documentation at &lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/faq.html#how-do-i-set-the-charset-and-collation-for-mysql-tables&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/faq.html#how-do-i-set-the-charset-and-collation-for-mysql-tables&lt;/a&gt; clearly states that the collation should be set at database level and then inherited for all tables created. &lt;/p&gt;

&lt;p&gt;Digging through the code and reading this issue &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2139&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2139&lt;/a&gt; it&apos;s clear that this is no longer the case.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14466">DDC-2286</key>
            <summary>Update documentation for collation</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rickard">Rickard Andersson</reporter>
                        <labels>
                        <label>collation</label>
                        <label>documentation</label>
                    </labels>
                <created>Fri, 8 Feb 2013 09:27:56 +0000</created>
                <updated>Fri, 8 Feb 2013 09:27:56 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2260] Partial DQL query doesn&apos;t respect given order of columns</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2260</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When executing partial DQL queries it may be important to keep given order of columns e.g. for &quot;pairs&quot; hydrator when first column of a pair is used as a key and second - as value. For example query 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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;select&lt;/span&gt; partial u.{id,name} &lt;span class=&quot;code-keyword&quot;&gt;from&lt;/span&gt; my:User u&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will expect &quot;id&quot; to be first in resulted set and &quot;name&quot; to be second and not vice versa.&lt;/p&gt;

&lt;p&gt;However Doctrine parses this part of statement via iterating over fields mapping from entity&apos;s class metadata (as can be seen in &lt;tt&gt;Doctrine\ORM\Query\SqlWalker::walkSelectExpression()&lt;/tt&gt;):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;foreach ($class-&amp;gt;fieldMappings as $fieldName =&amp;gt; $mapping) {
  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($partialFieldSet &amp;amp;&amp;amp; ! in_array($fieldName, $partialFieldSet)) {
    &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
  }
  ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and hence given columns order preserving is not guaranteed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14419">DDC-2260</key>
            <summary>Partial DQL query doesn&apos;t respect given order of columns</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="flying">Alexander Grimalovsky</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 Jan 2013 10:42:01 +0000</created>
                <updated>Sun, 27 Jan 2013 15:48:58 +0000</updated>
                                    <version>2.3.2</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19418" author="ocramius" created="Sat, 26 Jan 2013 15:55:02 +0000"  >&lt;p&gt;What is the advantage in respecting the order given in the DQL query?&lt;/p&gt;</comment>
                    <comment id="19426" author="flying" created="Sun, 27 Jan 2013 10:01:12 +0000"  >&lt;p&gt;Currently the only practical reason for it that I found is &quot;pairs&quot; hydrator. However it is, of course, possible to implement it without such change too. &lt;/p&gt;

&lt;p&gt;Generally speaking this behavior (getting result set with same order of columns that was given in a query) is something that is feeling &quot;natural&quot; for operations with database since it is how you normally get results from SQL queries.&lt;/p&gt;

&lt;p&gt;Maybe it will be enough to mention in documentation for Doctrine that given columns order is not guaranteed to be kept.&lt;/p&gt;</comment>
                    <comment id="19428" author="ocramius" created="Sun, 27 Jan 2013 15:48:39 +0000"  >&lt;p&gt;@&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=flying&quot; class=&quot;user-hover&quot; rel=&quot;flying&quot;&gt;Alexander Grimalovsky&lt;/a&gt; I don&apos;t think it&apos;s worth mentioning it. Also, including a fix for this is quite complex. If you prefer to document it, go for it!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2227] Add details about developer being responsible of inverse side of an association</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2227</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As far as I know, docs don&apos;t explain that it is up to the developer to keep the object graph consistent instead of relying on Doctrine ORM for everything.&lt;/p&gt;

&lt;p&gt;For example, for many to many, examples like following may be used:&lt;br/&gt;
&lt;a href=&quot;https://gist.github.com/3121916&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/3121916&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14364">DDC-2227</key>
            <summary>Add details about developer being responsible of inverse side of an association</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jan 2013 09:44:22 +0000</created>
                <updated>Wed, 9 Jan 2013 09:44:22 +0000</updated>
                                                                    <component>Documentation</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2200] Duplicates returned while accessing associations from @PostPersist callback</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2200</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When creating a new Post and adding it to a collection in an &lt;b&gt;existing&lt;/b&gt; Thread (i.e. loaded from the database), referencing Thread&apos;s posts collection in Post&apos;s @PostPersist callback returns the Post twice. To clarify, this only happens when Thread was previously persisted. If I&apos;m creating a new Thread object the code works as expected. I&apos;ve included some sample code to better illustrate my issue.&lt;/p&gt;

&lt;p&gt;I don&apos;t know if this is a bug, or if I&apos;m doing something that I shouldn&apos;t be, but I couldn&apos;t find this limitation mentioned in the documentation, and this seems to go against the expected behavior.&lt;/p&gt;

&lt;p&gt;Here are my sample entities:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;thread&quot;&lt;/span&gt;)
 */
class &lt;span class=&quot;code-object&quot;&gt;Thread&lt;/span&gt;
{
    /** 
     * @Id
     * @GeneratedValue
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** 
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Post&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;thread&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $posts;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;posts = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
    }   

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getPosts() {
        &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;posts-&amp;gt;toArray();
    }   

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addPost(Post $post) {
        $post-&amp;gt;setThread($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;posts-&amp;gt;add($post);
    }   
}

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;post&quot;&lt;/span&gt;)
 * @HasLifecycleCallbacks
 */
class Post
{
    /** 
     * @Id
     * @GeneratedValue
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** 
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;Thread&lt;/span&gt;&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;posts&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;thread_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $thread;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }   

    /** 
     * @PostPersist
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function onPostPersist() {
        $posts = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;thread-&amp;gt;getPosts();
        foreach ($posts as $post) {
            echo &apos;id: &apos; . $post-&amp;gt;getId() . &apos; type: &apos; . get_class($alert) . &apos;&amp;lt;br /&amp;gt;&apos;;
        }   
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setThread(&lt;span class=&quot;code-object&quot;&gt;Thread&lt;/span&gt; $thread) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;thread = $thread;
    }   
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the calling 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;

&lt;span class=&quot;code-comment&quot;&gt;// Grab an existing thread.
&lt;/span&gt;$thread = $em-&amp;gt;getReference(&apos;&lt;span class=&quot;code-object&quot;&gt;Thread&lt;/span&gt;&apos;, 1); 
$thread-&amp;gt;addPost(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Post());
$em-&amp;gt;flush();

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This outputs:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

id: 1 type: Post
id: 1 type: Post

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Alternatively:&lt;/p&gt;

&lt;div class=&quot;code panel&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;// Create a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; thread.
&lt;/span&gt;$thread = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;Thread&lt;/span&gt;()
$thread-&amp;gt;addPost(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Post());
$em-&amp;gt;persist($thread);
$em-&amp;gt;flush();

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This outputs:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

id: 1 type: Post

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14313">DDC-2200</key>
            <summary>Duplicates returned while accessing associations from @PostPersist callback</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="breathe">Brent</reporter>
                        <labels>
                    </labels>
                <created>Sat, 15 Dec 2012 02:06:07 +0000</created>
                <updated>Sat, 15 Dec 2012 02:06:07 +0000</updated>
                                    <version>2.3.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2164] Extend the cache support to eAccelerator</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2164</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice if the Doctrine caching drivers would support the eAccelerator library.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14262">DDC-2164</key>
            <summary>Extend the cache support to eAccelerator</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="noise085">Enea Bette</reporter>
                        <labels>
                        <label>cache</label>
                        <label>drivers</label>
                    </labels>
                <created>Fri, 23 Nov 2012 08:29:26 +0000</created>
                <updated>Mon, 26 Nov 2012 08:54:28 +0000</updated>
                                    <version>2.4</version>
                <version>3.0</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19037" author="ocramius" created="Fri, 23 Nov 2012 08:38:55 +0000"  >&lt;p&gt;&lt;a href=&quot;http://doctrine-project.org/jira/secure/ViewProfile.jspa?name=noise085&quot; class=&quot;user-hover&quot; rel=&quot;noise085&quot;&gt;Enea Bette&lt;/a&gt; eAccelerator is known for being stripping comments from cached source (making it impossible to use annotations)... Do you happen to know if this is fixed? Supporting it as cache driver is fine btw, I just wonder how many users will start thinking of using eAccelerator and then will be facing this huge limitation.&lt;/p&gt;</comment>
                    <comment id="19063" author="noise085" created="Mon, 26 Nov 2012 08:52:19 +0000"  >&lt;p&gt;I know that eAccelerator has this issue. It would be nice if we could utilize it with XML, YML and PHP based mapping though.&lt;br/&gt;
Do you know if the same problem would appear with these kinds of mapping strategies?&lt;/p&gt;

&lt;p&gt;To give response to your question (eAccelerator and annotations incompatibility), there is a pull request on github, &lt;a href=&quot;https://github.com/eaccelerator/eaccelerator/issues/19&quot; class=&quot;external-link&quot;&gt;https://github.com/eaccelerator/eaccelerator/issues/19&lt;/a&gt; . &lt;/p&gt;

&lt;p&gt;It seems that in the future these could be resolved, and at that time it would be very nice to have that supported with doctrine (symfony2 already has support for this library).&lt;/p&gt;

&lt;p&gt;&quot;I just wonder how many users will start thinking of using eAccelerator and then will be facing this huge limitation&quot;. Sometimes users just does not have a choice. Imagine the case when you have a hosted site that requires caching functionalities and the only available cache library is eAccelerator (as just in my case). You would be fried as a chicken hehe &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2140] [GH-512] Added addParameters() to Query and QueryBuilder</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2140</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 jappie:&lt;/p&gt;

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

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

&lt;p&gt;This method behaves like &lt;tt&gt;setParameters()&lt;/tt&gt; before version 2.3:&lt;br/&gt;
It will add new parameters to the collection, and override any existing positions/names.&lt;/p&gt;

&lt;p&gt;It can take a &lt;tt&gt;Doctrine\Common\Collections\ArrayCollection&lt;/tt&gt; with &lt;tt&gt;Doctrine\ORM\Query\Parameter&lt;/tt&gt; objects, as well as a plain &lt;tt&gt;array&lt;/tt&gt; with key/value pairs, as argument.&lt;/p&gt;

&lt;p&gt;This will greatly ease the upgrade to Doctrine 2.3, because you only need to perform a project-wide replace of &lt;tt&gt;setParameters&lt;/tt&gt; with &lt;tt&gt;addParameters&lt;/tt&gt;, in stead of going into your code and determine if calls to &lt;tt&gt;setParameters&lt;/tt&gt; are ok or need refactoring.&lt;/p&gt;

&lt;p&gt;I&apos;ve also added unit-tests to maintain integrity.&lt;/p&gt;</description>
                <environment>OS X 10.8.2, PHP 5.3.18, Nginx 1.2.4 (php through FPM)</environment>
            <key id="14218">DDC-2140</key>
            <summary>[GH-512] Added addParameters() to Query and QueryBuilder</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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>
                        <label>Query,</label>
                        <label>QueryBuilder</label>
                    </labels>
                <created>Tue, 13 Nov 2012 08:51:04 +0000</created>
                <updated>Tue, 20 Nov 2012 08:06:05 +0000</updated>
                                    <version>2.3</version>
                <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19008" author="beberlei" created="Tue, 20 Nov 2012 02:50:39 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-512&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/512&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/512&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19011" author="jasper@nerdsweide.nl" created="Tue, 20 Nov 2012 08:06:05 +0000"  >&lt;blockquote&gt;
&lt;p&gt;I don&apos;t feel strong need to have such an API.&lt;br/&gt;
If you want to keep track and merge collection of parameters, all you have to do is create an array (or an ArrayCollection), manipulate the instance and then setParameters at the end.&lt;br/&gt;
Unless you give me a stronger argument, this code won&apos;t be in. Closing for now.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Hi Guilherme,&lt;/p&gt;

&lt;p&gt;I agree that such a method makes less sense in &lt;tt&gt;Query&lt;/tt&gt;, because when you write a DQL string all parameters are known at once. But when using the &lt;tt&gt;QueryBuilder&lt;/tt&gt; you might need different parameters in different cases, so &lt;tt&gt;addParameters()&lt;/tt&gt; becomes useful there.&lt;/p&gt;

&lt;p&gt;I guess it&apos;s just a convenience method, like IMHO &lt;tt&gt;setParameter()&lt;/tt&gt; is. (You could just do &lt;tt&gt;$qb-&amp;gt;getParameters()-&amp;gt;add()&lt;/tt&gt;)&lt;/p&gt;

&lt;p&gt;The main reason for adding the method was, like I said, upgrading to Doctrine 2.3. I&apos;ve already upgraded all my projects to Doctrine 2.3, so the method is less useful for me now. But it took me a full day to refactor my repositories, because there is no safe way to automate the process. A simple search-and-replace &lt;tt&gt;setParameters()&lt;/tt&gt; to &lt;tt&gt;addParameters()&lt;/tt&gt; would have taken me 5 minutes &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m content with your decision.&lt;br/&gt;
If others find &lt;tt&gt;addParameters()&lt;/tt&gt; useful, I hope they let us know.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1081] Unnecessary JOIN when selecting ManyToMany/Join Table by ID.</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1081</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;With the schema:&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; 
Image
    @Id
    $id

Tag
    @Id
    $Id

Tag_Image
    @Id
    @OneToOne(targetEntity=&quot;Tag&quot;)
    @JoinColumn(name=&quot;tag&quot;)
    $tag

    @Id
    @OneToOne(targetEntity=&quot;Image&quot;)
    @JoinColumn(name=&quot;image&quot;)
    $image
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Given the following DQL, &lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    SELECT img
    FROM Image 
    LEFT JOIN img.tags tag
    WHERE tag.id=:tag
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Doctrine Generates this SQL&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
    SELECT i0_.id AS id1 
    FROM Image i0_ 
    LEFT JOIN Tag_Image t2_ 
        ON i0_.id = t2_.image 
    LEFT JOIN Tag t1_ 
        ON t1_.id = t2_.tag 
    WHERE t1_.id = 37
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;Which unncessarily joins against Tag, given that the foreign key Tag.id is also found in Tag_Image.tag.&lt;/p&gt;

</description>
                <environment></environment>
            <key id="12503">DDC-1081</key>
            <summary>Unnecessary JOIN when selecting ManyToMany/Join Table by ID.</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="4" iconUrl="http://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="putgeminmouth">David Reisch</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Mar 2011 12:21:20 +0000</created>
                <updated>Mon, 28 Mar 2011 10:03:44 +0000</updated>
                                    <version>2.0</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15596" author="beberlei" created="Sun, 27 Mar 2011 14:40:41 +0000"  >&lt;p&gt;This is not a bug, but expected behavior.&lt;/p&gt;

&lt;p&gt;You can select against the alias if its on the owning side of the association:&lt;/p&gt;

&lt;div class=&quot;code panel&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 img
FROM Image img 
WHERE img.tag=:tag
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this case it is not a left join though, if you want a left join you HAVE to join.&lt;/p&gt;</comment>
                    <comment id="15598" author="putgeminmouth" created="Sun, 27 Mar 2011 20:36:44 +0000"  >&lt;p&gt;There is no owning isde of the association, you can clearly see there is an association table/entity.&lt;/p&gt;

&lt;p&gt;I can&apos;t understand how this behavior is expected. If no properties of Tag are selected for, there is no need to join against Tag since the id is already available via the association table.&lt;/p&gt;</comment>
                    <comment id="15599" author="beberlei" created="Mon, 28 Mar 2011 03:36:34 +0000"  >&lt;p&gt;I misread the mappings, sorry, i though its a @OneToOne but its actually an assocition entity with @OneToOnes.&lt;/p&gt;

&lt;p&gt;Can you show me the Image::$tags mapping also?&lt;/p&gt;</comment>
                    <comment id="15606" author="putgeminmouth" created="Mon, 28 Mar 2011 08:27:57 +0000"  >&lt;p&gt;That is correct, thanks for taking another look at this.&lt;br/&gt;
Sorry I had forgotten to include that information.&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;Image
    /**
        @Id
    */
    $id

    /**
        @ManyToMany(targetEntity=&quot;Tag&quot;)
        @JoinTable(name=&quot;Tag_Image&quot;, 
                            joinColumns={@JoinColumn(name=&quot;image&quot;)},
                            inverseJoinColumns={@JoinColumn(name=&quot;tag&quot;)})
    */
    $tags
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15607" author="beberlei" created="Mon, 28 Mar 2011 08:56:44 +0000"  >&lt;p&gt;The targetEntity is wrong. I suppose it should be Image_Tag or not? If it should be Tag, then you don&apos;t need that Image_Tag entity at all.&lt;/p&gt;

&lt;p&gt;In that case i have to check if you can use the shortcut notation, however it will again not work with the left join - only inner. This is an assumption the ORM makes and there is not yet code included for the optimization. This is not a bug, but an improvement ticket. The functionality works.&lt;/p&gt;</comment>
                    <comment id="15608" author="putgeminmouth" created="Mon, 28 Mar 2011 09:12:26 +0000"  >&lt;p&gt;No argument on the ticket type...&lt;/p&gt;

&lt;p&gt;Ahh, I store some metadata in Tag_Image, which is why I manage it explicitly.&lt;/p&gt;

&lt;p&gt;In any case thanks for looking at this.&lt;/p&gt;</comment>
                    <comment id="15609" author="beberlei" created="Mon, 28 Mar 2011 09:43:12 +0000"  >&lt;p&gt;If you change the targetEntity to Tag_Image then it might already be enough to get this working without another join.&lt;/p&gt;</comment>
                    <comment id="15610" author="putgeminmouth" created="Mon, 28 Mar 2011 10:03:44 +0000"  >&lt;p&gt;With this change, the original query is invalid:&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;    LEFT JOIN i.tags t
    WHERE t.id=:tag
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Because i.tags of type Tag_Image has no field id&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Semantical Error&amp;#93;&lt;/span&gt; line 0, col 138 near &apos;id=:tag &apos;: Error: Class domain\Tag_Image has no field or association named id&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I attempt the logical modification:&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;    LEFT JOIN i.tags t
    WHERE t.tag=:tag
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and get&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT i0_.id AS id0
FROM Image i0_ 
LEFT JOIN Tag_Image t1_ ON i0_.id = t1_.image 
LEFT JOIN Tag_Image t1_ ON t1_.id = t1_.tag 
WHERE t1_.tag = 37
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1066 Not unique table/alias: &apos;t1_&lt;/p&gt;&lt;/blockquote&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1058] Documentation on orphan removal in XML Mapping is incorrect</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1058</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The XML Mapping documentation indicates that &quot;orphan-removal&quot; is an attribute on One-to-One or Many-to-One elements, but in DoctrineORM version 2.0 that does not work.  It seems I have to make &quot;orphan-removal&quot; a child attribute of those elements to turn it on. &lt;/p&gt;

&lt;p&gt;Just to be clear:&lt;/p&gt;

&lt;p&gt;Documentation says to do this, but it does not work:&lt;br/&gt;
&amp;lt;one-to-many field=&quot;...&quot; orphan-removal=&quot;true&quot;&amp;gt; ... &amp;lt;/one-to-many&amp;gt;&lt;/p&gt;

&lt;p&gt;This does work:&lt;br/&gt;
&amp;lt;one-to-many field=&quot;...&quot;&amp;gt; &amp;lt;orphan-removal&amp;gt;true&amp;lt;/orphan-removal&amp;gt; &amp;lt;/one-to-many&amp;gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12450">DDC-1058</key>
            <summary>Documentation on orphan removal in XML Mapping is incorrect</summary>
                <type id="6" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="jfreed">Josh Freed</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Mar 2011 12:38:09 +0000</created>
                <updated>Fri, 4 Mar 2011 12:38:09 +0000</updated>
                                    <version>2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1716] Better unique constraints handling or even updateIfExists/findOneOrCreate</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1716</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It is too hard handle rows duplication now. As adviced here &lt;a href=&quot;http://stackoverflow.com/questions/3967226/checking-for-duplicate-keys-with-doctrine-2&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/3967226/checking-for-duplicate-keys-with-doctrine-2&lt;/a&gt; we should catch \PDOException with code 23000. This is bad behavior.&lt;/p&gt;

&lt;p&gt;So I propose:&lt;br/&gt;
a. Add DuplicateRowException wich will throwed by flush method (maybe wrapped PDOException) with method &quot;getDuplicatedProperties&quot; (based on sql error description parsing + mapping)&lt;br/&gt;
b. Add method findOneOrCreate (hello, Propel!) or updateIfExists to ObjectInterface, EntityManager&lt;br/&gt;
c. Combine a, b&lt;/p&gt;</description>
                <environment></environment>
            <key id="13542">DDC-1716</key>
            <summary>Better unique constraints handling or even updateIfExists/findOneOrCreate</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="koc">Konstantin</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Mar 2012 21:11:04 +0000</created>
                <updated>Thu, 19 Apr 2012 09:15:57 +0000</updated>
                                    <version>2.2.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>5</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17866" author="dynom" created="Thu, 19 Apr 2012 07:46:36 +0000"  >&lt;p&gt;I don&apos;t think it should be limited to the flush method, however, as this can occur with &quot;custom&quot; queries also. It would be ideal if the errors being generated can be much more easily (read: standardized) caught or read. &lt;/p&gt;

&lt;p&gt;I&apos;m in favor of letting the database handle integrity checks, and not run a query to decide wether or not the update or insert queries will violate. Hence the desire to handle this more gracefully.&lt;/p&gt;</comment>
                    <comment id="17867" author="lucasvanlierop" created="Thu, 19 Apr 2012 09:15:57 +0000"  >&lt;p&gt;The DBAL statement class (&lt;a href=&quot;https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Statement.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Statement.php&lt;/a&gt;) has and execute method which might be a good place to catch and convert the generic PDOExceptions by wrapping the line&lt;/p&gt;

&lt;p&gt;$stmt = $this-&amp;gt;stmt-&amp;gt;execute($params);&lt;/p&gt;

&lt;p&gt;in a try/catch statement which then calls some kind of PDOException to Doctrine Exception method&lt;/p&gt;




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

<item>
            <title>[DDC-1675] PDO::FETCH_GROUP</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1675</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;PDO supports grouping by a field when doing a fetchAll() by using PDO::FETCH_GROUP. This can in many places be useful. &lt;a href=&quot;http://blog.stealth35.com/2011/08/17/pdo-fetch-group.html&quot; class=&quot;external-link&quot;&gt;http://blog.stealth35.com/2011/08/17/pdo-fetch-group.html&lt;/a&gt; desribes the behavior quite well.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13486">DDC-1675</key>
            <summary>PDO::FETCH_GROUP</summary>
                <type id="2" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="henrikbjorn">Henrik Bjornskov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Mar 2012 19:50:34 +0000</created>
                <updated>Thu, 1 Mar 2012 19:50:34 +0000</updated>
                                                                    <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-450] Add TableGenerator Implementation</title>
                <link>http://doctrine-project.org/jira/browse/DDC-450</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The TableGenerator Id Generator is not yet implemented, here is some code i came up with:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class TableGenerator &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; AbstractIdGenerator
{
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_tableName;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_sequenceName;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_allocationSize;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_nextValue;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_maxValue;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($tableName, $sequenceName = &apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;, $allocationSize = 10)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tableName = $tableName;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sequenceName = $sequenceName;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_allocationSize = $allocationSize;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function generate(EntityManager $em, $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;_maxValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; || $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_nextValue == $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_maxValue) {
            &lt;span class=&quot;code-comment&quot;&gt;// Allocate &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; values
&lt;/span&gt;            $conn = $em-&amp;gt;getConnection();
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($conn-&amp;gt;getTransactionNestingLevel() == 0) {

                &lt;span class=&quot;code-comment&quot;&gt;// use select &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; update
&lt;/span&gt;                $sql = $conn-&amp;gt;getDatabasePlatform()-&amp;gt;getTableHiLoCurrentValSql($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tableName, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sequenceName);
                $currentLevel = $conn-&amp;gt;fetchColumn($sql);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($currentLevel != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_nextValue = $currentLevel;
                    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_maxValue = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_nextValue + $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_allocationSize;

                    $updateSql = $conn-&amp;gt;getDatabasePlatform()-&amp;gt;getTableHiLoUpdateNextValSql(
                        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tableName, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sequenceName, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_allocationSize
                    );
                    
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($conn-&amp;gt;executeUpdate($updateSql, array(1 =&amp;gt; $currentLevel, 2 =&amp;gt; $currentLevel+1)) !== 1) {
                        &lt;span class=&quot;code-comment&quot;&gt;// no affected rows, concurrency issue, &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; exception
&lt;/span&gt;                    }
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                    &lt;span class=&quot;code-comment&quot;&gt;// no current level returned, TableGenerator seems to be broken, &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; exception
&lt;/span&gt;                }
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                &lt;span class=&quot;code-comment&quot;&gt;// only table locks help here, implement &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; or &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; exception?
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// or &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; we want to work with table locks exclusively?
&lt;/span&gt;            }
        }
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_nextValue++;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11100">DDC-450</key>
            <summary>Add TableGenerator Implementation</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="4" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Mar 2010 14:02:43 +0000</created>
                <updated>Mon, 13 Feb 2012 14:11:35 +0000</updated>
                                    <version>2.0-ALPHA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13771" author="guilhermeblanco" created="Wed, 4 Aug 2010 00:44:41 +0000"  >&lt;p&gt;Already merged into core.&lt;/p&gt;</comment>
                    <comment id="13772" author="beberlei" created="Wed, 4 Aug 2010 03:39:01 +0000"  >&lt;p&gt;But it is not enabled yet &lt;img class=&quot;emoticon&quot; src=&quot;http://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; Plus we need tests to verify this works in high concurrency enviroments and does not pass the same id twice.&lt;/p&gt;

&lt;p&gt;Furthermore the DAtabase Platform Methods are completly missing. No implementations yet.&lt;/p&gt;</comment>
                    <comment id="13773" author="beberlei" created="Wed, 4 Aug 2010 03:39:18 +0000"  >&lt;p&gt;Schema-Tool support is also missing.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="13443">DBAL-223</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-415] Introduce UnitOfWork Stages and throw exceptions for wrong method uses</title>
                <link>http://doctrine-project.org/jira/browse/DDC-415</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the event architecture is fragile when used wrong. I already see lots of &quot;bug reports&quot; popping up on this issue due to people dont understanding what is doable and what is not.&lt;/p&gt;

&lt;p&gt;How about we introduce an instance variable stage into the UnitOfWork and introduce an assertIsInStages($stages) protected method which is called ineach major command method of the UnitOfWork to verify its applied correctly?&lt;/p&gt;

&lt;p&gt;Stages could be:&lt;/p&gt;

&lt;p&gt;UNFLUSHED&lt;br/&gt;
PRE_COMPUTE_CHANGESETS&lt;br/&gt;
POST_COMPUTE_CHANGESETS&lt;br/&gt;
FLUSH_LOOP&lt;br/&gt;
TRANSACTION_COMPLETED&lt;/p&gt;</description>
                <environment></environment>
            <key id="11039">DDC-415</key>
            <summary>Introduce UnitOfWork Stages and throw exceptions for wrong method uses</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Mar 2010 04:20:04 +0000</created>
                <updated>Thu, 18 Mar 2010 07:47:17 +0000</updated>
                                    <version>2.0-ALPHA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12105" author="romanb" created="Fri, 12 Mar 2010 04:37:59 +0000"  >&lt;p&gt;I&apos;m not sure. I&apos;m afraid this will just add code bloat with the only goal to provide better error messages and its fragile to do right. There will surely be places missed in the code where to check for the stage and it might even constrain some valid use-cases we dont think of yet.&lt;/p&gt;

&lt;p&gt;So I&apos;m afraid that this would hurt more than it would help.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-280] UnitOfWork changeSet population should take advantage of Comparable technique</title>
                <link>http://doctrine-project.org/jira/browse/DDC-280</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently our UnitOfWork computes the changeset by checking actual instances of Objects.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;&lt;span class=&quot;code-comment&quot;&gt;// UnitOfWork, lines 501-507 
&lt;/span&gt;
            foreach ($actualData as $propName =&amp;gt; $actualValue) { 
                $orgValue = isset($originalData[$propName]) ? $originalData[$propName] : &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;; 
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_object($orgValue) &amp;amp;&amp;amp; $orgValue !== $actualValue) { 
                    $changeSet[$propName] = array($orgValue, $actualValue); 
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orgValue != $actualValue || ($orgValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; ^ $actualValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;))  
	                    $changeSet[$propName] = array($orgValue, $actualValue);
                } 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;While this is ok when you do new object assignments, it just bypass same instances of same object, since the hash is the same.&lt;br/&gt;
A user on IRC (post-o-matic) has a quite complex object logic that he would like to avoid clone and even instantiate another class.&lt;br/&gt;
I agree with him that cloning is not the ideal technique, mainly because the changeset would always compute the object (since then hashs would be different).&lt;/p&gt;

&lt;p&gt;He implemented this datatype:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;class EffortGraphType &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Type 
{ 
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) 
    { 
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $platform-&amp;gt;getClobTypeDeclarationSql($fieldDeclaration); 
    } 

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function convertToPHPValue($value, AbstractPlatform $platform) 
    { 
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; EffortGraph(unserialize($value)); 
    } 

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function convertToDatabaseValue($value, AbstractPlatform $platform) 
    { 
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; serialize($value-&amp;gt;getGraphPoints()); 
    } 

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getName() 
    { 
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;effort_graph&apos;; 
    } 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I was thinking in a possible alternative and it came up to me the same basic idea we have with operators overloading OR Comparable interface of Java. I know in Java it supports way more things, but at least for this situation (as a start point) it would make developer&apos;s life easier.&lt;/p&gt;

&lt;p&gt;Basic idea is to have an interface in Doctrine\Common:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;namespace Doctrine\Common;

&lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; Comparable
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function compareTo($value);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And update our UnitOfWork to take advantage 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;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;&lt;span class=&quot;code-comment&quot;&gt;// UnitOfWork, lines 501-507 
&lt;/span&gt;
            foreach ($actualData as $propName =&amp;gt; $actualValue) { 
                $orgValue = isset($originalData[$propName]) ? $originalData[$propName] : &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;; 

                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_object($orgValue)) { 
                    $isDiff = ($orgValue &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine\Common\Comparable) 
                        ? $orgValue-&amp;gt;compareTo($actualValue) :  ($orgValue !== $actualValue);

                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($isDiff) {
                        $changeSet[$propName] = array($orgValue, $actualValue); 
                    }
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orgValue != $actualValue || ($orgValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; ^ $actualValue === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;))  
	                    $changeSet[$propName] = array($orgValue, $actualValue);
                } 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this user&apos;s usecase, it&apos;d require him to update the EffortGraph class and implement Comparable interface.&lt;br/&gt;
For his specific situation, he&apos;d need to store original value and updated value, just like we do internally in UnitOfWork for Entities.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10791">DDC-280</key>
            <summary>UnitOfWork changeSet population should take advantage of Comparable technique</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jan 2010 17:53:55 +0000</created>
                <updated>Fri, 4 Feb 2011 05:19:46 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13018" author="guilhermeblanco" created="Wed, 19 May 2010 22:06:04 +0000"  >&lt;p&gt;What&apos;s the final status of this?&lt;/p&gt;

&lt;p&gt;IMHO this should be incorporated, since it adds a powerful support that users can take advantage in our Types.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="13019" author="guilhermeblanco" created="Wed, 19 May 2010 22:06:50 +0000"  >&lt;p&gt;You&apos;re the main guy that can give a final word in this subject.&lt;/p&gt;

&lt;p&gt;I&apos;m +1 for this&lt;/p&gt;</comment>
                    <comment id="15224" author="rv4wd" created="Fri, 4 Feb 2011 03:16:36 +0000"  >&lt;p&gt;+1 for this...&lt;/p&gt;

&lt;p&gt;if you have datetimes in a table and are using the DateTime object, you end up with useless update queries, if you persist an unchanged object...&lt;/p&gt;</comment>
                    <comment id="15226" author="beberlei" created="Fri, 4 Feb 2011 04:10:02 +0000"  >&lt;p&gt;That is not true.&lt;/p&gt;</comment>
                    <comment id="15227" author="rv4wd" created="Fri, 4 Feb 2011 04:35:28 +0000"  >&lt;p&gt;Sorry, I wasn&apos;t clear.&lt;/p&gt;

&lt;p&gt;It does not happen in all cases.&lt;/p&gt;

&lt;p&gt;I have a simple object, that I save to the session. After merging it and flushing the entitiy manager, an update query is generated, which sets all the datetime fields of the object to their current value:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;$item = $_SESSION[&apos;item&apos;];
$item = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;merge($item);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($item);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This code results in the expected SELECT query, which refreshes the item from DB, but it also results in an update query which sets the datetime of the object to the same value.&lt;br/&gt;
This query could be omitted, if I could use a comparable interface and a custom type for datetimes, which implement it.&lt;/p&gt;</comment>
                    <comment id="15228" author="beberlei" created="Fri, 4 Feb 2011 05:19:46 +0000"  >&lt;p&gt;This rather seems like a bug with the merging. Can you open up a new ticket describing this? Thank you&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-740] Mantain a list of DQL reserved keywords</title>
                <link>http://doctrine-project.org/jira/browse/DDC-740</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We should keep a list of DQ reserved keywords, so users can check out what they can use or not.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11745">DDC-740</key>
            <summary>Mantain a list of DQL reserved keywords</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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, 9 Aug 2010 16:35:53 +0000</created>
                <updated>Mon, 9 Aug 2010 16:35:53 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-718] Bottleneck in computeAssociationChanges()?</title>
                <link>http://doctrine-project.org/jira/browse/DDC-718</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems that since &lt;a href=&quot;http://doctrine-project.org/jira/browse/DDC-600&quot; title=&quot;Persisting Entities with unmanaged related associations produces ugly notices&quot;&gt;&lt;del&gt;DDC-600&lt;/del&gt;&lt;/a&gt; computeAssociationChanges() iterate over entries of an collections, even if they are not marked as cascadePersist. For large, hydrated collections this could potentially become a bottleneck.&lt;/p&gt;

&lt;p&gt;Wouldn&apos;t it be better to save the &quot;addedEntities&quot; in an additional map inside &quot;PersistentCollection&quot; and retrieve those instead of calling $value-&amp;gt;unwrap() ?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11677">DDC-718</key>
            <summary>Bottleneck in computeAssociationChanges()?</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Jul 2010 03:58:00 +0000</created>
                <updated>Sat, 24 Jul 2010 04:52:23 +0000</updated>
                                                                    <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13677" author="romanb" created="Sat, 24 Jul 2010 04:47:25 +0000"  >&lt;p&gt;Do you have any numbers to back this up? With large, hydrated collections the bottlenecks are likely elsewhere (SQL query, hydration) &lt;img class=&quot;emoticon&quot; src=&quot;http://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;Further, maintaining &quot;addedEntities&quot; is not as trivial as you might think. The current approach does not care about what happens in-between, it just computes a diff between the old and new state of the collection at commit time. Tracking added/removed objects as they come in and go is more cumbersome.&lt;/p&gt;</comment>
                    <comment id="13678" author="beberlei" created="Sat, 24 Jul 2010 04:51:40 +0000"  >&lt;p&gt;no numbers, i was just confused about the code, because i remembered it differently &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11386">DDC-600</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-712] allow RIGHT JOIN or specifying the root class of the hydratation tree</title>
                <link>http://doctrine-project.org/jira/browse/DDC-712</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi! Let me start by saying you guys did a great job with Doctrine 1 and that I can&apos;t wait to start using Doctrine2 &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I will explain this feature request with an example. I have a User entity wich relates one to many to a Picture entity. Picture has a &quot; is main picture&quot; boolean field. Not all users have a main picture. I would like to be able to select all Users, each with their main picutre, if that exists, or some Null value, if it does not exists, in one query, using join. I would also like for the result collection to contain Picture entities on the first level, with the User beinng accessible as an aggregate of Picture.&lt;/p&gt;

&lt;p&gt;The way I can think doing this is by using a RIGHT or LEFT join (not INNER) as to also select Users that don&apos;t have a main picture. I can do this by selecting &lt;/p&gt;

&lt;p&gt;SELECT Picture p, p.User u FROM p RIGHT JOIN u WITH p.main=1&lt;/p&gt;

&lt;p&gt;but right joins afik are not available atm in either version of Doctrine, or by selecting&lt;/p&gt;

&lt;p&gt;SELECT User u, u.Picture p FROM u LEFT JOIN p WITH p.main=1&lt;/p&gt;

&lt;p&gt;and somehow instructing the hydrator to consider Picture as the root object for the generated object tree and User as a &quot;child&quot; of Picture. &lt;/p&gt;

&lt;p&gt;For users without a picture, the Picture object would somehow indicate it is NULL, while still holding a refference to the User.&lt;/p&gt;


&lt;p&gt;Makes sense? &lt;img class=&quot;emoticon&quot; src=&quot;http://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; If there is an alternate way to achieve this, please enlighten me, tough I think it would still add felxibility if we could hint the hydrator for the root object in a tree.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11667">DDC-712</key>
            <summary>allow RIGHT JOIN or specifying the root class of the hydratation tree</summary>
                <type id="4" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://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="muqker">Mihai Ilinca</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 17:54:44 +0000</created>
                <updated>Thu, 22 Jul 2010 12:21:11 +0000</updated>
                                                                    <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13653" author="beberlei" created="Thu, 22 Jul 2010 02:56:34 +0000"  >&lt;p&gt;Why don&apos;t you model that as ManyToOne for the Main Picture and OneToMany for all pictures? Makes much more sense from an ORM perspsective, you would have your own property &quot;User::$mainPicture&quot;&lt;/p&gt;</comment>
                    <comment id="13661" author="muqker" created="Thu, 22 Jul 2010 12:21:11 +0000"  >&lt;p&gt;Thanks for the suggestion. However, this was just an example to demonstrate some lack of flexibility, I am not strictly looking for a solution to this example, but to the concept behind it. &lt;/p&gt;

&lt;p&gt;Also, how would I get the result with Picture on the top level and User aggregated to Picture with the model you suggested? Unless I am missing something, wouldn&apos;t I end up in the same situation?&lt;/p&gt;

&lt;p&gt;I can post-process the results myself and create a new collection easily, ofc, but it would be better (and more optimal) if I could tell the hydrator to do this, similar to how INDEXBY is passed as an option to the hydrator.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-677] Allow DQL DELETE statements to work with join table fk constraints</title>
                <link>http://doctrine-project.org/jira/browse/DDC-677</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
              