<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 05:44:54 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DDC+AND+fixVersion+%3D+%222.0-BETA4%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DDC+AND+fixVersion+%3D+%222.0-BETA4%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="37" total="37"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-633] fetch=&quot;EAGER&quot; is not loading one to one associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-633</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;&amp;lt;?php
namespace vo;

/**
 * @Entity
 */

class Appointment {
	
    /** @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;
	
	/**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Patient&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;appointment&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;patient_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; $patient;
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When doing a findAll() on appointments, $patient is being created as a proxy even though fetch is EAGER.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11477">DDC-633</key>
            <summary>fetch=&quot;EAGER&quot; is not loading one to one associations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jun 2010 15:25:08 +0000</created>
                <updated>Tue, 28 Sep 2010 15:19:25 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 05:05:54 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13834" author="beberlei" created="Sun, 8 Aug 2010 05:05:54 +0000"  >&lt;p&gt;Fixed in master&lt;/p&gt;</comment>
                    <comment id="13976" author="majkl578" created="Tue, 17 Aug 2010 12:19:19 +0000"  >&lt;p&gt;What is an advantage of this solution (in master) if it is loaded in the same way as when fetched lazily? Maybe it&apos;d be better to use INNER JOIN instead, at least for OneToOne and save one or more (probably unnecessary) SQL queries?&lt;/p&gt;</comment>
                    <comment id="13978" author="beberlei" created="Tue, 17 Aug 2010 12:40:01 +0000"  >&lt;p&gt;There is none (yet), it may be a future enhancement, however we dont know this yet. fetch=EAGER is not so useful at the moment.&lt;/p&gt;</comment>
                    <comment id="13989" author="majkl578" created="Tue, 17 Aug 2010 18:08:24 +0000"  >&lt;p&gt;I think that fetch=EAGER should behave like this DQL:&lt;br/&gt;
SELECT a, b FROM foo a JOIN a.bar b&lt;br/&gt;
This query will use INNER JOIN to load &quot;a.bar&quot; association, but fetch=EAGER won&apos;t.&lt;/p&gt;

&lt;p&gt;Should I open a new issue for this?&lt;/p&gt;</comment>
                    <comment id="14483" author="edke" created="Tue, 28 Sep 2010 11:01:08 +0000"  >&lt;p&gt;fetch=EAGER still is not working as I think it should.&lt;/p&gt;

&lt;p&gt;class Project  {&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@id&lt;/li&gt;
	&lt;li&gt;@column(type=&quot;integer&quot;)&lt;/li&gt;
	&lt;li&gt;@generatedValue(strategy=&quot;SEQUENCE&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    private $id;&lt;br/&gt;
    /**&lt;/li&gt;
	&lt;li&gt;@manyToOne(targetEntity=&quot;Client&quot;, inversedBy=&quot;projects&quot;, fetch=&quot;EAGER&quot;)&lt;/li&gt;
	&lt;li&gt;@joinColumn(name=&quot;id_client&quot;, referencedColumnName=&quot;id&quot;,nullable=false, onDelete=&quot;cascade&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    private $client;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;but after &lt;/p&gt;

&lt;p&gt;$this-&amp;gt;getEntityManager()&lt;del&gt;&amp;gt;find(&apos;\Entities\Project&apos;, $this&lt;/del&gt;&amp;gt;project);&lt;/p&gt;

&lt;p&gt;2 doctrine queries are executed:&lt;/p&gt;

&lt;p&gt;SELECT t0.id AS id1, t0.name AS name2, t0.paths AS paths3, t0.modified AS modified4, t0.created AS&lt;br/&gt;
created5, t0.has_running_tasks AS has_running_tasks6, t0.tasksCount AS taskscount7, t0.productsCount&lt;br/&gt;
AS productscount8, t0.id_client AS id_client9 &lt;br/&gt;
FROM projects t0 &lt;br/&gt;
WHERE t0.id = ?&lt;/p&gt;

&lt;p&gt;SELECT t0.id AS id1, t0.name AS name2, t0.modified AS modified3, t0.created AS created4 &lt;br/&gt;
FROM clients t0 &lt;br/&gt;
WHERE t0.id = ?&lt;/p&gt;

&lt;p&gt;And it should be one query with inner join to clients.&lt;/p&gt;</comment>
                    <comment id="14484" author="beberlei" created="Tue, 28 Sep 2010 13:01:13 +0000"  >&lt;p&gt;Eager doesnt mean it does a Join, it only means the query is executed directly&lt;/p&gt;</comment>
                    <comment id="14485" author="edke" created="Tue, 28 Sep 2010 15:19:25 +0000"  >&lt;p&gt;I see. And how can be achieved that product and client will be queried at once, and not only when I request product-&amp;gt;getClient() ? &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-790] Generating entities with cli failed on inheritated entities due missing PK</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-790</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;While generating entities with:&lt;/p&gt;

&lt;p&gt;./doctrine orm:generate-entities --generate-methods=true ../tmp/entities&lt;/p&gt;

&lt;p&gt;getting MappingException:  No identifier/primary key specified for Entity &apos;Entities\Admin&apos;. Every Entity must have an identifier/primary key. &lt;/p&gt;

&lt;p&gt;Admin is class inheritated, definition included:&lt;/p&gt;

&lt;p&gt;Person: &lt;a href=&quot;http://pastebin.com/5r9fXrAu&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/5r9fXrAu&lt;/a&gt;&lt;br/&gt;
Admin: &lt;a href=&quot;http://pastebin.com/51BcRZWZ&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/51BcRZWZ&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Kubuntu lucid lynx</environment>
            <key id="11886">DDC-790</key>
            <summary>Generating entities with cli failed on inheritated entities due missing PK</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="edke">Eduard Kracmar</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Sep 2010 10:08:03 +0000</created>
                <updated>Thu, 16 Sep 2010 05:32:46 +0000</updated>
                    <resolved>Wed, 15 Sep 2010 18:14:37 +0000</resolved>
                            <version>2.0-BETA4</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14304" author="beberlei" created="Wed, 8 Sep 2010 03:31:18 +0000"  >&lt;p&gt;You cannot generate entities in an inheritance hierachy currently&lt;/p&gt;</comment>
                    <comment id="14395" author="beberlei" created="Wed, 15 Sep 2010 16:35:12 +0000"  >&lt;p&gt;AFter having looked at the mappings, how do you plan to generate methods from annotated entities? I think the entity generator won&apos;t allow that, jwage?&lt;/p&gt;</comment>
                    <comment id="14401" author="jwage" created="Wed, 15 Sep 2010 18:12:09 +0000"  >&lt;p&gt;The problem with everything is that the inheritance hierarchy is not mapped, instead it is read at runtime from the classes themselves. So, when you&apos;re generating the initial entities from the mapping information, you don&apos;t have that information, so we can&apos;t properly generate a class with the &quot;class ClassName extends SomeOtherClass&quot; because we simply don&apos;t know it.&lt;/p&gt;

&lt;p&gt;To work around it all you have to do is manually create the file with the empty class inside of it, extending the class you want. When you run the orm:generate-entities again, it can properly read the subclasses of every entity and the generation will update the classes existing classes properties and methods instead of trying to generate a new class.&lt;/p&gt;

&lt;p&gt;Does that clear things up? I think the only way to fix it would be to allow the user to manually specify the all the inheritance information in the mapping information instead of reading it at run-time. That way we have all the information about some entities even before the actual classes exist and we can generate the right code then.&lt;/p&gt;

&lt;p&gt;Thoughts?&lt;/p&gt;</comment>
                    <comment id="14402" author="jwage" created="Wed, 15 Sep 2010 18:14:37 +0000"  >&lt;p&gt;Benjamin, yes it is possible. But like I mentioned above we don&apos;t know what class an entity extends until the class is created. You have no way to say in the mapping information that this entity extends this class.&lt;/p&gt;

&lt;p&gt;If you have an entity already created with just the annotated properties, and you run the command to generate entities it will update the class adding the methods to the class. If you were to add a new property to the class and annotate and run the command again, it would only add the 2 new methods to the bottom of the class.&lt;/p&gt;</comment>
                    <comment id="14404" author="edke" created="Thu, 16 Sep 2010 05:32:46 +0000"  >&lt;p&gt;This is really what I&apos;m looking for. I create classes, fill them with properties and define annotations for them. Then I run cli tool to generate all methods (getters and setters) for classes to skip the boring part of creating entity. Then if required, I modify getters and setters. &lt;/p&gt;

&lt;p&gt;Only problem was that it failed on classes that were inheritated because they were missing primary keys. &lt;/p&gt;

&lt;p&gt;As a workaround while generating methods for new entities, I moved away from project inheritated entities and after generating I moved them back. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-522] Join columns can not be named the same as the association fields.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-522</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Join columns can currently not be named the same as the association fields in a class. This apparently causes Doctrine to insert the identifier of the associated object instead of the actual object (on hydration of the fetch-joined association at least).&lt;/p&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * @OneToOne(...)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;item&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; $item;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11226">DDC-522</key>
            <summary>Join columns can not be named the same as the association fields.</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="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 11:44:17 +0000</created>
                <updated>Wed, 15 Sep 2010 14:05:18 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 07:16:55 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13846" author="romanb" created="Sun, 8 Aug 2010 07:16:55 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="11045">DDC-419</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11839">DDC-774</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-765] \Symfony\Components renamed to \Symfony\Component (singular) ... refactoring unfinished. console cannot be invoked</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-765</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I pulled from github the whole thing, but still stuck with sandbox:&lt;/p&gt;

&lt;p&gt;\doctrine\tools\sandbox&amp;gt;php doctrine.php&lt;br/&gt;
.PHP Warning:  require(doctrine\lib\vendor\Symfony\Components\Console\Helper\Helper.php): failed to open st&lt;br/&gt;
ream: No such file or directory in C:\Inetpub\wwwroot\BugTrackerORM\doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php&lt;br/&gt;
on line 148&lt;br/&gt;
PHP Stack trace:&lt;br/&gt;
PHP   1. &lt;/p&gt;
{main}
&lt;p&gt;() ..... doctrine\tools\sandbox\doctrine.php:0&lt;br/&gt;
PHP   2. require() .... doctrine\tools\sandbox\doctrine.php:21&lt;br/&gt;
PHP   3. Doctrine\Common\ClassLoader-&amp;gt;loadClass() ... doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\C&lt;br/&gt;
lassLoader.php:0&lt;br/&gt;
PHP   4. require() ... doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php:148&lt;br/&gt;
PHP   5. Doctrine\Common\ClassLoader-&amp;gt;loadClass() C:\Inetpub\wwwroot\BugTrackerORM\doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\C&lt;br/&gt;
lassLoader.php:0&lt;/p&gt;

&lt;p&gt;Warning: require(.... doctrine\lib\vendor\Symfony\Components\Console\Helper\Helper.php): failed to open stream:&lt;br/&gt;
No such file or directory in.... doctrine\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php on lin&lt;br/&gt;
e 148&lt;/p&gt;

&lt;p&gt;well, it seams that at some stage Symfony\Components got renamed to Symfony\Coponet:&lt;/p&gt;

&lt;p&gt;$ git log Component&lt;br/&gt;
commit 4a9f36800e3f55bc2cf61033573e1103594b4742&lt;br/&gt;
Author: S&amp;lt;C3&amp;gt;&amp;lt;A9&amp;gt;bastien HOUZE &amp;lt;sebastienhouze@mbash.livebox.home&amp;gt;&lt;br/&gt;
Date:   Mon Aug 23 08:21:41 2010 +0200&lt;br/&gt;
    Symfony/Components renamed into Symfony/Component&lt;/p&gt;

&lt;p&gt;When I copied Component into Componets I got:&lt;br/&gt;
.PHP Fatal error:  Cannot redeclare class Symfony\Component\Console\Helper\Helper in doctrine\lib\vendor\Sy&lt;br/&gt;
mfony\Components\Console\Helper\Helper.php on line 21&lt;/p&gt;</description>
                <environment>winXP, PHP 5.3.3 </environment>
            <key id="11821">DDC-765</key>
            <summary>\Symfony\Components renamed to \Symfony\Component (singular) ... refactoring unfinished. console cannot be invoked</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nad2000">Radomirs Cirskis</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 03:08:53 +0000</created>
                <updated>Mon, 30 Aug 2010 22:55:13 +0000</updated>
                    <resolved>Sun, 29 Aug 2010 04:34:01 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14115" author="nicokaiser" created="Fri, 27 Aug 2010 11:39:36 +0000"  >&lt;p&gt;Same for me, even worse, despite git submodule dependencies, the submodules (and their submodules) have different versions of &quot;Components&quot; vs. &quot;Component&quot;, so the CLI is broken now.&lt;/p&gt;</comment>
                    <comment id="14134" author="beberlei" created="Sun, 29 Aug 2010 04:32:56 +0000"  >&lt;p&gt;Yes this sucks, unfortunately for ORM depending on DBAL Beta 3 we cannot easily change this.&lt;/p&gt;

&lt;p&gt;Workaround until the next release of DBAL is uncommenting the following two lines  instantiating DBAL Commands from your doctrine.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;$cli-&amp;gt;addCommands(array(
    &lt;span class=&quot;code-comment&quot;&gt;// DBAL Commands
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For the next release this week this will be resolved.&lt;/p&gt;</comment>
                    <comment id="14185" author="codewench" created="Mon, 30 Aug 2010 22:55:13 +0000"  >&lt;p&gt;I came across this issue today. I installed Doctrine via PEAR and had to do a few things to get the sandbox example working, which might help as a workaround until the next release:&lt;/p&gt;

&lt;p&gt;1. make sure the PEAR directory is part of your php.ini include path&lt;br/&gt;
2. move the Symfony directory from &apos;PEAR/Doctrine/Symfony&apos; to &apos;PEAR/Symfony&apos;&lt;br/&gt;
3. update the paths to Doctrine &amp;amp; Symfony inside &apos;tools/sandbox/doctrine.php&apos; &amp;amp; &apos;tools/sandbox/cli-config.php&apos;&lt;/p&gt;

&lt;p&gt;I can now work with the sandbox examples.&lt;/p&gt;

&lt;p&gt;As a reference, this is what my cli-config.php source looks like now: (sorry for the unformatted code &amp;lt;pre&amp;gt; tag &amp;amp; &lt;span class=&quot;error&quot;&gt;&amp;#91;code&amp;#93;&lt;/span&gt; weren&apos;t recognized.)&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;require_once &apos;Doctrine/Common/ClassLoader.php&apos;;&lt;/p&gt;

&lt;p&gt;$classLoader = new \Doctrine\Common\ClassLoader(&apos;Doctrine\ORM&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Doctrine/ORM&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Doctrine\DBAL&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Doctrine/DBAL&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Doctrine\Common&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Doctrine/Common&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Symfony&apos;, realpath(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;Symfony&apos;));&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Entities&apos;, _&lt;em&gt;DIR&lt;/em&gt;_);&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
$classLoader = new \Doctrine\Common\ClassLoader(&apos;Proxies&apos;, _&lt;em&gt;DIR&lt;/em&gt;_);&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;/p&gt;

&lt;p&gt;$config = new \Doctrine\ORM\Configuration();&lt;br/&gt;
$config-&amp;gt;setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);&lt;br/&gt;
$driverImpl = $config-&amp;gt;newDefaultAnnotationDriver(array(_&lt;em&gt;DIR&lt;/em&gt;_.&quot;/Entities&quot;));&lt;br/&gt;
$config-&amp;gt;setMetadataDriverImpl($driverImpl);&lt;/p&gt;

&lt;p&gt;$config-&amp;gt;setProxyDir(_&lt;em&gt;DIR&lt;/em&gt;_ . &apos;/Proxies&apos;);&lt;br/&gt;
$config-&amp;gt;setProxyNamespace(&apos;Proxies&apos;);&lt;/p&gt;

&lt;p&gt;$connectionOptions = array(&lt;br/&gt;
    &apos;driver&apos; =&amp;gt; &apos;pdo_sqlite&apos;,&lt;br/&gt;
    &apos;path&apos; =&amp;gt; &apos;database.sqlite&apos;&lt;br/&gt;
);&lt;/p&gt;

&lt;p&gt;$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);&lt;/p&gt;

&lt;p&gt;$helpers = array(&lt;br/&gt;
    &apos;db&apos; =&amp;gt; new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em-&amp;gt;getConnection()),&lt;br/&gt;
    &apos;em&apos; =&amp;gt; new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)&lt;br/&gt;
);&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-684] Flaw in Build Process?</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-684</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;As I see it from our build script, each PEAR package of ORM and DBAL includes the Common sources again, although it sets itself as dependent on that package? That would mean the ORM package overwrites the files from the DBAL and Common packages.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11612">DDC-684</key>
            <summary>Flaw in Build Process?</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 11 Jul 2010 03:53:55 +0000</created>
                <updated>Mon, 30 Aug 2010 17:39:18 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 17:39:18 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13812" author="beberlei" created="Sat, 7 Aug 2010 05:40:56 +0000"  >&lt;p&gt;Assigned to jon.&lt;/p&gt;

&lt;p&gt;One solution would be to change the package.xml to reference only the ORM code, although DBAL and Common are also shipped.&lt;/p&gt;</comment>
                    <comment id="13826" author="jwage" created="Sat, 7 Aug 2010 08:46:23 +0000"  >&lt;p&gt;Hmm. I don&apos;t understand what you mean. The ORM includes the DBAL and Common code and installs it? Should it not do that and require that you install the dependencies via PEAR?&lt;/p&gt;</comment>
                    <comment id="13828" author="beberlei" created="Sat, 7 Aug 2010 10:02:18 +0000"  >&lt;p&gt;yes, otherwise if you install DBAL after ORM, the DBAL code will overwrite the DBAL code from the ORM. Or the other way around.&lt;/p&gt;

&lt;p&gt;Plus if you deinstall DBAL it will deinstall the DBAL code although ORM might still be installed.&lt;/p&gt;

&lt;p&gt;I can come up with about 20 other scenarios where this is problematic &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="14153" author="romanb" created="Mon, 30 Aug 2010 06:21:49 +0000"  >&lt;p&gt;Can we address this for BETA4 or should we push that to RC1 ? After releasing beta4 we still have time to address a lot of things before we go into RC.&lt;/p&gt;</comment>
                    <comment id="14163" author="jwage" created="Mon, 30 Aug 2010 10:27:01 +0000"  >&lt;p&gt;I think the only solution is for the pear packages to only include the specific code for that package and the dependencies installed via pear. But even then, installing the ORM will require a certain version of the DBAL, so if you already have a version of the DBAL installed, it will need you to install the version the ORM requires. So either way you can&apos;t mix and match packages. If you use the ORM, you wouldn&apos;t ever have your own version of Common and DBAL installed because they would conflict.&lt;/p&gt;</comment>
                    <comment id="14165" author="beberlei" created="Mon, 30 Aug 2010 11:48:26 +0000"  >&lt;p&gt;yes, but that is a downside of PEAR that we cannot influence.&lt;/p&gt;</comment>
                    <comment id="14166" author="jwage" created="Mon, 30 Aug 2010 12:54:30 +0000"  >&lt;p&gt;So the same problem exists either way. Do we have anything to fix then?&lt;/p&gt;</comment>
                    <comment id="14181" author="beberlei" created="Mon, 30 Aug 2010 17:39:18 +0000"  >&lt;p&gt;Fixed:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/dbal/commit/8054984a0448c54d5c658f60707b9ac490425c8b&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/dbal/commit/8054984a0448c54d5c658f60707b9ac490425c8b&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/803e33836518b7c019db667f482601f55803c29d&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/803e33836518b7c019db667f482601f55803c29d&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2 packages are now generated, one full package and one PEAR package. The PEAR package does not contain its dependencies, instead defines where to fetch them using the &amp;lt;dependencies&amp;gt;&amp;lt;package&amp;gt; configuration for d51PearPkg2 task.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-778] Query Clone Removes DQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-778</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-770&quot; title=&quot;Cleanup Query instance when cloneed&quot;&gt;&lt;del&gt;DDC-770&lt;/del&gt;&lt;/a&gt; made the \Doctrine\ORM\AbstractQuery call the free method when &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/8a21ab4755166127a9e60b98ab2e4759bc383997#L0R584&quot; class=&quot;external-link&quot;&gt;__cloned&lt;/a&gt;. This is fine with an abstract query but when you clone from a Doctrine\ORM\Query it calls the &lt;a href=&quot;http://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query.php#L359&quot; class=&quot;external-link&quot;&gt;free method&lt;/a&gt; of that class which nulls out the DQL statement. This breaks the example given in the Doctrine ORM cookbook of writing a &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/cookbook/dql-custom-walkers/en#dql-custom-walkers&quot; class=&quot;external-link&quot;&gt;custom walker&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is either a bug in the documentation or a bug in Doctrine ORM.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11849">DDC-778</key>
            <summary>Query Clone Removes DQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mitmaro">Tim Oram</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Aug 2010 12:29:23 +0000</created>
                <updated>Mon, 30 Aug 2010 14:30:24 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 14:30:24 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14167" author="beberlei" created="Mon, 30 Aug 2010 14:30:24 +0000"  >&lt;p&gt;Fixed!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-771] EntityGenerator generates wrong use statement in entity file</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-771</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If I use EntityGenerator with class to extend &apos;Extension\\Doctrine\\ORM\\ActiveEntity&lt;br class=&quot;atl-forced-newline&quot; /&gt;ActiveEntity&apos; in generated files I have this use 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;use Extension\Doctrine\ORM\ActiveEntity;

class XXX &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ActiveEntity
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and php ends with error. I think the use statement should look 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;use Extension\Doctrine\ORM\ActiveEntity\ActiveEntity;

class XXX &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ActiveEntity
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After I repaired this function it works ok:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _getClassToExtendNamespace()
{
    $refl = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \ReflectionClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getClassToExtend());

    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $refl-&amp;gt;getNamespaceName() ? $refl-&amp;gt;getNamespaceName():$refl-&amp;gt;getShortName();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;to&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $refl-&amp;gt;getNamespaceName() ? $refl-&amp;gt;getNamespaceName().&apos;\\&apos;.$refl-&amp;gt;getShortName():$refl-&amp;gt;getShortName();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;am not sure if it is bug or I am doing something wrong.&lt;/p&gt;</description>
                <environment>PHP 5.3.2, Windows 7 Professional</environment>
            <key id="11836">DDC-771</key>
            <summary>EntityGenerator generates wrong use statement in entity file</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="martinsrom">Martin Srom</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Aug 2010 06:59:18 +0000</created>
                <updated>Sat, 28 Aug 2010 11:01:05 +0000</updated>
                    <resolved>Sat, 28 Aug 2010 11:01:05 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14125" author="beberlei" created="Sat, 28 Aug 2010 08:47:52 +0000"  >&lt;p&gt;fixed formating&lt;/p&gt;</comment>
                    <comment id="14126" author="beberlei" created="Sat, 28 Aug 2010 08:56:21 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="14128" author="martinsrom" created="Sat, 28 Aug 2010 09:37:52 +0000"  >&lt;p&gt;After your fix, the EntityGenerator generates 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; 
use Extension\Doctrine\ORM\ActiveEntity\ActiveEntity;

class XXX &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Extension\Doctrine\ORM\ActiveEntity\ActiveEntity
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;and it isn&apos;t still right. There are two right posibilities:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Extension\Doctrine\ORM\ActiveEntity\ActiveEntity;

class XXX &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; ActiveEntity
&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; 
class XXX &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Extension\Doctrine\ORM\ActiveEntity\ActiveEntity
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="14130" author="beberlei" created="Sat, 28 Aug 2010 11:01:05 +0000"  >&lt;p&gt;ok, i dropped the use statement.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-752] Postpone Metadata Validation Until After Driver and loadClassMetadata Has Executed </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-752</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Right now the metadata drivers throw exceptions if certain metadata is not specified.  While this is convenient for letting the user know about errors, it limits the extensibility of the ORM, specifically what you can do in the loadClassMetadata event.  It also means that there is duplicated code in each of the driver implementations for validation.&lt;/p&gt;

&lt;p&gt;All validation of the metadata should be postponed until after the metadata driver has executed and also after the loadClassMetadata event has been fired.  This way all metadata has been loaded before attempting to validate and the user is still warned about errors.  This validation should still be ignored when loading from cache.&lt;/p&gt;

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

&lt;p&gt;Currently, setting a @DiscriminatorMap is required when using inheritance mapping. The loadClassMetadata event provides a way to dynamically set discriminator maps from a config or a database without having to extend a metadata driver.&lt;/p&gt;

&lt;p&gt;The specific regression in functionality that this references is MappingException::missingDiscriminatorMap being thrown in the metadata drivers.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11788">DDC-752</key>
            <summary>Postpone Metadata Validation Until After Driver and loadClassMetadata Has Executed </summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mridgway">Michael Ridgway</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Aug 2010 15:13:17 +0000</created>
                <updated>Sat, 28 Aug 2010 09:34:32 +0000</updated>
                    <resolved>Fri, 27 Aug 2010 16:16:10 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13979" author="mridgway" created="Tue, 17 Aug 2010 15:38:46 +0000"  >&lt;p&gt;Added specific exception that has been causing issues for my use case.  (MappingException::missingDiscriminatorMap)&lt;/p&gt;</comment>
                    <comment id="13981" author="romanb" created="Tue, 17 Aug 2010 15:49:23 +0000"  >&lt;p&gt;Sounds like a valid issue to me (and a regression).&lt;/p&gt;

&lt;p&gt;The metadata drivers should not do this kind of validation. If this validation needs to be done it should happen later either somewhere in ClassMetadata(Info) or the ClassMetadataFactory.&lt;/p&gt;

&lt;p&gt;Assigning this issue to Benjamin since I think he added this discriminator map validation in the drivers. I remember we talked about this but I did not properly recognize this issue either.&lt;/p&gt;</comment>
                    <comment id="13983" author="mridgway" created="Tue, 17 Aug 2010 16:06:52 +0000"  >&lt;p&gt;Committed a fix for my use case at &lt;a href=&quot;http://github.com/mridgway/doctrine2/commit/9acfa8b7c3ea17f4ee75608deb4cb474a799353c&quot; class=&quot;external-link&quot;&gt;http://github.com/mridgway/doctrine2/commit/9acfa8b7c3ea17f4ee75608deb4cb474a799353c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This moves the discriminatorMap validation to ClassMetadataFactory::_loadMetadata&lt;/p&gt;</comment>
                    <comment id="14120" author="beberlei" created="Fri, 27 Aug 2010 16:16:10 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                    <comment id="14122" author="romanb" created="Sat, 28 Aug 2010 03:58:11 +0000"  >&lt;p&gt;I&apos;m not sure but is it right that this validation in the CMF takes place &lt;b&gt;before&lt;/b&gt; the loadClassMetadata event is fired? After all, this event is supposed to be used for dynamic completion of the metadata.&lt;/p&gt;</comment>
                    <comment id="14123" author="beberlei" created="Sat, 28 Aug 2010 08:20:44 +0000"  >&lt;p&gt;i shouldn&apos;t code at late in the night, will 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;</comment>
                    <comment id="14124" author="beberlei" created="Sat, 28 Aug 2010 08:40:21 +0000"  >&lt;p&gt;@Roman, what about the ID stuff? Can i just move the event before every CMF validation?&lt;/p&gt;</comment>
                    <comment id="14127" author="romanb" created="Sat, 28 Aug 2010 09:34:32 +0000"  >&lt;p&gt;Maybe, but I would just try to leave the old order intact to not risk any BC issues. Simply moving the inheritance validation below the event should be enough for now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-770] Cleanup Query instance when cloneed</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-770</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When calling clone $query the instance should be cleaned from parameters.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11833">DDC-770</key>
            <summary>Cleanup Query instance when cloneed</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Aug 2010 16:56:08 +0000</created>
                <updated>Fri, 27 Aug 2010 15:29:54 +0000</updated>
                    <resolved>Fri, 27 Aug 2010 15:29:54 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14119" author="beberlei" created="Fri, 27 Aug 2010 15:29:54 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-757] Make names for tables and join columns not mandatory</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-757</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Why is it necessary to specify a name when using the @Table annotation (I guess it&apos;s the same using Yaml or XML) when I just want to add some indexes or unique constraints? When I do not specify the @Table at all, the name is generated from the entity&apos;s class, why can&apos;t it be also generated when I just want to add indexes or uniqueConstraints? My point is why should I write so many same stuff so many times, when Doctrine can already use it&apos;s API to do it for me. Preferably I would like to only specify the name when I need to change it from the default, not every time I need to add some explicit indexes &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; The same applies to the @JoinColumn annotation. When I want a nullable=false column, I have (again) specify a name for it, but the generated name would work just fine. Why do I have to specify it by hand?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11801">DDC-757</key>
            <summary>Make names for tables and join columns not mandatory</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="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="petr_motejlek">Petr Motejlek</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Aug 2010 04:25:19 +0000</created>
                <updated>Thu, 26 Aug 2010 13:13:40 +0000</updated>
                    <resolved>Thu, 26 Aug 2010 07:51:15 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14013" author="romanb" created="Thu, 19 Aug 2010 05:55:43 +0000"  >&lt;p&gt;Yes, the default/inferred value handling is not very smart yet. We will look into improving this in the future.&lt;/p&gt;</comment>
                    <comment id="14014" author="petr_motejlek" created="Thu, 19 Aug 2010 06:56:43 +0000"  >&lt;p&gt;Thanks. If you&apos;d like, I can try to look into it and make some patchsets, since I&apos;ll probably want to correct it for myself as soon as possible.&lt;/p&gt;</comment>
                    <comment id="14015" author="petr_motejlek" created="Thu, 19 Aug 2010 08:47:29 +0000"  >&lt;p&gt;I&apos;ve successfully created a patch for this issue, it&apos;s at &lt;a href=&quot;http://github.com/petr-motejlek/doctrine2/commit/d8359646fb43b7e1c42c3296ea8d7ebf3d18c51d&quot; class=&quot;external-link&quot;&gt;http://github.com/petr-motejlek/doctrine2/commit/d8359646fb43b7e1c42c3296ea8d7ebf3d18c51d&lt;/a&gt;&lt;br/&gt;
I&apos;ve also issued a pull request for that.&lt;/p&gt;</comment>
                    <comment id="14018" author="petr_motejlek" created="Thu, 19 Aug 2010 19:09:41 +0000"  >&lt;p&gt;So the above-mentioned fix was not that good as I thought it was. This one works perfectly &lt;a href=&quot;http://github.com/petr-motejlek/doctrine2/commit/e2522a9d4ed74c12356000d03a0aad7c6a34841f#diff-1&quot; class=&quot;external-link&quot;&gt;http://github.com/petr-motejlek/doctrine2/commit/e2522a9d4ed74c12356000d03a0aad7c6a34841f#diff-1&lt;/a&gt;. Now it should be possible to omit the JoinTable, Table and JoinColumn names, Doctrine will try to generate them automatically.&lt;/p&gt;</comment>
                    <comment id="14076" author="romanb" created="Thu, 26 Aug 2010 07:51:15 +0000"  >&lt;p&gt;I committed a modified version of your patch (i.e. it also allows leaving off referencedColumnName as well). I also made inferred default column names lowercase for aesthetics.&lt;/p&gt;

&lt;p&gt;Thanks for your help!&lt;/p&gt;
</comment>
                    <comment id="14095" author="petr_motejlek" created="Thu, 26 Aug 2010 13:13:40 +0000"  >&lt;p&gt;Thank you &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>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-737] Update PersistentCollection to upport slice($offset, $length);</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-737</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;With &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DCOM-17&quot; title=&quot;Add Collection::slice($offset, $length)&quot;&gt;&lt;del&gt;DCOM-17&lt;/del&gt;&lt;/a&gt; the Collection interface will be updated to contain one new method, this has to be implemented naively for 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;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function slice($offset, $length = &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;initialize();
    &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;_col-&amp;gt;slice($offset, $length);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11740">DDC-737</key>
            <summary>Update PersistentCollection to upport slice($offset, $length);</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Aug 2010 11:33:24 +0000</created>
                <updated>Tue, 24 Aug 2010 15:57:03 +0000</updated>
                    <resolved>Tue, 24 Aug 2010 15:57:03 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14059" author="beberlei" created="Tue, 24 Aug 2010 15:57:03 +0000"  >&lt;p&gt;Implemented.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-704] Inheritance-type with no discriminator-column results in SQL Error</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-704</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On an entity (XML mapping atleast) if there is an inheritance-type set but no discriminator-column(s) set the resulting query will have an extra comma at the end of the field list or occasionally (based on inheritance-type) a table alias without a fieldname. &lt;/p&gt;

&lt;p&gt;The correct solution would be to throw an exception during the parsing of the mapping that would indicate the inheritance-type is set but no discriminator-columns exist.&lt;/p&gt;</description>
                <environment>PHP 5.3 Ubuntu Linux</environment>
            <key id="11656">DDC-704</key>
            <summary>Inheritance-type with no discriminator-column results in SQL Error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="cmealey">Chris Mealey</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Jul 2010 13:52:25 +0000</created>
                <updated>Mon, 16 Aug 2010 11:10:34 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 06:29:29 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13626" author="cmealey" created="Tue, 20 Jul 2010 13:54:55 +0000"  >&lt;p&gt;Moving this from Major to Minor as a correctly mapped entity works fine, the bug is in the error reporting, not the functionality &lt;/p&gt;</comment>
                    <comment id="13842" author="beberlei" created="Sun, 8 Aug 2010 06:29:29 +0000"  >&lt;p&gt;Implemented better validation&lt;/p&gt;</comment>
                    <comment id="13962" author="mridgway" created="Mon, 16 Aug 2010 10:07:41 +0000"  >&lt;p&gt;I can&apos;t help but feel that the validation should be implemented outside of the metadata drivers.  To me the driver shouldn&apos;t require the discriminator map to be present because it limits the ability to add discriminators in other ways.&lt;/p&gt;

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

&lt;p&gt;I use annotations for my models, but I don&apos;t set the discriminator maps using the annotations driver, instead I use the loadClassMetadata event to fill in the discriminatorMap from configs or a database.  Perhaps this is a job for a custom metadata driver, but I still can&apos;t help but feel that the metadata driver shouldn&apos;t be the one making these validations, it should be when you try to use the inheritance-mapped model.&lt;/p&gt;

&lt;p&gt;Edit: To clarify the situation: I now get mappingException::missingDiscriminatorMap exception because my model annotations don&apos;t have a @DiscriminatorMap, but they would be loaded with the loadClassMetadata function.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-695] throw error on non-existing relation target column</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-695</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I had a problem with invalid SQL generated from DQL using JOIN the DQL query was as simple as:&lt;/p&gt;

&lt;p&gt;SELECT k, kt FROM Kmz k JOIN k.kmzType kt&lt;/p&gt;

&lt;p&gt;the final SQL missed the joined column name:&lt;/p&gt;

&lt;p&gt;SELECT k0_.ID_KMZ AS ID_KMZ0, k0_.ID_KMZ_TYPE AS ID_KMZ_TYPE1, k0_.IDENTIFICATOR_HW AS IDENTIFICATOR_HW2, k0_.TIME_INSERT AS TIME_INSERT3, k1_.ID_KMZ_TYPE AS ID_KMZ_TYPE4, k1_.SHORTNAME AS SHORTNAME5, k1_.DESCRIPTION AS DESCRIPTION6, k0_.id_KMZ_TYPE AS id_KMZ_TYPE7 FROM KMZ k0_ INNER JOIN KMZ_TYPE k1_ ON k0_.id_KMZ_TYPE = k1_. &lt;/p&gt;

&lt;p&gt;After some time of xdebugging I found that the names in JoinColumn clause in Kmz class annotation were not UPPERCASE as in KmzType - I just got a notice in SQL walker (line 728).&lt;/p&gt;

&lt;p&gt;                if ($relation-&amp;gt;isOwningSide) &lt;/p&gt;
{
                    $quotedTargetColumn = $targetClass-&amp;gt;getQuotedColumnName($targetClass-&amp;gt;fieldNames[$targetColumn], $this-&amp;gt;_platform); // &amp;lt;-- PHP Notice: Undefined index: id_KMZ_TYPE in .../libs/Doctrine/ORM/Query/SqlWalker.php:728
                    $sql .= $sourceTableAlias . &apos;.&apos; . $sourceColumn
                          . &apos; = &apos; 
                          . $targetTableAlias . &apos;.&apos; . $quotedTargetColumn;
                }
&lt;p&gt; else &lt;/p&gt;
{
                    $quotedTargetColumn = $sourceClass-&amp;gt;getQuotedColumnName($sourceClass-&amp;gt;fieldNames[$targetColumn], $this-&amp;gt;_platform);
                    $sql .= $sourceTableAlias . &apos;.&apos; . $quotedTargetColumn
                          . &apos; = &apos; 
                          . $targetTableAlias . &apos;.&apos; . $sourceColumn;
                }

&lt;p&gt;I think there might be a check and error thrown in case of missing targetColumn.&lt;/p&gt;</description>
                <environment>any</environment>
            <key id="11640">DDC-695</key>
            <summary>throw error on non-existing relation target column</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="romanb">Roman S. Borschel</assignee>
                                <reporter username="cicovec">Martin Ivi&#269;i&#269;</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Jul 2010 04:45:29 +0000</created>
                <updated>Thu, 12 Aug 2010 00:36:35 +0000</updated>
                    <resolved>Thu, 12 Aug 2010 00:36:35 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13928" author="guilhermeblanco" created="Thu, 12 Aug 2010 00:36:35 +0000"  >&lt;p&gt;This is not related to DQL.&lt;/p&gt;

&lt;p&gt;We have a validate-mapping CLI command that can verify this for you.&lt;br/&gt;
The problem you have is a bug in your mapping definition, nothing related to Doctrine core.&lt;/p&gt;

&lt;p&gt;If we add exceptions to all situations, DQL could not perform well. =\&lt;/p&gt;

&lt;p&gt;Marking as won&apos;t fix.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-738] Default Allocation Size remains still 10 in Beta 3</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-738</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems like default allocation size for sequences remains still 10 in Beta 3 - see &lt;a href=&quot;http://github.com/doctrine/doctrine2/blob/2.0.0-BETA3/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/blob/2.0.0-BETA3/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php&lt;/a&gt; - although it should have been already fixed. See also related older ticket - &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-577&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-577&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11741">DDC-738</key>
            <summary>Default Allocation Size remains still 10 in Beta 3</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="jantichy">Jan Tich&#253;</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Aug 2010 03:36:34 +0000</created>
                <updated>Thu, 12 Aug 2010 00:08:59 +0000</updated>
                    <resolved>Thu, 12 Aug 2010 00:08:59 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13924" author="guilhermeblanco" created="Thu, 12 Aug 2010 00:08:59 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/5719f8523bbb3c8a6fd11c749e5317b238d3d2b3&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/5719f8523bbb3c8a6fd11c749e5317b238d3d2b3&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-581] Unable to use single value association with IN expression</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-581</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL doesn&apos;t allow to use &lt;em&gt;Single Value Association&lt;/em&gt; with &lt;em&gt;IN&lt;/em&gt; expression.&lt;/p&gt;

&lt;p&gt;According to documentation: &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;InExpression             ::= StateFieldPathExpression [&lt;span class=&quot;code-quote&quot;&gt;&quot;NOT&quot;&lt;/span&gt;] &lt;span class=&quot;code-quote&quot;&gt;&quot;IN&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;(&quot;&lt;/span&gt; (InParameter {&lt;span class=&quot;code-quote&quot;&gt;&quot;,&quot;&lt;/span&gt; InParameter}* | Subselect) &lt;span class=&quot;code-quote&quot;&gt;&quot;)&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think it should be like 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;pre class=&quot;code-java&quot;&gt;InExpression             ::= SingleValuedPathExpression [&lt;span class=&quot;code-quote&quot;&gt;&quot;NOT&quot;&lt;/span&gt;] &lt;span class=&quot;code-quote&quot;&gt;&quot;IN&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;(&quot;&lt;/span&gt; (InParameter {&lt;span class=&quot;code-quote&quot;&gt;&quot;,&quot;&lt;/span&gt; InParameter}* | Subselect) &lt;span class=&quot;code-quote&quot;&gt;&quot;)&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Suggested solution:&lt;br/&gt;
Edit &lt;tt&gt;Parser::inExpression&lt;/tt&gt; method to accept SingleValuedPathExpressions:&lt;/p&gt;
&lt;div class=&quot;code panel&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 InExpression()
    {
        $inExpression = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AST\InExpression( /* Added &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;: */ $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;SingleValuedPathExpression() );
        ... 
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;



