<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 07:55:17 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DDC+ORDER+BY+status+DESC%2C+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://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DDC+ORDER+BY+status+DESC%2C+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1000" total="2406"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-1986] findBy hydration with limit and offset with Oracle database (oci8 driver)</title>
                <link>http://www.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://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://www.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-1879] Orphans are neither nulled nor removed when merging a graph of detached entities</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://www.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-1803] Paginator usage with a DQL query that is using 2 time the same named binded value failed</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://www.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://www.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-2193] Named native query bug?</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://www.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-2424] Removing an inherited entity via a delete cascade constraint does not remove the parent row</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://www.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://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://www.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://www.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-2449] Amazon Redshift Support</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="10000" iconUrl="http://www.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-2035] XML Mapping : add attribute &quot;length&quot; for tag &quot;id&quot;</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://www.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-1630] Get PersistentCollection::getDeleteDiff is empty when collection changes from 1 item to zero items</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://www.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-1494] Query results are overwritten by previous query.</title>
                <link>http://www.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://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://www.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-2281] Validation against database-first generated xml requires that the column order within a composite primary key match the order the columns are in in mapping xml</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2281</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In using a database-first approach utilizing orm:convert-mapping to generate xml, the validation and schema-tool reports that my composite primary key (ex. Columns A, C, B) be dropped and added in the order in which the mapping appears in the xml (ex. Columns A, B, C).&lt;/p&gt;

&lt;p&gt;These columns are not auto-increment and are simply a mixture of int and varchar.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14460">DDC-2281</key>
            <summary>Validation against database-first generated xml requires that the column order within a composite primary key match the order the columns are in in mapping xml</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://www.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="mcaden">Aaron Moore</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Feb 2013 18:26:47 +0000</created>
                <updated>Thu, 9 May 2013 16:30:08 +0000</updated>
                                    <version>2.3.2</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20253" author="beberlei" created="Thu, 9 May 2013 16:20:59 +0000"  >&lt;p&gt;Is the composite key a mix of association and field types?&lt;/p&gt;</comment>
                    <comment id="20254" author="mcaden" created="Thu, 9 May 2013 16:30:08 +0000"  >&lt;p&gt;I&apos;m trying to remember the usage as it was a short term project but I believe it is.&lt;/p&gt;

&lt;p&gt;For example a user has a userid.&lt;/p&gt;

&lt;p&gt;The table in question might have a primary key consisting of the userid and an int representing a year..&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1377] Doctrine doesn&apos;t understand associations from SINGLE_TABLE inheritances</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1377</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine doesn&apos;t understand when a query is built from an association to a SINGLE_TABLE parent to get its successors relations.&lt;/p&gt;

&lt;p&gt;For example:&lt;br/&gt;
Many Lice reside in an Animal (Louse @ManyToOne Animal)&lt;br/&gt;
Animals can specialize into Cats or Dogs (SINGLE_TABLE Inheritance)&lt;br/&gt;
A Dog can have one Bone (Dog @OneToOne Bone)&lt;br/&gt;
A Cat can have one Yarn (Yarn @OneToOne Yarn)&lt;/p&gt;

&lt;p&gt;From a specific Louse, Doctrine can&apos;t get the Animal&apos;s Bone or Yarn.&lt;/p&gt;</description>
                <environment>Xubuntu 11.04 Linux 2.6.38 i386</environment>
            <key id="13020">DDC-1377</key>
            <summary>Doctrine doesn&apos;t understand associations from SINGLE_TABLE inheritances</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="msilvagarcia">Marcos Augusto da Silva Garcia</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Sep 2011 19:19:25 +0000</created>
                <updated>Thu, 15 Sep 2011 16:14:29 +0000</updated>
                    <resolved>Thu, 15 Sep 2011 16:14:29 +0000</resolved>
                            <version>2.1.1</version>
                                                <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16473" author="beberlei" created="Wed, 14 Sep 2011 20:29:59 +0000"  >&lt;p&gt;Doctrine implements strict OO inheritance, what you want does not work as no casting is currently possible.&lt;/p&gt;</comment>
                    <comment id="16477" author="guilhermeblanco" created="Thu, 15 Sep 2011 16:13:59 +0000"  >&lt;p&gt;Reopening&lt;/p&gt;</comment>
                    <comment id="16478" author="guilhermeblanco" created="Thu, 15 Sep 2011 16:14:29 +0000"  >&lt;p&gt;Duplicate to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-16&quot; title=&quot;DQL Ignores properties of subclasses&quot;&gt;&lt;del&gt;DDC-16&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="10070">DDC-16</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-51] Notice: Undefined index: [columnName] in/Doctrine/ORM/Mapping/OneToManyMapping.php on line 129</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-51</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;With the same example as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-50&quot; title=&quot;Call to undefined method Doctrine\ORM\Mapping\OneToManyMapping::getQuotedJoinColumnName()&quot;&gt;&lt;del&gt;DDC-50&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i now can not get the ManyToOne association (definitions, proverbs and relations);&lt;/p&gt;

&lt;p&gt;i got php notice &lt;br/&gt;
Notice: Undefined index: phrase_id in /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Mapping/OneToManyMapping.php on line 129&lt;/p&gt;

&lt;p&gt;if i check the line the variable $joinColumnValues is an empty array, because the PersistentCollection.php at line 233 did not send any joincolumnvalues to the load method. i dont know if this the cause.&lt;/p&gt;

&lt;p&gt;i have try to set $entityManager-&amp;gt;getConfiguration()-&amp;gt;setAllowPartialObjects() to TRUE and make an dql like this&lt;br/&gt;
&quot;SELECT p, d FROM &quot;.models\Phrase::CLASS_NAME.&quot; p join p.definitions d WHERE p.phrase = &apos;$phrase&apos;&quot;&lt;/p&gt;

&lt;p&gt;but the result is still the same &lt;img class=&quot;emoticon&quot; src=&quot;http://www.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;/p&gt;</description>
                <environment>&amp;nbsp;&amp;nbsp;	&lt;br/&gt;
&amp;#xAB; Hide&lt;br/&gt;
PHP 5.3.0 (cli) (built: Jul 21 2009 08:22:07)&lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&lt;br/&gt;
Server Version: Apache/2.2.11 (Ubuntu) mod_jk/1.2.26 PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch&lt;br/&gt;
Server Built: Aug 18 2009 14:26:31&lt;br/&gt;
&lt;br/&gt;
mysql Ver 14.14 Distrib 5.1.31, for debian-linux-gnu (i486) using EditLine wrapper</environment>
            <key id="10194">DDC-51</key>
            <summary>Notice: Undefined index: [columnName] in/Doctrine/ORM/Mapping/OneToManyMapping.php on line 129</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="purnama">Arthur Purnama</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Oct 2009 15:31:50 +0000</created>
                <updated>Thu, 15 Oct 2009 19:28:55 +0000</updated>
                    <resolved>Thu, 15 Oct 2009 17:08:16 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10235" author="romanb" created="Thu, 15 Oct 2009 15:51:34 +0000"  >&lt;p&gt;Can you please show the code that you&apos;re using. I dont mean the models but the code that causes this problem.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="10236" author="purnama" created="Thu, 15 Oct 2009 16:07:08 +0000"  >&lt;p&gt;$definitions = $phrase-&amp;gt;getDefinitions();&lt;br/&gt;
var_dump($definitions&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; instanceof kateglo\application\models\Definition);&lt;/p&gt;

&lt;p&gt;hope this help you.&lt;/p&gt;

&lt;p&gt;regards,&lt;br/&gt;
arthur&lt;/p&gt;</comment>
                    <comment id="10237" author="romanb" created="Thu, 15 Oct 2009 16:37:47 +0000"  >&lt;p&gt;Okay, thanks, I can reproduce this and will work on this. When I&apos;m done I will add all these new tests to the test suite.&lt;/p&gt;</comment>
                    <comment id="10238" author="romanb" created="Thu, 15 Oct 2009 16:44:16 +0000"  >&lt;p&gt;By the way, eager loading works fine for me. See this 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;
        $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT p,d FROM Doctrine\Tests\ORM\Functional\Phrase p JOIN p.definitions d&quot;&lt;/span&gt;);
        $res = $query-&amp;gt;getResult();
        $definitions = $res[0]-&amp;gt;getDefinitions();
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(1, count($res));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertTrue($definitions[0] &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Definition);

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

&lt;p&gt;This works for me. But lazy-loading results in the error you mentioned and which I will fix.&lt;/p&gt;</comment>
                    <comment id="10241" author="purnama" created="Thu, 15 Oct 2009 19:28:55 +0000"  >&lt;p&gt;ok thank you very much it works like charm.&lt;/p&gt;

&lt;p&gt;du bist Gold Wert Roman &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;please close the ticket.&lt;/p&gt;

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

<item>
            <title>[DDC-50] Call to undefined method Doctrine\ORM\Mapping\OneToManyMapping::getQuotedJoinColumnName()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-50</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;with the $config-&amp;gt;setAllowPartialObjects(false); i make an query to&lt;br/&gt;
phrase, and get a phrase object. sofar so good&lt;/p&gt;

&lt;p&gt;but as i try to get the type or lexical member like $phrase-&amp;gt;getType()&lt;br/&gt;
it throws a Fatal error like this:&lt;/p&gt;

&lt;p&gt;Fatal error: Call to undefined method&lt;br/&gt;
Doctrine\ORM\Mapping\OneToManyMapping::getQuotedJoinColumnName() in&lt;br/&gt;
/usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php&lt;br/&gt;
on line 599&lt;/p&gt;

&lt;p&gt;i read this on doctrine-user groups&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/a15d430b4ae483b4/dc7665ed137a4e78?lnk=gst&amp;amp;q=getQuotedJoinColumnName#dc7665ed137a4e78&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/a15d430b4ae483b4/dc7665ed137a4e78?lnk=gst&amp;amp;q=getQuotedJoinColumnName#dc7665ed137a4e78&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and i take a look if the line&lt;/p&gt;

&lt;p&gt;$owningAssoc = $this-&amp;gt;_class-&amp;gt;associationMappings&lt;span class=&quot;error&quot;&gt;&amp;#91;$coll-&amp;gt;getMapping()-&amp;gt;mappedByFieldName&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;present on StandardEntityPersister#loadOneToManyCollection.&lt;/p&gt;

&lt;p&gt;and yes. its present. but i still got this error.&lt;/p&gt;</description>
                <environment>PHP 5.3.0 (cli) (built: Jul 21 2009 08:22:07)&lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&lt;br/&gt;
Server Version: Apache/2.2.11 (Ubuntu) mod_jk/1.2.26 PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch&lt;br/&gt;
Server Built: Aug 18 2009 14:26:31&lt;br/&gt;
&lt;br/&gt;
mysql Ver 14.14 Distrib 5.1.31, for debian-linux-gnu (i486) using EditLine wrapper </environment>
            <key id="10193">DDC-50</key>
            <summary>Call to undefined method Doctrine\ORM\Mapping\OneToManyMapping::getQuotedJoinColumnName()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="purnama">Arthur Purnama</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Oct 2009 11:32:07 +0000</created>
                <updated>Thu, 15 Oct 2009 14:41:03 +0000</updated>
                    <resolved>Thu, 15 Oct 2009 14:41:03 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10234" author="romanb" created="Thu, 15 Oct 2009 14:41:03 +0000"  >&lt;p&gt;Should be fixed now in HEAD.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10075" name="kateglox.sql" size="8526" author="purnama" created="Thu, 15 Oct 2009 11:32:07 +0000" />
                    <attachment id="10074" name="kateglo_doctrine.zip" size="14828" author="purnama" created="Thu, 15 Oct 2009 11:32:07 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-49] Incomplete MySQL Query Generator (MySQL Syntax error)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-49</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i checkout the HEAD version. and try to write this DQL&lt;/p&gt;

&lt;p&gt;$query = utilities\DataAccess::getEntityManager()-&amp;gt;createQuery(&quot;SELECT&lt;br/&gt;
p, t FROM &quot;.models\Phrase::CLASS_NAME.&quot; p join p.type t WHERE p.phrase&lt;br/&gt;
= &apos;$phrase&apos;&quot;);&lt;/p&gt;

&lt;p&gt;i commented out the $config-&amp;gt;setAllowPartialObjects(false);&lt;/p&gt;

&lt;p&gt;and have PDO error that my MySQL statement sytax is invalid.&lt;/p&gt;

&lt;p&gt;i check the Query that the Doctrine create and its like this :&lt;br/&gt;
SELECT p0_.phrase_id AS phrase_id0, p0_.phrase_name AS phrase_name1,&lt;br/&gt;
p1_.phrase_type_id AS phrase_type_id2, p1_.phrase_type_name AS&lt;br/&gt;
phrase_type_name3, p1_.phrase_type_abbreviation AS&lt;br/&gt;
phrase_type_abbreviation4 FROM phrase p0_ INNER JOIN phrase_type p1_&lt;br/&gt;
ON p0_.phrase_type_id = p1_. WHERE p0_.phrase_name = &apos;abu&apos;&lt;/p&gt;

&lt;p&gt;as you can si at the ON statement it writes p0_.phrase_type_id = p1_.&lt;/p&gt;

&lt;p&gt;the p1_. is not completed. i think my DocAnnotation is OK, because i&lt;br/&gt;
look at the Doctrine Tests Models that test the OneToMany Function&lt;br/&gt;
(the one with the ECommerce models, product and features).  I have&lt;br/&gt;
followed all the doc annotation writes there. &lt;/p&gt;</description>
                <environment>PHP 5.3.0 (cli) (built: Jul 21 2009 08:22:07) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&lt;br/&gt;
Server Version: Apache/2.2.11 (Ubuntu) mod_jk/1.2.26 PHP/5.2.6-3ubuntu4.2 with&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Suhosin-Patch&lt;br/&gt;
Server Built: Aug 18 2009 14:26:31&lt;br/&gt;
&lt;br/&gt;
mysql  Ver 14.14 Distrib 5.1.31, for debian-linux-gnu (i486) using  EditLine wrapper</environment>
            <key id="10192">DDC-49</key>
            <summary>Incomplete MySQL Query Generator (MySQL Syntax error)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="purnama">Arthur Purnama</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Oct 2009 11:24:34 +0000</created>
                <updated>Thu, 15 Oct 2009 14:40:37 +0000</updated>
                    <resolved>Thu, 15 Oct 2009 14:40:37 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10233" author="romanb" created="Thu, 15 Oct 2009 14:40:37 +0000"  >&lt;p&gt;Should be fixed now in HEAD.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10071" name="kateglo_doctrine.zip" size="14828" author="purnama" created="Thu, 15 Oct 2009 11:24:34 +0000" />
                    <attachment id="10073" name="Lexical.php" size="3132" author="purnama" created="Thu, 15 Oct 2009 11:24:34 +0000" />
                    <attachment id="10072" name="PhraseType.php" size="3096" author="purnama" created="Thu, 15 Oct 2009 11:24:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-24] text type not portable (works only on MySQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-24</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The text type is not portable to other RDBMS than MySQL. To support the text type, a platform must implement the method getClobDeclarationSql(array $field). Currently only MySqlPlatform has this method. This means that attempting to use the CLI tool  to create a schema with a text column using another RDBMS fails with the following error:&lt;/p&gt;

&lt;p&gt;Fatal error: Call to undefined method Doctrine\DBAL\Platforms\SqlitePlatform::getClobDeclarationSql() in D:\Projects\Test\tools\sandbox\lib\Doctrine\DBAL\Types\TextType.php on line 15&lt;/p&gt;

&lt;p&gt;I believe at least Sqlite supports the CLOB type.&lt;/p&gt;

&lt;p&gt;Either the text type should be supported by all platforms or the documentation should be revised. Currently it says:&lt;/p&gt;

&lt;p&gt;&quot;All Doctrine Mapping Types that ship with Doctrine are fully portable between different RDBMS.&quot;&lt;/p&gt;

&lt;p&gt;This makes easy testing of models using sqlite with minimum configuration impossible with the text type.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10127">DDC-24</key>
            <summary>text type not portable (works only on MySQL)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Sep 2009 15:28:48 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:43 +0000</updated>
                    <resolved>Thu, 1 Oct 2009 12:01:05 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10147" author="romanb" created="Wed, 30 Sep 2009 15:53:27 +0000"  >&lt;p&gt;Thanks. We will try to address this as soon as possible. This is just an oversight in the implementation. The text type can definitely be made portable across all platforms.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-513] LEFT JOIN on extended entity of associated entity from parent by @OneToOne throw exception &quot;no such column&quot; [testcase included] </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-513</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Dear Roman &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;, &lt;/p&gt;

&lt;p&gt;Watch testcase please to understand this issue.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11210">DDC-513</key>
            <summary>LEFT JOIN on extended entity of associated entity from parent by @OneToOne throw exception &quot;no such column&quot; [testcase included] </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="else">Ondrej Sibrina</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Apr 2010 06:07:52 +0000</created>
                <updated>Mon, 12 Apr 2010 23:59:49 +0000</updated>
                    <resolved>Mon, 12 Apr 2010 23:59:49 +0000</resolved>
                            <version>2.0-BETA2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12649" author="guilhermeblanco" created="Mon, 12 Apr 2010 23:59:49 +0000"  >&lt;p&gt;In &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/56a8f5cd5353908b815607a6e089201c95e01e6c&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/56a8f5cd5353908b815607a6e089201c95e01e6c&lt;/a&gt; this issue was fixed.&lt;/p&gt;

&lt;p&gt;Thanks for the report and unit test. It saved me a LOT of time!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10567" name="DDC513Test.php" size="1773" author="else" created="Mon, 12 Apr 2010 06:07:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-512] LEFT JOIN of extended null entity cause empty result [testcase included]</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-512</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Dear developers,&lt;/p&gt;

&lt;p&gt;I&apos;m not sure about propriety of my query but what i want to do is left&lt;br/&gt;
join entity which is associeted by @OneToOne. Problem occur when&lt;br/&gt;
associeted entity is NULL. Then i got empty result. I think it&apos;s&lt;br/&gt;
because my associeted entity is extended so it cause in final SQL&lt;br/&gt;
query inner joins which are not in subselect.&lt;/p&gt;

&lt;p&gt;class Shop_Data_Entity_StockItem extends Shop_Data_Entity_Item &lt;/p&gt;
{
    /**
     * @OneToOne(targetEntity=&quot;Shop_Data_Entity_OrderItem&quot;,
mappedBy=&quot;stockItem&quot;)
     */
    protected $orderItem;

    ...

}

&lt;p&gt;So there&apos;s my query:&lt;/p&gt;

&lt;p&gt;$q = $em-&amp;gt;createQuery(&quot;select u from Shop_Data_Entity_StockItem u left&lt;br/&gt;
join u.orderItem uu&quot;);&lt;br/&gt;
echo $q-&amp;gt;getSql();&lt;br/&gt;
$result = $q-&amp;gt;getResult();&lt;br/&gt;
count($result&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;// print 0 even there&apos;re Shop_Data_Entity_StockItem in database and&lt;br/&gt;
without left join clause prints 2&lt;/p&gt;

&lt;p&gt;There&apos;s echo $q-&amp;gt;getSql():&lt;/p&gt;

&lt;p&gt;SELECT s0_.ean AS ean0, s0_.title AS title1, s0_.description AS&lt;br/&gt;
description2, s0_.vat AS vat3, s0_.id AS id4, s1_.bestBefore AS&lt;br/&gt;
bestBefore5, s0_.discr AS discr6, s0_.price AS price7,&lt;br/&gt;
s1_.deliveryInvoice_id AS deliveryInvoice_id8 FROM&lt;br/&gt;
Shop_Data_Entity_StockItem s1_ INNER JOIN Shop_Data_Entity_Item s0_ ON&lt;br/&gt;
s1_.id = s0_.id LEFT JOIN Shop_Data_Entity_OrderItem s2_ ON s1_.id =&lt;br/&gt;
s2_.stockItem_id INNER JOIN Shop_Data_Entity_OfferItem s3_ ON s2_.id =&lt;br/&gt;
s3_.id INNER JOIN Shop_Data_Entity_Item s4_ ON s2_.id = s4_.id &lt;/p&gt;</description>
                <environment></environment>
            <key id="11209">DDC-512</key>
            <summary>LEFT JOIN of extended null entity cause empty result [testcase included]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="else">Ondrej Sibrina</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Apr 2010 02:35:24 +0000</created>
                <updated>Thu, 15 Apr 2010 12:39:53 +0000</updated>
                    <resolved>Thu, 15 Apr 2010 12:39:53 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12636" author="else" created="Mon, 12 Apr 2010 05:44:07 +0000"  >&lt;p&gt;This test case is slightly different from example i wrote in description but shows same issue&lt;/p&gt;</comment>
                    <comment id="12648" author="guilhermeblanco" created="Mon, 12 Apr 2010 23:57:48 +0000"  >&lt;p&gt;Your report exposes exactly the issue pointed on &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-349&quot; title=&quot;Add support for specifying precedence in joins in DQL&quot;&gt;DDC-349&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We should take a look how to fix this without having to update ALL unit tests that takes advantage of inheritance.&lt;/p&gt;

&lt;p&gt;Also, the SQL spec requires that all joins need to be specified before write the ON keyword.&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;Exception: [PDOException] SQLSTATE[HY000]: General error: 1 a JOIN clause is required before ON
SELECT d0_.id AS id0, d0_.item AS item1 FROM DDC512Customer d0_ LEFT JOIN (DDC512OfferItem d1_ ON d0_.item = d1_.id INNER JOIN DDC512Item d2_ ON d1_.id = d2_.id)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And in the situation of a inheritance:&lt;/p&gt;

&lt;div class=&quot;code panel&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: [PDOException] SQLSTATE[HY000]: General error: 1 a JOIN clause is required before ON             
SELECT o0_.id AS id0, o0_.name AS name1, o3_.id AS id2, o3_.name AS name3, o0_.discr AS discr4, o0_.mother_id AS mother_id5, o3_.discr AS discr6, o3_.mother_id AS mother_id7 FROM OJTIC_Pet o0_ LEFT JOIN OJTIC_Cat o1_ ON o0_.id = o1_.id LEFT JOIN OJTIC_Dog o2_ ON o0_.id = o2_.id INNER JOIN (OJTIC_Pet o3_ ON o0_.id = o3_.mother_id LEFT JOIN OJTIC_Cat o4_ ON o3_.id = o4_.id LEFT JOIN OJTIC_Dog o5_ ON o3_.id = o5_.id) WHERE o0_.name = &apos;Poofy&apos; ORDER BY o3_.name ASC
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12655" author="romanb" created="Tue, 13 Apr 2010 04:51:06 +0000"  >&lt;p&gt;I am aware of the problem and yes, nested joins for CTI can be a solution but its just 1 solution. The other one is to simply turn these CTI joins into left joins when they appear in the middle of a query (that is, not in the FROM clause).&lt;/p&gt;

&lt;p&gt;So, given a Class hierarchy 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;class Item
class StockItem &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Item
class OfferItem &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Item
class OrderItem &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; OfferItem

StockItem &amp;lt;-onetoone-&amp;gt; OrderItem
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and a DQL 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;DQL: select s from StockItem s left join s.orderItem o ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We have 2 possible solutions.&lt;/p&gt;

&lt;p&gt;Nr. 1: Nested inner 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-java&quot;&gt;SELECT ... FROM stockitem s1_
INNER JOIN item s0_ ON s1_.id = s0_.id
LEFT JOIN
    (orderitem s2_ INNER JOIN offeritem s3_ ON s2_.id = s3_.id
     INNER JOIN item s4_ ON s2_.id = s4_.id)
ON s1_.id = s2_.stockItem_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Nr. 2: Just use left joins for parent tables for all CTI joins that are the result of a DQL join (This is what Hibernate does):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT ... FROM stockitem s1_
INNER JOIN item s0_ ON s1_.id = s0_.id
LEFT JOIN orderitem s2_ ON s1_.id = s2_.stockItem_id
LEFT JOIN offeritem s3_ ON s2_.id = s3_.id
LEFT JOIN item s4_ ON s2_.id = s4_.id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;According to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-349&quot; title=&quot;Add support for specifying precedence in joins in DQL&quot;&gt;DDC-349&lt;/a&gt;, most databases seem to support nested inner joins (Nr. 1) but nevertheless its not in the ANSI standard I think, so I am not sure we can rely on it.&lt;/p&gt;

&lt;p&gt;The Hibernate solution seems simpler but I still wonder whether they perform differently (Usually, inner joins are more performant than outer joins),&lt;/p&gt;</comment>
                    <comment id="12674" author="romanb" created="Thu, 15 Apr 2010 12:39:53 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/01c2c06bbf529d89c9741ea97702359509ea230a&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/01c2c06bbf529d89c9741ea97702359509ea230a&lt;/a&gt; using the &quot;hibernate-way&quot;.&lt;/p&gt;

&lt;p&gt;Please note that you currently should not name join columns the same as entity fields. See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-522&quot; title=&quot;Join columns can not be named the same as the association fields.&quot;&gt;&lt;del&gt;DDC-522&lt;/del&gt;&lt;/a&gt;. Better use @JoinColumn(name=&quot;item_id&quot;, ...)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10566" name="DDC512Test.php" size="1848" author="else" created="Mon, 12 Apr 2010 05:44:07 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-422] Unable to add entity in @ManyToMany association when owning entity is extended from another entity </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-422</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Dear developers,&lt;/p&gt;

&lt;p&gt;I&apos;m not sure if i extend entities in right way but i found different behaviour in extended entity which won&apos;t process add in @ManyToMany association.&lt;br/&gt;
My class are defined 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;/**
 * @Entity
 * @HasLifecycleCallbacks
 * @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;guest&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Shop_Data_Entity_Guest&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;customer&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Shop_Data_Entity_Customer&quot;&lt;/span&gt;})
 */
class Shop_Data_Entity_Guest &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Shop_Data_Entity_Abstract {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
        /* call parent construct with all parameters */
        call_user_func_array(array(&lt;span class=&quot;code-quote&quot;&gt;&quot;parent&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;__construct&quot;&lt;/span&gt;),func_get_args());
    }
}

/**
 * @Entity
 * @HasLifecycleCallbacks
 */
class Shop_Data_Entity_Customer &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Shop_Data_Entity_Guest {
    /**
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Shop_Data_Entity_Contact&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;} )
     * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Shop_Data_Entity_Customer__homes&quot;&lt;/span&gt;,
     *      joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;customer_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade&quot;&lt;/span&gt; )},
     *      inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;contact_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade&quot;&lt;/span&gt; )}
     *      )
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $homes;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
        /* call parent construct with all parameters */
        call_user_func_array(array(&lt;span class=&quot;code-quote&quot;&gt;&quot;parent&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;__construct&quot;&lt;/span&gt;),func_get_args());

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;homes = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Shop_Data_Collection_Standard(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; class only &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ArrayCollection
&lt;/span&gt;    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;When i fire this code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $q = $em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;select c from Shop_Data_Entity_Customer c&quot;&lt;/span&gt;);
        $q-&amp;gt;setMaxResults(1);
        $customers = $q-&amp;gt;getResult();
        
        $contact = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Shop_Data_Entity_Contact();
        $customers[0]-&amp;gt;home-&amp;gt;add($contact);
        $em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There&apos;s no change in database. &lt;br/&gt;
When i change definition od Guest class 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;/** @MappedSuperclass */
class Shop_Data_Entity_Guest &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Shop_Data_Entity_Abstract {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
        /* call parent construct with all parameters */
        call_user_func_array(array(&lt;span class=&quot;code-quote&quot;&gt;&quot;parent&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;__construct&quot;&lt;/span&gt;),func_get_args());
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It start work and every firing of my code add one contact and association to my database. It causes problem only when owning entity is quered from database at first.&lt;/p&gt;</description>
                <environment>PHP 5.3.2</environment>
            <key id="11052">DDC-422</key>
            <summary>Unable to add entity in @ManyToMany association when owning entity is extended from another entity </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="else">Ondrej Sibrina</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Mar 2010 12:16:58 +0000</created>
                <updated>Thu, 18 Mar 2010 09:46:56 +0000</updated>
                    <resolved>Thu, 18 Mar 2010 09:45:00 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12274" author="else" created="Tue, 16 Mar 2010 08:50:27 +0000"  >&lt;p&gt;I tried to debug by myself and i found that on line 411 in UnitOfWork.php is on flush in first example $class-&amp;gt;associationMappings == null. When i change Shop_Data_Entity_Guest to /** @MappedSuperclass */ i can find $class-&amp;gt;associationMappings on same line with some elements.&lt;/p&gt;

&lt;p&gt;Hope it help to fix it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Andy&lt;/p&gt;</comment>
                    <comment id="12276" author="else" created="Tue, 16 Mar 2010 09:26:46 +0000"  >&lt;p&gt;I tried to made patch by myself and it looks it start working. I&apos;m not sure if this solution is proper. Andy&lt;/p&gt;

&lt;p&gt;from line 1731 of UnitOfWork.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;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_identityMap[$class-&amp;gt;name][$idHash])) {  &lt;span class=&quot;code-comment&quot;&gt;// $$class-&amp;gt;rootEntityName to $class-&amp;gt;name
&lt;/span&gt;            $entity = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_identityMap[$class-&amp;gt;name][$idHash]; &lt;span class=&quot;code-comment&quot;&gt;// $class-&amp;gt;rootEntityName to $class-&amp;gt;name
&lt;/span&gt;            $oid = spl_object_hash($entity);
            &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__) {
                $entity-&amp;gt;__isInitialized__ = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
                $overrideLocalValues = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                $overrideLocalValues = isset($hints[Query::HINT_REFRESH]);
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-comment&quot;&gt;//$entity = clone $class-&amp;gt;prototype;
&lt;/span&gt;            $entity = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $className;
            $oid = spl_object_hash($entity);
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_entityIdentifiers[$oid] = $id;
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_entityStates[$oid] = self::STATE_MANAGED;
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_originalEntityData[$oid] = $data;
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_identityMap[$class-&amp;gt;name][$idHash] = $entity; &lt;span class=&quot;code-comment&quot;&gt;// $class-&amp;gt;rootEntityName to $class-&amp;gt;name&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12287" author="else" created="Tue, 16 Mar 2010 13:37:59 +0000"  >&lt;p&gt;To ensure i checkouted trunk version but it doesn&apos;t solve this problem.&lt;/p&gt;

&lt;p&gt;Andy&lt;/p&gt;</comment>
                    <comment id="12297" author="else" created="Tue, 16 Mar 2010 18:25:32 +0000"  >&lt;p&gt;After using my patch i can&apos;t do $em-&amp;gt;remove properly any other patch? &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &lt;/p&gt;</comment>
                    <comment id="12330" author="romanb" created="Thu, 18 Mar 2010 09:45:00 +0000"  >&lt;p&gt;This is fixed now in trunk.&lt;/p&gt;</comment>
                    <comment id="12331" author="else" created="Thu, 18 Mar 2010 09:46:56 +0000"  >&lt;p&gt;Thank you very much&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Hope this report was better than my first one.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10482" name="DDC406Test.php" size="2220" author="else" created="Tue, 16 Mar 2010 11:58:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2440] composer.json is wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2440</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In composer.json for doctrine/doctrine-orm-module there is the following require:&lt;br/&gt;
&quot;doctrine/doctrine-module&quot;: &quot;0.8.*&quot;&lt;/p&gt;

&lt;p&gt;However &quot;0.8.*&quot; does not exist, it should be &quot;0.8.x-dev&quot; or &quot;dev-master&quot;. The later would then use the branch alias. Either way this needs changing, because it&apos;s stopping the package from being installed or updated.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14846">DDC-2440</key>
            <summary>composer.json is wrong</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="r-nicol">Richard Nicol</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 May 2013 15:37:15 +0000</created>
                <updated>Thu, 9 May 2013 22:06:31 +0000</updated>
                    <resolved>Thu, 9 May 2013 16:01:39 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="20249" author="beberlei" created="Thu, 9 May 2013 16:01:39 +0000"  >&lt;p&gt;Please open the ticket on the Doctrine ORM Module, this is the ORM bug tracker.&lt;/p&gt;</comment>
                    <comment id="20250" author="r-nicol" created="Thu, 9 May 2013 16:07:24 +0000"  >&lt;p&gt;Sorry my mistake! I have opened an issue on github here: &lt;a href=&quot;https://github.com/doctrine/DoctrineORMModule/issues/219&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/DoctrineORMModule/issues/219&lt;/a&gt; in case anyone ends up here.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;</comment>
                    <comment id="20260" author="ocramius" created="Thu, 9 May 2013 22:06:31 +0000"  >&lt;p&gt;DoctrineModule has a 0.8.x branch. Closing&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-802] Missing variable $name in XmlExporter</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-802</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;At line 112 &lt;a href=&quot;http://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php#L112&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php#L112&lt;/a&gt; is required variable $name. This variable should be replaced by $unique&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;. And before this line should be test if(isset($unique&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;)).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11918">DDC-802</key>
            <summary>Missing variable $name in XmlExporter</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hason">Martin Haso&#328;</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Sep 2010 06:42:56 +0000</created>
                <updated>Wed, 15 Sep 2010 13:13:27 +0000</updated>
                    <resolved>Wed, 15 Sep 2010 13:13:27 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14382" author="guilhermeblanco" created="Wed, 15 Sep 2010 13:13:27 +0000"  >&lt;p&gt;On &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/4845745337dbbed5eead25c3062a07103b38649f&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/4845745337dbbed5eead25c3062a07103b38649f&lt;/a&gt; I fixed this issue.&lt;/p&gt;

&lt;p&gt;Thanks for the report.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1352] ErrorException: Undefined index in array</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1352</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The following query:&lt;br/&gt;
&quot;select c.id&lt;br/&gt;
                from \\Domain&lt;br class=&quot;atl-forced-newline&quot; /&gt;Cuisine c&lt;br/&gt;
                left join c.nameTranslation t&lt;br/&gt;
                left join t.translationValues v&lt;br/&gt;
                left join v.language l&lt;br/&gt;
                where v.value = :name&lt;br/&gt;
                    and l.id = :languageId&quot;&lt;/p&gt;

&lt;p&gt;Results in a PHP ErrorException in \Doctrine\ORM\Query\SqlWalker line 745:&lt;br/&gt;
$assoc = ( ! $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;isOwningSide&amp;#39;&amp;#93;&lt;/span&gt;) ? $targetClass-&amp;gt;associationMappings[$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mappedBy&amp;#39;&amp;#93;&lt;/span&gt;] : $relation;&lt;/p&gt;

&lt;p&gt;When I step through the execution, the array entry: $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mappedBy&amp;#39;&amp;#93;&lt;/span&gt; gets the following value: &quot;Domain\Translation&quot; in the scope where the error occurs.&lt;br/&gt;
$targetClass-&amp;gt;associationMappings has the following indices: &quot;translation&quot; and &quot;language&quot; and this leads to a &quot;Undefined index&quot; error and the execution breaks. It means that I cannot execute DQL queries, which is critical for the application to run.&lt;/p&gt;

&lt;p&gt;    &amp;lt;entity name=&quot;Domain\Cuisine&quot; table=&quot;Cuisine&quot; repository-class=&quot;Infrastructure\Persistence\Doctrine\Repository\CuisineRepository&quot;&amp;gt;&lt;br/&gt;
        &amp;lt;id name=&quot;id&quot; type=&quot;integer&quot; column=&quot;Id&quot;&amp;gt;&lt;br/&gt;
            &amp;lt;generator strategy=&quot;AUTO&quot;/&amp;gt;&lt;br/&gt;
        &amp;lt;/id&amp;gt;&lt;br/&gt;
        &amp;lt;many-to-one target-entity=&quot;Domain\Translation&quot; field=&quot;nameTranslation&quot;&amp;gt;&lt;br/&gt;
            &amp;lt;join-column name=&quot;NameTranslation_Id&quot; referenced-column-name=&quot;Id&quot;/&amp;gt;&lt;br/&gt;
        &amp;lt;/many-to-one&amp;gt;&lt;br/&gt;
    &amp;lt;/entity&amp;gt;&lt;/p&gt;

&lt;p&gt;     &amp;lt;entity name=&quot;Domain\Translation&quot; table=&quot;Translations&quot;&amp;gt;&lt;br/&gt;
         &amp;lt;id name=&quot;id&quot; type=&quot;integer&quot; column=&quot;Id&quot;&amp;gt;&lt;br/&gt;
             &amp;lt;generator strategy=&quot;AUTO&quot; /&amp;gt;&lt;br/&gt;
         &amp;lt;/id&amp;gt;&lt;br/&gt;
         &amp;lt;one-to-many target-entity=&quot;Domain\TranslationValue&quot; mapped-by=&quot;Domain\Translation&quot; field=&quot;translationValues&quot; orphan-removal=&quot;true&quot;&amp;gt;&lt;br/&gt;
             &amp;lt;cascade&amp;gt;&lt;br/&gt;
                 &amp;lt;cascade-all/&amp;gt;&lt;br/&gt;
             &amp;lt;/cascade&amp;gt;&lt;br/&gt;
         &amp;lt;/one-to-many&amp;gt;&lt;br/&gt;
     &amp;lt;/entity&amp;gt;&lt;/p&gt;

&lt;p&gt;    &amp;lt;entity name=&quot;Domain\TranslationValue&quot; table=&quot;TranslationValues&quot;&amp;gt;&lt;br/&gt;
        &amp;lt;id name=&quot;id&quot; type=&quot;integer&quot; column=&quot;Id&quot;&amp;gt;&lt;br/&gt;
         &amp;lt;generator strategy=&quot;AUTO&quot; /&amp;gt;&lt;br/&gt;
        &amp;lt;/id&amp;gt;&lt;/p&gt;

&lt;p&gt;        &amp;lt;field name=&quot;value&quot; type=&quot;string&quot; column=&quot;Value&quot; /&amp;gt;&lt;/p&gt;

&lt;p&gt;        &amp;lt;many-to-one field=&quot;translation&quot; target-entity=&quot;Domain\Translation&quot;&amp;gt;&lt;br/&gt;
            &amp;lt;join-column name=&quot;Translation_Id&quot; nullable=&quot;false&quot; referenced-column-name=&quot;Id&quot; /&amp;gt;&lt;br/&gt;
        &amp;lt;/many-to-one&amp;gt;&lt;/p&gt;

&lt;p&gt;        &amp;lt;many-to-one field=&quot;language&quot; target-entity=&quot;Domain\Language&quot;&amp;gt;&lt;br/&gt;
            &amp;lt;join-column name=&quot;Language_Id&quot; nullable=&quot;false&quot; referenced-column-name=&quot;Id&quot; /&amp;gt;&lt;br/&gt;
        &amp;lt;/many-to-one&amp;gt;&lt;br/&gt;
    &amp;lt;/entity&amp;gt;&lt;/p&gt;

&lt;p&gt;     &amp;lt;entity name=&quot;Domain\Language&quot; table=&quot;Languages&quot; repository-class=&quot;\Infrastructure\Persistence\Doctrine\Repository\TranslationRepository&quot;&amp;gt;&lt;br/&gt;
         &amp;lt;id name=&quot;id&quot; type=&quot;integer&quot; column=&quot;Id&quot;&amp;gt;&lt;br/&gt;
             &amp;lt;generator strategy=&quot;AUTO&quot; /&amp;gt;&lt;br/&gt;
         &amp;lt;/id&amp;gt;&lt;br/&gt;
         &amp;lt;field name=&quot;name&quot; type=&quot;string&quot; column=&quot;Name&quot; /&amp;gt;&lt;br/&gt;
         &amp;lt;field name=&quot;shortIsoCode&quot; type=&quot;string&quot; column=&quot;ShortIsoCode&quot;/&amp;gt;&lt;br/&gt;
         &amp;lt;field name=&quot;longIsoCode&quot; type=&quot;string&quot; column=&quot;LongIsoCode&quot;/&amp;gt;&lt;br/&gt;
         &amp;lt;field name=&quot;isDefault&quot; type=&quot;boolean&quot; column=&quot;IsDefault&quot; /&amp;gt;&lt;br/&gt;
     &amp;lt;/entity&amp;gt;&lt;/p&gt;</description>
                <environment>Windows 7, PHP 5.3.3</environment>
            <key id="12984">DDC-1352</key>
            <summary>ErrorException: Undefined index in array</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="sorenmh">S&#248;ren</reporter>
                        <labels>
                    </labels>
                <created>Tue, 30 Aug 2011 19:53:49 +0000</created>
                <updated>Thu, 1 Sep 2011 02:58:12 +0000</updated>
                    <resolved>Thu, 1 Sep 2011 02:58:12 +0000</resolved>
                            <version>2.1.1</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16407" author="guilhermeblanco" created="Thu, 1 Sep 2011 02:58:12 +0000"  >&lt;p&gt;Your mapping information is wrong.&lt;br/&gt;
The mappedBy value must reference the field name of the owning side, and not the class name.&lt;/p&gt;

&lt;p&gt;Marking ticket as invalid.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2036] indexBy breaks cascade remove</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2036</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Adding the annotation indexBy causes the cascade annotation to be ignored:&lt;/p&gt;

&lt;p&gt;/**&lt;br/&gt;
 *&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@var ArrayCollection&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;@ORM\OneToMany(targetEntity=&quot;LocationData&quot;, mappedBy=&quot;location&quot;, indexBy=&quot;name&quot;, cascade=
{&quot;persist&quot;, &quot;remove&quot;}
&lt;p&gt;)&lt;br/&gt;
 */&lt;br/&gt;
protected $data;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Will cause an error when deleting the objects:&lt;/p&gt;

&lt;p&gt;An exception occurred while executing &apos;DELETE FROM location WHERE id = ?&apos; with params &lt;/p&gt;
{&quot;1&quot;:19306}
&lt;p&gt;:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`symfony`.`location_data`, CONSTRAINT `FK_2DF7462364D218E` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`))&lt;/p&gt;

&lt;p&gt;Removing indexBy fixes the issue.&lt;/p&gt;

&lt;p&gt;My class structure is:&lt;/p&gt;

&lt;p&gt;Location has many LocationData&lt;br/&gt;
LocationData extends AbstractData&lt;/p&gt;

&lt;p&gt;The name field I am trying to index by comes from the AbstractData class.&lt;/p&gt;</description>
                <environment>Ubuntu 12.04, PHP 5.3, 64 Bit, Symfony 2</environment>
            <key id="14048">DDC-2036</key>
            <summary>indexBy breaks cascade remove</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                                <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="jebbench">James Bench</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Sep 2012 13:50:04 +0000</created>
                <updated>Wed, 3 Oct 2012 17:05:04 +0000</updated>
                    <resolved>Wed, 3 Oct 2012 17:05:04 +0000</resolved>
                            <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18702" author="fabio.bat.silva" created="Sun, 23 Sep 2012 21:56:51 +0000"  >&lt;p&gt;Hi James&lt;/p&gt;

&lt;p&gt;Do you have a failing test case ?&lt;br/&gt;
Could you attach/paste your entity please ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18740" author="jebbench" created="Fri, 28 Sep 2012 10:15:01 +0000"  >&lt;p&gt;Entity exhibiting the behavior.&lt;/p&gt;</comment>
                    <comment id="18742" author="fabio.bat.silva" created="Sat, 29 Sep 2012 19:15:48 +0000"  >&lt;p&gt;Hi James,&lt;br/&gt;
I can&apos;t reproduce,&lt;/p&gt;

&lt;p&gt;Are you sure that you dont have more than one LocationData whith the same name ?&lt;/p&gt;

&lt;p&gt;When working with indexBy the index columns must be unique into the collection.&lt;br/&gt;
I recommend that you add a unique constrain in the columns name.&lt;/p&gt;

&lt;p&gt;If i&apos;m wrong about it, please&lt;br/&gt;
Could you change the added test case and try to make it fails ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18749" author="jebbench" created="Tue, 2 Oct 2012 10:21:28 +0000"  >&lt;p&gt;Hi Fabio,&lt;/p&gt;

&lt;p&gt;The test case uses a SQLite DB without any foreign keys so the issue wouldn&apos;t be apparent.&lt;/p&gt;

&lt;p&gt;How would I run the test against a MySQL db?&lt;/p&gt;

&lt;p&gt;I&apos;ve also attached the SQL log for the script I&apos;m running, it looks the same as the output from the testcase.&lt;/p&gt;

&lt;p&gt;Cheers,JB&lt;/p&gt;</comment>
                    <comment id="18750" author="jebbench" created="Tue, 2 Oct 2012 10:22:27 +0000"  >&lt;p&gt;SQL Log from script causing errors.&lt;/p&gt;</comment>
                    <comment id="18752" author="fabio.bat.silva" created="Tue, 2 Oct 2012 12:39:32 +0000"  >&lt;p&gt;Hi James,&lt;/p&gt;

&lt;p&gt;You must copy phpunit.xml.dist to phpunit.xml and change the database configurations.&lt;/p&gt;

&lt;p&gt;I have attached the mysql log, the test case works fine.&lt;/p&gt;</comment>
                    <comment id="18754" author="jebbench" created="Tue, 2 Oct 2012 12:44:31 +0000"  >&lt;p&gt;It appears that it only attempts to delete 68 LocationData rows but in the database there are 76.&lt;/p&gt;</comment>
                    <comment id="18755" author="jebbench" created="Tue, 2 Oct 2012 12:46:07 +0000"  >&lt;p&gt;Okay, I&apos;ve found the reason for this; the name isn&apos;t unique, some are duplicated.&lt;br/&gt;
Once the duplicates are removed there are 68 rows.&lt;br/&gt;
I&apos;ll add a unique index to the name column and hopefully this problem will go away.&lt;/p&gt;

&lt;p&gt;Not sure whether you would consider this a bug.&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;</comment>
                    <comment id="18756" author="fabio.bat.silva" created="Tue, 2 Oct 2012 13:00:28 +0000"  >&lt;p&gt;No problem, you are welcome &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Actually isn&apos;t a bug, it is a documented behavior.&lt;/p&gt;

&lt;p&gt;&quot;Fields that are used for the index by feature HAVE to be unique in the database.&quot;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/working-with-indexed-associations.html#working-with-indexed-assocations&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/working-with-indexed-associations.html#working-with-indexed-assocations&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18768" author="fabio.bat.silva" created="Wed, 3 Oct 2012 17:05:04 +0000"  >&lt;p&gt;Fields that are used for the index by feature HAVE to be unique in the database.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/working-with-indexed-associations.html#working-with-indexed-assocations&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/working-with-indexed-associations.html#working-with-indexed-assocations&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11329" name="AbstractData.php" size="1340" author="jebbench" created="Fri, 28 Sep 2012 10:15:01 +0000" />
                    <attachment id="11332" name="DDC2036Test.php" size="4152" author="fabio.bat.silva" created="Sat, 29 Sep 2012 19:15:48 +0000" />
                    <attachment id="11330" name="Location.php" size="1506" author="jebbench" created="Fri, 28 Sep 2012 10:15:01 +0000" />
                    <attachment id="11331" name="LocationData.php" size="551" author="jebbench" created="Fri, 28 Sep 2012 10:15:01 +0000" />
                    <attachment id="11334" name="msql.log" size="1748" author="fabio.bat.silva" created="Tue, 2 Oct 2012 12:39:32 +0000" />
                    <attachment id="11333" name="sql_flush.log" size="5793" author="jebbench" created="Tue, 2 Oct 2012 10:22:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2285] Repeating the same query with different parameter value returns the same results</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2285</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;
$activeAdsCustomers = \Ez\Registry::getDoctrineEntityManager()
    -&amp;gt;createQuery( &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT c, a FROM \Spot101\Model\Ad\Customer c JOIN c.ads a WHERE a.status = :status&quot;&lt;/span&gt; )
    -&amp;gt;setParameter( &lt;span class=&quot;code-quote&quot;&gt;&quot;status&quot;&lt;/span&gt;, \Spot101\Model\Ad\Status::ACTIVE )
    -&amp;gt;getResult();

$inactiveAdsCustomers = \Ez\Registry::getDoctrineEntityManager()
    -&amp;gt;createQuery( &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT c, a FROM \Spot101\Model\Ad\Customer c JOIN c.ads a WHERE a.status = :status&quot;&lt;/span&gt; )
    -&amp;gt;setParameter( &lt;span class=&quot;code-quote&quot;&gt;&quot;status&quot;&lt;/span&gt;, \Spot101\Model\Ad\Status::INACTIVE )
    -&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Having the code above I am getting the same results for $inactiveAdsCustomers as I get for $activeAdsCustomers. And when I try hydrating the results everything works so fine.&lt;/p&gt;

&lt;p&gt;Both queries look the same except the value provided for the &quot;status&quot; parameter.&lt;/p&gt;</description>
                <environment>Ubuntu 12.10, Zend Server CE</environment>
            <key id="14465">DDC-2285</key>
            <summary>Repeating the same query with different parameter value returns the same results</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="mehdone">Mehdi Bakhtiari</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Feb 2013 04:38:32 +0000</created>
                <updated>Fri, 8 Feb 2013 08:26:18 +0000</updated>
                    <resolved>Fri, 8 Feb 2013 08:26:18 +0000</resolved>
                            <version>2.3.2</version>
                                                <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19485" author="ocramius" created="Fri, 8 Feb 2013 08:26:18 +0000"  >&lt;p&gt;You are hydrating joined and filtered resultsets. You should never do this, as this will hydrate an invalid association into your objects.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2179] Transactions should sent in group not chunked</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2179</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In UnitOfWork::commit() it seems that a transaction is done like this:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;will send separate queries for transaction start&lt;/li&gt;
	&lt;li&gt;compute the queries/send them to the db driver&lt;/li&gt;
	&lt;li&gt;execute the commit statement&lt;/li&gt;
	&lt;li&gt;optionally execute rollback&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;The question would be, should my webserver have some issues with resources, wouldn&apos;t this part of the code be a pain for the DB?&lt;/p&gt;

&lt;p&gt;I don&apos;t know how mysql, for example, handles sending the transaction in chunks  as opposed to sending it in 2/3 statements ( begin + ops and commit / + revert in case of failure) or in mySQL,l the transaction is evaluated on COMMIT statement only?&lt;/p&gt;

&lt;p&gt;If my assumption about how MySQL works, locking everything as soon as the statement is on the server, then shouldn&apos;t Doctrine use a internal buffer for sending transactions to the DB driver in order to avoid all sorts of problems that appear in high concurency scenarios?&lt;/p&gt;


&lt;p&gt;Best regards.&lt;/p&gt;</description>
                <environment>MySQL 5.5 / Percona</environment>
            <key id="14282">DDC-2179</key>
            <summary>Transactions should sent in group not chunked</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="dlsniper">Florin Patan</reporter>
                        <labels>
                        <label>unitofwork</label>
                    </labels>
                <created>Thu, 29 Nov 2012 22:16:37 +0000</created>
                <updated>Fri, 30 Nov 2012 14:31:16 +0000</updated>
                    <resolved>Fri, 30 Nov 2012 14:28:10 +0000</resolved>
                            <version>2.2</version>
                <version>2.3</version>
                <version>Git Master</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19080" author="ocramius" created="Fri, 30 Nov 2012 13:21:29 +0000"  >&lt;p&gt;Invalid IMO. This is an over-complication that (in such high load scenarios) is handled by clustering/load balancing. Not a problem of the ORM, since smashing all statements together will just make it impossible to trap any problems.&lt;/p&gt;</comment>
                    <comment id="19082" author="ocramius" created="Fri, 30 Nov 2012 14:28:10 +0000"  >&lt;p&gt;This performance improvement has been discussed directly on IRC.&lt;/p&gt;

&lt;p&gt;The original problem is related to deadlocks and small transactions, which is not anyway solved by this issue.&lt;/p&gt;

&lt;p&gt;Otherwise, this improvement requires a PoC that shows that it is possible to have exceptions still showing the query that caused the failure.&lt;/p&gt;</comment>
                    <comment id="19083" author="ocramius" created="Fri, 30 Nov 2012 14:31:16 +0000"  >&lt;p&gt;Sorry, was unclear. I basically mean that any approach squashing the queries into a single chunk sent to the DB should also allow us to get computed insert IDs and eventual exceptions should bubble up with the query that caused them.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-263] YAML and XML Driver do not support cascading options &quot;all&quot;, &quot;detach&quot;. Also: Improvement of YAML Syntax (Patch attached)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-263</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a small patch which addresses the following issues:&lt;/p&gt;

&lt;p&gt;-&amp;gt; YAML did not support cascading options &quot;all&quot; (as described in documentation) and &quot;detach&quot; (as used in AssociationMapping class). The attached patch fixes that.&lt;/p&gt;

&lt;p&gt;-&amp;gt; XML does not support these things either, but the attached patch DOES NOT FIX THAT (see below).&lt;/p&gt;

&lt;p&gt;Also addressed:&lt;/p&gt;

&lt;p&gt;YAML had syntax like cascadeRemove, cascadePersist etc., but the documentation for the annotation driver uses only &quot;persist, remove&quot; etc.&lt;/p&gt;

&lt;p&gt;This patch changes the syntax to the following:&lt;/p&gt;

&lt;p&gt;cascade: [ persist, remove ]&lt;/p&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;p&gt;cascade:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;persist&lt;/li&gt;
	&lt;li&gt;remove&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;(Both work!)&lt;/p&gt;

&lt;p&gt;It is now also possible to use cascade: &lt;span class=&quot;error&quot;&gt;&amp;#91;all&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The YAML Driver was changed in that way that he must not know about the currently supported cascate actions. This has been pushed towards the AssociationMapping and I strongly believe that this is the right way.&lt;/p&gt;

&lt;p&gt;On the other hand, I did &lt;b&gt;not&lt;/b&gt; change the XML Driver functionality. It does still know about the cascade actions and does most probably &lt;b&gt;not&lt;/b&gt; support the detach and &quot;all&quot; actions. That should be fixed, but won&apos;t take too long.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10750">DDC-263</key>
            <summary>YAML and XML Driver do not support cascading options &quot;all&quot;, &quot;detach&quot;. Also: Improvement of YAML Syntax (Patch attached)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jan 2010 17:37:38 +0000</created>
                <updated>Fri, 22 Jan 2010 15:11:48 +0000</updated>
                    <resolved>Fri, 22 Jan 2010 15:11:48 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11444" author="shurakai" created="Fri, 22 Jan 2010 13:39:24 +0000"  >&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;YAML Driver fixed.&lt;/li&gt;
	&lt;li&gt;XML Driver fixed (supports now both cascade-persist and (because the other drivers do not use the prefixed cascade-) single &quot;persist&quot;)&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;I&apos;ve modified the UnitTests to cover cascade=&quot;all&quot; for XML &amp;amp; YAML&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="11445" author="romanb" created="Fri, 22 Jan 2010 13:48:14 +0000"  >&lt;p&gt;That patch looks good but there seem to be tabs in your patches. Please make sure that you use &quot;soft tabs&quot; (4 spaces) in your editor.&lt;/p&gt;</comment>
                    <comment id="11446" author="shurakai" created="Fri, 22 Jan 2010 13:58:11 +0000"  >&lt;p&gt;Resolved tab issue.&lt;/p&gt;</comment>
                    <comment id="11447" author="romanb" created="Fri, 22 Jan 2010 15:11:48 +0000"  >&lt;p&gt;Patch applied. Thanks! So this will be included in todays ALPHA4 release.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10310" name="MappingDriversCascade.patch" size="9949" author="shurakai" created="Fri, 22 Jan 2010 13:58:11 +0000" />
                    <attachment id="10309" name="MappingDriversCascade.patch" size="9834" author="shurakai" created="Fri, 22 Jan 2010 13:39:23 +0000" />
                    <attachment id="10299" name="YamlDriver_change_cascade_syntax.php.patch" size="4030" author="shurakai" created="Tue, 19 Jan 2010 17:37:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-193] Remove ClassMetadataInfo#inverseMappings</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-193</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The ClassMetadataInfo#inverseMappings attribute is an unnecessary complication.&lt;/p&gt;

&lt;p&gt;The problem comes down to: &quot;Given an association $assoc, how do I know if the association is bidirectional?&quot;.&lt;/p&gt;

&lt;p&gt;If $assoc is the inverse side ($assoc-&amp;gt;isInverseSide()), its clear, its bidirectional. But if $assoc is the owning side, we dont know.&lt;br/&gt;
What we currently do to determine that in such a case looks as follows:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($targetClass-&amp;gt;inverseMappings[$assoc-&amp;gt;sourceEntityName][$assoc-&amp;gt;sourceFieldName])) {
                &lt;span class=&quot;code-comment&quot;&gt;// Bi-directional
&lt;/span&gt;            }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So we check whether the target class has an inverse mapping to the source class. This is quite cumbersome. Additionally, we&apos;re usually only interested in the sourceFieldName of the inverse association.&lt;/p&gt;

&lt;p&gt;Therefore, it would simplify internal code a lot if we simply introduced a &quot;inversedBy&quot; attribute on an association that is used on the owning side and that corresponds to &quot;mappedBy&quot; on the inverse side. 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 A {
...
   /**
    * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Other&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;a&quot;&lt;/span&gt;)
    * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;other_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; $other;
...
}
...
/** @Entity */
class Other {
    /** @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;A&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;other&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $a;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This breaks BC. However, I think this is really necessary as it simplifies and speeds up the code, together with removing the inverseMappings attribute altogether.&lt;/p&gt;

&lt;p&gt;So this should happen before beta.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10569">DDC-193</key>
            <summary>Remove ClassMetadataInfo#inverseMappings</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 6 Dec 2009 12:03:31 +0000</created>
                <updated>Sat, 10 Apr 2010 05:18:00 +0000</updated>
                    <resolved>Sat, 10 Apr 2010 05:18:00 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12535" author="romanb" created="Wed, 31 Mar 2010 15:28:43 +0000"  >&lt;p&gt;Patch is ready and will be committed within the next week.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10536" name="ddc193.patch" size="55632" author="romanb" created="Wed, 31 Mar 2010 08:49:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-199] collection-valued, polymorphic fetch joins broken (hydration)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-199</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Polymorphic fetch-joins of collections are currently broken in the ObjectHydrator.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10577">DDC-199</key>
            <summary>collection-valued, polymorphic fetch joins broken (hydration)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Dec 2009 20:14:17 +0000</created>
                <updated>Mon, 7 Dec 2009 20:36:12 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 20:36:12 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-187] JOIN fails with inherited entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-187</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&quot;Entity\User\AbstractUser&quot; is a base entity for user records, &quot;Entity\User\Person&quot; extends AbstractUser (Single Table inheritance in this case).&lt;br/&gt;
The &quot;Setting&quot; property is a OneToOne relation with another entity.&lt;/p&gt;

&lt;p&gt;Now when I call this DQL:&lt;br/&gt;
&lt;tt&gt;SELECT u, t FROM Entity\User\AbstractUser u LEFT JOIN u.Setting t&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;The ObjectHydrator fails in line 276 (&quot;if ( ! $relation-&amp;gt;isOneToOne()) {&quot;...) with &quot;PHP Fatal error:  Call to a member function isOneToOne() on a non-object in .../lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php&quot;.&lt;/p&gt;

&lt;p&gt;It works when using the sub class for the query:&lt;br/&gt;
&lt;tt&gt;SELECT u, t FROM Entity\User\Person u LEFT JOIN u.Setting t&lt;/tt&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10542">DDC-187</key>
            <summary>JOIN fails with inherited entities</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 09:20:14 +0000</created>
                <updated>Thu, 3 Dec 2009 13:18:25 +0000</updated>
                    <resolved>Thu, 3 Dec 2009 13:18:25 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10965" author="nicokaiser" created="Wed, 2 Dec 2009 09:20:35 +0000"  >&lt;p&gt;It seems like ObjectHydrator::_hydrateRow tries to find a _ce entry for AbstractUser (but _ce only holds entries for Person)...&lt;/p&gt;</comment>
                    <comment id="10980" author="romanb" created="Wed, 2 Dec 2009 20:18:44 +0000"  >&lt;p&gt;Does Setting use inheritance also? TopnewsSetting extends Setting? If so which inheritance type?&lt;/p&gt;</comment>
                    <comment id="10981" author="romanb" created="Wed, 2 Dec 2009 20:21:46 +0000"  >&lt;p&gt;Can we see the classes and their mappings? AbstractUser, User, Setting and TopnewsSetting. Then I can set up a test to reproduce it. Thanks!&lt;/p&gt;</comment>
                    <comment id="10982" author="nicokaiser" created="Wed, 2 Dec 2009 20:22:08 +0000"  >&lt;p&gt;Oh no I forgot to change TopnewsSetting to Setting in this report, there is no inheritance, just copy &amp;amp; paste bug. &lt;/p&gt;</comment>
                    <comment id="10986" author="nicokaiser" created="Thu, 3 Dec 2009 09:28:24 +0000"  >&lt;p&gt;Here are the classes and example code:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pastie.org/private/ljkiowarvm9trhdyug903q&quot; class=&quot;external-link&quot;&gt;http://pastie.org/private/ljkiowarvm9trhdyug903q&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="10988" author="romanb" created="Thu, 3 Dec 2009 12:31:19 +0000"  >&lt;p&gt;Successfully reproduced in our test suite and working on it.&lt;/p&gt;</comment>
                    <comment id="10990" author="romanb" created="Thu, 3 Dec 2009 13:18:25 +0000"  >&lt;p&gt;Should be fixed now. Thanks for reporting.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-171] Cascade persist update foreign key for all unchanged entities </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-171</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using cascade persist, linked entities get updated even if there is no change made.&lt;/p&gt;

&lt;p&gt;I get an update on the unchanged foreign key even if I don&apos;t modify&lt;br/&gt;
the entity at all.&lt;/p&gt;

&lt;div class=&quot;code panel&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 email SET client_id = ? WHERE 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;$query = $qb-&amp;gt;getQuery();
$client = $query-&amp;gt;getSingleResult();
$em-&amp;gt;flush(); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10492">DDC-171</key>
            <summary>Cascade persist update foreign key for all unchanged entities </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="rickdt">Eric Durand-Tremblay</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Nov 2009 19:08:33 +0000</created>
                <updated>Thu, 10 Dec 2009 22:06:40 +0000</updated>
                    <resolved>Thu, 10 Dec 2009 21:31:07 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11131" author="romanb" created="Wed, 9 Dec 2009 13:33:14 +0000"  >&lt;p&gt;Can we see the query? I mean the DQL query! Thanks.&lt;/p&gt;</comment>
                    <comment id="11132" author="romanb" created="Wed, 9 Dec 2009 13:38:03 +0000"  >&lt;p&gt;Nevermind. Got it reproduced.&lt;/p&gt;</comment>
                    <comment id="11139" author="rickdt" created="Wed, 9 Dec 2009 16:20:56 +0000"  >&lt;p&gt;I tried with revision 6913 and I still reproduce the problem.&lt;/p&gt;

&lt;p&gt;Is there anyway I can use your UniTest framework, that way, I could check your test case and maybe suggest improvement.&lt;/p&gt;</comment>
                    <comment id="11140" author="rickdt" created="Wed, 9 Dec 2009 16:34:52 +0000"  >&lt;p&gt;I managed to run the UnitTests.&lt;/p&gt;

&lt;p&gt;Do you have a test for this specific issue ?&lt;/p&gt;</comment>
                    <comment id="11141" author="rickdt" created="Wed, 9 Dec 2009 16:44:03 +0000"  >&lt;p&gt;Here is my result for Doctrine/Tests/ORM/AllTests.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;1) testOptimisticTimestampSetsDefaultValue(Doctrine\Tests\ORM\Functional\Locking\OptimisticTest)
strtotime(): It is not safe to rely on the system&apos;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; you used any of those methods and you are still getting &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; warning, you most likely misspelled the timezone identifier. We selected &apos;America/New_York&apos; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &apos;EST/-5.0/no DST&apos; instead
/home/eric/doctrine_trunk/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php:126

2) testOptimisticTimestampFailureThrowsException(Doctrine\Tests\ORM\Functional\Locking\OptimisticTest)
DateTime::createFromFormat(): It is not safe to rely on the system&apos;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; you used any of those methods and you are still getting &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; warning, you most likely misspelled the timezone identifier. We selected &apos;America/New_York&apos; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &apos;EST/-5.0/no DST&apos; instead
/home/eric/doctrine_trunk/lib/Doctrine/DBAL/Types/DateTimeType.php:33
/home/eric/doctrine_trunk/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:225
/home/eric/doctrine_trunk/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:239
/home/eric/doctrine_trunk/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:112
/home/eric/doctrine_trunk/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:102
/home/eric/doctrine_trunk/lib/Doctrine/ORM/AbstractQuery.php:511
/home/eric/doctrine_trunk/lib/Doctrine/ORM/AbstractQuery.php:387
/home/eric/doctrine_trunk/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php:136

3) testJoinedSubclassPersisterRequiresSpecificOrderOfMetadataReflFieldsArray(Doctrine\Tests\ORM\Functional\Ticket\DDC168Test)
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column &apos;salary&apos; cannot be &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
/home/eric/doctrine_trunk/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php:190
/home/eric/doctrine_trunk/lib/Doctrine/ORM/UnitOfWork.php:698
/home/eric/doctrine_trunk/lib/Doctrine/ORM/UnitOfWork.php:283
/home/eric/doctrine_trunk/lib/Doctrine/ORM/EntityManager.php:288
/home/eric/doctrine_trunk/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php:34
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    <comment id="11142" author="romanb" created="Wed, 9 Dec 2009 16:48:11 +0000"  >&lt;p&gt;You need to fix your timezone settings but that is unrelated to this problem.&lt;/p&gt;

&lt;p&gt;To reproduce it, I added the following test temporarily to Doctrine\Tests\ORM\Functional\BasicFunctionalTest.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 testFlushDoesNotIssueUnnecessaryUpdates()
    {
        
        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CmsUser;
        $user-&amp;gt;name = &apos;Guilherme&apos;;
        $user-&amp;gt;username = &apos;gblanco&apos;;
        $user-&amp;gt;status = &apos;developer&apos;;
        
        $address = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CmsAddress;
        $address-&amp;gt;country = &apos;Germany&apos;;
        $address-&amp;gt;city = &apos;Berlin&apos;;
        $address-&amp;gt;zip = &apos;12345&apos;;
        
        $address-&amp;gt;user = $user;
        $user-&amp;gt;address = $address;
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($user);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();
        
        &lt;span class=&quot;code-comment&quot;&gt;// show SQL from here on...
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getConnection()-&amp;gt;getConfiguration()-&amp;gt;setSqlLogger(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\DBAL\Logging\EchoSqlLogger);
        
        
        $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.address a&apos;);
        echo &lt;span class=&quot;code-quote&quot;&gt;&quot;QUERY!&quot;&lt;/span&gt;.PHP_EOL;
        $user2 = $query-&amp;gt;getSingleResult();
        
        echo &lt;span class=&quot;code-quote&quot;&gt;&quot;FLUSH!&quot;&lt;/span&gt;.PHP_EOL;
        $&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;However, since I did not really know how to check that, keeping this test in didnt make much sense.&lt;/p&gt;

&lt;p&gt;Can you try this test? Before my patch it issued an UPDATE query but not after my changes.&lt;/p&gt;

&lt;p&gt;It is pretty difficult to test this in an isolated manner.&lt;/p&gt;</comment>
                    <comment id="11143" author="beberlei" created="Wed, 9 Dec 2009 16:48:40 +0000"  >&lt;p&gt;First two failures are your fault, you havent set the default timezone in php.ini&lt;/p&gt;

&lt;p&gt;The last failure is unrelated, its a benchmark for another bug.&lt;/p&gt;</comment>
                    <comment id="11144" author="romanb" created="Wed, 9 Dec 2009 17:00:59 +0000"  >&lt;p&gt;OK. Latest trunk contains a test now that verifies that no SQL is executed on the flush.&lt;/p&gt;

&lt;p&gt;Can you please tell us how to modify it to reproduce the problem?&lt;/p&gt;

&lt;p&gt;Look into: Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php&lt;/p&gt;

&lt;p&gt;Last test method.&lt;/p&gt;</comment>
                    <comment id="11147" author="rickdt" created="Wed, 9 Dec 2009 17:50:52 +0000"  >&lt;p&gt;Got it!  Your fix worked on OneToOne relation but not OneToMany&lt;/p&gt;

&lt;p&gt;I did the same test using the CmsArticles entity and here is the 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 c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c1_.id AS id4, c1_.topic AS topic5, c1_.text AS text6, c1_.user_id AS user_id7 FROM cms_users c0_ INNER JOIN cms_articles c1_ ON c0_.id = c1_.user_id
FLUSH!
UPDATE cms_users SET name = ? WHERE id = ?
array(2) {
  [0]=&amp;gt;
  string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;FooBar&quot;&lt;/span&gt;
  [1]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(17)
}
UPDATE cms_articles SET user_id = ? WHERE id = ?
array(2) {
  [0]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(17)
  [1]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
}
DONE!
DELETE FROM cms_users_groups
DELETE FROM cms_groups
DELETE FROM cms_addresses
DELETE FROM cms_phonenumbers
DELETE FROM cms_articles
DELETE FROM cms_users
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11148" author="rickdt" created="Wed, 9 Dec 2009 17:52:43 +0000"  >&lt;p&gt;Dont forget to add the cascade persist for the articles relation&lt;/p&gt;


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

        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CmsUser;
        $user-&amp;gt;name = &apos;Guilherme&apos;;
        $user-&amp;gt;username = &apos;gblanco&apos;;
        $user-&amp;gt;status = &apos;developer&apos;;

        $address = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CmsAddress;
        $address-&amp;gt;country = &apos;Germany&apos;;
        $address-&amp;gt;city = &apos;Berlin&apos;;
        $address-&amp;gt;zip = &apos;12345&apos;;

        $article = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Tests\Models\CMS\CmsArticle();
        $article-&amp;gt;text = &lt;span class=&quot;code-quote&quot;&gt;&quot;Lorem ipsum dolor sunt.&quot;&lt;/span&gt;;
        $article-&amp;gt;topic = &lt;span class=&quot;code-quote&quot;&gt;&quot;A Test Article!&quot;&lt;/span&gt;;
        $article-&amp;gt;setAuthor($user);
        $user-&amp;gt;articles[] = $article;


        $address-&amp;gt;user = $user;
        $user-&amp;gt;address = $address;

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($user);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();

        &lt;span class=&quot;code-comment&quot;&gt;// show SQL from here on...
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getConnection()-&amp;gt;getConfiguration()-&amp;gt;setSqlLogger(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\DBAL\Logging\EchoSqlLogger);


        &lt;span class=&quot;code-comment&quot;&gt;//$query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.address a&apos;);
&lt;/span&gt;        $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.articles a&apos;);
        echo &lt;span class=&quot;code-quote&quot;&gt;&quot;QUERY!&quot;&lt;/span&gt;.PHP_EOL;
        $user2 = $query-&amp;gt;getSingleResult();

        $user2-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;FooBar&quot;&lt;/span&gt;;

        echo &lt;span class=&quot;code-quote&quot;&gt;&quot;FLUSH!&quot;&lt;/span&gt;.PHP_EOL;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();

        echo &lt;span class=&quot;code-quote&quot;&gt;&quot;DONE!&quot;&lt;/span&gt;.PHP_EOL;

    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11149" author="romanb" created="Wed, 9 Dec 2009 17:55:21 +0000"  >&lt;p&gt;OK. I will look into this later or tomorrow.&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;</comment>
                    <comment id="11163" author="romanb" created="Thu, 10 Dec 2009 21:31:07 +0000"  >&lt;p&gt;Should be fixed now (second attempt) &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Can you check whether &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-140&quot; title=&quot;hydrateAdd does not update originalEntityData&quot;&gt;&lt;del&gt;DDC-140&lt;/del&gt;&lt;/a&gt; can be closed also?&lt;/p&gt;</comment>
                    <comment id="11168" author="rickdt" created="Thu, 10 Dec 2009 22:06:40 +0000"  >&lt;p&gt;Yes, this is now fixed for me.&lt;br/&gt;
I confirm you this also close &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-140&quot; title=&quot;hydrateAdd does not update originalEntityData&quot;&gt;&lt;del&gt;DDC-140&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for your great work !!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-132] Subclass&apos; columns missing from cached ClassMetadata::$resultColumnNames</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-132</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a Customer with class table inheritance mapping and some fields, and a subclass called SuperCustomer with two fields: bool `isSuper` and string `extra`.&lt;/p&gt;

&lt;p&gt;I found that when replacing the usual ArrayCache with a MemcacheCache, everything works fine on the first request, but notices occur on subsequent requests:&lt;/p&gt;

&lt;p&gt;Notice:  Undefined index: isSuper in X:\...\Doctrine\ORM\Persisters\StandardEntityPersister.php on line 577&lt;br/&gt;
Notice:  Undefined index: extra in X:\...\Doctrine\ORM\Persisters\StandardEntityPersister.php on line 577&lt;/p&gt;

&lt;p&gt;Inspection of ClassMetadata::$resultColumnNames on line 569 showed that the two fields `isSuper` and `extra` were (the only things) missing. The resulting object&apos;s `isSuper` and `extra` properties were empty.&lt;/p&gt;

&lt;p&gt;I have yet to find the cause of this, but maybe you have an idea.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10372">DDC-132</key>
            <summary>Subclass&apos; columns missing from cached ClassMetadata::$resultColumnNames</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="reinier.kip">Reinier Kip</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Nov 2009 14:24:32 +0000</created>
                <updated>Wed, 9 Dec 2009 12:39:08 +0000</updated>
                    <resolved>Wed, 9 Dec 2009 12:39:08 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10553" author="romanb" created="Mon, 9 Nov 2009 19:29:39 +0000"  >&lt;p&gt;This is indeed strange. My first guess was that the resultColumnNames get lost during serialization but the ClassMetadata#__sleep implementation seems to be correct in so far as it returns the resultColumnNames field as part of the fields to serialize.&lt;/p&gt;

&lt;p&gt;Let me know as soon as you have more information.&lt;/p&gt;

&lt;p&gt;Btw. Which metadata driver are you using? Annotations?&lt;/p&gt;</comment>
                    <comment id="10555" author="reinier.kip" created="Tue, 10 Nov 2009 07:42:40 +0000"  >&lt;p&gt;&amp;gt; My first guess was that the resultColumnNames get lost during serialization&lt;br/&gt;
This would be really strange, as the columns of the parent class Customer are still there after unserialization, so only a part is lost during serialization. My first guess was that the metadata is cached before the metadata loading is finished.&lt;/p&gt;

&lt;p&gt;&amp;gt; Which metadata driver are you using? Annotations?&lt;br/&gt;
I&apos;m using a custom metadata driver. Caching is separated from the driver, so the driver couldn&apos;t have anything to do with this, right?&lt;/p&gt;

&lt;p&gt;I&apos;ll try to find where it goes wrong and let you know.&lt;/p&gt;</comment>
                    <comment id="10556" author="reinier.kip" created="Tue, 10 Nov 2009 08:10:43 +0000"  >&lt;p&gt;First request:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Customer metadata is loaded and cached to Customer$CLASSMETADATA. $resultColumnNames contains Customer&apos;s fields.&lt;/li&gt;
	&lt;li&gt;SuperCustomer metadata is loaded and cached to SuperCustomer$CLASSMETADATA. $resultColumnNames contains Customer&apos;s and SuperCustomer&apos;s fields.&lt;/li&gt;
	&lt;li&gt;I request an object of class Customer be loaded from the database, which is an instance of SuperCustomer.&lt;/li&gt;
	&lt;li&gt;StandardEntityPersister::_createEntity() is called to create the entity, and uses Customer metadata ALSO CONTAINING SuperCustomer&apos;s $resultColumnNames.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Second request:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Customer metadata is loaded from Customer$CLASSMETADATA. $resultColumnNames contains Customer&apos;s fields.&lt;/li&gt;
	&lt;li&gt;SuperCustomer metadata is loaded from SuperCustomer$CLASSMETADATA. $resultColumnNames contains Customer&apos;s and SuperCustomer&apos;s fields.&lt;/li&gt;
	&lt;li&gt;I request an object of class Customer be loaded from the database, which is an instance of SuperCustomer.&lt;/li&gt;
	&lt;li&gt;StandardEntityPersister::_createEntity() is called to create the entity, and uses Customer metadata NOT CONTAINING SuperCustomer&apos;s $resultColumnNames.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Thought: the Customer&apos;s metadata is somehow changed after caching to cope with Customer&apos;s subclasses as well, but these changes are not in the cache. I don&apos;t have enough knowledge of Doctrine&apos;s internals, but you probably have a pretty good idea where this could happen.&lt;/p&gt;</comment>
                    <comment id="10557" author="romanb" created="Tue, 10 Nov 2009 08:52:07 +0000"  >&lt;p&gt;Thanks for your detailed information. I think I know what the issue is now. May be non-trivial to fix. I will try to look into it as soon as I got some free time.&lt;/p&gt;</comment>
                    <comment id="10599" author="jwage" created="Wed, 11 Nov 2009 19:29:35 +0000"  >&lt;p&gt;Here is a patch which fixes the issue but through doing this roman and I realized another issue.&lt;/p&gt;</comment>
                    <comment id="10605" author="romanb" created="Wed, 11 Nov 2009 22:08:23 +0000"  >&lt;p&gt;Scheduled for ALPHA4 as this may need some restructuring.&lt;/p&gt;</comment>
                    <comment id="11128" author="romanb" created="Wed, 9 Dec 2009 12:39:08 +0000"  >&lt;p&gt;This should be fixed now in trunk.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10155" name="patch.diff" size="14091" author="jwage" created="Wed, 11 Nov 2009 19:29:35 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-119] Collection change tracking broken with NOTIFY policy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-119</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Looks like change tracking of collections together with the NOTIFY policy doesnt work well as collection updates are detected in _computeAssociationChanges. Perhaps the collection itself should inform the UnitOfWork directly?&lt;/p&gt;</description>
                <environment></environment>
            <key id="10349">DDC-119</key>
            <summary>Collection change tracking broken with NOTIFY policy</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2009 10:34:28 +0000</created>
                <updated>Fri, 16 Jul 2010 05:29:45 +0000</updated>
                    <resolved>Thu, 15 Jul 2010 09:56:23 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12298" author="ksid" created="Tue, 16 Mar 2010 21:55:32 +0000"  >&lt;p&gt;Not sure if the issue is identical but seems at least related. Using NOTIFY change tracking with many-to-many bidirectional associations does not work. Objects added to the associations do not get persisted when calling EntityManager#flush.&lt;/p&gt;

&lt;p&gt;Tested on r7404.&lt;/p&gt;</comment>
                    <comment id="13590" author="mzach" created="Fri, 16 Jul 2010 04:57:11 +0000"  >&lt;p&gt;Dear Roman,&lt;/p&gt;

&lt;p&gt;the line # 456 in UnitOfWork.php seems wrong to me:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            $isChangeTrackingNotify = isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityChangeSets[$oid]);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Shouldn&apos;t this only be set if the entity has &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; @ChangeTrackingPolicy(&lt;span class=&quot;code-quote&quot;&gt;&quot;NOTIFY&quot;&lt;/span&gt;) *
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;set in his class docBlock? The current behaviour now is to assign $changeset if changes exists, leaving the NOTIFY tracking policy out:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;             $changeSet = $isChangeTrackingNotify ? $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityChangeSets[$oid] : array();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Because of this change, all our unit tests involving saving of entites break (basically, the whole application), which implement @postUpdate for logging purposes logging an own computed changeset.&lt;/p&gt;</comment>
                    <comment id="13591" author="romanb" created="Fri, 16 Jul 2010 05:16:22 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;you&apos;re right, I did that naivly because I thought the only case where an entity would already have a changeset on flush is with the NOTIFY policy. I did not think of custom use cases like yours. It is fixed now in master. My apologies. However, this still means your approach would be broken if you would use the NOTIFY policy right? That sounds like maybe there is potential to improve the approach you&apos;re currently using. If you&apos;re missing anything in the API or implementation that forbids a different approach feel free to raise some new JIRA issues so we can possibly improve the situation.&lt;/p&gt;</comment>
                    <comment id="13592" author="mzach" created="Fri, 16 Jul 2010 05:29:45 +0000"  >&lt;p&gt;Thank you for fixing this real quick! Our current approach is to compute the changeset on @preUpdate and after a successful save write the changeset to the database in @postUpdate. This conflicted with the changes made, I will however look into it and see if it&apos;s feasible for us to implement another approach.&lt;/p&gt;

&lt;p&gt;Once again, thanks for your reply and fix.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-116] array_combine error when using combined Primary Key</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-116</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I use a combined Primary Key for a User&apos;s Phonenumber entity (to match our existing DB model). The key is combined from a &quot;Type&quot; field and a &quot;userId&quot; field that references the User table. &lt;/p&gt;

&lt;p&gt;To mark the (referenced!) userId field and the type field as PK, I need to add &quot;userId&quot; to the model (adding @Id to User does not work). This works well when generating Users and Phonenumbers - but the delete command breaks:&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;PHP Warning:  array_combine(): Both parameters should have an equal number of elements in ..../lib/Doctrine/ORM/Persisters/StandardEntityPersister.php on line 274&lt;br/&gt;
PHP Catchable fatal error:  Argument 2 passed to Doctrine\DBAL\Connection::delete() must be an array, boolean given, called in ..../lib/Doctrine/ORM/Persisters/StandardEntityPersister.php on line 275 and defined in ..../lib/Doctrine/DBAL/Connection.php on line 372&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Entities:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/d51e021e2&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/d51e021e2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test code:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/m51d1f497&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/m51d1f497&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10343">DDC-116</key>
            <summary>array_combine error when using combined Primary Key</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Nov 2009 08:10:50 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:44 +0000</updated>
                    <resolved>Fri, 6 Nov 2009 10:30:36 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10518" author="nicokaiser" created="Fri, 6 Nov 2009 09:07:25 +0000"  >&lt;p&gt;I attached a patch for Doctrine\Orm\Id\Assigned, there seems to be a runaway line which makes the class add each element twice...&lt;/p&gt;</comment>
                    <comment id="10520" author="romanb" created="Fri, 6 Nov 2009 09:39:17 +0000"  >&lt;p&gt;Whoops. Thanks for finding this! Does it fix this issue? I will need to add a testcase to the suite.&lt;/p&gt;</comment>
                    <comment id="10521" author="nicokaiser" created="Fri, 6 Nov 2009 09:43:56 +0000"  >&lt;p&gt;Does not entirely fix it: if the $value is empty, too few elements are added again. &lt;br/&gt;
Need to remove the &quot;if (isset($value)) {&quot; clause. I&apos;ll attach the fixed Assigned.php.&lt;/p&gt;</comment>
                    <comment id="10522" author="romanb" created="Fri, 6 Nov 2009 09:50:56 +0000"  >&lt;p&gt;I think the isset() is correct. That way the $identifier array remains empty if the PK is null and later if ( ! $identifier) evaluates to false on the empty array and raises the exception. If we remove the isset() we would &quot;accept&quot; PKs with null values. But it might be better to do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!isset($value)) {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; ORMException::entityMissingAssignedId($entity);
  } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
         $identifier[] = $value;
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10523" author="romanb" created="Fri, 6 Nov 2009 10:09:49 +0000"  >&lt;p&gt;I will fix this and add some new tests for it.&lt;/p&gt;</comment>
                    <comment id="10524" author="romanb" created="Fri, 6 Nov 2009 10:30:36 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10143" name="Assigned.php" size="2329" author="nicokaiser" created="Fri, 6 Nov 2009 09:43:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-113] Cascaded persist avoids LifecycleCallbacks</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-113</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When an Entity is created by &apos;cascade=&lt;/p&gt;
{&quot;persist&quot;}
&lt;p&gt;&apos;, its LifecycleCallbacks (e.g. &quot;PrePersist&quot;!) are not invoked.&lt;/p&gt;

&lt;p&gt;When it is persisted explicitly, everything workes fine and the events are called...&lt;/p&gt;</description>
                <environment></environment>
            <key id="10332">DDC-113</key>
            <summary>Cascaded persist avoids LifecycleCallbacks</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 16:27:20 +0000</created>
                <updated>Fri, 18 Dec 2009 12:30:35 +0000</updated>
                    <resolved>Fri, 18 Dec 2009 12:30:35 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11170" author="beberlei" created="Fri, 11 Dec 2009 00:21:34 +0000"  >&lt;p&gt;Works for me on trunk, added test-case that proves it (Doctrine\Tests\ORM\Functional\LifecycleCallbackTest::testCascadedEntitiesCallsPrePersist())&lt;/p&gt;</comment>
                    <comment id="11182" author="nicokaiser" created="Mon, 14 Dec 2009 10:02:12 +0000"  >&lt;p&gt;There is still an issue. You can reproduce it if you change the test case slightly to this:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    /**
     * @group DDC-113
     */
    public function testCascadedEntitiesCallsPrePersist()
    {
        $e1 = new LifecycleCallbackTestEntity;
        $e2 = new LifecycleCallbackTestEntity;

        $c = new LifecycleCallbackCascader();
        
        $this-&amp;gt;_em-&amp;gt;persist($c);
        
        $c-&amp;gt;entities[] = $e1;
        $c-&amp;gt;entities[] = $e2;

        //$this-&amp;gt;_em-&amp;gt;persist($c);
        $this-&amp;gt;_em-&amp;gt;flush();

        $this-&amp;gt;assertTrue($e1-&amp;gt;prePersistCallbackInvoked);
        $this-&amp;gt;assertTrue($e2-&amp;gt;prePersistCallbackInvoked);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The difference to the existing (and indeed working) test case is that the Cascader entity is persisted before the collection entries are added. &lt;/p&gt;</comment>
                    <comment id="11183" author="beberlei" created="Mon, 14 Dec 2009 11:12:30 +0000"  >&lt;p&gt;That is valid behaviour according to the lifecycle of an entity, persist gets cascaded right and only when -&amp;gt;persist() is called.&lt;/p&gt;

&lt;p&gt;In the case you show, the two entities are also not persisted, because the cascade was already executed.&lt;/p&gt;</comment>
                    <comment id="11184" author="nicokaiser" created="Mon, 14 Dec 2009 11:27:23 +0000"  >&lt;p&gt;From a technical point of view this is ok - but from an intuitive point of view I would think I can use persist whereever I want. So I can create an entity, persist it (so it gets written to the DB), make changes to it (like adding entities to its collection) and getting its saved (and the collection entities persisted) when I call flush(). &lt;/p&gt;

&lt;p&gt;So I suspect lifecycle events to be called whenever an entity is persisted. And in this case LifecycleCallbackTestEntity&apos;s are persisted automatically by flush() (and this is after the Cascader is persisted!), so lifecycle events should fire here.&lt;/p&gt;</comment>
                    <comment id="11221" author="romanb" created="Thu, 17 Dec 2009 22:53:48 +0000"  >&lt;p&gt;I have a fix for this ready, however, I want to look into something else before committing. I&apos;ll address this over the weekend.&lt;/p&gt;</comment>
                    <comment id="11223" author="romanb" created="Fri, 18 Dec 2009 12:30:35 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-74] Updates get lost when Lifecycle Events (@PreUpdate) are invoked</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-74</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When Lifecycle Events are invoked on entity update (@PreUpdate), the entity is not updated properly in the database.&lt;/p&gt;

&lt;p&gt;This code creates a &lt;b&gt;User&lt;/b&gt; object, sets its &lt;b&gt;name&lt;/b&gt; to &quot;Bob&quot; and its &lt;b&gt;value&lt;/b&gt; to empty, then updates the object and updates the &lt;b&gt;name&lt;/b&gt; to &quot;Alice&quot;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$user = new User;&lt;br/&gt;
$user-&amp;gt;setName(&apos;Bob&apos;);&lt;br/&gt;
$user-&amp;gt;setValue(&apos;&apos;);&lt;br/&gt;
$em-&amp;gt;persist($user);&lt;br/&gt;
$em-&amp;gt;flush(); &lt;br/&gt;
$user-&amp;gt;setName(&apos;Alice&apos;);&lt;br/&gt;
&lt;b&gt;$em-&amp;gt;flush();&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;However, when the User class has a @PreUpdate event that e.g. sets the &lt;b&gt;value&lt;/b&gt; to &quot;Hello World&quot;, the &lt;b&gt;name&lt;/b&gt; change gets lost and only the &lt;b&gt;value&lt;/b&gt; is updated by the second flush() call.&lt;/p&gt;

&lt;p&gt;This is a critical bug which prevents creation of entities that simulate the &quot;Timestampable&quot; behaviour of Doctrine 1.x...&lt;/p&gt;</description>
                <environment></environment>
            <key id="10267">DDC-74</key>
            <summary>Updates get lost when Lifecycle Events (@PreUpdate) are invoked</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Oct 2009 16:17:42 +0000</created>
                <updated>Fri, 13 Nov 2009 16:40:19 +0000</updated>
                    <resolved>Fri, 13 Nov 2009 16:40:19 +0000</resolved>
                                            <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10391" author="beberlei" created="Mon, 2 Nov 2009 10:59:34 +0000"  >&lt;p&gt;I think this might be a hen-egg problem.&lt;/p&gt;

&lt;p&gt;@PreUpdate is only invoked after it is calculated that a change occured on all those entities that have updates. After a change in @PreUpdate events there would have to be another calculation of changes on all those entities, which would probably mean a significant performance hit.&lt;/p&gt;</comment>
                    <comment id="10630" author="rickdt" created="Fri, 13 Nov 2009 14:26:52 +0000"  >&lt;p&gt;I may not know all the consequences of this, but I think I have a fix for this bug.&lt;/p&gt;

&lt;p&gt;In the class ORM\UnitOfWork&lt;/p&gt;

&lt;p&gt;As I understand it,  computeSingleEntityChangeSet() is called to update the changeset and _originalEntityData is set to the current values.&lt;/p&gt;

&lt;p&gt;But, I see that the old changes are lost.&lt;/p&gt;

&lt;p&gt;If i modify the function computeSingleEntityChangeSet to merge the changeset, it works.&lt;/p&gt;

&lt;p&gt;At line 656 replace &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_entityChangeSets[$oid] = $changeSet;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;div class=&quot;code panel&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;($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_entityChangeSets[$oid]){
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_entityChangeSets[$oid] += $changeSet;
}
&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_entityChangeSets[$oid] = $changeSet;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Here is my test case : &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\QueryBuilder($em);
$qb-&amp;gt;select(&apos;fna&apos;)
			-&amp;gt;from(&apos;Entity\FNA&apos;, &apos;fna&apos;)
			-&amp;gt;andwhere($qb-&amp;gt;expr()-&amp;gt;eq(&apos;fna.id&apos;, &apos;:fna_id&apos;));
$qb-&amp;gt;setParameter(&apos;fna_id&apos;, 1);
$query = $qb-&amp;gt;getQuery();

$fna = $query-&amp;gt;getSingleResult();
		
$fna-&amp;gt;setStatus(&apos;COMPLETED&apos;);
$em-&amp;gt;persist($fna);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;AND The preUdate : &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/** 
 * @PreUpdate
*/
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function onPreUpdate($args=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
 {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;modified_at = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10633" author="romanb" created="Fri, 13 Nov 2009 16:18:23 +0000"  >&lt;p&gt;Indeed this looks like a good fix except that the addition has to be the other way around so that when the same field is changed twice, first before the flush and then in a lifecycle callback/event the change from the callback prevails.&lt;/p&gt;

&lt;p&gt;I will work on this and write a test for it.&lt;/p&gt;

&lt;p&gt;Thanks Eric.&lt;/p&gt;</comment>
                    <comment id="10634" author="romanb" created="Fri, 13 Nov 2009 16:40:19 +0000"  >&lt;p&gt;Fixed now.&lt;/p&gt;

&lt;p&gt;Thanks Nico for reporting and thanks Eric for the suggestion!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-61] OneToOne relation with an entity using Class Table Inheritance fails</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-61</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The bug occurs when there&apos;s a lazy bidirectional one-to-one relation where the inverse side only specifies the root entity. In this case, the final type of the target-entity is not resolved correctly. See the attached file for a failing test case.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10241">DDC-61</key>
            <summary>OneToOne relation with an entity using Class Table Inheritance fails</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="dennari">Ville V&#228;&#228;n&#228;nen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Oct 2009 11:29:53 +0000</created>
                <updated>Wed, 4 Nov 2009 10:30:32 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 18:31:24 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10314" author="dennari" created="Tue, 27 Oct 2009 17:20:30 +0000"  >&lt;p&gt;The situation is actually worse if the relation is eager. In that case not only is the classname incorrectly resolved, but if the root-entity is an abstract class, the execution ends up in a fatal error. &lt;/p&gt;

&lt;p&gt;It would seem to me that there are two ways to deal with the described problem: &lt;/p&gt;

&lt;p&gt;1. join all the tables that contain the discriminator-fields, so that the correct subclasses can be inferred&lt;br/&gt;
OR&lt;br/&gt;
2. change the proxy pattern to a variant which is used in the FLOW3 framework, where there&apos;s only one proxy-class &lt;/p&gt;</comment>
                    <comment id="10317" author="dennari" created="Tue, 27 Oct 2009 19:20:58 +0000"  >&lt;p&gt;A fix to the patch. Use the newer attachment.&lt;/p&gt;</comment>
                    <comment id="10409" author="dennari" created="Mon, 2 Nov 2009 20:47:05 +0000"  >&lt;p&gt;I have patches for both of the options above. Should this be a configuration option? As it stands now, OneToMany and ManyToMany relationships enjoy the advantage of having the Collection in between the target and source entities. We could even use a hybrid approach, where a general proxy-object is created only when the object type cannot be inferred without joins.&lt;/p&gt;</comment>
                    <comment id="10424" author="romanb" created="Mon, 2 Nov 2009 23:00:32 +0000"  >&lt;p&gt;It should of course be Nr. 1. The discriminator column is always stored in the topmost (root) table and tables of base classes must be joined, always. If this is not the case this is a bug. Can you show your patch?&lt;/p&gt;</comment>
                    <comment id="10445" author="dennari" created="Tue, 3 Nov 2009 07:41:08 +0000"  >&lt;p&gt;It would seem to me that this would cause an inconsistency in how similar associations with different kinds of entities are treated. &lt;/p&gt;

&lt;p&gt;From &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-38&quot; title=&quot;associations that are null should not create a prox object&quot;&gt;&lt;del&gt;DDC-38&lt;/del&gt;&lt;/a&gt;: &lt;cite&gt;But inverse sides of one-one associations can never be lazy.&lt;/cite&gt; Now going with option 1 would mean that in case the association is with an entity using class-table inheritance, these lazy associations would be allowed (because if we&apos;re joining the base-table anyway, there&apos;s no reason to forbid this) . This begs the question that if we&apos;re ready to do the joins in this case, should we reconsider doing them also to find out about target-existency when dealing with other types of entities?&lt;/p&gt;</comment>
                    <comment id="10446" author="dennari" created="Tue, 3 Nov 2009 08:37:15 +0000"  >&lt;p&gt;Describing the changes StandardEntityPersister.php.diff:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;_getSelectEntitiesSql
	&lt;ul&gt;
		&lt;li&gt;For every inverse OneToOne relation join the target-table/base-table and find out the existence of the target-entity and the value of the discriminator column if one should exist. These values are given the names of the sourceFieldNames in the result array&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;_createEntity
	&lt;ul&gt;
		&lt;li&gt;Pass the existence and discrimnator column values to unitOfWork-&amp;gt;createEntity in the hints&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;associations&amp;#39;&amp;#93;&lt;/span&gt; array. This part is only speculative.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This selects the existence/discrimator-column information when an entity is queried using EntityManager-&amp;gt;find, it&apos;s doesn&apos;t help if one is using a DQL query.&lt;/p&gt;</comment>
                    <comment id="10452" author="romanb" created="Tue, 3 Nov 2009 14:37:20 +0000"  >&lt;p&gt;I understand now what the problem is. Its tricky. Your testcase however has a wrong mapping. The way you mapped it, any event that is fetched of a company will automatically be the main event &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; In this case it would be correct to put a join column on the organization (main_event_id). But I understand the problem and will create a separate new test for it.&lt;/p&gt;

&lt;p&gt;It will probably be treated similar to inverse sides of one-one. That means, when a one-one associations references a target entity that is a base type (not an outermost type, that means there are still possible subtypes), whether the association is the owning side or not it must be eagerly fetched.&lt;/p&gt;</comment>
                    <comment id="10472" author="dennari" created="Wed, 4 Nov 2009 09:41:49 +0000"  >&lt;p&gt;Okay, so not allowing lazy-loading in this case at all. Why is this? As I stated earlier there are at least to ways to solve this without resorting to eager-loading. If using class-table inheritance means forgetting about lazy-load, to me at least it&apos;s a huge disadvantage and would be a deal breaker in using this inheritance-type. The problem with eager-load is not the first fetch that follows, but the uncertainty of how many fetches are going to follow in total. If the target-entity is the tip of a huge object-hierarchy full of entities using class-table inheritance, the current strategy is unusable. Having a couple of extra tables joined is nothing compared to the snowball that eager-fetching might get rolling.&lt;/p&gt;</comment>
                    <comment id="10473" author="romanb" created="Wed, 4 Nov 2009 09:47:46 +0000"  >&lt;p&gt;Well, option Nr.1 is too complicated and can lead to lots of new issues. You can not always join arbitrary tables, not when it comes to DQL where it alters the overall result. The situation is much more complex than it might look to you right now.&lt;/p&gt;

&lt;p&gt;Nr.2 is no option at all because such a proxy approach does not even hold for instanceof checks. An absolute no-go.&lt;/p&gt;

&lt;p&gt;What it does now is the best thing from my point of view. If performance becomes an issue you can &lt;b&gt;always&lt;/b&gt; improve upon that by eager fetching with DQL. Also, you did not yet understand how it works. The eager load does not happen always with class table inheritance, only when the target entity is a base type. If it is a subtype that does not have any further subtypes, then a proxy can be used without fear. Same goes for single table inheritance.&lt;/p&gt;</comment>
                    <comment id="10474" author="romanb" created="Wed, 4 Nov 2009 10:03:29 +0000"  >&lt;p&gt;If you still feel this is too bad open a new issue as &quot;improvement&quot; and move any old/new patches you have there. There would need to be much more tests for such a change. Also you did not mention whether your patch actually passes all existing unit tests.&lt;/p&gt;</comment>
                    <comment id="10475" author="dennari" created="Wed, 4 Nov 2009 10:03:37 +0000"  >&lt;p&gt;Sure I understood how it works. But to me one of the biggest advantages of class-table inheritance is exactly that the parent doesn&apos;t have to know the final type., and so in the configuration the association is pointed to the base-type. Yes, I accept that the issue might be way too complicated in the DQL case.&lt;/p&gt;

&lt;p&gt;Option number two can be improved if the parent model that might have these general proxies invokes a load in it&apos;s getters. Exactly the way the generated proxies work now. Of course, this means that the models need to be aware of the possible proxies. It&apos;s not perfect, but maybe it could be an option? &lt;/p&gt;</comment>
                    <comment id="10476" author="romanb" created="Wed, 4 Nov 2009 10:27:24 +0000"  >&lt;p&gt;Please open a new issue, I think this has potential as an improvement that can complement the current behavior.&lt;/p&gt;

&lt;p&gt;What I mean is: for normal find/load ... operations that are not triggered by DQL we can probably do the join and in the case of DQL the current behavior is used, if you want to avoid the extra query in that case its as simple as adding the join to DQL.&lt;/p&gt;

&lt;p&gt;So I think the approaches can be complementary.&lt;/p&gt;</comment>
                    <comment id="10478" author="dennari" created="Wed, 4 Nov 2009 10:30:32 +0000"  >&lt;p&gt;Sure like the sound of that! I will be very happy to open this as an improvement. Thanks for your patience &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; .&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10103" name="cti_test.diff" size="2473" author="dennari" created="Tue, 27 Oct 2009 19:20:58 +0000" />
                    <attachment id="10100" name="cti_test.diff" size="2431" author="dennari" created="Tue, 27 Oct 2009 11:29:53 +0000" />
                    <attachment id="10132" name="StandardEntityPersister.php.diff" size="6331" author="dennari" created="Tue, 3 Nov 2009 08:37:15 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-41] Getting error with lazy loading via createQuery() followed by $em-&gt;flush()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-41</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Simple O-O relationship between \Entities\User and \Entities\Feed. Seems like there&apos;s a problem with not-yet lazy-loaded proxies and $em-&amp;gt;flush().&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;&quot;Entities/User.php&quot;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
namespace Entities;

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

    /**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Feed&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $Feed;

    &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 getFeed() {
        &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;Feed;
    }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setFeed($feed) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;Feed = $feed;
    }
}
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;&quot;Entities/Feed.php&quot;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?php
namespace Entities;

/**
 * @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;feeds_debug&quot;&lt;/span&gt;)
 */
class Feed {
    /**
     * @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;, allocationSize=1)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

     /**
     * @OneToOne(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;persist&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;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $User;

    function setID($value) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id = $value;
    }
    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 getUser() {
        &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;User;
    }
    function setUser($user) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;User = $user;
    }
}


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

&lt;p&gt;Table-data&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;users_debug:
 id
 361

feeds_debug:
 id  | user_id
 461 |     361
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$user = $em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT u FROM Entities\User u WHERE u.id = 361&quot;&lt;/span&gt;)-&amp;gt;getSingleResult();
print $user-&amp;gt;getID(); &lt;span class=&quot;code-comment&quot;&gt;// 361
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// uncomment line below and it works
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// print $user-&amp;gt;getFeed()-&amp;gt;getID();
&lt;/span&gt;$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Error:&lt;br/&gt;
Warning: spl_object_hash() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 1010&lt;br/&gt;
Warning: spl_object_hash() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 566&lt;br/&gt;
Warning: ReflectionProperty::setValue() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 575&lt;br/&gt;
Warning: get_class() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 979&lt;br/&gt;
Fatal error: Uncaught exception &apos;ReflectionException&apos; with message &apos;Class  does not exist&apos; in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadata.php:69&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadata.php(69): ReflectionClass-&amp;gt;__construct(false)&lt;br/&gt;
#1 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(247): Doctrine\ORM\Mapping\ClassMetadata-&amp;gt;__construct(false)&lt;br/&gt;
#2 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(177): Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;_newClassMetadataInstance(false)&lt;br/&gt;
#3 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(115): Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;_loadMetadata(false)&lt;br/&gt;
#4 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/EntityManager.php(212): Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;getMetadataFor(false)&lt;br/&gt;
#5 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php(979): Doctrine\ORM\EntityManager-&amp;gt;getClassMetadata in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadata.php on line 69&lt;/p&gt;

&lt;p&gt;PostgreSQL log:&lt;br/&gt;
2009-10-10 16:32:58 CEST LOGG:  execute pdo_stmt_000000000a283af8: SELECT u0_.id AS id0 FROM users_debug u0_ WHERE u0_.id = 361&lt;br/&gt;
2009-10-10 16:32:58 CEST LOGG:  sats: DEALLOCATE pdo_stmt_000000000a283af8&lt;br/&gt;
2009-10-10 16:32:58 CEST LOGG:  execute pdo_stmt_000000000a283af8: SELECT NEXTVAL(&apos;feeds_debug_id_seq&apos;)&lt;br/&gt;
2009-10-10 16:32:58 CEST LOGG:  sats: DEALLOCATE pdo_stmt_000000000a283af8&lt;br/&gt;
2009-10-10 16:32:58 CEST LOGG:  execute pdo_stmt_000000000a283af8: SELECT NEXTVAL(&apos;users_debug_id_seq&apos;)&lt;br/&gt;
2009-10-10 16:32:58 CEST LOGG:  sats: DEALLOCATE pdo_stmt_000000000a283af8&lt;/p&gt;</description>
                <environment>Doctrine2-trunk, Postgresql, Lazy loading</environment>
            <key id="10168">DDC-41</key>
            <summary>Getting error with lazy loading via createQuery() followed by $em-&gt;flush()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="crotalus">Nichlas L&#246;fdahl</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Oct 2009 14:31:26 +0000</created>
                <updated>Mon, 12 Oct 2009 11:56:40 +0000</updated>
                    <resolved>Mon, 12 Oct 2009 11:56:40 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10202" author="romanb" created="Mon, 12 Oct 2009 09:36:51 +0000"  >&lt;p&gt;Strange, all the warnings and errors and the stack trace rather indicate that the associated value is NULL and not a (not initialized) proxy object. I&apos;m working on this and already found an issue to address but I&apos;m still unable to exactly reproduce this. Will keep you updated. If you have any further information, please let me know.&lt;/p&gt;</comment>
                    <comment id="10203" author="romanb" created="Mon, 12 Oct 2009 09:56:26 +0000"  >&lt;p&gt;OK, managed to reproduce this. Working on it.&lt;/p&gt;</comment>
                    <comment id="10205" author="romanb" created="Mon, 12 Oct 2009 11:56:40 +0000"  >&lt;p&gt;This should now be fixed but you need to manually delete your proxy classes so that they&apos;re regenerated. More improvements to the proxy classes and CLI tasks for (re)generating proxy classes will follow.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-34] schema-tool --create tries to create duplicate associations and exits with exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-34</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m getting the error&lt;/p&gt;

&lt;p&gt;SchemaTool:Duplicate field mapping ()&lt;/p&gt;

&lt;p&gt;when trying to create my database schema. I am pretty sure this worked before. The error occurs on a field defined in a mapped superclass on the first entity that extends this class on the first association.&lt;/p&gt;

&lt;p&gt;My entity classes:&lt;/p&gt;

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

use \Model\User\User;
use \DateTime;

/**
 * @MappedSuperclass
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Blameable
{
	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; DateTime
	 *
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;date_created&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $dateCreated;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; User
	 *
	 * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\User\User&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;creator_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $creator;

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

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; User
	 *
	 * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\User\User&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;updater_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $updater;

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

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; User
	 *
	 * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\User\User&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;deleter_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $deleter;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

use \Zend_Validate_Alnum;
use \Zend_Validate_StringLength;
use \Zend_Validate_Alpha;
use \Zend_Validate_EmailAddress;
use \Zend_Registry;
use \Model\Blameable;
use \Model\ConstraintException;
use \Itoijala_Singletons;
use \Zend_Auth;
use \Itoijala_Password_Hash;

/**
 *
 *
 * @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_users&quot;&lt;/span&gt;)
 */
class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Blameable
{
	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 *
	 * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * @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;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;20&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;username&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $username;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;20&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;first_name&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $firstName;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;20&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;last_name&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $lastName;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;255&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;email&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $email;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;20&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;signature&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $signature;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;128&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;password&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $password;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;255&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;role&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $role;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;32&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;session_id&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $sessionId;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; bool
	 *
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;unlocked&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $unlocked;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

use \Closure;
use \Model\Blameable;
use \Doctrine\Common\Collections\Collection;
use \Doctrine\ommon\Collections\ArrayCollection;
use \Model\User\User;
use \Model\Gallery\Gallery;
use \Model\ConstraintException;
use \Zend_Validate_StringLength;

/**
 * @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;article_articles&quot;&lt;/span&gt;)
 */
class Article &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Blameable
{
	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 *
	 * @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     * @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;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Category
	 *
	 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\Article\Category&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;category_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; $category;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;255&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $name;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;text&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;description&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $description;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(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;255&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;thumbnail&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $thumbnail;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 *
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;text&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;content&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $content;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 *
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;views&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $views;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; bool
	 *
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;news&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $news;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; bool
	 *
	 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;unlocked&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $unlocked;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Collection
	 *
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\Gallery\Gallery&quot;&lt;/span&gt;)
     * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;article_article_galleries&quot;&lt;/span&gt;,
     *      joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;article_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)},
     *      inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;gallery_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; $galleries;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Collection
	 *
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\User\User&quot;&lt;/span&gt;)
     * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;article_article_authors&quot;&lt;/span&gt;,
     *      joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;article_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)},
     *      inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_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; $authors;

	/**
	 *
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Collection
	 *
	 * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\Article\Attachment&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;article&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $attachments;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>HEAD</environment>
            <key id="10151">DDC-34</key>
            <summary>schema-tool --create tries to create duplicate associations and exits with exception</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Oct 2009 15:50:15 +0000</created>
                <updated>Wed, 7 Oct 2009 18:54:06 +0000</updated>
                    <resolved>Wed, 7 Oct 2009 18:54:06 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-32] EntityManager#getReference broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-32</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10148">DDC-32</key>
            <summary>EntityManager#getReference broken</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Oct 2009 12:28:03 +0000</created>
                <updated>Wed, 7 Oct 2009 12:42:48 +0000</updated>
                    <resolved>Wed, 7 Oct 2009 12:42:48 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-33] Remove allowPartialObjects option.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-33</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I think this option will cause unnecessary confusion. The best solution is to always disallow partial objects, yet you can force partial objects on individual object queries to increase performance if necessary. This is much simpler for the user than to remember all the details of how the current option affects certain behavior. Also, with the current default behavior of partial objects everywhere, some standard operations can unexpectedly not work, like adding an object to a collection of a managed object (but the collection itself was not fetched yet). As a result the collection will not be wrapped by doctrine with a PersistentCollection and modifications are lost.&lt;br/&gt;
There are more of such examples.&lt;/p&gt;

&lt;p&gt;I will do this myself and I think this can even be done with full backwards compatibility (though its not strictly necessary since we&apos;re still in alpha). &lt;/p&gt;

&lt;p&gt;This should be done before entering beta.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10149">DDC-33</key>
            <summary>Remove allowPartialObjects option.</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Oct 2009 12:34:39 +0000</created>
                <updated>Thu, 15 Oct 2009 14:40:18 +0000</updated>
                    <resolved>Thu, 15 Oct 2009 14:40:18 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-26] Add support for subdirectories in classdir when using schema-tool --create</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-26</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently when using schema-tool --create, all entity classes have to be in one directory. Subdirectories are not supported and result in errors. The iterator tries to require the subdirectories. This makes it impossible to use schema-tool --create to create the database for models that use namespaces and follow Doctrine rules for placing the files in subdirectories.&lt;/p&gt;

&lt;p&gt;The schema-tool should iterate through all of the subdirectories of the classdir to find all of the entity classes. It should also not try to require() any directories.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10130">DDC-26</key>
            <summary>Add support for subdirectories in classdir when using schema-tool --create</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Oct 2009 10:10:00 +0000</created>
                <updated>Mon, 5 Oct 2009 18:36:22 +0000</updated>
                    <resolved>Mon, 5 Oct 2009 18:36:22 +0000</resolved>
                                            <fixVersion>2.0-ALPHA2</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10155" author="romanb" created="Thu, 1 Oct 2009 15:50:50 +0000"  >&lt;p&gt;Jon, I remember you mentioning this issue already. Did you fix it already?&lt;/p&gt;</comment>
                    <comment id="10156" author="jwage" created="Thu, 1 Oct 2009 15:58:46 +0000"  >&lt;p&gt;No but I will fix it. The problem exists in Doctrine\ORM\Tools\Export\ClassMetadataExporter as well.&lt;/p&gt;</comment>
                    <comment id="10165" author="guilhermeblanco" created="Sat, 3 Oct 2009 16:11:38 +0000"  >&lt;p&gt;We should make is an option, not recursive all the time.... maybe include as an optional parameter --recursive&lt;/p&gt;

&lt;p&gt;I&apos;ll check it out the issue and will come with a solution later today.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-21] Already fetched associations should not be overriden by subsequent queries.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-21</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The discussion about this was brought up by &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-41&quot; title=&quot;cache problem with joined tables and external data change&quot;&gt;&lt;del&gt;DC-41&lt;/del&gt;&lt;/a&gt;. After checking the behavior of other ORMs (notably Hibernate), already fetched associations should not be overridden by subsequent queries, just like with other persistent state of already fetched entities. This saves performance and can assure a better integrity of the object model in-memory.&lt;/p&gt;

&lt;p&gt;Entities and their associations that are already in-memory should only be refreshed if this is done explicitly either through EntityManager#refresh($entity) or through using the Query::HINT_REFRESH query hint on any query.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10114">DDC-21</key>
            <summary>Already fetched associations should not be overriden by subsequent queries.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Sep 2009 15:09:27 +0000</created>
                <updated>Fri, 9 Oct 2009 14:29:19 +0000</updated>
                    <resolved>Fri, 9 Oct 2009 14:29:19 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10127" author="romanb" created="Fri, 25 Sep 2009 15:24:55 +0000"  >&lt;p&gt;This behavior is already correct for single-valued associations but not for collections. Needs to be fixed in ObjectHydrator.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="10115">DDC-22</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-22] EntityManager#refresh() should also refresh associations.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-22</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Initially this issue was brought up by &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-41&quot; title=&quot;cache problem with joined tables and external data change&quot;&gt;&lt;del&gt;DC-41&lt;/del&gt;&lt;/a&gt; which in turn led to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-21&quot; title=&quot;Already fetched associations should not be overriden by subsequent queries.&quot;&gt;&lt;del&gt;DDC-21&lt;/del&gt;&lt;/a&gt;. The implementation of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-21&quot; title=&quot;Already fetched associations should not be overriden by subsequent queries.&quot;&gt;&lt;del&gt;DDC-21&lt;/del&gt;&lt;/a&gt; requires a working refresh() implementation that also refreshes associations.&lt;/p&gt;

&lt;p&gt;1) For the state of the entity that is refreshed itself this is self-explanatory (simple select on the primary table, this is what already works).&lt;/p&gt;

&lt;p&gt;2) For single-valued associations the proper query depends on whether the entity being refreshed represents the owning side or the inverse side of the association. If it is the inverse side, a simple query like this should do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;select&lt;/span&gt; addresses.id, ... &lt;span class=&quot;code-keyword&quot;&gt;from&lt;/span&gt; addresses &lt;span class=&quot;code-keyword&quot;&gt;where&lt;/span&gt; addresses.user_id=?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If it is the owning side, a join may be required:&lt;/p&gt;

&lt;div class=&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; addresses.id, ... &lt;span class=&quot;code-keyword&quot;&gt;from&lt;/span&gt; addresses inner join users on addresses.id = users.address_id &lt;span class=&quot;code-keyword&quot;&gt;where&lt;/span&gt; users.id=?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;3) For one-to-many collections, a simple select on the target entity table, similar to the following should do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;select&lt;/span&gt; .... &lt;span class=&quot;code-keyword&quot;&gt;from&lt;/span&gt; phonenumbers ... &lt;span class=&quot;code-keyword&quot;&gt;where&lt;/span&gt; phonenumbers.user_id=?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For many-to-many collections a similar select that joins over the join table is required.&lt;/p&gt;

&lt;p&gt;An clever way for collections might be to not trigger this SQL immediately on refresh() but to simply mark the collection as uninitialized again so that the first access would trigger the reload, similar to a lazy-load.&lt;/p&gt;

&lt;p&gt;Note that the collection itself is refreshed, not the state of the entities contained therein.&lt;br/&gt;
Also note that only associations need to be refreshed that were already initialized. If an associated collection is uninitialized, it does not need to be refreshed. If an associated single-valued proxy is uninitialized, it does not need to be refreshed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10115">DDC-22</key>
            <summary>EntityManager#refresh() should also refresh associations.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Sep 2009 15:12:20 +0000</created>
                <updated>Wed, 28 Oct 2009 11:07:50 +0000</updated>
                    <resolved>Wed, 28 Oct 2009 11:07:50 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                            <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="10114">DDC-21</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-604] array_merge in Query::_doExecute causes parameter reordering</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-604</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi all, &lt;br/&gt;
I think there is a bug with the doExecute method from the Query class. &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;foreach ($this-&amp;gt;_params as $key =&amp;gt; $value) { 
            if ( ! isset($paramMappings[$key])) { 
                throw QueryException::unknownParameter($key); 
            } 
            if (isset($this-&amp;gt;_paramTypes[$key])) { 
                foreach ($paramMappings[$key] as $position) { 
                    $types[$position] = $this-&amp;gt;_paramTypes[$key]; 
                } 
            } 
            if (is_object($value) &amp;amp;&amp;amp; 
$this-&amp;gt;_em-&amp;gt;getMetadataFactory()-&amp;gt;hasMetadataFor(get_class($value))) { 
                $values = 
$this-&amp;gt;_em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($value); 
                $sqlPositions = $paramMappings[$key]; 
                $sqlParams = array_merge($sqlParams, 
array_combine((array)$sqlPositions, $values)); 
            } else { 
                foreach ($paramMappings[$key] as $position) { 
                    $sqlParams[$position] = $value; 
                } 
            } 
        } 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When constructing the $sqlParams array, array_merge is used for params wich &lt;br/&gt;
are objects. Php documentation says that numeric key are renumbered. So we &lt;br/&gt;
loose the position of the parameter. &lt;br/&gt;
I solved this problem by replacing the array_merge with that : &lt;br/&gt;
$sqlParams = $sqlParams + array_combine((array)$sqlPositions, $values); &lt;br/&gt;
But I&apos;m not sure it doesn&apos;t have unwanted effects. &lt;br/&gt;
I created a fork on github for this bug, hope it could be usefull. &lt;/p&gt;


&lt;p&gt;Edit a fail case :&lt;/p&gt;

&lt;p&gt;SQL (for postgres):&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;CREATE TABLE first_class
(
  id serial NOT NULL,
  &quot;text&quot; character varying,
  second_class_id integer,
  CONSTRAINT first_class_pkey PRIMARY KEY (id),
  CONSTRAINT first_class_second_class_id_fkey FOREIGN KEY (second_class_id)
      REFERENCES second_class (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
);

CREATE TABLE second_class
(
  id serial NOT NULL,
  CONSTRAINT second_class_pkey PRIMARY KEY (id)
);

INSERT INTO second_class(
            id)
    VALUES (1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;FirstClass.php&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/**
 * @Entity
 * @Table(name=&quot;first_class&quot;)
 */
class FirstClass {
  /**
   * @Id
   * @Column(name=&quot;id&quot;,type=&quot;integer&quot;)
   */
  private $id;
  /** @Column(name=&quot;text&quot;,type=&quot;string&quot;) */
  private $text;
  /**
   * @OneToOne(targetEntity=&quot;SecondClass&quot;)
   * @JoinColumn(name=&quot;second_class_id&quot;, referencedColumnName=&quot;id&quot;)
   */
  private $secondClassInstance;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;SecondClass.php&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/**
 * @Entity
 * @Table(name=&quot;second_class&quot;)
 */
class SecondClass {
  /**
   * @Id
   * @Column(name=&quot;id&quot;,type=&quot;integer&quot;)
   */
  private $id;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Test Case :&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;$secondClassInstance = $doctrineEntityManager-&amp;gt;find(&apos;SecondClass&apos;,1);

$query = $doctrineEntityManager-&amp;gt;createQuery(&quot;SELECT f FROM FirstClass f WHERE f.text = :text AND f.secondClassInstance = :instance&quot;)-&amp;gt;setParameters(array(&apos;instance&apos;=&amp;gt;$secondClassInstance,&apos;text&apos;=&amp;gt;&apos;Un texte en francais&apos;,));
echo $query-&amp;gt;getSQL();
$query-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When you execute this query it fails. When printing the $sqlParams variable from _doExecute you can see the folowing :&lt;br/&gt;
Array ( &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; =&amp;gt; Un texte en francais )&lt;/p&gt;</description>
                <environment></environment>
            <key id="11398">DDC-604</key>
            <summary>array_merge in Query::_doExecute causes parameter reordering</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hobodave">David Abdemoulaie</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 May 2010 20:19:17 +0000</created>
                <updated>Mon, 7 Jun 2010 07:58:08 +0000</updated>
                    <resolved>Mon, 7 Jun 2010 07:58:08 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13033" author="hobodave" created="Thu, 20 May 2010 20:30:43 +0000"  >&lt;p&gt;Brought Paul&apos;s changes over to doctrine/orm in branch &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-604&quot; title=&quot;array_merge in Query::_doExecute causes parameter reordering&quot;&gt;&lt;del&gt;DDC-604&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;http://github.com/doctrine/orm/tree/DDC-604&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/orm/tree/DDC-604&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13046" author="needle" created="Sat, 22 May 2010 05:46:36 +0000"  >&lt;p&gt;I&apos;ve just added the fail case&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-599] Inheritance breaks cascading</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-599</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using inheritance, cascade=&lt;/p&gt;
{&quot;delete&quot;} does not work anymore:&lt;br/&gt;
&lt;br/&gt;
This example creates three Entities: &lt;br/&gt;
- Item&lt;br/&gt;
- SubItem (extends Item)&lt;br/&gt;
- Child&lt;br/&gt;
&lt;br/&gt;
The Item has a OneToMany association with Child with cascade={&quot;delete&quot;}
&lt;p&gt;, so if an Item is deleted, its Children are deleted too.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pastie.org/965096&quot; class=&quot;external-link&quot;&gt;http://pastie.org/965096&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However this does not work, the cascade is ignored when the Item is deleted. Without inheritance (e.g. only Item with Children) it works perfectly.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11380">DDC-599</key>
            <summary>Inheritance breaks cascading</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 May 2010 04:16:48 +0000</created>
                <updated>Mon, 7 Jun 2010 07:06:36 +0000</updated>
                    <resolved>Mon, 7 Jun 2010 07:06:36 +0000</resolved>
                                            <fixVersion>2.0-BETA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12989" author="nicokaiser" created="Tue, 18 May 2010 04:27:49 +0000"  >&lt;p&gt;By the way, this cannot be reproduced with the included testcases (no DB connection). So the problem may be between the ORM and the DBAL...&lt;/p&gt;</comment>
                    <comment id="12990" author="romanb" created="Tue, 18 May 2010 05:14:09 +0000"  >&lt;p&gt;Do you get any error message? exception? stack trace?&lt;/p&gt;</comment>
                    <comment id="12991" author="nicokaiser" created="Tue, 18 May 2010 05:17:06 +0000"  >&lt;p&gt;PHP 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: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`kaiser_sandbox`.`Child`, CONSTRAINT `Child_ibfk_1` FOREIGN KEY (`parentId`) REFERENCES `Item` (`id`))&apos; in /home/kaiser/doctrine/doctrine/lib/Doctrine/DBAL/Connection.php:637&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 /home/kaiser/doctrine/doctrine/lib/Doctrine/DBAL/Connection.php(637): PDOStatement-&amp;gt;execute(Array)&lt;br/&gt;
#1 /home/kaiser/doctrine/doctrine/lib/Doctrine/DBAL/Connection.php(385): Doctrine\DBAL\Connection-&amp;gt;executeUpdate(&apos;DELETE FROM Ite...&apos;, Array)&lt;br/&gt;
#2 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(353): Doctrine\DBAL\Connection-&amp;gt;delete(&apos;Item&apos;, Array)&lt;br/&gt;
#3 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/UnitOfWork.php(777): Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;delete(Object(Entities\SubItem))&lt;br/&gt;
#4 /home/kaiser/doctrine/doctrine/lib/Doctrine/ORM/UnitOfWork.php(316): Doctrine\ORM\UnitOfWork-&amp;gt;_executeDeletions(Object(Doctri in /home/kaiser/doctrine/doctrine/lib/Doctrine/DBAL/Connection.php on line 637&lt;/p&gt;</comment>
                    <comment id="13005" author="romanb" created="Wed, 19 May 2010 06:54:27 +0000"  >&lt;p&gt;Scheduled for beta2 but not sure we can make it, might end up on beta3. Increasing priority though as this seems to be a bug and these have priority.&lt;/p&gt;</comment>
                    <comment id="13111" author="beberlei" created="Sun, 6 Jun 2010 07:19:41 +0000"  >&lt;p&gt;Attached a test-case that verifies this bug exists.&lt;/p&gt;

&lt;p&gt;Problem is the CommitOrderNodeCalculator not knowing about sub-class dependencies.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10628" name="DDC599Test.php" size="2538" author="beberlei" created="Sun, 6 Jun 2010 07:19:41 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-593] Subquery parenthesis omitted in generated SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-593</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;$dQuery = $this-&amp;gt;_em-&amp;gt;createQuery(&lt;br/&gt;
	&apos;SELECT p FROM entity\system\Group p WHERE (p.lft &amp;gt;= (SELECT t.lft FROM entity\system\Group t WHERE t.name = :name)) AND (p.rgt &amp;lt;= (SELECT t2.rgt FROM entity\system\Group t2 WHERE t2.name = :name))&apos;);&lt;/p&gt;

&lt;p&gt;As you see this includes brackets around the subqueries.&lt;/p&gt;

&lt;p&gt;var_dump($dQuery-&amp;gt;getSQL());&lt;/p&gt;

&lt;p&gt;SELECT s0_.level AS level0, s0_.lft AS lft1, s0_.rgt AS rgt2, s0_.id AS id3, s0_.name AS name4, s0_.description AS description5 FROM system_group s0_ WHERE (s0_.lft &amp;gt;= SELECT s1_.lft FROM system_group s1_ WHERE s1_.name = ?) AND (s0_.rgt &amp;lt;= SELECT s2_.rgt FROM system_group s2_ WHERE s2_.name = ?)&lt;/p&gt;

&lt;p&gt;Brackets gone, resulting in:&lt;/p&gt;

&lt;p&gt;&apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;SELECT s1_.lft FROM system_group s1_ WHERE s1_.name = &apos;root&apos;) AND (s0_.rgt &amp;lt;= SE&apos; at line 1&apos; in /usr/share/php/lib/Doctrine/DBAL/Connection.php:566&lt;/p&gt;

&lt;p&gt;Brackets added and executed against database&lt;/p&gt;

&lt;p&gt;SELECT s0_.level AS level0, s0_.lft AS lft1, s0_.rgt AS rgt2, s0_.id AS id3, s0_.name AS name4, s0_.description AS description5 FROM system_group s0_ WHERE (s0_.lft &amp;gt;= (SELECT s1_.lft FROM system_group s1_ WHERE s1_.name = &quot;root&quot;)) AND (s0_.rgt &amp;lt;= (SELECT s2_.rgt FROM system_group s2_ WHERE s2_.name = &quot;root&quot;))&lt;/p&gt;

&lt;p&gt;Works (MySQL).&lt;/p&gt;

</description>
                <environment></environment>
            <key id="11371">DDC-593</key>
            <summary>Subquery parenthesis omitted in generated SQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="jkleijn">John Kleijn</reporter>
                        <labels>
                    </labels>
                <created>Sun, 16 May 2010 06:20:11 +0000</created>
                <updated>Sun, 16 May 2010 07:51:57 +0000</updated>
                    <resolved>Sun, 16 May 2010 07:51:57 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12967" author="jkleijn" created="Sun, 16 May 2010 06:21:57 +0000"  >&lt;p&gt;Double brackets in the DQL results in&lt;/p&gt;

&lt;p&gt;&quot;exception &apos;Doctrine\ORM\Query\QueryException&apos; with message &apos;&lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 62: Error: Expected Literal, got &apos;SELECT&apos;&apos; in /usr/share/php/lib/Doctrine/ORM/Query/QueryException.php:42&lt;/p&gt;</comment>
                    <comment id="12968" author="romanb" created="Sun, 16 May 2010 06:32:14 +0000"  >&lt;p&gt;This might be caused by recent AST optimizations and thus I suspect this to be a regression.&lt;/p&gt;</comment>
                    <comment id="12969" author="jkleijn" created="Sun, 16 May 2010 06:38:43 +0000"  >&lt;p&gt;Is there a workaround (other than not using a subquery)?&lt;/p&gt;</comment>
                    <comment id="12970" author="romanb" created="Sun, 16 May 2010 07:04:03 +0000"  >&lt;p&gt;Well, a workaround for any DQL issues  that is always available is a NativeQuery (createNativeQuery). In essence, a DQL query is just a high-level abstraction for a native SQL query + a ResultSetMapping. &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/native-sql/en#native-sql&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/native-sql/en#native-sql&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The resulting objects from a native query are still fully managed and all, so its just a difference in query abstraction.&lt;/p&gt;

&lt;p&gt;Nevertheless, this should be fixed soon.&lt;/p&gt;</comment>
                    <comment id="12972" author="romanb" created="Sun, 16 May 2010 07:23:23 +0000"  >&lt;p&gt;Reproduced this successfully and already have a potential fix. Might not be a regression after all but a bug nevertheless.&lt;/p&gt;</comment>
                    <comment id="12973" author="romanb" created="Sun, 16 May 2010 07:51:57 +0000"  >&lt;p&gt;Should be fixed now in HEAD (doctrine2/master).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-576] New entities must have primary key values right after flushing with IDENTITY strategy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-576</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;After insertion of some new entity the primary key must be set. Example code is attached above.&lt;/p&gt;</description>
                <environment>PostgreSQL 8.4.3, Ubuntu 10.04</environment>
            <key id="11330">DDC-576</key>
            <summary>New entities must have primary key values right after flushing with IDENTITY strategy</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="drevolution">V&#225;clav Novotn&#253;</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 May 2010 08:29:20 +0000</created>
                <updated>Sat, 8 May 2010 08:11:29 +0000</updated>
                    <resolved>Sat, 8 May 2010 08:11:29 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12870" author="romanb" created="Fri, 7 May 2010 16:31:31 +0000"  >&lt;p&gt; I think I reproduced this already. Seems to be related to PostgreSQL + IDENTITY only. The SequenceIdentityGenerator must be used but apparently it is not used.&lt;/p&gt;

&lt;p&gt;Thanks for the report. Will keep you updated.&lt;/p&gt;

&lt;p&gt;ps. The standalone reproduce scripts are good. Thanks for that! If you are interested it would be even better if the test code would be provided as a unit test or with some additional comments and/or assertions about what the desired behavior is  or where the supposedly wrong behavior is (even if it is very obvious, like in this issue).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10596" name="example.tar.gz" size="1146" author="drevolution" created="Fri, 7 May 2010 08:29:20 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-561] Metadata caching broken due to incomplete __sleep functions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-561</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using a persistent Metadata cache, the serialized ClassMetadata objects are not complete. &lt;/p&gt;

&lt;p&gt;This leads to very strange behavior since not all Metadata is loaded in the next request (which uses cached Metadata). The problem is that the __sleep methods of Doctrine\ORM\Mapping\AssociationMapping and Doctrine\ORM\Mapping\ClassMetadata are note complete (missing &quot;namespace&quot;, &quot;fetchMode&quot; properties).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11300">DDC-561</key>
            <summary>Metadata caching broken due to incomplete __sleep functions</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Apr 2010 09:23:34 +0000</created>
                <updated>Fri, 30 Apr 2010 12:29:24 +0000</updated>
                    <resolved>Fri, 30 Apr 2010 11:33:36 +0000</resolved>
                                            <fixVersion>2.0-BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12792" author="nicokaiser" created="Fri, 30 Apr 2010 09:29:45 +0000"  >&lt;p&gt;This patch fixes the issue for AssociationMapping and ClassMetadata. I&apos;m not sure if there are more properties missing...&lt;/p&gt;</comment>
                    <comment id="12793" author="romanb" created="Fri, 30 Apr 2010 11:18:39 +0000"  >&lt;p&gt;Ouch, bad oversight. Sorry for that. We do actually have tests for serializing and unserializing the metadata, obviously not enough... will fix it asap.&lt;/p&gt;</comment>
                    <comment id="12794" author="romanb" created="Fri, 30 Apr 2010 11:33:36 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/db2be55e27c87fa513073b2bf44456f1d1423582&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/db2be55e27c87fa513073b2bf44456f1d1423582&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;</comment>
                    <comment id="12795" author="beberlei" created="Fri, 30 Apr 2010 12:00:12 +0000"  >&lt;p&gt;Should we re-release Beta1? This is pretty serious and might annoy people &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="12797" author="romanb" created="Fri, 30 Apr 2010 12:28:58 +0000"  >&lt;p&gt;Hehe, no its fine. You can easily patch it manually if needed and beta2 is only a few weeks away.&lt;/p&gt;</comment>
                    <comment id="12798" author="romanb" created="Fri, 30 Apr 2010 12:29:24 +0000"  >&lt;p&gt;And you can just use HEAD and not the tag, of course &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10588" name="ddc-561.patch" size="1456" author="nicokaiser" created="Fri, 30 Apr 2010 09:29:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-531] Collections broken in self-referenced Entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-531</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When dealing with parent / children entities, the UnitOfWork does not always hydrate all data correctly. &lt;/p&gt;

&lt;p&gt;This example generates Group1 and its child Group2. Then Clears the Entity Manager, loads Group2 (so it is in the EM), loads Group1 and then the children of Group1 (Group2 is the child of Group1). &lt;br/&gt;
However the children of Group1 cannot be loaded, because $group4-&amp;gt;children is not there:&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;Warning: Invalid argument supplied for foreach() in /Users/nico/Projects/test/test.php on line 20&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When calling Debug::dump($group4), I get this:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;object(stdClass)#56 (2) {
  [&quot;__CLASS__&quot;]=&amp;gt;
  string(26) &quot;Proxies\EntitiesGroupProxy&quot;
  [&quot;id&quot;]=&amp;gt;
  string(1) &quot;1&quot;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;test.php&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/7Q3wwtn6&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/7Q3wwtn6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Group entity:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/hBj2Emrf&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/hBj2Emrf&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11247">DDC-531</key>
            <summary>Collections broken in self-referenced Entities</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Apr 2010 09:35:36 +0000</created>
                <updated>Sun, 23 May 2010 09:29:29 +0000</updated>
                    <resolved>Sun, 23 May 2010 09:29:29 +0000</resolved>
                                            <fixVersion>2.0-BETA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12717" author="nicokaiser" created="Tue, 20 Apr 2010 09:52:00 +0000"  >&lt;p&gt;If I clear the Entity Manager between lines 17 and 18, it works... Seems like the previously loaded Group is reused (which is perfectly fine), but its associations (or at least its self-referenced associations) are not loaded (neither proxies are generated)...&lt;/p&gt;</comment>
                    <comment id="12738" author="romanb" created="Fri, 23 Apr 2010 04:49:47 +0000"  >&lt;p&gt;Thanks for reporting. I will take a look as soon as I find the time.&lt;/p&gt;</comment>
                    <comment id="12739" author="nicokaiser" created="Fri, 23 Apr 2010 05:09:10 +0000"  >&lt;p&gt;Test case for Doctrine\Tests\ORM\Functional\Ticket &lt;/p&gt;</comment>
                    <comment id="12875" author="shurakai" created="Fri, 7 May 2010 18:44:57 +0000"  >&lt;p&gt;It might be worth noting that, after renaming $parent to $parent2, the object is loaded but $item4-&amp;gt;children remains empty.&lt;/p&gt;

&lt;p&gt;If $item3 isn&apos;t being fetched beforehands, then everything seems to work fine.&lt;/p&gt;</comment>
                    <comment id="12922" author="shurakai" created="Wed, 12 May 2010 07:34:48 +0000"  >&lt;p&gt;After investigating, it came to my mind that the test submitted uses&lt;/p&gt;

&lt;p&gt;$proxy-&amp;gt;publicProperty&lt;/p&gt;

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

&lt;p&gt;$proxy-&amp;gt;getPublicProperty()&lt;/p&gt;


&lt;p&gt;Therefore, the proxy is not initialized and thus we get unexpected behaviour. Adding a getter a la &quot;getChildren()&quot; and calling this method only, everything works fine.&lt;/p&gt;

&lt;p&gt;Therefore, I mark this ticket as invalid.&lt;/p&gt;</comment>
                    <comment id="12926" author="nicokaiser" created="Wed, 12 May 2010 12:15:18 +0000"  >&lt;p&gt;Shouldn&apos;t these properties be automagically instantiated? In our project, we did use getChildren() and it did not work either (sorry, can&apos;t provide test case now, will do on monday).&lt;/p&gt;

&lt;p&gt;I think collections are populated automatically everywhere (you can always use $this-&amp;gt;children in entities), so this should work here as well.&lt;/p&gt;</comment>
                    <comment id="12927" author="shurakai" created="Wed, 12 May 2010 12:38:58 +0000"  >&lt;p&gt;The problem here is, that you&apos;re not really using an &lt;b&gt;entity&lt;/b&gt; but a proxy object. A proxy object does not initialize its collections, see here: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/best-practices#don%27t-use-public-properties-on-entities&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/best-practices#don%27t-use-public-properties-on-entities&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As long as you&apos;re using normal entities, the PersistentCollections will normally lazy load, thats true. But as soon as you&apos;re using proxies - like in this case - you&apos;re running into severe problems. I strongly recommend not using public properties.&lt;/p&gt;</comment>
                    <comment id="12983" author="nicokaiser" created="Mon, 17 May 2010 05:03:56 +0000"  >&lt;p&gt;You are right -&#160;if I use getChildren and a &quot;protected $children&quot;, this example works. &lt;br/&gt;
However, if I use inheritance (e.g. SINGLE_TABLE), it breaks again, even if I don&apos;t use sub items. I&apos;ll update the test case.&lt;/p&gt;</comment>
                    <comment id="12984" author="nicokaiser" created="Mon, 17 May 2010 05:04:54 +0000"  >&lt;p&gt;Updated DDC531Test.php to use SINGLE_TABLE inheritance. Breaks again, even if I don&apos;t use public members for the collection...&lt;/p&gt;</comment>
                    <comment id="12985" author="shurakai" created="Mon, 17 May 2010 08:46:38 +0000"  >&lt;p&gt;Hi Nico,&lt;/p&gt;

&lt;p&gt;thanks for your response. I will take a look at this issue shortly and will hopefully resolve it before beta2.&lt;/p&gt;

&lt;p&gt;regards&lt;br/&gt;
christian&lt;/p&gt;</comment>
                    <comment id="13031" author="romanb" created="Thu, 20 May 2010 19:05:16 +0000"  >&lt;p&gt;Thanks for your investigation. I tracked down the issue and have a fix pending.&lt;/p&gt;

&lt;p&gt;Note though, that with such an example as in the provided testcase, the parents can never be lazy. That means all parents will be eagerly loaded. Of course you can work around that by eager-joining them in DQL or by using Query::HINT_FORCE_PARTIAL_LOAD and things like that.&lt;/p&gt;

&lt;p&gt;The reason why the parents in the example can not be lazy is because a parent can potentially be of any subtype, so you would not know which proxy to put in. In general, a single-valued association that points to another entity that has mapped subclasses can not be lazy. This &quot;problem&quot; does not occur when the targeted entity has no mapped subclasses (this means it either does not participate in a mapped inheritance hierarchy or it is a leaf in the hierarchy).&lt;/p&gt;

&lt;p&gt;See also: &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;</comment>
                    <comment id="13048" author="romanb" created="Sun, 23 May 2010 09:29:29 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/616f2eda0af1a15ba205cc5013b5f001c34dfc55&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/616f2eda0af1a15ba205cc5013b5f001c34dfc55&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10606" name="DDC531Test.php" size="1976" author="nicokaiser" created="Mon, 17 May 2010 05:04:54 +0000" />
                </attachments>
            <subtasks>
            <subtask id="11378">DDC-597</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-518] Merging an entity with a one to one association to a MANAGED entity with no id throws &apos;The given entity has no identity.&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-518</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Calling merge($entity) where $entity has a one to one association to another entity that has been persisted but not yet flushed (when using auto-generated ids) throws &apos;The given entity has no identity.&apos;&lt;/p&gt;

&lt;p&gt;It looks like it does this because _doMerge in UnitOfWork assumes for one to one associations only that the associated entity has an id and calls registerManaged, which then calls addToIdentityMap)on it.&lt;/p&gt;

&lt;p&gt;I think that registeredManaged should only be called if !isset($this-&amp;gt;_entityInsertions&lt;span class=&quot;error&quot;&gt;&amp;#91;spl_object_hash($other)&amp;#93;&lt;/span&gt;)&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Reproduce.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// This is a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; element
&lt;/span&gt;$doctor = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Doctor(); $d1-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;New doctor&quot;&lt;/span&gt;;

&lt;span class=&quot;code-comment&quot;&gt;// This is a detached element which is in the database
&lt;/span&gt;$patient = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Patient(); $p1-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Existing patient&quot;&lt;/span&gt;; $p1-&amp;gt;id = 1;

$doctor-&amp;gt;patients-&amp;gt;add($patient);
$patient -&amp;gt;doctor = $doctor;

$em-&amp;gt;persist($doctor);

&lt;span class=&quot;code-comment&quot;&gt;// This &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; InvalidArgumentException: The given entity has no identity. in D:\Projects\ORM\flextrine2\flextrine\web\lib\Doctrine\ORM\UnitOfWork.php on line 1014
&lt;/span&gt;$em-&amp;gt;merge($patient);
&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;Doctor.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Doctor {

    /** @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;IDENTITY&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
    /** @Column(length=100, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
	
	/**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Patient&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;doctor&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; $patients;
	
	&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;patients = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Patient.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Patient {
	
	&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; $_explicitType = &lt;span class=&quot;code-quote&quot;&gt;&quot;vo/Patient&quot;&lt;/span&gt;;
	
    /** @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;IDENTITY&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
    /** @Column(length=100, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;

	/**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctor&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;patients&quot;&lt;/span&gt;)
	 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;doctor_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;public&lt;/span&gt; $doctor;
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11216">DDC-518</key>
            <summary>Merging an entity with a one to one association to a MANAGED entity with no id throws &apos;The given entity has no identity.&apos;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Apr 2010 06:30:30 +0000</created>
                <updated>Fri, 30 Jul 2010 12:01:46 +0000</updated>
                    <resolved>Fri, 30 Jul 2010 12:01:46 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12880" author="romanb" created="Sat, 8 May 2010 11:37:52 +0000"  >&lt;p&gt;I think the order of operations in your example is not correct even though the error is misleading.&lt;/p&gt;

&lt;p&gt;You are associating a &quot;new doctor&quot; to a &quot;detached patient&quot;. That does not seem right, remember that merge() returns a managed copy, thus when merging the patient later, the &quot;new doctor&quot; is still associated with the &quot;detached patient&quot;, not with the managed one.&lt;/p&gt;

&lt;p&gt;The following should 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;&lt;span class=&quot;code-comment&quot;&gt;// Merge detached patient
&lt;/span&gt;$managedPatient = $em-&amp;gt;merge($patient);

&lt;span class=&quot;code-comment&quot;&gt;// Associate &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; doctor with patient
&lt;/span&gt;$doctor-&amp;gt;patients-&amp;gt;add($managedPatient);
$managedPatient-&amp;gt;doctor = $doctor;

&lt;span class=&quot;code-comment&quot;&gt;// Persist &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; doctor and flush
&lt;/span&gt;$em-&amp;gt;persist($doctor);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12974" author="ccapndave" created="Sun, 16 May 2010 08:23:34 +0000"  >&lt;p&gt;You are quite right - that does work.&lt;/p&gt;

&lt;p&gt;However, I am now trying to implement my use case (turning a tree of detached objects into a tree of managed objects) and implementing the correct order you describe above seems to cause another problem.  I am not sure if this should be another ticket, but I&apos;ll put it here for the moment.&lt;/p&gt;

&lt;p&gt;Note that the part within the stars that creates the unmanaged doctor and the detached patient simulates exactly what is received by Doctrine in my application so I can&apos;t put any merges in 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;/********************************************************************/
&lt;span class=&quot;code-comment&quot;&gt;// This is a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; element
&lt;/span&gt;$doctor = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Doctor(); $doctor-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;New doctor&quot;&lt;/span&gt;;

&lt;span class=&quot;code-comment&quot;&gt;// This is a detached element which is in the database
&lt;/span&gt;$patient = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Patient(); $patient-&amp;gt;name = &lt;span class=&quot;code-quote&quot;&gt;&quot;Existing patient&quot;&lt;/span&gt;; $patient-&amp;gt;id = 1;

$doctor-&amp;gt;patients-&amp;gt;add($patient); $patient-&amp;gt;doctor = $doctor;
/********************************************************************/

&lt;span class=&quot;code-comment&quot;&gt;// Now replace $patient with its managed version
&lt;/span&gt;$managedPatient = $em-&amp;gt;merge($patient);
$doctor-&amp;gt;patients-&amp;gt;set(0, $managedPatient);

&lt;span class=&quot;code-comment&quot;&gt;// Persist the doctor
&lt;/span&gt;$em-&amp;gt;persist($doctor);

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

&lt;p&gt;This works up to the flush, which throws an error of the form:&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: 000000007dd346c3000000005d0908d2 in \Doctrine\ORM\UnitOfWork.php on line 1955&lt;/p&gt;

&lt;p&gt;In the database this results in a new doctor being created, but doctor_id in the patients table is set to NULL for the patient that is supposed to be linking to it.&lt;/p&gt;</comment>
                    <comment id="13113" author="beberlei" created="Sun, 6 Jun 2010 07:52:55 +0000"  >&lt;p&gt;I think this can&apos;t work, because obviously $doctor-&amp;gt;patients still points to the unmanaged $patient, not the managed one.&lt;/p&gt;

&lt;p&gt;Can you elaborate on why the star part is done by Doctrine? Where is doctrine doing that? what are you doing with the public API?&lt;/p&gt;

&lt;p&gt;All the detached entities should be merged before doing anything regarding a NEW entity in my opinion.&lt;/p&gt;</comment>
                    <comment id="13114" author="beberlei" created="Sun, 6 Jun 2010 07:57:50 +0000"  >&lt;p&gt;Moved to beta3 for now&lt;/p&gt;</comment>
                    <comment id="13120" author="beberlei" created="Sun, 6 Jun 2010 11:33:39 +0000"  >&lt;p&gt;Patch with test-case for this merging scenario&lt;/p&gt;</comment>
                    <comment id="13735" author="romanb" created="Fri, 30 Jul 2010 12:01:46 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/69073c4b37ee28f988306db4965f512b70f45181&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/69073c4b37ee28f988306db4965f512b70f45181&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10629" name="ddc518.patch" size="3071" author="beberlei" created="Sun, 6 Jun 2010 11:33:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-500] Single Table Inheritance Selects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-500</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We have a set of models that use Single Table inheritance and we are trying to select all objects of one type:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&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;Child&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;Child&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;OtherChild&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;OtherChild&quot;&lt;/span&gt;})
*/
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class ParentModel
{
    /**
     * @Id @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @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;

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

    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;abstract&lt;/span&gt; class SubParent &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ParentModel
{
}

/**
 * @Entity
 */
class Child &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; SubParent
{
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $anotherProperty;
}

/**
 * @Entity
 */
class OtherChild &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; SubParent
{
    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $someOtherProperty;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now to query for all of the Child objects we do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$children = $em-&amp;gt;getRepository(&apos;Child&apos;)-&amp;gt;findall();
foreach($children AS $child) {
    echo $child-&amp;gt;getId();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but we get &quot;Notice: Undefined index: id in ./Doctrine/ORM/UnitOfWork.php on line 1727&quot; on the finAll() call and the objects that aren&apos;t of the correct type have their properties nulled out.  This is because the query that is being executed doesn&apos;t have any conditionals for the type of model it&apos;s looking for and the ORM doesn&apos;t check to make sure that the object is of the correct type.&lt;/p&gt;

&lt;p&gt;This could be solved by having conditionals in the SQL query (chaining a bunch of &apos;or&apos; statements for all of the child objects) or by pulling back all of the objects and then filtering out what isn&apos;t of the correct type.  Unfortunately neither solution seems ideal.&lt;/p&gt;

&lt;p&gt;I&apos;ll try to make a test case for this then.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11190">DDC-500</key>
            <summary>Single Table Inheritance Selects</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="mridgway">Michael Ridgway</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Apr 2010 13:33:31 +0000</created>
                <updated>Mon, 26 Apr 2010 08:30:57 +0000</updated>
                    <resolved>Mon, 26 Apr 2010 08:30:57 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12600" author="mridgway" created="Wed, 7 Apr 2010 13:35:50 +0000"  >&lt;p&gt;Adding another child class just to be clear.&lt;/p&gt;</comment>
                    <comment id="12601" author="romanb" created="Wed, 7 Apr 2010 13:53:27 +0000"  >&lt;p&gt;Related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-497&quot; title=&quot;find() and findAll() on Repository do not work when SINGLE_TABLE inheritance is used&quot;&gt;&lt;del&gt;DDC-497&lt;/del&gt;&lt;/a&gt; ? Of course there should be conditionals in the query when querying for a subtype. It really surprises me that this seems not to be the case. Maybe there has been some regression.&lt;/p&gt;</comment>
                    <comment id="12602" author="mridgway" created="Wed, 7 Apr 2010 14:03:48 +0000"  >&lt;p&gt;Attached a unit test that may or may not work.&lt;/p&gt;

&lt;p&gt;It looks to be a similar issue for sure.&lt;/p&gt;</comment>
                    <comment id="12606" author="mridgway" created="Thu, 8 Apr 2010 11:55:17 +0000"  >&lt;p&gt;Fixed test case.  Now gives the &apos;Undefined index: id&apos; error.&lt;/p&gt;</comment>
                    <comment id="12713" author="romanb" created="Mon, 19 Apr 2010 05:30:25 +0000"  >&lt;p&gt;Reproduced successfully and working on it.&lt;/p&gt;</comment>
                    <comment id="12747" author="romanb" created="Mon, 26 Apr 2010 08:30:57 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/760ea34a0cc3cae4e3caea17e8aab6ceb74ecace&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/760ea34a0cc3cae4e3caea17e8aab6ceb74ecace&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11174">DDC-497</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10561" name="DDC500Test.php" size="2226" author="mridgway" created="Thu, 8 Apr 2010 11:55:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-497] find() and findAll() on Repository do not work when SINGLE_TABLE inheritance is used</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-497</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&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; 
Class Orm\Models\Car:

	@Entity
	@Table(name=&quot;cars&quot;)
	@InheritanceType(&quot;SINGLE_TABLE&quot;)
 	@DiscriminatorColumn(name=&quot;discr&quot;, type=&quot;string&quot;)
	@DiscriminatorMap({&quot;car&quot; = &quot;Orm\Models\Car&quot;, &quot;bluecar&quot; = &quot;Orm\Models\BlueCar&quot;})

Class Orm\Models\BlueCar extends Orm\Models\Car:
	
	@Entity

Now my Database holds 4 records:
	
	id 	title 		discr
	1 	blue car 	bluecar
	2 	only Car 	car
	5 	blue car2 	bluecar
	6 	only Car2 car

Now querying objects by Repository leads to some errors.

	
	//quering for all BlueCars
	$em-&amp;gt;getRepository(&apos;Orm\Models\BlueCar&apos;)-&amp;gt;findAll();
	
	//the result set counts 4 objects
	blue car	: Orm\Models\BlueCar
			: Orm\Models\Car
	blue car2	: Orm\Models\BlueCar
			: Orm\Models\Car

	//The 2 Car Items where the title is missing are to much for this result set, and useless
	// there is also a php notice coming up for each Orm\Models\Car object
	Notice: Undefined index: id in /library/Doctrine/ORM/UnitOfWork.php  on line 1727
	I use mysql as Database and so the sql query looks like this.

	&quot;SELECT c0.id AS id1, c0.title AS title2, discr FROM cars c0&quot;
	
	It seems that the query is missing the where discriminator = &quot;bluecar&quot; part

querying for Car
	$em-&amp;gt;getRepository(&apos;Orm\Models\Car&apos;)-&amp;gt;findAll();
	
	blue car: Orm\Models\BlueCar
	only Car: Orm\Models\Car
	blue car2: Orm\Models\BlueCar
	only Car2: Orm\Models\Car

	Is working without errors but i think it is a mere chance if you look at the query
	&quot;SELECT c0.id AS id1, c0.title AS title2, discr FROM cars c0&quot; it is the same.

	I am not shure if it is intended that quering for Cars also returns BlueCars but due to the behavior when using DQL for quering, i guess it is right.
	That means, when using DQL:

	$q = $em-&amp;gt;createQuery(&apos;select u from Orm\Models\BlueCar u&apos;);
	$results = $q-&amp;gt;execute();

	everything works as expected, so using a custom EntityRepository and override find, findAll and so on is a workaround. So this is a minor bug ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


</description>
                <environment>MacOsX 10.6.2 - Zend Server 4.0.6 - PHP 5.3 - MySql 5.1.40</environment>
            <key id="11174">DDC-497</key>
            <summary>find() and findAll() on Repository do not work when SINGLE_TABLE inheritance is used</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ditte">Marcus</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Apr 2010 15:56:25 +0000</created>
                <updated>Mon, 26 Apr 2010 08:32:21 +0000</updated>
                    <resolved>Mon, 26 Apr 2010 08:32:21 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12577" author="romanb" created="Mon, 5 Apr 2010 16:08:33 +0000"  >&lt;p&gt;You mention ALPHA4 as the affected version. Did you test this with trunk?&lt;/p&gt;</comment>
                    <comment id="12578" author="romanb" created="Mon, 5 Apr 2010 16:26:42 +0000"  >&lt;p&gt;@&quot;I am not shure if it is intended that quering for Cars also returns BlueCars but due to the behavior when using DQL for quering, i guess it is right.&quot;&lt;/p&gt;

&lt;p&gt;Of course. Anything else would be wrong. If you query for cars you get all cars. BlueCars are Cars.&lt;/p&gt;</comment>
                    <comment id="12590" author="ditte" created="Wed, 7 Apr 2010 06:58:15 +0000"  >&lt;p&gt;Tested with Revision: 7533.&lt;/p&gt;</comment>
                    <comment id="12748" author="romanb" created="Mon, 26 Apr 2010 08:32:21 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/760ea34a0cc3cae4e3caea17e8aab6ceb74ecace&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/760ea34a0cc3cae4e3caea17e8aab6ceb74ecace&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11190">DDC-500</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-481] Incorrect table aliasing when using quoting on table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-481</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I need to quote several table names (because of reserved words within MySQL) like so:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`Column`&quot;&lt;/span&gt;)
 */
class Column &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; OptionAbstract
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Another entity Question is related one-to-many to these entities, however, when trying to fetch the relation I get SQL errors because it seems to use the backtick as the table alias, which is illegal. An example of the query it&apos;s generating:&lt;/p&gt;
&lt;div class=&quot;code panel&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 `0.id AS id1, `0.name AS name2, `0.sequence AS sequence3, `0.question_id AS question_id4 FROM `Column` `0 WHERE question_id = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Doctrine trunk (r7479)</environment>
            <key id="11148">DDC-481</key>
            <summary>Incorrect table aliasing when using quoting on table names</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="mluiten">Menno Luiten</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Mar 2010 06:15:18 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:46 +0000</updated>
                    <resolved>Sat, 8 May 2010 11:01:48 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12506" author="mluiten" created="Mon, 29 Mar 2010 16:59:26 +0000"  >&lt;p&gt;Here&apos;s a patch that works for me; looping through the table name until there is a character in the range a-z (case insensitive) to use as an alias.&lt;/p&gt;

&lt;p&gt;Might need some more error-reporting and endless loop protection etc.&lt;/p&gt;</comment>
                    <comment id="12510" author="romanb" created="Mon, 29 Mar 2010 17:19:49 +0000"  >&lt;p&gt;Thanks but the problem is elsewhere. The table name should not have the quote characters. The quote characters should be stripped during metadata parsing and instead a flag quoted =&amp;gt; true set for the table in ClassMetadata::$table. Its not hard to fix, we will look into it soon.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10525" name="DDC-481.patch" size="734" author="mluiten" created="Mon, 29 Mar 2010 16:59:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-448] Cannot select rows from chield table   by JoinColumn in @InheritanceType(&quot;JOINED&quot;) parent table</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-448</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This bug is connected with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-416&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-416&lt;/a&gt;&lt;br/&gt;
I have this schema.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @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;smallint&quot;&lt;/span&gt;)
 * @DiscriminatorMap({
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;mainTable&quot;&lt;/span&gt;,
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;SubTable&quot;&lt;/span&gt;
 * })
 */
class mainTable
{  	
    /**
     * @Id
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @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;

    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;connectedClass&quot;&lt;/span&gt;,  cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;}, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;connectedClassId&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;, onUpdate=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $connectedClassId;
}

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;connectedClass&quot;&lt;/span&gt;)
 * @HasLifecycleCallbacks
 */
class connectedClass
{	
    /**
     * @Id
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @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-comment&quot;&gt;// connected with mainTable
&lt;/span&gt;}

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;SubTable&quot;&lt;/span&gt;)
 */
class SubTable &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; mainTable
{
}


$qb-&amp;gt;select(array(&apos;b&apos;))
       -&amp;gt;from(&apos;SubTable&apos;, &apos;b&apos;)
       -&amp;gt;where(
           $qb-&amp;gt;expr()-&amp;gt;eq(&apos;b.connectedClassId&apos;, &apos;?1&apos;) &lt;span class=&quot;code-comment&quot;&gt;// select by JoinColumn field does not work
&lt;/span&gt;                                                                                          &lt;span class=&quot;code-comment&quot;&gt;// select by normal column work (after http://www.doctrine-project.org/jira/browse/DDC-416  ) 
&lt;/span&gt;       )
       -&amp;gt;setParameter(1, $value); &lt;span class=&quot;code-comment&quot;&gt;// $value - &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; or connectedClass object
&lt;/span&gt;

Fatal error: Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;i1_.connectedClassId&apos; in &apos;where clause&apos;&apos; in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/shelly/library/Doctrine/DBAL/Connection.php:573
Stack trace:
#0 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/shelly/library/Doctrine/DBAL/Connection.php(573): PDOStatement-&amp;gt;execute(Array)
#1 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/shelly/library/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(42): Doctrine\DBAL\Connection-&amp;gt;execute(&apos;SELECT p0_.id A...&apos;, Array)
#2 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/shelly/library/Doctrine/ORM/Query.php(231): Doctrine\ORM\Query\Exec\SingleSelectExecutor-&amp;gt;execute(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Doctrine\DBAL\Connection), Array)
#3 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/shelly/library/Doctrine/ORM/AbstractQuery.php(514): Doctrine\ORM\Query-&amp;gt;_doExecute(Array)
#4 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/shelly/library/Doctrine/ORM/AbstractQuery.php(391): Doctrine\ORM\AbstractQuery-&amp;gt;execute(Array, NULL)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So, we cannot select rows by JoinColumn from Inheritance tables, because doctrine selects SubTable.connectedClassId field, not mainTable.connectedClassId&lt;/p&gt;

&lt;p&gt;This bug was fix in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-416&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-416&lt;/a&gt; patch, but it was not commited. I may write unit test for this problem&lt;/p&gt;</description>
                <environment></environment>
            <key id="11098">DDC-448</key>
            <summary>Cannot select rows from chield table   by JoinColumn in @InheritanceType(&quot;JOINED&quot;) parent table</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="freeakk">Uvarov Michael</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Mar 2010 05:34:11 +0000</created>
                <updated>Tue, 13 Apr 2010 04:20:32 +0000</updated>
                    <resolved>Mon, 12 Apr 2010 23:31:50 +0000</resolved>
                                                            <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12646" author="guilhermeblanco" created="Mon, 12 Apr 2010 23:31:50 +0000"  >&lt;p&gt;In &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/56a8f5cd5353908b815607a6e089201c95e01e6c&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/56a8f5cd5353908b815607a6e089201c95e01e6c&lt;/a&gt; this issue was fixed!&lt;/p&gt;

&lt;p&gt;Thanks for the report!&lt;/p&gt;</comment>
                    <comment id="12651" author="romanb" created="Tue, 13 Apr 2010 04:20:32 +0000"  >&lt;p&gt;The testcase is irritating though, because connectedClassId is an object, not an id.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-419] Problem when I make a INNER JOIN between 2 classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-419</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I hae some problems when I make a inner join between 2 classes, one of these classes makes join to others 2 classes in the same time and when I try to make a inner to this class, it&apos;s not coming like a object, but object Id...&lt;/p&gt;

&lt;p&gt;I don&apos;t know why its happening..&lt;/p&gt;

&lt;p&gt;I make a test case..there&apos;re all the classes and yml that show my problem..it&apos;s on ItemPregaoTest.php.. just need to run phpunit in this file..&lt;/p&gt;</description>
                <environment>Ubuntu 9.10&lt;br/&gt;
PHP 5.3.1-0.dotdeb.1 with Suhosin-Patch (cli) (built: Dec  5 2009 20:08:29) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH&lt;br/&gt;
PHPUnit 3.4.6 by Sebastian Bergmann</environment>
            <key id="11045">DDC-419</key>
            <summary>Problem when I make a INNER JOIN between 2 classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hgirardi">Henrique Girardi dos Santos</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Mar 2010 14:38:42 +0000</created>
                <updated>Sun, 8 Aug 2010 07:17:16 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 07:17:16 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12159" author="beberlei" created="Sun, 14 Mar 2010 13:51:47 +0000"  >&lt;p&gt;This is what returns for me:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;object(stdClass)[82]
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;ItemPregao&apos; (length=10)
  &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
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;item&apos; =&amp;gt; string &apos;1&apos; (length=1)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The expected result I guess. What happens for you?&lt;/p&gt;</comment>
                    <comment id="12161" author="hgirardi" created="Sun, 14 Mar 2010 14:05:06 +0000"  >&lt;p&gt;Ok...this is what happen for me...&lt;br/&gt;
but I think the expected result 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;object(stdClass)[82]
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;ItemPregao&apos; (length=10)
  &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
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;item&apos; =&amp;gt; string &apos;Item&apos; (length=4)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;because &apos;public item&apos; makes refereces to Item class, so I think it should give me a Item class, not its Id...&lt;/p&gt;</comment>
                    <comment id="12277" author="hgirardi" created="Tue, 16 Mar 2010 09:49:58 +0000"  >&lt;p&gt;When I try to make a inner join between Item and ItemPregao, happens what I&apos;ve said before, but if I make a inner join between Item and its refereces tables, it&apos;s working fine&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;createQueryBuilder();
        $qb-&amp;gt;select(&apos;i, cc, ca, cl&apos;)
           -&amp;gt;from(&apos;Item&apos;, &apos;i&apos;)
           -&amp;gt;innerJoin(&apos;i.classificacaoCatalogo&apos;, &apos;cc&apos;)
           -&amp;gt;innerJoin(&apos;cc.catalogo&apos;, &apos;ca&apos;)
           -&amp;gt;innerJoin(&apos;cc.classificacao&apos;, &apos;cl&apos;)
        ;

object(stdClass)[141]
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;Item&apos; (length=4)
  &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
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;descricao&apos; =&amp;gt; string &apos;ITEM 1&apos; (length=6)
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;classificacaoCatalogo&apos; =&amp;gt; 
    object(stdClass)[99]
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;ClassificacaoCatalogo&apos; (length=21)
      &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
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;classificacao&apos; =&amp;gt; string &apos;Classificacao&apos; (length=13)
      &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;catalogo&apos; =&amp;gt; string &apos;Catalogo&apos; (length=8)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It brings a class on &apos;classificacaoCatalogo&apos; and inside classificacaoCatalogo you can see that &apos;classificacao&apos; and &apos;catalogo&apos; are objects too..so it worked! But If I make 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 = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;createQueryBuilder();
        $qb-&amp;gt;select(&apos;ip, i&apos;)
           -&amp;gt;from(&apos;ItemPregao&apos;, &apos;ip&apos;)
           -&amp;gt;innerJoin(&apos;ip.item&apos;, &apos;i&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;do not work like before..&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;object(stdClass)[152]
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;__CLASS__&apos; =&amp;gt; string &apos;ItemPregao&apos; (length=10)
  &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
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &apos;item&apos; =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&apos;item&apos; should be a object, not a integer..&lt;/p&gt;</comment>
                    <comment id="12282" author="beberlei" created="Tue, 16 Mar 2010 12:37:32 +0000"  >&lt;p&gt;Ah now I see it. Yes, this seems to be a problem.&lt;/p&gt;</comment>
                    <comment id="12353" author="beberlei" created="Thu, 18 Mar 2010 19:30:05 +0000"  >&lt;p&gt;I have taken some time now trying to re-produce it, there  is definately a bug i have identified, however i havent found the reason yet.&lt;/p&gt;</comment>
                    <comment id="12355" author="hgirardi" created="Thu, 18 Mar 2010 20:38:12 +0000"  >&lt;p&gt;ok man!&lt;br/&gt;
I&apos;ve try to find the reason too but I havent found yet too...&lt;br/&gt;
I dont know if there&apos;s something about the item are conected to a table that there&apos;re 2 table...&lt;br/&gt;
i dont know :S&lt;/p&gt;</comment>
                    <comment id="12395" author="beberlei" created="Sat, 20 Mar 2010 10:36:32 +0000"  >&lt;p&gt;I found the issue. A quick fix is to rename the join column to &quot;item_id&quot; instead of &quot;item&quot;. This is causing the bug, we will look how to fix it.&lt;/p&gt;

&lt;p&gt;@Roman:&lt;/p&gt;

&lt;p&gt;This is particularly nasty, in UnitOfWork::createEntity the join column is set to the field name in $data, which makes the following code write the primitive FK value to the entity:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            &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;_useCExtension) {
                doctrine_populate_data($entity, $data);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                foreach ($data as $field =&amp;gt; $value) {
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($class-&amp;gt;reflFields[$field])) {
                        $class-&amp;gt;reflFields[$field]-&amp;gt;setValue($entity, $value);
                    }
                }
            }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This then leads in the ObjectHydrator to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                    &lt;span class=&quot;code-comment&quot;&gt;// PATH B: Single-valued association
&lt;/span&gt;                    $reflFieldValue = $reflField-&amp;gt;getValue($parentObject);
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $reflFieldValue || isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_hints[Query::HINT_REFRESH])) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;not evaluating to null, but to the primitive value. the If condition does not match here and the relation is never set.&lt;/p&gt;

&lt;p&gt;A simple solution would be to replace !$reflFieldValue with !is_object().&lt;/p&gt;</comment>
                    <comment id="12396" author="beberlei" created="Sat, 20 Mar 2010 10:37:24 +0000"  >&lt;p&gt;Attached a reproduce test-case.&lt;/p&gt;</comment>
                    <comment id="12399" author="romanb" created="Sat, 20 Mar 2010 10:46:10 +0000"  >&lt;p&gt;I see. As their is an easy workaround, this is not a blocker, however.&lt;/p&gt;</comment>
                    <comment id="12675" author="romanb" created="Thu, 15 Apr 2010 12:43:04 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-522&quot; title=&quot;Join columns can not be named the same as the association fields.&quot;&gt;&lt;del&gt;DDC-522&lt;/del&gt;&lt;/a&gt; needs to be fixed, then this issue is solved, too (its the same after all, the other issue is just more specific).&lt;/p&gt;</comment>
                    <comment id="12676" author="romanb" created="Thu, 15 Apr 2010 12:43:54 +0000"  >&lt;p&gt;Scheduled for beta2&lt;/p&gt;</comment>
                    <comment id="13847" author="romanb" created="Sun, 8 Aug 2010 07:17:16 +0000"  >&lt;p&gt;Should be fixed now in master.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="11226">DDC-522</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10509" name="DDC419Test.php" size="1620" author="beberlei" created="Sat, 20 Mar 2010 10:37:24 +0000" />
                    <attachment id="10449" name="TestCase.tar.bz2" size="623131" author="hgirardi" created="Fri, 12 Mar 2010 14:38:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-388] Private properties in @MappedSupperclass don&apos;t work</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-388</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;All of my entites extend an abstract class Model to inherit the &apos;id&apos; property and some other functionality. It has the @MappedSuperclass annotation.&lt;/p&gt;

&lt;p&gt;If the id property is declared private to the Model class, I&apos;ll get the following exception when using entites extending 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;[03-Mar-2010 11:36:29] exception &apos;ReflectionException&apos; with message &apos;Property id does not exist&apos; in library/Doctrine/ORM/Mapping/ClassMetadata.php:370
Stack trace:
#0 library/Doctrine/ORM/Mapping/ClassMetadata.php(370): ReflectionClass-&amp;gt;getProperty(&apos;id&apos;)
#1 [internal function]: Doctrine\ORM\Mapping\ClassMetadata-&amp;gt;__wakeup()
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I haven&apos;t looked at Doctrine code, but perhaps you should be looking for the property on the class which actually has the @Column annotation?&lt;/p&gt;</description>
                <environment>PHP 5.3.1</environment>
            <key id="10985">DDC-388</key>
            <summary>Private properties in @MappedSupperclass don&apos;t work</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="jakajancar">Jaka Jancar</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Mar 2010 06:53:06 +0000</created>
                <updated>Wed, 14 Apr 2010 11:41:40 +0000</updated>
                    <resolved>Wed, 14 Apr 2010 11:41:40 +0000</resolved>
                                            <fixVersion>2.0-BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12003" author="romanb" created="Wed, 3 Mar 2010 08:16:02 +0000"  >&lt;p&gt;Yes, I think the &apos;inherited&apos; key is simply not set for fields that are inherited from mapped superclasses. This needs to be fixed.&lt;/p&gt;</comment>
                    <comment id="12666" author="romanb" created="Wed, 14 Apr 2010 11:41:40 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/d4232d906e433b1fe4dd8aa85aa7a4aca3a2cf4c&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/d4232d906e433b1fe4dd8aa85aa7a4aca3a2cf4c&lt;/a&gt; .&lt;br/&gt;
Make sure to clear the metadata cache if necessary.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="11109">DDC-456</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-335] Refactor DQL EBNF to use JOIN FETCH as syntax for fetch joins only</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-335</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There are several problems with the current approach on fetch joins:&lt;/p&gt;

&lt;p&gt;1. There is no way to determine in the parser already if a join is fetch or not, this makes it much harder to implement things like @OrderBy or @OrderColumn&lt;br/&gt;
2. A DQL like &quot;SELECT u, g.name FROM User u JOIN u.group g&quot; currently tries to partially load the group object instead of just returning g.name as scalar. This is very unintuiative.&lt;/p&gt;

&lt;p&gt;Solution, change the EBNF too:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Join                                       ::= [&lt;span class=&quot;code-quote&quot;&gt;&quot;LEFT&quot;&lt;/span&gt; [&lt;span class=&quot;code-quote&quot;&gt;&quot;OUTER&quot;&lt;/span&gt;] | &lt;span class=&quot;code-quote&quot;&gt;&quot;INNER&quot;&lt;/span&gt;] &lt;span class=&quot;code-quote&quot;&gt;&quot;JOIN&quot;&lt;/span&gt; [FETCH] JoinAssociationPathExpression 
                                               [&lt;span class=&quot;code-quote&quot;&gt;&quot;AS&quot;&lt;/span&gt;] AliasIdentificationVariable [(&lt;span class=&quot;code-quote&quot;&gt;&quot;ON&quot;&lt;/span&gt; | &lt;span class=&quot;code-quote&quot;&gt;&quot;WITH&quot;&lt;/span&gt;) ConditionalExpression]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Question would be how to specify partial object selects.&lt;/p&gt;

&lt;p&gt;Romans idea was 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.{name, other, field, stuff}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However my take is this would again put information into the select clause that might be interesting elsewhere, so&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT u FROM User u JOIN FETCH u.group PARTIAL id, name
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That way we could add both $isFetchJoin and $isPartial flags to the AST/Join Node plus an additional $partialFields array.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10891">DDC-335</key>
            <summary>Refactor DQL EBNF to use JOIN FETCH as syntax for fetch joins only</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Feb 2010 12:56:11 +0000</created>
                <updated>Fri, 19 Feb 2010 16:33:27 +0000</updated>
                    <resolved>Fri, 19 Feb 2010 16:33:27 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11733" author="beberlei" created="Tue, 16 Feb 2010 07:14:11 +0000"  >&lt;p&gt;Ah just to remember, the idea on the partial fetch syntax was 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 FROM User u.{name, other, field, stuff} JOIN FETCH u.group g.{id, name, baz}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11734" author="beberlei" created="Tue, 16 Feb 2010 07:41:27 +0000"  >&lt;p&gt;I think this will also make the HINT_PARTIAL_LOAD constant obsolet, since the DQL is already implicitly requesting a partial load.&lt;/p&gt;</comment>
                    <comment id="11735" author="romanb" created="Tue, 16 Feb 2010 08:47:39 +0000"  >&lt;p&gt;Regarding HINT_FORCE_PARTIAL_LOAD: Not necessarily, but it might need to be renamed since its still used to decide whether to stub associations with empty collections/proxies.&lt;/p&gt;

&lt;p&gt;Anyways, I&apos;ve played around a bit with different implementations in the last days and I changed my mind regarding changing the fetch join syntax. It has many complications, like more difficult sql construction in the walker, among other things, and of course the fact that it would be a huge bc break.&lt;/p&gt;

&lt;p&gt;However, some things will change. &quot;select u.name&quot;  will select a scalar value, as you expect. The new syntax for partial object selection will currently 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;select partial u.{id,name}, partial a.{id,city} from User u join u.address a
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There will be a new AST node PartialObjectExpression that represents such a construct.&lt;/p&gt;

&lt;p&gt;Thats the current state of my progress. Regarding the isFetchJoin/isPartial decisions, we need to find another way and I&apos;m confident there are some other ways.&lt;/p&gt;

&lt;p&gt;So far...&lt;/p&gt;</comment>
                    <comment id="11736" author="beberlei" created="Tue, 16 Feb 2010 08:58:42 +0000"  >&lt;p&gt;If we change u.name to retrieving a scalar value always its easy to get all the fetch joins identification variables inside the SELECT already:&lt;/p&gt;

&lt;p&gt;If (identificiationVariable) =&amp;gt; fetchJoin&lt;/p&gt;

&lt;p&gt;Then when the join is found, you can mark the Join as Fetch already.&lt;/p&gt;</comment>
                    <comment id="11759" author="romanb" created="Fri, 19 Feb 2010 16:33:27 +0000"  >&lt;p&gt;Implemented.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="10571">DDC-195</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-317] Using a function only in hydration returns only one result</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-317</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Output of $arg:&lt;/p&gt;

&lt;div class=&quot;code panel&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(1) {
  [-1]=&amp;gt;
  array(1) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;namedep&quot;&lt;/span&gt;]=&amp;gt;
    string(25) &lt;span class=&quot;code-quote&quot;&gt;&quot;Jonathan W.Administration&quot;&lt;/span&gt;
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testConcatFunction()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;generateFixture();
        $arg = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery(&apos;SELECT CONCAT(m.name, m.department) AS namedep FROM Doctrine\Tests\Models\Company\CompanyManager m&apos;)
                         -&amp;gt;getArrayResult();

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(4, count($arg)); &lt;span class=&quot;code-comment&quot;&gt;// fails with 1
&lt;/span&gt;    }

    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function generateFixture()
    {
        $manager1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CompanyManager();
        $manager1-&amp;gt;setName(&apos;Roman B.&apos;);
        $manager1-&amp;gt;setTitle(&apos;&apos;);
        $manager1-&amp;gt;setDepartment(&apos;IT&apos;);
        $manager1-&amp;gt;setSalary(100000);

        $manager2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CompanyManager();
        $manager2-&amp;gt;setName(&apos;Benjamin E.&apos;);
        $manager2-&amp;gt;setTitle(&apos;&apos;);
        $manager2-&amp;gt;setDepartment(&apos;HR&apos;);
        $manager2-&amp;gt;setSalary(200000);

        $manager3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CompanyManager();
        $manager3-&amp;gt;setName(&apos;Guilherme B.&apos;);
        $manager3-&amp;gt;setTitle(&apos;&apos;);
        $manager3-&amp;gt;setDepartment(&apos;Complaint Department&apos;);
        $manager3-&amp;gt;setSalary(400000);

        $manager4 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CompanyManager();
        $manager4-&amp;gt;setName(&apos;Jonathan W.&apos;);
        $manager4-&amp;gt;setTitle(&apos;&apos;);
        $manager4-&amp;gt;setDepartment(&apos;Administration&apos;);
        $manager4-&amp;gt;setSalary(800000);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($manager1);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($manager2);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($manager3);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($manager4);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10868">DDC-317</key>
            <summary>Using a function only in hydration returns only one result</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Feb 2010 13:25:38 +0000</created>
                <updated>Fri, 19 Feb 2010 16:30:58 +0000</updated>
                    <resolved>Fri, 19 Feb 2010 16:30:58 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11674" author="beberlei" created="Thu, 11 Feb 2010 13:26:43 +0000"  >&lt;p&gt;Additional bug, changing the DQL 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;SELECT CONCAT(m.name, m.department) AS namedep FROM Doctrine\Tests\Models\Company\CompanyManager m WHERE m.id = 4
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;returns an empty result.&lt;/p&gt;</comment>
                    <comment id="11675" author="beberlei" created="Thu, 11 Feb 2010 14:05:36 +0000"  >&lt;p&gt;Thie following DQL gives a partial error bug:&lt;/p&gt;

&lt;div class=&quot;code panel&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 m, m.salary+2500 AS add FROM Doctrine\Tests\Models\Company\CompanyManager m
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;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\Tests\ORM\Functional\QueryDqlFunctionTest::testOperatorAdd()
Exception: [Doctrine\Common\DoctrineException] Loading partial objects is dangerous. Fetch full objects or consider using a different fetch mode. If you really want partial objects, set the doctrine.forcePartialLoad query hint to TRUE.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11676" author="beberlei" created="Thu, 11 Feb 2010 14:07:32 +0000"  >&lt;p&gt;The same goes for - * and /&lt;/p&gt;</comment>
                    <comment id="11693" author="beberlei" created="Sat, 13 Feb 2010 14:45:12 +0000"  >&lt;p&gt;Generated SQL of the CONCAT 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 CONCAT(c0_.name, c1_.department) AS sclr0 FROM company_managers c2_ INNER JOIN company_employees c1_ ON c2_.id = c1_.id INNER JOIN company_persons c0_ ON c2_.id = c0_.id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11758" author="romanb" created="Fri, 19 Feb 2010 16:30:58 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-610] Numeric strings are not quoted</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-610</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;ve been working on a MaterializedPath implementation and hit a roadblock. &lt;/p&gt;

&lt;p&gt;This condition:&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;// $pathInterval = array(&apos;00010001&apos;, &apos;0001ZZZZ&apos;);
$andX-&amp;gt;add($expr-&amp;gt;between(&apos;e.&apos; . $this-&amp;gt;getPathFieldName(), $expr-&amp;gt;literal($pathInterval[0]), $expr-&amp;gt;literal($pathInterval[1])));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;results in 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;AND (l0_.path BETWEEN 00010000 AND &apos;0001ZZZZ&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is clearly not correct. Numeric strings should still be quoted if the field is of type string.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11412">DDC-610</key>
            <summary>Numeric strings are not quoted</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="hobodave">David Abdemoulaie</assignee>
                                <reporter username="hobodave">David Abdemoulaie</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 May 2010 06:38:13 +0000</created>
                <updated>Tue, 25 May 2010 15:11:35 +0000</updated>
                    <resolved>Tue, 25 May 2010 14:56:55 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13062" author="hobodave" created="Tue, 25 May 2010 14:56:55 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/b6a5402bcb014e78eb6c0b841609e6f0bba71ef6&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/b6a5402bcb014e78eb6c0b841609e6f0bba71ef6&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-168] serialization/unserialization of ClassMetadata lose reflFields order causing  insertSql statement to fail</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-168</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This problem will be difficult to reproduce for you, but I isolated the exact cause of it.&lt;/p&gt;

&lt;p&gt;To reproduce&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Use any MetadataCache&lt;/li&gt;
	&lt;li&gt;Create a complex entity with some inheritance. (I may detail in later if your really need it)&lt;/li&gt;
	&lt;li&gt;Create an element of this entity with persist.&lt;/li&gt;
	&lt;li&gt;Create an other element of this entity but not on the same php run. (ex: reload the page)&lt;/li&gt;
	&lt;li&gt;The insert statement will fail because field names will not match parameters.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I narrowed it down to a serialization issue.&lt;/p&gt;

&lt;p&gt;When you serialize an MetadataInfo, you don&apos;t serialize reflFields.&lt;br/&gt;
When you unserizlize you regenerate this value using ReflectionClass&lt;br/&gt;
That sound&apos;s like a good optimization.&lt;/p&gt;

&lt;p&gt;The problem is that somehow, the reflection class can return the fields not in the same order that they were at the initial creation of the MetadataInfo.&lt;/p&gt;

&lt;p&gt;Because the insertSql value is not re-generated, it can be out of sync with the new fields order.&lt;/p&gt;

&lt;p&gt;The solution : &lt;br/&gt;
Call something like MetadataInfoFactory::_generateStaticSql (whish is private but ...) at wakeup time.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10483">DDC-168</key>
            <summary>serialization/unserialization of ClassMetadata lose reflFields order causing  insertSql statement to fail</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="rickdt">Eric Durand-Tremblay</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Nov 2009 22:06:08 +0000</created>
                <updated>Thu, 17 Dec 2009 13:48:12 +0000</updated>
                    <resolved>Thu, 17 Dec 2009 13:38:07 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10810" author="romanb" created="Sat, 21 Nov 2009 10:17:11 +0000"  >&lt;p&gt;Are you using composite keys anywhere?&lt;/p&gt;

&lt;p&gt;The fact that reflFields is not serialized is not really an optimization but rather due to the fact that they simply can can not be serialized/unserialized properly.&lt;/p&gt;

&lt;p&gt;We surely need some more concrete test case in order to reproduce this.&lt;/p&gt;</comment>
                    <comment id="10820" author="rickdt" created="Mon, 23 Nov 2009 13:52:39 +0000"  >&lt;p&gt;I do not uses composite key anyware.&lt;/p&gt;

&lt;p&gt;The field who change place  is a foreign key.&lt;/p&gt;

&lt;p&gt;EntityRevision extends Entity&lt;br/&gt;
EntityRevision.parent_entity : manyToOne entity&lt;/p&gt;

&lt;p&gt;(the field parent_entity_id changes place during serialization)&lt;/p&gt;

&lt;p&gt;What do you need to reproduce the case ? Just entitiy classes? a completely fuctionnal project? some kind of unit test ?&lt;/p&gt;</comment>
                    <comment id="11017" author="romanb" created="Sat, 5 Dec 2009 22:21:08 +0000"  >&lt;p&gt;Hm. the order shouldnt even matter because insertSql only contains placeholders. Can you show the SQL INSERT that is failing? With parameters, if possible, and error message.&lt;/p&gt;</comment>
                    <comment id="11024" author="rickdt" created="Sun, 6 Dec 2009 18:03:11 +0000"  >&lt;p&gt;For what I can remember, parameters are not bound in the right order which is causing an error like &quot;field x could not be null&quot;&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;INSERT INTO table (a, b) VALUES (?, ?)
bind : $b, $a
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I will post the real query on monday morning when I get back to work.&lt;/p&gt;</comment>
                    <comment id="11042" author="rickdt" created="Mon, 7 Dec 2009 13:58:13 +0000"  >&lt;p&gt;Here is the real world example.  I put the statement, the parameters, the error, and all the related 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;INSERT INTO fna_client_revision (fna_parent_record_id, record_id, display_name, last_name, maiden_name, first_name, civility, gender, birthdate, employer, employment, employment_from, civil_status, civil_status_from, insurability, fna_client_fna_id, fna_spouse_fna_id, rev_no, created_at, modified_at, created_by, modified_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Array
(
    [1] =&amp;gt; 1
    [2] =&amp;gt; George Simard2
    [3] =&amp;gt; Simard2
    [4] =&amp;gt;
    [5] =&amp;gt; George
    [6] =&amp;gt;
    [7] =&amp;gt; MALE
    [8] =&amp;gt; 1962-09-14
    [9] =&amp;gt; Plomberie ABC Inc.
    [10] =&amp;gt; Plombier
    [11] =&amp;gt;
    [12] =&amp;gt; MARRIED
    [13] =&amp;gt;
    [14] =&amp;gt; INSURABLE
    [15] =&amp;gt; 5
    [16] =&amp;gt; 2009-12-07 08:54:46
    [17] =&amp;gt; 2009-12-07 08:54:46
    [18] =&amp;gt;  Eric Durand-Tremblay
    [19] =&amp;gt;  Eric Durand-Tremblay
    [20] =&amp;gt; 1
    [21] =&amp;gt;
    [22] =&amp;gt;
)

SQLSTATE[23000]: Integrity constraint violation: 1048 Column &apos;employment&apos; cannot be &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

/**
 * @MappedSuperclass
 */
class Entity
{
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; $boolean_values = array(&lt;span class=&quot;code-quote&quot;&gt;&quot;YES&quot;&lt;/span&gt;, &apos;NO&apos;);
	
	 /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @Id
     * @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;
    
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;created_at&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $created_at;
    
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;modified_at&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $modified_at;
    
    
     /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;created_by&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $created_by=&quot;&quot;;
    
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;modified_by&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $modified_by=&quot;&quot;;
}

/**
 * @MappedSuperclass
 * @HasLifecycleCallbacks
 */
class Revisionable &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ORM\BaseEntity\Entity
{

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


namespace ORM\BaseEntity;

/**
 * @MappedSuperclass
 * @HasLifecycleCallbacks
 */
class Client &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Revisionable
{

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

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

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

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

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;civility&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $civility=&quot;&quot;;
    
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;gender&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;25&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $gender=&quot;&quot;;

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;birthdate&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;date&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $birthdate;

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

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

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;employment_from&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;date&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $employment_from;

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;civil_status&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;25&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $civil_status=&quot;&quot;;
    
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;civil_status_from&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;date&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $civil_status_from;
    
    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;insurability&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;25&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $insurability=&quot;&quot;;

    
    /**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ORM\Entity\FNA&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fna_client_fna_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; $client_fna;

	/**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ORM\Entity\FNA&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fna_spouse_fna_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; $spouse_fna;
}


namespace ORM\RevisionEntity;

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fna_client_revision&quot;&lt;/span&gt;, indexes={@index(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;idx_record_id&quot;&lt;/span&gt;, columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;record_id&quot;&lt;/span&gt;})})
 * @HasLifecycleCallbacks
 */
class Client &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ORM\BaseEntity\Client{
	
	 /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Kronos\FNA\ORM\Entity\Client&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fna_parent_record_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;SET NULL&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $parent_record;  &lt;span class=&quot;code-comment&quot;&gt;/// HERE IS THE  FIELD WHO CHANGE PLACE AFTER SERIALIZATION !!!!!!!!!!!!!!!!!!!!!!
&lt;/span&gt;    
    /**
     * 
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;record_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $record_id;
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11043" author="rickdt" created="Mon, 7 Dec 2009 14:06:54 +0000"  >&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;   
    [1] =&amp;gt; 1  (fna_parent_record_id)
(expected record_id)
    [2] =&amp;gt; George Simard2 (display_name)
    [3] =&amp;gt; Simard2 (last_name)
    [4] =&amp;gt; (maiden_name)
    [5] =&amp;gt; George (first_name)
    [6] =&amp;gt; (civility)
    [7] =&amp;gt; MALE (gender)
    [8] =&amp;gt; 1962-09-14 (birthdate)
    [9] =&amp;gt; Plomberie ABC Inc. (employer)
    [10] =&amp;gt; Plombier (employment)
    [11] =&amp;gt; (employment_from)
    [12] =&amp;gt; MARRIED (civil_status)
    [13] =&amp;gt; (civil_status_from)
    [14] =&amp;gt; INSURABLE (insurability)
    [15] =&amp;gt; 5 (rev_no)
    [16] =&amp;gt; 2009-12-07 08:54:46 (created_at)
    [17] =&amp;gt; 2009-12-07 08:54:46 (modified_at)
    [18] =&amp;gt;  Eric Durand-Tremblay (created_by)
    [19] =&amp;gt;  Eric Durand-Tremblay (modified_by)
    [20] =&amp;gt; 1 (record_id) !! Should be in position  2
    [21] =&amp;gt; (fna_client_fna_id)
    [22] =&amp;gt; (fna_spouse_fna_id)

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11070" author="beberlei" created="Mon, 7 Dec 2009 21:25:11 +0000"  >&lt;p&gt;I could reproduce the issue and generated a failing test for this. We already discussed how this might be fixed.&lt;/p&gt;</comment>
                    <comment id="11072" author="rickdt" created="Mon, 7 Dec 2009 21:28:50 +0000"  >&lt;p&gt;This is a very good news !&lt;/p&gt;</comment>
                    <comment id="11209" author="romanb" created="Thu, 17 Dec 2009 13:38:07 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                    <comment id="11210" author="rickdt" created="Thu, 17 Dec 2009 13:48:12 +0000"  >&lt;p&gt;Resolution confirmed.&lt;/p&gt;

&lt;p&gt;Thank your for your great work !&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-164] find() not polymoprhic with single table inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-164</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="10479">DDC-164</key>
            <summary>find() not polymoprhic with single table inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Nov 2009 17:08:30 +0000</created>
                <updated>Sat, 21 Nov 2009 18:52:22 +0000</updated>
                    <resolved>Sat, 21 Nov 2009 18:52:22 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-152] Polymorphic queries and fields of subclasses</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-152</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently fields of subclasses are added to the ResultSetMapping under the alias of the queried (parent) class. Later during hydration if the queried (parent) class does not own a field AbstractHydrator#_lookupDeclaringClass looks up the first subclass that defines a field with that name. However, multiple subclasses can define a field with the same name, so this is error-prone.&lt;/p&gt;

&lt;p&gt;Fields of subclasses in a polymorphic query should probably be added to the ResultSetMapping with their own alias. The lookup during hydration should be removed and the information which field belongs to which class encoded in the ResultSetMapping.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10423">DDC-152</key>
            <summary>Polymorphic queries and fields of subclasses</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Nov 2009 17:09:04 +0000</created>
                <updated>Sat, 19 Dec 2009 13:39:06 +0000</updated>
                    <resolved>Sat, 19 Dec 2009 13:39:06 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-145] Cascaded delete on a lazyloaded persistent collection</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-145</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems that if you call PersistentCollection#unwrap on a lazy loaded collection, you get nothing back (unless you initialize the collection first). Because of this, UnitOfWork#_cascadeRemove is &quot;unwrapping&quot; the collection before transversing it, and nothing gets deleted on the cascade.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10411">DDC-145</key>
            <summary>Cascaded delete on a lazyloaded persistent collection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ablock">Avi Block</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Nov 2009 14:17:17 +0000</created>
                <updated>Fri, 13 Nov 2009 19:34:48 +0000</updated>
                    <resolved>Fri, 13 Nov 2009 19:34:48 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10635" author="romanb" created="Fri, 13 Nov 2009 18:44:43 +0000"  >&lt;p&gt;Right, I think I made that change for all _cascade* methods but actually I think for _cascadeRemove initialization is actually intended. For the others it doesnt make sense.&lt;/p&gt;</comment>
                    <comment id="10636" author="romanb" created="Fri, 13 Nov 2009 18:45:32 +0000"  >&lt;p&gt;Will need to write a functional test for this before I fix it by reverting the change for _cascadeRemove.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-141] DQL with WHERE queries on Single Table Inheritance Entities fail</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-141</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The ORM query builder seems to be broken for Single Table Inheritance with discriminator. &lt;/p&gt;

&lt;p&gt;When using inheritance like here:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/inheritance-mapping#single-table-inheritance&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/inheritance-mapping#single-table-inheritance&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Queries with WHERE fail:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;SELECT p FROM MyProject\Model\Person p WHERE p.id = 1&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This translates to this SQL:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;SELECT p0_.id AS id0, p0_.discr AS discr1 FROM person p0_ WHERE p0_.id = 1 p0_.discr IN (&apos;&apos;, &apos;person&apos;, &apos;employee&apos;)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;(AND is missing after p0_.id = 1)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10406">DDC-141</key>
            <summary>DQL with WHERE queries on Single Table Inheritance Entities fail</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Nov 2009 09:36:50 +0000</created>
                <updated>Fri, 13 Nov 2009 10:12:43 +0000</updated>
                    <resolved>Fri, 13 Nov 2009 10:12:43 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10622" author="romanb" created="Fri, 13 Nov 2009 10:02:17 +0000"  >&lt;p&gt;Thanks for reporting this. I&apos;m just wondering where the empty string in the IN clause comes from? I dont seem to be able to reproduce that bit. &lt;/p&gt;</comment>
                    <comment id="10623" author="nicokaiser" created="Fri, 13 Nov 2009 10:05:56 +0000"  >&lt;p&gt;Argh, ignore the empty string, it is&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;SELECT p0_.id AS id0, p0_.discr AS discr1 FROM person p0_ WHERE p0_.id = 1 p0_.discr IN (&apos;person&apos;, &apos;employee&apos;)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;My initial example was a superclass that did not appear in the DiscriminatorMap...&lt;/p&gt;</comment>
                    <comment id="10624" author="romanb" created="Fri, 13 Nov 2009 10:12:43 +0000"  >&lt;p&gt;OK. Should be fixed now. Was a very trivial mistake. Now its covered in the tests.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-137] Only last relation id updated with multiple one-to-one self-referencing relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-137</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Take this simplified situation:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/** @Entity */
class Entity {
	/** @Id @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;) @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;

	/**
	 * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
	 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;other1&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;public&lt;/span&gt; $other1;

	/**
	 * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
	 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;other2&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;public&lt;/span&gt; $other2;
}

$entity1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Entity();
$em-&amp;gt;persist($entity1);
$entity1-&amp;gt;other1 = $entity2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Entity();
$entity1-&amp;gt;other2 = $entity3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Entity();
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The entities&apos; ids are now:&lt;/p&gt;
&lt;div class=&quot;code panel&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 1: 1, Entity 2: 2, Entity 3: 3&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, the other1&apos;s relation id is not updated:&lt;/p&gt;
&lt;div class=&quot;code panel&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	other1	other2
1  	NULL 	3:	&lt;span class=&quot;code-comment&quot;&gt;// other1&apos;s id is missing
&lt;/span&gt;2 	NULL 	NULL
3 	NULL 	NULL
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The SQL clarifies:&lt;/p&gt;
&lt;div class=&quot;code panel&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 Entity (other1, other2) VALUES (?, ?)
array(2) {
  [1]=&amp;gt;
  NULL
  [2]=&amp;gt;
  NULL
}
INSERT INTO Entity (other1, other2) VALUES (?, ?)
array(2) {
  [1]=&amp;gt;
  NULL
  [2]=&amp;gt;
  NULL
}
INSERT INTO Entity (other1, other2) VALUES (?, ?)
array(2) {
  [1]=&amp;gt;
  NULL
  [2]=&amp;gt;
  NULL
}
UPDATE Entity SET other2 = ? WHERE id = ?
array(2) {
  [0]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(3)
  [1]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Adding &apos;other3&apos; proved that only the last relation id is updated, as such:&lt;/p&gt;
&lt;div class=&quot;code panel&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	other1	other2	other3
1  	NULL 	NULL	4	&lt;span class=&quot;code-comment&quot;&gt;// other1 and other2 missing
&lt;/span&gt;2 	NULL 	NULL	NULL
3 	NULL 	NULL	NULL
4 	NULL 	NULL	NULL
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is not the case with relations that reference to entities outside the class hierarchy (so the same problem occurs with relations inside the class hierarchy).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10398">DDC-137</key>
            <summary>Only last relation id updated with multiple one-to-one self-referencing relations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="reinier.kip">Reinier Kip</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Nov 2009 14:02:28 +0000</created>
                <updated>Sun, 15 Nov 2009 11:44:21 +0000</updated>
                    <resolved>Sun, 15 Nov 2009 11:44:21 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10641" author="romanb" created="Sun, 15 Nov 2009 11:44:21 +0000"  >&lt;p&gt;Thanks, should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2] Proxies in UoW::_computeChangeSets</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When having a proxy object, say &quot;PhonenumberProxy? extends Phonenumber&quot;, and its not yet loaded from the database I think an error occures in the UnitOfWork::_computeChangeSets function since it goes and retrieves that lazy load object value using an instance of &quot;ReflectionProperty?&quot;. However with it being lazily loaded the value must be null.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10031">DDC-2</key>
            <summary>Proxies in UoW::_computeChangeSets</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Sep 2009 18:41:44 +0000</created>
                <updated>Tue, 6 Oct 2009 10:04:58 +0000</updated>
                    <resolved>Tue, 6 Oct 2009 10:04:58 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-875] Merge can sometimes add the same entity twice into a collection</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-875</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging some cascade merge object-graphs, the same entity in a ManyToMany association can be put into a collection twice during doMerge.&lt;/p&gt;

&lt;p&gt;The attached patch should stop this from happening.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12094">DDC-875</key>
            <summary>Merge can sometimes add the same entity twice into a collection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="5">Cannot Reproduce</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Nov 2010 08:50:47 +0000</created>
                <updated>Sun, 11 Mar 2012 20:46:45 +0000</updated>
                    <resolved>Sun, 11 Mar 2012 20:46:45 +0000</resolved>
                            <version>2.0-BETA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14739" author="beberlei" created="Mon, 15 Nov 2010 15:02:58 +0000"  >&lt;p&gt;which conditions lead to this problem? I want to write a test for it&lt;/p&gt;</comment>
                    <comment id="14740" author="beberlei" created="Mon, 15 Nov 2010 15:06:39 +0000"  >&lt;p&gt;not doint the unwrap() but add() directly was a bugfix for one of your other issues .Why is unwrap in here again?&lt;/p&gt;</comment>
                    <comment id="14984" author="ccapndave" created="Mon, 20 Dec 2010 06:16:53 +0000"  >&lt;p&gt;Oops - that was a mistake.  I have attached multipleaddmerge2.diff which no longer uses unwrap to add the element.&lt;/p&gt;</comment>
                    <comment id="15028" author="beberlei" created="Mon, 27 Dec 2010 18:33:32 +0000"  >&lt;p&gt;That is exactly the same code in the patch, the lines are just formatted differently.&lt;/p&gt;</comment>
                    <comment id="15112" author="ccapndave" created="Thu, 6 Jan 2011 11:59:28 +0000"  >&lt;p&gt;Sorry, I am still getting the hang of git and diff and maybe what I put in there isn&apos;t what I meant to.  I have now pushed the code to the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-875&quot; title=&quot;Merge can sometimes add the same entity twice into a collection&quot;&gt;&lt;del&gt;DDC-875&lt;/del&gt;&lt;/a&gt; branch on my ccapndave/doctrine2 fork on GitHub, hopefully this works better.&lt;/p&gt;

&lt;p&gt;As far as I can tell I am using unwrap() in order to check whether the element already exists in the array, but then calling &lt;del&gt;&amp;gt;add() directly on the PersistentCollection rather than the ArrayCollection, triggering $this&lt;/del&gt;&amp;gt;changed().&lt;/p&gt;</comment>
                    <comment id="15391" author="beberlei" created="Sat, 26 Feb 2011 10:07:40 +0000"  >&lt;p&gt;It seems even this issue is caused by multiple calls to persist. I cannot reproduce this with just a single bidirectional cascade merge.&lt;/p&gt;</comment>
                    <comment id="17545" author="asm89" created="Sun, 11 Mar 2012 20:46:45 +0000"  >&lt;p&gt;We cannot reproduce this error and haven&apos;t had similar complaints ever-since. Feel free to open a new issue with a failing testcase.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10859" name="multipleaddmerge.diff" size="1161" author="ccapndave" created="Thu, 11 Nov 2010 08:50:47 +0000" />
                    <attachment id="10897" name="multipleaddmerge2.diff" size="1163" author="ccapndave" created="Mon, 20 Dec 2010 06:16:53 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-792] CLI run-dql --max-result switch calls undefined method</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-792</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;doctrine orm:run-dql &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a FROM Entity\Foo a&quot;&lt;/span&gt; --max-result=1
&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;PHP Fatal error:  Call to undefined method Doctrine\ORM\Query::setMaxResult() in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/mysite.com/library/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php on line 117

Fatal error: Call to undefined method Doctrine\ORM\Query::setMaxResult() in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/mysite.com/library/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php on line 117
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Update line 117 of Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php to call &lt;b&gt;setMaxResults&lt;/b&gt; rather than &lt;b&gt;setMaxResult&lt;/b&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11893">DDC-792</key>
            <summary>CLI run-dql --max-result switch calls undefined method</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Sep 2010 21:36:52 +0000</created>
                <updated>Wed, 15 Sep 2010 13:26:21 +0000</updated>
                    <resolved>Wed, 15 Sep 2010 13:26:21 +0000</resolved>
                            <version>2.0-BETA4</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14383" author="guilhermeblanco" created="Wed, 15 Sep 2010 13:26:21 +0000"  >&lt;p&gt;On &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/2e3c1506fbeec0f3598a71c8a9624b72c59e3674&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/2e3c1506fbeec0f3598a71c8a9624b72c59e3674&lt;/a&gt; this issue was fixed.&lt;/p&gt;

&lt;p&gt;Thanks for the report! =)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-775] Ability to use IFNULL() function in ORDER BY clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-775</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;    $qb = $em-&amp;gt;createQueryBuilder(); /* @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; $qb Doctrine\ORM\QueryBuilder */
    $roles = $qb-&amp;gt;from(&apos;App_Model_Role&apos;, &apos;r&apos;)
                -&amp;gt;select(&apos;r&apos;)
                -&amp;gt;orderBy(&apos;IFNULL(r.rootId, r.id), r.lft&apos;)
                -&amp;gt;getQuery()
                -&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 46: Error: Expected end of string, got &apos;(&apos;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11844">DDC-775</key>
            <summary>Ability to use IFNULL() function in ORDER BY clause</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="darkangel">Glen Ainscow</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Aug 2010 08:01:29 +0000</created>
                <updated>Sun, 25 Mar 2012 13:19:51 +0000</updated>
                    <resolved>Sun, 25 Mar 2012 13:19:51 +0000</resolved>
                            <version>2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="17460" author="riki4321" created="Mon, 20 Feb 2012 14:34:50 +0000"  >&lt;p&gt;I have the same error while using FIELD mysql function.&lt;/p&gt;

&lt;p&gt;I added beberlei/DoctrineExtensions to my Symfony2 project to enable the FIELD function, but I&apos;m able to use it in SELECT clause only. The problem is that in  that case Doctrine returns bad result for me. Here is the 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;           $queryBuilder
                 -&amp;gt;addSelect(&apos;FIELD(u.id, 1, 2) as relevanceField&apos;)
                 -&amp;gt;orderBy(&apos;relevanceField&apos;)
            ;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The result 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;foreach($queryBuilder-&amp;gt;getQuery()-&amp;gt;getResult() as $r) { ... } 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;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(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;, relevanceField)
Array(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;, relevanceField)
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Without that addSelect() function call I have correct 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;&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; 
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So I think orderByItem() function in Parser.php class should be extended so that MySQL function could be used there.&lt;/p&gt;</comment>
                    <comment id="17469" author="fabio.bat.silva" created="Mon, 20 Feb 2012 21:48:22 +0000"  >&lt;p&gt;Hi  Nikita,&lt;/p&gt;

&lt;p&gt;I have a pull request under discussion about this ticket :&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/288&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/288&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;please follow, and fell free to comment. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="17650" author="fabio.bat.silva" created="Sun, 25 Mar 2012 13:19:51 +0000"  >&lt;p&gt;i&apos;m +1 for this feature. &lt;br/&gt;
But is not cross-platform then we can&apos;t support..&lt;/p&gt;

&lt;p&gt;More details : &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/288&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/288&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1284] Inheritance fails in JOIN query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1284</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi!&lt;br/&gt;
Sorry for my english, I&apos;m working on that.&lt;br/&gt;
I&apos;ve this code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;entity&quot;&lt;/span&gt;) 
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;entityTypeId&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;)
 * @DiscriminatorMap({0 = &lt;span class=&quot;code-quote&quot;&gt;&quot;Bank&quot;&lt;/span&gt;,  1 = &lt;span class=&quot;code-quote&quot;&gt;&quot;Dealer&quot;&lt;/span&gt;, 2 = &lt;span class=&quot;code-quote&quot;&gt;&quot;Debtor&quot;&lt;/span&gt;, 3 = &lt;span class=&quot;code-quote&quot;&gt;&quot;Repo&quot;&lt;/span&gt;, 4 = &lt;span class=&quot;code-quote&quot;&gt;&quot;Appraiser&quot;&lt;/span&gt;, 5 = &lt;span class=&quot;code-quote&quot;&gt;&quot;Transport&quot;&lt;/span&gt;})
 */
class Entities
{
     /**
     * @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;var&lt;/span&gt; integer
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

   /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=40)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; text
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;

    ............................................................
    ............................................................
}

------------------------------------------------------------------------------------------------------------------------------------
/** 
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\Entity\Repository\DebtorRepository&quot;&lt;/span&gt;)
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;debtor&quot;&lt;/span&gt;) 
 */ 
class Debtor &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Entities{
    
}

------------------------------------------------------------------------------------------------------------------------------------
 
/**
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Model\Entity\Repository\PlacementRepository&quot;&lt;/span&gt;)
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;placement&quot;&lt;/span&gt;)
 */
class Placement
{
      
    /**
     * @Id
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;)
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;


       /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Debtor&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;placements&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;debtorId&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; $debtor;
 
........................................
.......................................
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The DQL query: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&quot;SELECT t1 FROM Model\Entity\Placement t1 INNER JOIN t1.debtor d WITH d.name = &apos;test&apos; &quot;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;fails and show the message&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;e2_.name&apos; in &apos;on clause&apos;&quot;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I hope somebody know how fix this, I can&apos;t fixing this.&lt;/p&gt;
</description>
                <environment>Ubuntu 10.10</environment>
            <key id="12841">DDC-1284</key>
            <summary>Inheritance fails in JOIN query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="thetourist">Carlos Ayala</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Jul 2011 20:40:13 +0000</created>
                <updated>Sun, 14 Aug 2011 03:18:40 +0000</updated>
                    <resolved>Sun, 14 Aug 2011 03:18:40 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16206" author="beberlei" created="Tue, 26 Jul 2011 18:39:09 +0000"  >&lt;p&gt;Can you call $query-&amp;gt;getSQL() and show me the generated SQL statement? or grab it from a log file&lt;/p&gt;</comment>
                    <comment id="16322" author="guilhermeblanco" created="Sun, 14 Aug 2011 03:18:40 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;This issue is impossible to be fixed by Doctrine side.&lt;br/&gt;
The inheritance requires Doctrine to make additional JOINs to also include the inherited Entities, but it&apos;s not possible at that stage to determine which JOIN-ON clause your WITH would be part of, it generates a broken SQL.&lt;/p&gt;

&lt;p&gt;That&apos;s your situation. Since in your individual situation you&apos;re doing INNER JOINs, you are pretty much able to fix this by doing a WHERE clause. From Doctrine perspective, this issue is not fixable.&lt;/p&gt;


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

<item>
            <title>[DDC-1234] With class table inheritance, SqlWalker always joins subclass tables even when they are not used</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1234</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using class table inheritance, it is not possible to avoid joining subclass tables even if they are not needed.  For example, when selecting only scalar fields of the parent class and using array hydration.&lt;/p&gt;

&lt;p&gt;Classes:&lt;/p&gt;
&lt;div class=&quot;code panel&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;employee&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;customer&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;Customer&quot;&lt;/span&gt;})
 */
class Person
{
    ...
    /** @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;
    ...
}

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

&lt;p&gt;Test 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;$entityManager-&amp;gt;createQueryBuilder()-&amp;gt;select(&apos;p.name&apos;)-&amp;gt;from(&apos;Person&apos;, &apos;p&apos;)-&amp;gt;getQuery()-&amp;gt;getArrayResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The generated SQL includes &apos;employee&apos; table even though it is not used.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12756">DDC-1234</key>
            <summary>With class table inheritance, SqlWalker always joins subclass tables even when they are not used</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="pschwisow">Patrick Schwisow</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Jun 2011 17:31:09 +0000</created>
                <updated>Sun, 16 Oct 2011 03:26:17 +0000</updated>
                    <resolved>Sun, 16 Oct 2011 03:26:17 +0000</resolved>
                            <version>2.0.5</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16093" author="beberlei" created="Tue, 28 Jun 2011 19:46:13 +0000"  >&lt;p&gt;A change that detects this would be considered an improvement, the functionality works, its just not very efficient in this case.&lt;/p&gt;

&lt;p&gt;I doubt there is a simple and good way to implement this though, i assign this to Guilherme for evaluation.&lt;/p&gt;</comment>
                    <comment id="16612" author="guilhermeblanco" created="Sun, 16 Oct 2011 03:26:17 +0000"  >&lt;p&gt;That would require almost a complete rewrite of DQL parser to be able to be done.&lt;br/&gt;
An alternative would be a 2-step parser, but it would slowdown the performance of DQL =&amp;gt; SQL translation so much that I consider it&apos;s better to mark as can&apos;t fix.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1184] ORM\Id\AssignedGenerator try to current() on non-array</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1184</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// Doctrine\ORM\AssignedGenerator::generate at line 54
&lt;/span&gt;
$identifier[$idField] = current($em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($value));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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

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

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

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

<item>
            <title>[DDC-1175] Call chaining for entity manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1175</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It would be nice to have the entity manager return $this in methods like persist and remove, so instead of having this:&lt;/p&gt;

&lt;p&gt;$em = $this-&amp;gt;get(&apos;doctrine&apos;)-&amp;gt;getEntityManager();&lt;br/&gt;
$user = $em-&amp;gt;find(&apos;AcmeHelloBundle:User&apos;, $id);&lt;br/&gt;
$em-&amp;gt;remove($user);&lt;br/&gt;
$em-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;One could do this:&lt;/p&gt;

&lt;p&gt;$em = $this-&amp;gt;get(&apos;doctrine&apos;)-&amp;gt;getEntityManager();&lt;br/&gt;
$user = $em-&amp;gt;find(&apos;AcmeHelloBundle:User&apos;, $id);&lt;br/&gt;
$em&lt;br/&gt;
    -&amp;gt;remove($user)&lt;br/&gt;
    -&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;It is a small improvement (and perhaps its not the best case to demonstrate it) but it makes using the entity manager more comfortable.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12673">DDC-1175</key>
            <summary>Call chaining for entity manager</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dukeofgaming">David Vega</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 May 2011 07:20:13 +0000</created>
                <updated>Mon, 30 May 2011 06:20:32 +0000</updated>
                    <resolved>Mon, 30 May 2011 06:20:32 +0000</resolved>
                            <version>2.x</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15886" author="beberlei" created="Fri, 27 May 2011 07:24:20 +0000"  >&lt;p&gt;A fluent interface shouldnt be introduced just for convenience, it makes no sense here semenatically.&lt;/p&gt;</comment>
                    <comment id="15894" author="dukeofgaming" created="Mon, 30 May 2011 01:05:15 +0000"  >&lt;p&gt;Well, I never spoke of any fluent interface, and method chaining &#8212;which can be easily confused with fluent interfaces or vice versa (read the Update at the bottom of &lt;a href=&quot;http://martinfowler.com/bliki/FluentInterface.html&quot; class=&quot;external-link&quot;&gt;http://martinfowler.com/bliki/FluentInterface.html&lt;/a&gt;)&#8212; is often used for convenience, meaning readability and practicality.&lt;/p&gt;

&lt;p&gt;So compare:&lt;/p&gt;

&lt;p&gt;$entity_manager&lt;br/&gt;
    -&amp;gt;persist($an_entity)&lt;br/&gt;
    -&amp;gt;persist($another_entity)&lt;br/&gt;
    -&amp;gt;persist($some_entity)&lt;br/&gt;
    -&amp;gt;persist($the_entity)&lt;br/&gt;
    -&amp;gt;remove($little_entity)&lt;br/&gt;
    -&amp;gt;remove($big_entity)&lt;br/&gt;
        -&amp;gt;flush();&lt;/p&gt;

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

&lt;p&gt;$entity_manager-&amp;gt;persist($an_entity)&lt;br/&gt;
$entity_manager-&amp;gt;persist($another_entity)&lt;br/&gt;
$entity_manager-&amp;gt;persist($some_entity)&lt;br/&gt;
$entity_manager-&amp;gt;persist($the_entity)&lt;br/&gt;
$entity_manager-&amp;gt;remove($little_entity)&lt;br/&gt;
$entity_manager-&amp;gt;remove($big_entity)&lt;br/&gt;
$entity_manager-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;It is way less tedious and way more readable, and again, not a fluent interface, just method chaining to improve readability and ease of use.&lt;/p&gt;</comment>
                    <comment id="15895" author="beberlei" created="Mon, 30 May 2011 06:20:32 +0000"  >&lt;p&gt;No reason to reopen. We made this decision and its final&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1157] Remove Cascade doesn&apos;t work on proxy object</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1157</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;I am a beginner with doctrine, so all my apologize if this is not the place, or if this issue was already report. I posted on doctrine user google group(&lt;a href=&quot;http://tinyurl.com/6gh49yh&quot; class=&quot;external-link&quot;&gt;http://tinyurl.com/6gh49yh&lt;/a&gt;), but got no response, asked on mirc channel, not response too. I searched into jira for the same issue, but i don&apos;t find.&lt;/p&gt;

&lt;p&gt;This is my problem: I have a ont-to-one relation between two entities, A and B. A got foreign key to B. I configure delete cascade on A, so i am expected that if A is deleted, B should be too.&lt;br/&gt;
I used the Entity Manager getReference method to get an A entity, so this is a proxy object. I did $em-&amp;gt;remove($A). After flush, A is remove, but B still alive.&lt;br/&gt;
I investigate doctrine source code, and i found in UnitOfWork#cascaseRemove method, line 1705, a TODO comment line, where initialized should call on proxy object. And when remove is called on Proxy object, at this point, $relatedEntities is null.&lt;br/&gt;
When i used the Entity Manager find method, i got an object fullfilled, so at this line $relatedEntities is not null.&lt;/p&gt;

&lt;p&gt;So this is a forgotten implementation, a bug, or did I make something wrong because what i want to do work perfectly for you ?&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;</description>
                <environment>Doctrine 2.1 beta</environment>
            <key id="12645">DDC-1157</key>
            <summary>Remove Cascade doesn&apos;t work on proxy object</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="benoit">Jonathan Clus</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 May 2011 08:22:33 +0000</created>
                <updated>Tue, 6 Sep 2011 04:48:29 +0000</updated>
                    <resolved>Tue, 6 Sep 2011 04:48:29 +0000</resolved>
                            <version>2.1</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16438" author="guilhermeblanco" created="Tue, 6 Sep 2011 04:48:29 +0000"  >&lt;p&gt;Defining delete cascade means that when B is removed, A is also removed... not the opposite.&lt;/p&gt;

&lt;p&gt;You need to define cascade=&lt;/p&gt;
{&quot;remove&quot;}
&lt;p&gt; in order to have this working nicely.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1142] Cache affecting Doctrine\ORM\Persisters\BasicEntityPersister::_prepareUpdateData()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1142</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine\ORM\Persisters\BasicEntityPersister::_prepareUpdateData()&lt;br/&gt;
Differing behaviour on line 460  if (isset($this-&amp;gt;_class-&amp;gt;associationMappings&lt;span class=&quot;error&quot;&gt;&amp;#91;$field&amp;#93;&lt;/span&gt;)) {&lt;/p&gt;

&lt;p&gt;Dependand on the prepopulation of $this-&amp;gt;_class-&amp;gt;associationMappings.&lt;br/&gt;
If you are using the  \Doctrine\Common\Cache\ArrayCache (every request) or \Doctrine\Common\Cache\MemcacheCache (only on the first request after restart)&lt;br/&gt;
$this-&amp;gt;_class-&amp;gt;associationMappings[ $field] is set.&lt;/p&gt;

&lt;p&gt;Subsequent calls when using memcache wil have $this-&amp;gt;_class-&amp;gt;associationMappings&lt;span class=&quot;error&quot;&gt;&amp;#91;$field&amp;#93;&lt;/span&gt; NOT set &amp;amp; hence differing behaviour.&lt;br/&gt;
result: irregular updates of associations&lt;/p&gt;
</description>
                <environment>php 5.3.5, winxp , WampServer 2.1e</environment>
            <key id="12624">DDC-1142</key>
            <summary>Cache affecting Doctrine\ORM\Persisters\BasicEntityPersister::_prepareUpdateData()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="5">Cannot Reproduce</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:18:06 +0000</created>
                <updated>Thu, 15 Mar 2012 21:50:50 +0000</updated>
                    <resolved>Thu, 15 Mar 2012 21:50:50 +0000</resolved>
                            <version>2.0.4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15849" author="beberlei" created="Sat, 14 May 2011 10:04:26 +0000"  >&lt;p&gt;Why have subsequent calls with memcache $this-&amp;gt;_class-&amp;gt;associationMappings&lt;span class=&quot;error&quot;&gt;&amp;#91;$field&amp;#93;&lt;/span&gt;  not set? This should not be happening&lt;/p&gt;</comment>
                    <comment id="17134" author="beberlei" created="Wed, 28 Dec 2011 19:52:17 +0000"  >&lt;p&gt;note to myself: Maybe a windows + memcache, wampserver issue?&lt;/p&gt;</comment>
                    <comment id="17599" author="asm89" created="Thu, 15 Mar 2012 21:50:50 +0000"  >&lt;p&gt;Cannot really reproduce this and no additional feedback was provided.&lt;/p&gt;

&lt;p&gt;-&amp;gt; close&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1114] Association on a non primary key field - fix the commit order</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1114</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We are trying to create an association which referenced column is not a primary key.&lt;/p&gt;

&lt;p&gt;The source entity mapping looks like:&lt;/p&gt;

&lt;p&gt;   &amp;lt;entity name=&quot;Joiz\HomeBundle\Entity\ShowInstanceTeaser&quot; table=&quot;teaser&quot;&amp;gt;&lt;br/&gt;
        &amp;lt;many-to-one field=&quot;showInstance&quot; target-entity=&quot;Joiz\ShowBundle\Entity\ShowInstance&quot;&amp;gt;&lt;br/&gt;
            &amp;lt;join-column name=&quot;show_instance_extid&quot; referenced-column-name=&quot;extid&quot; /&amp;gt;&lt;br/&gt;
        &amp;lt;/many-to-one&amp;gt;&lt;br/&gt;
   &amp;lt;/entity&amp;gt;&lt;/p&gt;

&lt;p&gt;The destination entity mapping is:&lt;/p&gt;

&lt;p&gt;    &amp;lt;entity name=&quot;Joiz\ShowBundle\Entity\ShowInstance&quot; table=&quot;show_instance&quot; repository-class=&quot;Joiz\ShowBundle\Entity\ShowInstanceRepository&quot;&amp;gt;&lt;/p&gt;

&lt;p&gt;        &amp;lt;id name=&quot;id&quot; column=&quot;id&quot; type=&quot;integer&quot;&amp;gt;&lt;br/&gt;
            &amp;lt;generator strategy=&quot;IDENTITY&quot; /&amp;gt;&lt;br/&gt;
        &amp;lt;/id&amp;gt;&lt;/p&gt;

&lt;p&gt;        &amp;lt;field name=&quot;extid&quot; column=&quot;extid&quot; type=&quot;string&quot; unique=&quot;true&quot; /&amp;gt;&lt;/p&gt;

&lt;p&gt;        &amp;lt;!-- ... snip ... --&amp;gt;&lt;/p&gt;

&lt;p&gt;    &amp;lt;/entity&amp;gt;&lt;/p&gt;

&lt;p&gt;Doctrine will correctly create the tables with the above mapping but the association does not seem to work.&lt;/p&gt;

&lt;p&gt;When we  try to load some data in the tables:&lt;/p&gt;

&lt;p&gt;        $showInst = new ShowInstance();&lt;br/&gt;
        $showInst-&amp;gt;setExtid(999);&lt;br/&gt;
        $manager-&amp;gt;persist($showInst);&lt;/p&gt;

&lt;p&gt;        $teaser = new ShowInstanceTeaser();&lt;br/&gt;
        $teaser-&amp;gt;setShowInstance($showInst);&lt;br/&gt;
        $manager-&amp;gt;persist($teaser);&lt;/p&gt;

&lt;p&gt;This will leave the column &quot;teaser.show_instance_extid&quot; null.&lt;/p&gt;

&lt;p&gt;Doing the same but using the primary key for the association will work.&lt;/p&gt;


&lt;p&gt;In a discussion on the #doctrine-dev channel on freenode beberlei explained:&lt;/p&gt;

&lt;p&gt;&amp;lt;beberlei&amp;gt; ah the problem is probably the CommitOrderCalculator does not know of this foreign key&lt;br/&gt;
&amp;lt;beberlei&amp;gt; and sorts the inserts in the wrong order&lt;/p&gt;

&lt;p&gt;&amp;lt;beberlei&amp;gt; you cannot add foreign keys say through some mapping information in annotations or xml the like&lt;br/&gt;
&amp;lt;beberlei&amp;gt; you have to create them manually&lt;br/&gt;
&amp;lt;beberlei&amp;gt; and in this case doctrine might end up in troubles depending on the commit order&lt;br/&gt;
&amp;lt;beberlei&amp;gt; hibernate solves this by allowing to specifiy additional constraints that are recognized while calculating the commit order, but this is not yet in tdoctrine2. can you open up a ticket for this?&lt;/p&gt;
</description>
                <environment>debian lenny, smyfony2, postgres 8.4</environment>
            <key id="12563">DDC-1114</key>
            <summary>Association on a non primary key field - fix the commit order</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="dan_liip">Daniel Barsotti</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Apr 2011 08:17:07 +0000</created>
                <updated>Mon, 5 Sep 2011 05:30:12 +0000</updated>
                    <resolved>Mon, 5 Sep 2011 05:30:12 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16155" author="beberlei" created="Tue, 12 Jul 2011 20:40:47 +0000"  >&lt;p&gt;Btw, 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 wasn&apos;t responsible to design this part of the Doctrine code. I would strongly suggest not to do this.&lt;/p&gt;</comment>
                    <comment id="16433" author="guilhermeblanco" created="Mon, 5 Sep 2011 05:30:12 +0000"  >&lt;p&gt;Any ORM can&apos;t be designed to map associations on non-ID fields.&lt;/p&gt;

&lt;p&gt;Ideally, no IDs would be exposed to user (they should be controlled internally), but since almost everything rely on IDs to be passed this is exposed to the user.&lt;/p&gt;

&lt;p&gt;Anyway, this ticket is invalid as it&apos;s an invalid usage of the ORM tool.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="12813">DDC-1269</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1046] Configurable/overridable code generation templates for entities and repositories classes automatic generation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1046</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Initial proposal discussed in doctrine-user groups: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/10ed814339429c3e?hl=en&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/10ed814339429c3e?hl=en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Required features are:&lt;/p&gt;

&lt;p&gt;1. Possibility to override default Doctrine&apos;s code generation templates, which are hard-coded for the moment within EntityGenerator &amp;amp; EntityRepositoryGenerator classes&lt;br/&gt;
2. Possibility to extend Repository classes from a custom base class. For the moment it is also hard-coded inside EntityRepositoryGenerator class to be extended from Doctrine\ORM\EntityRepository&lt;/p&gt;

&lt;p&gt;Attached pull request with possible implementation is here: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/30&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/30&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12428">DDC-1046</key>
            <summary>Configurable/overridable code generation templates for entities and repositories classes automatic generation</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mikhus">Mykhailo Stadnyk</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Feb 2011 15:27:04 +0000</created>
                <updated>Sun, 11 Mar 2012 20:54:48 +0000</updated>
                    <resolved>Sun, 11 Mar 2012 20:54:48 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15372" author="beberlei" created="Fri, 25 Feb 2011 17:53:39 +0000"  >&lt;p&gt;There are several things I don&apos;t like with this change that need to be addressed before I merge this:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Additional options in the configuration, please drop them, you may specify them as optional arguments to the constructors of GenerateEntitiesCommand and GenerateRepositoriesCommand classes.&lt;/li&gt;
	&lt;li&gt;The init() in the constructor, please move it to load lazily in the setters/getters of the AbstractWriter.&lt;/li&gt;
	&lt;li&gt;The change for $fullParentClassName is not backwards compatible, please make that parameter optional and default to &quot;Doctrine\ORM\EntityRepository&quot;.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="15394" author="mikhus" created="Sat, 26 Feb 2011 10:52:33 +0000"  >&lt;p&gt;Hi, Benjamin!&lt;/p&gt;

&lt;p&gt;Done and available for review: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/30/files&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/30/files&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1. Done. Options dropped, added optional arguments --code-writer=&quot;My\Writer\ClassImpl&quot; to orm:generate-entities &amp;amp; orm:generate-repositories commands&lt;br/&gt;
2. Done.&lt;br/&gt;
3. Done. Added constant DEFAULT_EXTEND_CLASS to EntityRepositoryGenerator class, which is used within $fullParendClassName and $parentClassName as defualt value&lt;/p&gt;

&lt;p&gt;I&apos;ve also removed assignment of writer instance via constructor and added setCodeWriter method dedicated for this purpose. From other hand implemented getCodeWriter method will construct a default writer if none was previously set, so both EntityRepositoryGenerator and EntityGenerator are also backward compatible from now.&lt;/p&gt;</comment>
                    <comment id="15419" author="mikhus" created="Tue, 1 Mar 2011 16:27:02 +0000"  >&lt;p&gt;Could I help in any other way? Is there any problem to merge?&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br/&gt;
Mike&lt;/p&gt;</comment>
                    <comment id="15420" author="beberlei" created="Tue, 1 Mar 2011 16:40:52 +0000"  >&lt;p&gt;I just have limited time at the moment, i will merge this in the near future.&lt;/p&gt;</comment>
                    <comment id="17546" author="asm89" created="Sun, 11 Mar 2012 20:54:48 +0000"  >&lt;p&gt;The entity generation stuff will hopefully be replaced by a new generation project in the future:&lt;br/&gt;
&lt;a href=&quot;https://github.com/beberlei/DoctrineCodeGenerator&quot; class=&quot;external-link&quot;&gt;https://github.com/beberlei/DoctrineCodeGenerator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since this is quite an old issue I&apos;ll close it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1020] Do we really need PreUpdateEventArgs::_assertValidField()?</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1020</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am not sure why we need this. I have a situation where we have a preUpdate() listener and the field I want to set the value for is not already in the changeset so _assertValidField() throws an exception. Do we really need this?&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Order
{
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $something;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $tax;

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

$order = $em-&amp;gt;find(&apos;Order&apos;, 1);
$order-&amp;gt;setSomething(&apos;test&apos;);

$em-&amp;gt;flush();

class MyListener
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preUpdate(PreUpdateEventArgs $args)
    {
        $calculatedTax = 0;
        &lt;span class=&quot;code-comment&quot;&gt;// _assertValidField() in PreUpdateEventArgs &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; an exception because
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;// tag is not already in the changeset. If i hack around it and &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tax = 1; or something
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;// in the contructor of Order then it shows up in the changeset and setNewValue() works
&lt;/span&gt;        $args-&amp;gt;setNewValue(&apos;tax&apos;, $calculatedTax);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12362">DDC-1020</key>
            <summary>Do we really need PreUpdateEventArgs::_assertValidField()?</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Feb 2011 16:19:24 +0000</created>
                <updated>Fri, 11 Feb 2011 13:14:47 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 13:14:47 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15254" author="jwage" created="Fri, 11 Feb 2011 11:45:22 +0000"  >&lt;p&gt;Working on an actual test and patch for this.&lt;/p&gt;</comment>
                    <comment id="15255" author="jwage" created="Fri, 11 Feb 2011 13:14:47 +0000"  >&lt;p&gt;After discussing this we discovered that you just need to modify the entity and then explicitly recompute the changeset for that document.&lt;/p&gt;

&lt;div class=&quot;code panel&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 DDC1020OrderEventListener
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preUpdate(LifecycleEventArgs $args)
    {
        $order = $args-&amp;gt;getEntity();
        $order-&amp;gt;tax = 100;
        $em = $args-&amp;gt;getEntityManager();
        $uow = $em-&amp;gt;getUnitOfWork();
        $uow-&amp;gt;recomputeSingleEntityChangeSet(
            $em-&amp;gt;getClassMetadata(get_class($order)),
            $args-&amp;gt;getEntity()
        );
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1013] Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1013</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases&lt;/p&gt;</description>
                <environment></environment>
            <key id="12348">DDC-1013</key>
            <summary>Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 13:31:08 +0000</created>
                <updated>Sun, 14 Aug 2011 16:18:34 +0000</updated>
                    <resolved>Sun, 14 Aug 2011 03:23:10 +0000</resolved>
                            <version>2.0.1</version>
                                <fixVersion>2.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16203" author="kbond" created="Tue, 26 Jul 2011 14:31:30 +0000"  >&lt;p&gt;Any update on this, is there a work-around?&lt;/p&gt;</comment>
                    <comment id="16205" author="beberlei" created="Tue, 26 Jul 2011 18:36:25 +0000"  >&lt;p&gt;I could not reproduce this yet, can you provide me with a reproduce case?&lt;/p&gt;</comment>
                    <comment id="16207" author="kbond" created="Tue, 26 Jul 2011 19:01:58 +0000"  >&lt;p&gt;&lt;a href=&quot;https://gist.github.com/1107578&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/1107578&lt;/a&gt; shows my entity inheritance structure:&lt;/p&gt;

&lt;p&gt;Entity (MappedSuperClass) -&amp;gt; Page -&amp;gt; BaseClassification (MappedSuperClass) -&amp;gt; Species&lt;/p&gt;

&lt;p&gt;...&lt;del&gt;&amp;gt;getRepository(&apos;Species&apos;)&lt;/del&gt;&amp;gt;findOneByPath(&apos;path&apos;) gives me this error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;t0.path&apos; in &apos;where clause&apos; &lt;/p&gt;

&lt;p&gt;The query being generated is as follows:&lt;/p&gt;

&lt;p&gt;&apos;SELECT t1.body AS body2, t1.path AS path3, t1.id AS id4, t1.title AS title5, t1.updated_at AS updated_at6, t1.created_at AS created_at7, t1.alternate_names AS alternate_names8, t1.latin_name AS latin_name9, t1.genus_id AS genus_id10 FROM species t1 WHERE t0.path = ?&apos;&lt;/p&gt;

&lt;p&gt;that t0 is an alias that does exist.&lt;/p&gt;

&lt;p&gt;If you need further information, let me know.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="16323" author="guilhermeblanco" created="Sun, 14 Aug 2011 03:23:10 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Your mapping is wrong.&lt;br/&gt;
Species entity extends from BaseClassification, which contains no &quot;path&quot; field. The only &quot;path&quot; that exists is in Page entity, which has nothing hierarchically to Species entity.&lt;/p&gt;

&lt;p&gt;Marking this issue as invalid. Reopen if you after your mapping fix the issue still persist.&lt;/p&gt;

&lt;p&gt;Cheers, &lt;/p&gt;</comment>
                    <comment id="16328" author="kbond" created="Sun, 14 Aug 2011 16:18:34 +0000"  >&lt;p&gt;Hmm, not sure what you mean?  BaseClassification extends the Page entity...  Should BaseClassification not contain all the fields from Page and Species not all the fields from BaseClassification?&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12011">DDC-841</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

<item>
            <title>[DDC-1408] DQL parser fails to parse alias in select expression named &quot;count&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1408</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When running 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 count(u.id) AS count FROM User u
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I receive 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 28 near &apos;FROM User u&apos;: Error: &lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt; &apos;FROM&apos; is not defined. 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;because of &quot;COUNT&quot; alias being parsed as aggregate function.&lt;/p&gt;

&lt;p&gt;Still such alias is valid in MySQL and should be treated as &quot;identifier&quot; following the DQL EBNF (at least I think so).&lt;/p&gt;

&lt;p&gt;If not fixing this to allow such names being used as aliases, at least should warn developer about this somehow, because the current error is not self descriptive.&lt;/p&gt;</description>
                <environment>mysql</environment>
            <key id="13073">DDC-1408</key>
            <summary>DQL parser fails to parse alias in select expression named &quot;count&quot;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Oct 2011 10:15:57 +0000</created>
                <updated>Sun, 16 Oct 2011 03:29:38 +0000</updated>
                    <resolved>Sun, 16 Oct 2011 03:29:38 +0000</resolved>
                            <version>2.1.1</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16613" author="guilhermeblanco" created="Sun, 16 Oct 2011 03:29:38 +0000"  >&lt;p&gt;COUNT is considered a keyword in other drivers, so this issue is not solvable.&lt;br/&gt;
Please avoid to use keywords as part of your DQL, or you&apos;ll experience this issue.&lt;/p&gt;

&lt;p&gt;It&apos;s not possible to fix and we already give the hint to the users to not use tokens as identifiers. You&apos;re in your will by doing that.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1362] Native SQL with addJoinedEntityResult()  causes wrong mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1362</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Order of fields in the native select query and order of result set mapping should be in the same order, otherwise wrong mapping is happening.&lt;/p&gt;

&lt;p&gt;I have faced problem with my code. I am explaining the issue with the simple code&lt;/p&gt;


&lt;p&gt;$sql =&quot;&lt;br/&gt;
SELECT&lt;br/&gt;
    a.id as aid,&lt;br/&gt;
    a.city_name,&lt;br/&gt;
    a.country_name,&lt;br/&gt;
    u.id as uid,&lt;br/&gt;
    u.name,&lt;br/&gt;
    u.age&lt;br/&gt;
FROM&lt;br/&gt;
    user as u&lt;br/&gt;
JOIN&lt;br/&gt;
    address as a&lt;br/&gt;
ON&lt;br/&gt;
    u.address_id=a.id&quot;;&lt;/p&gt;



&lt;p&gt;$rsm = new ResultSetMapping;&lt;/p&gt;

&lt;p&gt;$rsm-&amp;gt;addEntityResult(&apos;models\User&apos;, &apos;u&apos;);&lt;br/&gt;
$rsm-&amp;gt;addFieldResult(&apos;u&apos;, &apos;uid&apos;, &apos;id&apos;);&lt;br/&gt;
$rsm-&amp;gt;addFieldResult(&apos;u&apos;, &apos;name&apos;, &apos;name&apos;);&lt;br/&gt;
$rsm-&amp;gt;addFieldResult(&apos;u&apos;, &apos;age&apos;, &apos;age&apos;);&lt;/p&gt;

&lt;p&gt;$rsm-&amp;gt;addJoinedEntityResult(&apos;models\Address&apos;, &apos;a&apos;, &apos;u&apos;, &apos;address&apos;);&lt;/p&gt;

&lt;p&gt;$rsm-&amp;gt;addFieldResult(&apos;a&apos;, &apos;aid&apos;, &apos;id&apos;);&lt;br/&gt;
$rsm-&amp;gt;addFieldResult(&apos;a&apos;, &apos;city_name&apos;, &apos;city_name&apos;);&lt;br/&gt;
$rsm-&amp;gt;addFieldResult(&apos;a&apos;, &apos;country_name&apos;, &apos;country_name&apos;);&lt;/p&gt;


&lt;p&gt;$query = $this-&amp;gt;_em-&amp;gt;createNativeQuery($sql, $rsm);&lt;br/&gt;
return $query-&amp;gt;getResult();      &lt;/p&gt;



&lt;p&gt;As in the code, the select clause column ordering and result set mapping orders are reversed. It causes the wrong mapping as follows&lt;/p&gt;

&lt;p&gt;The wrong mapping happens as follows&lt;/p&gt;

&lt;p&gt;user1 =&amp;gt; address2&lt;br/&gt;
user2 =&amp;gt; address3&lt;br/&gt;
user3 =&amp;gt; null&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;NOTE: address1 missing and see the wrong mapping&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;instead of the correct mapping as&lt;/p&gt;

&lt;p&gt;user1=&amp;gt;address1&lt;br/&gt;
user2=&amp;gt;address2&lt;br/&gt;
user3=&amp;gt;address3&lt;/p&gt;</description>
                <environment>Ubuntu</environment>
            <key id="12996">DDC-1362</key>
            <summary>Native SQL with addJoinedEntityResult()  causes wrong mapping</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="5">Cannot Reproduce</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ramandv">Venkatraman Dhamodaran</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Sep 2011 17:37:22 +0000</created>
                <updated>Thu, 15 Mar 2012 22:32:42 +0000</updated>
                    <resolved>Thu, 15 Mar 2012 22:32:42 +0000</resolved>
                            <version>2.0.5</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17295" author="fabio.bat.silva" created="Tue, 17 Jan 2012 13:34:44 +0000"  >&lt;p&gt;hi Venkatraman,&lt;/p&gt;

&lt;p&gt;I can&apos;t reproduce..&lt;/p&gt;

&lt;p&gt;i&apos;m attaching a test-case with a working scenario.&lt;br/&gt;
Please, Can you adapt this to your situation and try to make it fail ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="17602" author="asm89" created="Thu, 15 Mar 2012 22:32:42 +0000"  >&lt;p&gt;Closing until someone can provide more information.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11152" name="DDC1362Test.php" size="3819" author="fabio.bat.silva" created="Tue, 17 Jan 2012 13:34:44 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1303] Adding casts on EntityGenerator&apos;s generated setters could improve the Database hitting</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1303</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As i mentionned here: &lt;a href=&quot;https://groups.google.com/d/topic/doctrine-dev/ovDQzb9JM74/discussion&quot; class=&quot;external-link&quot;&gt;https://groups.google.com/d/topic/doctrine-dev/ovDQzb9JM74/discussion&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine you have some boolean, like &quot;archived&quot;, the code that EntityGenerator generated is like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;MyEntity.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setArchived($archived)
{
   $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;archived = $archived;
}

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

&lt;p&gt;Now, imagine I use some forms logics to archive the object, I&apos;ll pass &quot;1&quot; to setArchived.&lt;br/&gt;
Doctrine will hit the database even if the flag is already setted to true because the boolean True is different from &quot;1&quot;.&lt;/p&gt;

&lt;p&gt;So, I think it would be better if Doctrine generates the following:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;MyEntity.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setArchived($archived)
{
   $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;archived = (&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; === $archived) ? &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; : (bool)$archived;
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12868">DDC-1303</key>
            <summary>Adding casts on EntityGenerator&apos;s generated setters could improve the Database hitting</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gregwar">Gr&#233;goire Passault</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Jul 2011 20:24:29 +0000</created>
                <updated>Sun, 11 Mar 2012 20:59:46 +0000</updated>
                    <resolved>Sun, 11 Mar 2012 20:59:46 +0000</resolved>
                            <version>Git Master</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16231" author="gregwar" created="Fri, 29 Jul 2011 20:34:06 +0000"  >&lt;p&gt;I wrote it here:&lt;br/&gt;
&lt;a href=&quot;https://github.com/Gregwar/doctrine2/commit/a19529713d2c99f1b1e1ccb8ed4ffaedd2094d6f&quot; class=&quot;external-link&quot;&gt;https://github.com/Gregwar/doctrine2/commit/a19529713d2c99f1b1e1ccb8ed4ffaedd2094d6f&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The casts are disabled by defaults (in both EntityGenerator and Command line)&lt;/p&gt;</comment>
                    <comment id="17547" author="asm89" created="Sun, 11 Mar 2012 20:59:46 +0000"  >&lt;p&gt;The entity generation stuff will be replaced by a new generation project in the future (which is way more flexible):&lt;br/&gt;
&lt;a href=&quot;https://github.com/beberlei/DoctrineCodeGenerator&quot; class=&quot;external-link&quot;&gt;https://github.com/beberlei/DoctrineCodeGenerator&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2094] [GH-488] Fix DDC-2079</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2094</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/488&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/488&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-2079&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2079&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14152">DDC-2094</key>
            <summary>[GH-488] Fix DDC-2079</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Oct 2012 18:45:46 +0000</created>
                <updated>Sun, 21 Oct 2012 03:19:10 +0000</updated>
                    <resolved>Sun, 21 Oct 2012 03:19:10 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18853" author="beberlei" created="Sun, 21 Oct 2012 03:00:10 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-488&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/488&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/488&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18857" author="fabio.bat.silva" created="Sun, 21 Oct 2012 03:19:10 +0000"  >&lt;p&gt;Merged&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2095] [GH-489] Fixed coding standards in the Tools namespace</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2095</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 stof:&lt;/p&gt;

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

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

&lt;p&gt;This also fixes some command exit code in case of failure and removes an unused private method&lt;/p&gt;</description>
                <environment></environment>
            <key id="14155">DDC-2095</key>
            <summary>[GH-489] Fixed coding standards in the Tools namespace</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 22 Oct 2012 00:00:22 +0000</created>
                <updated>Sun, 4 Nov 2012 20:25:15 +0000</updated>
                    <resolved>Sun, 4 Nov 2012 20:25:10 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18912" author="beberlei" created="Sat, 3 Nov 2012 17:04:19 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-489&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/489&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/489&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2092] [GH-487] Fix DDC-2069</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2092</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/487&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/487&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-2069&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-2069&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="14149">DDC-2092</key>
            <summary>[GH-487] Fix DDC-2069</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Oct 2012 03:32:05 +0000</created>
                <updated>Sun, 21 Oct 2012 03:19:38 +0000</updated>
                    <resolved>Sun, 21 Oct 2012 03:19:38 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18854" author="beberlei" created="Sun, 21 Oct 2012 03:01:01 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-487&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/487&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/487&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18858" author="fabio.bat.silva" created="Sun, 21 Oct 2012 03:19:38 +0000"  >&lt;p&gt;Merged&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2074] ManyToManyPersister not found in the chain configured namespaces</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2074</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The error is: &quot;The class &apos;Doctrine\ORM\Persisters\ManyToManyPersister&apos; was not found in the chain configured namespaces&quot;&lt;/p&gt;

&lt;p&gt;Replicate by making an entity which has a property which is self referencing; e.g. &lt;a href=&quot;http://docs.doctrine-project.org/en/latest/reference/association-mapping.html#many-to-many-self-referencing&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/latest/reference/association-mapping.html#many-to-many-self-referencing&lt;/a&gt; . &lt;/p&gt;

&lt;p&gt;For example an Album could be related to any other similar albums. An album entity would have a property &apos;relatedAlbums&apos; which is an ArrayCollection. Similarly, I could be working on a CMS where any piece of content could be related to any other in order to show a &quot;related content&quot; or &quot;related posts&quot; style list on a web page.&lt;/p&gt;

&lt;p&gt;Using Symfony 2.1 and a Symfony Form with FormBuilder make sure to use the &apos;by_reference&apos; =&amp;gt; false to call the setter for the property. In the setter for the property: &lt;a href=&quot;https://gist.github.com/3879169&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/3879169&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A similar question has been asked on StackOverflow: &lt;a href=&quot;http://stackoverflow.com/questions/12077084/doctrine2-manytomany-self-referencing&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/12077084/doctrine2-manytomany-self-referencing&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Symfony 2.1</environment>
            <key id="14124">DDC-2074</key>
            <summary>ManyToManyPersister not found in the chain configured namespaces</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="bendihossan">Steffan Harries</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Oct 2012 13:08:51 +0000</created>
                <updated>Sun, 25 Nov 2012 20:10:52 +0000</updated>
                    <resolved>Sun, 25 Nov 2012 20:10:52 +0000</resolved>
                            <version>2.2.3</version>
                                <fixVersion>2.3.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18831" author="beberlei" created="Fri, 12 Oct 2012 17:58:22 +0000"  >&lt;p&gt;I need a stacktrace for this error, i have no clue why this happens and where.&lt;/p&gt;</comment>
                    <comment id="18836" author="bendihossan" created="Mon, 15 Oct 2012 08:22:14 +0000"  >&lt;p&gt;Stack Trace:&lt;/p&gt;

&lt;p&gt;The class &apos;Doctrine\ORM\Persisters\ManyToManyPersister&apos; was not found in the chain configured namespaces Gedmo\Tree\Entity, Gedmo\Translatable\Entity, MyProject\Bundle\AdminBundle\Entity, MyProject\Bundle\Common\SiteBundle\Entity, MyProject\Bundle\Common\ContentBundle\Entity, FOS\UserBundle\Entity&lt;/p&gt;

&lt;p&gt;500 Internal Server Error - MappingException&lt;/p&gt;

&lt;p&gt;Stack Trace&lt;/p&gt;

&lt;p&gt;in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php at line 38   &lt;br/&gt;
     */&lt;br/&gt;
    public static function classNotFoundInNamespaces($className, $namespaces)&lt;/p&gt;
    {
        return new self(&quot;The class &apos;&quot; . $className . &quot;&apos; was not found in the &quot;.
            &quot;chain configured namespaces &quot; . implode(&quot;, &quot;, $namespaces));
    }
&lt;p&gt;at MappingException ::classNotFoundInNamespaces (&apos;Doctrine\ORM\Persisters\ManyToManyPersister&apos;, array(&apos;Gedmo\Tree\Entity&apos;, &apos;Gedmo\Translatable\Entity&apos;, &apos;MyProject\Bundle\AdminBundle\Entity&apos;, &apos;MyProject\Bundle\Common\SiteBundle\Entity&apos;, &apos;MyProject\Bundle\Common\ContentBundle\Entity&apos;, &apos;FOS\UserBundle\Entity&apos;)) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php at line 114   &lt;br/&gt;
at MappingDriverChain -&amp;gt;loadMetadataForClass (&apos;Doctrine\ORM\Persisters\ManyToManyPersister&apos;, object(ClassMetadata)) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php at line 112   &lt;br/&gt;
at ClassMetadataFactory -&amp;gt;doLoadMetadata (object(ClassMetadata), null, false, array()) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php at line 302   &lt;br/&gt;
at AbstractClassMetadataFactory -&amp;gt;loadMetadata (&apos;Doctrine\ORM\Persisters\ManyToManyPersister&apos;) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php at line 205   &lt;br/&gt;
at AbstractClassMetadataFactory -&amp;gt;getMetadataFor (&apos;Doctrine\ORM\Persisters\ManyToManyPersister&apos;) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 268   &lt;br/&gt;
at EntityManager -&amp;gt;getClassMetadata (&apos;Doctrine\ORM\Persisters\ManyToManyPersister&apos;) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php at line 169   &lt;br/&gt;
at ManyToManyPersister -&amp;gt;_getDeleteSQL (object(PersistentCollection)) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php at line 89   &lt;br/&gt;
at AbstractCollectionPersister -&amp;gt;delete (object(PersistentCollection)) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 328   &lt;br/&gt;
at UnitOfWork -&amp;gt;commit (null) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 355   &lt;br/&gt;
at EntityManager -&amp;gt;flush (null) &lt;br/&gt;
in kernel.root_dir/cache/dev/jms_diextra/doctrine/EntityManager_5075974d574d6.php at line 362   &lt;br/&gt;
at EntityManager -&amp;gt;flush () &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/src/MyProjectBundle/Common/ContentBundle/Controller/ContentController.php at line 170   &lt;br/&gt;
at ContentController -&amp;gt;updateAction (object(Request), &apos;3&apos;)&lt;br/&gt;
at call_user_func_array (array(object(ContentController), &apos;updateAction&apos;), array(object(Request), &apos;3&apos;)) &lt;br/&gt;
in kernel.root_dir/bootstrap.php.cache at line 1421   &lt;br/&gt;
at HttpKernel -&amp;gt;handleRaw (object(Request), &apos;1&apos;) &lt;br/&gt;
in kernel.root_dir/bootstrap.php.cache at line 1385   &lt;br/&gt;
at HttpKernel -&amp;gt;handle (object(Request), &apos;1&apos;, true) &lt;br/&gt;
in kernel.root_dir/bootstrap.php.cache at line 1561   &lt;br/&gt;
at HttpKernel -&amp;gt;handle (object(Request), &apos;1&apos;, true) &lt;br/&gt;
in kernel.root_dir/bootstrap.php.cache at line 612   &lt;br/&gt;
at Kernel -&amp;gt;handle (object(Request)) &lt;br/&gt;
in /opt/local/apache2/htdocs/projects/my-project/web/app_dev.php at line 28  &lt;/p&gt;</comment>
                    <comment id="19061" author="beberlei" created="Sun, 25 Nov 2012 20:10:52 +0000"  >&lt;p&gt;Ok apparently this is fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2033] Merge with multiple Associations to the same Entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2033</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Let&apos;s say we have 2 Entities. User and Group and there&apos;s a ManyToMany Assocication and an additional ManyToOne (User as owning side and no inverse).&lt;/p&gt;

&lt;p&gt;So a User can have as many Groups as he likes and one another with the ManyToOne Association which can be also in the ManyToMany Collection. (Could be the MainGroup or something)&lt;/p&gt;

&lt;p&gt;I create a User and add a Group(already in DB) and set the same as the ManyToOne and Merge it. Everything works fine as long as the Group in ManyToOne Association is not in the ManyToMany. &lt;/p&gt;

&lt;p&gt;If I var_dump the merged entity i can already see that one association is empty.&lt;/p&gt;

&lt;p&gt;It looks like doctrine is writing just one association of that Group preferring which one comes first. So if i change the position of the properties in the class the written association changes, but doctrine never writes both.&lt;/p&gt;

&lt;p&gt;The reason why I use merge is that I normally store the entity in the session and merge and flush it in another request. But this also happens in the same Request.&lt;/p&gt;

&lt;p&gt;In the UnitofWork at Line 2050 and 2053 are the responsible doMerge Calls for as CascadeMerge Tagged Associations. If Doctrine gets there in the first place the doMerge for the Group is running through. In the Second call when the Group is again associated with the user the doMerge already exits at line 1658. That&apos;s ok but I think there&apos;s something missing so doctrine isn&apos;t creating the association.&lt;/p&gt;

&lt;p&gt;The Mentioned Entites are attached&lt;/p&gt;</description>
                <environment>Symfony 2.1.1, Ubuntu, PHP 5.3.5</environment>
            <key id="14044">DDC-2033</key>
            <summary>Merge with multiple Associations to the same Entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="soeren.j">s&#246;ren jahns</reporter>
                        <labels>
                        <label>merge</label>
                    </labels>
                <created>Mon, 17 Sep 2012 14:29:20 +0000</created>
                <updated>Wed, 23 Jan 2013 22:06:58 +0000</updated>
                    <resolved>Wed, 23 Jan 2013 22:06:58 +0000</resolved>
                            <version>2.2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19380" author="ocramius" created="Wed, 23 Jan 2013 22:06:58 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1942&quot; title=&quot;problem with serialize/merging entities with aggregation&quot;&gt;&lt;del&gt;DDC-1942&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11323" name="Group.php" size="485" author="soeren.j" created="Mon, 17 Sep 2012 14:29:20 +0000" />
                    <attachment id="11324" name="User.php" size="951" author="soeren.j" created="Mon, 17 Sep 2012 14:29:20 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1985] Call to undefined method ProxyException::proxyDirectoryNotWritable</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1985</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I think it&apos;s fairly self explanatory, didn&apos;t supply a patch since I had no idea what text you wanted there &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;PHP Fatal error:  Call to undefined method Doctrine\ORM\Proxy\ProxyException::proxyDirectoryNotWritable() in .../orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php on line 193&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment></environment>
            <key id="13968">DDC-1985</key>
            <summary>Call to undefined method ProxyException::proxyDirectoryNotWritable</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="dynom">Mark van der Velden</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Aug 2012 15:19:55 +0000</created>
                <updated>Fri, 17 Aug 2012 04:51:01 +0000</updated>
                    <resolved>Fri, 17 Aug 2012 04:51:01 +0000</resolved>
                            <version>2.2.3</version>
                                <fixVersion>2.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18521" author="guilhermeblanco" created="Fri, 17 Aug 2012 04:51:01 +0000"  >&lt;p&gt;This issue is already fixed in master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1669] [GH-289] by isanosyan: Preserve camelcase when mapping existing database</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1669</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/289&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/289&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;CamelCase is now preserved when importing entities from existing database using Symfony&apos;s command &lt;/p&gt;

&lt;p&gt;php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force&lt;/p&gt;</description>
                <environment></environment>
            <key id="13478">DDC-1669</key>
            <summary>[GH-289] by isanosyan: Preserve camelcase when mapping existing database</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="4">Incomplete</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Feb 2012 23:59:31 +0000</created>
                <updated>Wed, 11 Jul 2012 20:00:15 +0000</updated>
                    <resolved>Wed, 11 Jul 2012 20:00:15 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17633" author="beberlei" created="Thu, 22 Mar 2012 22:07:12 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-289&amp;#93;&lt;/span&gt; was &lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/289&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/289&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1656] fetch mode EXTRA_LAZY does not do a IN(1, 2, 3, ...) merge type query to fetch OneToMany results </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1656</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using the fetch mode EXTRA_LAZY does not produce a SQL query to fetch all OneToMany relationship results via  a IN(1, 2, 3, ...) type merged query, instead it does one query per row in the result set. &lt;/p&gt;

&lt;p&gt;First query to obtain all the pages&lt;/p&gt;

&lt;p&gt;SELECT t0.page_id AS page_id1, t0.name AS name2, t0.text AS text3, t0.url AS url4, t0.revision_id AS revision_id5, t0.owner_id AS owner_id6, t0.is_active AS is_active7 FROM pages t0 &lt;/p&gt;

&lt;p&gt;then for each row in that result set&lt;/p&gt;

&lt;p&gt;SELECT t0.attribute_id AS attribute_id1, t0.page_id AS page_id2, t0.key AS key3, t0.value AS value4, t0.page_id AS page_id5 FROM page_attributes t0 WHERE t0.page_id = ?&lt;/p&gt;

&lt;p&gt;What is desired is a query like this, &lt;/p&gt;

&lt;p&gt;SELECT t0.attribute_id AS attribute_id1, t0.page_id AS page_id2, t0.key AS key3, t0.value AS value4, t0.page_id AS page_id5 FROM page_attributes t0 WHERE t0.page_id IN(1, 2, 3, ...)&lt;/p&gt;

&lt;p&gt;to obtain all the attributes for the pages, after the first original page query.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13458">DDC-1656</key>
            <summary>fetch mode EXTRA_LAZY does not do a IN(1, 2, 3, ...) merge type query to fetch OneToMany results </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="des.hymers">des hymers</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Feb 2012 20:43:03 +0000</created>
                <updated>Fri, 17 Feb 2012 21:26:44 +0000</updated>
                    <resolved>Fri, 17 Feb 2012 21:01:54 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17432" author="des.hymers" created="Fri, 17 Feb 2012 20:47:25 +0000"  >&lt;p&gt;had a typo in the file I uploaded, corrected now&lt;/p&gt;</comment>
                    <comment id="17433" author="asm89" created="Fri, 17 Feb 2012 21:26:44 +0000"  >&lt;p&gt;Closed as invalid, because this is the ORM working as intended. First all the PageEntity objects are loaded. Next there is a loop over all the objects, with an inner loop on the &quot;attributes&quot; association. These attributes are lazy loaded for each individual page, hence 1 query for all the pages and n queries for all the attributes of the pages.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11163" name="d2_bugreportcode.txt" size="2738" author="des.hymers" created="Fri, 17 Feb 2012 20:47:24 +0000" />
                    <attachment id="11162" name="d2_bugreportcode.txt" size="2733" author="des.hymers" created="Fri, 17 Feb 2012 20:43:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1650] PHP 5.3.2 compatibility</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1650</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When triggering travis build under PHP 5.3.2, the build fails.&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;Fatal error: Class &apos;\Doctrine\Tests\DbalTypes\UpperCaseStringType&apos; not found in /home/vagrant/builds/ooflorent/doctrine2/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Types/Type.php on line 144&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Call Stack:&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;1. {main}() /home/vagrant/.phpenv/versions/5.3.2/bin/phpunit:0
2. PHPUnit_TextUI_Command::main() /home/vagrant/.phpenv/versions/5.3.2/bin/phpunit:46
3. PHPUnit_TextUI_Command-&amp;gt;run() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/TextUI/Command.php:130
4. PHPUnit_TextUI_TestRunner-&amp;gt;doRun() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/TextUI/Command.php:192
5. PHPUnit_Framework_TestSuite-&amp;gt;run() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/TextUI/TestRunner.php:325
6. PHPUnit_Framework_TestSuite-&amp;gt;run() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/Framework/TestSuite.php:705
7. PHPUnit_Framework_TestSuite-&amp;gt;runTest() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/Framework/TestSuite.php:745
8. PHPUnit_Framework_TestCase-&amp;gt;run() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/Framework/TestSuite.php:772
9. PHPUnit_Framework_TestResult-&amp;gt;run() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/Framework/TestCase.php:751
10. PHPUnit_Framework_TestCase-&amp;gt;runBare() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/Framework/TestResult.php:649
11. Doctrine\Tests\ORM\Functional\TypeValueSqlTest-&amp;gt;setUp() /home/vagrant/.phpenv/versions/5.3.2/share/pyrus/.pear/php/PHPUnit/Framework/TestCase.php:801
12. Doctrine\Tests\OrmFunctionalTestCase-&amp;gt;setUp() /home/vagrant/builds/ooflorent/doctrine2/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php:
13. Doctrine\ORM\EntityManager-&amp;gt;getClassMetadata() /home/vagrant/builds/ooflorent/doctrine2/tests/Doctrine/Tests/OrmFunctionalTestCase.php:272
14. Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;getMetadataFor() /home/vagrant/builds/ooflorent/doctrine2/lib/Doctrine/ORM/EntityManager.php:269
15. Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;loadMetadata() /home/vagrant/builds/ooflorent/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
16. Doctrine\ORM\Mapping\Driver\AnnotationDriver-&amp;gt;loadMetadataForClass() /home/vagrant/builds/ooflorent/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:293
17. Doctrine\ORM\Mapping\ClassMetadataInfo-&amp;gt;mapField() /home/vagrant/builds/ooflorent/doctrine2/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php:327
18. Doctrine\ORM\Mapping\ClassMetadataInfo-&amp;gt;_validateAndCompleteFieldMapping() /home/vagrant/builds/ooflorent/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1735
19. Doctrine\DBAL\Types\Type::getType() /home/vagrant/builds/ooflorent/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1074&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>php 5.3.2</environment>
            <key id="13444">DDC-1650</key>
            <summary>PHP 5.3.2 compatibility</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="5">Cannot Reproduce</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="ooflorent">Florent Cailhol</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Feb 2012 14:08:09 +0000</created>
                <updated>Wed, 11 Jul 2012 18:00:36 +0000</updated>
                    <resolved>Wed, 11 Jul 2012 18:00:36 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17449" author="beberlei" created="Mon, 20 Feb 2012 08:49:06 +0000"  >&lt;p&gt;Does this only fail exactly with 5.3.2? What could be the issue?&lt;/p&gt;</comment>
                    <comment id="17732" author="ocramius" created="Tue, 3 Apr 2012 00:46:03 +0000"  >&lt;p&gt;Also, knowing the travis build url could help &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="17796" author="ooflorent" created="Fri, 6 Apr 2012 15:43:12 +0000"  >&lt;p&gt;Sorry about the long inactivity period...&lt;br/&gt;
The travis build URL is &lt;a href=&quot;http://travis-ci.org/#!/ooflorent/doctrine2&quot; class=&quot;external-link&quot;&gt;http://travis-ci.org/#!/ooflorent/doctrine2&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18243" author="ocramius" created="Sun, 8 Jul 2012 15:49:38 +0000"  >&lt;p&gt;I think this may be solved.in DBAL by putting a `trim()` at &lt;a href=&quot;https://github.com/doctrine/dbal/blob/1ca9db4f437797c6bdc04a3a761d61e24150e20b/lib/Doctrine/DBAL/Types/Type.php#L170&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/blob/1ca9db4f437797c6bdc04a3a761d61e24150e20b/lib/Doctrine/DBAL/Types/Type.php#L170&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18273" author="ocramius" created="Tue, 10 Jul 2012 19:17:09 +0000"  >&lt;p&gt;Couldn&apos;t reproduce on 5.3.2, and seems like the build points to a non existing repository (you have deleted it from your github).&lt;br/&gt;
What did you alter exactly? Do you remember that?&lt;br/&gt;
Because with the same call stack, and having verified that `class_exists(&apos;Doctrine\Tests\DbalTypes\UpperCaseStringType&apos;, false) === false` before that call to `Doctrine\DBAL\Types\Type::getType()` it doesn&apos;t cause the fatal.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1626] Refreshing an entity after disabling a filter has no effect</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1626</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The situation:&lt;/p&gt;

&lt;p&gt;I have a Person with a 1-to-1 relation to User, fetch mode is EAGER. The user has a deleted flag, which in this case is set to true. The filter automatically adds a &quot;deleted = 0&quot; to the join query&lt;/p&gt;

&lt;p&gt;I wish to fetch the user anyway, so I disable the filter and execute a refresh:&lt;/p&gt;

&lt;p&gt;$em-&amp;gt;getFilters()-&amp;gt;disable(&apos;soft_delete&apos;);&lt;br/&gt;
$em-&amp;gt;refresh($person);&lt;/p&gt;

&lt;p&gt;Unfortunately, this doesn&apos;t work as the left join part of the query is saved line 971 through 973 in BasicEntityPersister:&lt;/p&gt;

&lt;p&gt;if ($this-&amp;gt;_selectColumnListSql !== null) {&lt;br/&gt;
  return $this-&amp;gt;_selectColumnListSql;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;if I remove these lines, everything works fine...&lt;/p&gt;</description>
                <environment></environment>
            <key id="13399">DDC-1626</key>
            <summary>Refreshing an entity after disabling a filter has no effect</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="burgov">Bart van den Burg</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Jan 2012 15:34:50 +0000</created>
                <updated>Mon, 30 Jan 2012 15:59:45 +0000</updated>
                    <resolved>Mon, 30 Jan 2012 15:41:51 +0000</resolved>
                            <version>2.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17354" author="asm89" created="Mon, 30 Jan 2012 15:41:35 +0000"  >&lt;p&gt;I had a short discussion about this. The problem isn&apos;t easily solved by the &quot;fix&quot; you provide. It&apos;s very complicated to fix it for all use-cases if you already have objects.&lt;/p&gt;

&lt;p&gt;If you change your filter settings, you should clear the em and refetch your object(s). I&apos;ll put a big WARNING about this in the upcoming docs.&lt;/p&gt;</comment>
                    <comment id="17356" author="burgov" created="Mon, 30 Jan 2012 15:59:45 +0000"  >&lt;p&gt;I realise that my fix was not the way to go, it was just a quick fix to show the source of the problem&lt;/p&gt;

&lt;p&gt;clearing the EM has way too big consequences at the position where I&apos;d have to do it. If the only way to fetch &quot;deleted&quot; objects is by clearing the whole EM, then filters unfortunately are unusable for me. I hope a fix for this will be implemented at some point&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1625] proxy initialized when accessing identifier on extending class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1625</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The proxy is always initialized when the entity is extending another class and that parent class has get&amp;lt;IDENTIFIER&amp;gt; method&lt;/p&gt;</description>
                <environment></environment>
            <key id="13398">DDC-1625</key>
            <summary>proxy initialized when accessing identifier on extending class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Jan 2012 10:41:43 +0000</created>
                <updated>Sun, 5 Feb 2012 10:46:05 +0000</updated>
                    <resolved>Sun, 5 Feb 2012 10:46:05 +0000</resolved>
                            <version>2.2</version>
                <version>Git Master</version>
                                <fixVersion>2.2.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17353" author="mvrhov" created="Mon, 30 Jan 2012 11:16:06 +0000"  >&lt;p&gt;Fix: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/274&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/274&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17355" author="asm89" created="Mon, 30 Jan 2012 15:54:28 +0000"  >&lt;p&gt;Re-opening this ticket as a reminder for Benjamin to backport the fix to 2.2.&lt;/p&gt;</comment>
                    <comment id="17371" author="beberlei" created="Sun, 5 Feb 2012 10:46:05 +0000"  >&lt;p&gt;Merged into 2.2, See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1634&quot; title=&quot;Lazy Proxy ID Method on Inheritance Entities not working&quot;&gt;&lt;del&gt;DDC-1634&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1591] Paginator: ResultVariable cannot be used in HavingClause</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1591</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using the QueryBuilder, I&apos;m getting the message&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Notice: Undefined index: distance in vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php line 2128
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;when trying to add a &quot;having&quot; clause for the field &quot;distance&quot;, which is defined in the &quot;select&quot; part of the statement:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$queryBuilder
    -&amp;gt;select(&apos;myEntity, MY_FUNCTION() AS distance&apos;)
    -&amp;gt;having(&apos;distance &amp;lt;= 10&apos;)
;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13346">DDC-1591</key>
            <summary>Paginator: ResultVariable cannot be used in HavingClause</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="craue">Christian Raue</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Jan 2012 23:35:34 +0000</created>
                <updated>Thu, 15 Mar 2012 22:22:50 +0000</updated>
                    <resolved>Thu, 15 Mar 2012 22:22:50 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17245" author="fabio.bat.silva" created="Sat, 14 Jan 2012 16:52:27 +0000"  >&lt;p&gt;Christian, I couldn&apos;t reproduce.&lt;/p&gt;

&lt;p&gt;Can you give more details ?&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="17253" author="craue" created="Sun, 15 Jan 2012 14:24:14 +0000"  >&lt;p&gt;I tried it again and found out that it could also be an issue in &lt;a href=&quot;https://github.com/whiteoctober/Pagerfanta&quot; class=&quot;external-link&quot;&gt;https://github.com/whiteoctober/Pagerfanta&lt;/a&gt; rather in Doctrine itself because my query is passed to that pager to show a sliced result. Maybe that issue could already be resolved by &lt;a href=&quot;https://github.com/whiteoctober/Pagerfanta/pull/46&quot; class=&quot;external-link&quot;&gt;https://github.com/whiteoctober/Pagerfanta/pull/46&lt;/a&gt;. Will give it a try...&lt;/p&gt;</comment>
                    <comment id="17256" author="craue" created="Sun, 15 Jan 2012 14:31:36 +0000"  >&lt;p&gt;In fact, applying that patch made the query work. So this is not a Doctrine issue.&lt;/p&gt;</comment>
                    <comment id="17395" author="craue" created="Fri, 10 Feb 2012 17:55:22 +0000"  >&lt;p&gt;Since the PR mentioned was not merged and Doctrine&apos;s pagination is used now, the issue still exists and I cannot use a result variable in a &quot;having&quot; clause. But I&apos;d like to. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="17396" author="stof" created="Fri, 10 Feb 2012 17:57:05 +0000"  >&lt;p&gt;This ticket is indeed invalid as it is talking about the query builder. Please open a dedicated ticket for the pagination issue&lt;/p&gt;</comment>
                    <comment id="17397" author="craue" created="Fri, 10 Feb 2012 18:05:38 +0000"  >&lt;p&gt;But I am using the QueryBuilder and then passing the query to a DoctrineORMAdapter instance. The error message didn&apos;t change, just the line number:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Notice: Undefined index: distance in vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php line 2142
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But I can confirm that this error doesn&apos;t occur when not using a paginator. How to continue?&lt;/p&gt;</comment>
                    <comment id="17399" author="beberlei" created="Fri, 10 Feb 2012 20:30:25 +0000"  >&lt;p&gt;Which paginator are you using?&lt;/p&gt;</comment>
                    <comment id="17402" author="craue" created="Fri, 10 Feb 2012 20:33:55 +0000"  >&lt;p&gt;Still &lt;a href=&quot;https://github.com/whiteoctober/Pagerfanta/&quot; class=&quot;external-link&quot;&gt;https://github.com/whiteoctober/Pagerfanta/&lt;/a&gt; &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="17456" author="beberlei" created="Mon, 20 Feb 2012 10:44:55 +0000"  >&lt;p&gt;Renamed and assigned issue.&lt;/p&gt;</comment>
                    <comment id="17601" author="asm89" created="Thu, 15 Mar 2012 22:22:50 +0000"  >&lt;p&gt;Fixed as sander was kind enough to resubmit the code to the doctrine2 repository now instead:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/298&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/298&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1948] Lazy Loading on Many To One association does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1948</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Create a many to one relationship with lazy loading as exposed there :&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/7599007/lazy-loading-properties-not-loading-in-doctrine-2-0&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/7599007/lazy-loading-properties-not-loading-in-doctrine-2-0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that the relationship does not load while it should.&lt;/p&gt;

&lt;p&gt;The problem is always reproducible.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13884">DDC-1948</key>
            <summary>Lazy Loading on Many To One association does not work</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="4">Incomplete</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="julien.aubin">Julien AUBIN</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Jul 2012 13:28:52 +0000</created>
                <updated>Thu, 21 Feb 2013 10:18:27 +0000</updated>
                    <resolved>Thu, 21 Feb 2013 10:18:26 +0000</resolved>
                            <version>2.1.7</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18404" author="beberlei" created="Sun, 29 Jul 2012 08:52:49 +0000"  >&lt;p&gt;I need more information. The mapping of both entities, and a \Doctrine\Common\Utils\Debug::dump() of the $source entity when its a proxy. Also it would be helpful to have an SQL log which shows the queries executed by your example. Do you use any listeners?&lt;/p&gt;</comment>
                    <comment id="19582" author="ocramius" created="Thu, 21 Feb 2013 10:18:27 +0000"  >&lt;p&gt;Closing as incomplete.&lt;/p&gt;

&lt;p&gt;Please test this with latest master before eventually re-opening&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1936] [GH-404] DDC-1933 - Fixing cloning of QueryBuilder and adding related tests</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1936</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/404&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/404&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This PR fixes &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1933&quot; title=&quot;Problem with parameters when clone Doctrine\ORM\QueryBuilder&quot;&gt;&lt;del&gt;DDC-1933&lt;/del&gt;&lt;/a&gt; and mimics the behaviour of `Doctrine\ORM\AbstractQuery` in `Doctrine\ORM\QueryBuilder` when dealing with assigned parameters and `__clone`.&lt;/p&gt;

</description>
                <environment></environment>
            <key id="13869">DDC-1936</key>
            <summary>[GH-404] DDC-1933 - Fixing cloning of QueryBuilder and adding related tests</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Jul 2012 23:24:12 +0000</created>
                <updated>Mon, 23 Jul 2012 08:35:25 +0000</updated>
                    <resolved>Mon, 23 Jul 2012 08:35:25 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18365" author="beberlei" created="Mon, 23 Jul 2012 05:01:59 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-404&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/404&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/404&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1930] [GH-401] Add Doctrine\Tests in composer autoload</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1930</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 cedriclombardot:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="13862">DDC-1930</key>
            <summary>[GH-401] Add Doctrine\Tests in composer autoload</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Jul 2012 08:29:06 +0000</created>
                <updated>Tue, 17 Jul 2012 09:10:45 +0000</updated>
                    <resolved>Tue, 17 Jul 2012 09:10:45 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18318" author="beberlei" created="Tue, 17 Jul 2012 09:09:07 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-401&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/401&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/401&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1933] Problem with parameters when clone Doctrine\ORM\QueryBuilder</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1933</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi, here problem with cloning \Doctrine\ORM\QueryBuilder&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;Example&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$queryBuilder = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; QueryBuilder($em);

$queryBuilder-&amp;gt;setParameter(&apos;parameter1&apos;, &apos;value1&apos;);

$copy = clone $queryBuilder;
$copy-&amp;gt;setParameter(&apos;parameter2&apos;, &apos;value2&apos;);


count($queryBuilder-&amp;gt;getParameters()) &lt;span class=&quot;code-comment&quot;&gt;// equals 2
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//expects 1
&lt;/span&gt;

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Solution:&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;QueryBuilder&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __clone
{
   ......

   $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;parameters = clone $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;parameters;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment></environment>
            <key id="13865">DDC-1933</key>
            <summary>Problem with parameters when clone Doctrine\ORM\QueryBuilder</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="ghennady">Gandzy Ghennady</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Jul 2012 11:05:31 +0000</created>
                <updated>Mon, 23 Jul 2012 08:36:42 +0000</updated>
                    <resolved>Mon, 23 Jul 2012 08:36:42 +0000</resolved>
                            <version>2.3</version>
                <version>Git Master</version>
                                <fixVersion>Git Master</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18328" author="ocramius" created="Wed, 18 Jul 2012 11:18:40 +0000"  >&lt;p&gt;Is `$copy = clone $queryBuilder();` a typo?&lt;/p&gt;</comment>
                    <comment id="18330" author="ghennady" created="Wed, 18 Jul 2012 14:06:22 +0000"  >&lt;p&gt;Sorry, this is a typo, was meant: $copy = clone $queryBuilder;&lt;/p&gt;</comment>
                    <comment id="18351" author="ocramius" created="Fri, 20 Jul 2012 00:12:16 +0000"  >&lt;p&gt;This is being handled at &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1936&quot; title=&quot;[GH-404] DDC-1933 - Fixing cloning of QueryBuilder and adding related tests&quot;&gt;&lt;del&gt;DDC-1936&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/404&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/404&lt;/a&gt;)&lt;/p&gt;</comment>
                    <comment id="18352" author="ghennady" created="Fri, 20 Jul 2012 06:35:28 +0000"  >&lt;p&gt;Hi. Thanks for the quick response.&lt;/p&gt;

&lt;p&gt;I looked at the changes, and have a question: whether you need to reset the parameters when cloning? Thus broken backward compatibility with versions &amp;lt;2.3.&lt;/p&gt;
</comment>
                    <comment id="18357" author="ocramius" created="Fri, 20 Jul 2012 18:10:08 +0000"  >&lt;p&gt;Actually, I just implemented your expected behaviour (see tests), which is compatible with what the `AbstractQuery` does. It can also be done the other way around, waiting for feedback by &lt;a href=&quot;http://www.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; &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="18358" author="ocramius" created="Fri, 20 Jul 2012 18:43:18 +0000"  >&lt;p&gt;Ah, nevermind. You&apos;re right. Will change my code &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1929] [GH-400] Changed commands to use command.name in the help</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1929</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 stof:&lt;/p&gt;

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

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

&lt;p&gt;The current code does not work for child classes: it gets the name too early as the child has not changed it yet at this point. using ``%command;name%`` replaces it only when the help needs to be displayed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13860">DDC-1929</key>
            <summary>[GH-400] Changed commands to use command.name in the help</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Jul 2012 22:58:31 +0000</created>
                <updated>Mon, 23 Jul 2012 08:33:41 +0000</updated>
                    <resolved>Mon, 23 Jul 2012 08:33:41 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18367" author="beberlei" created="Mon, 23 Jul 2012 05:04:20 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-400&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/400&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/400&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1922] [GH-399] Fix phpdocs</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1922</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 Adel-E:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="13848">DDC-1922</key>
            <summary>[GH-399] Fix phpdocs</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Jul 2012 22:44:43 +0000</created>
                <updated>Wed, 11 Jul 2012 23:43:27 +0000</updated>
                    <resolved>Wed, 11 Jul 2012 23:43:27 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18286" author="beberlei" created="Wed, 11 Jul 2012 22:50:43 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-399&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/399&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/399&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1919] Doctrine fails to escape entity with reserved name in various situations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1919</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have submitted a PR here, fixing part of this issue: &lt;a href=&quot;https://github.com/doctrine/dbal/pull/166&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/166&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, it fails when UPDATE or INSERT is used. I&apos;m using a very simple, and common, entity name: Group. Doctrine is failing to escape this in various situations, causing queries to fail in MySQL due to reserved keywords.&lt;/p&gt;</description>
                <environment>MySQL</environment>
            <key id="13845">DDC-1919</key>
            <summary>Doctrine fails to escape entity with reserved name in various situations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="klaussilveira">Klaus Silveira</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Jul 2012 21:34:08 +0000</created>
                <updated>Thu, 19 Jul 2012 18:27:21 +0000</updated>
                    <resolved>Wed, 11 Jul 2012 19:28:24 +0000</resolved>
                            <version>2.2</version>
                                <fixVersion>2.3</fixVersion>
                <fixVersion>Git Master</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18274" author="ocramius" created="Wed, 11 Jul 2012 00:31:41 +0000"  >&lt;p&gt;Can you try using the quoting strategy in master? By defining an &apos;@Table(name=&quot;`Group`&quot;)&apos; on your entity you should be able to fix this issue by yourself... Anyway, this is only available in latest master.&lt;br/&gt;
Please give it a try and let us know.&lt;/p&gt;</comment>
                    <comment id="18275" author="klaussilveira" created="Wed, 11 Jul 2012 17:27:34 +0000"  >&lt;p&gt;That hack, of course, fixes the problem. However, Doctrine is failing to escape entities with reserved keywords in various different situations and this should be a major problem, specially since there are many keywords that are common table names. Having to change the table name or escape the table name manually is not the best solution.&lt;/p&gt;

&lt;p&gt;I have look through the code but could not find out why getQuotedTableName() is failing to quote the table name &quot;Group&quot;. I fixed the other problem, involving schema creation, but this one i couldn&apos;t fix. That&apos;s why i&apos;m opening the issue, hoping someone with more experience in the ORM codebase manages to fix it.&lt;/p&gt;</comment>
                    <comment id="18276" author="ocramius" created="Wed, 11 Jul 2012 18:04:26 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=klaussilveira&quot; class=&quot;user-hover&quot; rel=&quot;klaussilveira&quot;&gt;Klaus Silveira&lt;/a&gt;, doctrine won&apos;t quote (at least with the default strategy) a table called &quot;Group&quot;. The default strategy will look for the sorrounding &quot;`&quot; (&quot;`Group`&quot;).&lt;br/&gt;
Is it still failing to quote something in latest master? Can you write a simple example of a failure you are getting?&lt;/p&gt;</comment>
                    <comment id="18277" author="klaussilveira" created="Wed, 11 Jul 2012 18:12:48 +0000"  >&lt;p&gt;The failure is caused when querying anything related to an entity wich it&apos;s name is a reserved keyword, for example, an entity called &quot;Group&quot;. I expected Doctrine to quote such table names. &lt;/p&gt;</comment>
                    <comment id="18278" author="ocramius" created="Wed, 11 Jul 2012 18:41:26 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=klaussilveira&quot; class=&quot;user-hover&quot; rel=&quot;klaussilveira&quot;&gt;Klaus Silveira&lt;/a&gt; did you put an @Table(name=&quot;`Group`&quot;) in it?&lt;/p&gt;</comment>
                    <comment id="18279" author="ocramius" created="Wed, 11 Jul 2012 18:48:04 +0000"  >&lt;p&gt;Please note that &lt;/p&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;@Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;)&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;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;@Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`Group`&quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; are quite different. That&apos;s why I&apos;m asking&lt;/p&gt;</comment>
                    <comment id="18280" author="klaussilveira" created="Wed, 11 Jul 2012 19:00:52 +0000"  >&lt;p&gt;As i said, that hack fixes the problem. But i don&apos;t believe that having to change the table name or escape the table name manually is the best solution. Doctrine should be doing that transparently, as it does for other situations (such as during schema creation). Why not during all other operations? Makes no sense at all.&lt;/p&gt;</comment>
                    <comment id="18281" author="ocramius" created="Wed, 11 Jul 2012 19:22:07 +0000"  >&lt;p&gt;This is not a hack... In ORM, &quot;`&quot; is not the MySQL identifier quote. It is exactly thought as a character with which you tell the ORM that the identifier should be quoted.&lt;br/&gt;
The default strategy does make use of it, so please use it.&lt;/p&gt;</comment>
                    <comment id="18282" author="ocramius" created="Wed, 11 Jul 2012 19:27:29 +0000"  >&lt;p&gt;Also, we won&apos;t collect the SQL reserved keywords, nor we can know what keywords are used in all vendors. The patch for the quoting strategy was exactly thought to allow end users to use insecure names for their objects/fields/indexes/etc but without having the ORM implement those checks for them (since it would just be messy and too &quot;magic&quot;).&lt;/p&gt;

&lt;p&gt;Please also reconsider your pull request on github too ( &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-298&quot; title=&quot;[GH-166] Fixes a bug caused by unquoted reserved table name being referenced during schema creation&quot;&gt;&lt;del&gt;DBAL-298&lt;/del&gt;&lt;/a&gt; ).&lt;/p&gt;

&lt;p&gt;I&apos;m closing this one&lt;/p&gt;</comment>
                    <comment id="18283" author="klaussilveira" created="Wed, 11 Jul 2012 19:32:14 +0000"  >&lt;p&gt;Then what&apos;s the purpose of Doctrine\DBAL\Platforms\Keywords\MySQLKeywords?&lt;/p&gt;</comment>
                    <comment id="18284" author="ocramius" created="Wed, 11 Jul 2012 19:38:58 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=klaussilveira&quot; class=&quot;user-hover&quot; rel=&quot;klaussilveira&quot;&gt;Klaus Silveira&lt;/a&gt; not sure, but it isn&apos;t used in ORM.&lt;/p&gt;</comment>
                    <comment id="18339" author="beberlei" created="Thu, 19 Jul 2012 18:27:21 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-166&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/166&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/166&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1915] [GH-396] DDC-1893 - Updating configuration to reflect latest Doctrine Common changes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1915</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/396&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/396&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This PR fixes &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1893&quot; title=&quot;Doctrine\ORM\Mapping\Driver\AnnotationDriver::create() not updated for new annotation readers&quot;&gt;&lt;del&gt;DDC-1893&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1893&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1893&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The `getDefaultAnnotationDriver` method was changes to stop supporting older incompatible Doctrine Common versions in favour of the newer logic.&lt;/p&gt;

&lt;p&gt;Also, changing logic so that the SimpleAnnotationReader is no more the&lt;br/&gt;
default one. An additional parameter for the method will allow using it (this is a &lt;b&gt;BC break&lt;/b&gt;!)&lt;/p&gt;

&lt;p&gt;The CS fixes that were additionally implemented (along with other minor changes&lt;br/&gt;
that do not affect BC compatibility are caused by a CS sniff via IDE.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13833">DDC-1915</key>
            <summary>[GH-396] DDC-1893 - Updating configuration to reflect latest Doctrine Common changes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Jul 2012 13:01:22 +0000</created>
                <updated>Wed, 11 Jul 2012 23:54:17 +0000</updated>
                    <resolved>Sun, 8 Jul 2012 16:26:30 +0000</resolved>
                                            <fixVersion>2.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18246" author="beberlei" created="Sun, 8 Jul 2012 16:26:22 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-396&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/396&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/396&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1900] Impossibility to override built-in SQL functions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1900</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine doesn&apos;t allow to to create own SQL function for DQL if that function is already defined as &quot;built-in&quot;. An example could be custom &lt;tt&gt;DATE_ADD&lt;/tt&gt; implementation.&lt;br/&gt;
Method &lt;tt&gt;FunctionDeclaration()&lt;/tt&gt; in &lt;em&gt;Doctrine\ORM\Query\Parser&lt;/em&gt; gives higher priority to built-in SQL functions, even if they are not&lt;br/&gt;
usable for a specific situation, and registering of own datetime function doesn&apos;t help. This issue makes it  impossible to use some advanced Doctrine extensions, &lt;br/&gt;
for example &lt;a href=&quot;https://github.com/beberlei/DoctrineExtensions&quot; class=&quot;external-link&quot;&gt;https://github.com/beberlei/DoctrineExtensions&lt;/a&gt; that provide fuller implementations.&lt;br/&gt;
Considering the fact that someone may want to use ready components provided by the community, and being new to Doctrine can&apos;t figure out the way to hack&lt;br/&gt;
or workaround this, the issue is a major one.&lt;/p&gt;</description>
                <environment>Any</environment>
            <key id="13810">DDC-1900</key>
            <summary>Impossibility to override built-in SQL functions</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="lex0r">Alex Oroshchuk</reporter>
                        <labels>
                    </labels>
                <created>Sat, 30 Jun 2012 20:00:28 +0000</created>
                <updated>Thu, 5 Jul 2012 19:57:12 +0000</updated>
                    <resolved>Thu, 5 Jul 2012 19:57:12 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18160" author="beberlei" created="Wed, 4 Jul 2012 19:12:20 +0000"  >&lt;p&gt;Just name the method differently.&lt;/p&gt;</comment>
                    <comment id="18182" author="lex0r" created="Thu, 5 Jul 2012 05:52:23 +0000"  >&lt;p&gt;To rename the method one has to &lt;b&gt;KNOW&lt;/b&gt; that he has to rename it, i.e. to know about this issue. &lt;br/&gt;
One has to &lt;b&gt;SPEND hours&lt;/b&gt; (like me) on understanding that there are built-in implementations and other extensions that are meant&lt;br/&gt;
to provide necessary features just don&apos;t work. IMHO it&apos;s just too cruel to leave it as is.&lt;/p&gt;

&lt;p&gt;As to the renaming: is it ok to go and edit source code (change class name at least) provided by someone else and then merge all the sources when new releases appear?&lt;br/&gt;
Is that the only way flexible Doctrine provides? Also, I want DQL to be as close as possible to real SQL. I don&apos;t want to see weird stuff like MY_DATE_ADD or BETTER_DATE_ADD, or whatever it will be.&lt;br/&gt;
Syntax matters, we are all writers, code writers...&lt;/p&gt;

&lt;p&gt;I re-open the issue in order to attract more attention, but you are free to decide how to treat it. Hope you&apos;ll find the best solution. A short line in documentation could notify about current limitations and save hours for people&lt;br/&gt;
who want to be productive with Doctrine.&lt;/p&gt;</comment>
                    <comment id="18199" author="beberlei" created="Thu, 5 Jul 2012 19:57:12 +0000"  >&lt;p&gt;Printing statements in bold isnt helpful. This is open-source.&lt;/p&gt;

&lt;p&gt;However, you are right that this could be more user-friendly. Its now throwing an exception when an internal function is attempted to be overwritten.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1886] [GH-381] [WIP] [DDC-1637] Collection Filtering API</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1886</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/381&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/381&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This Pull Request implements the new Collection Filtering/Criteria API inside the PErsisters.&lt;/p&gt;

&lt;p&gt;Its still heavily WIP and the code is not cleaned up yet. In general i am not yet happy about the problems to get from criteria to SQL, and that is also to complex to use completely internally.&lt;/p&gt;

&lt;p&gt;Todo:&lt;br/&gt;
1. More tests for Repository impl.&lt;br/&gt;
2. Add PersistentCollection impl.&lt;br/&gt;
3. Cleanup&lt;/p&gt;</description>
                <environment></environment>
            <key id="13793">DDC-1886</key>
            <summary>[GH-381] [WIP] [DDC-1637] Collection Filtering API</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jun 2012 20:31:52 +0000</created>
                <updated>Wed, 11 Jul 2012 19:57:21 +0000</updated>
                    <resolved>Wed, 11 Jul 2012 19:57:21 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18285" author="fabio.bat.silva" created="Wed, 11 Jul 2012 19:57:21 +0000"  >&lt;p&gt;Fixed by : &lt;a href=&quot;https://github.com/doctrine/common/commit/4ac23ae8737fe7b95a7dd0f1346dbd48c7a503b0&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/commit/4ac23ae8737fe7b95a7dd0f1346dbd48c7a503b0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Related ticket : &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1637&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1637&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1843] CLONE -Join columns can&apos;t be quoted</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1843</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Join columns can&apos;t be quoted like columns using name=&quot;`quoted`&quot;. Using annotation driver.&lt;/p&gt;

&lt;div class=&quot;code panel&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(
 *      name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`category`&quot;&lt;/span&gt;,
 *      indexes={
 *          @ORM\Index(
 *              name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fk_category_parentId&quot;&lt;/span&gt;,
 *              columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;parentId&quot;&lt;/span&gt;}
 *          )
 *      },
 *      uniqueConstraints={
 *          @ORM\UniqueConstraint(
 *              name=&lt;span class=&quot;code-quote&quot;&gt;&quot;uq_category_nameParentId&quot;&lt;/span&gt;,
 *              columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;parentId&quot;&lt;/span&gt;}
 *          )
 *      }
 * )
 */
class Category
{
    /**
     * @ORM\Id
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`id`&quot;&lt;/span&gt;)
     * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`parentId`&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $parentId;

    /**
     * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=50, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`name`&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;

    /**
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Category&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;categories&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;parentId&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, onDelete=&lt;span class=&quot;code-quote&quot;&gt;&quot;CASCADE&quot;&lt;/span&gt;, onUpdate=&lt;span class=&quot;code-quote&quot;&gt;&quot;NO ACTION&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $category;
}

... 


&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function load(ObjectManager $manager)
    {
        $parent = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
        $parent-&amp;gt;setName(&apos;parent&apos;);
        $manager-&amp;gt;persist($parent);
        $manager-&amp;gt;flush();

        $child = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
        $child-&amp;gt;setName(&apos;parent&apos;);
        $child-&amp;gt;setParentId($parent-&amp;gt;getId());
        $child-&amp;gt;setCategory($parent);

        $manager-&amp;gt;persist($child);
        $manager-&amp;gt;flush();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result: Invalid parameter number: number of bound variables does not match number of tokens&lt;/p&gt;</description>
                <environment></environment>
            <key id="13737">DDC-1843</key>
            <summary>CLONE -Join columns can&apos;t be quoted</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="easen">Marc Easen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 May 2012 12:46:37 +0000</created>
                <updated>Wed, 15 Aug 2012 00:17:24 +0000</updated>
                    <resolved>Wed, 15 Aug 2012 00:17:24 +0000</resolved>
                            <version>2.1.6</version>
                                <fixVersion>2.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18024" author="fabio.bat.silva" created="Mon, 28 May 2012 17:29:33 +0000"  >&lt;p&gt;code format&lt;/p&gt;</comment>
                    <comment id="18139" author="fabio.bat.silva" created="Mon, 25 Jun 2012 13:04:40 +0000"  >&lt;p&gt;Fixed by : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/cb72219b118c158c9b5344c4b81ff2b1a9149ab0&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/cb72219b118c158c9b5344c4b81ff2b1a9149ab0&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18187" author="easen" created="Thu, 5 Jul 2012 15:14:37 +0000"  >&lt;p&gt;When inserting into an entity which has quoted columns and unquoted JoinColumn the generated SQL includes the correct number of parameters but the incorrect columns names and bind parameters:&lt;/p&gt;

&lt;p&gt;INSERT INTO `table` (`c1`, c1) VALUES (?, ?)&lt;/p&gt;

</comment>
                    <comment id="18188" author="easen" created="Thu, 5 Jul 2012 15:18:40 +0000"  >&lt;p&gt;See &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/390&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/390&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18189" author="fabio.bat.silva" created="Thu, 5 Jul 2012 15:19:37 +0000"  >&lt;p&gt;Hi Marc,&lt;/p&gt;

&lt;p&gt;Could you attach your entities or a test case please ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18194" author="fabio.bat.silva" created="Thu, 5 Jul 2012 18:40:28 +0000"  >&lt;p&gt;Marc, why do you need to quoted columns and unquoted join column ?&lt;/p&gt;

&lt;p&gt;For sure duplicated columns is a problem, but your use case does not make sense for me..&lt;/p&gt;</comment>
                    <comment id="18516" author="fabio.bat.silva" created="Wed, 15 Aug 2012 00:17:24 +0000"  >&lt;p&gt;More details about the related problem : &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/390&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/390&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11194" name="quoted_joins_fix.diff" size="1510" author="easen" created="Mon, 28 May 2012 12:58:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1818] ResultSetMapping::addJoinedEntityResult does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1818</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m trying to fetch the data for oneToMany relation, but it failed:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Notice: Undefined index: SomeCompany\SomeBundle\Entity\SomeJoinedEntity in ..../symfony/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 382&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;While trying to debug the issue I came to the conclusion that if I use the FQDN entity name it works, but if using SomeBundle:SomeJoinedEntity does not. I also checked the unit tests and I wasn&apos;t able to find which test this behavior - they all use the FQDN and not the short name of the entity.&lt;/p&gt;

&lt;p&gt;I wasn&apos;t sure whether this should be a Symfony 2.0.13 issue or a Doctrine2 one, but in the end I&apos;ve the intention that it has to be posted here.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13693">DDC-1818</key>
            <summary>ResultSetMapping::addJoinedEntityResult does not work</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nikola.petkanski">Nikola Petkanski</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 May 2012 10:24:15 +0000</created>
                <updated>Tue, 17 Jul 2012 18:25:13 +0000</updated>
                    <resolved>Tue, 17 Jul 2012 17:49:36 +0000</resolved>
                            <version>2.1.6</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="17937" author="beberlei" created="Fri, 11 May 2012 09:20:34 +0000"  >&lt;p&gt;Its probably a usage problem. ResultSetMapping are used internally in Doctrine as well and they work there. Check Doctrine\ORM\Query\SQLWalker .php on how to use addJoinedentityResult with one-to-many associations. you probably have to set meta columns aswell.&lt;/p&gt;</comment>
                    <comment id="18319" author="dante77" created="Tue, 17 Jul 2012 11:58:25 +0000"  >&lt;p&gt;I support Nikolas opinion that is a bug. With a simple 1:N (one to many) relation, using FQDNs for the entities involved works, where as the shorthand form SomeBundle:Entity does not (for the same, unaltered native query).&lt;br/&gt;
IMHO, the hydrating behaviour should be the same for FQDNs and shorthand entity names, but it is obviously not.&lt;/p&gt;</comment>
                    <comment id="18320" author="beberlei" created="Tue, 17 Jul 2012 12:09:58 +0000"  >&lt;p&gt;Just reading that part now, yes the shorthand does not work here, and can never work.&lt;/p&gt;</comment>
                    <comment id="18321" author="nikola.petkanski" created="Tue, 17 Jul 2012 13:58:02 +0000"  >&lt;p&gt;Is it going to be fixed?&lt;/p&gt;</comment>
                    <comment id="18324" author="beberlei" created="Tue, 17 Jul 2012 17:49:36 +0000"  >&lt;p&gt;no, its not easy to fix it in ResultSetMapping without opening a can of worms.&lt;/p&gt;</comment>
                    <comment id="18325" author="nikola.petkanski" created="Tue, 17 Jul 2012 18:25:13 +0000"  >&lt;p&gt;Shouldn&apos;t this issue be marked as known instead of closed? It has to be fixed at some point, perhaps at the next major refactoring &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1805] [GH-343] Lets make correct data structure</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1805</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 rivaros:&lt;/p&gt;

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

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

&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;As you know Doctine2 supports explicit quoting of identifiers.&lt;/p&gt;

&lt;p&gt;This is extremely useful for PostgreSQL where &quot;TableName&quot; and TableName(implicit lowercased) are 2 different things. That&apos;s why - please, do support explicit quoting with ` (back-ticks) in future.&lt;/p&gt;

&lt;p&gt;Now a problem - you do not support quoting columns which are part of associations. Can you give me a reasonable answer why it should not be supported?&lt;/p&gt;

&lt;p&gt;Now comes my first update - i think that keeping &quot;quoted&quot; property inside the fieldMapping array is globally wrong. &quot;Quoted&quot; is a property, related to a column, not field. For example, an association can consist of 2 joined columns, and 1 of them can be quoted (theoretically).&lt;/p&gt;

&lt;p&gt;That&apos;s why a better choice to store &quot;Quoted/Nonquoted&quot;  properties in ClassMetadata level. I made an array quotedColumns for this and rewrote the function getQuotedColumnName to use it.&lt;/p&gt;

&lt;p&gt;If you have time for short dispute, I may have a solution to make explicit quoting supported in join columns.&lt;/p&gt;

&lt;p&gt;See related thread here:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-142&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-142&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last comment was&lt;br/&gt;
&quot;After some discussion support for quoting join column names and discriminator column names has been dropped for the sake of simplicity.&lt;br/&gt;
Quoting table names and regular column names will continue to be supported.&lt;br/&gt;
The docs have been updated accordingly.&quot;&lt;/p&gt;

&lt;p&gt;I can argue on this - my solution is even more simple.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13674">DDC-1805</key>
            <summary>[GH-343] Lets make correct data structure</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 May 2012 18:50:25 +0000</created>
                <updated>Fri, 4 May 2012 17:54:00 +0000</updated>
                    <resolved>Fri, 4 May 2012 17:54:00 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17907" author="beberlei" created="Fri, 4 May 2012 17:38:37 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-343&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/343&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/343&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1797] [GH-341] Added fluent interface to persist</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1797</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 fixe:&lt;/p&gt;

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

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

</description>
                <environment></environment>
            <key id="13659">DDC-1797</key>
            <summary>[GH-341] Added fluent interface to persist</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Apr 2012 17:27:45 +0000</created>
                <updated>Fri, 4 May 2012 17:57:55 +0000</updated>
                    <resolved>Fri, 4 May 2012 17:57:55 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17883" author="beberlei" created="Tue, 24 Apr 2012 20:27:27 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-341&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/341&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/341&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1788] [GH-338] EntityGenerator will typehint core fields where applicable (DateTime)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1788</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 benlumley:&lt;/p&gt;

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

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

&lt;p&gt;As per other PR (on dbal) - EntityGenerator doesn&apos;t currently do this. This PR adds it.&lt;/p&gt;

&lt;p&gt;It requires the matching PR on dbal as well for the mapping info.&lt;/p&gt;

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

</description>
                <environment></environment>
            <key id="13646">DDC-1788</key>
            <summary>[GH-338] EntityGenerator will typehint core fields where applicable (DateTime)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</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 23:04:04 +0000</created>
                <updated>Fri, 4 May 2012 17:56:55 +0000</updated>
                    <resolved>Fri, 4 May 2012 17:56:55 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17888" author="beberlei" created="Thu, 26 Apr 2012 21:50:06 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-135&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/135&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/135&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17910" author="asm89" created="Fri, 4 May 2012 17:56:55 +0000"  >&lt;p&gt;There is another PR adressing this issue. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/317&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/317&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1780] Function createEntity does&apos;t support DateTime identifier</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1780</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When I try to get data (as objects, function getResult()) from a table with two indexes (1.Integer, 2.DateTime), Doctrine returns duplicate objects to the first index.&lt;br/&gt;
This bug is present only in the function getResult(), getArrayResult work correctly.&lt;br/&gt;
The bug is in file UnitOfWork.php, line 2323-2329.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$idHash = implode(&apos; &apos;, $id);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;This code does not take into account that identifer may be DateTime object.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13634">DDC-1780</key>
            <summary>Function createEntity does&apos;t support DateTime identifier</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="raccoon">Tereshchenko Maxim</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Apr 2012 10:20:55 +0000</created>
                <updated>Sat, 7 Jul 2012 14:31:56 +0000</updated>
                    <resolved>Sat, 7 Jul 2012 14:31:56 +0000</resolved>
                            <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18222" author="asm89" created="Sat, 7 Jul 2012 14:31:56 +0000"  >&lt;p&gt;Doctrine doesn&apos;t support DateTime objects as identifiers because the objects don&apos;t implement __toString().&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1773] GRUOP BY table.id in PostgreSQL.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1773</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I use in mysql driver this DQL: &quot;GRUOP BY table.id&quot;&lt;br/&gt;
But when i shwich to PostgreSQL i have to rewrite it like this: &quot;GRUOP BY table&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13621">DDC-1773</key>
            <summary>GRUOP BY table.id in PostgreSQL.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="elfet">Elfet</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Apr 2012 14:37:11 +0000</created>
                <updated>Sun, 22 Apr 2012 15:41:53 +0000</updated>
                    <resolved>Sun, 22 Apr 2012 15:41:53 +0000</resolved>
                            <version>Git Master</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17877" author="fabio.bat.silva" created="Sat, 21 Apr 2012 14:20:28 +0000"  >&lt;p&gt;Hi Elfet&lt;/p&gt;

&lt;p&gt;I can&apos;t reproduce.&lt;/p&gt;

&lt;p&gt;Could you give more details, maybe attach your entities or a test case ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="17879" author="elfet" created="Sat, 21 Apr 2012 20:32:06 +0000"  >&lt;p&gt;The DQL: SELECT g, COUNT(u.id) AS usersCount FROM Entity\Group g LEFT JOIN g.users u GROUP BY g&lt;font color=&quot;red&quot;&gt;&lt;ins&gt;.id&lt;/ins&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;The Entity&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Entities&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;namespace Entity;

/**
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Repository\Groups&quot;&lt;/span&gt;)
 */
class Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \&lt;span class=&quot;code-object&quot;&gt;System&lt;/span&gt;\Entity
{
    /** @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;

    /** @Column(length=100) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;

    /** @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;group&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $users;
}

namespace Entity;

/**
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Repository\Users&quot;&lt;/span&gt;) 
 */
class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; \&lt;span class=&quot;code-object&quot;&gt;System&lt;/span&gt;\Entity
{
    /** @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;

    /** @Column(length=100) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;

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

    /** @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $group;

    &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;logins = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Collections\ArrayCollection();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;group = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Group()
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="17880" author="fabio.bat.silva" created="Sat, 21 Apr 2012 21:18:02 +0000"  >&lt;p&gt;Hi Elfet.&lt;/p&gt;

&lt;p&gt;In some databases like postgres and oracle all selected columns must appear in the GROUP BY clause or be used in an aggregate function.&lt;br/&gt;
You CANNOT, select &quot;Group&quot; fields without add these field on the ORDER BY clause.&lt;/p&gt;

&lt;p&gt;you should use : &lt;br/&gt;
   ( GROUP BY g )&lt;br/&gt;
or&lt;br/&gt;
  ( GROUP BY g.id, g.nome, g.otherSelectedFields )&lt;/p&gt;</comment>
                    <comment id="17881" author="elfet" created="Sun, 22 Apr 2012 11:56:09 +0000"  >&lt;p&gt;Ok, thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1749] [GH-318] [WIP] Adding Multiple ID Generators support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1749</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/318&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/318&lt;/a&gt;&lt;/p&gt;

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

</description>
                <environment></environment>
            <key id="13587">DDC-1749</key>
            <summary>[GH-318] [WIP] Adding Multiple ID Generators support</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 1 Apr 2012 16:51:26 +0000</created>
                <updated>Fri, 4 May 2012 18:05:32 +0000</updated>
                    <resolved>Fri, 4 May 2012 18:05:32 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17720" author="beberlei" created="Sun, 1 Apr 2012 16:54:25 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-318&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/318&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/318&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2278] Invalid arguments to PreFlushEventArgs class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2278</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Here &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L527&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L527&lt;/a&gt; PreFlushEventArgs expects number of arguments to be 2 and the first argument have to be instance of entity manager. But two arguments are passed and the first one is not instanceof em.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14457">DDC-2278</key>
            <summary>Invalid arguments to PreFlushEventArgs class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="thestanislav">Stanislav Anisimov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Feb 2013 08:00:37 +0000</created>
                <updated>Tue, 5 Feb 2013 08:14:33 +0000</updated>
                    <resolved>Tue, 5 Feb 2013 08:14:33 +0000</resolved>
                            <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19471" author="ocramius" created="Tue, 5 Feb 2013 08:14:33 +0000"  >&lt;p&gt;Being handled in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2276&quot; title=&quot;[GH-569] Hotfix/pre flush event args params&quot;&gt;&lt;del&gt;DDC-2276&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2259] [GH-557] [DDC 2004] addFilter class name or instance</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2259</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 gimler:&lt;/p&gt;

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

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

&lt;p&gt;Make it possible to add filter class name or instance to addFilter. This is useful to use services to inject other dependencies.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14418">DDC-2259</key>
            <summary>[GH-557] [DDC 2004] addFilter class name or instance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 Jan 2013 10:06:52 +0000</created>
                <updated>Sat, 26 Jan 2013 15:57:01 +0000</updated>
                    <resolved>Sat, 26 Jan 2013 15:57:01 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19415" author="beberlei" created="Sat, 26 Jan 2013 10:16:55 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-557&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/557&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/557&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2255] [Doctrine-Bridge][Console] Entity, Getters and Setters Generating Bug detected in Symfony 2 Framework</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2255</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;h3&gt;&lt;a name=&quot;BugfoundwhengenerationtheEntity%2CGettersandSettersbyusingtheCommand%3A&quot;&gt;&lt;/a&gt;Bug found when generation the Entity, Getters and Setters by using the Command:&lt;/h3&gt;

&lt;div class=&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;gt; php app/console doctrine:generate:entities YourBundleBundle:YourEntity 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In the situation you have a &lt;b&gt;OneToMany&lt;/b&gt; relation in the Entity and you did implement the &lt;b&gt;__construct()&lt;/b&gt;, then the Console &lt;b&gt;Wont&lt;/b&gt; generate the &lt;b&gt;ArrayCollection()&lt;/b&gt; !&lt;br/&gt;
In the case you did not implement the &lt;b&gt;__construct()&lt;/b&gt;, then everything will goes fine when generating them,&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-none&quot;&gt;
/**
 * @ORM\OneToMany(targetEntity=&quot; YourBundleBundle \Entity\ YourEntity &quot;, mappedBy=&quot; YourEntity &quot;)
 */
private $YourAttribut;

public function __construct()
{
  $this-&amp;gt; YourAttribut = new \Doctrine\Common\Collections\ArrayCollection();
} 
// But in the case you did implement the __construct() before using the Command, let say like this:

public function __construct()
{
  $this-&amp;gt; YourOtherAttribut = a_value;
} 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In this case, when using the Command to generate Entity, Getters and Setters, the Console &lt;b&gt;Wont&lt;/b&gt; generate the &lt;b&gt;ArrayCollection()&lt;/b&gt; of the &lt;b&gt;OneToMany&lt;/b&gt; relations in the &lt;b&gt;__construct()&lt;/b&gt; !&lt;/p&gt;</description>
                <environment></environment>
            <key id="14408">DDC-2255</key>
            <summary>[Doctrine-Bridge][Console] Entity, Getters and Setters Generating Bug detected in Symfony 2 Framework</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="nayzo">Ala Eddine Khefifi</reporter>
                        <labels>
                        <label>collection</label>
                    </labels>
                <created>Thu, 24 Jan 2013 11:38:03 +0000</created>
                <updated>Thu, 24 Jan 2013 13:24:22 +0000</updated>
                    <resolved>Thu, 24 Jan 2013 12:26:39 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19398" author="ocramius" created="Thu, 24 Jan 2013 12:26:39 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=nayzo&quot; class=&quot;user-hover&quot; rel=&quot;nayzo&quot;&gt;Ala Eddine Khefifi&lt;/a&gt; This is expected behavior, since the generator should not change already existing methods&lt;/p&gt;</comment>
                    <comment id="19399" author="nayzo" created="Thu, 24 Jan 2013 12:50:41 +0000"  >&lt;p&gt;but it could override them and add missing instruction that should be added within the code, otherwise it leads to a dis-function and non stable relations !! &lt;/p&gt;</comment>
                    <comment id="19402" author="ocramius" created="Thu, 24 Jan 2013 13:24:22 +0000"  >&lt;p&gt;No, that is not up to the generator. Entity generation and fixing your broken existing code are different things. You should not rely on the generator to handle this kind of problems, the generator just gives you a kick-start, but after that, you are on your own.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2242] [GH-550] Update lib/Doctrine/ORM/UnitOfWork.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2242</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 cedriclombardot:&lt;/p&gt;

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

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

&lt;p&gt;When the pk contains a DateTime object doctrine fail to create the index, because implode call __toString wich doesn&apos;t exists in \DateTime object&lt;/p&gt;</description>
                <environment></environment>
            <key id="14386">DDC-2242</key>
            <summary>[GH-550] Update lib/Doctrine/ORM/UnitOfWork.php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jan 2013 08:16:09 +0000</created>
                <updated>Tue, 15 Jan 2013 09:21:48 +0000</updated>
                    <resolved>Tue, 15 Jan 2013 08:29:07 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19318" author="beberlei" created="Tue, 15 Jan 2013 09:21:48 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-550&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/550&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/550&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2244] One-To-Many Cascade saving not working properly</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2244</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the following code:&lt;/p&gt;

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

&lt;p&gt;When i execute this code i have the following 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;
An exception occurred &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; executing &apos;INSERT INTO interview_review_question (question, tags, created_at, interview_review_id) VALUES (?, ?, ?, ?)&apos; with params {&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;asdfg&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;asdfg&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;3&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;4&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;}:

Column &apos;interview_review_id&apos; cannot be &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here are my entities:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
/**
 * InterviewReview
 *
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;interview_review&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class InterviewReview
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\Id
     * @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;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Doctrine\Common\Collections\ArrayCollection
     *
     * @ORM\OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Absolvent\AbsolventBundle\Entity\InterviewReviewQuestion&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;}, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;interview_review&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;interview_review&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; $questions;

    /**
     * Add question
     *
     * @param \Absolvent\AbsolventBundle\Entity\InterviewReviewQuestion $question
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; InterviewReview
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addQuestion(\Absolvent\AbsolventBundle\Entity\InterviewReviewQuestion $question)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;questions[] = $question;

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
    }

    /**
     * Remove question
     *
     * @param \Absolvent\AbsolventBundle\Entity\InterviewReviewQuestion $question
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeQuestion(\Absolvent\AbsolventBundle\Entity\InterviewReviewQuestion $question)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;questions-&amp;gt;removeElement($question);
    }

    /**
     * Get questions
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; \Doctrine\Common\Collections\Collection
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getQuestions()
    {
        &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;questions;
    }
}


/**
 * InterviewReviewQuestion
 *
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;interview_review_question&quot;&lt;/span&gt;)
 * @ORM\Entity
 */
class InterviewReviewQuestion
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
     *
     * @ORM\Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @ORM\Id
     * @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;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Absolvent\AbsolventBundle\Entity\InterviewReview
     *
     * @ORM\ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Absolvent\AbsolventBundle\Entity\InterviewReview&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;}, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;questions&quot;&lt;/span&gt;)
     * @ORM\JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;interview_review_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&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; $interview_review;

    /**
     * Get id
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; integer
     */
    &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;
    }

    /**
     * Set interview_review
     *
     * @param \Absolvent\AbsolventBundle\Entity\InterviewReview $interviewReview
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; InterviewReviewQuestion
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setInterviewReview(\Absolvent\AbsolventBundle\Entity\InterviewReview $interviewReview = &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;interview_review = $interviewReview;

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
    }

    /**
     * Get interview_review
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; \Absolvent\AbsolventBundle\Entity\InterviewReview
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getInterviewReview()
    {
        &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;interview_review;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This problem is causing because the is no $question-&amp;gt;setInterviewReview() called anywhere.&lt;/p&gt;

&lt;p&gt;I know that i can call it inside addQuestion function, but is should work out of the box - isn&apos;t it?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14388">DDC-2244</key>
            <summary>One-To-Many Cascade saving not working properly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="kl3ryk">Pawe&#322; &#321;askarzewski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jan 2013 16:22:33 +0000</created>
                <updated>Tue, 15 Jan 2013 16:46:25 +0000</updated>
                    <resolved>Tue, 15 Jan 2013 16:44:24 +0000</resolved>
                                                            <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19321" author="ocramius" created="Tue, 15 Jan 2013 16:31:16 +0000"  >&lt;p&gt;Fixing code highlighting&lt;/p&gt;</comment>
                    <comment id="19322" author="kl3ryk" created="Tue, 15 Jan 2013 16:34:58 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="19323" author="ocramius" created="Tue, 15 Jan 2013 16:35:21 +0000"  >&lt;p&gt;Works here with your code. What&apos;s the exact ORM version you&apos;re using?&lt;/p&gt;</comment>
                    <comment id="19324" author="ocramius" created="Tue, 15 Jan 2013 16:38:45 +0000"  >&lt;p&gt;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;$question-&amp;gt;setInterviewReview($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;is up to you. Doctrine does not apply this kind of &quot;magic&quot;.&lt;br/&gt;
You are responsible for keeping your object graph consistent.&lt;/p&gt;</comment>
                    <comment id="19325" author="kl3ryk" created="Tue, 15 Jan 2013 16:40:10 +0000"  >&lt;p&gt;In composer (using symofny) i have:&lt;/p&gt;

&lt;p&gt;&quot;doctrine/orm&quot;: &quot;&amp;gt;=2.2,&amp;lt;2.4-dev&quot;&lt;/p&gt;

&lt;p&gt;and got the latest version.&lt;/p&gt;

&lt;p&gt;Lanuched composer update 2 hours ago&lt;/p&gt;</comment>
                    <comment id="19326" author="kl3ryk" created="Tue, 15 Jan 2013 16:41:18 +0000"  >&lt;p&gt;Ok but both objects are new and connected (using add function). I thought that cascade=&lt;/p&gt;
{&quot;persist&quot;}
&lt;p&gt; will do this magic &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="19327" author="ocramius" created="Tue, 15 Jan 2013 16:44:17 +0000"  >&lt;p&gt;No, associating them is up to you. The ORM is only responsible for saving/loading data, not for manipulating your associations like that.&lt;/p&gt;</comment>
                    <comment id="19328" author="kl3ryk" created="Tue, 15 Jan 2013 16:44:17 +0000"  >&lt;p&gt;In the documentation there is some info about this:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/working-with-associations.html#transitive-persistence-cascade-operations&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/working-with-associations.html#transitive-persistence-cascade-operations&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Even if you persist a new User that contains our new Comment this code would fail if you removed the call to EntityManager#persist($myFirstComment). Doctrine 2 does not cascade the persist operation to all nested entities that are new as well.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;....&amp;#93;&lt;/span&gt;&lt;br/&gt;
To have Doctrine handle both cases automatically we can change the User#commentsAuthored property to cascade both the &#8220;persist&#8221; and the &#8220;remove&#8221; operation.&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    <comment id="19329" author="ocramius" created="Tue, 15 Jan 2013 16:45:09 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=kl3ryk&quot; class=&quot;user-hover&quot; rel=&quot;kl3ryk&quot;&gt;Pawe&#322; &#321;askarzewski&lt;/a&gt; see &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2227&quot; title=&quot;Add details about developer being responsible of inverse side of an association&quot;&gt;DDC-2227&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19330" author="kl3ryk" created="Tue, 15 Jan 2013 16:46:25 +0000"  >&lt;p&gt;Ok thanks for your help&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2177] WHERE IN not working</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2177</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m going by the docs, trying to get a WHERE IN type of query working with the query builder.&lt;/p&gt;

&lt;p&gt;I&apos;ve got a flat array of IDs, e.g. something like this:&lt;/p&gt;

&lt;p&gt;  $IDs = array( 228052, 265635, 344498, 391761, 329203, 317911, 305961, 299939, 249429, 344706 );&lt;/p&gt;

&lt;p&gt;I&apos;ve tried the following ways to get this working:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;using the Expr class:&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  $qb-&amp;gt;add( &apos;where&apos;, $qb-&amp;gt;expr()-&amp;gt;in( &apos;c.id&apos;, &apos;:IDs&apos; ));&lt;br/&gt;
  $qb-&amp;gt;setParameter( &apos;IDs&apos;, $IDs );&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;alternatively:&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  $qb-&amp;gt;add( &apos;where&apos;, $qb-&amp;gt;expr()-&amp;gt;in( &apos;c.id&apos;, $IDs ));&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;even direct DQL:&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  $qb-&amp;gt;where( &apos;c.id IN (:IDs)&apos; );&lt;br/&gt;
  $qb-&amp;gt;setParameter( &apos;IDs&apos;, $IDs );&lt;/p&gt;

&lt;p&gt;The generated DQL looks fine:&lt;/p&gt;

&lt;p&gt;  SELECT c FROM MyEntity c WHERE c.id IN(&apos;228052&apos;, &apos;265635&apos;, &apos;344498&apos;, &apos;391761&apos;, &apos;329203&apos;, &apos;317911&apos;, &apos;305961&apos;, &apos;299939&apos;, &apos;249429&apos;, &apos;344706&apos;)&lt;/p&gt;

&lt;p&gt;But when I call execute() on that query, all these variations give me the following error:&lt;/p&gt;

&lt;p&gt;  Expected argument of type &quot;Doctrine\ORM\QueryBuilder&quot;, &quot;array&quot; given&lt;/p&gt;</description>
                <environment>Linux, Symfony 2, PHP 5.3.10</environment>
            <key id="14280">DDC-2177</key>
            <summary>WHERE IN not working</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="userfriendly">Moritz Kraft</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Nov 2012 18:18:56 +0000</created>
                <updated>Thu, 29 Nov 2012 14:08:43 +0000</updated>
                    <resolved>Wed, 28 Nov 2012 18:46:24 +0000</resolved>
                            <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19075" author="userfriendly" created="Wed, 28 Nov 2012 18:28:49 +0000"  >&lt;p&gt;never mind.... it was something i was doing wrong. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; thank god...&lt;/p&gt;</comment>
                    <comment id="19076" author="ocramius" created="Wed, 28 Nov 2012 18:46:42 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=userfriendly&quot; class=&quot;user-hover&quot; rel=&quot;userfriendly&quot;&gt;Moritz Kraft&lt;/a&gt; what was it exactly?&lt;/p&gt;</comment>
                    <comment id="19078" author="userfriendly" created="Thu, 29 Nov 2012 14:08:43 +0000"  >&lt;p&gt;The error was thrown by the Symfony Form Framework, not Doctrine. Sorry about that. :-/&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2163] Export entity data to array and create new entity by this array</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2163</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Entity serialization is really pain operation for doctrine2 entities, but why we need serialization? If we may just get array of table&apos;s row for entity and store this array anywhere!&lt;/p&gt;

&lt;p&gt;For example, we have Entity:&lt;/p&gt;

&lt;p&gt;id, category_id, title&lt;/p&gt;

&lt;p&gt;(where category_id is many to one to Category entity)&lt;/p&gt;

&lt;p&gt;If we will able to get just array from entity like&lt;br/&gt;
array(&lt;br/&gt;
    &apos;id&apos; =&amp;gt; 1,&lt;br/&gt;
    &apos;category_id&apos; =&amp;gt; 2,&lt;br/&gt;
    &apos;title&apos; =&amp;gt; &apos;Some title&apos;&lt;br/&gt;
)&lt;br/&gt;
That&apos;s all!&lt;/p&gt;

&lt;p&gt;I look at code and find a place where table row converted to object: &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php#L341&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php#L341&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This method is protected, so we can&apos;t call it directly. Can we change it to public?&lt;/p&gt;

&lt;p&gt;Another question how we can get this raw values array from entity. I found method &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L2692&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L2692&lt;/a&gt; but it return data with related entities.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14260">DDC-2163</key>
            <summary>Export entity data to array and create new entity by this array</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="wiistriker">Anton</reporter>
                        <labels>
                        <label>serialize</label>
                    </labels>
                <created>Fri, 23 Nov 2012 00:38:50 +0000</created>
                <updated>Tue, 27 Nov 2012 07:00:44 +0000</updated>
                    <resolved>Fri, 23 Nov 2012 08:28:30 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19033" author="wiistriker" created="Fri, 23 Nov 2012 02:39:45 +0000"  >&lt;p&gt;i write some weird code: &lt;a href=&quot;http://stackoverflow.com/questions/13507300/doctrine2-export-entity-to-array/13522452#13522452&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/13507300/doctrine2-export-entity-to-array/13522452#13522452&lt;/a&gt;&lt;br/&gt;
please, take a look.&lt;/p&gt;</comment>
                    <comment id="19034" author="ocramius" created="Fri, 23 Nov 2012 08:25:18 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=wiistriker&quot; class=&quot;user-hover&quot; rel=&quot;wiistriker&quot;&gt;Anton&lt;/a&gt; the namespace `Internal` is there for a reason. If you want to convert entities to array or the opposite, please use either JMS Serializer, Symfony Serializer or Zend\StdLib\Hydrator with DoctrineModule\StdLib\Hydrator.&lt;/p&gt;

&lt;p&gt;Currently, we don&apos;t support serialization&lt;/p&gt;</comment>
                    <comment id="19035" author="ocramius" created="Fri, 23 Nov 2012 08:28:30 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=wiistriker&quot; class=&quot;user-hover&quot; rel=&quot;wiistriker&quot;&gt;Anton&lt;/a&gt; this is not the correct approach to the problem. Serialization/unserialization is a problem related to (probably) Doctrine\Common.&lt;/p&gt;</comment>
                    <comment id="19067" author="wiistriker" created="Tue, 27 Nov 2012 07:00:44 +0000"  >&lt;p&gt;Marco Pivetta, thanks for reply. With JMSSerializer or Symfony serializer can i later insert\update object in db? I see in sources, that UnitOfWork get changeset for each entity. How doctrine2 knows which properties of serialized\deserialized entitiy was changed?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1724] [GH-308] Fix DDC-1697</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1724</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/308&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/308&lt;/a&gt;&lt;/p&gt;

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

</description>
                <environment></environment>
            <key id="13557">DDC-1724</key>
            <summary>[GH-308] Fix DDC-1697</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Mar 2012 01:54:13 +0000</created>
                <updated>Sun, 25 Mar 2012 13:24:02 +0000</updated>
                    <resolved>Sun, 25 Mar 2012 13:24:02 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17646" author="beberlei" created="Sun, 25 Mar 2012 03:30:02 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-308&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/308&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/308&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17651" author="fabio.bat.silva" created="Sun, 25 Mar 2012 13:24:02 +0000"  >&lt;p&gt;Fixed by : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/8a52e3033b51f0f0b97e1ee75477644484debf2b&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/8a52e3033b51f0f0b97e1ee75477644484debf2b&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-1711] [GH-306] by r1pp3rj4ck: Fixed fetch mapping in xsd</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1711</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 r1pp3rj4ck:&lt;/p&gt;

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

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

&lt;p&gt;It was &apos;EXTRALAZY&apos; and the constant name in ClassMetadata is &apos;EXTRA_LAZY&apos;.&lt;/p&gt;

&lt;p&gt;It&apos;s really annoying that my IDE says it&apos;s a wrong attribute.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13535">DDC-1711</key>
            <summary>[GH-306] by r1pp3rj4ck: Fixed fetch mapping in xsd</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="asm89">Alexander</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Mar 2012 16:01:02 +0000</created>
                <updated>Sun, 18 Mar 2012 22:02:38 +0000</updated>
                    <resolved>Sun, 18 Mar 2012 22:02:38 +0000</resolved>
                                            <fixVersion>Git Master</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17620" author="asm89" created="Sun, 18 Mar 2012 22:02:38 +0000"  >&lt;p&gt;Merged: &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/1b2b831febb780d8153bc4f8684baa763dd8f177&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/1b2b831febb780d8153bc4f8684baa763dd8f177&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-267] CLI does only show last error message and ignores stacked exceptions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-267</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If exceptions are stacked, only the last message is shown. The attached patch fixes this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10761">DDC-267</key>
            <summary>CLI does only show last error message and ignores stacked exceptions</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Jan 2010 20:00:56 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:34 +0000</updated>
                    <resolved>Mon, 12 Apr 2010 00:20:55 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11448" author="romanb" created="Fri, 22 Jan 2010 20:55:03 +0000"  >&lt;p&gt;Apparently there is a --trace option that, if enabled, shows the full stack trace.&lt;/p&gt;

&lt;p&gt;Is that not sufficient? The patch merely concatenates exception messages, even without a separator.&lt;/p&gt;

&lt;p&gt;The stack trace should probably always be shown?&lt;/p&gt;</comment>
                    <comment id="11449" author="shurakai" created="Fri, 22 Jan 2010 21:07:55 +0000"  >&lt;p&gt;Yes, I would disable --trace&lt;/p&gt;

&lt;p&gt;The stacktrace is not sufficient because e.g. the ReflectionException generates a very useful message and is afterwards stacked by the MappingException to add more information, but the original message is lost...&lt;/p&gt;

&lt;p&gt;Btw., yeah, maybe the output could be better &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="11475" author="guilhermeblanco" created="Mon, 25 Jan 2010 14:45:53 +0000"  >&lt;p&gt;The MappingException should be fixed then.&lt;br/&gt;
There&apos;s no reason to add a $e-&amp;gt;getPrevious() lookup in CLIController.&lt;/p&gt;

&lt;p&gt;Also... it&apos;s even a break in Exception class. There&apos;s no method prototype in PHP Exception class.&lt;/p&gt;

&lt;p&gt;If MappingException is hiding something, point it to me and I fix it.&lt;/p&gt;</comment>
                    <comment id="11477" author="beberlei" created="Mon, 25 Jan 2010 15:23:06 +0000"  >&lt;p&gt;@Guilherme - That was because of the your latest commit on additional entity class information &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I guess the way to go (and i already initiazed first contact) is to patch the Reflection C API in PHP to show the class name instead.&lt;/p&gt;</comment>
                    <comment id="12634" author="guilhermeblanco" created="Mon, 12 Apr 2010 00:20:55 +0000"  >&lt;p&gt;That&apos;s a PHP issue, as Benjamin stated. Patch already submitted to PHP core team.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10311" name="CliController_Exception.patch" size="6639" author="shurakai" created="Fri, 22 Jan 2010 20:00:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-269] CLI throws Exception that table already exists if --dump-sql specified</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-269</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If I execute&lt;/p&gt;

&lt;p&gt;./doctrine orm:schema-tool --create --trace --dump-sql&lt;/p&gt;

&lt;p&gt;I recieve an Exception stating that one of the tables already exists, but I only want to dump the SQL and not have it executed (in which case this exception would be okay)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10763">DDC-269</key>
            <summary>CLI throws Exception that table already exists if --dump-sql specified</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Sat, 23 Jan 2010 16:58:16 +0000</created>
                <updated>Mon, 25 Jan 2010 13:49:54 +0000</updated>
                    <resolved>Mon, 25 Jan 2010 13:49:54 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11450" author="beberlei" created="Sat, 23 Jan 2010 22:32:47 +0000"  >&lt;p&gt;Can you post the stack trace please?&lt;/p&gt;</comment>
                    <comment id="11458" author="shurakai" created="Sun, 24 Jan 2010 14:24:13 +0000"  >&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;orm:schema-tool =&amp;gt; The table with name &apos;core_content_directories&apos; already exists.


#0 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/DBAL/Schema/Schema.php(89): Doctrine\DBAL\Schema\SchemaException::tableAlreadyExists(&apos;core_content_di...&apos;)
#1 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/DBAL/Schema/Schema.php(185): Doctrine\DBAL\Schema\Schema-&amp;gt;_addTable(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Doctrine\DBAL\Schema\Table))
#2 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/ORM/Tools/SchemaTool.php(120): Doctrine\DBAL\Schema\Schema-&amp;gt;createTable(&apos;core_content_di...&apos;)
#3 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/ORM/Tools/SchemaTool.php(98): Doctrine\ORM\Tools\SchemaTool-&amp;gt;getSchemaFromMetadata(Array)
#4 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/ORM/Tools/Cli/Tasks/SchemaToolTask.php(200): Doctrine\ORM\Tools\SchemaTool-&amp;gt;getCreateSchemaSql(Array)
#5 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/Common/Cli/TaskNamespace.php(229): Doctrine\ORM\Tools\Cli\Tasks\SchemaToolTask-&amp;gt;run()
#6 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/Common/Cli/CliController.php(170): Doctrine\Common\Cli\TaskNamespace-&amp;gt;runTask(&apos;schema-tool&apos;, Array)
#7 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/lib/Doctrine/Common/Cli/CliController.php(137): Doctrine\Common\Cli\CliController-&amp;gt;runTask(&apos;orm:schema-tool&apos;, Array)
#8 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/tools/sandbox/doctrine.php(12): Doctrine\Common\Cli\CliController-&amp;gt;run(Array)
#9 /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces/DoctrineTrunk/tools/sandbox/doctrine(4): include(&apos;/&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/workspaces...&apos;)
#10 {main}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11464" author="guilhermeblanco" created="Mon, 25 Jan 2010 13:49:20 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-15&quot; title=&quot;Add support to --force option in SchemaTool CLI Task&quot;&gt;&lt;del&gt;DDC-15&lt;/del&gt;&lt;/a&gt; points to the same issue.&lt;/p&gt;</comment>
                    <comment id="11465" author="guilhermeblanco" created="Mon, 25 Jan 2010 13:49:54 +0000"  >&lt;p&gt;Closing this issue since it&apos;s duplicated with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-15&quot; title=&quot;Add support to --force option in SchemaTool CLI Task&quot;&gt;&lt;del&gt;DDC-15&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="10065">DDC-15</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-258] DiscriminatorMap Ordering Affects Mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-258</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In an inheritance tree, I have a super class with three subclasses.  Two of the subclasses have a &apos;title&apos; and &apos;description&apos; field, but one of those has an extra field.  The third class doesn&apos;t share any properties, but demonstrates the reasoning for not having &apos;title&apos; and &apos;description&apos; in the super class.&lt;/p&gt;

&lt;p&gt;So, the problem I&apos;m getting is that only one of these classes can work at a time, depending on which is first in the DiscriminatorMap. The SQL query performs left joins on all of the tables and uses aliases to keep the common fields separated.  The mapper doesn&apos;t seem to be using the aliases when it maps the properties to the object.  It seems override properties even if they aren&apos;t in the correct table.&lt;/p&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;/**
 * @Entity
 * @Table(name=&quot;Content&quot;)
 * @InheritanceType(&quot;JOINED&quot;)
 * @DiscriminatorColumn(name=&quot;type&quot;, type=&quot;string&quot;)
 * @DiscriminatorMap({&quot;class1&quot; = &quot;Class1&quot;, &quot;class2&quot; = &quot;Class2&quot;, &quot;class3&quot;=&quot;Class3&quot;})
 */
abstract class Super
{
    /**
     * @Id @Column(name=&quot;id&quot;, type=&quot;integer&quot;)
     * @GeneratedValue(strategy=&quot;AUTO&quot;)
    */
    protected $id;
}

/**
 * @Entity
 */
class Class1 extends Super
{
    /**
     * @Column(name=&quot;title&quot;, type=&quot;string&quot;, length=&quot;150&quot;)
     */
    protected $title;

    /**
     * @Column(name=&quot;content&quot;, type=&quot;string&quot;, length=&quot;500&quot;)
     */
    protected $description;
}

/**
 * @Entity
 */
class Class2 extends Super
{
    /**
     * @Column(name=&quot;title&quot;, type=&quot;string&quot;, length=&quot;150&quot;)
     */
    protected $title;

    /**
     * @Column(name=&quot;content&quot;, type=&quot;string&quot;, length=&quot;500&quot;)
     */
    protected $description;

    /**
     * @Column(name=&quot;text&quot;, type=&quot;text&quot;)
     */
    protected $text;
}

/**
 * An extra class to demonstrate why title and description aren&apos;t in Super
 *
 * @Entity
 */
class Class3 extends Super
{
    /**
     * @Column(name=&quot;title&quot;, type=&quot;string&quot;, length=&quot;150&quot;)
     */
    protected $apples;

    /**
     * @Column(name=&quot;content&quot;, type=&quot;string&quot;, length=&quot;500&quot;)
     */
    protected $bananas;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The select for a Super of id 2 uses the following query (or similar):&lt;/p&gt;
&lt;div class=&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;SELECT t0.id, t0.type, t1.title, t1.description, t2.title, t2.description, t2.text, t3.apples, t3.bananas 
FROM Super t0 
LEFT JOIN Class1 t1 ON t0.id = t1.id 
LEFT JOIN Class2 t2 ON t0.id = t2.id 
LEFT JOIN Class3 t3 ON t0.id = t3.id 
WHERE t0.id = 2;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, if the DiscriminatorMap is reordered, the joins change order as well, which seems to affect which fields actually get mapped to the object.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10739">DDC-258</key>
            <summary>DiscriminatorMap Ordering Affects Mapping</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="mridgway">Michael Ridgway</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Jan 2010 22:26:24 +0000</created>
                <updated>Fri, 5 Mar 2010 11:37:42 +0000</updated>
                    <resolved>Fri, 5 Mar 2010 11:37:42 +0000</resolved>
                                            <fixVersion>2.0-BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11419" author="mridgway" created="Mon, 18 Jan 2010 19:27:27 +0000"  >&lt;p&gt;It appears it doesn&apos;t have to do with the table name, but with the actual property name.  Changing the property column names in one of the classes still gives the same results, but changing the property names does fix it.&lt;/p&gt;</comment>
                    <comment id="11420" author="mridgway" created="Mon, 18 Jan 2010 19:28:38 +0000"  >&lt;p&gt;Formatting to fix horizontal scroll.&lt;/p&gt;</comment>
                    <comment id="11776" author="beberlei" created="Sat, 20 Feb 2010 19:12:46 +0000"  >&lt;p&gt;@Roman - I just read jwages slides on Dc2 and he mentioned in an inheritance scenario no field is allowed to be defined twice, isn&apos;t that the case here which produces this problems?&lt;/p&gt;</comment>
                    <comment id="11782" author="romanb" created="Mon, 22 Feb 2010 06:09:11 +0000"  >&lt;p&gt;@Benjamin: Shouldnt be, because the restriction refers to classes who inherit from each other.&lt;/p&gt;

&lt;p&gt;Say, if Class2 would extend Class1 in this example, that would be a violation because Class2 would actually have 2 x title/description.&lt;/p&gt;</comment>
                    <comment id="11846" author="beberlei" created="Fri, 26 Feb 2010 17:28:08 +0000"  >&lt;p&gt;Verified, Test-Case attached for Roman&lt;/p&gt;</comment>
                    <comment id="12034" author="romanb" created="Fri, 5 Mar 2010 11:37:42 +0000"  >&lt;p&gt;Should be fixed now. Testcase is committed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10398" name="DDC258Test.php" size="2693" author="beberlei" created="Fri, 26 Feb 2010 17:28:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-260] Add additional info to ReflectionException in ClassMetadata</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-260</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I was thinking about adding an additional exception to the ClassMetadata class. For example when using reflection for recieving an attribute and an exception is raised (for example because the attribute does not exist), the debug information could be improved. I thought one could catch the ReflectionException and throw a DoctrineReflectionException or something like that and add some additional information like what the name of the currently processed class is&lt;/p&gt;</description>
                <environment></environment>
            <key id="10742">DDC-260</key>
            <summary>Add additional info to ReflectionException in ClassMetadata</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Sat, 16 Jan 2010 18:30:03 +0000</created>
                <updated>Thu, 21 Jan 2010 19:52:59 +0000</updated>
                    <resolved>Thu, 21 Jan 2010 19:52:59 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11393" author="romanb" created="Sat, 16 Jan 2010 18:50:37 +0000"  >&lt;p&gt;I dont think that would be overly useful as the exceptions from php are pretty good. Can you show an example of the error, the message you get and the improved message you would like to get instead?&lt;/p&gt;</comment>
                    <comment id="11394" author="shurakai" created="Sat, 16 Jan 2010 23:41:18 +0000"  >&lt;p&gt;Hi Roman,&lt;/p&gt;

&lt;p&gt;i ran the doctrine CLI tool and tried &quot;schema-tool&quot;. One of my PHP entities classes hadn&apos;t all properties defined in my YAML files (I&apos;m wondering why Doctrine needs to perform Reflection on my PHP classes when converting from YAML...?) and I recieve this error:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt; PHP Fatal error:  Uncaught exception &apos;ReflectionException&apos; with message &apos;Property children does not exist&apos; in /var/workspaces/project/library/Doctrine/ORM/Mapping/ClassMetadata.php:244&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 /var/workspaces/project/library/Doctrine/ORM/Mapping/ClassMetadata.php(244): ReflectionClass-&amp;gt;getProperty(&apos;children&apos;)&lt;br/&gt;
#1 /var/workspaces/project/library/Doctrine/ORM/Mapping/ClassMetadataInfo.php(1298): Doctrine\ORM\Mapping\ClassMetadata-&amp;gt;_storeAssociationMapping(Object(Doctrine\ORM\Mapping\OneToManyMapping))&lt;br/&gt;
#2 /var/workspaces/project/library/Doctrine/ORM/Mapping/Driver/YamlDriver.php(266): Doctrine\ORM\Mapping\ClassMetadataInfo-&amp;gt;mapOneToMany(Array)&lt;br/&gt;
#3 /var/workspaces/project/library/Doctrine/ORM/Mapping/ClassMetadataFactory.php(195): Doctrine\ORM\Mapping\Driver\YamlDriver-&amp;gt;loadMetadataForClass(&apos;Core\Block\Item...&apos;, Object(Doctrine\ORM\Mapping\ClassMetadata))&lt;br/&gt;
#4 /var/workspaces/project/library/Doctrine/ORM/Mapping/ClassMetadataFactory.php(111): Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;_loadMetadata(&apos;Core\Block\Item...&apos;)&lt;br/&gt;
#5 /va in /var/workspaces/project/library/Doctrine/ORM/Mapping/ClassMetadata.php on line 244&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;The problem here is, that I&apos;m not told in which class the problem occurs because PHP automatically shortens the parameters displayed. Therefore, I need to guess, and thats definitely something I don&apos;t want to do.&lt;/p&gt;

&lt;p&gt;The errormessage I&apos;d like to see:&lt;/p&gt;

&lt;p&gt;&amp;lt;ReflectionExceptionMessage&amp;gt;. The error occurred in class &amp;lt;namespace&amp;gt;&amp;lt;className&amp;gt;.&lt;/p&gt;

&lt;p&gt;So in this case:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Property children does not exist. The error occurred in class Core\Block\Item\Panel\AbstractPanel&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    <comment id="11441" author="shurakai" created="Thu, 21 Jan 2010 18:47:13 +0000"  >&lt;p&gt;This should fix this issue&lt;/p&gt;</comment>
                    <comment id="11442" author="guilhermeblanco" created="Thu, 21 Jan 2010 19:52:59 +0000"  >&lt;p&gt;In r7041 this issue was fixed.&lt;/p&gt;

&lt;p&gt;Thanks for the patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10307" name="Mapping.patch" size="4591" author="shurakai" created="Thu, 21 Jan 2010 19:02:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-256] AnnotationExporter does not support inheritanceType</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-256</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The inheritanceType was simply forgotten when exporting. The attached file does add this functionality!&lt;/p&gt;</description>
                <environment></environment>
            <key id="10731">DDC-256</key>
            <summary>AnnotationExporter does not support inheritanceType</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jan 2010 21:08:00 +0000</created>
                <updated>Mon, 8 Mar 2010 22:03:52 +0000</updated>
                    <resolved>Mon, 8 Mar 2010 22:03:52 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11392" author="shurakai" created="Fri, 15 Jan 2010 19:36:38 +0000"  >&lt;p&gt;The patch however does not support the discriminator column, so this needs to be additionally added. sorry for that...&lt;/p&gt;</comment>
                    <comment id="12059" author="guilhermeblanco" created="Mon, 8 Mar 2010 22:03:52 +0000"  >&lt;p&gt;In r7321 this issue was fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10285" name="doctrine_annotation_inheritance_fix.patch" size="1746" author="shurakai" created="Thu, 14 Jan 2010 21:08:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-254] Improved MappingException class &amp; usage of these in ManyToManyMapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-254</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I added a new Exception method and changed the way its used in the Many2Many class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10723">DDC-254</key>
            <summary>Improved MappingException class &amp; usage of these in ManyToManyMapping</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jan 2010 15:34:16 +0000</created>
                <updated>Thu, 14 Jan 2010 15:49:10 +0000</updated>
                    <resolved>Thu, 14 Jan 2010 15:49:10 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11379" author="guilhermeblanco" created="Thu, 14 Jan 2010 15:49:10 +0000"  >&lt;p&gt;In r7026 this patch was applied! Thanks for providing it to us!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10283" name="doctrine_exception_added.patch" size="2164" author="shurakai" created="Wed, 13 Jan 2010 15:34:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-251] ArrayCollection::__construct() must be an array, object given</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-251</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Running index.php in the Doctrine2 sandbox results in a fatal error:&lt;br/&gt;
PHP Catchable fatal error:  Argument 1 passed to Doctrine\Common\Collections\ArrayCollection::__construct() must be an array, object given, called in /home/bjori/doctrine2/lib/Doctrine/ORM/UnitOfWork.php on line 468 and defined in /home/bjori/doctrine2/lib/Doctrine/Common/Collections/ArrayCollection.php on line 53&lt;/p&gt;

&lt;p&gt;Unsure what exactly is going on, but this is the smallest reproduce case I have managed to create.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10719">DDC-251</key>
            <summary>ArrayCollection::__construct() must be an array, object given</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="bjori">Hannes Magnusson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jan 2010 11:35:08 +0000</created>
                <updated>Mon, 18 Jan 2010 19:12:17 +0000</updated>
                    <resolved>Mon, 18 Jan 2010 12:50:51 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11410" author="romanb" created="Mon, 18 Jan 2010 12:39:19 +0000"  >&lt;p&gt;I think I&apos;ve found the issue. Its a bug in the lazy-load code of OneToOneMapping (which is also used for ManyToOne).&lt;/p&gt;

&lt;p&gt;I am going to fix it.&lt;/p&gt;

&lt;p&gt;Note, however, that self-referencing association + inheritance on a base type is currently a very bad combination because it basically causes the whole object tree to be loaded (the whole table). Say we have a standard parent-child (one-to-many) without inheritance. Each object has 1 parent and many children. When you query for any object (without joining anything) the children field is set to an empty collection and the parent field is set to a proxy object, so only 1 database query as expected.&lt;/p&gt;

&lt;p&gt;Now comes inheritance into the game. More specifically, if the targetEntity of the &quot;parent&quot; field is not an outermost subtype. That causes Doctrine to not be able to use a proxy as the parent, because the proxy might have the wrong type! So it is forced to load the object.&lt;/p&gt;</comment>
                    <comment id="11411" author="romanb" created="Mon, 18 Jan 2010 12:47:00 +0000"  >&lt;p&gt;I&apos;ll make this clear in an example.&lt;/p&gt;

&lt;p&gt;The following is unproblematic:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Category {
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $parentCategory;
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $childCategories;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following is also unproblematic, where the parent always is an outermost subtype:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Category {
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $parentCategory; &lt;span class=&quot;code-comment&quot;&gt;// targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;SpecialCategory&quot;&lt;/span&gt;
&lt;/span&gt;   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $childCategories;
}
class SpecialCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Category {
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following however &lt;b&gt;is&lt;/b&gt; problematic:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Category {
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $parentCategory; &lt;span class=&quot;code-comment&quot;&gt;// targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Category&quot;&lt;/span&gt;
&lt;/span&gt;   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $childCategories;
}
class SpecialCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Category {
}
class AnotherSpecialCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Category {
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine cant put a CategoryProxy into &quot;parent&quot;, because &quot;parent&quot; might be a subtype (SpecialCategory or AnotherSpecialCategory) thus it does not know which proxy to use.&lt;/p&gt;

&lt;p&gt;To better solve this it would require transparently joining at least the discriminator column of the parent entity but that is a quite tricky.&lt;/p&gt;</comment>
                    <comment id="11412" author="romanb" created="Mon, 18 Jan 2010 12:50:51 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                    <comment id="11418" author="bjori" created="Mon, 18 Jan 2010 19:12:17 +0000"  >&lt;p&gt;Thanks for the explanation, and the fix! &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10280" name="Collection.php" size="963" author="bjori" created="Wed, 13 Jan 2010 11:35:08 +0000" />
                    <attachment id="10281" name="index.php" size="1888" author="bjori" created="Wed, 13 Jan 2010 11:35:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-249] QueryBuilder documentation states that select() takes an array, but expects strings</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-249</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you try to execute something like&lt;/p&gt;

&lt;p&gt;$qb-&amp;gt;select(array(&apos;u&apos;, &apos;a&apos;))&lt;br/&gt;
      -&amp;gt;from(&apos;Entities\User&apos;, &apos;u&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;Entities\Address&apos;, &apos;a&apos;)&lt;br/&gt;
      -&amp;gt;where(&apos;u.age = 23&apos;);&lt;/p&gt;

&lt;p&gt;which should be correct if one takes a look at the third example here: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/query-builder#the-querybuilder:working-with-querybuilder:helper-methods&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/query-builder#the-querybuilder:working-with-querybuilder:helper-methods&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then one will recieve an exception to be thrown, because the ORM\QueryBuilder::select() method makes an internal call for get_func_args() and therefore will pass an array within an array to the ORM\Query\Base class.&lt;/p&gt;

&lt;p&gt;In fact, I propose to change the internal of the select() method and check whether an array has been passed and if yes, do not call get_func_args().&lt;/p&gt;

&lt;p&gt;By the way, I think that arrays should be supported because it&apos;s much easier to dynamically pass an array as an argument than several strings.&lt;/p&gt;

&lt;p&gt;Regards&lt;br/&gt;
Christian&lt;/p&gt;</description>
                <environment></environment>
            <key id="10717">DDC-249</key>
            <summary>QueryBuilder documentation states that select() takes an array, but expects strings</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="shurakai">Christian Heinrich</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jan 2010 18:30:29 +0000</created>
                <updated>Thu, 14 Jan 2010 16:16:55 +0000</updated>
                    <resolved>Thu, 14 Jan 2010 16:16:55 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11380" author="guilhermeblanco" created="Thu, 14 Jan 2010 16:16:55 +0000"  >&lt;p&gt;In revisions 7027 and 7028 this issue was fixed!&lt;/p&gt;

&lt;p&gt;Thanks for pointing out this mis-behavior of QueryBuilder!&lt;/p&gt;

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

<item>
            <title>[DDC-248] Exception is thrown during deserialization of the class &apos;ClassMetadata&apos; if it contains child type</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-248</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a class hierarchy:&lt;br/&gt;
resource (id, type, name)&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;---&amp;gt; module ()&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;---&amp;gt; controller (ref to module)&lt;br/&gt;
&amp;#45;--&amp;gt; action (ref to controller)&lt;br/&gt;
It is mapped with inheritamce type = &quot;JOINED&quot;&lt;br/&gt;
During the class ClassMetadata deserialization exception belows is thrown:&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;



&lt;p&gt;ReflectionException: Property id does not exist in E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadata.php on line 362&lt;/p&gt;

&lt;p&gt;Call Stack:&lt;br/&gt;
    0.0003     334120   1. &lt;/p&gt;
{main}
&lt;p&gt;() E:\Projects\DoctrineTest\index.php:0&lt;br/&gt;
    0.0291    2124544   2. Doctrine\ORM\EntityManager-&amp;gt;find() E:\Projects\DoctrineTest\index.php:24&lt;br/&gt;
    0.0291    2124544   3. Doctrine\ORM\EntityManager-&amp;gt;getRepository() E:\Projects\portal\library\Doctrine\ORM\EntityManager.php:308&lt;br/&gt;
    0.0291    2124544   4. Doctrine\ORM\EntityManager-&amp;gt;getClassMetadata() E:\Projects\portal\library\Doctrine\ORM\EntityManager.php:489&lt;br/&gt;
    0.0291    2124544   5. Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;getMetadataFor() E:\Projects\portal\library\Doctrine\ORM\EntityManager.php:220&lt;br/&gt;
    0.0291    2124608   6. Doctrine\Common\Cache\AbstractCache-&amp;gt;fetch() E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadataFactory.php:133&lt;br/&gt;
    0.0292    2124608   7. CacheDriver-&amp;gt;_doFetch() E:\Projects\portal\library\Doctrine\Common\Cache\AbstractCache.php:89&lt;br/&gt;
    0.0292    2124608   8. CacheDriver-&amp;gt;init() E:\Projects\DoctrineTest\CacheDriver.php:61&lt;br/&gt;
    0.0293    2127872   9. unserialize() E:\Projects\DoctrineTest\CacheDriver.php:49&lt;br/&gt;
    0.0336    2609432  10. Doctrine\ORM\Mapping\ClassMetadata-&amp;gt;__wakeup() E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadata.php:0&lt;br/&gt;
    0.0340    2633128  11. ReflectionClass-&amp;gt;getProperty() E:\Projects\portal\library\Doctrine\ORM\Mapping\ClassMetadata.php:362&lt;br/&gt;
I have attached file with sample code.. I hope it will be helpful&lt;/p&gt;</description>
                <environment>PHP 5.3.1 Win32 (XP SP3), pdo_mysql, AnnotationDriver used</environment>
            <key id="10711">DDC-248</key>
            <summary>Exception is thrown during deserialization of the class &apos;ClassMetadata&apos; if it contains child type</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="cloun">Valery Dubrava</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jan 2010 12:43:07 +0000</created>
                <updated>Fri, 15 Jan 2010 13:34:42 +0000</updated>
                    <resolved>Fri, 15 Jan 2010 13:34:42 +0000</resolved>
                                            <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11362" author="cloun" created="Mon, 11 Jan 2010 14:01:02 +0000"  >&lt;p&gt;I have found workaround: &lt;br/&gt;
1. add to returned by the __sleep method array &apos;reflClass&apos; and &apos;reflFields&apos; fields.&lt;br/&gt;
2. write code for recreating the ReflectionClass and ReflectionPropery objects (I think this is a PHP error, Reflection* classes is restored in wrong state). It looks like code below:&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; 
        $this-&amp;gt;reflClass = new \ReflectionClass($this-&amp;gt;reflClass-&amp;gt;name);
        foreach ($this-&amp;gt;reflFields as $field =&amp;gt; $reflField) {
            $this-&amp;gt;reflFields[$field] = new \ReflectionProperty($reflField-&amp;gt;class, $reflField-&amp;gt;name);
            $this-&amp;gt;reflFields[$field]-&amp;gt;setAccessible(true);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="11363" author="cloun" created="Mon, 11 Jan 2010 14:20:28 +0000"  >&lt;p&gt;Sorry, but my workaround doesn&apos;t work =(&lt;/p&gt;</comment>
                    <comment id="11388" author="wb" created="Fri, 15 Jan 2010 12:24:11 +0000"  >&lt;p&gt;The issue seems to be that ReflectionClass::getProperty() will only return properties that are defined directly by the class. The attached patch seems to resolve the issue for me.&lt;/p&gt;</comment>
                    <comment id="11389" author="romanb" created="Fri, 15 Jan 2010 13:10:03 +0000"  >&lt;p&gt;Thanks for the patch but I think there is a better (faster) way to resolve this as we know when a field stems from a superclass and the name of that class.&lt;/p&gt;

&lt;p&gt;I will commit a patch soon.&lt;/p&gt;</comment>
                    <comment id="11390" author="romanb" created="Fri, 15 Jan 2010 13:34:42 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10287" name="ClassMetadata.php.patch" size="1841" author="wb" created="Fri, 15 Jan 2010 12:24:11 +0000" />
                    <attachment id="10278" name="DoctrineTest.zip" size="4150" author="cloun" created="Mon, 11 Jan 2010 12:43:07 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-243] XML many-to-many mapping broken and xsd incomplete</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-243</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;ol&gt;
	&lt;li&gt;There is a typo in XML driver - element should be named mapped-by, not mappedBy &lt;a href=&quot;http://trac.doctrine-project.org/browser/trunk/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php?rev=7007#L319&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/trunk/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php?rev=7007#L319&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;mapped-by attribute is missing in XSD definition of many-to-many element&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
            <key id="10692">DDC-243</key>
            <summary>XML many-to-many mapping broken and xsd incomplete</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="koubas">Jakub Hus&#225;k</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Jan 2010 16:49:31 +0000</created>
                <updated>Wed, 6 Jan 2010 17:21:04 +0000</updated>
                    <resolved>Wed, 6 Jan 2010 17:21:04 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11342" author="romanb" created="Wed, 6 Jan 2010 17:21:04 +0000"  >&lt;p&gt;Should be fixed now. Thanks for reporting!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-238] PersistentCollection is not initialized when toArray() is called</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-238</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When receiving entities from the database, collections are received as PersistentCollection objects. &lt;/p&gt;

&lt;p&gt;A PersistentCollectionmay not be initialized (i.e. its elements are not loaded), this is done via &quot;_initialize()&quot; when the elements are accessed for the first time (i.e. forAll() or the corresponding &quot;foreach&quot; call). &lt;/p&gt;

&lt;p&gt;However when toArray() is called, the _initialize() call is missing, so the method may return an empty array even if the collection has elements.&lt;/p&gt;

&lt;p&gt;Shouldn&apos;t PersistentCollection::toArray() look like this?&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    public function toArray()
    {
        $this-&amp;gt;_initialize();
        return $this-&amp;gt;_coll-&amp;gt;toArray();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10682">DDC-238</key>
            <summary>PersistentCollection is not initialized when toArray() is called</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 10:59:48 +0000</created>
                <updated>Tue, 5 Jan 2010 11:46:08 +0000</updated>
                    <resolved>Tue, 5 Jan 2010 11:46:08 +0000</resolved>
                                            <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11321" author="romanb" created="Tue, 5 Jan 2010 11:08:54 +0000"  >&lt;p&gt;Right, we got this reported two times already (this is the third) so I guess I better go fix this now &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="11323" author="romanb" created="Tue, 5 Jan 2010 11:46:08 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="10629">DDC-216</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-242] CLONE - XML Mapping XSD file misses description of &lt;many-to-one&gt; element</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-242</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;still not fixed - missing many-to-one in sequence of entity element &lt;a href=&quot;http://trac.doctrine-project.org/browser/trunk/doctrine-mapping.xsd?rev=6969#L60&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/trunk/doctrine-mapping.xsd?rev=6969#L60&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;XML Mapping XSD file misses description of &amp;lt;many-to-one&amp;gt; element&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
            <key id="10690">DDC-242</key>
            <summary>CLONE - XML Mapping XSD file misses description of &lt;many-to-one&gt; element</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="koubas">Jakub Hus&#225;k</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Jan 2010 12:07:43 +0000</created>
                <updated>Wed, 6 Jan 2010 17:20:47 +0000</updated>
                    <resolved>Wed, 6 Jan 2010 17:20:47 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11335" author="beberlei" created="Wed, 6 Jan 2010 13:42:55 +0000"  >&lt;p&gt;Its in thre for me. It is even committed to the &lt;a href=&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot; class=&quot;external-link&quot;&gt;http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&lt;/a&gt; location already.&lt;/p&gt;</comment>
                    <comment id="11340" author="koubas" created="Wed, 6 Jan 2010 14:37:08 +0000"  >&lt;p&gt;The &amp;lt;many-to-one&amp;gt; tag it self is defined, but there is not specified, that &amp;lt;entity&amp;gt; can contain &amp;lt;many-to-one&amp;gt; elements. Or at least i don&apos;t see it and my Netbeans xml editor neither. Cache refreshed.&lt;/p&gt;</comment>
                    <comment id="11341" author="romanb" created="Wed, 6 Jan 2010 17:20:47 +0000"  >&lt;p&gt;Should be fixed now. Thanks for reporting!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-237] Proxies are not initialized during hydration of a fetch-joined assocation.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-237</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Proxies are not initialized during hydration of a fetch-joined assocation when the proxy already existed in the identity map (in an uninitialized state).&lt;/p&gt;

&lt;p&gt;Ref: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/ecd5d86580ed3497/022f2b7da2b9b7ff&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/ecd5d86580ed3497/022f2b7da2b9b7ff&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10680">DDC-237</key>
            <summary>Proxies are not initialized during hydration of a fetch-joined assocation.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="reinier.kip">Reinier Kip</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 09:07:44 +0000</created>
                <updated>Tue, 5 Jan 2010 11:46:48 +0000</updated>
                    <resolved>Tue, 5 Jan 2010 11:46:48 +0000</resolved>
                                            <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-240] PATCH: StandardEntityPersister-&gt;delete should use column names instead of field names</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-240</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="10686">DDC-240</key>
            <summary>PATCH: StandardEntityPersister-&gt;delete should use column names instead of field names</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="dennis.verspuij">Dennis Verspuij</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 15:29:45 +0000</created>
                <updated>Tue, 5 Jan 2010 17:08:37 +0000</updated>
                    <resolved>Tue, 5 Jan 2010 17:08:37 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11327" author="guilhermeblanco" created="Tue, 5 Jan 2010 17:08:37 +0000"  >&lt;p&gt;In r7005 this issue was fixed! Thanks for the report and patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10266" name="StandardEntityPersister.php.patch" size="648" author="dennis.verspuij" created="Tue, 5 Jan 2010 15:29:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-236] uniqueConstraints annotation is not consistant with indexes annotation</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-236</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It is not possible to name an unique constraint like we would do for an index.&lt;/p&gt;

&lt;p&gt;If you look at ORM/Mapping/Driver/AnnotationDriver:99 in trunk, you will see that improvement done for index have not been ported to uniqueConstraints.&lt;/p&gt;

&lt;div class=&quot;code panel&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; ($tableAnnot-&amp;gt;indexes !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                foreach ($tableAnnot-&amp;gt;indexes as $indexAnnot) {
                    $primaryTable[&apos;indexes&apos;][$indexAnnot-&amp;gt;name] = array(&apos;columns&apos; =&amp;gt; $indexAnnot-&amp;gt;columns);
                }
            }
            
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($tableAnnot-&amp;gt;uniqueConstraints !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                foreach ($tableAnnot-&amp;gt;uniqueConstraints as $uniqueConstraint) {
                    $primaryTable[&apos;uniqueConstraints&apos;][] = $uniqueConstraint-&amp;gt;columns;
                }
            }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10678">DDC-236</key>
            <summary>uniqueConstraints annotation is not consistant with indexes annotation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="rickdt">Eric Durand-Tremblay</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jan 2010 21:49:44 +0000</created>
                <updated>Wed, 6 Jan 2010 13:25:03 +0000</updated>
                    <resolved>Wed, 6 Jan 2010 13:25:03 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11329" author="guilhermeblanco" created="Tue, 5 Jan 2010 19:15:58 +0000"  >&lt;p&gt;First attempt to fix unique naming issues and support.&lt;/p&gt;</comment>
                    <comment id="11332" author="guilhermeblanco" created="Wed, 6 Jan 2010 02:13:05 +0000"  >&lt;p&gt;Second attempt to fix this issue... unit tests are passing now.&lt;/p&gt;

&lt;p&gt;Try to incorporate it and check if it works smoothly. I&apos;ll commit this as soon as I get a feedback from you.&lt;/p&gt;

&lt;p&gt;Also Benjamin is reviewing it against all supported databases.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="11334" author="guilhermeblanco" created="Wed, 6 Jan 2010 13:25:03 +0000"  >&lt;p&gt;In r7007 this issue was fixed.&lt;/p&gt;

&lt;p&gt;Patch was tested successfully over SQLite, MySQL and PostgreSQL.&lt;br/&gt;
Oracle is ok also.&lt;/p&gt;

&lt;p&gt;If you have any related problems, reopen the issue.&lt;/p&gt;


&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10269" name="patch.diff" size="15101" author="guilhermeblanco" created="Wed, 6 Jan 2010 02:13:05 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-234] CLONE -createQueryBuilder does not insert alias into &quot;from&quot; part</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-234</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using createQueryBuilder() the dql created throws an error when executed:&lt;/p&gt;

&lt;p&gt;Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got &apos;LEFT&apos;&lt;/p&gt;

&lt;p&gt;The dql created is missing the alias after &quot;from&quot;.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="10675">DDC-234</key>
            <summary>CLONE -createQueryBuilder does not insert alias into &quot;from&quot; part</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="cloun">Valery Dubrava</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jan 2010 14:16:07 +0000</created>
                <updated>Wed, 6 Jan 2010 11:39:02 +0000</updated>
                    <resolved>Tue, 5 Jan 2010 17:12:09 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11311" author="cloun" created="Mon, 4 Jan 2010 14:17:48 +0000"  >&lt;p&gt;The same issue in trunk&lt;/p&gt;</comment>
                    <comment id="11312" author="guilhermeblanco" created="Mon, 4 Jan 2010 16:41:26 +0000"  >&lt;p&gt;You must define an alias for all situations (update and select queries included).&lt;/p&gt;

&lt;p&gt;Closing ticket. If I made something wrong, reopen it and provide more informations.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="11320" author="cloun" created="Tue, 5 Jan 2010 06:13:03 +0000"  >&lt;p&gt;Thanks for fix, but it is not all. Please, look at EntityRepository-&amp;gt;createQueryBuilder method. Specified alias is not pushed into &apos;from&apos; method. I suggest:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;public function createQueryBuilder($alias)
{
   return $this-&amp;gt;_em-&amp;gt;createQueryBuilder()
        -&amp;gt;select($alias)
        -&amp;gt;from($this-&amp;gt;_entityName, $alias); //the second parameter lost
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11328" author="guilhermeblanco" created="Tue, 5 Jan 2010 17:12:09 +0000"  >&lt;p&gt;In r7006 this issue was fixed. Thanks for the clear report now... it saves quite some time =)&lt;br/&gt;
Also thanks for the patch!&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="11333" author="cloun" created="Wed, 6 Jan 2010 11:39:02 +0000"  >&lt;p&gt;Thanks for fix =)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-223] Alternative for $globalArguments after CLI refactoring</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-223</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The previous $globalArguments functionality from the CLI is now missing.&lt;/p&gt;

&lt;p&gt;There needs to be an alternative, unless it is intended to drop this functionality entirely.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10650">DDC-223</key>
            <summary>Alternative for $globalArguments after CLI refactoring</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Dec 2009 21:22:03 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:45 +0000</updated>
                    <resolved>Wed, 6 Jan 2010 17:36:07 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11280" author="romanb" created="Tue, 22 Dec 2009 23:07:52 +0000"  >&lt;p&gt;If we want to drop this functionality entirely, it needs to be removed from the documentation.&lt;/p&gt;

&lt;p&gt;Do you want to reintroduce it?&lt;/p&gt;</comment>
                    <comment id="11281" author="guilhermeblanco" created="Tue, 22 Dec 2009 23:49:41 +0000"  >&lt;p&gt;Docs have already been updated, only the cache that needs to be removed to allow docs to be updated on live.&lt;/p&gt;</comment>
                    <comment id="11282" author="romanb" created="Wed, 23 Dec 2009 12:16:05 +0000"  >&lt;p&gt;The Introduction chapter is not updated. It contains the quick tutorial. See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-224&quot; title=&quot;CLI examples are incorrect&quot;&gt;&lt;del&gt;DDC-224&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="11283" author="romanb" created="Wed, 23 Dec 2009 12:16:48 +0000"  >&lt;p&gt;I ask again: Do you want to &lt;b&gt;drop&lt;/b&gt; this functionality or &lt;b&gt;reintroduce&lt;/b&gt; it in another way?&lt;/p&gt;</comment>
                    <comment id="11343" author="guilhermeblanco" created="Wed, 6 Jan 2010 17:36:07 +0000"  >&lt;p&gt;In r7014 this issue was fixed.&lt;/p&gt;

&lt;p&gt;Documentation still must be updated and unit tests to be done.&lt;/p&gt;

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

<item>
            <title>[DDC-224] CLI examples are incorrect</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-224</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In the PDF documentation page 10 item 1 of the Mini tutorial it says to run php doctrine schema-tool --create but that gives an error  task &apos;schema tool&apos; doesn&apos;t exist in &apos;Core&apos;. What seems to work is php doctrine orm:schema-tool --create&lt;/p&gt;
</description>
                <environment>PDF Documentation</environment>
            <key id="10651">DDC-224</key>
            <summary>CLI examples are incorrect</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="kanundrum">akeem philbert</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Dec 2009 21:45:42 +0000</created>
                <updated>Wed, 23 Dec 2009 15:59:02 +0000</updated>
                    <resolved>Wed, 23 Dec 2009 15:59:02 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11279" author="romanb" created="Tue, 22 Dec 2009 21:50:16 +0000"  >&lt;p&gt;Yes, the documentation needs to be updated. The CLI has undergone some changes very recently. Apparently not all documentation has been updated.&lt;/p&gt;

&lt;p&gt;Assigning this to Guilherme.&lt;/p&gt;</comment>
                    <comment id="11284" author="guilhermeblanco" created="Wed, 23 Dec 2009 15:59:02 +0000"  >&lt;p&gt;In r6980 this issue was fixed. Now wait until docs to be regenerated.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-216] PersistentCollection#toArray() should call _initialize()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-216</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Calling toArray on a PersistentCollection does not initialize the collection. This means that a not yet initialized collection returns an empty array. This is not expected behavior. The user expects the collection to be initialized and the objects returned. Calling count first is a workaround to initialize the array because count calls _initialize.&lt;/p&gt;

&lt;p&gt;A use case is an accessor wanting to return an array to not expose the collection to modification.&lt;/p&gt;</description>
                <environment>Doctrine trunk</environment>
            <key id="10629">DDC-216</key>
            <summary>PersistentCollection#toArray() should call _initialize()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Dec 2009 18:05:44 +0000</created>
                <updated>Tue, 5 Jan 2010 11:45:59 +0000</updated>
                    <resolved>Tue, 5 Jan 2010 11:45:59 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11322" author="romanb" created="Tue, 5 Jan 2010 11:45:59 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="10682">DDC-238</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="10672">DDC-232</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-215] not null is not working using YAML</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-215</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;ve created this:&lt;/p&gt;

&lt;p&gt;Test:&lt;br/&gt;
  type: entity&lt;br/&gt;
  table: test&lt;br/&gt;
  fields:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer&lt;br/&gt;
      id: true&lt;br/&gt;
      generator:&lt;br/&gt;
        strategy: auto&lt;br/&gt;
      sequenceGenerator:&lt;br/&gt;
        sequenceName: test_id_seq&lt;br/&gt;
        allocationSize: 1&lt;br/&gt;
        initialValue: 1&lt;br/&gt;
    nome:&lt;br/&gt;
      type: string&lt;br/&gt;
      length: 300&lt;br/&gt;
    sigla:&lt;br/&gt;
      type: string&lt;br/&gt;
      length: 5&lt;br/&gt;
      notnull: false&lt;/p&gt;

&lt;p&gt;result:&lt;br/&gt;
CREATE TABLE test (id INT NOT NULL, nome TEXT NOT NULL, sigla VARCHAR(5) DEFAULT NOT NULL, PRIMARY KEY(id))&lt;br/&gt;
CREATE SEQUENCE test_id_seq INCREMENT BY 1 START 1&lt;/p&gt;

&lt;p&gt;I debuged doctrine&apos;s code and saw in the &lt;br/&gt;
lib/Doctrine/ORM/Tools/SchemaTool.php on _gatherColumn method &lt;br/&gt;
that is tested &lt;br/&gt;
$column&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt; = isset($mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;) ? ! $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt; : true; &lt;br/&gt;
on line 266&lt;/p&gt;

&lt;p&gt;but in lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php there&apos;s not any check for &apos;nullable&apos;, just &apos;notnull&apos;...&lt;br/&gt;
on line 193 there&apos;s this validation:&lt;br/&gt;
if (isset($fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;)) {;&lt;br/&gt;
    $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt; = $fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;if I insert this validation:&lt;br/&gt;
if (isset($fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;)) {;&lt;br/&gt;
    $mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt; = $fieldMapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;nullable&amp;#39;&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;it&apos;s gonna work just fine...&lt;/p&gt;</description>
                <environment>linux/php 5.3</environment>
            <key id="10625">DDC-215</key>
            <summary>not null is not working using YAML</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="hgirardi">Henrique Girardi dos Santos</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Dec 2009 18:44:03 +0000</created>
                <updated>Sat, 19 Dec 2009 13:52:59 +0000</updated>
                    <resolved>Sat, 19 Dec 2009 13:52:59 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-211] Exception is thrown after many calls to flush()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-211</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Two classes having a many-to-many association:&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;namespace Entity;

/**
 * @Entity
 * @Table(name=&quot;user&quot;)
*/
class User
{
    /**
     * @Id
     * @Column(name=&quot;id&quot;, type=&quot;integer&quot;)
     * @GeneratedValue(strategy=&quot;AUTO&quot;)
     */
    protected $id;

    /**
     * @Column(name=&quot;name&quot;, type=&quot;string&quot;)
     */
    protected $name;

    /**
    * @ManyToMany(targetEntity=&quot;Group&quot;)
    *   @JoinTable(name=&quot;user_groups&quot;,
    *       joinColumns={@JoinColumn(name=&quot;user_id&quot;, referencedColumnName=&quot;id&quot;)},
    *       inverseJoinColumns={@JoinColumn(name=&quot;group_id&quot;, referencedColumnName=&quot;id&quot;)}
    *   )
    */
    protected $groups;

    public function __construct() {
        $this-&amp;gt;groups = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function setName($name) { $this-&amp;gt;name = $name; }

    public function getGroups() { return $this-&amp;gt;groups; }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;namespace Entity;

/**
 * @Entity
 * @Table(name=&quot;groups&quot;)
 */
class Group
{
    /**
     * @Id
     * @Column(name=&quot;id&quot;, type=&quot;integer&quot;)
     * @GeneratedValue(strategy=&quot;AUTO&quot;)
     */
    protected $id;

    /**
     * @Column(name=&quot;name&quot;, type=&quot;string&quot;)
     */
    protected $name;

    /**
    * @ManyToMany(targetEntity=&quot;User&quot;, mappedBy=&quot;groups&quot;)
    */
    protected $users;

    public function __construct() {
        $this-&amp;gt;users = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function setName($name) { $this-&amp;gt;name = $name; }

    public function getUsers() { return $this-&amp;gt;users; }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Fill the database with some data:&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;$em = EntityManager::create($connectionOptions, $config);

$user = new \Entity\User();
$user-&amp;gt;setName(&apos;John Doe&apos;);

$em-&amp;gt;persist($user);
$em-&amp;gt;flush();

$groupNames = array(&apos;group 1&apos;, &apos;group 2&apos;, &apos;group 3&apos;, &apos;group 4&apos;);
foreach ($groupNames as $name) {

    $group = new \Entity\Group();
    $group-&amp;gt;setName($name);
    $em-&amp;gt;persist($group);
    $em-&amp;gt;flush();

    if (!$user-&amp;gt;getGroups()-&amp;gt;contains($group)) {
        $user-&amp;gt;getGroups()-&amp;gt;add($group);
        $group-&amp;gt;getUsers()-&amp;gt;add($user);
        $em-&amp;gt;flush();
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After the user was added to the third group, an exception is thrown:&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;PHP Fatal error:  Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &apos;1-1&apos; for key &apos;PRIMARY&apos;&apos; in /lib/Doctrine/DBAL/Connection.php:623
Stack trace:
#0 /lib/Doctrine/DBAL/Connection.php(623): PDOStatement-&amp;gt;execute(Array)
#1 /lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php(121): Doctrine\DBAL\Connection-&amp;gt;executeUpdate(&apos;INSERT INTO use...&apos;, Array)
#2 /lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php(101): Doctrine\ORM\Persisters\AbstractCollectionPersister-&amp;gt;insertRows(Object(Doctrine\ORM\PersistentCollection))
#3 /lib/Doctrine/ORM/UnitOfWork.php(306): Doctrine\ORM\Persisters\AbstractCollectionPersister-&amp;gt;update(Object(Doctrine\ORM\PersistentCollection))
#4 /lib/Doctrine/ORM/EntityManager.php(288): Doctrine\ORM\UnitOfWork-&amp;gt;commit()
#5 [...] in /lib/Doctrine/DBAL/Connection.php on line 623
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using the EchoSqlLogger a strange SQL statement becomes visible (after the user was added to &quot;group 3&quot;):&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;INSERT INTO groups (name) VALUES (?)
array(1) {
  [1]=&amp;gt;
  string(7) &quot;group 4&quot;
}
DELETE FROM user_groups WHERE user_id = ? AND group_id = ?
array(2) {
  [0]=&amp;gt;
  int(1)
  [1]=&amp;gt;
  int(3)
}
INSERT INTO user_groups (user_id, group_id) VALUES (?, ?)
array(2) {
  [0]=&amp;gt;
  int(1)
  [1]=&amp;gt;
  int(1)
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Where does the delete statement come from? There is none of that in the code.&lt;/p&gt;

&lt;p&gt;Interestingly the example works fine if the user is just added to three groups. If flush() is just called once at the end of the script, everything is fine too.&lt;/p&gt;

&lt;p&gt;Many calls to flush() are expected to slow down execution time and/or increase memory consumption, but should work properly.&lt;/p&gt;</description>
                <environment>PHP 5.3.1-0.dotdeb.0 with Suhosin-Patch (cli) (built: Nov 28 2009 17:11:24)&lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH&lt;br/&gt;
&lt;br/&gt;
MySQL 5.1.41</environment>
            <key id="10618">DDC-211</key>
            <summary>Exception is thrown after many calls to flush()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="baumgartl">Marco Baumgartl</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Dec 2009 14:08:54 +0000</created>
                <updated>Tue, 15 Dec 2009 18:41:55 +0000</updated>
                    <resolved>Tue, 15 Dec 2009 18:41:55 +0000</resolved>
                                            <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11187" author="nicokaiser" created="Tue, 15 Dec 2009 15:38:45 +0000"  >&lt;p&gt;The delete statement seems to come from &lt;b&gt;\Doctrine\ORM\PersistentCollection#getDeleteDiff()&lt;/b&gt;, which returns the entities from the association that should be deleted (in this case this happens iff you delete associations between M:N entities):&lt;/p&gt;

&lt;p&gt;This is done by an &lt;b&gt;array_udiff($this-&amp;gt;_snapshot, $this-&amp;gt;_coll-&amp;gt;toArray(), array($this, &apos;_compareRecords&apos;))&lt;/b&gt;, where _compareRecords is nothing more than &lt;b&gt;$a === $b&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;I modified getDeleteDiff() so it displays what it does and pasted the output here: &lt;a href=&quot;http://pastie.org/744175&quot; class=&quot;external-link&quot;&gt;http://pastie.org/744175&lt;/a&gt;&lt;br/&gt;
(the DIFF sections are only the DeleteDiffs). After successfully adding 3 Categories (303, 304, 305) Doctrine suddenly decides that the association Group&lt;span class=&quot;error&quot;&gt;&amp;#91;134&amp;#93;&lt;/span&gt;/Category&lt;span class=&quot;error&quot;&gt;&amp;#91;305&amp;#93;&lt;/span&gt; should be deleted, and then Group&lt;span class=&quot;error&quot;&gt;&amp;#91;134&amp;#93;&lt;/span&gt;/Category&lt;span class=&quot;error&quot;&gt;&amp;#91;303&amp;#93;&lt;/span&gt; (!!!) is re-inserted, which produces an exception of course.&lt;/p&gt;

&lt;p&gt;The full log with SQL is here &lt;a href=&quot;http://pastie.org/744183&quot; class=&quot;external-link&quot;&gt;http://pastie.org/744183&lt;/a&gt;  (here the Group has id 138 instead of 134).&lt;/p&gt;</comment>
                    <comment id="11188" author="romanb" created="Tue, 15 Dec 2009 17:08:31 +0000"  >&lt;p&gt;array_udiff is very weird. If anyone can explain me this behavior, I would be delighted:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Foo {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($val) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $val;
    }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
}

function compare($a, $b) {
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $a === $b ? 0 : 1;
}

$foo1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Foo(&apos;one&apos;);
$foo2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Foo(&apos;two&apos;);
$foo3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Foo(&apos;three&apos;);
$foo4 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Foo(&apos;four&apos;);
$foo5 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Foo(&apos;five&apos;);

$snapshot = array();
$coll = array($foo1);
var_dump(array_udiff($snapshot, $coll, &apos;compare&apos;));
&lt;span class=&quot;code-comment&quot;&gt;// =&amp;gt; array(0) { }
&lt;/span&gt;
$snapshot = array($foo1);
$coll = array($foo1, $foo2);
var_dump(array_udiff($snapshot, $coll, &apos;compare&apos;));
&lt;span class=&quot;code-comment&quot;&gt;// =&amp;gt; array(0) { }
&lt;/span&gt;
$snapshot = array($foo1, $foo2);
$coll = array($foo1, $foo2, $foo3);
var_dump(array_udiff($snapshot, $coll, &apos;compare&apos;));
&lt;span class=&quot;code-comment&quot;&gt;// =&amp;gt; array(0) { }
&lt;/span&gt;
$snapshot = array($foo1, $foo2, $foo3);
$coll = array($foo1, $foo2, $foo3, $foo4);
var_dump(array_udiff($snapshot, $coll, &apos;compare&apos;));
&lt;span class=&quot;code-comment&quot;&gt;// =&amp;gt; array(1) { [2]=&amp;gt;  object(Foo)#3 (2) { [&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;]=&amp;gt;  string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;three&quot;&lt;/span&gt; } } 
&lt;/span&gt;
$snapshot = array($foo1, $foo2, $foo3, $foo4);
$coll = array($foo1, $foo2, $foo3, $foo4, $foo5);
var_dump(array_udiff($snapshot, $coll, &apos;compare&apos;));
&lt;span class=&quot;code-comment&quot;&gt;// =&amp;gt; array(2) { [1]=&amp;gt;  object(Foo)#2 (2) { [&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;]=&amp;gt;  string(3) &lt;span class=&quot;code-quote&quot;&gt;&quot;two&quot;&lt;/span&gt; } [3]=&amp;gt;  object(Foo)#4 (2) { [&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;]=&amp;gt;  string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;four&quot;&lt;/span&gt; } } &lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The array_udiff behavior is the reason for this problem. I just dont understand it.&lt;/p&gt;

&lt;p&gt;According to the manual: &quot;Returns an array containing all the values of array1 ($snapshot in this case)  that are not present in any of the other arguments. &quot;&lt;/p&gt;</comment>
                    <comment id="11189" author="romanb" created="Tue, 15 Dec 2009 18:41:55 +0000"  >&lt;p&gt;This should now be fixed. We&apos;re using array_udiff_assoc instead which behaves as expected and is faster. Also, this is a necessary preparation for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-213&quot; title=&quot;Persist order of collections&quot;&gt;DDC-213&lt;/a&gt;. This can now lead to join-table elements being deleted and reinserted when they change position in the collection, however this is expected and indeed needed for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-213&quot; title=&quot;Persist order of collections&quot;&gt;DDC-213&lt;/a&gt;. I don&apos;t see this as an issue for &quot;unordered&quot; collections.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-207] XML Mapping XSD file misses description of &lt;many-to-one&gt; element</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-207</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;XML Mapping XSD file misses description of &amp;lt;many-to-one&amp;gt; element&lt;/p&gt;</description>
                <environment></environment>
            <key id="10606">DDC-207</key>
            <summary>XML Mapping XSD file misses description of &lt;many-to-one&gt; element</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Dec 2009 09:42:11 +0000</created>
                <updated>Sat, 19 Dec 2009 14:06:30 +0000</updated>
                    <resolved>Sat, 19 Dec 2009 14:06:30 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-208] AbstractQuery::getSingleResult() should throw exception if no row is found</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-208</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;AbstractQuery::getSingleResult() should throw exception if no row is found.&lt;/p&gt;

&lt;p&gt;This is also what JPA does, it throws a NoResultException, so we should add a Doctrine\ORM\NoResultException for this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10607">DDC-208</key>
            <summary>AbstractQuery::getSingleResult() should throw exception if no row is found</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Dec 2009 17:12:41 +0000</created>
                <updated>Fri, 18 Dec 2009 13:20:29 +0000</updated>
                    <resolved>Fri, 18 Dec 2009 13:20:29 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11179" author="beberlei" created="Sat, 12 Dec 2009 17:17:05 +0000"  >&lt;p&gt;This probably also affects EntityManager::find($class, $identifier) and EntityRepository::find($class, $identifier)&lt;/p&gt;</comment>
                    <comment id="11180" author="romanb" created="Sat, 12 Dec 2009 19:08:47 +0000"  >&lt;p&gt;As was discussed, find() should rather return the entity or null, if it was not found, since find() implies that you&apos;re not sure it is there.&lt;/p&gt;

&lt;p&gt;Contrary to that, getSingleResult() is a strong assumption about the fact that there is a result and thus no result is usually unexpected behavior. Hence in this case an exception might be the better fit.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-203] Detached entities are recognized as new ones</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-203</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;From&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects&lt;/a&gt;&lt;br/&gt;
on using persist() on an entity X:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;If X is a detached entity, an InvalidArgumentException will be thrown.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So I do this:&lt;br/&gt;
       $picard = $this-&amp;gt;_getUser(&apos;Picard&apos;);&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;persist($picard);&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;flush();&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;detach($picard);&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;persist($picard);&lt;br/&gt;
        $this-&amp;gt;_howMany(&quot;Picard&quot;, 1);&lt;br/&gt;
Result:&lt;br/&gt;
    1) NakedPhp\Storage\DoctrineTest::testSavesUpdatedEntities&lt;br/&gt;
    There are 2 instances of Picard saved instead of 1.&lt;br/&gt;
    Failed asserting that &amp;lt;string:2&amp;gt; matches expected &amp;lt;integer:1&amp;gt;.&lt;br/&gt;
The entity is recognized as new instead of detached, so no error is thrown and it is duplicated in the database.&lt;/p&gt;</description>
                <environment>Cli tests with PHPUnit&lt;br/&gt;
PHP 5.3.1 (cli) (built: Nov 27 2009 10:08:49) &lt;br/&gt;
PHPUnit 3.4.1</environment>
            <key id="10595">DDC-203</key>
            <summary>Detached entities are recognized as new ones</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="giorgiosironi">Giorgio Sironi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2009 16:34:15 +0000</created>
                <updated>Tue, 6 Jul 2010 06:03:30 +0000</updated>
                    <resolved>Tue, 6 Jul 2010 06:03:30 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11145" author="giorgiosironi" created="Wed, 9 Dec 2009 17:16:40 +0000"  >&lt;p&gt;Patch tentative. Resolved this bug but breaks another test of DetachedEntityTest, so I added another to make clear what is the issue: relying on keys to know if an entity is detached is not correct when entities have natural keys like CmsPhonenumber.&lt;br/&gt;
It seems that the only option would be hitting the database to see if the entity is already present.&lt;br/&gt;
Eliminating the error and simply persisting the entity anyway would not be cool because a duplicate will be created everytime entity is passed to persist(); even to pass it internally to merge() we have to know if it&apos;s new or detached.&lt;br/&gt;
A last option would be declaring: pass detached entities to persist at your own risk. It&apos;s normal for Doctrine not being aware of the difference between new and detached, if not &apos;detached&apos; would not be so detached if the Orm remembers it. I have no problem in keeping new entities separated from detached ones in my data structure. Or I can simply merge() all, catching exceptions and add the entity that resulted in exceptions with persist().&lt;/p&gt;</comment>
                    <comment id="11146" author="romanb" created="Wed, 9 Dec 2009 17:24:06 +0000"  >&lt;p&gt;Yes, that exactly is the problem and I am/was aware of this but hitting the database is a no-go for that. Determining the state (UnitOfWork#getEntityState) has to be very fast. So its just a matter of finding the best compromise.&lt;/p&gt;</comment>
                    <comment id="11151" author="giorgiosironi" created="Wed, 9 Dec 2009 19:12:33 +0000"  >&lt;p&gt;We can&apos;t save any information in Doctrine objects because serialized or cached entities travel between http requests and sessions. merge() uses the same assumption that entities without identifiers defined are new and when passing a phonenumber it gives a false protection because the defined natural key does not result always in a real entity in the database.&lt;br/&gt;
Substituting a proxy subclass which adds a $_state private property is definitely an overkill. I suggest removing the exception and assuming that detached objects should be passed to merge() before any operation is performed on them, and only detached objects should be passed to merge(). Behavior if other operations are done previously would be undefined.&lt;br/&gt;
The use case for the merge()/detach() methods is serialization/unserialization of objects from a cache. A developer would then only merge objects in the access point of the cache or on saving.&lt;/p&gt;</comment>
                    <comment id="11631" author="beberlei" created="Sun, 7 Feb 2010 09:16:25 +0000"  >&lt;p&gt;My take at this issue:&lt;/p&gt;

&lt;p&gt;1. _doPersist() assumes all entities are new. This is wrong.&lt;br/&gt;
2. An entity is new if it has no identifier.&lt;br/&gt;
3. Detached entities have identifiers.&lt;/p&gt;

&lt;p&gt;Now the heuristics:&lt;/p&gt;

&lt;p&gt;1. If the IdGenerator is NOT (Assigned &amp;lt;-&amp;gt; None) and we find identifiers then it is obviusly a detached Entity&lt;br/&gt;
2. If we dont find identifiers the entity is obviusly is new.&lt;/p&gt;

&lt;p&gt;Problematic case: IdGenerator is Assigned and we find identifiers: Here i assume the entity is new, by definition of an entity persist() leads to a duplicate key error and catches this error.&lt;/p&gt;

&lt;p&gt;I think this is the best approach.&lt;/p&gt;</comment>
                    <comment id="11632" author="beberlei" created="Sun, 7 Feb 2010 10:40:55 +0000"  >&lt;p&gt;Updated version that introduces the &quot;EntityExistsException&quot;&lt;/p&gt;</comment>
                    <comment id="11731" author="romanb" created="Tue, 16 Feb 2010 06:04:13 +0000"  >&lt;p&gt;The problem I have with this is that by doing this, every single entity passed to persist() gets its identifier read out using reflection just to determine whether its really new.&lt;/p&gt;

&lt;p&gt;I would rather change the contract and the documentation to clearly indicate that detached instances must not be passed to persist().&lt;/p&gt;</comment>
                    <comment id="11744" author="giorgiosironi" created="Tue, 16 Feb 2010 14:16:38 +0000"  >&lt;p&gt;There are no problems in a stricter contract for persist() if detached instances are kept separate from new ones in applications, which is usually true since they come from a cache or a store. I would go with the change as it&apos;s the simplest reliable solution.&lt;/p&gt;</comment>
                    <comment id="12857" author="romanb" created="Thu, 6 May 2010 07:18:59 +0000"  >&lt;p&gt;I updated the documentation to be more clear about this issue: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects:persisting-entities&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects:persisting-entities&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;The problem is, we can not do it reliably for all cases. Yes, we could look into the identifier property if the identifier is &lt;b&gt;generated&lt;/b&gt; and conclude from that whether it is detached or not but that does not work for manually assigned identifiers. For these we would need to hit the database and I just don&apos;t think we can do that.&lt;/p&gt;

&lt;p&gt;So right now changing the persist contract as I did in the documentation, explicitly stating that detached entities should not be passed to persist() and that the behavior is undefined if done so, is the &quot;best&quot; thing.&lt;/p&gt;

&lt;p&gt;Tell me what you think. The alternative would be to do the above (peek into identifier field of generated identifiers or look the identifier up in the db if it is assigned manually). I&apos;m pretty sure the JPA implementations do just that but I dont know for sure and I dont think we want that.&lt;/p&gt;

&lt;p&gt;I am still undecided though &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Something inside me prefers to go the other route, even if it means some additional db hits for manually assigned identifiers. Please make your vote.&lt;/p&gt;</comment>
                    <comment id="12860" author="giorgiosironi" created="Thu, 6 May 2010 13:35:12 +0000"  >&lt;p&gt;If an identifier is a natural key, and not generated,  a detached object of that class and a new one are really indistinguishable if they have the same values on the other columns.&lt;br/&gt;
I am for simplicity: the detached/merge entities are related to use cases like caches, sessions and serialization of every kind. So typically you in an application you always know when they come from such a source and can call merge() appropriately.&lt;br/&gt;
If calling persist() erroneously will result in throwing an exception &lt;b&gt;on flush()&lt;/b&gt; (primary key value already present), the application developer will notice the problem.&lt;/p&gt;</comment>
                    <comment id="13096" author="romanb" created="Thu, 3 Jun 2010 05:43:58 +0000"  >&lt;p&gt;Pushing final resolution back to beta3. The problem is that this missing detection of detached objects can lead to weird errors in other cases as well. Need to think about it some more.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11107">DDC-455</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10224" name="ddc-203.patch" size="2898" author="giorgiosironi" created="Wed, 9 Dec 2009 17:16:40 +0000" />
                    <attachment id="10354" name="ddc203-beberlei-update.patch" size="2995" author="beberlei" created="Sun, 7 Feb 2010 10:40:55 +0000" />
                    <attachment id="10351" name="ddc203-beberlei.patch" size="1312" author="beberlei" created="Sun, 7 Feb 2010 09:16:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-202] Left Joining on an empty previous join results spl_object_hash warning</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-202</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;ve marked this as minor because it does not seem to affect anything, other than raising a PHP warning, but that in itself suggests something is amiss somewhere.&lt;/p&gt;

&lt;p&gt;When joining twice (or more), all the joins must return some rows, else the warning: &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; 
Warning: spl_object_hash() expects parameter 1 to be object, array given in... /etc/etc/.../ObjectHydrator.php line 269
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;is raised.&lt;/p&gt;

&lt;p&gt;In my particular example, I am simulating a ManyToMany relationship via a join table, so have relations set up either side as OneToMany and ManyToOne. In order to retrieve the &quot;many&quot; records, I need to first join the link table, then join the records that the link table  specifies.&lt;/p&gt;

&lt;p&gt;If the link table join returns some rows then everything passes without incident, however if the link join returns no rows, then the above warning is raised.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10589">DDC-202</key>
            <summary>Left Joining on an empty previous join results spl_object_hash warning</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="russ">Russ Flynn (rooster)</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Dec 2009 23:03:48 +0000</created>
                <updated>Wed, 9 Dec 2009 13:51:26 +0000</updated>
                    <resolved>Wed, 9 Dec 2009 12:39:33 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11116" author="romanb" created="Wed, 9 Dec 2009 09:46:25 +0000"  >&lt;p&gt;Interesting. You&apos;re not initializing collections as arrays, are you?&lt;/p&gt;

&lt;p&gt;I mean sth 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;&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $foos = array();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;?&lt;/p&gt;</comment>
                    <comment id="11117" author="romanb" created="Wed, 9 Dec 2009 09:54:12 +0000"  >&lt;p&gt;I will try to reproduce this.&lt;/p&gt;</comment>
                    <comment id="11118" author="russ" created="Wed, 9 Dec 2009 10:03:59 +0000"  >&lt;p&gt;No, no parameter is being initialised.&lt;/p&gt;

&lt;p&gt;Array hydration works fine also, so currently I have this rather interesting 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;    $dql = &quot;SELECT p, c, etl FROM PdfTemplate p
            INNER JOIN p.collection c 
            LEFT JOIN p.emailTemplateLinks etl &quot;;
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($hydrationMode == \Doctrine\ORM\Query::HYDRATE_ARRAY)
    {
      &lt;span class=&quot;code-comment&quot;&gt;// Workaround whilst waiting &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; #DDC-202
&lt;/span&gt;      &lt;span class=&quot;code-comment&quot;&gt;// Empty joins cause spl_object_hash warning
&lt;/span&gt;      $dql .= &lt;span class=&quot;code-quote&quot;&gt;&quot; LEFT JOIN etl.emailTemplate et&quot;&lt;/span&gt;;
      $dql = str_replace(&lt;span class=&quot;code-quote&quot;&gt;&quot;etl FROM&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;etl, et FROM&quot;&lt;/span&gt;, $dql);
    }
    $dql.=  &lt;span class=&quot;code-quote&quot;&gt;&quot; WHERE c.id = :collection_id&quot;&lt;/span&gt;;
    $q = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery($dql);
    $q-&amp;gt;setParameter(&lt;span class=&quot;code-quote&quot;&gt;&quot;collection_id&quot;&lt;/span&gt;, $collectionId);
    
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $q-&amp;gt;execute(array(), $hydrationMode);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For reference, here are the other class annotations:&lt;/p&gt;

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

  /**
   * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Collection&quot;&lt;/span&gt;)
   * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;collection_id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Collection
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $collection;

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

  /**
   * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;text&quot;&lt;/span&gt;)
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $content;

  /**
   * Emails linked to &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; pdf
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; array
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $linkedEmailTemplates = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

  /**
   * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;EmailTemplatePdfTemplate&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;emailTemplate&quot;&lt;/span&gt;)
   * 
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; array
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $emailTemplateLinks;

.......

}
&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;class EmailTemplate &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; sfDoctrineActiveEntity
{
  /**
   * @Id
   * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
   * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

  /**
   * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Collection&quot;&lt;/span&gt;)
   * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;collection_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;var&lt;/span&gt; Collection
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $collection;


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

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

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


  /**
   * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $defaultReplyToAddress;

  /**
   * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;)
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; array
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $defaultCCAddresses; &lt;span class=&quot;code-comment&quot;&gt;// Fixme - the Doctrine array type is broken!
&lt;/span&gt;
  /**
   * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;text&quot;&lt;/span&gt;)
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $messageBody;

  /**
   * Pdf templates linked to/attached to &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; email
   *
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; array
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $linkedPdfTemplates = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

  /**
   * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;EmailTemplatePdfTemplate&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;emailTemplate&quot;&lt;/span&gt;)
   * 
   * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; array
   */
  &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $pdfTemplateLinks;

.....
}
&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;class EmailTemplatePdfTemplate
{
  /**
    * @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;protected&lt;/span&gt; $id;

  /**
   * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;EmailTemplate&quot;&lt;/span&gt;)
   * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;email_template_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; $emailTemplate;

  /**
   * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;PdfTemplate&quot;&lt;/span&gt;)
   * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pdf_template_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; $pdfTemplate;

....

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

&lt;p&gt;As you can see the only properties that are initialised (as null) are not annotated and are dealt with by the class internally. Could they have something to do with it?&lt;/p&gt;</comment>
                    <comment id="11120" author="romanb" created="Wed, 9 Dec 2009 10:57:20 +0000"  >&lt;p&gt;I dont think so. Your code looks absolutely correct. I am working on this. I already got it reproduced in the test suite.&lt;/p&gt;</comment>
                    <comment id="11129" author="romanb" created="Wed, 9 Dec 2009 12:39:33 +0000"  >&lt;p&gt;This should be fixed now in trunk.&lt;/p&gt;</comment>
                    <comment id="11134" author="russ" created="Wed, 9 Dec 2009 13:51:26 +0000"  >&lt;p&gt;Works for me when I remove my workaround (above). Good stuff.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-198] createQueryBuilder does not insert alias into &quot;from&quot; part</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-198</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using createQueryBuilder() the dql created throws an error when executed:&lt;/p&gt;

&lt;p&gt;Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got &apos;LEFT&apos;&lt;/p&gt;

&lt;p&gt;The dql created is missing the alias after &quot;from&quot;.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="10574">DDC-198</key>
            <summary>createQueryBuilder does not insert alias into &quot;from&quot; part</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="russ">Russ Flynn (rooster)</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Dec 2009 14:59:50 +0000</created>
                <updated>Tue, 8 Dec 2009 18:02:34 +0000</updated>
                    <resolved>Tue, 8 Dec 2009 18:02:34 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10217" name="EntityRepository-DDC-198.diff" size="408" author="russ" created="Mon, 7 Dec 2009 15:00:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-189] Implement SqlWalker::walkSingleValuedAssociationPathExpression()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-189</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine\ORM\Query\SqlWalker::walkSingleValuedAssociationPathExpression() needs to be implemented.&lt;/p&gt;

&lt;p&gt;This function is not found when trying to execute a query which references relations.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10547">DDC-189</key>
            <summary>Implement SqlWalker::walkSingleValuedAssociationPathExpression()</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="russ">Russ Flynn (rooster)</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 15:38:41 +0000</created>
                <updated>Mon, 22 Feb 2010 06:36:28 +0000</updated>
                    <resolved>Mon, 22 Feb 2010 06:33:06 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10970" author="romanb" created="Wed, 2 Dec 2009 16:24:04 +0000"  >&lt;p&gt;Please show an example of such a DQL query, the SQL you would expect to be generated and what query results you would expect. Thanks!&lt;/p&gt;</comment>
                    <comment id="10976" author="guilhermeblanco" created="Wed, 2 Dec 2009 18:25:53 +0000"  >&lt;p&gt;This situation falls into 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; u &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; \MyProject\Entities\User u &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; u.&lt;span class=&quot;code-keyword&quot;&gt;Group&lt;/span&gt; = 1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;User &amp;lt;=&amp;gt; Group is a manyToOne relation.&lt;/p&gt;

&lt;p&gt;I already inspected source and there&apos;s no implementation for that yet.&lt;br/&gt;
We should just decide rather how we&apos;ll support the composite PK situation.&lt;/p&gt;

&lt;p&gt;For the given example, it should throw an exception telling that Group is a composite PK.&lt;br/&gt;
But in this case:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; u &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; \MyProject\Entities\User u &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; u.&lt;span class=&quot;code-keyword&quot;&gt;Group&lt;/span&gt; = ?1
&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;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;$q-&amp;gt;setParameter(1, array(1, 2));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;div class=&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; (groups.pk_id1 = 1 AND groups.pk_id2 = 2)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Since we do not allow SingleValuedAssociationPathExpression in the InExpression, that would be enough.&lt;br/&gt;
If the user attempts to do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; ... &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; u.&lt;span class=&quot;code-keyword&quot;&gt;Group&lt;/span&gt; IN ?1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It&apos;ll through an expression, because of our supported grammar:&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;InExpression             ::= StateFieldPathExpression [&quot;NOT&quot;] &quot;IN&quot; &quot;(&quot; (InParameter {&quot;,&quot; InParameter}* | Subselect) &quot;)&quot;
StateFieldPathExpression ::= IdentificationVariable &quot;.&quot; StateField | SingleValuedAssociationPathExpression &quot;.&quot; StateField
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10977" author="russ" created="Wed, 2 Dec 2009 18:30:46 +0000"  >&lt;p&gt;I&apos;m not even sure if this functionality &lt;b&gt;should&lt;/b&gt; exist, but the problem was that the error came up as a function call to a method that did not exist!&lt;/p&gt;

&lt;p&gt;Anyway, the dql would be something like this:&lt;/p&gt;

&lt;p&gt;SELECT a FROM  Address a WHERE a.User = :user&lt;/p&gt;

&lt;p&gt;where user is a user object (ManyToOne)&lt;br/&gt;
If this functionality were to exist, I guess it could simply replicate this dql:&lt;/p&gt;

&lt;p&gt;SELECT a FROM  Address a WHERE a.User.id = :userId&lt;/p&gt;

&lt;p&gt;The reason this was a problem for us at the time, was that we did not know that the second option was available, and since it is not possible to define column names AND relations, we couldn&apos;t figure out how to run a simple query that included a relation. It turned out that I figured out that option 2 (above) was valid, and that&apos;s the route we went down&lt;/p&gt;

&lt;p&gt;Of course we had no reason to beleive that another option existed, since the only error presented to us was a PHP fatal error telling us that the function Doctrine\ORM\Query\SqlWalker::walkSingleValuedAssociationPathExpression()  did not exist.&lt;/p&gt;

&lt;p&gt;Either this could be implemented, or an exception thrown, rather than Doctrine trying to trigger a function that has not been implemented :o)&lt;/p&gt;

&lt;p&gt;Edit: I should have used a ManyToOne example since that was the code we used&lt;/p&gt;</comment>
                    <comment id="10978" author="romanb" created="Wed, 2 Dec 2009 19:08:42 +0000"  >&lt;p&gt;@Guilherme:&lt;/p&gt;

&lt;div class=&quot;code panel&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 \MyProject\Entities\User u WHERE u.Group = 1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That should never be valid.&lt;/p&gt;

&lt;div class=&quot;code panel&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 \MyProject\Entities\User u WHERE u.Group = ?1
$q-&amp;gt;setParameter(1, array(1, 2));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That should also never be valid as it makes no sense. You should pass the object, not the ids.&lt;/p&gt;

&lt;div class=&quot;code panel&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(1, $group);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But I think we&apos;re on the same page. Its just not as easy as it looks. Supporting this has lots of consequences and edge-cases.&lt;/p&gt;

&lt;p&gt;@Russ:&lt;/p&gt;

&lt;p&gt;I didnt even know this worked:&lt;/p&gt;

&lt;div class=&quot;code panel&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 a FROM Address a WHERE a.User.id = :userId
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Because generally, we decided against supporting nested paths as it leads to additional complexity for parsing and sql construction.&lt;br/&gt;
The above is also the same as 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;&quot;SELECT a FROM Address a JOIN a.User u WHERE u.id = :userId
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which I would recommend since it makes the join explicit.&lt;/p&gt;</comment>
                    <comment id="10983" author="russ" created="Wed, 2 Dec 2009 23:51:22 +0000"  >&lt;p&gt;@Roman: My only issue with the join suggestion is that from a performance and sql perspective it seems unnecessary.&lt;/p&gt;

&lt;p&gt;If I want to do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; a &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Address a &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; a.user_id = :userId
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I can&apos;t, because there is no user_id property (and as far as I know there can&apos;t be) so we have to refer to the object, so if using User.id avoids the join I&apos;m all for it. However, like you say, if there is some other magic going on behind that then you may be right that it&apos;s best avoided.&lt;/p&gt;

&lt;p&gt;So if all I need is an Address object (or array) and I want to look it up based on the owning User object, I want my sql to turn out as:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt; 
&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; address a &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; a.user_id = 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;In this case one extra join to make things &quot;clean&quot; is no biggy, but imagine in more complex cases with several relations when I know all the foreign key IDs involved it may introduce crippling overhead if we have to join all the necessary tables to be able to select based on the foreign ids.&lt;/p&gt;

&lt;p&gt;Do you see where I&apos;m coming from?&lt;/p&gt;</comment>
                    <comment id="10985" author="romanb" created="Thu, 3 Dec 2009 09:18:25 +0000"  >&lt;p&gt;@Russ: Yes, absolutely and I&apos;m with you.&lt;/p&gt;

&lt;p&gt;I will explain how it should be here, so that I dont have to remember later.&lt;/p&gt;

&lt;div class=&quot;code panel&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: SELECT a FROM Address a WHERE a.user = :user
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, the SQL depends on where the &quot;owning side&quot; (from doctrine&apos;s point fo view) is, in other words which side holds the FK.&lt;br/&gt;
If the address table holds the FK (user_id) the SQL should be like you have shown:&lt;/p&gt;

&lt;div class=&quot;code panel&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: SELECT a FROM addresses a WHERE a.user_id = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, if the foreign key is on the other side, theres no way around the join and the SQL 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;SQL: SELECT a FROM addresses a INNER JOIN users u ON a.id = u.address_id WHERE u.id = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of course, this should only be possible for X-to-one associations.&lt;/p&gt;

&lt;p&gt;You are right about that there should not be a user_id property or other properties for foreign keys in your objects. I mean, you &lt;b&gt;could&lt;/b&gt; do that, it would be treated as a normal field, but if you do that, you leak a part of the relational schema into your object model, because your objects have associations, not foreign keys. Foreign keys are how the relational database handles associations, not your objects.&lt;/p&gt;

&lt;p&gt;I hope that makes sense! I will certainly try to work on this.&lt;/p&gt;</comment>
                    <comment id="10987" author="romanb" created="Thu, 3 Dec 2009 10:20:27 +0000"  >&lt;p&gt;@Russ: Meanwhile you could use a NativeQuery to achieve the same.&lt;/p&gt;

&lt;p&gt;Take a look at: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/native-sql&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/native-sql&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This concept is extremely powerful as you can use any SQL you want. It is important to understand that what comes out at the end when DQL is processed is = SQL + ResultSetMapping!&lt;/p&gt;

&lt;p&gt;In your specific case, it could look 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;&lt;span class=&quot;code-comment&quot;&gt;// in some Repository/DAO class
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function findAddressForUser($userId) {
    $rsm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ResultSetMapping;
    $rsm-&amp;gt;addEntityResult(&apos;My\Domain\Address&apos;, &apos;a&apos;);
    $rsm-&amp;gt;addFieldResult(&apos;a&apos;, &apos;id&apos;, &apos;id&apos;);
    $rsm-&amp;gt;addFieldResult(&apos;a&apos;, &apos;city&apos;, &apos;city&apos;);
    &lt;span class=&quot;code-comment&quot;&gt;// ... more fields &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; there are any
&lt;/span&gt;
    $query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createNativeQuery(&apos;SELECT id, city FROM addresses WHERE user_id = ?&apos;, $rsm);
    $query-&amp;gt;setParameter(1, $userId);

    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $query-&amp;gt;getSingleResult();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It can be a bit tricky at times to get the ResultSetMapping right, but once you got the hang of it you can use the fanciest database-specific SQL and let Doctrine turn it into objects (or arrays or scalars) for you.&lt;/p&gt;</comment>
                    <comment id="11303" author="thecelavi" created="Sun, 27 Dec 2009 20:24:38 +0000"  >&lt;p&gt;Of course NativeQuery can help for us that are developing on Alpha version.&lt;/p&gt;

&lt;p&gt;Please, would you be so kind and add more examples, especially for one to one and one to many references and how to add these objects to EM in scope of work as UNCHANGED objects.&lt;/p&gt;</comment>
                    <comment id="11708" author="beberlei" created="Sun, 14 Feb 2010 09:41:03 +0000"  >&lt;p&gt;@Roman:&lt;/p&gt;

&lt;div class=&quot;code panel&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: SELECT a FROM Address a WHERE a.user IS NULL
DQL: SELECT a FROM Address a WHERE a.user IS NOT NULL
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;should also be supported, as an equivalent of checking &quot;collection IS &lt;span class=&quot;error&quot;&gt;&amp;#91;NOT&amp;#93;&lt;/span&gt; EMPTY&quot;&lt;/p&gt;</comment>
                    <comment id="11710" author="beberlei" created="Sun, 14 Feb 2010 10:06:25 +0000"  >&lt;p&gt;The problem is that &lt;b&gt;SqlWalker::walkPathExpression()&lt;/b&gt; has to return a single column sql string otherwise it breaks behaviour on related walk functions like:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;walkNullComparisonExpression&lt;/li&gt;
	&lt;li&gt;walkInExpression&lt;/li&gt;
	&lt;li&gt;walkAggregateExpression&lt;/li&gt;
	&lt;li&gt;walkGroupByItem&lt;/li&gt;
	&lt;li&gt;walkOrderByItem&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This restricts the behaviour to be only allowed if the single valued association has a single column primary key, otherwise an exception should be thrown.&lt;/p&gt;

&lt;p&gt;If this is agreed behaviour, a DQL statement like Guilherme mentioned, might become feasible under the assumptions:&lt;/p&gt;

&lt;div class=&quot;code panel&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 \MyProject\Entities\User u WHERE u.Group = 1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11713" author="romanb" created="Sun, 14 Feb 2010 10:52:30 +0000"  >&lt;p&gt;No, a query like this should not be allowed. WHERE u.Group = 1 is just wrong. See my earlier comments.&lt;/p&gt;</comment>
                    <comment id="11783" author="romanb" created="Mon, 22 Feb 2010 06:33:06 +0000"  >&lt;p&gt;This should work now.&lt;/p&gt;

&lt;p&gt;I.e.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;select u from User u where u.address = ?1
...
-&amp;gt;setParameter(1, $em-&amp;gt;getReference(&apos;Address&apos;, $addressId))
...
SQL: SELECT .... FROM users WHERE user_id = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Not that for simplicity this only works if User is the owning side (has the FK in the database)&lt;/p&gt;

&lt;p&gt;Otherwise you need a join anyway and then its better if you do that join explicitly:&lt;/p&gt;

&lt;div class=&quot;code panel&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 a from Address a join a.user u where u.id = ?1
...
-&amp;gt;setParameter(1, $userId)
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11784" author="romanb" created="Mon, 22 Feb 2010 06:34:30 +0000"  >&lt;p&gt;The SQL in my first example should of course 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;SQL: SELECT .... FROM users WHERE address_id = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="11785" author="romanb" created="Mon, 22 Feb 2010 06:36:28 +0000"  >&lt;p&gt;Similarly, the examples from Benjamin for null checking should now work as well, provided in that example Address is the owning side.&lt;/p&gt;

&lt;div class=&quot;code panel&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: SELECT a FROM Address a WHERE a.user IS NULL
=&amp;gt; SQL: SELECT ... FROM addresses a WHERE user_id IS NULL

DQL: SELECT a FROM Address a WHERE a.user IS NOT NULL
=&amp;gt; SQL: SELECT ... FROM addresses WHERE user_id IS NOT NULL
&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="10888">DDC-333</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-186] addIndex is borken in trunk since this morning update</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-186</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;Warning: Illegal offset type in isset or empty in /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php on line 183

Call Stack:
    0.0003     328176   1. {main}() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/tool.php:0
    0.0046     708968   2. Kronos\Common\ToolRunner-&amp;gt;run() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/tool.php:31
    0.0094     990020   3. Kronos\Common\Tool-&amp;gt;run() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Kronos/Common/ToolRunner.php:92
    0.0094     990020   4. Kronos\FNA\Tool\CreateDatabase-&amp;gt;runTool() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Kronos/Common/Tool.php:223
    0.0094     990020   5. Kronos\FNA\Tool\CreateDatabase::CreateDatabase() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php:18
    0.7140   10032764   6. Doctrine\ORM\Tools\SchemaTool-&amp;gt;createSchema() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php:45
    0.7140   10032764   7. Doctrine\ORM\Tools\SchemaTool-&amp;gt;getCreateSchemaSql() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:81
    0.7140   10032764   8. Doctrine\ORM\Tools\SchemaTool-&amp;gt;getSchemaFromMetadata() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:98
    0.7184   10339688   9. Doctrine\DBAL\Schema\Table-&amp;gt;addIndex() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:197
    0.7184   10339744  10. Doctrine\DBAL\Schema\Table-&amp;gt;_createIndex() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php:150

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10532">DDC-186</key>
            <summary>addIndex is borken in trunk since this morning update</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rickdt">Eric Durand-Tremblay</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Nov 2009 21:32:45 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:45 +0000</updated>
                    <resolved>Fri, 4 Dec 2009 07:20:04 +0000</resolved>
                                            <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10929" author="beberlei" created="Mon, 30 Nov 2009 22:06:18 +0000"  >&lt;p&gt;This happens because of the totally unused 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;$indexColumns = array(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt; =&amp;gt; array(), &lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt; =&amp;gt; array());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This syntax was removed in favour 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;$indexColumns = array(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10930" author="rickdt" created="Mon, 30 Nov 2009 22:12:01 +0000"  >&lt;p&gt;How do we use this syntax in Metadata ??&lt;/p&gt;

&lt;p&gt;I do ;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;@Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;xxxxxxx&quot;&lt;/span&gt;,indexes={@index(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;idx_record_id&quot;&lt;/span&gt;, columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;record_id&quot;&lt;/span&gt;})})
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10931" author="rickdt" created="Mon, 30 Nov 2009 22:13:57 +0000"  >&lt;p&gt;..&lt;/p&gt;</comment>
                    <comment id="10932" author="rickdt" created="Mon, 30 Nov 2009 22:15:32 +0000"  >&lt;p&gt;I really would like to use the good syntax.  I even asked for a better documentation in    &lt;a href=&quot;http://www.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;&lt;/p&gt;</comment>
                    <comment id="10933" author="beberlei" created="Mon, 30 Nov 2009 22:31:08 +0000"  >&lt;p&gt;Hm it seems the metadata drivers make this. This only means index creation is not tested in the unittests &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ll add a temporary fix, and discuss it in the team how to solve this consistently.&lt;/p&gt;</comment>
                    <comment id="10934" author="beberlei" created="Mon, 30 Nov 2009 22:46:24 +0000"  >&lt;p&gt;Can you try again with trunk?&lt;/p&gt;</comment>
                    <comment id="10941" author="rickdt" created="Tue, 1 Dec 2009 13:36:35 +0000"  >&lt;p&gt;There is a new 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;An unknown column-name columns was given.
#0 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php(188): Doctrine\DBAL\Schema\SchemaException::columnDoesNotExist(&apos;columns&apos;)
#1 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php(150): Doctrine\DBAL\Schema\Table-&amp;gt;_createIndex(Array, &apos;idx_record_id&apos;, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
#2 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(197): Doctrine\DBAL\Schema\Table-&amp;gt;addIndex(Array, &apos;idx_record_id&apos;)
#3 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(98): Doctrine\ORM\Tools\SchemaTool-&amp;gt;getSchemaFromMetadata(Array)
#4 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(81): Doctrine\ORM\Tools\SchemaTool-&amp;gt;getCreateSchemaSql(Array)
#5 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php(46): Doctrine\ORM\Tools\SchemaTool-&amp;gt;createSchema(Array)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I will try to get you more informations.&lt;/p&gt;</comment>
                    <comment id="10942" author="rickdt" created="Tue, 1 Dec 2009 13:38:26 +0000"  >&lt;p&gt;Here is the content of columnNames&lt;/p&gt;

&lt;div class=&quot;code panel&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; id
)
Array
(
    [columns] =&amp;gt; Array
        (
            [0] =&amp;gt; record_id
        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10943" author="rickdt" created="Tue, 1 Dec 2009 13:52:55 +0000"  >&lt;p&gt;After some verification all Mapping Driver generate the index definitions 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;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($tableAnnot-&amp;gt;indexes !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                foreach ($tableAnnot-&amp;gt;indexes as $indexAnnot) {
                    $primaryTable[&apos;indexes&apos;][$indexAnnot-&amp;gt;name] = array(&apos;columns&apos; =&amp;gt; $indexAnnot-&amp;gt;columns);
                }
            }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10944" author="beberlei" created="Tue, 1 Dec 2009 15:41:11 +0000"  >&lt;p&gt;Ok, that could be changed easily i guess.&lt;/p&gt;</comment>
                    <comment id="11002" author="beberlei" created="Fri, 4 Dec 2009 07:20:04 +0000"  >&lt;p&gt;Fixed, added a test-case.&lt;/p&gt;</comment>
                    <comment id="11005" author="rickdt" created="Fri, 4 Dec 2009 13:25:15 +0000"  >&lt;p&gt;Thank you! I confirm this fixed the issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-184] Infinite recursion on toArray() with manyToMany bidirectional relationships</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-184</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When specifying a bidirectional @manyToMany relationship, the Doctrine ActiveRecord locks up on toArray(). Line 154 ($array&lt;span class=&quot;error&quot;&gt;&amp;#91;$name&amp;#93;&lt;/span&gt; = $this-&amp;gt;toArray($value)&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; is run thousands of times, presumably because the relations are constantly loading each other.&lt;/p&gt;

&lt;p&gt;Everything works fine when I comment out that line, but that will surely break something else somewhere!&lt;/p&gt;

&lt;p&gt;Hydrating these objects as arrays also works fine.&lt;/p&gt;</description>
                <environment>PHP 5.3.1, Ubuntu</environment>
            <key id="10528">DDC-184</key>
            <summary>Infinite recursion on toArray() with manyToMany bidirectional relationships</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="russ">Russ Flynn (rooster)</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Nov 2009 09:34:28 +0000</created>
                <updated>Wed, 9 Dec 2009 02:55:01 +0000</updated>
                    <resolved>Wed, 9 Dec 2009 02:55:01 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10899" author="romanb" created="Mon, 30 Nov 2009 09:43:21 +0000"  >&lt;p&gt;Is this probably related to the sfDoctrine2Plugin ? Since there is no ActiveRecord / toArray in Doctrine 2 itself.&lt;/p&gt;</comment>
                    <comment id="10900" author="russ" created="Mon, 30 Nov 2009 09:47:47 +0000"  >&lt;p&gt;Attached patch: Stab in the dark but this makes sense and seems to solve the problem for me&lt;/p&gt;</comment>
                    <comment id="10901" author="russ" created="Mon, 30 Nov 2009 09:50:14 +0000"  >&lt;p&gt;@Roman, yes - is Active_Record maintained separately somewhere?&lt;/p&gt;

&lt;p&gt;I&apos;m not entirely sure if it&apos;s a problem with Active_Record or a problem with the Doctrine metadata, but adding the dirty state at least seems to fix the problem for me.&lt;/p&gt;</comment>
                    <comment id="10902" author="romanb" created="Mon, 30 Nov 2009 09:57:11 +0000"  >&lt;p&gt;Yes, I think it is maintained in the symfony trac and svn. I will assign this to Jon here anyway.&lt;/p&gt;</comment>
                    <comment id="11062" author="jwage" created="Mon, 7 Dec 2009 20:02:56 +0000"  >&lt;p&gt;It is a Doctrine extension. Maybe we can use Jira projects for extensions? It is a tough decision because eventually we may have a lot of extensions and it would clutter Jira. I think maybe we might use github to host all Doctrine extensions and mirror them to our SVN or something.&lt;/p&gt;</comment>
                    <comment id="11108" author="guilhermeblanco" created="Wed, 9 Dec 2009 02:55:01 +0000"  >&lt;p&gt;In r6903 this issue was fixed! Thanks for the patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10192" name="Active_Entity-DDC-184.patch" size="567" author="russ" created="Mon, 30 Nov 2009 09:47:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-183] Annotation parser barfs on &quot;@something at.&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-183</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Here&apos;s an odd one: The annotations parser has some quirk where it barfs if the comment contains a line that starts with any tag and ends with &quot;at.&quot;:&lt;/p&gt;

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

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; A;
$em-&amp;gt;persist($a);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result 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;PHP Fatal error:  Uncaught exception &apos;Doctrine\Common\Annotations\AnnotationException&apos;
    with message &apos;[Syntax Error] Expected Doctrine\Common\Annotations\Lexer::T_IDENTIFIER, got &apos;.&apos; at position 19 in class A.&apos;
    in Doctrine\Common\Annotations\AnnotationException.php:39
Stack trace:
#0  Doctrine\Common\Annotations\Parser.php(182): Doctrine\Common\Annotations\AnnotationException::syntaxError(&apos;Expected Doctri...&apos;)
#1  Doctrine\Common\Annotations\Parser.php(150): Doctrine\Common\Annotations\Parser-&amp;gt;syntaxError(&apos;Doctrine\Common...&apos;)
#2  Doctrine\Common\Annotations\Parser.php(229): Doctrine\Common\Annotations\Parser-&amp;gt;match(2)
#3  Doctrine\Common\Annotations\Parser.php(204): Doctrine\Common\Annotations\Parser-&amp;gt;Annotation()
#4  Doctrine\Common\Annotations\Parser.php(134): Doctrine\Common\Annotations\Parser-&amp;gt;Annotations()
#5  Doctrine\Common\Annotations\AnnotationReader.php(102): Doctrine\Common\Annotations\Parser-&amp;gt;parse(&apos;/**? * @Entity?...&apos;, &apos;class A&apos;)
#6  Doctrine\ORM\Mapping\Driver\AnnotationDriver.php(73): Doctrine\Common\Annotations\AnnotationReader-&amp;gt;getClassAnnotations(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(ReflectionClass))
#7  Doctrine\ORM\Mapping\ClassMetadataFactory.php(196): Doctrine\ORM\Mapping\Driver\AnnotationDriver-&amp;gt;loadMetadataForClass(&apos;A&apos;, &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(Doctrine\ORM\Mapping\ClassMetadata))
#8  Doctrine\ORM\Mapping\ClassMetadataFactory.php(111): Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;_loadMetadata(&apos;A&apos;)
#9  Doctrine\ORM\EntityManager.php(214): Doctrine\ORM\Mapping\ClassMetadataFactory-&amp;gt;getMetadataFor(&apos;A&apos;)
#10 Doctrine\ORM\UnitOfWork.php(1182): Doctrine\ORM\EntityManager-&amp;gt;getClassMetadata(&apos;A&apos;)
#11 Doctrine\ORM\UnitOfWork.php(1160): Doctrine\ORM\UnitOfWork-&amp;gt;_doPersist(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(A), Array)
#12 Doctrine\ORM\EntityManager.php(393): Doctrine\ORM\UnitOfWork-&amp;gt;persist(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(A))
#13 test.php(40): Doctrine\ORM\EntityManager-&amp;gt;persist(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(A))
#14 {main}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10526">DDC-183</key>
            <summary>Annotation parser barfs on &quot;@something at.&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="amirabiri">Amir Abiri</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Nov 2009 01:43:28 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:34 +0000</updated>
                    <resolved>Tue, 22 Dec 2009 02:15:46 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10910" author="ivo.nascimento" created="Mon, 30 Nov 2009 16:33:03 +0000"  >&lt;p&gt;i, I&apos;m attempting to fix this one myself. Patch will be uploaded when ready.&lt;/p&gt;</comment>
                    <comment id="11262" author="guilhermeblanco" created="Tue, 22 Dec 2009 02:15:46 +0000"  >&lt;p&gt;In r6974 this issue was fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-185] 2 Test failures on Oracle OCI8</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-185</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;1) Doctrine\Tests\ORM\Functional\SingleTableInheritanceTest::testPolymorphicFind
Exception: [PHPUnit_Framework_Error_Notice] Undefined index: number

With queries:
1. SQL: &apos;CREATE TABLE ParentEntity (id NUMBER(10) NOT NULL, DATA VARCHAR2(255) NOT NULL, discr VARCHAR2(255) NOT NULL, &lt;span class=&quot;code-quote&quot;&gt;&quot;number&quot;&lt;/span&gt; NUMBER(10) DEFAULT NULL, related_entity_id NUMBER(10) DEFAULT NULL, PRIMARY KEY(id))&apos; Params: 
2. SQL: &apos;INSERT INTO ParentEntity (id, DATA, &lt;span class=&quot;code-quote&quot;&gt;&quot;number&quot;&lt;/span&gt;, related_entity_id, discr) VALUES (?, ?, ?, ?, ?)&apos; Params: &apos;5&apos;, &apos;thedata&apos;, &apos;1234&apos;, &apos;&apos;, &apos;child&apos;

Trace:
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:733
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Persisters/SingleTablePersister.php:82
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:565
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:413
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/EntityRepository.php:96
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/EntityManager.php:302
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php:152


/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/OrmFunctionalTestCase.php:235

2) Doctrine\Tests\ORM\Functional\LifecycleCallbackTest::testChangesDontGetLost
Exception: [PHPUnit_Framework_Error_Warning] oci_execute(): ORA-01400: cannot insert NULL into (&lt;span class=&quot;code-quote&quot;&gt;&quot;DOCTRINE_TESTS&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;LIFECYCLECALLBACKTESTUSER&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;VALUE&quot;&lt;/span&gt;)

With queries:
1. SQL: &apos;CREATE TABLE lc_cb_test_entity (id NUMBER(10) NOT NULL, value VARCHAR2(255) NOT NULL, PRIMARY KEY(id))&apos; Params: 
2. SQL: &apos;SELECT LifecycleCallbackTestUser_id_s.nextval FROM DUAL&apos; Params: 
3. SQL: &apos;INSERT INTO LifecycleCallbackTestUser (id, value, name) VALUES (?, ?, ?)&apos; Params: &apos;1&apos;, &apos;&apos;, &apos;Bob&apos;

Trace:
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php:140
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:151
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/UnitOfWork.php:698
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/UnitOfWork.php:283
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/EntityManager.php:288
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php:50


/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/OrmFunctionalTestCase.php:235
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10531">DDC-185</key>
            <summary>2 Test failures on Oracle OCI8</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Nov 2009 21:17:47 +0000</created>
                <updated>Wed, 9 Dec 2009 12:38:42 +0000</updated>
                    <resolved>Wed, 9 Dec 2009 12:38:42 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-180] [patch] The SmallIntType does not extend the default Type class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-180</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The schematool has a check to see if a field is a &lt;tt&gt;string&lt;/tt&gt; value, this check throws a small error because it passes an object into &lt;tt&gt;strtolower&lt;/tt&gt; instead of a &lt;tt&gt;string&lt;/tt&gt; value. The attached patch calls the method &lt;tt&gt;Type-&amp;gt;getName()&lt;/tt&gt; to check if the field is a string.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10522">DDC-180</key>
            <summary>[patch] The SmallIntType does not extend the default Type class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="marijn">Marijn Huizendveld</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Nov 2009 21:48:19 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:44 +0000</updated>
                    <resolved>Thu, 3 Dec 2009 02:37:17 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10888" author="beberlei" created="Fri, 27 Nov 2009 22:34:08 +0000"  >&lt;p&gt;this shouldnt throw an error, all types have a __toString() method.&lt;/p&gt;</comment>
                    <comment id="10889" author="marijn" created="Fri, 27 Nov 2009 22:55:47 +0000"  >&lt;p&gt;You are right, the issue originated from the &lt;tt&gt;SmallIntType&lt;/tt&gt; class which does not extend the &lt;tt&gt;Type&lt;/tt&gt; class. See the attached patch file.&lt;/p&gt;</comment>
                    <comment id="10984" author="guilhermeblanco" created="Thu, 3 Dec 2009 02:37:17 +0000"  >&lt;p&gt;Issue fixed!&lt;/p&gt;

&lt;p&gt;Thanks for the patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10191" name="strtolower_bug_doctrine.diff" size="334" author="marijn" created="Fri, 27 Nov 2009 22:55:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-175] Drop and create database should use postgres user for pgsql connections</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-175</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When dropping or creating a postgres database, Doctrine attempts to use the &quot;database name&quot; linked to the connection, however this is impossible when creating a database, and since postgres requires the dbname parameter to be set - it should be set to &quot;postgres&quot;.&lt;/p&gt;

&lt;p&gt;Previous versions of Doctrine used a temp connection with a temp connection name &quot;postgres&quot; - the attached patch applies a similar logic.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10510">DDC-175</key>
            <summary>Drop and create database should use postgres user for pgsql connections</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="russ">Russ Flynn (rooster)</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Nov 2009 16:10:25 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:44 +0000</updated>
                    <resolved>Wed, 25 Nov 2009 17:21:48 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10866" author="guilhermeblanco" created="Wed, 25 Nov 2009 17:21:48 +0000"  >&lt;p&gt;In r6807 this patch was applied.&lt;/p&gt;

&lt;p&gt;Thanks for report and patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10188" name="PostgresSqlSchemaManager-DCC-175.patch" size="1409" author="russ" created="Wed, 25 Nov 2009 16:14:05 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-174] Missing DoctrineException use statement in Doctrine\ORM\UnitOfWork</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-174</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;UnitOfWork throws a &quot;DoctrineException&quot; in several places, which resolves to &quot;\Doctrine\ORM\DoctrineException&quot; (instead of &lt;br/&gt;
Doctrine\Common\DoctrineException). &lt;/p&gt;

&lt;p&gt;This should either be ORMException, or &quot;use&quot;d in the header.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10509">DDC-174</key>
            <summary>Missing DoctrineException use statement in Doctrine\ORM\UnitOfWork</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Nov 2009 14:30:42 +0000</created>
                <updated>Wed, 2 Dec 2009 20:34:07 +0000</updated>
                    <resolved>Wed, 2 Dec 2009 20:34:07 +0000</resolved>
                                                            <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10865" author="nicokaiser" created="Wed, 25 Nov 2009 14:31:37 +0000"  >&lt;p&gt;This is a patch that fixes the &quot;use&quot; statement in UnitOfWork, so it properly finds DoctrineException...&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="10294">DDC-92</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10187" name="ddc-174-unitofwork-use.patch" size="496" author="nicokaiser" created="Wed, 25 Nov 2009 14:31:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-136] Usage of spl_object_hash in UnitOfWork is dangerous</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-136</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;UnitOfWork uses spl_object_hash to identify objects. This breaks horribly as spl_object_hash is not unique when using it in different scopes.&lt;/p&gt;

&lt;p&gt;See this example:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/d5e4825b0&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/d5e4825b0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When creating and destroying (persisting and removing) objects in sub functions, UnitOfWork gets confused. &lt;br/&gt;
I don&apos;t think this is a special case, so I consider this as a Blocker...&lt;/p&gt;</description>
                <environment></environment>
            <key id="10388">DDC-136</key>
            <summary>Usage of spl_object_hash in UnitOfWork is dangerous</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Nov 2009 11:56:06 +0000</created>
                <updated>Tue, 27 Dec 2011 10:07:27 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 16:22:58 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10583" author="romanb" created="Wed, 11 Nov 2009 12:05:00 +0000"  >&lt;p&gt;Of course we know how spl_object_hash works and we dont see any problems with it with regards to Doctrine. There is never the same object hash on two different objects that are alive at the same time. Doctrine keeps references to all objects its manages. If they get detached then Doctrine does not care about them.&lt;/p&gt;

&lt;p&gt;Please show an example where the spl_object_hash behavior, or more concretely, the fact that hashes from destroyed objects are reused, is a problem for Doctrine.&lt;/p&gt;</comment>
                    <comment id="10585" author="romanb" created="Wed, 11 Nov 2009 12:26:41 +0000"  >&lt;p&gt;To clarify, there might be (a) bug(s) where the UnitOfWork wrongly keeps entries in its internal arrays with the spl_object_hash of an object it does no longer care about. But this is then rather a bug in our code and not a problem that is inherent to the behavior of spl_object_hash.&lt;/p&gt;

&lt;p&gt;As long as Doctrine (and the UnitOfWork) cares about an object, it keeps a reference to it, hence the hash is not reused by any new objects. When Doctrine no longer cares bout an object, all entries of that object should be wiped from the UnitOfWork internal arrays and then it does not matter that later a new object gets the same hash again.&lt;/p&gt;

&lt;p&gt;I hope I explained that well.&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;</comment>
                    <comment id="10587" author="nicokaiser" created="Wed, 11 Nov 2009 13:08:48 +0000"  >&lt;p&gt;Ok, you are right, but then UnitOfWork keeps internal entries when it shouldn&apos;t. &lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/d71a638f8&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/d71a638f8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(The both User objects in the highlighted linesget the same object hashes, the last pesist() thinks the object is detached and fails)&lt;/p&gt;</comment>
                    <comment id="10588" author="beberlei" created="Wed, 11 Nov 2009 13:18:05 +0000"  >&lt;p&gt;Btw, why dont we use SplObjectStorage at this point? Since 5.3 it has some (undocumented) behaviour that goes like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$entity = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Entity();
$storage = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SplObjectStorage()
$storage[$entity] = array(&apos;foo&apos; =&amp;gt; &apos;bar&apos;);

$foo = $storage[$entity][&apos;foo&apos;];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This might save some additional performance, because I think SplObjectStorage uses the PHP internal object pointer and does not need to calculate the spl_object_hash().&lt;/p&gt;</comment>
                    <comment id="10591" author="romanb" created="Wed, 11 Nov 2009 14:19:17 +0000"  >&lt;p&gt;@Nico: Thanks for the example, I will look into it.&lt;/p&gt;

&lt;p&gt;@Benjamin: I&apos;ve played with the idea of SplObjectStorage several times already. It has some disadvantages. First, contrary to your and my first belief it is slower, not faster than using an array with spl_object_hash. Secondly it results in additional references to the objects that you need to be aware of and can potentially prevent the objects from being garbage collected.&lt;/p&gt;

&lt;p&gt;I mean if I store some associated information to an entity with the spl_object_hash =&amp;gt; value information there is no reference to the actual object. Using SplObjectStorage would result in object references being stored. I&apos;ve always tried to keep the locations where Doctrine keeps references to objects to a minimum to not provoke unnecessary potential memory leaks.&lt;/p&gt;

&lt;p&gt;If you would like to make your own performance tests of SplObjectStorage vs array + spl_object_hash I would be glad to see your results!&lt;/p&gt;</comment>
                    <comment id="10596" author="romanb" created="Wed, 11 Nov 2009 16:22:58 +0000"  >&lt;p&gt;@Nico: The issue you mentioned should be fixed now. I reproduced it in the sandbox as well as in the tests (with some effort). So we have test coverage for this case as well at least. If you find any more of such things feel free to open new issues.&lt;/p&gt;

&lt;p&gt;Thanks for your help on improving Doctrine.&lt;/p&gt;</comment>
                    <comment id="10597" author="beberlei" created="Wed, 11 Nov 2009 17:20:04 +0000"  >&lt;p&gt;@Roman: the reference issue is a serious drawback of SplObjectStorage, good that the bug could be fixed with spl_object_hash nonetheless. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="17107" author="gamesh" created="Tue, 27 Dec 2011 10:07:27 +0000"  >&lt;p&gt;&lt;cite&gt;I&apos;ve played with the idea of SplObjectStorage several times already. It has some disadvantages. First, contrary to your and my first belief it is slower, not faster than using an array with spl_object_hash&lt;/cite&gt;&lt;br/&gt;
@Roman: how did you come to that conclusion? because there was a performance test made, and it showed that SplObjectStorage was faster and consumed less memory than php native array&lt;br/&gt;
here is the link to the benchmark, if interested&lt;br/&gt;
&lt;a href=&quot;http://technosophos.com/content/set-objects-php-arrays-vs-splobjectstorage&quot; class=&quot;external-link&quot;&gt;http://technosophos.com/content/set-objects-php-arrays-vs-splobjectstorage&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-133] Complete implementation for schema support.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-133</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description></description>
                <environment></environment>
            <key id="10373">DDC-133</key>
            <summary>Complete implementation for schema support.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Nov 2009 16:02:26 +0000</created>
                <updated>Sun, 8 Aug 2010 09:09:04 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 09:09:04 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11018" author="romanb" created="Sat, 5 Dec 2009 22:22:59 +0000"  >&lt;p&gt;This mainly affects SqlWalker but probably many other parts also.&lt;/p&gt;</comment>
                    <comment id="11743" author="romanb" created="Tue, 16 Feb 2010 13:27:01 +0000"  >&lt;p&gt;This shoudl wait for ddc-335 to finish.&lt;/p&gt;</comment>
                    <comment id="11855" author="romanb" created="Sat, 27 Feb 2010 12:50:36 +0000"  >&lt;p&gt;How (if) his should be supported is still open to discussion. Maybe just @Table(name=&quot;schema.table&quot;) can work fine mostly and we dont need to bloat our implementation.&lt;/p&gt;</comment>
                    <comment id="12050" author="romanb" created="Sun, 7 Mar 2010 06:07:30 +0000"  >&lt;p&gt;I tested this a bit with PostgreSQL and @Table(name=&quot;schema.table&quot;) and it seems to work fine. Even DDL generation/export works fine as long as the schema is created beforehand, just like databases. I think this is acceptable but still need to test further.&lt;/p&gt;</comment>
                    <comment id="12919" author="andyajadeh" created="Wed, 12 May 2010 05:04:26 +0000"  >&lt;p&gt;Hello, I use postgresql, with PHP mapping driver 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;&amp;lt;?php

use Doctrine\ORM\Mapping\ClassMetadataInfo;

$metadata-&amp;gt;setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE);
$metadata-&amp;gt;setPrimaryTable(array(
    &apos;name&apos; =&amp;gt; &apos;sales.mdp&apos;,
    &apos;schema&apos; =&amp;gt; &apos;sales&apos;,
));

$metadata-&amp;gt;setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT);
$metadata-&amp;gt;setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE);
$metadata-&amp;gt;setSequenceGeneratorDefinition(array(
        &apos;sequenceName&apos;   =&amp;gt; &apos;mdp_id_seq&apos;,
        &apos;allocationSize&apos; =&amp;gt; 10,
        &apos;initialValue&apos;   =&amp;gt; 1,
    ));
    
$metadata-&amp;gt;mapField(array(
   &apos;id&apos;         =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
   &apos;fieldName&apos;  =&amp;gt; &apos;id&apos;,
   &apos;columnName&apos; =&amp;gt; &apos;id&apos;,
   &apos;type&apos;       =&amp;gt; &apos;integer&apos;,
  ));
$metadata-&amp;gt;mapField(array(
   &apos;fieldName&apos;  =&amp;gt; &apos;rrn&apos;,
   &apos;columnName&apos; =&amp;gt; &apos;rrn&apos;,
   &apos;type&apos;       =&amp;gt; &apos;string&apos;,
   &apos;length&apos;     =&amp;gt; 50,
   &apos;unique&apos;     =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
  ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I create database schema from CLI, it raises exception:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;[Doctrine\DBAL\Schema\SchemaException]
Invalid index-name sales.mdp_rrn_uniq given, has to be [a-zA-Z0-9_]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12920" author="andyajadeh" created="Wed, 12 May 2010 05:12:19 +0000"  >&lt;p&gt;I try to remove unique =&amp;gt; true, then it works. The mdp table is generated in sales schema.&lt;br/&gt;
Now when I I try to drop the database from CLI, I get an exception:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;[PDOException]
SQLSTAT[42P01] Undefined table: 7 Error: table &lt;span class=&quot;code-quote&quot;&gt;&quot;mdp&quot;&lt;/span&gt; does not exist.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;it seems like dropping improper sequence or table name.&lt;/p&gt;</comment>
                    <comment id="13004" author="romanb" created="Wed, 19 May 2010 06:48:37 +0000"  >&lt;p&gt;Ben, do you have an opinion on this? I think we can try to address this on the DBAL level by inspecting the table names whether they are of the form &quot;foo.bar&quot;. The alternative would require full extra schema support on the ORM + DBAL level, so I&apos;d rather try to do this the &quot;hacky&quot; way if possible (i.e. no explicit schema support, just &quot;schema.table&quot; as table name implicitly works) since most of the stuff works already with this.&lt;/p&gt;

&lt;p&gt;The DBAL does not need to support creating schemas or stuff like that. Just ensuring that &quot;schema.table&quot; as a table name does not mess up DDL statements like constraint or index names in this example.&lt;/p&gt;</comment>
                    <comment id="13115" author="beberlei" created="Sun, 6 Jun 2010 08:08:26 +0000"  >&lt;p&gt;Fixed the auto-naming of indexes and constraints on the latest DBAL trunk, so this should continue to work @Andy can you verify?&lt;/p&gt;</comment>
                    <comment id="13116" author="beberlei" created="Sun, 6 Jun 2010 08:09:12 +0000"  >&lt;p&gt;Move to Beta3 to gather more feedback on the implicit definition&lt;/p&gt;</comment>
                    <comment id="13242" author="andyajadeh" created="Tue, 8 Jun 2010 21:34:18 +0000"  >&lt;p&gt;Thanks Benjamin, Now it works. When I run orm:schema-tool:create, it creates the tables &amp;amp; indexes &amp;amp; constraints in the proper schema.&lt;br/&gt;
But, I still have problems when update / dropping the tables.&lt;/p&gt;

&lt;p&gt;when I run orm:schema-tool:drop, I get an exception:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;[PDOException]

  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation &lt;span class=&quot;code-quote&quot;&gt;&quot;mdp_id_seq&quot;&lt;/span&gt; does not exist
  LINE 1: SELECT min_value, increment_by FROM mdp_id_seq

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

&lt;p&gt;I use this in my map:&lt;/p&gt;

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

use Doctrine\ORM\Mapping\ClassMetadataInfo;

$metadata-&amp;gt;setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE);
$metadata-&amp;gt;setPrimaryTable(array(
    &apos;name&apos; =&amp;gt; &apos;sales.mdp&apos;,
    &apos;schema&apos; =&amp;gt; &apos;sales&apos;,
));

$metadata-&amp;gt;setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT);
$metadata-&amp;gt;setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE);
$metadata-&amp;gt;setSequenceGeneratorDefinition(array(
        &apos;sequenceName&apos;   =&amp;gt; &apos;sales.mdp_id_seq&apos;,
        &apos;allocationSize&apos; =&amp;gt; 10,
        &apos;initialValue&apos;   =&amp;gt; 1,
    ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I want my sequence name to be also in sales schema. But when I drop it, I get that exception.&lt;/p&gt;</comment>
                    <comment id="13345" author="ss10sb" created="Wed, 16 Jun 2010 10:52:02 +0000"  >&lt;p&gt;Since I was trying to break the schemaname.tablename by overcomplicating it and not doing a very good search here first (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-639&quot; title=&quot;Schema info included in output SQL&quot;&gt;&lt;del&gt;DDC-639&lt;/del&gt;&lt;/a&gt;, sorry Roman!), I happened to notice that the quoteIdentifier method in AbstractPlatform doesn&apos;t appear to be correctly quoting the schema and table name if quotes are needed. I&apos;m not using any quoting but just glancing at the code, shouldn&apos;t $str be exploded on &apos;.&apos; in case of a schema.tablename string passed in?  The current method looks like it will return (quote)schemaname.tablename(quote) instead of (quote)schemaname(quote).(quote)tablename(quote).&lt;br/&gt;
Maybe something along the lines 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;$expStr = explode(&apos;.&apos;, $str);
&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $c . join(&lt;span class=&quot;code-quote&quot;&gt;&quot;$c.$c&quot;&lt;/span&gt;, $expStr) . $c;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Awesome piece of work!  It rocks!!&lt;/p&gt;</comment>
                    <comment id="13359" author="jwage" created="Thu, 17 Jun 2010 13:30:22 +0000"  >&lt;p&gt;The only problem I can think of is the identifier quoting like Scott mentions above. I had to &quot;hack&quot; this same thing in Doctrine 1. I don&apos;t like it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="13362" author="romanb" created="Thu, 17 Jun 2010 14:43:21 +0000"  >&lt;p&gt;I think the limitation of not supporting identifier quoting in cases like this is not problematic so this hack is not needed. Identifier quoting is not supported &lt;b&gt;everywhere&lt;/b&gt; anyway (i.e. not for join columns and discriminator columns).&lt;/p&gt;</comment>
                    <comment id="13539" author="romanb" created="Wed, 7 Jul 2010 11:20:19 +0000"  >&lt;p&gt;Pushing back to beta4 to wait for more potential feedback. If anyone has issues with the current support for schemas via the table name, please speak up.&lt;/p&gt;</comment>
                    <comment id="13853" author="romanb" created="Sun, 8 Aug 2010 09:09:04 +0000"  >&lt;p&gt;Closing this case for now as no further negative feedback was submitted. If new major issues arise that can not be addressed easily this issue needs to be reconsidered in a post 2.0 release.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-123] PDO throws an exception when parameters are missing or mismatch, DC throws php warnings</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-123</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;PDO throws exceptions if you try to execute a query with a wrong parameter count or parameters named incorrect.&lt;/p&gt;

&lt;p&gt;Doctrine\ORM\Query does nothing of such kind and only throws php warnings when wrong php array keys are accessed. Attached is a patch that corrects this behaviour to give a developer more feedback on this kind of errors.&lt;/p&gt;

&lt;p&gt;Performance wise, on each _doExecute() 1 count check of params against set parameter mappings aswell as one additional check if each passed param really exists.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="10356">DDC-123</key>
            <summary>PDO throws an exception when parameters are missing or mismatch, DC throws php warnings</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2009 16:54:57 +0000</created>
                <updated>Sat, 21 Nov 2009 21:50:04 +0000</updated>
                    <resolved>Sat, 21 Nov 2009 18:58:10 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10816" author="romanb" created="Sat, 21 Nov 2009 18:58:10 +0000"  >&lt;p&gt;This seems to be applied already.&lt;/p&gt;</comment>
                    <comment id="10817" author="beberlei" created="Sat, 21 Nov 2009 21:50:04 +0000"  >&lt;p&gt;Oh I accidently committed this on &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-127&quot; title=&quot;IterableResult should implement Iterator&quot;&gt;&lt;del&gt;DDC-127&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10145" name="DDC_123.diff" size="2612" author="beberlei" created="Fri, 6 Nov 2009 16:57:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-120] Create oci8 driver</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-120</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The pdo_oci driver is sometimes problematic. Even the test suite results in segfaults already when using pdo_oci.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10350">DDC-120</key>
            <summary>Create oci8 driver</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2009 11:40:09 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:44 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 21:19:58 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10545" author="beberlei" created="Sun, 8 Nov 2009 17:06:18 +0000"  >&lt;p&gt;oci8 handles CLOBs quite differently, using a OCI-LOB object instead of returning the LOB as text. How should we handle this?&lt;/p&gt;</comment>
                    <comment id="10603" author="jwage" created="Wed, 11 Nov 2009 21:19:58 +0000"  >&lt;p&gt;This is committed and is working well so far. We should open new issues now for any problems we find.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="10280">DDC-83</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-122] Not specifying a Metadata Cache at all leads to fatal error in EM</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-122</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If for development purposes you dont follow the recommendation to use a Metadata Cache you end up with a fatal error, because the EntityManager sets the null value of the metadata cache to the ClassMetadataFactory which issues a command on it.&lt;/p&gt;

&lt;p&gt;Solutions &lt;/p&gt;

&lt;p&gt;1. in ORM Configuration create and return an array cache.&lt;br/&gt;
2. Throw an exception if getMetadataCacheDriverImpl() would return null.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10352">DDC-122</key>
            <summary>Not specifying a Metadata Cache at all leads to fatal error in EM</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2009 12:28:35 +0000</created>
                <updated>Wed, 16 Dec 2009 09:50:47 +0000</updated>
                    <resolved>Tue, 15 Dec 2009 21:09:06 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10536" author="guilhermeblanco" created="Sat, 7 Nov 2009 19:35:59 +0000"  >&lt;p&gt;If no metadata cache is defined, it should always use the array cache.&lt;/p&gt;

&lt;p&gt;It should not throw the exception!&lt;/p&gt;</comment>
                    <comment id="10540" author="romanb" created="Sat, 7 Nov 2009 22:26:15 +0000"  >&lt;p&gt;An exception is much better. Just silently using an array cache can hide a serious performance problem... The metadata cache is declared as &lt;b&gt;REQUIRED&lt;/b&gt; in the documentation, hence &lt;b&gt;you must specify it&lt;/b&gt;.&lt;/p&gt;</comment>
                    <comment id="10541" author="romanb" created="Sat, 7 Nov 2009 22:29:59 +0000"  >&lt;p&gt;ArrayCache is actually &lt;b&gt;worse than using no metadata cache at all!&lt;/b&gt;. Thus we might instead consider turning a metadata cache from &lt;b&gt;required&lt;/b&gt; to &lt;b&gt;recommended&lt;/b&gt;. That means, of course, that no exception should be thrown if it is not set.&lt;/p&gt;</comment>
                    <comment id="10670" author="romanb" created="Mon, 16 Nov 2009 17:45:54 +0000"  >&lt;p&gt;Not specifying a metadata cache actually works fine for me.&lt;/p&gt;

&lt;p&gt;Is this the problematic code you&apos;re referring to?&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_cacheDriver = $cacheDriver;
        foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_driver-&amp;gt;preload() as $className) {
            $cacheKey = &lt;span class=&quot;code-quote&quot;&gt;&quot;$className\$CLASSMETADATA&quot;&lt;/span&gt;;
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_cacheDriver-&amp;gt;save($cacheKey, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getMetadataFor($className), &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So this would only be problematic in preload mode which we want to remove for A4 anyway. Would that be correct?&lt;/p&gt;</comment>
                    <comment id="10694" author="beberlei" created="Tue, 17 Nov 2009 00:44:56 +0000"  >&lt;p&gt;yes correct, please remove it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="11194" author="romanb" created="Tue, 15 Dec 2009 21:09:06 +0000"  >&lt;p&gt;PRELOAD mode removed. ClassMetadataFactory#getAllMetadata introduced.&lt;/p&gt;</comment>
                    <comment id="11196" author="beberlei" created="Wed, 16 Dec 2009 09:23:51 +0000"  >&lt;p&gt;Hm, shouldn&apos;t we deprecate  &amp;lt;entity class=&quot;&quot;&amp;gt; and the Respective other File driver options? It seems otherwise the class name has to be specified twice, once as filename, once as attribute in XML or YAML.&lt;/p&gt;</comment>
                    <comment id="11197" author="romanb" created="Wed, 16 Dec 2009 09:30:30 +0000"  >&lt;p&gt;No, I think that is fine. The file drivers just make use of the naming convention in order to not load/parse the file to get at the class name. IMHO the class name should always be present in the mapping document.&lt;/p&gt;</comment>
                    <comment id="11198" author="beberlei" created="Wed, 16 Dec 2009 09:50:47 +0000"  >&lt;p&gt;But we should at least throw an exception if filename and entity name don&apos;t match, this probably kills 95% of support and debugging time in this matter.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-121] Persisting added children to parent in a one-to-many relationship fails</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-121</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Affects Doctrine 2.0 at revision 6679 (trunk).&lt;/p&gt;

&lt;p&gt;Persisting children that were added to a parent retrieved from the database in (at least) a one-to-many relationship fails when the children array was not initialized before adding. A simple demonstration:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Customer {
	/** @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;public&lt;/span&gt; $id;
	/** @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;customer&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;}) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $users = array();
}

/** @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;public&lt;/span&gt; $id;
	/** @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Customer&quot;&lt;/span&gt;) @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;customerId&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;public&lt;/span&gt; $customer;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Let&apos;s retrieve our existing customer and add a user to 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;$customer = $em-&amp;gt;find(&apos;Customer&apos;, 1);
$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;customer = $customer;
$customer-&amp;gt;users[] = $user;
$em-&amp;gt;persist($customer);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At this point the user has not been persisted.&lt;br/&gt;
When initializing the users collection by e.g.:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$customer = $em-&amp;gt;find(&apos;Customer&apos;, 1);
sizeof($customer-&amp;gt;users);
$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;... this is not the case.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10351">DDC-121</key>
            <summary>Persisting added children to parent in a one-to-many relationship fails</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="reinier.kip">Reinier Kip</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2009 12:20:15 +0000</created>
                <updated>Mon, 9 Nov 2009 08:26:20 +0000</updated>
                    <resolved>Sun, 8 Nov 2009 11:08:30 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10525" author="romanb" created="Fri, 6 Nov 2009 12:28:23 +0000"  >&lt;p&gt;Improved formatting.&lt;/p&gt;</comment>
                    <comment id="10530" author="romanb" created="Sat, 7 Nov 2009 11:55:01 +0000"  >
&lt;p&gt;I fixed your example, UnitOfWork#_doPersist was using foreach() on the PersistentCollection so that it was initialized. That should not happen.&lt;/p&gt;

&lt;p&gt;At the same time I think there might still be the issue of new objects in collections being wiped out when the collection is initialized. So I still need to look into that.&lt;/p&gt;</comment>
                    <comment id="10531" author="romanb" created="Sat, 7 Nov 2009 11:58:29 +0000"  >&lt;p&gt;By the way: In your example you do not even need to call $em-&amp;gt;persist($customer); because $customer is managed and $user is a new object attached to it (in the collection). Together with cascade=&lt;/p&gt;
{&quot;persist&quot;}
&lt;p&gt; this means it will be persisted automatically. This is called &quot;persistence by reachability&quot;.&lt;/p&gt;</comment>
                    <comment id="10546" author="reinier.kip" created="Mon, 9 Nov 2009 08:26:20 +0000"  >&lt;p&gt;Thanks a bundle!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-108] Transitive persistence broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-108</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When cascading &apos;persist&apos; operations, the object which was not persisted implicitly is being written to the DB with wrong parameters, broken 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;INSERT INTO email (email, userId) VALUES (?, ?)
array(3) {
  [1]=&amp;gt;
  NULL
  [2]=&amp;gt;
  string(16) &quot;user@example.com&quot;
  [3]=&amp;gt;
  int(1)
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;See the attached example for details... When I uncomment the &quot;$em-&amp;gt;persist($email);&quot; line, everything works as expected (but I&apos;d like this persist to be done automatically...)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10319">DDC-108</key>
            <summary>Transitive persistence broken</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Nov 2009 15:45:24 +0000</created>
                <updated>Tue, 3 Nov 2009 18:31:44 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 18:31:44 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10457" author="romanb" created="Tue, 3 Nov 2009 17:04:38 +0000"  >&lt;p&gt;Indeed this looks like a bug, but it is unrelated to cascades.&lt;/p&gt;

&lt;p&gt;I will explain on your code 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;$em = EntityManager::create($connectionOptions, $config);
$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entity\User;
$user-&amp;gt;setName(&apos;Bob&apos;);

&lt;span class=&quot;code-comment&quot;&gt;// This would invoke persist() on the associated email because of the cascade, but there is no email yet!
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// After persist() $user is MANAGED
&lt;/span&gt;$em-&amp;gt;persist($user);

$email = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entity\Email;
$email-&amp;gt;setEmail(&apos;user@example.com&apos;);
$user-&amp;gt;addEmails($email);

&lt;span class=&quot;code-comment&quot;&gt;// On flush the email should be correctly persisted because it is NEW but referenced/reachable from a MANAGED entity ($user)
&lt;/span&gt;$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Just to clarify. So this is a bug in the &quot;persistence by reachability&quot;.&lt;/p&gt;

&lt;p&gt;&quot;persistence by reachability&quot; means that a NEW entity (like $email) that is associated to a MANAGED entity (like $user) and the association has cascade=persist is automatically persisted on flush().&lt;/p&gt;

&lt;p&gt;I still need to write about persistence by reachability in the manual but as you have already found out, it is intuitive since you expect that to happen.&lt;/p&gt;</comment>
                    <comment id="10459" author="romanb" created="Tue, 3 Nov 2009 17:10:54 +0000"  >&lt;p&gt;Ok its not &lt;b&gt;completely&lt;/b&gt; unrelated to cascades since persistence by reachability still requires cascade=persist &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; but the bug itself has to do with incorrect changeset calculation.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10134" name="cascade-bug.zip" size="4569" author="nicokaiser" created="Tue, 3 Nov 2009 15:45:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-104] Junk annotation code generated using convert mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-104</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When generating annotation from yaml &lt;br/&gt;
./doctrine convert-mapping --from=./yaml/ --to=annotation --dest=.&lt;/p&gt;

&lt;p&gt;with one already generated yaml file and one new yaml file&lt;/p&gt;

&lt;p&gt;annotation of first yaml is appended to the new annotations.&lt;/p&gt;

&lt;p&gt;Cause of the problem is in AnnotationExporter.  ($this-&amp;gt;_currentCode is not cleared.)&lt;/p&gt;

&lt;p&gt;public function exportClassMetadata(ClassMetadataInfo $metadata)&lt;br/&gt;
{&lt;br/&gt;
        if (file_exists($this-&amp;gt;_outputPath)) &lt;/p&gt;
{
            $this-&amp;gt;_currentCode = file_get_contents($this-&amp;gt;_outputPath);
          }


&lt;p&gt;Solution : &lt;/p&gt;

&lt;p&gt; if (file_exists($this-&amp;gt;_outputPath)) &lt;/p&gt;
{
            $this-&amp;gt;_currentCode = file_get_contents($this-&amp;gt;_outputPath);
        }
&lt;p&gt;		else &lt;/p&gt;
{
			$this-&amp;gt;_currentCode = &apos;&apos;;
		}</description>
                <environment>Issue occurs in trunk</environment>
            <key id="10312">DDC-104</key>
            <summary>Junk annotation code generated using convert mapping</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rickdt">Eric Durand-Tremblay</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2009 16:53:50 +0000</created>
                <updated>Wed, 11 Nov 2009 19:37:32 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 19:37:32 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10403" author="rickdt" created="Mon, 2 Nov 2009 17:07:34 +0000"  >&lt;p&gt;This does not solve completely the issue.&lt;/p&gt;

&lt;p&gt;Updating the same annotation class from yaml often generate junk code.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-94] Queries executed through StandardEntityPersister load(), loadAll(), etc. are not logged.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-94</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In Doctrine\DBAL\Connection, execute() and executeUpdate() methods both call:&lt;br/&gt;
$this-&amp;gt;_config-&amp;gt;getSqlLogger()-&amp;gt;logSql($query, $params)&lt;/p&gt;

&lt;p&gt;But when you use the Doctrine\ORM\Persisters\StandardEntityPersister (which is the case with all magic repository methods in Symfony, such as Models\User::findAll() for example), it only calls the prepare() method of the Connection, so the query is not logged (and does not appear in the Debug Panel in Symfony for instance).&lt;/p&gt;

&lt;p&gt;I added the following line in Doctrine\DBAL\Connection.php, in method prepare():&lt;br/&gt;
if ($this-&amp;gt;_config-&amp;gt;getSqlLogger()) {&lt;br/&gt;
  $this-&amp;gt;_config-&amp;gt;getSqlLogger()-&amp;gt;logSql($statement);&lt;br/&gt;
}&lt;br/&gt;
which seem to solve the problem in this case.&lt;/p&gt;</description>
                <environment>sfDoctrine2Plugin (currently embedding Doctrine 2.0.0 Alpha 1) used with Symfony 1.3.0 BETA 1 WampServer, Apache 2.2.11, PHP 5.3.0, MySQL 5.1.36 </environment>
            <key id="10297">DDC-94</key>
            <summary>Queries executed through StandardEntityPersister load(), loadAll(), etc. are not logged.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="simonvdd">Simon VANDENDRIESSCHE</reporter>
                        <labels>
                    </labels>
                <created>Sun, 1 Nov 2009 21:19:43 +0000</created>
                <updated>Wed, 2 Dec 2009 20:49:45 +0000</updated>
                    <resolved>Wed, 2 Dec 2009 20:49:45 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10390" author="beberlei" created="Mon, 2 Nov 2009 10:56:42 +0000"  >&lt;p&gt;This is an obvious fix, but it leads to the problem that the $params are not logged.&lt;/p&gt;

&lt;p&gt;I ask myself if the SqlLogger shouldn&apos;t be passed to the Connection Driver also to solve this problem.&lt;/p&gt;</comment>
                    <comment id="10804" author="romanb" created="Fri, 20 Nov 2009 17:02:39 +0000"  >&lt;p&gt;Not only would the params not be logged but in the case of a prepared statement that is executed several times you would miss queries.&lt;/p&gt;

&lt;p&gt;So this needs to be logged on the caller side where the statement is prepared and executed (one or more times).&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10476">DDC-162</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-97] \Doctrine\ORM\Mapping\Driver\Driver::preload($force=false) is missing</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-97</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Every driver implementation has a preload() method, however it is not present on the interface.&lt;/p&gt;

&lt;p&gt;It should however be on the interface to consistently call preload on the CLI tasks which require all the metadata.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10301">DDC-97</key>
            <summary>\Doctrine\ORM\Mapping\Driver\Driver::preload($force=false) is missing</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2009 10:17:35 +0000</created>
                <updated>Tue, 15 Dec 2009 21:08:01 +0000</updated>
                    <resolved>Tue, 15 Dec 2009 21:08:01 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10388" author="beberlei" created="Mon, 2 Nov 2009 10:34:43 +0000"  >&lt;p&gt;Attached a patch that adds a new method to the interface Driver:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;+                                                                                                                                        
+    /**                                                                                                                                 
+     * Preload entities and &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; an array of entities that have been preloaded.                                                       
+     *                                                                                                                                  
+     * On consecutive calls the preload will only &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; newly preloaded entities.                                                      
+     * Therefore you should not rely on the &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; value, but use the                                                                   
+     * {@link ClassMetadataFactory::getLoadedMetadata()} method.                                                                        
+     *
+     * @param  bool $force
+     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; array
+     */
+    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preload($force=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And adds the $force flag to some of the drivers that don&apos;t require it.&lt;/p&gt;</comment>
                    <comment id="10464" author="romanb" created="Tue, 3 Nov 2009 19:23:15 +0000"  >&lt;p&gt;Scheduled for ALPHA4 where we will probably get rid of PRELOAD as a regular operating mode.&lt;/p&gt;</comment>
                    <comment id="11192" author="romanb" created="Tue, 15 Dec 2009 21:08:01 +0000"  >&lt;p&gt;PRELOAD mode removed. ClassMetadataFactory#getAllMetadata introduced.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="10318">DDC-107</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10303">DDC-98</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10126" name="ddc_97.diff" size="2541" author="beberlei" created="Mon, 2 Nov 2009 10:34:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-98] SchemaToolTask&apos;s use of Driver\preload() is not &quot;deterministic&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-98</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;\Doctrine\ORM\Mapping\Driver\Driver::preload() only returns the diff of loaded entities, however for example ClassMetadataFactory::setCacheDriver() already calls preload() which may make the SchemaToolTask find zero entities.&lt;/p&gt;

&lt;p&gt;preload() should be executed, however it should be done from a new preload() method on ClassMetadataFactory() and then all the loaded classes should be fetched from the ClassMetadataFactory by calling getLoadedMetadata().&lt;/p&gt;</description>
                <environment></environment>
            <key id="10303">DDC-98</key>
            <summary>SchemaToolTask&apos;s use of Driver\preload() is not &quot;deterministic&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2009 10:24:05 +0000</created>
                <updated>Tue, 15 Dec 2009 21:08:18 +0000</updated>
                    <resolved>Tue, 15 Dec 2009 21:08:18 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10389" author="beberlei" created="Mon, 2 Nov 2009 10:48:54 +0000"  >&lt;p&gt;Attached a patch that relies on the patch in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-97&quot; title=&quot;\Doctrine\ORM\Mapping\Driver\Driver::preload($force=false) is missing&quot;&gt;&lt;del&gt;DDC-97&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It adds a preload($force=false) method on the ClassMetadataFactory, and changes the setCacheDriver() to use that method also.&lt;/p&gt;

&lt;p&gt;This now allows to consistently preload() drivers into the class metadata factory without &quot;loosing&quot; entities, which is required in SchemaTool Task.&lt;/p&gt;

&lt;p&gt;The patch also changes the SchemaTool Task to use ClassMetadataFactory::preload() and ClassMetadataFactory::getLoadedMetadata().&lt;/p&gt;

&lt;p&gt;All Tests still pass on Sqlite, Mysql and Postgres&lt;/p&gt;</comment>
                    <comment id="10465" author="romanb" created="Tue, 3 Nov 2009 19:23:42 +0000"  >&lt;p&gt;Scheduled for ALPHA4 where we will probably get rid of PRELOAD as a regular operating mode.&lt;/p&gt;</comment>
                    <comment id="11193" author="romanb" created="Tue, 15 Dec 2009 21:08:18 +0000"  >&lt;p&gt;PRELOAD mode removed. ClassMetadataFactory#getAllMetadata introduced.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10301">DDC-97</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10127" name="ddc_98.diff" size="2392" author="beberlei" created="Mon, 2 Nov 2009 10:48:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-92] Remove DoctrineException and introduce Doctrine\ORM\ORMException and Doctrine\DBAL\DBALException instead</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-92</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DoctrineException in the Common package currently serves as a base exception for DBAL and ORM. This is not optimal and the __callStatic handling already showed some issues where the real exception was hidden (var_export issue).&lt;/p&gt;

&lt;p&gt;Therefore it makes much more sense to introdude ORMException and DBALException as the base exception classes of the respective packages.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10294">DDC-92</key>
            <summary>Remove DoctrineException and introduce Doctrine\ORM\ORMException and Doctrine\DBAL\DBALException instead</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 1 Nov 2009 11:48:39 +0000</created>
                <updated>Fri, 5 Mar 2010 11:39:23 +0000</updated>
                    <resolved>Fri, 5 Mar 2010 11:39:23 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11452" author="beberlei" created="Sat, 23 Jan 2010 23:13:11 +0000"  >&lt;p&gt;I refactored Doctrine\DBAL\DriverManager in this regard.&lt;/p&gt;</comment>
                    <comment id="11760" author="beberlei" created="Fri, 19 Feb 2010 17:34:02 +0000"  >&lt;p&gt;My work is done &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="11812" author="shurakai" created="Wed, 24 Feb 2010 13:50:32 +0000"  >&lt;p&gt;Roman, this issue is marked as &quot;in progress&quot; but I&apos;m not sure if you are currently working on this. If you&apos;re not, I would like to offer to remove DoctrineException from the ORM package. Just tell me if I should do this.&lt;/p&gt;</comment>
                    <comment id="11816" author="romanb" created="Wed, 24 Feb 2010 16:47:56 +0000"  >&lt;p&gt;@Christian: That would be great. You would need to replace all occurences of DoctrineException with either ORMException or a more specific subclass, creating the static exception methods as needed.&lt;/p&gt;

&lt;p&gt;At the end of the day we want DoctrineException removed from the repo.&lt;/p&gt;</comment>
                    <comment id="11919" author="shurakai" created="Mon, 1 Mar 2010 18:39:51 +0000"  >&lt;p&gt;The attached file removes DoctrineException from all packages and introduces several new classes.&lt;/p&gt;

&lt;p&gt;Additionally, all DoctrineException tests are removed.&lt;/p&gt;</comment>
                    <comment id="11942" author="romanb" created="Tue, 2 Mar 2010 05:49:34 +0000"  >&lt;p&gt;Applied the patch to my local copy. Will commit it together with a bunch of other stuff in a few days. Thanks!&lt;/p&gt;</comment>
                    <comment id="12036" author="romanb" created="Fri, 5 Mar 2010 11:39:23 +0000"  >&lt;p&gt;Should be fixed now. Committed the patch from Christian.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="10509">DDC-174</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10405" name="remove_doctrine_exception.patch" size="157256" author="shurakai" created="Mon, 1 Mar 2010 18:39:51 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-88] SchemaTool/Platform DDL does not escape column names</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-88</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The column identifiers are not quoted in the SchemaTool/Platform.&lt;/p&gt;

&lt;p&gt;Funny is Doctrine\Tests\ORM\Functional\SchemaTool\MysqlSchemaToolTest::testGetCreateSchemaSql2() suffers from this &quot;problem&quot; by asserting mysql invalid syntax as correct creation code.&lt;/p&gt;

&lt;p&gt;All identifiers should be escaped by the Platform.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10289">DDC-88</key>
            <summary>SchemaTool/Platform DDL does not escape column names</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Oct 2009 20:54:45 +0000</created>
                <updated>Sun, 1 Nov 2009 11:06:06 +0000</updated>
                    <resolved>Sun, 1 Nov 2009 11:06:06 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10378" author="romanb" created="Sun, 1 Nov 2009 09:36:12 +0000"  >&lt;p&gt;This is actually intended, I mean not the wrong test case but the fact that the DBAL itself does not escape anything. If someone is using the DBAL directly he can quote problematic names himself ($platform-&amp;gt;quoteIdentifier(...)). Identifier quoting is discouraged and not even a 100% reliable solution for reserved words.&lt;/p&gt;

&lt;p&gt;There is also no global switch anymore like in D1 to &quot;quote all identifiers&quot; as this is like breaking a butterfly on the wheel if there is just 1 problematic column name.&lt;/p&gt;

&lt;p&gt;How quoting a specific column works from the ORM is described here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/basic-mapping#quoting-reserved-words&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/basic-mapping#quoting-reserved-words&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, the ORM applies quoting on individual columns that have been marked as such. Apart from that, there is no quoting going on, neither in the ORM, nor in the DBAL. &lt;/p&gt;

&lt;p&gt;The test case needs to be fixed, of course.&lt;/p&gt;</comment>
                    <comment id="10379" author="beberlei" created="Sun, 1 Nov 2009 09:53:57 +0000"  >&lt;p&gt;But the DDL SQL is generated inside DBAL Platform, i don&apos;t see a way to affect its quoting identifiers or not strategy.&lt;/p&gt;

&lt;p&gt;All identifiers should be escaped by the platform maybe a bit harsh, i meant all the DDL sql. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10380" author="romanb" created="Sun, 1 Nov 2009 10:40:04 +0000"  >&lt;p&gt;If we would do that we would then need to take care of not quoting twice.&lt;/p&gt;

&lt;p&gt;I&apos;ll try to explain how it currently works, its quite simple. Yes, the platform constructs the DDL, based on some parameters and these may already be quoted or escaped or whatever. The platform doesnt do anything with it, except embed it into the DDL statement.&lt;/p&gt;

&lt;p&gt;I&apos;ll try to quickly outline the process of a quoted table/column name:&lt;/p&gt;

&lt;p&gt;1) @Column(name=&quot;`number`&quot;, ...)&lt;/p&gt;

&lt;p&gt;2) Inside ClassMetadata/AssociactionMapping where the mapping is validated &amp;amp; completed, the following happens: If the column name starts with a backtick `, apply trim(&apos;`&apos;, $name) before storing the name (never store quoted names anywhere!) and mark &apos;quoted&apos; =&amp;gt; true for that column.&lt;/p&gt;

&lt;p&gt;3) Whenever a table or column name is placed in an SQL statement *&lt;b&gt;or&lt;/b&gt;* passed to the DBAL use one of the following methods, depending on who owns the column:&lt;/p&gt;

&lt;p&gt;ClassMetadata#getQuotedColumnName($name, $platform)&lt;br/&gt;
ClassMetadata#getQuotedTableName($platform)&lt;br/&gt;
OneToOneMapping#getQuotedJoinColumnName($name, $platform)&lt;br/&gt;
ManyToManyMapping#getQuotedJoinColumnName($name, $platform)&lt;/p&gt;

&lt;p&gt;Thats it.&lt;/p&gt;

&lt;p&gt;Now, SchemaTool, for example uses (or should use!) These methods when it constructs the parameters that are passed to the DBAL.&lt;/p&gt;

&lt;p&gt;Identifier quoting is a very ugly problem and we tried to minimize the effect it has on our code. The only solid way to fix the problem of a reserved name is to change the name and not to quote it.&lt;/p&gt;

&lt;p&gt;Of course, if you have a better idea/solution, just shoot! &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10381" author="romanb" created="Sun, 1 Nov 2009 10:49:12 +0000"  >&lt;p&gt;Btw. What is the reserved word in testGetCreateSchemaSql2 ? &quot;decimal&quot; ?&lt;/p&gt;</comment>
                    <comment id="10382" author="beberlei" created="Sun, 1 Nov 2009 10:53:13 +0000"  >&lt;p&gt;Yes its decimal, thanks for your explanation, i get it why its not necessary to quote at this point then.&lt;/p&gt;

&lt;p&gt;Ok, then its probably just that decimal should be quoted in the DecimalModel.&lt;/p&gt;</comment>
                    <comment id="10383" author="romanb" created="Sun, 1 Nov 2009 11:06:06 +0000"  >&lt;p&gt;Just did that! Thanks for finding this.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-82] ConvertMapping is broken in latest svn</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-82</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The ConvertMapping class tries to call &quot;parent::validate()&quot;, but the parent class is abstract, so this fails. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10278">DDC-82</key>
            <summary>ConvertMapping is broken in latest svn</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Oct 2009 16:20:52 +0000</created>
                <updated>Sun, 1 Nov 2009 18:08:55 +0000</updated>
                    <resolved>Sun, 1 Nov 2009 18:08:55 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10361" author="nicokaiser" created="Fri, 30 Oct 2009 16:40:42 +0000"  >&lt;p&gt;This affects all Cli/Tasks, they have to be changed as well.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10121" name="convertmapping-broken.patch" size="559" author="nicokaiser" created="Fri, 30 Oct 2009 16:20:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-81] Wrong class names when using sub-namespaces</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-81</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using sub-namespaces, e.g. an entity is named &quot;Entity\User\Permission&quot;, the annontated PHP file has the wrong class:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;- - - 8&amp;lt; - - - -&lt;br/&gt;
namespace Entity\User;&lt;br/&gt;
...&lt;br/&gt;
class User\Permission&lt;br/&gt;
{&lt;br/&gt;
...&lt;/li&gt;
	&lt;li&gt;- - - 8&amp;lt; - - - -&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The namespace is correct, but the class should be &quot;class Permission&quot;...&lt;/p&gt;

&lt;p&gt;The attaches patch should fix this in AnnotationExporter&lt;/p&gt;</description>
                <environment></environment>
            <key id="10277">DDC-81</key>
            <summary>Wrong class names when using sub-namespaces</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Oct 2009 16:14:43 +0000</created>
                <updated>Wed, 11 Nov 2009 21:18:42 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 21:18:42 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10602" author="jwage" created="Wed, 11 Nov 2009 21:18:42 +0000"  >&lt;p&gt;Thanks for the ticket and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10120" name="annotationexporter-subnamespaces.patch" size="657" author="nicokaiser" created="Fri, 30 Oct 2009 16:14:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-83] Tests segfault under oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-83</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In \Doctrine\Tests\ORM\Functional\AdvancedAssociationTest::testIssue() lines 87, 97 and 98 cause PHP to segfault when running the test suite under PHp 5.3 and oracle. Has something to do with what Doctrine does with lazy loading..Not quite sure but this is all I have figured out up until now.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10280">DDC-83</key>
            <summary>Tests segfault under oracle</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Oct 2009 21:16:17 +0000</created>
                <updated>Wed, 11 Nov 2009 21:20:50 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 21:20:50 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10543" author="romanb" created="Sun, 8 Nov 2009 09:09:05 +0000"  >&lt;p&gt;This seems to only affect pdo_oci. This should be fixed once we have an oci8 driver that we can then use for the tests.&lt;/p&gt;</comment>
                    <comment id="10544" author="romanb" created="Sun, 8 Nov 2009 11:15:55 +0000"  >&lt;p&gt;First functional version of OCI8 driver is committed. Try changing the driver name from &quot;pdo_oci&quot; to &quot;oci8&quot; in your oracle XML config for the test suite.&lt;/p&gt;</comment>
                    <comment id="10604" author="jwage" created="Wed, 11 Nov 2009 21:20:50 +0000"  >&lt;p&gt;This is committed and is working well so far. We should open new issues now for any problems we find.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="10350">DDC-120</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-79] Allow constructor arguments in persistable models</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-79</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently, at the reconstitution phase, models are created using the &apos;new&apos; keyword. This implies a requirement that one must be able to create the model without any arguments to it&apos;s constructor. Actually this is the only requirement for the models implied by Doctrine. This requirement makes it impossible to use constructor-based dependency injection for example.&lt;/p&gt;

&lt;p&gt;At least two project&apos;s that I know of (php-object-freezer and FLOW3) solve this by using a trick which creates an object without running it&apos;s constructor:&lt;/p&gt;

&lt;p&gt;$object = unserialize(sprintf(&apos;O:%d:&quot;%s&quot;:0:{}&apos;, strlen($className), $className));&lt;/p&gt;</description>
                <environment></environment>
            <key id="10272">DDC-79</key>
            <summary>Allow constructor arguments in persistable models</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="dennari">Ville V&#228;&#228;n&#228;nen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Oct 2009 09:18:26 +0000</created>
                <updated>Wed, 10 Feb 2010 05:49:01 +0000</updated>
                    <resolved>Wed, 10 Feb 2010 05:49:01 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-BETA1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="10344" author="romanb" created="Fri, 30 Oct 2009 09:41:41 +0000"  >&lt;p&gt;This looks like a rather slow workaround to me. You can use constructor arguments but they must all be optional.&lt;/p&gt;

&lt;p&gt;The &quot;restrictions&quot; on entities are explained here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/architecture#entities&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/architecture#entities&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="10345" author="romanb" created="Fri, 30 Oct 2009 09:47:05 +0000"  >&lt;p&gt;I will try the alternative, however, and see how it performs/works, thanks.&lt;/p&gt;</comment>
                    <comment id="10347" author="romanb" created="Fri, 30 Oct 2009 10:22:41 +0000"  >&lt;p&gt;Here is a small test of mine:&lt;/p&gt;

&lt;div class=&quot;code panel&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 {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $foo;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {}
}

$className = &apos;A&apos;;
$initString = sprintf(&apos;O:%d:&lt;span class=&quot;code-quote&quot;&gt;&quot;%s&quot;&lt;/span&gt;:0:{}&apos;, strlen($className), $className);

$s=microtime(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i=0; $i&amp;lt;100000; ++$i) {
    $entity = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $className;
    &lt;span class=&quot;code-comment&quot;&gt;//$entity = unserialize($initString);
&lt;/span&gt;}

$e=microtime(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);

echo ($e - $s) . &lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;br/&amp;gt;&quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Results:&lt;/p&gt;

&lt;div class=&quot;code panel&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;new&lt;/span&gt;: 0.095 seconds
unserialize: 0.18 seconds
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So its twice as slow. However, this is for 100000 objects. So in practice this might not make any noticeable difference. I will keep this open for discussion. Thanks for the suggestion.&lt;/p&gt;</comment>
                    <comment id="10348" author="dennari" created="Fri, 30 Oct 2009 10:36:02 +0000"  >&lt;p&gt;It would seem to me that the advantages outweigh the slight performance cost. I&apos;d thought that the difference was more.&lt;/p&gt;</comment>
                    <comment id="10349" author="romanb" created="Fri, 30 Oct 2009 10:46:06 +0000"  >&lt;p&gt;Yes, I thought it would be slower, too.&lt;/p&gt;

&lt;p&gt;I have yet another idea, that might even be faster than &quot;new ..&quot;. We could store a prototype in ClassMetadata like so:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($entityName)
    {
        &lt;span class=&quot;code-comment&quot;&gt;// other stuff
&lt;/span&gt;        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;prototype = unserialize(sprintf(&apos;O:%d:&lt;span class=&quot;code-quote&quot;&gt;&quot;%s&quot;&lt;/span&gt;:0:{}&apos;, strlen($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name), $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name));
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then 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;$entity = clone $class-&amp;gt;prototype;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Clone is even faster than new. In the test above, the result of using clone is: 0.065 seconds&lt;/p&gt;

&lt;p&gt;Only drawback: Entity classes must not implement __clone&lt;/p&gt;</comment>
                    <comment id="10355" author="dennari" created="Fri, 30 Oct 2009 11:18:16 +0000"  >&lt;p&gt;Well, I&apos;d much rather take constructors with no requirements than no __clone. I made another, more &apos;real life&apos;, test:&lt;/p&gt;

&lt;p&gt;In UnitOfWork-&amp;gt;createEntity I change between&lt;/p&gt;
&lt;div class=&quot;code panel&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;//$entity = unserialize(sprintf(&apos;O:%d:&lt;span class=&quot;code-quote&quot;&gt;&quot;%s&quot;&lt;/span&gt;:0:{}&apos;, strlen($className), $className));
&lt;/span&gt;$entity = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $className;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Test:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $timer = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PHPUnit_Util_Timer();
        $orders = array();
        $timer-&amp;gt;start();
        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;($i=0;$i&amp;lt;5000;$i++) {
            $order = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Order();
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($order);
            $orders[] = $order; 
        }
        $creationTime = $timer-&amp;gt;stop();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;flush();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();
        $timer-&amp;gt;start();
        foreach($orders as $order) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;find(&apos;Order&apos;,$order-&amp;gt;getId());
        }
        $reconstitutionTime = $timer-&amp;gt;stop();
        printf(&lt;span class=&quot;code-quote&quot;&gt;&quot;creationTime: %.2f\n reconstitutionTime: %.2f&quot;&lt;/span&gt;,$creationTime,$reconstitutionTime);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Results (reconstitution times):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;: 8.07s
unserialize: 8.16s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    <comment id="10356" author="romanb" created="Fri, 30 Oct 2009 11:25:17 +0000"  >&lt;p&gt;5000 find() == 5000 database queries is not so much a real-life test, hehe. &lt;/p&gt;

&lt;p&gt;&quot;Well, I&apos;d much rather take constructors with no requirements than no __clone&quot;&lt;/p&gt;

&lt;p&gt;I dont understand. Would you be ok with the cloning solution or not?&lt;/p&gt;</comment>
                    <comment id="10357" author="dennari" created="Fri, 30 Oct 2009 11:39:15 +0000"  >&lt;p&gt;Sorry if I was unclear. To me the cloning solution is absolutely perfect, as I&apos;ve never even used __clone. But I can guess that for some it might be a big deal. I&apos;d suggest that by default Doctrine would use unserialize(...) every time, as this would be the most &apos;compatible&apos; solution. Using the cloning strategy could be a config option.&lt;/p&gt;

&lt;p&gt;p.s. Okay, maybe not exactly real life &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; .&lt;/p&gt;</comment>
                    <comment id="10368" author="beberlei" created="Sat, 31 Oct 2009 09:05:30 +0000"  >&lt;p&gt;The unserialize hack begs the question if there is a PHP Unit-Test for it. Its so ugly I wouldn&apos;t rely on it working across all php versions in the past and future &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10370" author="romanb" created="Sat, 31 Oct 2009 09:19:04 +0000"  >&lt;p&gt;@Benjamin: I think the fact that unserialization does not invoke the constructor is by design. You would not expect that that constructor gets invoked again whenever an object is serialized/unserialized. This behavior is also found in many other languages, at least for Java and C# I can say its pretty much the same. So I think we could rely on it to work.&lt;/p&gt;</comment>
                    <comment id="10401" author="dennari" created="Mon, 2 Nov 2009 16:33:42 +0000"  >&lt;p&gt;Yes, it&apos;s certainly not by chance that the constructor doesn&apos;t get called. It would complicate object serialization/unserialization quite a bit.&lt;/p&gt;</comment>
                    <comment id="10402" author="beberlei" created="Mon, 2 Nov 2009 16:58:40 +0000"  >&lt;p&gt;Both unserialize and clone have domain use-cases. I am not convinced, maybe make the three options configurable?&lt;/p&gt;</comment>
                    <comment id="10404" author="dennari" created="Mon, 2 Nov 2009 17:10:35 +0000"  >&lt;p&gt;Making it configurable is of course a good idea. Benjamin, this wouldn&apos;t affect any domain use-cases in any way, on the contrary it gives back all the use-cases that a constructor might have. Only drawback is the performance penalty that is measured here. Just because it&apos;s a little ugly doesn&apos;t mean it shouldn&apos;t be used &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &lt;/p&gt;</comment>
                    <comment id="10405" author="romanb" created="Mon, 2 Nov 2009 17:28:39 +0000"  >&lt;p&gt;Having configuration options for something like this is something I&apos;d like to avoid. The problem is that &lt;b&gt;all&lt;/b&gt; these options: constructor, clone and unserialization have domain use-cases. And I have to agree that the constructor is probably the most intrusive.&lt;/p&gt;

&lt;p&gt;@Ville: What Benjamin means is that whenever unserialize() is called and the domain class has either a __wakeup method or implements the Serializable interface, then this method will be called.&lt;/p&gt;

&lt;p&gt;This is really difficult.&lt;/p&gt;
</comment>
                    <comment id="10406" author="dennari" created="Mon, 2 Nov 2009 19:07:22 +0000"  >&lt;p&gt;Yes of course, overlooked the __wakeup call... Although if you think about it, unserialization of and reconstitution of an object by Doctrine are not entirely different types of events. Getting a __wakeup call might even be useful.&lt;/p&gt;</comment>
                    <comment id="10407" author="dennari" created="Mon, 2 Nov 2009 20:08:02 +0000"  >&lt;p&gt;Constructor arguments are a great way of enforcing required dependencies and I&apos;d go as far as to say that having that option when designing your models is quite a big deal. And to be clear, this is not something I came up with myself, I first saw it in Sebastian Bergmann&apos;s presentation &lt;a href=&quot;http://sebastian-bergmann.de/archives/867-Cool-Objects-Sleep-on-the-Couch.html&quot; class=&quot;external-link&quot;&gt;Cool Objects Sleep on the Couch&lt;/a&gt; (p.29 and __wakeup is mentioned also) and later on found out that the FLOW3 library is using this method as well.&lt;/p&gt;</comment>
                    <comment id="10422" author="romanb" created="Mon, 2 Nov 2009 22:56:55 +0000"  >&lt;p&gt;I got some interesting new findings.&lt;/p&gt;

&lt;p&gt;Apparently, if a class implements Serializable, Serializable#unserialize() is not called  when unserializing directly from such a compact string as shown in the issue description. This means only __wakeup is called. But since __wakeup is not really needed and the &quot;OO-way&quot; is to implement Serializable I think this is fine. Concerning cloning, I think this is very rarely used and can always be done in other ways by just implementing a regular &lt;del&gt;&amp;gt;clone/&lt;/del&gt;&amp;gt;copy method that acts according to the desired behavior.&lt;/p&gt;

&lt;p&gt;Given this new fact that serializing/unserializing through the Serializable interface is not affected by this special unserialize operation I am starting to lean towards the special unserialize/clone combination.&lt;/p&gt;

&lt;p&gt;Can someone confirm that &quot;unserialize(sprintf(&apos;O:%d:&quot;%s&quot;:0:{}&apos;, strlen($className), $className));&quot; does not invoke unserialize() if $className implements Serializable?&lt;/p&gt;</comment>
                    <comment id="10428" author="beberlei" created="Mon, 2 Nov 2009 23:21:08 +0000"  >&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;php -r &apos;class Foo &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; Serializable { &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $a; &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function serialize() { echo &lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt;; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; array(&apos;a&apos;); } &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function unserialize($data) { echo var_dump(unserialize($data)); } &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __wakeUp() { echo &lt;span class=&quot;code-quote&quot;&gt;&quot;wakeup&quot;&lt;/span&gt;;} } $className = &lt;span class=&quot;code-quote&quot;&gt;&quot;Foo&quot;&lt;/span&gt;; unserialize(sprintf(&lt;span class=&quot;code-quote&quot;&gt;&quot;O:%d:\&quot;&lt;/span&gt;%s\&lt;span class=&quot;code-quote&quot;&gt;&quot;:0:{}&quot;&lt;/span&gt;, strlen($className), $className));&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;confirms it.&lt;/p&gt;</comment>
                    <comment id="11119" author="beberlei" created="Wed, 9 Dec 2009 10:57:14 +0000"  >&lt;p&gt;I have some cons on this:&lt;/p&gt;

&lt;p&gt;1. People are definately going to put logic into the constructor, this would not be executed&lt;br/&gt;
2. People are definately going to put non-persistent variable initializations in the constructor, these would not be assigned.&lt;/p&gt;
</comment>
                    <comment id="11121" author="romanb" created="Wed, 9 Dec 2009 11:08:59 +0000"  >&lt;p&gt;These are actually both Pros.&lt;/p&gt;

&lt;p&gt;The constructor is not supposed to be executed when a persisted object is queried for. It exists already, it was created before. It is very counter-intuitive that it is constructed again.&lt;br/&gt;
Imagine that what we&apos;re actually trying to do is to make it look as if the persisted objects never leave memory.&lt;/p&gt;

&lt;p&gt;Logic and initializations in the constructor additionally just slow down the hydration/reconstitution process.&lt;/p&gt;</comment>
                    <comment id="11124" author="romanb" created="Wed, 9 Dec 2009 11:43:25 +0000"  >&lt;p&gt;Either way is surely not perfect but I feel not calling the constructor when reconstituting already persistent objects as preferrable.&lt;/p&gt;

&lt;p&gt;Some object databases and ORMs have a configuration switch for this, but I am really not keen on making configuration checks in such critical code paths.&lt;/p&gt;

&lt;p&gt;PostLoad is a good callback for initializations of transient/non-persistent fields in an entity that should be initialized after reconstitution also.&lt;br/&gt;
Probably 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;class Foo {

   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($arg1, $arg2, $arg3) {
        ....
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initstuff();
   }

    /** @PostLoad */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function initstuff() { ... }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Again, I think there is no perfect approach to this, but I like this one better.&lt;/p&gt;</comment>
                    <comment id="11125" author="romanb" created="Wed, 9 Dec 2009 11:55:40 +0000"  >&lt;p&gt;To show some problems with calling the constructor on reconstitution:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Foo {
   &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $things;   
 
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
        &lt;span class=&quot;code-comment&quot;&gt;// All &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Foos start with two things
&lt;/span&gt;       $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;things = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection;
       $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;things-&amp;gt;add(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Thing(&lt;span class=&quot;code-quote&quot;&gt;&quot;yada yada&quot;&lt;/span&gt;));
       $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;things-&amp;gt;add(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Thing(&lt;span class=&quot;code-quote&quot;&gt;&quot;yada yada&quot;&lt;/span&gt;));
   }

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

&lt;p&gt;Currently this would cause real issues because the elements would be contained in collections of reconstituted entities.&lt;br/&gt;
Of course we could empty out the collections when the object  is being reconstituted but in that case it would still be&lt;br/&gt;
code that is executed unnecessarily. Objects created and destroyed for nothing.&lt;/p&gt;

&lt;p&gt;Bottom line, we just cant know which of the logic in a constructor is supposed or safe to be executed on reconstitution.&lt;/p&gt;

&lt;p&gt;Just to show some more dangerous things of the current approach (in addition to the problematic fact that constructor arguments must be optional).&lt;/p&gt;
</comment>
                    <comment id="11127" author="beberlei" created="Wed, 9 Dec 2009 12:30:21 +0000"  >&lt;p&gt;Hm, i get your arguments, and you&apos;re right they are pros &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;We definately need a good section on this problem in the manual, no matter how it turns out to be implemented.&lt;/p&gt;</comment>
                    <comment id="11649" author="romanb" created="Wed, 10 Feb 2010 05:49:01 +0000"  >&lt;p&gt;Implemented.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="10746">DDC-261</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-73] Lifecycle Events only work with undocumented @HasLifecycleCallbacks in Annonation classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-73</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using Docblock Annotations, Lifecycle Events don&apos;t work as described here: &lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/events&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/events&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Functions with e.g. &quot;@PrePersist&quot; annonations are not called unless the class&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/warning.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; has &quot;@HasLifecycleCallbacks&quot; annotation in its class header docblock.&lt;/p&gt;

&lt;p&gt;This behavior should be either documented or changed (no need for the @HasLifecycleCallbacks annotation)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10266">DDC-73</key>
            <summary>Lifecycle Events only work with undocumented @HasLifecycleCallbacks in Annonation classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Oct 2009 16:06:44 +0000</created>
                <updated>Sun, 8 Nov 2009 09:03:55 +0000</updated>
                    <resolved>Sun, 8 Nov 2009 09:03:55 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10527" author="lucasts" created="Fri, 6 Nov 2009 18:53:34 +0000"  >&lt;p&gt;Working patch to trunk(r6683)&lt;/p&gt;

&lt;p&gt;WIth this patch the foreach ran every time, but as metadata are cached, I guess that will not be a problem.&lt;/p&gt;</comment>
                    <comment id="10532" author="romanb" created="Sat, 7 Nov 2009 12:10:00 +0000"  >&lt;p&gt;This should rather be fixed in the documentation instead. I think @HasLifecycleCallbacks is useful not only to save some overhead but also as a visual clue to quickly see whether a class has lifecycle callbacks without looking at all methods.&lt;/p&gt;</comment>
                    <comment id="10535" author="guilhermeblanco" created="Sat, 7 Nov 2009 19:29:26 +0000"  >&lt;p&gt;I think the opposite.&lt;/p&gt;

&lt;p&gt;Overhead will only exist during metadata creation.&lt;br/&gt;
It&apos;s then irrelevant since we strongly suggest a cache mechanism at the top of metadata information.&lt;/p&gt;

&lt;p&gt;I&apos;m +1 to commit suggested patch.&lt;/p&gt;</comment>
                    <comment id="10539" author="romanb" created="Sat, 7 Nov 2009 22:23:21 +0000"  >&lt;p&gt;Its far from irrelevant. Everything should be as fast as possible and during development you usually dont use APC/memcache as metadata cache because you would have to clear it manually after every change. Its simply not worth this absolutely minor convenience that we iterate over &lt;b&gt;all&lt;/b&gt; methods of &lt;b&gt;all&lt;/b&gt; entity classes just to look for lifecycle callbacks.&lt;/p&gt;

&lt;p&gt;Again, this needs to be fixed in the documentation.&lt;/p&gt;</comment>
                    <comment id="10542" author="romanb" created="Sat, 7 Nov 2009 22:34:37 +0000"  >&lt;p&gt;And to make it even clearer: Not even a metadata cache is the ultimate thing for performance since the unserialization is not very fast either. So please dont ever think something is irrelevant. This is php and php is pretty slow.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10147" name="ddc_73.patch" size="4844" author="lucasts" created="Fri, 6 Nov 2009 18:53:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-71] Method Doctrine\ORM\Tools\Export\Driver\AnnotationExporter::getClassToExtend() does not exist</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-71</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In Doctrine\ORM\Tools\Export\Driver\AnnotationExporter, on line 191 &amp;amp; 197, method getClassToExtend() is called, whereas the actual name of the method is _getClassToExtend().&lt;br/&gt;
It generates a fatal error when using command line tool symfony doctrine:build --all.&lt;/p&gt;</description>
                <environment>sfDoctrine2Plugin (currently embedding Doctrine 2.0.0 Alpha 1)  used with Symfony 1.3.0 BETA 1&lt;br/&gt;
WampServer, Apache 2.2.11, PHP 5.3.0, MySQL 5.1.36</environment>
            <key id="10263">DDC-71</key>
            <summary>Method Doctrine\ORM\Tools\Export\Driver\AnnotationExporter::getClassToExtend() does not exist</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="simonvdd">Simon VANDENDRIESSCHE</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Oct 2009 11:23:05 +0000</created>
                <updated>Wed, 11 Nov 2009 19:39:54 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 19:39:54 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10450" author="florian.klein" created="Tue, 3 Nov 2009 11:24:26 +0000"  >&lt;p&gt;I had the same problem with sfDoctrine2Plugin ( &lt;a href=&quot;http://svn.symfony-project.org/plugins/sfDoctrinePlugin/branches/1.3-2.0&quot; class=&quot;external-link&quot;&gt;http://svn.symfony-project.org/plugins/sfDoctrinePlugin/branches/1.3-2.0&lt;/a&gt; )&lt;br/&gt;
But it seems to be fixed as I can&apos;t reproduce the problem with ./symfony doctrine:build --all&lt;br/&gt;
in rev 6639&lt;/p&gt;</comment>
                    <comment id="10451" author="simonvdd" created="Tue, 3 Nov 2009 11:42:51 +0000"  >&lt;p&gt;Well the fix version is 2.0-ALPHA3, and sfDoctrine2Plugin is now embedding 2.0-ALPHA3 (was ALPHA1 when I submited this bug), so it might be OK. I&apos;ll check this out ASAP.&lt;/p&gt;</comment>
                    <comment id="10463" author="simonvdd" created="Tue, 3 Nov 2009 18:45:03 +0000"  >&lt;p&gt;Well I just downloaded the last version of sfDoctrine2Plugin, and the problem is still there.&lt;br/&gt;
Anyway, the method is still called _getClassToExtend(), and lines 191 &amp;amp; 197 are still calling getClassToExtend(), so it should not work I think... Except if it is a kind of magic that PHP allows, and in this case, I don&apos;t know about that !&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-72] column alias not recognized in ConvertDoctrine1Schema</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-72</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The syntax for column aliases used in D1 is not recognized &quot;column_name as field_name&quot;. This produces fatal errors when converting D1 YAML -&amp;gt; D2 YAML -&amp;gt; D2 Annotations. &lt;/p&gt;

&lt;p&gt;D1 yaml:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;xcoord as x:
        type: integer(3)
        unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;converted D2 yaml: &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;xcoord as x:
        type: integer(3)
        unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;expected output:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;x:
      columnName: xcoord
      type: integer(3)
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;patch attached.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10265">DDC-72</key>
            <summary>column alias not recognized in ConvertDoctrine1Schema</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="chriswest">Christian Ehmig</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Oct 2009 15:30:42 +0000</created>
                <updated>Wed, 11 Nov 2009 21:15:52 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 21:15:52 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10118" name="column_alias_patch.patch" size="707" author="chriswest" created="Thu, 29 Oct 2009 15:30:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-64] missing column type &quot;clob&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-64</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The legacy column type &quot;clob&quot; is not recognized by &quot;Doctrine\ORM\Tools\ConvertDoctrine1Schema&quot;. It should be correctly mapped to &quot;text&quot;. &lt;/p&gt;

&lt;p&gt;Patch attached.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10247">DDC-64</key>
            <summary>missing column type &quot;clob&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="chriswest">Christian Ehmig</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Oct 2009 22:39:57 +0000</created>
                <updated>Wed, 11 Nov 2009 20:44:27 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 20:44:27 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10320" author="romanb" created="Tue, 27 Oct 2009 22:45:14 +0000"  >&lt;p&gt;As you&apos;ve seen, &quot;text&quot; is the D2 type that maps to a text/clob. This either needs to be fixed in the schema managers (Doctrine\DBAL\Schema\... if they output &apos;clob&apos; as a portable column type thats a bug) or in the conversion code of convert-mapping.&lt;/p&gt;

&lt;p&gt;Where are you experiencing this? On the CLI with convert-mapping or when reverse-engineering a database?&lt;/p&gt;</comment>
                    <comment id="10321" author="romanb" created="Tue, 27 Oct 2009 22:47:05 +0000"  >&lt;p&gt;To clarify: This is a real issue, just patched in the wrong location &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10324" author="chriswest" created="Tue, 27 Oct 2009 23:01:00 +0000"  >&lt;p&gt;Yes, I experienced it when converting Doctrine 1.x YAML to 2.0. The output is still &quot;clob&quot; - You are right - wrong patch location then &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10339" author="chriswest" created="Thu, 29 Oct 2009 14:12:16 +0000"  >&lt;p&gt;Attached the correct patch &quot;legacy_column_map_patch.patch&quot; is the correct one. How can I delete obsolete attachments in jira?&lt;/p&gt;</comment>
                    <comment id="10601" author="jwage" created="Wed, 11 Nov 2009 20:44:27 +0000"  >&lt;p&gt;Thanks for the ticket and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10117" name="legacy_column_map_patch.patch" size="1279" author="chriswest" created="Thu, 29 Oct 2009 14:10:12 +0000" />
                    <attachment id="10104" name="missing_type_clob_patch.patch" size="566" author="chriswest" created="Tue, 27 Oct 2009 22:39:57 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-66] missing column type &quot;timestamp&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-66</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The former supported column type &quot;timestamp&quot; is not defined in Doctrine\DBAL\Types\Type.&lt;/p&gt;

&lt;p&gt;Patches and suggestions follow.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10249">DDC-66</key>
            <summary>missing column type &quot;timestamp&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="chriswest">Christian Ehmig</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Oct 2009 22:46:44 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:44 +0000</updated>
                    <resolved>Wed, 11 Nov 2009 20:46:55 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10323" author="romanb" created="Tue, 27 Oct 2009 22:49:43 +0000"  >&lt;p&gt;See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-64&quot; title=&quot;missing column type &amp;quot;clob&amp;quot;&quot;&gt;&lt;del&gt;DDC-64&lt;/del&gt;&lt;/a&gt; for where best to patch this.&lt;/p&gt;</comment>
                    <comment id="10340" author="chriswest" created="Thu, 29 Oct 2009 14:41:07 +0000"  >&lt;p&gt;I think you need another type &quot;Timestamp&quot;. Otherwise you cannot decide if it should be mapped to a &quot;DATETIME&quot; or &quot;TIMESTAMP&quot; column in mysql. A timestamp column only requires 4 bytes of storage space - datetime requires 8 bytes, so this is quite a decision regarding performance and storage space. a timestamp, of course, is limited to a date range. see &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I see that in D1 you mapped &quot;timestamp&quot; to &quot;DATETIME&quot;. To be fully backwards compatible, a timstamp should be converted to a D2 &quot;DateTime&quot; type then (in this case ignore the first paragraph of this comment &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;). &lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-59] Add Caching chapter to the manual</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-59</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This chapter should cover the use of the cache drivers in the Common package with all their features. Examples should show how to use these cache drivers together with query, result and metadata caches. It should also warn of cache slams especially when letting the cache driver manage the cache keys.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10230">DDC-59</key>
            <summary>Add Caching chapter to the manual</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Oct 2009 15:00:31 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:34 +0000</updated>
                    <resolved>Sat, 24 Oct 2009 00:42:10 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>Documentation</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-57] ManyToMany PDOException MySQL Syntax Error</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-57</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For ManyToMany Relation I have an MySQL Sytax Error from the StandardEntityPersister.php&lt;/p&gt;

&lt;p&gt;Hier is my error code:&lt;/p&gt;

&lt;p&gt;2009-10-22T09:39:31+02:00 ERR (3): exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;= lemma_type.type_id WHERE lemma_type.lemma_id = NULL&apos; at line 1&apos; in /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:475&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php(475): PDOStatement-&amp;gt;execute(Array)&lt;br/&gt;
#1 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Mapping/ManyToManyMapping.php(186): Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;loadManyToManyCollection(Object(Doctrine\ORM\Mapping\ManyToManyMapping), Array, Object(Doctrine\ORM\PersistentCollection))&lt;br/&gt;
#2 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/PersistentCollection.php(233): Doctrine\ORM\Mapping\ManyToManyMapping-&amp;gt;load(Object(kateglo\application\models\Lemma), Object(Doctrine\ORM\PersistentCollection), Object(Doctrine\ORM\EntityManager))&lt;br/&gt;
#3 /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/PersistentCollection.php(495): Doctrine\ORM\PersistentCollection-&amp;gt;_initialize()&lt;br/&gt;
#4 /usr/local/zend/apache2/htdocs/kateglo/application/views/scripts/search/index.phtml(24): Doctrine\ORM\PersistentCollection-&amp;gt;getIterator()&lt;/p&gt;

&lt;p&gt;@roman: i send you the new database structure and the php code (models etc..)&lt;/p&gt;</description>
                <environment>PHP 5.3.0 (cli) (built: Jul 21 2009 08:22:07)&lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&lt;br/&gt;
Server Version: Apache/2.2.11 (Ubuntu) mod_jk/1.2.26 PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch&lt;br/&gt;
Server Built: Aug 18 2009 14:26:31&lt;br/&gt;
&lt;br/&gt;
mysql Ver 14.14 Distrib 5.1.31, for debian-linux-gnu (i486) using EditLine wrapper </environment>
            <key id="10221">DDC-57</key>
            <summary>ManyToMany PDOException MySQL Syntax Error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="purnama">Arthur Purnama</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Oct 2009 07:45:05 +0000</created>
                <updated>Mon, 26 Oct 2009 13:19:21 +0000</updated>
                    <resolved>Mon, 26 Oct 2009 13:19:21 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10280" author="purnama" created="Thu, 22 Oct 2009 10:59:38 +0000"  >&lt;p&gt;This is the SQL statement produce by&lt;br/&gt;
$this-&amp;gt;_getSelectManyToManyEntityCollectionSql($assoc, $criteria)&lt;/p&gt;

&lt;p&gt;on line 474:&lt;/p&gt;

&lt;p&gt;SELECT type_id, type_name, type_abbreviation FROM type INNER JOIN lemma_type ON type. = lemma_type.type_id WHERE lemma_type.lemma_id = NULL;&lt;/p&gt;

&lt;p&gt;as you can see the syntax after ON is failure its type. with dot.&lt;/p&gt;</comment>
                    <comment id="10286" author="purnama" created="Fri, 23 Oct 2009 11:43:37 +0000"  >&lt;p&gt;Hallo,&lt;/p&gt;

&lt;p&gt;I try to fix this issue myself. i send you the patch code right after this.&lt;/p&gt;

&lt;p&gt;for the info. i change my manytomany mapping like this&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@var kateglo\application\helpers\collections\ArrayCollection&lt;/li&gt;
	&lt;li&gt;@ManyToMany(targetEntity=&quot;kateglo\application\models\Lemma&quot;)&lt;/li&gt;
	&lt;li&gt;@JoinTable(name=&quot;lemma_type&quot;,&lt;/li&gt;
	&lt;li&gt;joinColumns=
{@JoinColumn(name=&quot;type_id&quot;, referencedColumnName=&quot;id&quot;)}
&lt;p&gt;,&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;inverseJoinColumns=
{@JoinColumn(name=&quot;lemma_id&quot;, referencedColumnName=&quot;lemma&quot;)}&lt;/li&gt;
	&lt;li&gt;)&lt;br/&gt;
	 */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;as you cann see the referencedColumnName did not referenced to column name in the database, but the member variable of the Entity class. or something like that. i dont understand &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; but this is incosequent. maybe on later fix.. but i go on with this right now.&lt;/p&gt;
</comment>
                    <comment id="10288" author="romanb" created="Fri, 23 Oct 2009 15:03:46 +0000"  >&lt;p&gt;This should be fixed now in trunk. If not, please reopen this issue with new information. Thanks for reporting!&lt;/p&gt;</comment>
                    <comment id="10294" author="purnama" created="Mon, 26 Oct 2009 09:21:37 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Thank You for the patch.&lt;/p&gt;

&lt;p&gt;But its still not functioning. I think you need to see my patch file that is attached to this issue.&lt;/p&gt;

&lt;p&gt;There is two other problems that to be fix on many to many. the first one is ambigous table name problem (my relation table have the same column name as his parent table for foreign key. &lt;/p&gt;

&lt;p&gt;the secod problem is the referencedColumnId name must be a class name or something.&lt;/p&gt;

&lt;p&gt;only if i do this patch i can go on.&lt;/p&gt;

&lt;p&gt;please take a look.&lt;/p&gt;

&lt;p&gt;regards,&lt;br/&gt;
Arthur&lt;/p&gt;</comment>
                    <comment id="10295" author="romanb" created="Mon, 26 Oct 2009 09:32:34 +0000"  >&lt;p&gt;Just to be sure, did you revert your local changes, using only the original latest code from trunk and changing back your annotations to the &quot;right way&quot; (column names)?&lt;/p&gt;

&lt;p&gt;Like I said, I reproduced the issue in our tests and fixed it. I am no longer able to reproduce it.&lt;/p&gt;

&lt;p&gt;Please add a new, failing test here: &lt;a href=&quot;http://trac.doctrine-project.org/browser/trunk/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/trunk/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add missing models, if necessary, and then attach a diff to this ticket.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="10297" author="romanb" created="Mon, 26 Oct 2009 12:02:47 +0000"  >&lt;p&gt;I think I see the issue with the ambigious table name but the other problem should be fixed already.&lt;/p&gt;</comment>
                    <comment id="10298" author="romanb" created="Mon, 26 Oct 2009 12:56:40 +0000"  >&lt;p&gt;I&apos;m working on it and will get back to you shortly.&lt;/p&gt;

&lt;p&gt;Thanks for your patience.&lt;/p&gt;</comment>
                    <comment id="10299" author="romanb" created="Mon, 26 Oct 2009 13:05:54 +0000"  >&lt;p&gt;Please try the latest code from trunk now and report back. Thanks!&lt;/p&gt;</comment>
                    <comment id="10300" author="purnama" created="Mon, 26 Oct 2009 13:06:34 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Hier i send you a patch file for testing the ManyToMany problem. i hope this help.&lt;br/&gt;
I see that you already working on that.&lt;/p&gt;

&lt;p&gt;Thank you very much.&lt;/p&gt;</comment>
                    <comment id="10301" author="purnama" created="Mon, 26 Oct 2009 13:13:03 +0000"  >&lt;p&gt;Ok it works,&lt;/p&gt;

&lt;p&gt;Thank You.&lt;/p&gt;</comment>
                    <comment id="10302" author="romanb" created="Mon, 26 Oct 2009 13:19:21 +0000"  >&lt;p&gt;I added your new test to our suite! Thank you!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10096" name="doctrine20.patch" size="3067" author="purnama" created="Fri, 23 Oct 2009 11:43:55 +0000" />
                    <attachment id="10098" name="doctrine20Test.diff" size="6100" author="purnama" created="Mon, 26 Oct 2009 13:06:34 +0000" />
                    <attachment id="10090" name="kateglo.tar.gz" size="10819" author="purnama" created="Thu, 22 Oct 2009 07:45:05 +0000" />
                    <attachment id="10089" name="kateglox.sql" size="12917" author="purnama" created="Thu, 22 Oct 2009 07:45:05 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-58] Getting &quot;undefined index&quot; notices from fields in subentities which are foreign indices.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-58</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a class with subclasses. One of the subclasses has fields which are foreign indices&lt;br/&gt;
If i do &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$em-&amp;gt;find(&apos;MyParentEntity&apos;, 1)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I get notices&lt;br/&gt;
Notice: Undefined index: somefieldwhichisforeignindex in /Doctrine/ORM/UnitOfWork.php on line 1708&lt;/p&gt;</description>
                <environment></environment>
            <key id="10223">DDC-58</key>
            <summary>Getting &quot;undefined index&quot; notices from fields in subentities which are foreign indices.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ablock">Avi Block</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Oct 2009 15:55:45 +0000</created>
                <updated>Thu, 22 Oct 2009 19:13:38 +0000</updated>
                    <resolved>Thu, 22 Oct 2009 19:13:38 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10281" author="romanb" created="Thu, 22 Oct 2009 16:56:26 +0000"  >&lt;p&gt;I assume this is Class Table Inheritance?&lt;/p&gt;

&lt;p&gt;If so, I think I know what to do.&lt;/p&gt;</comment>
                    <comment id="10282" author="ablock" created="Thu, 22 Oct 2009 17:10:16 +0000"  >&lt;p&gt;Yes, this is Class Table Inheritance.&lt;/p&gt;</comment>
                    <comment id="10283" author="romanb" created="Thu, 22 Oct 2009 19:13:38 +0000"  >&lt;p&gt;I reproduced this issue in our unit tests and then fixed it. So this issue should be fixed now. If not, please report back with new information.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-56] ManyToMany mapping does not take difference between field name and column name into account</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-56</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The fields of my entities are prefixed with an underscore since they are private variables. Since I don&apos;t like my database schema that way I&apos;ve named all the columns without the underscore, thus far no problems. Now when you create a ManyToMany mapping a problem occurs. The column name in the database is &quot;fieldname&quot; but the fieldname = &quot;_fieldname&quot;. We need an annotation in the form of @referencedFieldName to specify the relevant field name. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10207">DDC-56</key>
            <summary>ManyToMany mapping does not take difference between field name and column name into account</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="marijn">Marijn Huizendveld</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Oct 2009 01:49:56 +0000</created>
                <updated>Sun, 18 Oct 2009 20:36:38 +0000</updated>
                    <resolved>Sun, 18 Oct 2009 20:36:38 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10247" author="romanb" created="Sun, 18 Oct 2009 08:36:02 +0000"  >&lt;p&gt;I dont understand. Can you give an example?&lt;/p&gt;</comment>
                    <comment id="10248" author="marijn" created="Sun, 18 Oct 2009 17:14:13 +0000"  >&lt;p&gt;For the example the following model definition is used.&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;&apos;EntityAbstract.php&apos;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php

  namespace Entities;

  /**
   * @MappedSuperclass
   */
  &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class EntityAbstract
  {

    /**
     * @Id @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&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;

    /* ... */

  }
&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;&apos;Document.php&apos;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php

  namespace Entities;

  /**
   * @Entity
   * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;documents&quot;&lt;/span&gt;)
   */
  class Document &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; EntityAbstract
  {

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;uri&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_uri;

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;culture&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_culture;

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;description&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_description;

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;title&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_title;

    /**
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Keyword&quot;&lt;/span&gt;)
     * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;document_keywords&quot;&lt;/span&gt;, joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;document_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)}, inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;keyword_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; $_keywords;

    /* ... */

  }
&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;&apos;Keyword.php&apos;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php

  /**
   * @Entity
   * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;keywords&quot;&lt;/span&gt;)
   */
  class Keyword &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; EntityAbstract
  {

    /**
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_name;

    /**
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Document&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;_keywords&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $_documents;

    /* ... */

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

&lt;p&gt;The following query issues this error message: &lt;font color=&quot;red&quot;&gt;ErrorException: Undefined index: id in /path/to/Doctrine/ORM/Mapping/ClassMetadata.php on line 257&lt;/font&gt;&lt;/p&gt;

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

  $query = $em-&amp;gt;createQuery(&apos;SELECT d FROM Entities\Document d LEFT JOIN d._keywords k&apos;);

   printf(&lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;pre&amp;gt;\n%s\n&amp;lt;/pre&amp;gt;&quot;&lt;/span&gt;, $query-&amp;gt;getArrayResult());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10249" author="romanb" created="Sun, 18 Oct 2009 20:36:38 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-55] Query paramater mapping error</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-55</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems as though the query parameters start from &apos;1&apos; (?0 throws an exception), whereas the Query#_prepareParams function starts counting from 0.&lt;/p&gt;

&lt;p&gt;Code:&lt;br/&gt;
$query = $this-&amp;gt;em-&amp;gt;createQuery(&apos;SELECT s FROM Session s WHERE s.id = ?1&apos;);&lt;/p&gt;

&lt;p&gt;echo $query-&amp;gt;getSQL();&lt;/p&gt;

&lt;p&gt;$session = $query-&amp;gt;execute(array($id));&lt;br/&gt;
print_r($session);&lt;/p&gt;

&lt;p&gt;Output:&lt;br/&gt;
SELECT s0_.id AS id0, s0_.data AS data1, s0_.created AS created2, s0_.accessed AS accessed3 FROM Session s0_ WHERE s0_.id = ?&lt;/p&gt;

&lt;p&gt;Warning: Invalid argument supplied for foreach() in Doctrine/ORM/Query.php on line 222&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;PDOException&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;?&apos; at line 1&apos; in Doctrine/DBAL/Connection.php:602&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 Doctrine/DBAL/Connection.php(602): PDO-&amp;gt;query(&apos;SELECT s0_.id A...&apos;)&lt;br/&gt;
#1 Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(42): Doctrine\DBAL\Connection-&amp;gt;execute(&apos;SELECT s0_.id A...&apos;, Array)&lt;br/&gt;
#2 Doctrine/ORM/Query.php(198): Doctrine\ORM\Query\Exec\SingleSelectExecutor-&amp;gt;execute(Object(Doctrine\DBAL\Connection), Array)&lt;br/&gt;
#3 Doctrine/ORM/AbstractQuery.php(461): Doctrine\ORM\Query-&amp;gt;_doExecute(Array)&lt;br/&gt;
#4 classes/SessionManager.php(35): Doctrine\ORM\AbstractQuery-&amp;gt;execute(A in /var/www/tec-expo.com/development/libraries/Doctrine/DBAL/Connection.php on line 602&lt;/p&gt;

</description>
                <environment></environment>
            <key id="10202">DDC-55</key>
            <summary>Query paramater mapping error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="mcurcio">Matt Curcio</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Oct 2009 12:14:49 +0000</created>
                <updated>Wed, 28 Oct 2009 11:30:54 +0000</updated>
                    <resolved>Wed, 28 Oct 2009 11:30:54 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10245" author="romanb" created="Sat, 17 Oct 2009 14:42:18 +0000"  >&lt;p&gt;This:&lt;/p&gt;

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

&lt;p&gt;is the same as this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query-&amp;gt;execute(array(0 =&amp;gt; $id));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;is the same as this:&lt;/p&gt;

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

&lt;p&gt;Hence the error. We should probably check for isset($params&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;) in execute() and throw an exception in this case.&lt;/p&gt;

&lt;p&gt;To get it to work, either 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;$query-&amp;gt;execute(array(1 =&amp;gt; $id));
&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;$query-&amp;gt;setParameter(1, $id);
$query-&amp;gt;execute(); &lt;span class=&quot;code-comment&quot;&gt;// or $query-&amp;gt;getResult()&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10252" author="mcurcio" created="Mon, 19 Oct 2009 20:49:22 +0000"  >&lt;p&gt;While I have since discovered the &quot;colon-mapping&quot; scheme, for the users who would prefer this mapping method, why not allow the zero position?  Starting the count from zero would allow the simple execute() mechanism that I was trying, and while not very clear, might be useful for certain cases. &lt;/p&gt;</comment>
                    <comment id="10327" author="romanb" created="Wed, 28 Oct 2009 11:30:54 +0000"  >&lt;p&gt;Fixed now. A meaninfgul exception is thrown.&lt;/p&gt;

&lt;p&gt;Starting from 0 would be unintuitive as even PDO starts to count from 1.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10077" name="param_mapping.diff" size="489" author="mcurcio" created="Sat, 17 Oct 2009 12:14:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-48] Cache Namespaces</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-48</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;For users who run multiple doctrine 2 installations on a single machine, it is possible for APC/Memcache cache collisions to occur.  One possible solution would allow the user to specify a namespace when creating the cache instance.  I have attached such a solution.  However, after reviewing &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-47&quot; title=&quot;Improve query resultset cache control&quot;&gt;&lt;del&gt;DDC-47&lt;/del&gt;&lt;/a&gt;, there might be a better solution that addresses both requirements.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10189">DDC-48</key>
            <summary>Cache Namespaces</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mcurcio">Matt Curcio</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Oct 2009 22:00:23 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:34 +0000</updated>
                    <resolved>Thu, 22 Oct 2009 22:40:14 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10284" author="mcurcio" created="Fri, 23 Oct 2009 05:29:15 +0000"  >&lt;p&gt;Thanks for adding this feature.  It appears that the AbstractCache::fetch method is namespacing the id twice (&lt;a href=&quot;http://trac.doctrine-project.org/browser/trunk/lib/Doctrine/Common/Cache/AbstractCache.php?rev=6554#L59&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/trunk/lib/Doctrine/Common/Cache/AbstractCache.php?rev=6554#L59&lt;/a&gt;), is this intentional?&lt;/p&gt;</comment>
                    <comment id="10285" author="jwage" created="Fri, 23 Oct 2009 05:37:41 +0000"  >&lt;p&gt;Whoops. No this was just a mistake I made during the refactoring. It is fixed now.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10187">DDC-47</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10069" name="cache_namespaces.diff" size="5783" author="mcurcio" created="Wed, 14 Oct 2009 22:00:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-47] Improve query resultset cache control</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-47</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We need better control for setting the hash/key for resultset cache entries. Then provide a way to clear these cache entries.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/ticket/2042&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/2042&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;$temp = Doctrine_Query::create() 
-&amp;gt;from(&apos;Profile p&apos;) 
-&amp;gt;where(&apos;p.id=?&apos;, $o) 
-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY) 
-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;product_cache&apos;) &lt;span class=&quot;code-comment&quot;&gt;// custom tag 
&lt;/span&gt;-&amp;gt;execute(); 

$temp = Doctrine_Query::create() 
-&amp;gt;from(&apos;Model m&apos;) 
-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY) 
-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;product_cache&apos;) &lt;span class=&quot;code-comment&quot;&gt;// custom tag 
&lt;/span&gt;-&amp;gt;execute(); 

$temp = Doctrine_Query::create() 
-&amp;gt;from(&apos;News n&apos;) 
-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY) 
-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;news_cache&apos;) &lt;span class=&quot;code-comment&quot;&gt;// custom tag 
&lt;/span&gt;-&amp;gt;execute(); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$conn  = Doctrine_Manager::getConnection(&apos;sqlite_cache_connection&apos;); 
$cacheDriver = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Cache_Db(array(&apos;connection&apos; =&amp;gt; $conn, 
&apos;tableName&apos; =&amp;gt; &apos;cache&apos;)); 

$cacheDriver-&amp;gt;deleteByTag(&apos;product_cache&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10187">DDC-47</key>
            <summary>Improve query resultset cache control</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Oct 2009 21:17:14 +0000</created>
                <updated>Thu, 22 Oct 2009 22:39:55 +0000</updated>
                    <resolved>Thu, 22 Oct 2009 22:39:55 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10232" author="romanb" created="Thu, 15 Oct 2009 08:46:18 +0000"  >&lt;p&gt;The problematic part here is that APC/memcache/xcache dont have any notion of tags or tagging cache entries. They provide simple a simple key/value store. So we need to work with that.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10199">DC-112</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="10189">DDC-48</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-42] the DQL parser does not support boolean literal values</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-42</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The parser does not support boolean literal values. This means that comparisons like e.unlocked = true result in a syntax error. This is not what is intended, since both documentation and comments in the code Doctrine\ORM\Query\Parser.php line 1870 say that boolean literals are supported.&lt;/p&gt;

&lt;p&gt;I have a possible fix. I don&apos;t know if it is the best way to fix this.&lt;/p&gt;

&lt;p&gt;OLD:&lt;/p&gt;
&lt;div class=&quot;code panel&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 ::= string | &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; | integer | &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt; | &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function Literal()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lexer-&amp;gt;lookahead[&apos;type&apos;]) {
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_STRING:
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_INTEGER:
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_FLOAT:
				$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lexer-&amp;gt;lookahead[&apos;value&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;_lexer-&amp;gt;token[&apos;value&apos;];
            &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;syntaxError(&apos;Literal&apos;);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;NEW:&lt;/p&gt;
&lt;div class=&quot;code panel&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 ::= string | &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; | integer | &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt; | &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;
     *
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function Literal()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lexer-&amp;gt;lookahead[&apos;type&apos;]) {
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_STRING:
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_INTEGER:
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_FLOAT:
				$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lexer-&amp;gt;lookahead[&apos;value&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;_lexer-&amp;gt;token[&apos;value&apos;];
			&lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_TRUE:
			&lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_FALSE:
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lexer-&amp;gt;lookahead[&apos;value&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;_em-&amp;gt;getConnection()-&amp;gt;getDatabasePlatform()-&amp;gt;convertBooleans(strtolower($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lexer-&amp;gt;token[&apos;value&apos;]) == &apos;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&apos; ? &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; : &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
            &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;syntaxError(&apos;Literal&apos;);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using convertBooleans is important. Otherwise the sql will have &apos;true&apos; or &apos;false&apos;.&lt;/p&gt;

&lt;p&gt;Cases T_TRUE and T_FALSE should also be added to ArithmeticPrimary(). (line 2048)&lt;/p&gt;</description>
                <environment>HEAD from trunk</environment>
            <key id="10174">DDC-42</key>
            <summary>the DQL parser does not support boolean literal values</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Oct 2009 16:36:46 +0000</created>
                <updated>Tue, 13 Oct 2009 10:48:59 +0000</updated>
                    <resolved>Tue, 13 Oct 2009 10:48:59 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10210" author="romanb" created="Mon, 12 Oct 2009 19:53:23 +0000"  >&lt;p&gt;Thanks, I will work on this.&lt;/p&gt;

&lt;p&gt;One thing for your understanding though: The task of the parser is only to accept or deny input, thereby building up a syntax tree. Afterwards, one or more tree walkers can walk down this tree to do something with it. Normally this is just the SqlWalker that produces SQL. So it is the task of this SqlWalker to properly quote the literals. The Parser does not even care what the output will be.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-43] offset and limit are in the wrong order (at least SQLite)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-43</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The following code creates an error:&lt;/p&gt;

&lt;p&gt;Code:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = Itoijala_Singletons::getDoctrine()-&amp;gt;createQueryBuilder();
$query-&amp;gt;select(&apos;e&apos;)-&amp;gt;from(&apos;Model\Guestbook\Entry e&apos;);
$query-&amp;gt;andWhere(&apos;e.dateDeleted IS NULL&apos;)-&amp;gt;andWhere(&apos;e.unlocked = TRUE&apos;);
$query-&amp;gt;orderBy(&apos;e.dateCreated&apos;, &apos;DESC&apos;)-&amp;gt;setFirstResult(($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getParam(&apos;page&apos;) - 1) * 15);
$query-&amp;gt;setMaxResults(15);

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;view-&amp;gt;entries = $query-&amp;gt;getQuery()-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Error:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1 near &quot;OFFSET&quot;: syntax error&lt;/p&gt;

&lt;p&gt;The DQL:&lt;br/&gt;
SELECT e FROM Model\Guestbook\Entry e WHERE (e.dateDeleted IS NULL) AND (e.unlocked = TRUE) ORDER BY e.dateCreated DESC&lt;/p&gt;

&lt;p&gt;The SQL:&lt;br/&gt;
SELECT g0_.id AS id0, g0_.name AS name1, g0_.email AS email2, g0_.homepage AS homepage3, g0_.content AS content4, g0_.comment AS comment5, g0_.unlocked AS unlocked6, g0_.date_created AS date_created7, g0_.date_updated AS date_updated8, g0_.date_deleted AS date_deleted9, g0_.creator_id AS creator_id10, g0_.updater_id AS updater_id11, g0_.deleter_id AS deleter_id12 FROM guestbook_entries g0_ WHERE (g0_.date_deleted IS NULL) AND (g0_.unlocked = 1) ORDER BY g0_.date_created DESC OFFSET 0 LIMIT 15&lt;/p&gt;

&lt;p&gt;SQLite expects offset to come after limit. writeLimitClause in AbstractPlatform works correctly and is not overriden by SqlitePlatform. This means that the bug is somewhere else. writeLimitClause is not called.&lt;/p&gt;</description>
                <environment>HEAD from trunk</environment>
            <key id="10175">DDC-43</key>
            <summary>offset and limit are in the wrong order (at least SQLite)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Oct 2009 17:55:10 +0000</created>
                <updated>Mon, 12 Oct 2009 19:10:52 +0000</updated>
                    <resolved>Mon, 12 Oct 2009 19:10:52 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-38] associations that are null should not create a prox object</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-38</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Associations that are nullable do not work as expected. When the association is null, i.e. the id in the database is null, the association is not null when loaded from the database. Doctrine creates a proxy object for the association that, when loaded, has no values for any fields. Doctrine should check during object hydration if the association is null. If true then no proxy object should be created. Please see &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-34&quot; title=&quot;schema-tool --create tries to create duplicate associations and exits with exception&quot;&gt;&lt;del&gt;DDC-34&lt;/del&gt;&lt;/a&gt; for my schema.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10165">DDC-38</key>
            <summary>associations that are null should not create a prox object</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Oct 2009 11:37:19 +0000</created>
                <updated>Wed, 28 Oct 2009 11:14:47 +0000</updated>
                    <resolved>Wed, 28 Oct 2009 11:14:47 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10198" author="romanb" created="Sat, 10 Oct 2009 11:54:01 +0000"  >&lt;p&gt;Yea, I know this issue and it needs to be corrected. When an association is optional (i.e. can be null) the fetch strategy must default to EAGER, instead of LAZY. That means even if the assocition is not joined, a separate select is issued because without fetching the association, you dont know whether null means &quot;not fetched&quot; or &quot;no association&quot;. Optional associations simply can not be lazy.&lt;/p&gt;</comment>
                    <comment id="10206" author="romanb" created="Mon, 12 Oct 2009 12:07:55 +0000"  >&lt;p&gt;Small correction: Optional, &lt;b&gt;single-valued&lt;/b&gt; associations can not be lazy.&lt;/p&gt;</comment>
                    <comment id="10207" author="itoijala" created="Mon, 12 Oct 2009 12:23:41 +0000"  >&lt;p&gt;If I have understood this correctly, making an association eagerly loaded means that it will always be loaded with the other end of the association. The eager associations that the first association has will also be loaded, etc. This means that, in a schema in which a user has an association to its creator, possibly very many users will be loaded if one is loaded.&lt;/p&gt;

&lt;p&gt;Loading only the one eager association is not a problem. Loading the eager associations of the association and so on is a problem. Would it be possible to add an option on optional associations to always load the id from the database to see if it is null. If it is null, we now know that no proxy object is needed. If it is not null, we create a proxy object that loads the entity lazily.&lt;/p&gt;

&lt;p&gt;This would mean that loading one user would not result in possibly many users being loaded, but only the originally loaded user. Accessing the creator would load it, like now. I am not sure about the performance impacts of this feature, but it should be better than eagerly loading the associations. I am also not sure if an additional select statement must be issued. Couldn&apos;t all queries automatically by default load the ids of the associations id the hydration mode is object?&lt;/p&gt;</comment>
                    <comment id="10218" author="romanb" created="Tue, 13 Oct 2009 10:52:45 +0000"  >&lt;p&gt;Yes, I think an optimization like this might be possible but its certainly non-trivial. So an optional single-valued association configured LAZY would mean that you get either NULL or an uninitialized proxy object. The EAGER loading needs improvements anyway. Thanks for the suggestion.&lt;/p&gt;

&lt;p&gt;Of course, if you happen to have a patch already I will happily look at it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10326" author="romanb" created="Wed, 28 Oct 2009 11:14:47 +0000"  >&lt;p&gt;This behavior is now fixed in the best way currently possible.&lt;/p&gt;

&lt;p&gt;Owning sides of a one-one association will always select the foreign key, so if the associated entity is not fetch-joined, it gets either a proxy or null.&lt;/p&gt;

&lt;p&gt;But &lt;b&gt;inverse sides of one-one associations can never be lazy&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;Imagine:&lt;/p&gt;

&lt;p&gt;User &amp;lt;-&amp;gt; Address (one-one, Address owning side with user_id)&lt;/p&gt;

&lt;p&gt;When only a User is loaded, we dont know whether the address is null or not and consequently whether we can use a proxy or not.&lt;br/&gt;
We would in any way either need a join or a separate select and both ways, we can just get the real object anyway if we&apos;re already forced to go to the database.&lt;/p&gt;

&lt;p&gt;For the owning side of a one-one this is easier! Since the foreign key is there we know what to do.&lt;/p&gt;

&lt;p&gt;This is the best behavior I can offer right now and I&apos;ve checked back with some of my Hibernate projects and they work the same.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-39] Proxy definition files doesn&apos;t get updated when changing Entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-39</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Proxy definitions are generated in /tmp but not accordingly updated  when their respective Entitiy-objects gets new methods, therefore _load() is never called on these new methods.&lt;/p&gt;
</description>
                <environment>Doctrine 2-trunk, No metadata caching, Postgresql</environment>
            <key id="10166">DDC-39</key>
            <summary>Proxy definition files doesn&apos;t get updated when changing Entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="crotalus">Nichlas L&#246;fdahl</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Oct 2009 11:51:13 +0000</created>
                <updated>Wed, 14 Oct 2009 20:22:21 +0000</updated>
                    <resolved>Wed, 14 Oct 2009 20:22:21 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10200" author="romanb" created="Sun, 11 Oct 2009 07:33:21 +0000"  >&lt;p&gt;I think we should do the following:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;In development mode, the proxy class files should be regenerated automatically when changed. This has some overhead but for development its very convenient.&lt;/li&gt;
	&lt;li&gt;New CLI tasks for generating proxies: &quot;generate-proxy-classes&quot; ?&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="10229" author="romanb" created="Wed, 14 Oct 2009 20:22:21 +0000"  >&lt;p&gt;This should work better now in HEAD. Please refer to the updated Configuration chapter of the manual, especially the section and configuration options about proxy classes. Also there is a new CLI task to (re)generate proxy classes by hand. Proxy classes now behave like all other classes with regard to class loading.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-35] [patch] The cli configuration maps the convert-mapping task to the wrong file name for the class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-35</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently the &lt;tt&gt;Cli&lt;/tt&gt; class maps the &lt;tt&gt;convert-mapping&lt;/tt&gt; task to the class with file name &lt;tt&gt;MappingTask&lt;/tt&gt; but this should be &lt;tt&gt;ConvertMappingTask&lt;/tt&gt; since that is the name of the class. I&apos;ve attached &lt;del&gt;two patch files&lt;/del&gt; (svn diff doesn&apos;t add the renamed file) one patch file. The first one renames the name of the class. &lt;del&gt;The second one renames the file to &lt;tt&gt;ConvertMappingTask&lt;/tt&gt;&lt;/del&gt;.&lt;/p&gt;</description>
                <environment>most recent version from the trunk</environment>
            <key id="10154">DDC-35</key>
            <summary>[patch] The cli configuration maps the convert-mapping task to the wrong file name for the class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="marijn">Marijn Huizendveld</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Oct 2009 01:54:03 +0000</created>
                <updated>Thu, 8 Oct 2009 16:23:38 +0000</updated>
                    <resolved>Thu, 8 Oct 2009 16:23:38 +0000</resolved>
                            <version>2.0-ALPHA2</version>
                                <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10064" name="fix_convert_mapping_task_patch_by_renaming.diff" size="904" author="marijn" created="Thu, 8 Oct 2009 01:54:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-27] schema-tool --create creates a table for a mapped superclass</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-27</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Using the schema-tool to create the database creates a table for a mapped superclass. I think this behaviour is not desired, since the fields of the superclass also exist in the subclass tables. Running php doctrine schema-tool --create --dump-sql --classdir=&quot;&amp;lt;...&amp;gt;&quot; generates the following output (MySql):&lt;/p&gt;

&lt;p&gt;CREATE TABLE Blameable (date_created DATETIME NOT NULL, date_updated DATETIME DEFAULT NULL, &lt;br/&gt;
date_deleted DATETIME DEFAULT NULL, creator_id INT DEFAULT NULL, updater_id INT DEFAULT NULL, &lt;br/&gt;
deleter_id INT DEFAULT NULL) ENGINE = InnoDB&lt;br/&gt;
ALTER TABLE Blameable ADD FOREIGN KEY (creator_id) REFERENCES user_users(id)&lt;br/&gt;
ALTER TABLE Blameable ADD FOREIGN KEY (updater_id) REFERENCES user_users(id)&lt;br/&gt;
ALTER TABLE Blameable ADD FOREIGN KEY (deleter_id) REFERENCES user_users(id)&lt;/p&gt;

&lt;p&gt;Only the mapped superclass exists in the classdir. I think it should not create any tables.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10131">DDC-27</key>
            <summary>schema-tool --create creates a table for a mapped superclass</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="itoijala">Ismo Toijala</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Oct 2009 10:17:58 +0000</created>
                <updated>Sat, 3 Oct 2009 22:08:00 +0000</updated>
                    <resolved>Sat, 3 Oct 2009 22:08:00 +0000</resolved>
                                            <fixVersion>2.0-ALPHA2</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10150" author="itoijala" created="Thu, 1 Oct 2009 10:30:08 +0000"  >&lt;p&gt;Example class, used to generate output.&lt;/p&gt;</comment>
                    <comment id="10151" author="romanb" created="Thu, 1 Oct 2009 10:32:16 +0000"  >&lt;p&gt;Is this with ALPHA1 or the latest code from HEAD? I remember Jon making some fixes recently for mapped superclasses.&lt;/p&gt;</comment>
                    <comment id="10153" author="itoijala" created="Thu, 1 Oct 2009 14:32:39 +0000"  >&lt;p&gt;This was with ALPHA1.&lt;/p&gt;</comment>
                    <comment id="10164" author="guilhermeblanco" created="Sat, 3 Oct 2009 16:08:59 +0000"  >&lt;p&gt;Are you able to try same thing with HEAD? If it works I can definately close the issue. &lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="10167" author="itoijala" created="Sat, 3 Oct 2009 17:03:36 +0000"  >&lt;p&gt;This works now using HEAD.&lt;/p&gt;

&lt;p&gt;No SQL is outputted with --dump-sql and no tables are created for the mapped superclass.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10052" name="Example.php" size="1102" author="itoijala" created="Thu, 1 Oct 2009 10:30:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-31] ClassMetadata discriminatorColumn[&apos;name&apos;] should always be set when discriminatorColumn is not null</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-31</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When creating an entity, StandardEntityPersister checks if the discriminatorColumn is null. If not it checks if discriminatorColumn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt; is $column. Sometimes