&lt;p&gt;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;$address1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entities\Address();
$address1-&amp;gt;setStreet(&lt;span class=&quot;code-quote&quot;&gt;&quot;Test Street #1&quot;&lt;/span&gt;);
$em-&amp;gt;persist($address1);

$userA = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entities\User();
$userA-&amp;gt;setName(&apos;user A&apos;);
$userA-&amp;gt;setTest(&apos;test A&apos;);
$userA-&amp;gt;setAddress( $address1 );
$em-&amp;gt;persist($userA);

$userB = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entities\User();
$userB-&amp;gt;setName(&apos;user B&apos;);
$userB-&amp;gt;setTest(&apos;test B&apos;);
$userB-&amp;gt;setAddress( $address1 );
$em-&amp;gt;persist($userB);

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


$dql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT u FROM Entities\User u WHERE u.address IN (SELECT a FROM Entities\Address a WHERE a.street LIKE &apos;Test Street%&apos; ) &quot;&lt;/span&gt;;
$query = $em-&amp;gt;createQuery($dql);


$result = $query-&amp;gt;getResult();
foreach ($result as $user) {
    echo &lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;pre&amp;gt;&quot;&lt;/span&gt;;
    \Doctrine\Common\Util\Debug::dump($user);
    echo &lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;/pre&amp;gt;&quot;&lt;/span&gt;;
    $em-&amp;gt;remove($user);
}

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


&lt;p&gt;Without this change It&apos;s impossible to select entities having specified association by a subquery with no additional join.&lt;/p&gt;

&lt;p&gt;Now this could be done with this DQL:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; u &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Entities\User u &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; u.address.id IN (&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; a.id &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Entities\Address a &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; a.street LIKE &apos;Test Street%&apos; )
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But it requires to join &lt;tt&gt;addresses&lt;/tt&gt; table for &lt;tt&gt;u.address.id&lt;/tt&gt; field, which in fact is redundant and ineffective.&lt;/p&gt;


&lt;p&gt;&lt;sub&gt;Tried to find similar issues or feature requests but no results. So I posted it here.&lt;/sub&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11346">DDC-581</key>
            <summary>Unable to use single value association with IN expression</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="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="7heaven">Ivan Voskoboynyk</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 May 2010 13:49:03 +0000</created>
                <updated>Wed, 11 Aug 2010 23:18:23 +0000</updated>
                    <resolved>Wed, 11 Aug 2010 23:18:23 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12953" author="romanb" created="Fri, 14 May 2010 09:26:04 +0000"  >&lt;p&gt;This would only work in one direction though ... in the other direction you need a join anyway and it will also not work with composite keys...&lt;/p&gt;

&lt;p&gt;Besides that, you can 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;SELECT u FROM Entities\User u WHERE u.address.street LIKE &apos;Test Street%&apos; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or more explicit&lt;/p&gt;

&lt;div class=&quot;code panel&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 Entities\User u JOIN u.address a WHERE a.street LIKE &apos;Test Street%&apos; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The performance of join vs subquery should be just as good on most systems, on mysql joins are often even faster than subqueries.&lt;/p&gt;</comment>
                    <comment id="13001" author="romanb" created="Wed, 19 May 2010 06:42:50 +0000"  >&lt;p&gt;Unscheduling as this enhancement is questionable and not really necessary (see my last comment).&lt;/p&gt;</comment>
                    <comment id="13921" author="guilhermeblanco" created="Wed, 11 Aug 2010 23:18:23 +0000"  >&lt;p&gt;Fixed. Implemented this support in:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/496a34a4d246f7b3e628e37963d8950e43540733&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/496a34a4d246f7b3e628e37963d8950e43540733&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-680] Complex Mathematical Expressions in DQL Subselects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-680</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems complex mathematical expressions are handled differently in DQL Subselects then in normal Selects:&lt;/p&gt;

&lt;div class=&quot;code panel&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 testSelectCorrelatedSubqueryComplexMathematicalExpression()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertSqlGeneration(
            &apos;SELECT (SELECT (count(p.phonenumber)+5)*10 FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p JOIN p.user ui WHERE ui.id = u.id) AS c FROM Doctrine\Tests\Models\CMS\CmsUser u&apos;,
            &apos;SELECT (SELECT (count(c0_.phonenumber)+5)*10 AS dctrn__1 FROM cms_phonenumbers c0_ INNER JOIN cms_users c1_ ON c0_.user_id = c1_.id WHERE c1_.id = c2_.id) AS sclr0 FROM cms_users c2_&apos;
        );
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testSelectComplexMathematicalExpression()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertSqlGeneration(
            &apos;SELECT (count(p.phonenumber)+5)*10 FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p JOIN p.user ui WHERE ui.id = ?1&apos;,
            &apos;SELECT (count(c0_.phonenumber) + 5) * 10 AS sclr0 FROM cms_phonenumbers c0_ INNER JOIN cms_users c1_ ON c0_.user_id = c1_.id WHERE c1_.id = ?&apos;
        );
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here the first test fails and the second passes. The second has the nested SQL running alone. The failure message 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;1) Doctrine\Tests\ORM\Query\SelectSqlGenerationTest::testSelectCorrelatedSubqueryComplexMathematicalExpression
[Syntax Error] line 0, col 15: Error: Expected One of: MAX, MIN, AVG, SUM, COUNT, got &apos;(&apos;

/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php:31
/home/benny/code/php/wsnetbeans/doctrine2/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php:709
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11608">DDC-680</key>
            <summary>Complex Mathematical Expressions in DQL Subselects</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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 10:41:05 +0000</created>
                <updated>Wed, 11 Aug 2010 22:18:42 +0000</updated>
                    <resolved>Wed, 11 Aug 2010 22:18:42 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13566" author="beberlei" created="Sun, 11 Jul 2010 03:21:59 +0000"  >&lt;p&gt;The problem seems to be in SelectExpression(). Functions are only detected in isolation, i.e. everything after the first function is ignored.&lt;/p&gt;</comment>
                    <comment id="13888" author="guilhermeblanco" created="Tue, 10 Aug 2010 00:40:52 +0000"  >&lt;p&gt;Patch that fixes the issue.&lt;/p&gt;

&lt;p&gt;However, I am not 100% if the alias (sclr) of subquery select expression should be generated and added to RSM.&lt;br/&gt;
Can anyone chat with me tomorrow and agree on this patch?&lt;/p&gt;</comment>
                    <comment id="13900" author="guilhermeblanco" created="Wed, 11 Aug 2010 00:27:00 +0000"  >&lt;p&gt;New patch&lt;/p&gt;</comment>
                    <comment id="13920" author="guilhermeblanco" created="Wed, 11 Aug 2010 22:18:42 +0000"  >&lt;p&gt;In &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/84b9eda17c8faead9ea59b39f12d1b78aa5ba823&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/84b9eda17c8faead9ea59b39f12d1b78aa5ba823&lt;/a&gt; I have committed a fix to this issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10734" name="DDC680patch.diff" size="12220" author="guilhermeblanco" created="Wed, 11 Aug 2010 00:27:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-729] When merging many to many entities back into the repository all associations are deleted on the next flush</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-729</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging a DETACHED entity into the repository with a ManyToMany association, the entries in the join table are deleted on the next flush.&lt;/p&gt;

&lt;p&gt;Many Movies have many Artists:&lt;/p&gt;

&lt;div class=&quot;code panel&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 Movie {
	
	/** @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=50, 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; $title;
	
	/** 
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Artist&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $artists;
	
	&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;artists = &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;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Artist {
	
	/** @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=50, 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;
	
	/** @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Movie&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;artists&quot;&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $movies;
	
	&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;movies = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Assume that the database contains:&lt;br/&gt;
  Movie: id=1, title=&quot;Movie 1&quot;&lt;br/&gt;
  Artist: id=1, name=&quot;Artist 1&quot;&lt;/p&gt;

&lt;p&gt;and that there is a entry (1, 1) in movie_artist so that there is a many-many relationship between Movie 1 and Artist 1.&lt;/p&gt;

&lt;p&gt;I then run the following code to merge the existing associations into the entity manager:&lt;/p&gt;

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

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

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

$m1 = $em-&amp;gt;merge($m1);
$m1-&amp;gt;artists-&amp;gt;set(0, $em-&amp;gt;merge($a1));
$a1-&amp;gt;movies-&amp;gt;set(0, $em-&amp;gt;merge($m1));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At this point $m1 should contains merged entities reflecting the same as what is in the database.&lt;/p&gt;

&lt;p&gt;If I now run:&lt;/p&gt;

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

&lt;p&gt;the association is deleted from movie_artist and the SQL log shows DELETE FROM Movie_Artist WHERE Movie_id = &apos;1&apos; as having been run.&lt;/p&gt;

&lt;p&gt;Debugging $m1 both before and after the flush shows the expected values, and $em-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets() is empty before the flush.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11701">DDC-729</key>
            <summary>When merging many to many entities back into the repository all associations are deleted on the next flush</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Jul 2010 07:44:13 +0000</created>
                <updated>Wed, 11 Aug 2010 06:30:50 +0000</updated>
                    <resolved>Mon, 9 Aug 2010 17:05:16 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13840" author="beberlei" created="Sun, 8 Aug 2010 06:03:14 +0000"  >&lt;p&gt;Can you explain why you merge $m1 twice?&lt;/p&gt;</comment>
                    <comment id="13843" author="ccapndave" created="Sun, 8 Aug 2010 06:59:19 +0000"  >&lt;p&gt;Its a representation of how the algorithm I am using works - it assumes that once an entity is managed merge() will just return the already managed entity.&lt;/p&gt;

&lt;p&gt;Anyway, to be sure I just ran another test that only calls merge() once, and it has the same behaviour.&lt;/p&gt;</comment>
                    <comment id="13860" author="beberlei" created="Sun, 8 Aug 2010 10:09:35 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="13879" author="ccapndave" created="Mon, 9 Aug 2010 14:05:58 +0000"  >&lt;p&gt;A slightly different many to many merge bug is occurring - I am re-opening this ticket for it because a) I expect it is somewhat related and b) the example to recreate follows on from the example in this bug.&lt;/p&gt;

&lt;p&gt;Now assume the database has one more artist:&lt;/p&gt;

&lt;p&gt;Movie: id=1, title=&quot;Movie 1&quot;&lt;br/&gt;
Artist: id=1, name=&quot;Artist 1&quot;&lt;br/&gt;
Artist: id=2, name=&quot;Artist 2&quot;&lt;/p&gt;

&lt;p&gt;and that there is still only an entry (1, 1) in movie_artist so that there is a many-many relationship between Movie 1 and Artist 1.&lt;/p&gt;

&lt;p&gt;I then run the following code to merge the existing entity AND add a new association between artist 2 and movie 1:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$m1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Movie();
$m1-&amp;gt;id = 1;
$m1-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Movie 1&quot;&lt;/span&gt;;

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

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

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

$m1 = $em-&amp;gt;merge($m1);

$m1-&amp;gt;artists-&amp;gt;set(0, $em-&amp;gt;merge($a1));
$a1-&amp;gt;movies-&amp;gt;set(0, $em-&amp;gt;merge($m1));

$m1-&amp;gt;artists-&amp;gt;set(1, $em-&amp;gt;merge($a2));
$a2-&amp;gt;movies-&amp;gt;set(1, $em-&amp;gt;merge($m1));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I now run:&lt;/p&gt;

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

&lt;p&gt;Instead of getting a (1, 2) entry added to movie_artist as expected, the change sets are empty and I get the following error:&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;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1-2&apos; for key &apos;PRIMARY&apos;&apos; in D:\Projects\ORM\doctrine2\lib\vendor\doctrine-dbal\lib\Doctrine\DBAL\Connection.php on line 646&lt;br/&gt;
( ! ) PDOException: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1-2&apos; for key &apos;PRIMARY&apos; in D:\Projects\ORM\doctrine2\lib\vendor\doctrine-dbal\lib\Doctrine\DBAL\Connection.php on line 646&lt;br/&gt;
Call Stack&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Time	Memory	Function	Location&lt;br/&gt;
1	0.0006	400744	
{main}
&lt;p&gt;( )	..\index.php:0&lt;br/&gt;
2	0.0933	4375416	Doctrine\ORM\EntityManager-&amp;gt;flush( )	..\index.php:62&lt;br/&gt;
3	0.0934	4375416	Doctrine\ORM\UnitOfWork-&amp;gt;commit( )	..\EntityManager.php:320&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
</comment>
                    <comment id="13882" author="beberlei" created="Mon, 9 Aug 2010 16:23:12 +0000"  >&lt;p&gt;There is no CASCADE=MERGE on this relation or?&lt;/p&gt;</comment>
                    <comment id="13883" author="ccapndave" created="Mon, 9 Aug 2010 16:25:55 +0000"  >&lt;p&gt;No - I think I am simulating what cascade merge would do though.&lt;/p&gt;</comment>
                    <comment id="13884" author="beberlei" created="Mon, 9 Aug 2010 16:59:43 +0000"  >&lt;p&gt;I cannot reproduce this with any case.&lt;/p&gt;

&lt;p&gt;Additionally your algorithm is REALLY slow compared to doing this natively in the UnitOfWork. The merge operation does lots of stuff even if the entity is already merged before.&lt;/p&gt;</comment>
                    <comment id="13885" author="beberlei" created="Mon, 9 Aug 2010 17:05:16 +0000"  >&lt;p&gt;Added 3 more tests that verify the correct behavior. Please add a failing test-case for this and open up a new ticket.&lt;/p&gt;</comment>
                    <comment id="13902" author="ccapndave" created="Wed, 11 Aug 2010 06:30:50 +0000"  >&lt;p&gt;Thanks for pointing out the inefficiency in the algorithm - you are completely right and as recommended I have changed the Flextrine codebase to use UnitOfWork merge (by internally changing the metadata to enable cascade).  However, there still seems to be a bug mergng many to many - I will open it up in a new ticket.  Cheers &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-562] @OneToOne is not generating a unique constraint on the owning table</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-562</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Annotations:&lt;/p&gt;

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

/** @Entity */
class Customer
{
    /**
     * @Id @Column(name=&quot;id&quot;, type=&quot;integer&quot;)
     */
    private $customerId;

    /**
     * @OneToOne(targetEntity=&quot;Cart&quot;, mappedBy=&quot;customer&quot;)
     */
    private $cart;
}

/** @Entity */
class Cart
{
    /**
     * @Id @Column(name=&quot;id&quot;, type=&quot;integer&quot;, nullable=false)
     */
    private $cartId;

    /**
     * Shouldn&apos;t unique=true be setting a UNIQUE index on customer_id ??
     *
     * @OneToOne(targetEntity=&quot;Customer&quot;, inversedBy=&quot;cart&quot;)
     * @JoinColumn(name=&quot;customer_id&quot;, referencedColumnName=&quot;id&quot;, nullable=false, unique=true)
     */
    private $customer;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Resulting schema (MySQL), generated with orm:schema-tool:create in CLI:&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 `customer` (
  `id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cart` (
  `id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_id` (`customer_id`),  /* this should be UNIQUE KEY  */
  CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think the key on customer_id in the cart should be generating a UNIQUE KEY by definition on a @OneToOne, with or without the unique= param in the annotation, right?  &lt;/p&gt;

&lt;p&gt;I&apos;ve tested this with and without the unique=true param and in both cases it does not generate a UNIQUE key constraint.&lt;/p&gt;</description>
                <environment>Win 7 x64, PHP 5.3.1</environment>
            <key id="11301">DDC-562</key>
            <summary>@OneToOne is not generating a unique constraint on the owning table</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Apr 2010 15:43:56 +0000</created>
                <updated>Tue, 10 Aug 2010 16:08:25 +0000</updated>
                    <resolved>Tue, 10 Aug 2010 16:08:25 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13112" author="beberlei" created="Sun, 6 Jun 2010 07:40:28 +0000"  >&lt;p&gt;Verified, however i cannot fix this know, we need another internal refactoring before this can be done.&lt;/p&gt;</comment>
                    <comment id="13535" author="romanb" created="Wed, 7 Jul 2010 11:16:45 +0000"  >&lt;p&gt;Pushing back to beta4.&lt;/p&gt;</comment>
                    <comment id="13890" author="romanb" created="Tue, 10 Aug 2010 05:39:31 +0000"  >&lt;p&gt;I think this can be easily fixed now.&lt;/p&gt;</comment>
                    <comment id="13896" author="beberlei" created="Tue, 10 Aug 2010 16:08:25 +0000"  >&lt;p&gt;Fixed!&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                            <issuelink>
            <issuekey id="11451">DDC-626</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-741] Support SingleValuedAssociationPathExpression owning side Association in InExpression</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-741</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Title explains everything:&lt;/p&gt;

&lt;div class=&quot;code panel&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 v FROM Videos v WHERE v.Venue IN (....)
SQL: SELECT .. FROM ... WHERE v.venue_id IN (...)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11749">DDC-741</key>
            <summary>Support SingleValuedAssociationPathExpression owning side Association in InExpression</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="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Aug 2010 15:00:58 +0000</created>
                <updated>Tue, 10 Aug 2010 15:08:15 +0000</updated>
                    <resolved>Tue, 10 Aug 2010 15:08:15 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13894" author="guilhermeblanco" created="Tue, 10 Aug 2010 15:08:15 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-581&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-581&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-626] Remove Association Classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-626</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The AssociationMapping classes are not needed anymore now that all of the logic has moved to the persisters.&lt;/p&gt;

&lt;p&gt;Additionally we get caching benefits doing this and its a dependency for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-562&quot; title=&quot;@OneToOne is not generating a unique constraint on the owning table&quot;&gt;&lt;del&gt;DDC-562&lt;/del&gt;&lt;/a&gt; (allowing to differ between ManyToOne and OneToOne)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11451">DDC-626</key>
            <summary>Remove Association Classes</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>Sun, 6 Jun 2010 07:56:34 +0000</created>
                <updated>Tue, 10 Aug 2010 05:38:36 +0000</updated>
                    <resolved>Tue, 10 Aug 2010 05:38:36 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13537" author="romanb" created="Wed, 7 Jul 2010 11:17:48 +0000"  >&lt;p&gt;Pushing back to beta4.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="11301">DDC-562</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-728] Inherited (JOINED) associations referred on DQL on owning side doesn&apos;t refer to correct table column</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-728</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Based on code instrospection, it seems that SQL generated is wrong when you attempt to do something like this:&lt;/p&gt;

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

&lt;p&gt;It seems the column that refers to the association points to wrong table (apparently it points to CompanyManager table).&lt;br/&gt;
If everything works, we still need to have coverage to it (we have none). &lt;/p&gt;</description>
                <environment></environment>
            <key id="11698">DDC-728</key>
            <summary>Inherited (JOINED) associations referred on DQL on owning side doesn&apos;t refer to correct table column</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="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Jul 2010 14:43:42 +0000</created>
                <updated>Mon, 9 Aug 2010 23:18:40 +0000</updated>
                    <resolved>Mon, 9 Aug 2010 23:18:40 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13822" author="romanb" created="Sat, 7 Aug 2010 07:18:36 +0000"  >&lt;p&gt;The first thing we need is tests to verify the issue.&lt;/p&gt;</comment>
                    <comment id="13849" author="beberlei" created="Sun, 8 Aug 2010 08:25:08 +0000"  >&lt;p&gt;I added a test to show that it works and no issue occours:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * @group DDC-728
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testQueryForInheritedSingleValuedAssociation()
    {
        $manager = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CompanyManager();
        $manager-&amp;gt;setName(&apos;gblanco&apos;);
        $manager-&amp;gt;setSalary(1234);
        $manager-&amp;gt;setTitle(&apos;Awesome!&apos;);
        $manager-&amp;gt;setDepartment(&apos;IT&apos;);

        $person = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CompanyPerson();
        $person-&amp;gt;setName(&apos;spouse&apos;);

        $manager-&amp;gt;setSpouse($person);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($manager);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;persist($person);
        $&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();

        $dql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT m FROM Doctrine\Tests\Models\Company\CompanyManager m WHERE m.spouse = ?1&quot;&lt;/span&gt;;
        $dqlManager = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;createQuery($dql)-&amp;gt;setParameter(1, $person-&amp;gt;getId())-&amp;gt;getSingleResult();

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($manager-&amp;gt;getId(), $dqlManager-&amp;gt;getId());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals($person-&amp;gt;getId(), $dqlManager-&amp;gt;getSpouse()-&amp;gt;getId());
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Its in Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php, see commit:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/dcebc241b4e36f20f364699105aff258f5840962&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/dcebc241b4e36f20f364699105aff258f5840962&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13887" author="guilhermeblanco" created="Mon, 9 Aug 2010 23:18:40 +0000"  >&lt;p&gt;I think I fixed it sometime... it was missing a condition that is now present.&lt;/p&gt;

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

<item>
            <title>[DDC-735] PersistentCollection#remove() and PersistentCollection#removeElement() behave differently</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-735</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It all started when I noticed that removing elements from an a collection using removeElement() didn&apos;t actually remove them from the database. While debugging that issue, I found that using remove() worked as expected, so I took a look at ArrayCollection#removeElement() and remove(). I remained thorougly confused for a good 5 minutes because the two methods are virtually identical, yet they were behaving differently. That&apos;s when I realized that loading a collection from the database gives you a PersistentCollection, not an ArrayCollection.&lt;/p&gt;

&lt;p&gt;So here&apos;s the bug: PersistentCollection#remove() and PersistentCollection#removeElement() behave differently. remove() marks the collection as changed only if an element is actually removed, then schedules an OrphanRemoval if applicable. removeElement() unconditionally marks the collection as changed and forgets to check for orphanRemoval.&lt;/p&gt;

&lt;p&gt;Since both methods are virtually identical, I suggest that they are refactored to use a common code path instead of duplicating their code. The same should be done with ArrayCollection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11737">DDC-735</key>
            <summary>PersistentCollection#remove() and PersistentCollection#removeElement() behave differently</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="s9e">s9e</reporter>
                        <labels>
                    </labels>
                <created>Sat, 7 Aug 2010 12:27:30 +0000</created>
                <updated>Mon, 9 Aug 2010 17:14:42 +0000</updated>
                    <resolved>Mon, 9 Aug 2010 15:26:31 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13829" author="s9e" created="Sat, 7 Aug 2010 12:50:01 +0000"  >&lt;p&gt;Testcase and proposed fix at &lt;a href=&quot;http://github.com/s9e/doctrine2/commit/5a01b50bdbffbfd59c3af6cfc94ddb5793dac329&quot; class=&quot;external-link&quot;&gt;http://github.com/s9e/doctrine2/commit/5a01b50bdbffbfd59c3af6cfc94ddb5793dac329&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13863" author="beberlei" created="Sun, 8 Aug 2010 11:14:50 +0000"  >&lt;p&gt;Slighty changed the patch because removeElement() on the wrapped collection has to be called.&lt;/p&gt;

&lt;p&gt;Merged your testcase also, fixed in master.&lt;/p&gt;</comment>
                    <comment id="13869" author="s9e" created="Sun, 8 Aug 2010 19:33:52 +0000"  >&lt;p&gt;How about merging the code path differently then? You keep calling the right method on the wrapped collection but you move all the common code from PersistentCollection to its own method instead of duplicating it. Plus, it doesn&apos;t prevent you from implementing method-specific routines such as the ones mentionned in the TODOs.&lt;/p&gt;

&lt;p&gt;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class PersistentCollection
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function remove($key)
    {
        &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;removeFromCollection(&apos;remove&apos;, $key);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeElement($element)
    {
        /*&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initialized) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;getUnitOfWork()-&amp;gt;getCollectionPersister($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;association)
                -&amp;gt;deleteRows($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;, $element);
        }*/

        &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;removeFromCollection(&apos;removeElement&apos;, $element);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function removeFromCollection($method, $arg)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initialize();
        $removed = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;coll-&amp;gt;$method($arg);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($removed) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;changed();
            &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;association !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;association-&amp;gt;isOneToMany() &amp;amp;&amp;amp;
                    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;association-&amp;gt;orphanRemoval) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em-&amp;gt;getUnitOfWork()-&amp;gt;scheduleOrphanRemoval($removed);
            }
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $removed;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13870" author="beberlei" created="Mon, 9 Aug 2010 02:30:03 +0000"  >&lt;p&gt;dynamic method calls are to slow and this gives no additional benefit.&lt;/p&gt;

&lt;p&gt;i just realize that there might be another bug in the removeElement() just that i read the docblock changes yesterday. it returns true and not the element if the operation was successful. I have to reevaluate this...&lt;/p&gt;</comment>
                    <comment id="13871" author="s9e" created="Mon, 9 Aug 2010 03:59:51 +0000"  >&lt;p&gt;It&apos;s been a long time since I&apos;ve last heard that dynamic method calls were slow. That may have been true in older versions of PHP (4?) but nowadays the difference is negligible; I&apos;ve just run a quick informal test showing a ~20ms difference over one million calls on PHP 5.3.3 in CLI .&lt;/p&gt;

&lt;p&gt;I think that code deduplication is a strong benefit. In fact, that&apos;s because code was duplicated instead of reused that this ticket exists. The next time any code is added to or removed from one of these methods, it will have to be mirrored to the other one or you will run into the same issue.&lt;/p&gt;

&lt;p&gt;Wrt the return value, I had noticed earlier that ArrayCollection#removeElement&apos;s docblock mentionned returning a boolean, but the Collection interface declares returning the object and that&apos;s what the implementation does too, so I assumed its docblock simply needed to be updated. Shouldn&apos;t it use &lt;/p&gt;
{@inheritdoc}
&lt;p&gt; just like PersistentCollection does? Interestingly, it&apos;s another case of deduplication.&lt;/p&gt;</comment>
                    <comment id="13880" author="beberlei" created="Mon, 9 Aug 2010 15:26:31 +0000"  >&lt;p&gt;fixed, again!&lt;/p&gt;</comment>
                    <comment id="13886" author="s9e" created="Mon, 9 Aug 2010 17:14:42 +0000"  >&lt;p&gt;I see that PersistentCollection#removeElement has been modified to accomodate the underlying collection&apos;s removeElement() potentionally returning a boolean. Is the Collection interface&apos;s definition going to be changed so that removeElement() returns a boolean? I think that would be confusing for the end user because we&apos;d then have:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;add() takes an element as argument, returns a boolean&lt;/li&gt;
	&lt;li&gt;remove() takes a key as argument, returns an element&lt;/li&gt;
	&lt;li&gt;removeElement() takes an element as argument, returns a boolean&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="10727" name="DDC735Test.php" size="2538" author="s9e" created="Sat, 7 Aug 2010 12:50:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-584] Document DBAL ArrayType and ObjectType in &quot;Doctrine Mapping Types&quot; instructions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-584</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/basic-mapping#doctrine-mapping-types&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/basic-mapping#doctrine-mapping-types&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Does not mention Doctrine\DBAL\Types\ArrayType or Doctrine\DBAL\Types\ObjectType&lt;/p&gt;

&lt;p&gt;Should these be included as documented mapping types?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11350">DDC-584</key>
            <summary>Document DBAL ArrayType and ObjectType in &quot;Doctrine Mapping Types&quot; instructions</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 May 2010 11:52:31 +0000</created>
                <updated>Sun, 8 Aug 2010 13:31:23 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 13:31:23 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13866" author="jwage" created="Sun, 8 Aug 2010 13:31:23 +0000"  >&lt;p&gt;It seems to show it now&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/basic-mapping/en#doctrine-mapping-types&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/2.0/docs/reference/basic-mapping/en#doctrine-mapping-types&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-663] Update PEAR install command</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-663</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Documentation gives incorrect command for downloading ORM from PEAR which causes the installation to fail with the message:&lt;/p&gt;

&lt;p&gt;Failed to download doctrine/DoctrineORM, version &quot;2.0.0&quot;, latest release is version 2.0.0BETA2, stability &quot;beta&quot;, use &quot;channel://pear.doctrine-project.org/DoctrineORM-2.0.0BETA2&quot; to install&lt;br/&gt;
install failed&lt;/p&gt;

&lt;p&gt;Currently:&lt;br/&gt;
sudo pear install pear.doctrine-project.org/DoctrineORM-2.0.0&lt;/p&gt;

&lt;p&gt;Change to:&lt;br/&gt;
sudo pear install pear.doctrine-project.org/DoctrineORM-2.0.0BETA2&lt;/p&gt;</description>
                <environment>Mac OS X 10.6.</environment>
            <key id="11576">DDC-663</key>
            <summary>Update PEAR install command</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mjstelly">Michael Stelly</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jul 2010 16:29:56 +0000</created>
                <updated>Sun, 8 Aug 2010 13:21:58 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 13:21:58 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13865" author="jwage" created="Sun, 8 Aug 2010 13:21:58 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/orm-documentation/commit/70d12fc57aa3ea3b94b1b8ff8efdf8b7e0543988&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/orm-documentation/commit/70d12fc57aa3ea3b94b1b8ff8efdf8b7e0543988&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-651] Bad class (without used namespace) is provided in extends section of entity class declaration in generator.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-651</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Bad class (without used namespace) is provided in extends section of entity class declaration in generator. &lt;/p&gt;

&lt;p&gt;For example with option --extend=&quot;Nette\Object&quot; the class looks like this:&lt;/p&gt;

&lt;p&gt;// ...&lt;/p&gt;

&lt;p&gt;namespace Entities;&lt;/p&gt;

&lt;p&gt;use Nette;&lt;/p&gt;

&lt;p&gt;class  Foo extends Object          &amp;lt;=         this is bad. Here should by Nette\Object&lt;/p&gt;

&lt;p&gt;// ...&lt;/p&gt;</description>
                <environment>n\a</environment>
            <key id="11540">DDC-651</key>
            <summary>Bad class (without used namespace) is provided in extends section of entity class declaration in generator.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="svodev">stepan svoboda</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Jun 2010 13:02:12 +0000</created>
                <updated>Sun, 8 Aug 2010 10:44:06 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 10:44:06 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13862" author="beberlei" created="Sun, 8 Aug 2010 10:44:06 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-703] Explicit change tracking not inherited by inheriting classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-703</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a class B that inherits from A using single table inheritance strategy with discriminator column.&lt;br/&gt;
On class A I have defined @ChangeTrackingPolicy (&quot;DEFERRED_EXPLICIT&quot;), which should be inherited by B, but it is not currenlty.&lt;/p&gt;

&lt;p&gt;This means that when I have a managed instance $b of B $em-&amp;gt;getClassMetadata(get_class($b))-&amp;gt;isChangeTrackingDeferredExplicit()&lt;br/&gt;
does not return TRUE and calling $em-&amp;gt;persist($b) and $em-&amp;gt;flush() does not save any changes to $b.&lt;/p&gt;

&lt;p&gt;If I set @ChangeTrackingPolicy (&quot;DEFERRED_EXPLICIT&quot;) on class B it does work. So either way I think B should inherit the change tracking policy of A, or it should have IMPLICT as default like A but not none.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11654">DDC-703</key>
            <summary>Explicit change tracking not inherited by inheriting 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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dennis.verspuij">Dennis Verspuij</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Jul 2010 09:49:43 +0000</created>
                <updated>Sun, 8 Aug 2010 10:15:51 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 10:15:51 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13861" author="beberlei" created="Sun, 8 Aug 2010 10:15:51 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-542] ManyToMany with Properties sharing Join columns with PRimary Key</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-542</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;Spagetthi with Tomatoes

Notice: Undefined index: recipe_id in /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/UnitOfWork.php on line 1820

Call Stack:
    0.0005     354964   1. {main}() /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php:0
    0.2063    4308460   2. Doctrine\ORM\PersistentCollection-&amp;gt;getIterator() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:0
    0.2063    4308460   3. Doctrine\ORM\PersistentCollection-&amp;gt;_initialize() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:512
    0.2064    4308460   4. Doctrine\ORM\Mapping\OneToManyMapping-&amp;gt;load() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:210
    0.2064    4308820   5. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;loadOneToManyCollection() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/OneToManyMapping.php:137
    0.2371    4312216   6. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;_createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:559
    0.2372    4312720   7. Doctrine\ORM\UnitOfWork-&amp;gt;createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:611


Notice: Undefined index: product_id in /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/UnitOfWork.php on line 1820

Call Stack:
    0.0005     354964   1. {main}() /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php:0
    0.2063    4308460   2. Doctrine\ORM\PersistentCollection-&amp;gt;getIterator() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:0
    0.2063    4308460   3. Doctrine\ORM\PersistentCollection-&amp;gt;_initialize() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:512
    0.2064    4308460   4. Doctrine\ORM\Mapping\OneToManyMapping-&amp;gt;load() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:210
    0.2064    4308820   5. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;loadOneToManyCollection() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/OneToManyMapping.php:137
    0.2371    4312216   6. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;_createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:559
    0.2372    4312720   7. Doctrine\ORM\UnitOfWork-&amp;gt;createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:611


Notice: Undefined index: recipe_id in /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/UnitOfWork.php on line 1820

Call Stack:
    0.0005     354964   1. {main}() /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php:0
    0.2063    4308460   2. Doctrine\ORM\PersistentCollection-&amp;gt;getIterator() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:0
    0.2063    4308460   3. Doctrine\ORM\PersistentCollection-&amp;gt;_initialize() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:512
    0.2064    4308460   4. Doctrine\ORM\Mapping\OneToManyMapping-&amp;gt;load() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:210
    0.2064    4308820   5. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;loadOneToManyCollection() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/OneToManyMapping.php:137
    0.2382    4314316   6. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;_createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:559
    0.2383    4314820   7. Doctrine\ORM\UnitOfWork-&amp;gt;createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:611


Notice: Undefined index: product_id in /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/UnitOfWork.php on line 1820

Call Stack:
    0.0005     354964   1. {main}() /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php:0
    0.2063    4308460   2. Doctrine\ORM\PersistentCollection-&amp;gt;getIterator() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:0
    0.2063    4308460   3. Doctrine\ORM\PersistentCollection-&amp;gt;_initialize() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:512
    0.2064    4308460   4. Doctrine\ORM\Mapping\OneToManyMapping-&amp;gt;load() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/PersistentCollection.php:210
    0.2064    4308820   5. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;loadOneToManyCollection() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Mapping/OneToManyMapping.php:137
    0.2382    4314316   6. Doctrine\ORM\Persisters\StandardEntityPersister-&amp;gt;_createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:559
    0.2383    4314820   7. Doctrine\ORM\UnitOfWork-&amp;gt;createEntity() /home/benny/code/php/wsnetbeans/doctrine2/lib/Doctrine/ORM/Persisters/StandardEntityPersister.php:611


Notice: Trying to get property of non-object in /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php on line 176

Call Stack:
    0.0005     354964   1. {main}() /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php:0

   100

Notice: Trying to get property of non-object in /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php on line 176

Call Stack:
    0.0005     354964   1. {main}() /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php:0

   5
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11272">DDC-542</key>
            <summary>ManyToMany with Properties sharing Join columns with PRimary Key</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="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, 26 Apr 2010 15:42:33 +0000</created>
                <updated>Sun, 8 Aug 2010 09:46:16 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 09:46:16 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="12752" author="beberlei" created="Mon, 26 Apr 2010 15:43:40 +0000"  >&lt;p&gt;With DQL the second ingredient in the loop has an product of NULL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Spagetthi with Tomatoes
  Tomatoes 100

Notice: Trying to get property of non-object in /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php on line 168

Call Stack:
    0.0004     356008   1. {main}() /home/benny/code/php/wsnetbeans/DoctrineTests/ManyToMany/Recipes.php:0

   5
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12753" author="romanb" created="Mon, 26 Apr 2010 15:48:56 +0000"  >&lt;p&gt;Scheduled for beta2 for now. May be pushed back later if we don&apos;t find the time.&lt;/p&gt;</comment>
                    <comment id="13050" author="romanb" created="Sun, 23 May 2010 10:03:56 +0000"  >&lt;p&gt;Pushing back.&lt;/p&gt;</comment>
                    <comment id="13857" author="romanb" created="Sun, 8 Aug 2010 09:46:16 +0000"  >&lt;p&gt;This works now after the latest patches.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11075">DDC-436</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10587" name="Recipes.php" size="3679" author="beberlei" created="Mon, 26 Apr 2010 15:43:40 +0000" />
                </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-385] Change behaviour if fully qualified classname is passed in as string</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-385</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If one calls $em-&amp;gt;getRepository(&apos;\Entity&apos;) (leading \ !) then Doctrine&apos;s behaviour is quite undefined, as it would result e.g. in a &quot;mapping file &apos;.entity.dcm.yml&apos; not found&quot; error. (leading dot!)&lt;/p&gt;

&lt;p&gt;PHP, however, seems to allow the leading \, but Doctrine does not. In fact, the leading \ is not necessary as classnames in strings are always fully qualified.&lt;/p&gt;

&lt;p&gt;So Doctrine should either:&lt;/p&gt;

&lt;p&gt;1.) Throw an exception stating that using a leading backslash is prohibited&lt;br/&gt;
2.) Simply strip it.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10977">DDC-385</key>
            <summary>Change behaviour if fully qualified classname is passed in as string</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="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>Mon, 1 Mar 2010 17:35:50 +0000</created>
                <updated>Sun, 8 Aug 2010 09:05:25 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 09:05:25 +0000</resolved>
                                            <fixVersion>2.0-BETA4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11908" author="beberlei" created="Mon, 1 Mar 2010 17:43:40 +0000"  >&lt;p&gt;I vote for 1. Stripping the char just leads to major overhead given that getMetadataFor is one of the most called functions in Doctrine 2.&lt;/p&gt;</comment>
                    <comment id="13852" author="romanb" created="Sun, 8 Aug 2010 09:05:25 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-675] EntityManager-&gt;find() returns detached (or otherwise unmanaged) object.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-675</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The find method seems to be broken. Returned objects are not managed according to the EntityManager. Fetching the same object via findAll() 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;$e = $em-&amp;gt;find(&apos;\net\jay\products\doctrine\ProductEntityType&apos;, 1);
print &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt;: &quot;&lt;/span&gt; . get_class($e) . &lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;br&amp;gt;&quot;&lt;/span&gt;;
print &lt;span class=&quot;code-quote&quot;&gt;&quot;Contained: &quot;&lt;/span&gt; . ($em-&amp;gt;contains($e) === &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; ? &apos;Yes&apos; : &apos;No&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This gives me:&lt;/p&gt;

&lt;p&gt;Class: net\jay\products\doctrine\ProductEntityType&lt;br/&gt;
Contained: No&lt;/p&gt;</description>
                <environment></environment>
            <key id="11602">DDC-675</key>
            <summary>EntityManager-&gt;find() returns detached (or otherwise unmanaged) 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="napsi">Michael Nielsen</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Jul 2010 07:00:59 +0000</created>
                <updated>Sun, 8 Aug 2010 09:05:07 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 09:05:07 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13545" author="beberlei" created="Fri, 9 Jul 2010 07:13:27 +0000"  >&lt;p&gt;can you try to build a reproducible test-case? This would be a serious issue, however we cannot reproduce it this way.&lt;/p&gt;</comment>
                    <comment id="13546" author="napsi" created="Fri, 9 Jul 2010 09:11:52 +0000"  >&lt;p&gt;Ah it turns out to be the leading namespace \ in the find parameter that killed me. Without it, the object turns out managed. &lt;/p&gt;

&lt;p&gt;Slightly troublesome that the object is returned in both cases perhaps.&lt;/p&gt;

&lt;p&gt;I tested with this added to tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php, in case the behaviour needs to be changed:&lt;/p&gt;
&lt;div class=&quot;code panel&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 testFind()
    {
    	&lt;span class=&quot;code-comment&quot;&gt;// Create
&lt;/span&gt;        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CmsUser;
        $user-&amp;gt;name = &apos;Roman&apos;;
        $user-&amp;gt;username = &apos;romanb&apos;;
        $user-&amp;gt;status = &apos;developer&apos;;
        $&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-comment&quot;&gt;// Find1
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();
        $user2 = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;find(&apos;Doctrine\Tests\Models\CMS\CmsUser&apos;, $user-&amp;gt;id);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertTrue($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($user2));

        &lt;span class=&quot;code-comment&quot;&gt;// Find2
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;clear();
        $user3 = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;find(&apos;\Doctrine\Tests\Models\CMS\CmsUser&apos;, $user-&amp;gt;id);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertTrue($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;contains($user3));
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Find1 passes, while Find2 fails. The user is found in both cases though.&lt;/p&gt;

&lt;p&gt;Have a nice weekend. &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="13547" author="romanb" created="Fri, 9 Jul 2010 09:17:55 +0000"  >&lt;p&gt;That is because the objects are stored in the identity map based on their class name. We could strip off leading backslashes but once we start doing that we will always miss some places. Class names in strings are &lt;b&gt;always fully-qualified&lt;/b&gt;, thus there is never a need to use a leading backslash in a string that contains a class name. The leading backslash is only useful in actual code, not in strings.&lt;/p&gt;</comment>
                    <comment id="13548" author="napsi" created="Fri, 9 Jul 2010 10:24:21 +0000"  >&lt;p&gt;Maybe just mentioning it in a &quot;common use errors&quot; section of the manual could be a good solution to avoid too much despair when the \ is added by mistake. If it&apos;s not already mentioned in there somewhere.&lt;/p&gt;</comment>
                    <comment id="13619" author="obrys" created="Tue, 20 Jul 2010 04:43:43 +0000"  >&lt;p&gt;The solution is just add a warning when leading \ is found.&lt;/p&gt;

&lt;p&gt;The same bug happends to me. It took lots of hours to find that it was by \.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
obrys&lt;/p&gt;</comment>
                    <comment id="13851" author="romanb" created="Sun, 8 Aug 2010 09:05:07 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-650] $data using wrong index in UnitOfWork::createEntity() in one to one assoc</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-650</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It looks like $data is using the wrong index ($srcColumn) in UnitOfWork::createEntity() line 1834 (1854 in github repo, it seems my IDE can&apos;t count &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;) to get the $joinColumnValue.  Since $data contains the camelized field names and $srcColumn is the actual field name, should it 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;+ $joinColumnValue = $data[$class-&amp;gt;fieldNames[$srcColumn]];
- $joinColumnValue = $data[$srcColumn];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11539">DDC-650</key>
            <summary>$data using wrong index in UnitOfWork::createEntity() in one to one assoc</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="ss10sb">Scott Morken</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Jun 2010 18:00:31 +0000</created>
                <updated>Sun, 8 Aug 2010 08:37:04 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 08:37:04 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13404" author="romanb" created="Wed, 23 Jun 2010 03:58:07 +0000"  >&lt;p&gt;Not really, join columns have no field name but you may have encountered one of &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; &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-383&quot; title=&quot;Setting Column name doesn&amp;#39;t work predictably in associations&quot;&gt;&lt;del&gt;DDC-383&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Join columns should really never be mapped to fields, they have no place whatsoever in the objects.&lt;/p&gt;</comment>
                    <comment id="13405" author="ss10sb" created="Wed, 23 Jun 2010 10:08:05 +0000"  >&lt;p&gt;It looks like it is &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-383&quot; title=&quot;Setting Column name doesn&amp;#39;t work predictably in associations&quot;&gt;&lt;del&gt;DDC-383&lt;/del&gt;&lt;/a&gt; for me.  I &lt;b&gt;think&lt;/b&gt; this occurred in my case because the tables use compound keys and I was using partials and part of the compound key was also the foreign key for a joined table.  Since the partial required all the compound keys be added to the field list, the foreign key was also added and probably caused this.  &lt;/p&gt;

&lt;p&gt;Thanks for the explanation.&lt;/p&gt;</comment>
                    <comment id="13850" author="romanb" created="Sun, 8 Aug 2010 08:37:04 +0000"  >&lt;p&gt;Should be fixed now.&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-383] Setting Column name doesn&apos;t work predictably in associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-383</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Setting a column name that is different from the property name yields errors in associations (e.g. in a one to one association I get &quot;Undefined index: shipping_id in /var/www/wetawa/library/Doctrine/ORM/UnitOfWork.php on line 1782 Call &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;...
    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;bigint&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;shipping_id&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; $shippingId=0;
    /**
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Shipping&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;shipping_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; Shipping
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $shipping;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The only way I&apos;ve been able to get associations to work is by using the default naming so $shipping_id instead of $shippingId&lt;/p&gt;</description>
                <environment></environment>
            <key id="10971">DDC-383</key>
            <summary>Setting Column name doesn&apos;t work predictably in associations</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="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="romanb">Roman S. Borschel</assignee>
                                <reporter username="kanundrum">akeem philbert</reporter>
                        <labels>
                    </labels>
                <created>Sat, 27 Feb 2010 15:19:39 +0000</created>
                <updated>Sun, 8 Aug 2010 07:16:38 +0000</updated>
                    <resolved>Fri, 9 Jul 2010 17:39:11 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11857" author="romanb" created="Sat, 27 Feb 2010 15:32:25 +0000"  >&lt;p&gt;Foreign keys (or discriminator columns) are not intended to be mapped to properties. What do you need $shippingId for?&lt;/p&gt;</comment>
                    <comment id="11858" author="kanundrum" created="Sat, 27 Feb 2010 19:44:00 +0000"  >&lt;p&gt;I see your point though there might be some use cases for wanting to access $shippingId (maybe storing in some kind of log that doesn&apos;t need the full set of shipping info) and not incur the expense of getting the shipping object. &lt;/p&gt;</comment>
                    <comment id="11859" author="beberlei" created="Sun, 28 Feb 2010 05:25:06 +0000"  >&lt;p&gt;@akeem: This is possible without mapping the shipping-id, although its not recommended for the reason that you are depending on internal Doctrien 2 APIs. This should only be done as a very last resort (performance reasons).&lt;/p&gt;

&lt;p&gt;You can retrieve the identifier of the shipping proxy object by calling:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$shippingId = $em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityIdentifier($entity-&amp;gt;shipping);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As another solution you could, if required for a specific use-case, retrieve only the shipping ids and initialize shipping as partial objects:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT o, PARTIAL s.{id} FROM Order o JOIN o.shipping s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11999" author="romanb" created="Wed, 3 Mar 2010 06:30:53 +0000"  >&lt;p&gt;Let my try to clarify, because I saw you tweeting that you dislike this &quot;limitation&quot;.&lt;/p&gt;

&lt;p&gt;A foreign key has no meaning in an object model. Foreign keys are how relational databases establish associations/relations between rows. In object-oriented programming objects establish associations through object references. In a sense, when you map a foreign key to an object property you leak detail of your relational schema into your object model. Detail that is only ever relevant to a relational database. If you would ever persist this object in another type of persistent storage, the foreign key has no meaning. This level of abstraction that D2 provides is rare among PHP ORMs. Most require you to have foreign keys as properties which is a major flaw of the abstraction.&lt;/p&gt;

&lt;p&gt;It should be possible to map foreign keys to properties but this has very low priority because even if you want to do it, it can only be a workaround and there are other ways that Benjamin pointed out.&lt;/p&gt;

&lt;p&gt;That said, Doctrine does of course not &quot;take away&quot; access to the foreign keys. With array or scalar hydration or even plain SQL, of course, you can still get the foreign keys in a result but foreign keys &lt;b&gt;have no place in an object model&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;Just trying to communicate this better.&lt;/p&gt;</comment>
                    <comment id="12001" author="kanundrum" created="Wed, 3 Mar 2010 07:43:58 +0000"  >&lt;p&gt;I appreciate the time spent on explaining this an do appreciate what you guys have said. I guess one of the things I really liked about the doctrine 2.0 direction was the use of plain php objects (so tempted to so pojos). While this is true there seem to be a number of caveats that get in the way of using those objects exactly how I want to (or in a way that isn&apos;t doctrine specific), so these caveats seem to make it a bit more intrusive than I initially thought (though less intrusive than having to extend classes). I&apos;ll chalk this one up to keep an eye on and I commend you guys on the work you&apos;ve done so far. &lt;/p&gt;</comment>
                    <comment id="12004" author="romanb" created="Wed, 3 Mar 2010 08:28:47 +0000"  >&lt;p&gt;Whenever you have questions on how to do something properly without dedicated foreign key properties just drop a mail to the user mailing list. For most cases there is a good solution and if not, we will create one.&lt;/p&gt;</comment>
                    <comment id="13556" author="beberlei" created="Fri, 9 Jul 2010 17:39:11 +0000"  >&lt;p&gt;This is not an issue. Closed&lt;/p&gt;</comment>
                    <comment id="13717" author="gedrox" created="Tue, 27 Jul 2010 17:13:54 +0000"  >&lt;p&gt;Still there is another issue related to this one.&lt;/p&gt;

&lt;p&gt;When I create yaml files from existing database using the command line command &quot;orm:convert-mapping --from-database yaml&quot; the relational field &quot;target_id&quot; is created in both places - as a field and in the relation definition (under oneToOne in my case). Here I get the same problem as described above and the target object cannot be retrieved.&lt;/p&gt;

&lt;p&gt;Sample generated yaml for city&#8212;country 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;City:
  type: entity
  table: city
  fields:
    id:
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: integer
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      generator:
        strategy: IDENTITY
    countryId:
      type: string(2)
      fixed: &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;
      column: country_id
    name:
      type: string(255)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      nullable: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  oneToOne:
    country:
      targetEntity: Country
      cascade: {  }
      mappedBy: &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      joinColumns:
        country_id:
          referencedColumnName: id
      orphanRemoval: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
  lifecycleCallbacks: {  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This yaml causes problems when city is loaded.&lt;/p&gt;

&lt;p&gt;Is it a bug or is it just me?&lt;/p&gt;</comment>
                    <comment id="13718" author="gedrox" created="Tue, 27 Jul 2010 17:33:52 +0000"  >&lt;p&gt;The file attached is modified YAML export driver which workarounds the problem with the problem described in the previous comment.&lt;/p&gt;

&lt;p&gt;Also it can append namespace to classes in the YAML files generated from the database schema.&lt;/p&gt;

&lt;p&gt;Hope it helps someone.&lt;/p&gt;</comment>
                    <comment id="13845" author="romanb" created="Sun, 8 Aug 2010 07:16:38 +0000"  >&lt;p&gt;This should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10712" name="YamlExportDriver.php" size="1724" author="gedrox" created="Tue, 27 Jul 2010 17:33:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-700] Proxy class is created for MappedSuperclass class</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-700</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When having abstract class as Mapped Superclass the proxy class is created without the &quot;abstract&quot; keyword which raises fatal PHP error &quot;Class %proxyClassName% contains 1 abstract method and must therefore be declared abstract or implement the remaining methods&quot; when read.&lt;/p&gt;

&lt;p&gt;I think there is no need to generate the proxy classes for classes marked as @MappedSuperclass at all.&lt;/p&gt;</description>
                <environment>Windows, PHP 5.3.2</environment>
            <key id="11651">DDC-700</key>
            <summary>Proxy class is created for MappedSuperclass class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Jul 2010 05:27:35 +0000</created>
                <updated>Sun, 8 Aug 2010 06:05:48 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 06:05:48 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13621" author="gedrox" created="Tue, 20 Jul 2010 05:34:00 +0000"  >&lt;p&gt;Patch which adds the &quot;abstract&quot; keyword for problematic proxies&lt;/p&gt;</comment>
                    <comment id="13841" author="beberlei" created="Sun, 8 Aug 2010 06:05:48 +0000"  >&lt;p&gt;Fixed, skip generation of proxies for mapped superclasses.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10700" name="vcs-diff2497454792683211266.patch" size="1540" author="gedrox" created="Tue, 20 Jul 2010 05:34:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-654] Unused lines of code in Doctrine\ORM\Query\AST\Functions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-654</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The majority of the classes contains a line that does notthing&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$lexer = $parser-&amp;gt;getLexer();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11549">DDC-654</key>
            <summary>Unused lines of code in Doctrine\ORM\Query\AST\Functions</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mac_nibblet">Antoine Hedgecock</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 18:35:44 +0000</created>
                <updated>Sun, 8 Aug 2010 05:49:51 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 05:49:51 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13838" author="beberlei" created="Sun, 8 Aug 2010 05:49:51 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-709] Doctrine-cli should check @OrderBy() taget existency</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-709</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Doctrine-cli orm:validate-schema should check schema for common typo mistakes as much as possible. Unknown target attribute passes ok. It&apos;s not expected behaviour.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11662">DDC-709</key>
            <summary>Doctrine-cli should check @OrderBy() taget existency</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="obrys">Jan Obr&#225;til</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 09:22:45 +0000</created>
                <updated>Sun, 8 Aug 2010 05:39:59 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 05:39:59 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13837" author="beberlei" created="Sun, 8 Aug 2010 05:39:59 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-645] XML schema missing change-tracking-policy</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-645</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;XML schema is missing change-tracking-policy element:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Tests\Models\ECommerce\ECommerceCart&quot;&lt;/span&gt; table=&lt;span class=&quot;code-quote&quot;&gt;&quot;ecommerce_carts&quot;&lt;/span&gt;&amp;gt;
        &amp;lt;change-tracking-policy&amp;gt;DEFERRED_IMPLICIT&amp;lt;/change-tracking-policy&amp;gt;
        &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;payment&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;payment&quot;&lt;/span&gt; length=&lt;span class=&quot;code-quote&quot;&gt;&quot;50&quot;&lt;/span&gt; precision=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; scale=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt;/&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thank you&lt;/p&gt;</description>
                <environment></environment>
            <key id="11521">DDC-645</key>
            <summary>XML schema missing change-tracking-policy</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="frantisek.troster">Frantisek Troster</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Jun 2010 08:39:10 +0000</created>
                <updated>Sun, 8 Aug 2010 05:32:55 +0000</updated>
                    <resolved>Sun, 8 Aug 2010 05:32:55 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13836" author="beberlei" created="Sun, 8 Aug 2010 05:32:55 +0000"  >&lt;p&gt;We changed how the XML Driver allows to define the change-tracking-policy for better validation. The working case is 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;    &amp;lt;entity change-tracking-policy=&lt;span class=&quot;code-quote&quot;&gt;&quot;DEFERRED_IMPLICT&quot;&lt;/span&gt; /&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Its included in the XSD Schema now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>