<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 07:00:36 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=fixVersion+%3D+%222.0-BETA3%22+AND+project+%3D+DDC&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=fixVersion+%3D+%222.0-BETA3%22+AND+project+%3D+DDC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="45" total="45"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-723] Upgrade ORM to depend on DBAL Beta3</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-723</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We need to raise the dependency of ORM to DBAL  BETA 3 before the ORM Beta 3 release.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11690">DDC-723</key>
            <summary>Upgrade ORM to depend on DBAL Beta3</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>Wed, 28 Jul 2010 13:16:16 +0000</created>
                <updated>Wed, 28 Jul 2010 14:22:09 +0000</updated>
                    <resolved>Wed, 28 Jul 2010 14:22:09 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13722" author="beberlei" created="Wed, 28 Jul 2010 14:22:09 +0000"  >&lt;p&gt;Done!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-719] Error in SQL subquery for a ManyToMany selfreferencing enitity when using the SIZE() or IS EMPTY dql function</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-719</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have an entity (Group) with a self-referencing ManyToMany association (parents, children).&lt;br/&gt;
Now im just trying to query all groups without a parent.&lt;/p&gt;

&lt;p&gt;My 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; g, c, d &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Volkszaehler\Model\&lt;span class=&quot;code-keyword&quot;&gt;Group&lt;/span&gt; g LEFT JOIN g.children c LEFT JOIN g.channels d  &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; g.parents IS EMPTY
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;throws this PDOException:&lt;/p&gt;
&lt;div class=&quot;code panel&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(PDOException)#31 (8) {
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;message&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
  string(89) &lt;span class=&quot;code-quote&quot;&gt;&quot;SQLSTATE[42S02]: Base table or view not found: 1146 Table &apos;volkszaehler.5_&apos; doesn&apos;t exist&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Exception&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
  string(0) &quot;&quot;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;code&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
  string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;42S02&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
  string(90) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(568)
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;trace&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Exception&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
  array(9) {
    [0]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(90) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(568)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;query&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(3) &lt;span class=&quot;code-quote&quot;&gt;&quot;PDO&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(1) {
        [0]=&amp;gt;
        string(604) &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT g0_.name AS name0, g0_.description AS description1, g0_.id AS id2, g0_.uuid AS uuid3, g1_.name AS name4, g1_.description AS description5, g1_.id AS id6, g1_.uuid AS uuid7, c2_.name AS name8, c2_.description AS description9, c2_.indicator AS indicator10, c2_.resolution AS resolution11, c2_.cost AS cost12, c2_.id AS id13, c2_.uuid AS uuid14 FROM groups g0_ LEFT JOIN groups_groups g3_ ON g0_.id = g3_.parent_id LEFT JOIN groups g1_ ON g1_.id = g3_.child_id LEFT JOIN groups_channel g4_ ON g0_.id = g4_.group_id LEFT JOIN channels c2_ ON c2_.id = g4_.channel_id WHERE (SELECT COUNT(*) FROM  5_) = 0&quot;&lt;/span&gt;
      }
    }
    [1]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(85) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/doctrine/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(46)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(12) &lt;span class=&quot;code-quote&quot;&gt;&quot;executeQuery&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(24) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\DBAL\Connection&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(3) {
        [0]=&amp;gt;
        string(604) &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT g0_.name AS name0, g0_.description AS description1, g0_.id AS id2, g0_.uuid AS uuid3, g1_.name AS name4, g1_.description AS description5, g1_.id AS id6, g1_.uuid AS uuid7, c2_.name AS name8, c2_.description AS description9, c2_.indicator AS indicator10, c2_.resolution AS resolution11, c2_.cost AS cost12, c2_.id AS id13, c2_.uuid AS uuid14 FROM groups g0_ LEFT JOIN groups_groups g3_ ON g0_.id = g3_.parent_id LEFT JOIN groups g1_ ON g1_.id = g3_.child_id LEFT JOIN groups_channel g4_ ON g0_.id = g4_.group_id LEFT JOIN channels c2_ ON c2_.id = g4_.channel_id WHERE (SELECT COUNT(*) FROM  5_) = 0&quot;&lt;/span&gt;
        [1]=&amp;gt;
        array(0) {
        }
        [2]=&amp;gt;
        array(0) {
        }
      }
    }
    [2]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(59) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/doctrine/lib/Doctrine/ORM/Query.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(265)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(7) &lt;span class=&quot;code-quote&quot;&gt;&quot;execute&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(44) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\Query\Exec\SingleSelectExecutor&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(3) {
        [0]=&amp;gt;
        object(Doctrine\DBAL\Connection)#16 (11) {
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_conn&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
          object(Doctrine\DBAL\Driver\PDOConnection)#29 (0) {
          }
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_config&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
          object(Doctrine\ORM\Configuration)#7 (1) {
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;_attributes&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
            array(7) {
              [&lt;span class=&quot;code-quote&quot;&gt;&quot;metadataCacheImpl&quot;&lt;/span&gt;]=&amp;gt;
              object(Doctrine\Common\Cache\ApcCache)#8 (2) {
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_cacheIdsIndexId&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Cache\AbstractCache&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                string(18) &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine_cache_ids&quot;&lt;/span&gt;
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_namespace&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Cache\AbstractCache&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                NULL
              }
              [&lt;span class=&quot;code-quote&quot;&gt;&quot;queryCacheImpl&quot;&lt;/span&gt;]=&amp;gt;
              object(Doctrine\Common\Cache\ApcCache)#8 (2) {
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_cacheIdsIndexId&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Cache\AbstractCache&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                string(18) &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine_cache_ids&quot;&lt;/span&gt;
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_namespace&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Cache\AbstractCache&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                NULL
              }
              [&lt;span class=&quot;code-quote&quot;&gt;&quot;metadataDriverImpl&quot;&lt;/span&gt;]=&amp;gt;
              object(Doctrine\ORM\Mapping\Driver\AnnotationDriver)#13 (4) {
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_reader&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\Mapping\Driver\AnnotationDriver&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                object(Doctrine\Common\Annotations\AnnotationReader)#9 (2) {
                  [&lt;span class=&quot;code-quote&quot;&gt;&quot;parser&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\AnnotationReader&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                  object(Doctrine\Common\Annotations\Parser)#10 (6) {
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;lexer&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\Parser&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    object(Doctrine\Common\Annotations\Lexer)#11 (5) {
                      [&lt;span class=&quot;code-quote&quot;&gt;&quot;tokens&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Lexer&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                      array(0) {
                      }
                      [&lt;span class=&quot;code-quote&quot;&gt;&quot;position&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Lexer&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(0)
                      [&lt;span class=&quot;code-quote&quot;&gt;&quot;peek&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Lexer&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(0)
                      [&lt;span class=&quot;code-quote&quot;&gt;&quot;lookahead&quot;&lt;/span&gt;]=&amp;gt;
                      NULL
                      [&lt;span class=&quot;code-quote&quot;&gt;&quot;token&quot;&lt;/span&gt;]=&amp;gt;
                      NULL
                    }
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;isNestedAnnotation&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\Parser&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    bool(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;defaultAnnotationNamespace&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\Parser&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    string(21) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\Mapping\&quot;&lt;/span&gt;
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;namespaceAliases&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\Parser&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    array(0) {
                    }
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;context&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\Parser&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    string(0) &quot;&quot;
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;autoloadAnnotations&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\Parser&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    bool(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
                  }
                  [&lt;span class=&quot;code-quote&quot;&gt;&quot;cache&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Annotations\AnnotationReader&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                  object(Doctrine\Common\Cache\ArrayCache)#12 (3) {
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;data&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Cache\ArrayCache&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    array(0) {
                    }
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_cacheIdsIndexId&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Cache\AbstractCache&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    string(18) &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine_cache_ids&quot;&lt;/span&gt;
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_namespace&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\Cache\AbstractCache&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
                    NULL
                  }
                }
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_paths&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
                array(1) {
                  [0]=&amp;gt;
                  string(58) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/volkszaehler.org/backend/lib/Model&quot;&lt;/span&gt;
                }
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_fileExtension&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
                string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;.php&quot;&lt;/span&gt;
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;_classNames&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
                NULL
              }
              [&lt;span class=&quot;code-quote&quot;&gt;&quot;proxyDir&quot;&lt;/span&gt;]=&amp;gt;
              string(66) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/volkszaehler.org/backend/lib/Model/Proxies&quot;&lt;/span&gt;
              [&lt;span class=&quot;code-quote&quot;&gt;&quot;proxyNamespace&quot;&lt;/span&gt;]=&amp;gt;
              string(26) &lt;span class=&quot;code-quote&quot;&gt;&quot;Volkszaehler\Model\Proxies&quot;&lt;/span&gt;
              [&lt;span class=&quot;code-quote&quot;&gt;&quot;autoGenerateProxyClasses&quot;&lt;/span&gt;]=&amp;gt;
              bool(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
              [&lt;span class=&quot;code-quote&quot;&gt;&quot;sqlLogger&quot;&lt;/span&gt;]=&amp;gt;
              object(Volkszaehler\Util\Debug)#22 (5) {
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;queries&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
                array(1) {
                  [0]=&amp;gt;
                  array(2) {
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;sql&quot;&lt;/span&gt;]=&amp;gt;
                    string(604) &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT g0_.name AS name0, g0_.description AS description1, g0_.id AS id2, g0_.uuid AS uuid3, g1_.name AS name4, g1_.description AS description5, g1_.id AS id6, g1_.uuid AS uuid7, c2_.name AS name8, c2_.description AS description9, c2_.indicator AS indicator10, c2_.resolution AS resolution11, c2_.cost AS cost12, c2_.id AS id13, c2_.uuid AS uuid14 FROM groups g0_ LEFT JOIN groups_groups g3_ ON g0_.id = g3_.parent_id LEFT JOIN groups g1_ ON g1_.id = g3_.child_id LEFT JOIN groups_channel g4_ ON g0_.id = g4_.group_id LEFT JOIN channels c2_ ON c2_.id = g4_.channel_id WHERE (SELECT COUNT(*) FROM  5_) = 0&quot;&lt;/span&gt;
                    [&lt;span class=&quot;code-quote&quot;&gt;&quot;parameters&quot;&lt;/span&gt;]=&amp;gt;
                    array(0) {
                    }
                  }
                }
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;messages&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
                array(0) {
                }
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;started&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
                NULL
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;level&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
                string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;
                [&lt;span class=&quot;code-quote&quot;&gt;&quot;created&quot;&lt;/span&gt;]=&amp;gt;
                &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;(1280063214.6367)
              }
            }
          }
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_eventManager&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
          object(Doctrine\Common\EventManager)#14 (1) {
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;_listeners&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\Common\EventManager&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
            array(0) {
            }
          }
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_isConnected&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\DBAL\Connection&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
          bool(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_transactionNestingLevel&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\DBAL\Connection&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
          &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(0)
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_transactionIsolationLevel&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\DBAL\Connection&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
          &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_params&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\DBAL\Connection&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
          array(5) {
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;driver&quot;&lt;/span&gt;]=&amp;gt;
            string(9) &lt;span class=&quot;code-quote&quot;&gt;&quot;pdo_mysql&quot;&lt;/span&gt;
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;host&quot;&lt;/span&gt;]=&amp;gt;
            string(9) &lt;span class=&quot;code-quote&quot;&gt;&quot;localhost&quot;&lt;/span&gt;
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt;]=&amp;gt;
            string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;vz&quot;&lt;/span&gt;
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;password&quot;&lt;/span&gt;]=&amp;gt;
            string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;demo&quot;&lt;/span&gt;
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;dbname&quot;&lt;/span&gt;]=&amp;gt;
            string(12) &lt;span class=&quot;code-quote&quot;&gt;&quot;volkszaehler&quot;&lt;/span&gt;
          }
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_platform&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
          object(Doctrine\DBAL\Platforms\MySqlPlatform)#17 (1) {
            [&lt;span class=&quot;code-quote&quot;&gt;&quot;doctrineTypeMapping&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
            NULL
          }
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_schemaManager&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
          NULL
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_driver&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;]=&amp;gt;
          object(Doctrine\DBAL\Driver\PDOMySql\Driver)#15 (0) {
          }
          [&lt;span class=&quot;code-quote&quot;&gt;&quot;_isRollbackOnly&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\DBAL\Connection&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
          bool(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
        }
        [1]=&amp;gt;
        array(0) {
        }
        [2]=&amp;gt;
        array(0) {
        }
      }
    }
    [3]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(67) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/doctrine/lib/Doctrine/ORM/AbstractQuery.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(522)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(10) &lt;span class=&quot;code-quote&quot;&gt;&quot;_doExecute&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(18) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\Query&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(0) {
      }
    }
    [4]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(67) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/doctrine/lib/Doctrine/ORM/AbstractQuery.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(360)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(7) &lt;span class=&quot;code-quote&quot;&gt;&quot;execute&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(26) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\AbstractQuery&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(2) {
        [0]=&amp;gt;
        array(0) {
        }
        [1]=&amp;gt;
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
      }
    }
    [5]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(83) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/volkszaehler.org/backend/lib/Controller/GroupController.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(57)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(9) &lt;span class=&quot;code-quote&quot;&gt;&quot;getResult&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(26) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\AbstractQuery&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(0) {
      }
    }
    [6]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(78) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/volkszaehler.org/backend/lib/Controller/Controller.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(54)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(3) &lt;span class=&quot;code-quote&quot;&gt;&quot;get&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(39) &lt;span class=&quot;code-quote&quot;&gt;&quot;Volkszaehler\Controller\GroupController&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(0) {
      }
    }
    [7]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(67) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/volkszaehler.org/backend/lib/Dispatcher.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(149)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(3) &lt;span class=&quot;code-quote&quot;&gt;&quot;run&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(34) &lt;span class=&quot;code-quote&quot;&gt;&quot;Volkszaehler\Controller\Controller&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(1) {
        [0]=&amp;gt;
        string(3) &lt;span class=&quot;code-quote&quot;&gt;&quot;get&quot;&lt;/span&gt;
      }
    }
    [8]=&amp;gt;
    array(6) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;]=&amp;gt;
      string(58) &lt;span class=&quot;code-quote&quot;&gt;&quot;/home/steffen/workspace/volkszaehler.org/backend/index.php&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;line&quot;&lt;/span&gt;]=&amp;gt;
      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(55)
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;function&quot;&lt;/span&gt;]=&amp;gt;
      string(3) &lt;span class=&quot;code-quote&quot;&gt;&quot;run&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;class&quot;&lt;/span&gt;]=&amp;gt;
      string(23) &lt;span class=&quot;code-quote&quot;&gt;&quot;Volkszaehler\Dispatcher&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;]=&amp;gt;
      string(2) &lt;span class=&quot;code-quote&quot;&gt;&quot;-&amp;gt;&quot;&lt;/span&gt;
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;args&quot;&lt;/span&gt;]=&amp;gt;
      array(0) {
      }
    }
  }
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;previous&quot;&lt;/span&gt;:&lt;span class=&quot;code-quote&quot;&gt;&quot;Exception&quot;&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;]=&amp;gt;
  NULL
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;errorInfo&quot;&lt;/span&gt;]=&amp;gt;
  array(3) {
    [0]=&amp;gt;
    string(5) &lt;span class=&quot;code-quote&quot;&gt;&quot;42S02&quot;&lt;/span&gt;
    [1]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1146)
    [2]=&amp;gt;
    string(37) &lt;span class=&quot;code-quote&quot;&gt;&quot;Table &apos;volkszaehler.5_&apos; doesn&apos;t exist&quot;&lt;/span&gt;
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is my Group Entitiy:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;namespace Volkszaehler\Model;

use Doctrine\Common\Collections;

use Doctrine\Common\Collections\ArrayCollection;

/**
 * Group entity
 *
 * @author Steffen Vogel &amp;lt;info@steffenvogel.de&amp;gt;
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;
 *
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;groups&quot;&lt;/span&gt;)
 */
class Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Entity {
	/** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $name;

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

	/**
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Channel&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;groups&quot;&lt;/span&gt;)
	 * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;groups_channel&quot;&lt;/span&gt;,
	 * 		joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;group_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)},
	 * 		inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;channel_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)}
	 * )
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $channels = NULL;

	/**
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;parents&quot;&lt;/span&gt;)
	 * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;groups_groups&quot;&lt;/span&gt;,
	 * 		joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;parent_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)},
	 * 		inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;child_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)}
	 * )
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $children = NULL;

	/**
	 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;children&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $parents = NULL;

	/**
	 * construct
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
		parent::__construct();

		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;channels = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;children = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;parents = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
	}

	/**
	 * adds group as &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; child
	 *
	 * @param Group $child
	 * @todo check against endless recursion
	 * @todo check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the group is already member of the group
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addGroup(Group $child) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;children-&amp;gt;add($child);
	}

	/**
	 * adds channel as &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; child
	 *
	 * @param Channel $child
	 * @todo check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the channel is already member of the group
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addChannel(Channel $child) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;channels-&amp;gt;add($child);
	}

	/**
	 * getter &amp;amp; setter
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getName() { &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name; }
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setName($name) { $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;name = $name; }
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDescription() { &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;description; }
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setDescription($description) { $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;description = $description; }
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getChildren() { &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;children; }
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getParents() { &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;parents; }
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getChannels() { &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;channels; }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3, Ubuntu Lucid, MySQL 5, Apache 2.2</environment>
            <key id="11679">DDC-719</key>
            <summary>Error in SQL subquery for a ManyToMany selfreferencing enitity when using the SIZE() or IS EMPTY dql function</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="steffenvogel">Steffen Vogel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 25 Jul 2010 09:20:15 +0000</created>
                <updated>Sat, 7 Aug 2010 06:28:09 +0000</updated>
                    <resolved>Sat, 7 Aug 2010 06:28:09 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>DQL</component>
                <component>Mapping Drivers</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13691" author="beberlei" created="Sun, 25 Jul 2010 09:34:37 +0000"  >&lt;p&gt;Looks like abug in the SQL Walker.&lt;/p&gt;

&lt;p&gt;btw, you can use $e-&amp;gt;getTraceAsString() to get a nice looking output for an exception. Its not as verbose as var_dump on the exception&lt;/p&gt;</comment>
                    <comment id="13764" author="guilhermeblanco" created="Tue, 3 Aug 2010 00:21:38 +0000"  >&lt;p&gt;No, it is a bug on ClassMetadata.&lt;/p&gt;

&lt;p&gt;The var_dump on Association of parents refers to a NULL on joinTable.&lt;br/&gt;
Problem seems to be deeper. I am creating a test case, will figure it out soon.&lt;/p&gt;</comment>
                    <comment id="13765" author="guilhermeblanco" created="Tue, 3 Aug 2010 01:11:04 +0000"  >&lt;p&gt;Ok, it seems that on Mapping drivers we don&apos;t map jointables on opposite side.&lt;/p&gt;

&lt;p&gt;So, if you map something on inversedBy and you grab the association from mappedBy side, you&apos;ll never have the jointable definition, because it is not exported to us.&lt;br/&gt;
This seems like a bug flaw we have on our code... not at the point of a critical, but we need to fix it asap.&lt;/p&gt;</comment>
                    <comment id="13766" author="romanb" created="Tue, 3 Aug 2010 04:11:03 +0000"  >&lt;p&gt;That the jointable info is only on the owning side is by design, not a flaw.&lt;/p&gt;</comment>
                    <comment id="13770" author="guilhermeblanco" created="Tue, 3 Aug 2010 23:25:51 +0000"  >&lt;p&gt;Path to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-719&quot; title=&quot;Error in SQL subquery for a ManyToMany selfreferencing enitity when using the SIZE() or IS EMPTY dql function&quot;&gt;&lt;del&gt;DDC-719&lt;/del&gt;&lt;/a&gt; aswell as a possible issue with collection member implementation.&lt;/p&gt;</comment>
                    <comment id="13795" author="guilhermeblanco" created="Fri, 6 Aug 2010 12:00:14 +0000"  >&lt;p&gt;In &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/35af98260a525a841c05be15f52f8df455000066&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/35af98260a525a841c05be15f52f8df455000066&lt;/a&gt; I committed a fix to this issue.&lt;br/&gt;
Should be working now =)&lt;/p&gt;</comment>
                    <comment id="13814" author="romanb" created="Sat, 7 Aug 2010 06:26:39 +0000"  >&lt;p&gt;Reopening in order to correct the fixed version.&lt;/p&gt;</comment>
                    <comment id="13815" author="romanb" created="Sat, 7 Aug 2010 06:26:58 +0000"  >&lt;p&gt;Closing with correct version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10716" name="DDC719-patch.diff" size="5500" author="guilhermeblanco" created="Tue, 3 Aug 2010 23:25:51 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-716] Proxy autogeneration fails with concurrent requests</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-716</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When doing concurrent requests with autogeneration of proxies enabled, the proxy file does not exist when ProxyFactory tries to use it:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine/ORM/Proxy/ProxyFactory.php(92): spl_autoload_call(&apos;MyClassProxy&apos;))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think this is because file_put_contents is not atomic.&lt;/p&gt;</description>
                <environment>Debian 5.0.5, Apache 2.2.9, PHP 5.3.2</environment>
            <key id="11672">DDC-716</key>
            <summary>Proxy autogeneration fails with concurrent requests</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="jakajancar">Jaka Jancar</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Jul 2010 10:00:44 +0000</created>
                <updated>Sat, 24 Jul 2010 06:23:09 +0000</updated>
                    <resolved>Sat, 24 Jul 2010 06:23:09 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13657" author="jakajancar" created="Thu, 22 Jul 2010 11:07:21 +0000"  >&lt;p&gt;The following fixes it on Linux, but I think will not work in Windows (iirc, rename() on Windows won&apos;t work if the dest file already exists, much less atomically):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
--- Proxy/ProxyFactory.php	(revision 2)
+++ Proxy/ProxyFactory.php	(working copy)
@@ -144,7 +144,9 @@
 
         $file = str_replace($placeholders, $replacements, $file);
 
-        file_put_contents($fileName, $file);
+        $tmpFileName = $fileName.&apos;-&apos;.uniqid(&apos;&apos;, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);;
+        file_put_contents($tmpFileName, $file);
+        rename($tmpFileName, $fileName);
     }
 
     /**
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13658" author="jakajancar" created="Thu, 22 Jul 2010 11:19:14 +0000"  >&lt;p&gt;I don&apos;t even know why this is needed. Can&apos;t the file just be returned as string and eval()&apos;d, instead of being written to a file and then require()&apos;d?&lt;/p&gt;</comment>
                    <comment id="13665" author="beberlei" created="Thu, 22 Jul 2010 17:06:15 +0000"  >&lt;p&gt;we should just change file_put_Contents into:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;file_put_contents($fileName, $file, LOCK_EX);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13666" author="beberlei" created="Thu, 22 Jul 2010 17:13:17 +0000"  >&lt;p&gt;Setting the LOCK_EX constant now, this should solve the issue.&lt;/p&gt;

&lt;p&gt;However in high concurrency scenarios the &quot;autoGenerateProxyClasses&quot; flag should always be FALSE and the proxies be generated during build-time.&lt;/p&gt;</comment>
                    <comment id="13667" author="jakajancar" created="Thu, 22 Jul 2010 18:30:53 +0000"  >&lt;p&gt;LOCK_EX doesn&apos;t fix it for me. Apparently it&apos;s still possible that the file doesn&apos;t exist:&lt;/p&gt;

&lt;div class=&quot;code panel&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_WARNING (2): include(MyProxies/MyClassProxy.php) [&amp;lt;a href=&apos;function.include&apos;&amp;gt;function.include&amp;lt;/a&amp;gt;]: failed to open stream: No such file or directory
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Please note that my above uniqid+rename suggestion only works if more_entropy is true, if you decide to add it.&lt;/p&gt;

&lt;p&gt;However, I&apos;d much prefer having an option of just not using these files at all. I&apos;ve created an Improvement ticket &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-717&quot; title=&quot;Do not use files when using proxy autogeneration&quot;&gt;DDC-717&lt;/a&gt; for this.&lt;/p&gt;</comment>
                    <comment id="13673" author="beberlei" created="Fri, 23 Jul 2010 03:16:56 +0000"  >&lt;p&gt;i now underestand what you are doing wrong.&lt;/p&gt;

&lt;p&gt;if you set autogenerate = false you have to call doctrine orm:generate-proxies&lt;/p&gt;</comment>
                    <comment id="13674" author="jakajancar" created="Fri, 23 Jul 2010 03:20:55 +0000"  >&lt;p&gt;I&apos;m not setting it to false!&lt;/p&gt;

&lt;p&gt;&amp;gt; When doing concurrent requests with autogeneration of proxies &lt;b&gt;enabled&lt;/b&gt;&lt;/p&gt;
</comment>
                    <comment id="13676" author="beberlei" created="Fri, 23 Jul 2010 05:34:10 +0000"  >&lt;p&gt;ah ok, eval is just a workaround.&lt;/p&gt;</comment>
                    <comment id="13680" author="beberlei" created="Sat, 24 Jul 2010 06:23:09 +0000"  >&lt;p&gt;Closed again, See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-717&quot; title=&quot;Do not use files when using proxy autogeneration&quot;&gt;DDC-717&lt;/a&gt; for a timetable of a fix using auto-generate = true in production.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-714] Fix of DDC-167 creates FatalError when persisting a new entity</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-714</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The resolution of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-167&quot; title=&quot;New method: EntityManager#getPartialReference&quot;&gt;&lt;del&gt;DDC-167&lt;/del&gt;&lt;/a&gt; introduced a new problem in UnitOfWork on line 612 (function persistNew()) as well - when I try to save an entity, I get an Exception from my error handler (who captues php errors):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ErrorException with Argument 2 passed to Doctrine\ORM\Mapping\ClassMetadata::setIdentifierValues() must be an array, integer given, called in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php on line 612 and defined
Backtrace: #0: Doctrine\ORM\Mapping\ClassMetadata-&amp;gt;setIdentifierValues at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:612
#1: Doctrine\ORM\UnitOfWork-&amp;gt;persistNew at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:1247
#2: Doctrine\ORM\UnitOfWork-&amp;gt;doPersist at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:1210
#3: Doctrine\ORM\UnitOfWork-&amp;gt;persist at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/EntityManager.php:438
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The relevant code in UoW 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;            $idValue = $idGen-&amp;gt;generate($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em, $entity);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $idGen &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; \Doctrine\ORM\Id\AssignedGenerator) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityIdentifiers[$oid] = array($class-&amp;gt;identifier[0] =&amp;gt; $idValue);
                $class-&amp;gt;setIdentifierValues($entity, $idValue);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We&apos;re using the SequenceGenerator&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;@SequenceGenerator(allocationSize=1,sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;address_id_seq&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which doesn&apos;t return an array, so the array typehint fails and generates an error.&lt;/p&gt;

&lt;p&gt;The fix, which worked for me, is attached.&lt;/p&gt;</description>
                <environment>Debian 5 (64bit), Postgresql 8.3, ZendServer 5.0.2, PHP 5.3.2, Doctrine-HEAD</environment>
            <key id="11670">DDC-714</key>
            <summary>Fix of DDC-167 creates FatalError when persisting a new entity</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="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="mzach">Michael Zach</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Jul 2010 08:13:40 +0000</created>
                <updated>Sun, 25 Jul 2010 10:35:58 +0000</updated>
                    <resolved>Sun, 25 Jul 2010 10:35:58 +0000</resolved>
                            <version>2.0-BETA3</version>
                <version>2.0-BETA4</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13692" author="beberlei" created="Sun, 25 Jul 2010 10:28:08 +0000"  >&lt;p&gt;This bug also leads to about 400 test failures in the Postgres ORM Testsuite &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="13693" author="beberlei" created="Sun, 25 Jul 2010 10:35:58 +0000"  >&lt;p&gt;Fixed! Thanks for reporting.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10704" name="uow.diff" size="775" author="mzach" created="Thu, 22 Jul 2010 08:13:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-710] DecimalType - NULL in database should be NULL not 0</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-710</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DecimalType::convertToPHPValue should return NULL if the value in the database is NULL.  This is similar to the issue with IntegerType that was fixed with #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-571&quot; title=&quot;IntegerType - NULL in datbase should be NULL not 0&quot;&gt;&lt;del&gt;DDC-571&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The fix would be to replace&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;return (double) $value;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;with&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;return is_null($value) ? null : (double) $value;&lt;/tt&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11663">DDC-710</key>
            <summary>DecimalType - NULL in database should be NULL not 0</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="pschwisow">Patrick Schwisow</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 11:10:43 +0000</created>
                <updated>Wed, 21 Jul 2010 15:44:39 +0000</updated>
                    <resolved>Wed, 21 Jul 2010 15:44:39 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13648" author="beberlei" created="Wed, 21 Jul 2010 15:44:39 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-706] DriverChain::isTransient should return false not throw exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-706</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The isTransient() method has to return false, not throw an exception if the given class is not an entity or mapped superclass. The current behaviour violates the Mapping\Driver contract.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11658">DDC-706</key>
            <summary>DriverChain::isTransient should return false not throw exception</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>Tue, 20 Jul 2010 16:47:40 +0000</created>
                <updated>Wed, 21 Jul 2010 15:23:46 +0000</updated>
                    <resolved>Wed, 21 Jul 2010 15:23:46 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13645" author="beberlei" created="Wed, 21 Jul 2010 15:23:46 +0000"  >&lt;p&gt;Fixed in master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-697] Support for DateTime in query parameters</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-697</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Supports native DateTime in query parameters. (for more universal using)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Column definition&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; DateTime
 *
 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $published;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Query&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb = $em-&amp;gt;getRepository(&apos;Entities\Foo&apos;)-&amp;gt;createQueryBuilder(&apos;f&apos;);
$qb-&amp;gt;where(&lt;span class=&quot;code-quote&quot;&gt;&quot;f.published &amp;lt;= ?1&quot;&lt;/span&gt;);
$qb-&amp;gt;setParameter(1, &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime(&apos;2012-12-21 23:59:59&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now display &quot;Object of class DateTime could not be converted to string&quot; error&lt;/p&gt;</description>
                <environment></environment>
            <key id="11642">DDC-697</key>
            <summary>Support for DateTime in query parameters</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="vrtak-cz">Patrik Voto&#269;ek</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Jul 2010 06:19:56 +0000</created>
                <updated>Wed, 21 Jul 2010 17:17:22 +0000</updated>
                    <resolved>Wed, 21 Jul 2010 17:17:22 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13599" author="beberlei" created="Mon, 19 Jul 2010 07:53:46 +0000"  >&lt;p&gt;This is another case for possible optimizations in my opinion, is it possible to access the parameter needles from the ResultSetMapping? If so then we should add a convertToParam method to each Doctrine\DBAL\Types\Type and allow conversions to take place or just do nothing. This woulld help with this issue, aswell as with other more complex types to be bound.&lt;/p&gt;</comment>
                    <comment id="13600" author="beberlei" created="Mon, 19 Jul 2010 07:55:48 +0000"  >&lt;p&gt;This affects the following loop inside Doctrine\ORM\Query:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query.php#L234&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query.php#L234&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13617" author="beberlei" created="Tue, 20 Jul 2010 02:42:23 +0000"  >&lt;p&gt;According to Roman this should already be possible with:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb-&amp;gt;setParameter(1, &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime(&apos;2012-12-21 23:59:59&apos;), \Doctrine\DBAL\Types\Type::DATETIME);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;can you verify this?&lt;/p&gt;</comment>
                    <comment id="13618" author="vrtak-cz" created="Tue, 20 Jul 2010 03:18:53 +0000"  >&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$qb-&amp;gt;setParameter(1, &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime(&apos;2012-12-21 23:59:59&apos;), \Doctrine\DBAL\Types\Type::DATETIME);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;No this featrue not work for me. (Same error message) I&apos;m tested at latest BETA release &amp;amp; latest code from master branch (GitHub).&lt;/p&gt;</comment>
                    <comment id="13649" author="beberlei" created="Wed, 21 Jul 2010 17:17:22 +0000"  >&lt;p&gt;Fixed, QueryBuilder::setParameter() and QueryBuilder::setParameters() did not yet support setting parameter types.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-693] NULL values from Postgres boolean columns are loaded as FALSE instead of NULL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-693</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have column in PostgreSQL defined as &quot;BOOLEAN NULL&quot;. If I store NULL value to database and then load it back, I get FALSE instead of NULL.&lt;/p&gt;

&lt;p&gt;Example entity and test attached.&lt;/p&gt;

&lt;p&gt;I am not sure if this issue applies to ORM or DBAL, so posting here.&lt;/p&gt;</description>
                <environment>PostgreSQL 8.4.3</environment>
            <key id="11637">DDC-693</key>
            <summary>NULL values from Postgres boolean columns are loaded as FALSE instead of NULL</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="jantichy">Jan Tich&#253;</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Jul 2010 12:19:04 +0000</created>
                <updated>Wed, 21 Jul 2010 15:44:23 +0000</updated>
                    <resolved>Wed, 21 Jul 2010 15:44:23 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13647" author="beberlei" created="Wed, 21 Jul 2010 15:44:23 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10698" name="NullBoolean.zip" size="896" author="jantichy" created="Sun, 18 Jul 2010 12:19:04 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-681] PATCH: UnitOfWork#lock locks by column names instead of field names</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-681</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;On line 1700 of UnitOfWork#lock column names are used instead of field names, I think the line should read:&lt;/p&gt;

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

&lt;p&gt;A related question: when I load an instance by relation, e.g. $author = $book-&amp;gt;getAuthor(), I cannot specify a lock type at that point, so I have to call $em-&amp;gt;lock($author, LockType::PESSIMISTIC_WRITE) afterwards, which results in two database queries for the same record. Is it possible to do this at once, without setting a transaction isolation level?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11609">DDC-681</key>
            <summary>PATCH: UnitOfWork#lock locks by column names instead of field names</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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>Sat, 10 Jul 2010 13:00:12 +0000</created>
                <updated>Sat, 10 Jul 2010 17:58:05 +0000</updated>
                    <resolved>Sat, 10 Jul 2010 17:56:08 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13562" author="beberlei" created="Sat, 10 Jul 2010 13:29:01 +0000"  >&lt;p&gt;Fixed the UoW issue. Thanks!&lt;/p&gt;

&lt;p&gt;As for the second issue, there is really only one way to skip the second database call:&lt;/p&gt;

&lt;p&gt;Use a Fetch Join DQL to get both book and author and apply the pessimistic lock to that DQL. (Locking both the book and author)&lt;/p&gt;

&lt;p&gt;All the other way already created the Author proxy object and you won&apos;t be able to specify a locking hint on those lazy loading select statements, requiring you to do the second locking call.&lt;/p&gt;</comment>
                    <comment id="13563" author="dennis.verspuij" created="Sat, 10 Jul 2010 14:05:15 +0000"  >&lt;p&gt;Hi Benjamin, thanks for the quick answer, I already thought you&apos;d answer that. Only funny thing is that in my SQL log it seems the select query for the lock is called before the select query for populating the $author values! May be because it delays populating the values before its first use? In the lock could actually be done at once. Any ideas?&lt;/p&gt;</comment>
                    <comment id="13565" author="beberlei" created="Sat, 10 Jul 2010 17:55:53 +0000"  >&lt;p&gt;Ah ok that is a very good optimization case, let me think about how and if this is easily implementable.&lt;/p&gt;

&lt;p&gt;I close this issue now and open up a new one&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11611">DDC-683</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-669] order of fields in sql query and parameters to be bound to the dbal&apos;s statement is different</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-669</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;It seems that I found a bug in the Doctrine\ORM\Persisters\BasicEntityPersister. Let me explain.&lt;/p&gt;

&lt;p&gt;Put it simply, I have the following entity:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Foo.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @Entity
 */
class Foo
{
    /**
     * @Id
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Foo&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;children&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;parent_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $parent;
    /**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Foo&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;parent&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $children;
    /**
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $verticalOrder;

    &lt;span class=&quot;code-comment&quot;&gt;// a bunch of getters/setters&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;As you can see, there&apos;s a mandatory field called &quot;verticalOrder&quot;, it is not intended to be managed manually but rather with a listener attached to onFlush event. ( In that listener, after a value for the verticalOrder is set, the uow::recomputeSingleEntityChangeSet() method is invoked, as it was suggested in documentation ).&lt;/p&gt;

&lt;p&gt;The thing is that when I persist an instance of this class and then invoke flush ( without providing a value for it, the verticalOrder ), Doctrine dies silently, with no exception being thrown. The easy fix can be done with adding this piece of source code to the BasicEntityPersister on line 218:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Dumb fix&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!$stmt-&amp;gt;execute()) {
    &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Exception(&apos;Unable to execute query: &apos;.var_export($stmt-&amp;gt;errorInfo(), &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;That was the first problem I have faced with while trying to find out why my entity is not persisted. After I have delved a bit deeper, I found out&lt;br/&gt;
that the problem lies in &lt;b&gt;BasicEntityPersister ::_getInsertColumnList()&lt;/b&gt; or in &lt;b&gt;BasicEntityPersister  ::_prepareUpdateData()&lt;/b&gt;. The thing is that order of columns in the SQL query generated by the BasicEntityPersister::_getInsertColumnList() and values to be bound to the statement and after executed is different. &lt;b&gt;Line 214&lt;/b&gt; in BasicEntityPersister is meant here.&lt;/p&gt;

&lt;p&gt;In my case it was reversed, instead of parent_id, a value for verticalOrder was inserted and vice versa.&lt;/p&gt;

&lt;p&gt;Array of parameters to be bound to the Doctrine\DBAL\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;Array
(
    [verticalOrder] =&amp;gt; 1278334736 &lt;span class=&quot;code-comment&quot;&gt;// at the moment timestamp is used rather than MAX from the table
&lt;/span&gt;    [parent_id] =&amp;gt; 
)

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

&lt;p&gt;And the query that will be executed:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;INSERT INTO Foo(parent_id, verticalOrder) VALUES (?, ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These snippets clearly illustrate the point.&lt;/p&gt;

&lt;p&gt;I hope I was clear in my explanations.&lt;/p&gt;

&lt;p&gt;I will try to devote some spare time and write tests to lock this issue, but i&apos;m not able to say at the moment when it happens.&lt;/p&gt;

&lt;p&gt;All the best,&lt;br/&gt;
Sergei Lissovski&lt;/p&gt;</description>
                <environment>win7, apache2, php 5.3.2</environment>
            <key id="11586">DDC-669</key>
            <summary>order of fields in sql query and parameters to be bound to the dbal&apos;s statement is different</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="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sergei.lissovski">Sergei Lissovski</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Jul 2010 09:17:19 +0000</created>
                <updated>Mon, 5 Jul 2010 10:12:25 +0000</updated>
                    <resolved>Mon, 5 Jul 2010 10:03:44 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13516" author="beberlei" created="Mon, 5 Jul 2010 10:03:44 +0000"  >&lt;p&gt;This issue is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-656&quot; title=&quot;UnitOfWork::recomputeSingleEntityChangeSet does not preserve field order&quot;&gt;&lt;del&gt;DDC-656&lt;/del&gt;&lt;/a&gt;. which was fixed this weekend. The current master has a fix for it.&lt;/p&gt;</comment>
                    <comment id="13518" author="sergei.lissovski" created="Mon, 5 Jul 2010 10:12:25 +0000"  >&lt;p&gt;Okay, thank you for a quick response. Will take it into account.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-662] Missing default value for attribute &apos;AutoGenerateProxyClasses&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-662</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When not setting the attribute &apos;AutoGenerateProxyClasses&apos; and running orm:ensure-production-settings an exception is thrown:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Notice: Undefined index: autoGenerateProxyClasses in Doctrine/ORM/lib/Doctrine/ORM/Configuration.php on line 332&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There should be a default value set or a notice that this attribute is mandatory.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11574">DDC-662</key>
            <summary>Missing default value for attribute &apos;AutoGenerateProxyClasses&apos;</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="mstoehr">Marcus St&#246;hr</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Jun 2010 08:47:57 +0000</created>
                <updated>Thu, 1 Jul 2010 18:36:44 +0000</updated>
                    <resolved>Thu, 1 Jul 2010 18:36:44 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13464" author="romanb" created="Wed, 30 Jun 2010 09:12:01 +0000"  >&lt;p&gt;the code inside the method that checks the production settings should simply use the getters instead of accessing the attributes array directly. So: $this-&amp;gt;getAutoGenerateProxyClasses() instead of $this-&amp;gt;_attributes&lt;span class=&quot;error&quot;&gt;&amp;#91;....&amp;#93;&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;The default values are encapsulated in the getter methods to avoid having a large array with default values that grows with each new setting even if the setting is never used.&lt;/p&gt;</comment>
                    <comment id="13487" author="beberlei" created="Thu, 1 Jul 2010 18:36:44 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-660] quoting not-in-values</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-660</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There seems to be a bug in ORM/Query/expr.php method notIn. All literals should be quoted 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;    /**
     * Creates a NOT IN() expression with the given arguments.
     *
     * @param string $x Field in string format to be restricted by NOT IN() function
     * @param mixed $y Argument to be used in NOT IN() function.
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Expr\Func
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function notIn($x, $y)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_array($y)) {
            foreach ($y as &amp;amp;$literal) { 
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! ($literal &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Expr\Literal)) { 
                    $literal = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_quoteLiteral($literal);
                }
            }
        }
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Expr\Func($x . &apos; NOT IN&apos;, (array) $y);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Win7</environment>
            <key id="11569">DDC-660</key>
            <summary>quoting not-in-values</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="dietmar">Dietmar Bauer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 29 Jun 2010 11:38:04 +0000</created>
                <updated>Thu, 1 Jul 2010 15:43:08 +0000</updated>
                    <resolved>Thu, 1 Jul 2010 15:43:08 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13457" author="dietmar" created="Tue, 29 Jun 2010 11:50:46 +0000"  >&lt;p&gt;Of  course without &quot;unknown macro&quot; in the code!&lt;/p&gt;</comment>
                    <comment id="13459" author="beberlei" created="Tue, 29 Jun 2010 16:42:08 +0000"  >&lt;p&gt;this was fixed for the in() function already some time ago, good oversight &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="13479" author="dietmar" created="Thu, 1 Jul 2010 04:27:49 +0000"  >&lt;p&gt;added   &lt;/p&gt;
{ code }
&lt;p&gt;  to description&lt;/p&gt;</comment>
                    <comment id="13483" author="beberlei" created="Thu, 1 Jul 2010 15:43:08 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-656] UnitOfWork::recomputeSingleEntityChangeSet does not preserve field order</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-656</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;XML&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt; xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;    &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Entities\Specification&quot;&lt;/span&gt; table=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification&quot;&lt;/span&gt;&amp;gt;
        &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; length=&lt;span class=&quot;code-quote&quot;&gt;&quot;255&quot;&lt;/span&gt;/&amp;gt;
        &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;/&amp;gt;
        &amp;lt;id name=&lt;span class=&quot;code-quote&quot;&gt;&quot;specificationId&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;specification_id&quot;&lt;/span&gt;&amp;gt;
            &amp;lt;generator strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;/&amp;gt;
        &amp;lt;/id&amp;gt;
    &amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$spec = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Entities\Specification();
$spec-&amp;gt;setName(&apos;test1&apos;);
$spec-&amp;gt;setType(&apos;type1&apos;);
$em-&amp;gt;persist($spec);
$em-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSet($em-&amp;gt;getClassMetadata(get_class($spec)), $spec);
$data1 = $em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityChangeset($spec);
$spec-&amp;gt;setType(&apos;type2&apos;);
$em-&amp;gt;getUnitOfWork()-&amp;gt;recomputeSingleEntityChangeSet($em-&amp;gt;getClassMetadata(get_class($spec)), $spec);
$data2 = $em-&amp;gt;getUnitOfWork()-&amp;gt;getEntityChangeset($spec);
&lt;span class=&quot;code-comment&quot;&gt;// data1 contains keys in correct order: name, type
&lt;/span&gt;var_dump($data1);
&lt;span class=&quot;code-comment&quot;&gt;// data2 contains keys in reverse order: type, name
&lt;/span&gt;var_dump($data2);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I got this issue when was trying to change entity properties using onFlush event&lt;/p&gt;</description>
                <environment>php 5.3.2, ubuntu 10.4</environment>
            <key id="11556">DDC-656</key>
            <summary>UnitOfWork::recomputeSingleEntityChangeSet does not preserve field order</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="wizardz">Andriy Savchenko</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Jun 2010 15:27:51 +0000</created>
                <updated>Sun, 4 Jul 2010 02:55:22 +0000</updated>
                    <resolved>Sun, 4 Jul 2010 02:55:22 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13432" author="beberlei" created="Sun, 27 Jun 2010 13:36:10 +0000"  >&lt;p&gt;fixed format&lt;/p&gt;</comment>
                    <comment id="13433" author="beberlei" created="Sun, 27 Jun 2010 13:36:48 +0000"  >&lt;p&gt;how is this a bug?&lt;/p&gt;</comment>
                    <comment id="13472" author="wizardz" created="Wed, 30 Jun 2010 17:58:40 +0000"  >&lt;p&gt;when you call $em-&amp;gt;flush() values are inserted switched&lt;/p&gt;</comment>
                    <comment id="13488" author="beberlei" created="Thu, 1 Jul 2010 18:39:38 +0000"  >&lt;p&gt;Updating priority to critical&lt;/p&gt;</comment>
                    <comment id="13503" author="beberlei" created="Sun, 4 Jul 2010 02:55:22 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-649] SQL Error with single table inheritance and findAll method</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-649</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When selecting all objects of SecondClass and ThirdClass which both inherit from FirstClass with the following code :&lt;/p&gt;

&lt;p&gt;$em-&amp;gt;getRepository(&apos;FirstClass&apos;)-&amp;gt;findAll();&lt;/p&gt;

&lt;p&gt;Postgresql is throwing the following error :&lt;br/&gt;
Invalid text representation: 7 ERROR: invalid input syntax for integer: &quot;&quot; LINE 1: ...er_stuff3 FROM &quot;first_class&quot; t0 WHERE t0.type IN (&apos;&apos;, &apos;1&apos;, &apos;... &lt;/p&gt;

&lt;p&gt;I think it&apos;s because of the empty string after the IN clause.&lt;/p&gt;

&lt;p&gt;There is the fail test case :&lt;/p&gt;

&lt;p&gt;Classes :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class FirstClass {

  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $type;
}

class SecondClass &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; FirstClass {
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $otherStuff;
}

class ThirdClass &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; FirstClass {
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $otherStuff;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Mapping :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
  &amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt; xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; xsi:schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;
  &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;FirstClass&quot;&lt;/span&gt; table=&apos;&lt;span class=&quot;code-quote&quot;&gt;&quot;first_class&quot;&lt;/span&gt;&apos; inheritance-type=&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_TABLE&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;id name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;&amp;gt;
      &amp;lt;generator strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;/&amp;gt;
      &amp;lt;sequence-generator sequence-name=&lt;span class=&quot;code-quote&quot;&gt;&quot;first_class_id_seq&quot;&lt;/span&gt; allocation-size=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; initial-value=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;/&amp;gt;
    &amp;lt;/id&amp;gt;

    &amp;lt;discriminator-column name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt; field-name=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt; /&amp;gt;

    &amp;lt;discriminator-map&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;ThirdClass&quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;SecondClass&quot;&lt;/span&gt; /&amp;gt;
    &amp;lt;/discriminator-map&amp;gt;
  &amp;lt;/entity&amp;gt;
  &amp;lt;/doctrine-mapping&amp;gt;

&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt; xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; xsi:schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;
  &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;SecondClass&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherStuff&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;other_stuff&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;gt;

&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;
&amp;lt;doctrine-mapping xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//doctrine-project.org/schemas/orm/doctrine-mapping&quot;&lt;/span&gt; xmlns:xsi=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt; xsi:schemaLocation=&lt;span class=&quot;code-quote&quot;&gt;&quot;http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd&quot;&lt;/span&gt;&amp;gt;
&lt;/span&gt;
  &amp;lt;entity name=&lt;span class=&quot;code-quote&quot;&gt;&quot;ThirdClass&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;otherStuff&quot;&lt;/span&gt; column=&lt;span class=&quot;code-quote&quot;&gt;&quot;other_stuff&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/entity&amp;gt;
&amp;lt;/doctrine-mapping&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The SQL :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE first_class
(
  id serial NOT NULL,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt; integer,
  other_stuff character varying,
  CONSTRAINT first_class_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The fail test :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;require_once &apos;class/FirstClass.php&apos;;
require_once &apos;class/SecondClass.php&apos;;
require_once &apos;class/ThirdClass.php&apos;;

$entities = $doctrineEntityManager-&amp;gt;getRepository(&apos;FirstClass&apos;)-&amp;gt;findAll();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Postgresql</environment>
            <key id="11531">DDC-649</key>
            <summary>SQL Error with single table inheritance and findAll method</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="needle">Paul Fariello</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Jun 2010 17:12:43 +0000</created>
                <updated>Sun, 4 Jul 2010 07:46:56 +0000</updated>
                    <resolved>Sun, 4 Jul 2010 07:46:56 +0000</resolved>
                            <version>2.0-BETA1</version>
                <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13382" author="needle" created="Sun, 20 Jun 2010 17:25:16 +0000"  >&lt;p&gt;The problem seems to come from Doctrine\ORM\Persisters\SingleTablePersister::_getSelectConditionSQL()&lt;/p&gt;</comment>
                    <comment id="13403" author="bmills" created="Tue, 22 Jun 2010 18:02:56 +0000"  >&lt;p&gt;I am also experiencing this exact issue. The value of the empty string in the &apos;IN&apos; clause would appear to be the &apos;discriminatorValue&apos; field on the instance of ClassMetadataInfo that gets passed into SingleTablePersister. For me, that value is null.&lt;/p&gt;

&lt;p&gt;As a side note, this came up when I was trying to switch all my entities from using Annotation to XML. When using Annotations, I do not experience the problem with this query, which leads me to believe the issues lies somewhere in the XML drivers.&lt;/p&gt;

&lt;p&gt;That&apos;s about as far as I&apos;ve gotten trying to debug it.&lt;/p&gt;</comment>
                    <comment id="13409" author="needle" created="Thu, 24 Jun 2010 17:12:05 +0000"  >&lt;p&gt;Why do not juste change the _getSelectConditionSQL() to the following : &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _getSelectConditionSQL(array $criteria, $assoc = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        $conditionSql = parent::_getSelectConditionSQL($criteria, $assoc);

        &lt;span class=&quot;code-comment&quot;&gt;// Append discriminator condition
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($conditionSql) $conditionSql .= &apos; AND &apos;;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;discriminatorValue)) {
            $values = array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quote($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;discriminatorValue));
        }
        $discrValues = array_flip($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;discriminatorMap);
        foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;subClasses as $subclassName) {
            $values[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quote($discrValues[$subclassName]);
        }
        $conditionSql .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_getSQLTableAlias($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;name) . &apos;.&apos;
                . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_class-&amp;gt;discriminatorColumn[&apos;name&apos;]
                . &apos; IN (&apos; . implode(&apos;, &apos;, $values) . &apos;)&apos;;

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $conditionSql;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13468" author="beberlei" created="Wed, 30 Jun 2010 15:37:02 +0000"  >&lt;p&gt;There is a fundamental flaw in your logic i believe.&lt;/p&gt;

&lt;p&gt;The parent entity has to be part of the entity map, otherwise it cannot be used as a starting point for findAll() on the repository.&lt;/p&gt;

&lt;div class=&quot;code panel&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;discriminator-map&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;FirstClass&quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;ThirdClass&quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;discriminator-mapping value=&lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt; class=&lt;span class=&quot;code-quote&quot;&gt;&quot;SecondClass&quot;&lt;/span&gt; /&amp;gt;
    &amp;lt;/discriminator-map&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13474" author="needle" created="Wed, 30 Jun 2010 18:38:26 +0000"  >&lt;p&gt;But what if the FirstClass is abstract ?&lt;br/&gt;
Then it can&apos;t be part of the entity map, isn&apos;t it ?&lt;/p&gt;

&lt;p&gt;However I should be able to select all its children classes. Anyway I think Doctrine should allow me to do it &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="13476" author="beberlei" created="Thu, 1 Jul 2010 01:35:05 +0000"  >&lt;p&gt;even if it is abstract it is part of the hierachy and can be selected in DQL, repository and find methods. Since you cannot instantiate&lt;br/&gt;
the abstract class in userland anyways there is never going to be a problem. It still has to be done.&lt;/p&gt;

&lt;p&gt;Maybe we should throw an exception in the mapping drivers if this is not done properly&lt;/p&gt;</comment>
                    <comment id="13477" author="needle" created="Thu, 1 Jul 2010 03:38:56 +0000"  >&lt;p&gt;Correct me if I&apos;m wrong, but if I do such a thing then i&apos;ll have a discriminator value wich will never be used.&lt;br/&gt;
It seems strange to me but as long as it works &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Thank you for the explanation.&lt;/p&gt;</comment>
                    <comment id="13489" author="beberlei" created="Thu, 1 Jul 2010 18:40:12 +0000"  >&lt;p&gt;add it for now, you are right its never used. We will look into a change.&lt;/p&gt;</comment>
                    <comment id="13507" author="beberlei" created="Sun, 4 Jul 2010 07:46:56 +0000"  >&lt;p&gt;Fixed in master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-647] string length not taken into account on id while using Yaml driver</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-647</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The string lenght specified in the Yaml file is not respected on id columns.&lt;/p&gt;

&lt;p&gt;Sample YAML file&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;---
# Entities.Stock.dcm.yml
Entities\Stock:
  type: entity
  table: stocks
  id:
    id:
      type: string
      length: 10
      generator:
        strategy: NONE
  fields:
    nature:
      type: string
      length: 10
    name:
      type: string
      length: 40
    creationDate:
      name: creation_date
      type: datetime
    owner:
      type: string
      length: 8
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Command used to generate the SQL statements:&lt;br/&gt;
./doctrine orm:schema-tool:create --dump-sql&lt;/p&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE stocks (id VARCHAR(255) NOT NULL, nature VARCHAR(12) NOT
NULL, name VARCHAR(40) NOT NULL, creationDate DATETIME NOT NULL, owner
VARCHAR(8) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &quot;id&quot; is generated as VARCHAR(255) instead of VARCHAR(10).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11527">DDC-647</key>
            <summary>string length not taken into account on id while using Yaml driver</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="shurakai">Christian Heinrich</assignee>
                                <reporter username="goriol">Guillaume ORIOL</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Jun 2010 06:42:41 +0000</created>
                <updated>Mon, 28 Jun 2010 17:08:35 +0000</updated>
                    <resolved>Tue, 22 Jun 2010 14:26:37 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13375" author="beberlei" created="Sun, 20 Jun 2010 07:04:31 +0000"  >&lt;p&gt;Fixed formating&lt;/p&gt;</comment>
                    <comment id="13402" author="shurakai" created="Tue, 22 Jun 2010 14:26:23 +0000"  >&lt;p&gt;Fixed: &lt;a href=&quot;http://github.com/Shurakai/doctrine2/tree/DDC-647&quot; class=&quot;external-link&quot;&gt;http://github.com/Shurakai/doctrine2/tree/DDC-647&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13445" author="beberlei" created="Mon, 28 Jun 2010 17:08:18 +0000"  >&lt;p&gt;Hey Christian, please don&apos;t mark bugs as fixed that have not been merged into the main repository yet.&lt;/p&gt;

&lt;p&gt;Merged now&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-646] Missing inclusion of namespace</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-646</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand.php requires that you include the following namespace &lt;/p&gt;

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

&lt;p&gt;else the following error is thrown&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;PHP Warning:  require(Doctrine/ORM/Tools/Console/Command/EntityGenerator.php): failed to open stream: No such file or directory in /usr/local/zend/share/pear/Doctrine/Common/&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;.php on line 148
PHP Fatal error:  require(): Failed opening required &apos;Doctrine/ORM/Tools/Console/Command/EntityGenerator.php&apos; (include_path=&apos;/Users/antoine/Sites/startaeget-3.3/application/library:.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear&apos;) in /usr/local/zend/share/pear/Doctrine/Common/&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;.php on line 148
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11525">DDC-646</key>
            <summary>Missing inclusion of namespace</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="mac_nibblet">Antoine Hedgecock</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jun 2010 16:47:47 +0000</created>
                <updated>Sat, 19 Jun 2010 18:28:51 +0000</updated>
                    <resolved>Sat, 19 Jun 2010 18:28:51 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13372" author="beberlei" created="Sat, 19 Jun 2010 18:28:51 +0000"  >&lt;p&gt;fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-644] [ORACLE] setting query maxResults together with firstResult leads to an error</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-644</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m not very skilled in doctrine yet, but I found something that might be worth reporting. &lt;/p&gt;

&lt;p&gt;The code below produces &quot;Class does not exist&quot; error, which is quite misleading and just a side effect of a Notice that shows up in AbstractHydrator.php (lines 190 and 191).&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;		$q = DBConnection::Common()-&amp;gt;createQueryBuilder()-&amp;gt;select(&apos;c&apos;)-&amp;gt;from(&apos;COMPANY&apos;, &apos;c&apos;)-&amp;gt;getQuery();
		$q-&amp;gt;setMaxResults(15);
		$q-&amp;gt;setFirstResult(1);
		var_dump($query-&amp;gt;getResult());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;div class=&quot;code panel&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 b.* FROM (SELECT a.*, ROWNUM AS doctrine_rownum FROM (SELECT c0_.ID_COMPANY AS ID_COMPANY0, c0_.CONTACT AS CONTACT1, c0_.CONTRACT AS CONTRACT2, c0_.DESCRIPTION AS DESCRIPTION3, c0_.ID_DISPLAY_CASE AS ID_DISPLAY_CASE4, c0_.MAX_OPEN_WIN AS MAX_OPEN_WIN5, c0_.NAME AS NAME6, c0_.REFRESH_TIME AS REFRESH_TIME7, c0_.STATUS AS STATUS8, c0_.TABLESPACE AS TABLESPACE9 FROM COMPANY c0_) a ) b WHERE doctrine_rownum BETWEEN 2 AND 16
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem occurs when iterating over the list of internal column aliases (ID_COMPANY0,DESCRIPTION3,ID_DISPLAY_CASE4,MAX_OPEN_WIN5,NAME6,REFRESH_TIME7,STATUS8,TABLESPACE9 and&lt;br/&gt;
DOCTRINE_ROWNUM). The last one &quot;DOCTRINE_ROWNUM&quot; is missing in both $this-&amp;gt;_rsm-&amp;gt;metaMappings and $this-&amp;gt;_rsm-&amp;gt;columnOwnerMap and it&apos;s not a matter of case sensitivity, it&apos;s missing completely.&lt;/p&gt;

&lt;p&gt;Result: &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$cache[$key][&apos;dqlAlias&apos;] becomes NULL
$rowData[$dqlAlias][$cache[$key][&apos;fieldName&apos;]] = $value;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(line 203) creates a new key (named as empty string) in $rowData and things get screwed up since then in further iterations over $rowData array.&lt;/p&gt;

&lt;p&gt;Unfortunately I&apos;m not familiar with the internal code of doctrine at all, and it seems too complex for me to be able to provide a fix (except for an ugly hack).&lt;/p&gt;

&lt;p&gt;I&apos;ve attached the Exception trace (might help).&lt;/p&gt;

&lt;p&gt;BTW: Doctrine 2 is the cleanest piece of complex code I&apos;ve ever seen. You guys rock !!!&lt;/p&gt;</description>
                <environment>PHP 5.3.2</environment>
            <key id="11518">DDC-644</key>
            <summary>[ORACLE] setting query maxResults together with firstResult leads to an error</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="cicovec">Martin Ivi&#269;i&#269;</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 17:42:06 +0000</created>
                <updated>Wed, 28 Jul 2010 15:53:00 +0000</updated>
                    <resolved>Wed, 28 Jul 2010 15:53:00 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13447" author="beberlei" created="Mon, 28 Jun 2010 17:13:14 +0000"  >&lt;p&gt;fixed formating&lt;/p&gt;</comment>
                    <comment id="13723" author="beberlei" created="Wed, 28 Jul 2010 15:53:00 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10669" name="ReflectionException.zip" size="23954" author="cicovec" created="Thu, 17 Jun 2010 17:42:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-642] Conversion from annotation to xml mapping doesn&apos;t equal (missing inversedBy)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-642</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&apos;ve converted schema from annotations to XML, but after the conversion the association is missing inversedBy parameter:&lt;/p&gt;

&lt;div class=&quot;code panel&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; $text;
/**
 * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;CmsUser&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;articles&quot;&lt;/span&gt;)
 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
*/
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;converted XML is missing inversedBy attribute:&lt;/p&gt;

&lt;div class=&quot;code panel&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;many-to-one field=&lt;span class=&quot;code-quote&quot;&gt;&quot;user&quot;&lt;/span&gt; target-entity=&lt;span class=&quot;code-quote&quot;&gt;&quot;CmsUser&quot;&lt;/span&gt; orphan-removal=&quot;&quot;&amp;gt;
  &amp;lt;join-columns&amp;gt;
    &amp;lt;join-column name=&lt;span class=&quot;code-quote&quot;&gt;&quot;user_id&quot;&lt;/span&gt; referenced-column-name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; nullable=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;/&amp;gt;
  &amp;lt;/join-columns&amp;gt;
&amp;lt;/many-to-one&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thank you.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11501">DDC-642</key>
            <summary>Conversion from annotation to xml mapping doesn&apos;t equal (missing inversedBy)</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="frantisek.troster">Frantisek Troster</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 03:50:27 +0000</created>
                <updated>Wed, 16 Jun 2010 11:52:04 +0000</updated>
                    <resolved>Wed, 16 Jun 2010 11:48:11 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-641] Conversion from annotation to xml mapping not matching XML schema (Cascade persist)</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-641</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&apos;m converting schema from annotations to XML, but the result doesn&apos;t match XML schema:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ECommerceProduct&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;})
 * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;ecommerce_carts_products&quot;&lt;/span&gt;,
        joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cart_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)},
        inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;product_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)})
*/
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;gets converted 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;&amp;lt;many-to-many field=&lt;span class=&quot;code-quote&quot;&gt;&quot;related&quot;&lt;/span&gt; target-entity=&lt;span class=&quot;code-quote&quot;&gt;&quot;ECommerceProduct&quot;&lt;/span&gt; inversed-by=&lt;span class=&quot;code-quote&quot;&gt;&quot;par-relates&quot;&lt;/span&gt;&amp;gt;
....
          &amp;lt;cascade&amp;gt;
            &amp;lt;persist/&amp;gt;
          &amp;lt;/cascade&amp;gt;
.....
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but the XML schema allows only:&lt;/p&gt;

&lt;div class=&quot;code panel&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;xs:complexType name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade-type&quot;&lt;/span&gt;&amp;gt;
  &amp;lt;xs:sequence&amp;gt;
    &amp;lt;xs:element name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade-all&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;orm:emptyType&quot;&lt;/span&gt; minOccurs=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt;/&amp;gt; 
    &amp;lt;xs:element name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade-persist&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;orm:emptyType&quot;&lt;/span&gt; minOccurs=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt;/&amp;gt; 
    &amp;lt;xs:element name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade-merge&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;orm:emptyType&quot;&lt;/span&gt; minOccurs=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt;/&amp;gt; 
    &amp;lt;xs:element name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade-remove&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;orm:emptyType&quot;&lt;/span&gt; minOccurs=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt;/&amp;gt; 
    &amp;lt;xs:element name=&lt;span class=&quot;code-quote&quot;&gt;&quot;cascade-refresh&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;orm:emptyType&quot;&lt;/span&gt; minOccurs=&lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt;/&amp;gt; 
  &amp;lt;/xs:sequence&amp;gt;
&amp;lt;/xs:complexType&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thank you.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11500">DDC-641</key>
            <summary>Conversion from annotation to xml mapping not matching XML schema (Cascade persist)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="frantisek.troster">Frantisek Troster</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 03:45:22 +0000</created>
                <updated>Wed, 16 Jun 2010 11:21:04 +0000</updated>
                    <resolved>Wed, 16 Jun 2010 11:21:04 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-634] Merging an entity with a single valued association that has been set to null has no effect</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-634</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When merging an owning entity which has NULL as one of its associated properties, merge doesn&apos;t realize that it needs to disassociate 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;class Doctor {
	
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
	/**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Patient&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;doctor&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
     */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $patients;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;patients = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Patient {
	
    /** @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;Doctor&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;patients&quot;&lt;/span&gt;)
	 * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;doctor_id&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
     */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $doctor;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Assume that in the database there exists a doctor id=1 and a patient id=1.  The patient belongs to the doctor, so the patient table has doctor_id = 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;$p1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \vo\Patient();
$p1-&amp;gt;id = 1;
$p1-&amp;gt;doctor = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
$em-&amp;gt;merge($p1);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This does not set doctor_id to null as expected.&lt;/p&gt;

&lt;p&gt;It can be fixed by changing the block at line 1373 in UnitOfWork.php as follow.  Apologies for not providing a patch file, I haven&apos;t quite got the hang of git yet &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                           &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($other !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                                $targetClass = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($assoc2-&amp;gt;targetEntityName);
                                $id = $targetClass-&amp;gt;getIdentifierValues($other);
                                $proxy = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getProxyFactory()-&amp;gt;getProxy($assoc2-&amp;gt;targetEntityName, $id);
                                $prop-&amp;gt;setValue($managedCopy, $proxy);
                                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;registerManaged($proxy, $id, array());
                            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
								$prop-&amp;gt;setValue($managedCopy, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
			   }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11481">DDC-634</key>
            <summary>Merging an entity with a single valued association that has been set to null has no effect</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ccapndave">Dave Keen</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Jun 2010 20:14:25 +0000</created>
                <updated>Fri, 30 Jul 2010 11:59:48 +0000</updated>
                    <resolved>Fri, 30 Jul 2010 11:59:48 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13734" author="romanb" created="Fri, 30 Jul 2010 11:59:48 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/69073c4b37ee28f988306db4965f512b70f45181&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/69073c4b37ee28f988306db4965f512b70f45181&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-627] Unexpected Duplicate Field Mapping Exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-627</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Trying to generate entities with annotation mappings using the CLI orm:convert-mapping command will throw an exception.&lt;/p&gt;

&lt;p&gt;&amp;#8211; Schema to reproduce &lt;br/&gt;
CREATE DATABASE IF NOT EXISTS `doctrine_issue`;&lt;br/&gt;
USE `doctrine_issue`;&lt;br/&gt;
CREATE TABLE `activity` (&lt;br/&gt;
  `idact` int(10) unsigned NOT NULL AUTO_INCREMENT,&lt;br/&gt;
  PRIMARY KEY (`idact`)&lt;br/&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;br/&gt;
CREATE TABLE `activity_log` (&lt;br/&gt;
  `idacl` int(10) unsigned NOT NULL AUTO_INCREMENT,&lt;br/&gt;
  `idact` int(10) unsigned NOT NULL,&lt;br/&gt;
  PRIMARY KEY (`idacl`),&lt;br/&gt;
  CONSTRAINT `fk_activity_data_activity` FOREIGN KEY (`idact`) REFERENCES `activity` (`idact`)&lt;br/&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;/p&gt;

&lt;p&gt;// configure a simple doctrine.php file to connect and run the following CLI command:&lt;br/&gt;
C:\&amp;gt;php doctrine.php orm:convert-mapping --from-database annotation .\Entities&lt;/p&gt;

&lt;p&gt;Will throw an MappingException::duplicateFieldMapping on ActivityLog::idact, at line 1064 of class Doctrine\ORM\Mapping\ClassMetadataInfo&lt;/p&gt;</description>
                <environment>mysql  Ver 14.14 Distrib 5.1.43, for Win32 (ia32)&lt;br/&gt;
&lt;br/&gt;
PHP 5.3.1 (cli) (built: Feb  8 2010 22:11:49) &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 Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [enabled]</environment>
            <key id="11456">DDC-627</key>
            <summary>Unexpected Duplicate Field Mapping Exception</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="alexbrina">Alexandre Brina</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Jun 2010 12:07:58 +0000</created>
                <updated>Thu, 2 Jun 2011 19:55:08 +0000</updated>
                    <resolved>Sun, 13 Jun 2010 14:13:19 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13300" author="beberlei" created="Sun, 13 Jun 2010 14:13:19 +0000"  >&lt;p&gt;Fixed and scheduled for BETA 3&lt;/p&gt;</comment>
                    <comment id="15899" author="cosmo" created="Thu, 2 Jun 2011 19:55:08 +0000"  >&lt;p&gt;Hi, I&apos;ve got this exact issue in 2.1.0BETA1. Any idea how to work around it?&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11425">DDC-616</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-625] orm:schema-tool:update --dump-sql showing SQL when DB is up-to-date</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-625</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;With the following entities ...&lt;br class=&quot;atl-forced-newline&quot; /&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;&amp;lt;?php

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

    /**
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_Role&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;role_id&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $role;

    /** @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, columnDefinition=&lt;span class=&quot;code-quote&quot;&gt;&quot;CHAR(64) NOT NULL&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $password;
}

&amp;lt;?php

/**
 * @Entity
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;roles&quot;&lt;/span&gt;)
 */
class App_Model_Role
{
    /**
     * @Id
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;)
     * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;smallint&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m getting this output from orm:schema-tool:update --dump-sql, when the database is already up-to-date:&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;ALTER TABLE users CHANGE password password CHAR(64) NOT NULL;
ALTER TABLE users DROP FOREIGN KEY users_ibfk_1;
ALTER TABLE users ADD FOREIGN KEY (role_id) REFERENCES roles(id)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11443">DDC-625</key>
            <summary>orm:schema-tool:update --dump-sql showing SQL when DB is up-to-date</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="darkangel">Glen Ainscow</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Jun 2010 16:26:06 +0000</created>
                <updated>Fri, 9 Jul 2010 17:36:32 +0000</updated>
                    <resolved>Fri, 9 Jul 2010 17:36:32 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13401" author="shurakai" created="Tue, 22 Jun 2010 14:18:05 +0000"  >&lt;p&gt;This is most probably equivalent with the following problem:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It&apos;s got to do with cli: when you DB is up to date and you run orm:schema-tool:update --dump-sql, you get something like this:&lt;/p&gt;

&lt;p&gt;ALTER TABLE user_users CHANGE avatar avatar LONGTEXT NOT NULL &amp;lt;- but the column avatar is already LONGTEXT&lt;/p&gt;

&lt;p&gt;This is caused by the following: Two schema objects are being compared. The first schema is created from the current mapping files (YAML, e.g.) and within these, this column is marked as &quot;object&quot;. When the DB is setup, object is transferred into another type, like LONGTEXT. (Platform dependent)&lt;/p&gt;

&lt;p&gt;The second schema is created from your current database and is marked as &quot;TextType&quot; because Doctrine cannot decide which other type - there are several who use LONGTEXT - would be correct&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;See /DBAL/Schema/Comparator.php ll. 172ff. &amp;amp; 293&lt;/p&gt;

&lt;p&gt;Comparing whether both Types return the same SQL-Statement might do the job but would be really ugly.&lt;/p&gt;</comment>
                    <comment id="13446" author="beberlei" created="Mon, 28 Jun 2010 17:11:13 +0000"  >&lt;p&gt;The columnDefintion affected field can obviously not be solved by any means.&lt;/p&gt;

&lt;p&gt;The foreign key thing i see more often in my own projects though, i have to dig deeper there.&lt;/p&gt;</comment>
                    <comment id="13554" author="beberlei" created="Fri, 9 Jul 2010 17:36:32 +0000"  >&lt;p&gt;Fixed Foreign Key issue in DBAL master, it was an error in the MySQL query to fetch the foreign keys.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-620] Add support to multiple FROM clauses</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-620</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We support multiple FROM in EBNF, and also in Hydrators.&lt;br/&gt;
But it still misses the support of SqlWalker. We need to support that&lt;/p&gt;</description>
                <environment></environment>
            <key id="11431">DDC-620</key>
            <summary>Add support to multiple FROM clauses</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 May 2010 12:40:05 +0000</created>
                <updated>Tue, 20 Jul 2010 11:27:17 +0000</updated>
                    <resolved>Tue, 20 Jul 2010 11:27:17 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13398" author="shurakai" created="Mon, 21 Jun 2010 18:56:40 +0000"  >&lt;p&gt;I think this issue is a duplicate.&lt;/p&gt;</comment>
                    <comment id="13625" author="beberlei" created="Tue, 20 Jul 2010 11:27:17 +0000"  >&lt;p&gt;Was fixed by guilherme, see &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-614&quot; title=&quot;Multiple Entities in FROM clause throws exception&quot;&gt;&lt;del&gt;DDC-614&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11421">DDC-614</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-618] INDEX BY not working</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-618</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It looks like INDEX BY does not work from DQL queries.&lt;br/&gt;
Haven&apos;t tested it when using query builder.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11428">DDC-618</key>
            <summary>INDEX BY not working</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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>Mon, 31 May 2010 11:13:45 +0000</created>
                <updated>Mon, 28 Jun 2010 18:07:08 +0000</updated>
                    <resolved>Mon, 28 Jun 2010 18:07:06 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13085" author="dennis.verspuij" created="Mon, 31 May 2010 11:22:00 +0000"  >&lt;p&gt;Test case&lt;/p&gt;</comment>
                    <comment id="13451" author="beberlei" created="Mon, 28 Jun 2010 17:52:48 +0000"  >&lt;p&gt;INDEX BY got optimized away, the SqlWalker currently does not interpret the INDEX BY clause.&lt;/p&gt;
</comment>
                    <comment id="13452" author="beberlei" created="Mon, 28 Jun 2010 18:07:06 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10621" name="DDC618Test.php" size="3551" author="dennis.verspuij" created="Mon, 31 May 2010 11:22:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;My schema:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;create table TABLE_TEST1 (
   TEST1_FIRST_COLUMN      NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   TEST1_SECOND_COLUMN     VARCHAR2(50)                    not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   TEST1_THIRD_COLUMN      DATE,
   constraint PK_TABLE_TEST1 primary key (TEST1_FIRST_COLUMN)
         using index
       tablespace TBS_INDEX
       storage
       (
           initial 100K
           next 100K
       )
)
storage
(
    initial 100K
    next 100K
)
tablespace TBS_DATA;

create table TABLE_TEST2 (
   TEST2_FIRST_COLUMN      NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   TEST2_SECOND_COLUMN     VARCHAR2(50)                    not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   TEST2_THIRD_COLUMN      DATE,
   TEST1_FIRST_COLUMN      NUMBER(4)                       not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,
   constraint PK_TABLE_TEST2 primary key (TEST2_FIRST_COLUMN)
         using index
       tablespace TBS_INDEX
       storage
       (
           initial 100K
           next 100K
       )
)
storage
(
    initial 100K
    next 100K
)
tablespace TBS_DATA;

alter table TABLE_TEST2
   add constraint TABLE_TEST2__TABLE_TEST1 foreign key (TEST1_FIRST_COLUMN)
      references TABLE_TEST1 (TEST1_FIRST_COLUMN);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;My reverse engineering code:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ini_set(&apos;display_errors&apos;, 1);
set_include_path(realpath(__DIR__ . &apos;/../doctrine-orm/lib/&apos;));

require &apos;Doctrine/Common/&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;.php&apos;;
$classLoader = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\&lt;span class=&quot;code-object&quot;&gt;ClassLoader&lt;/span&gt;(&apos;Doctrine&apos;, realpath(__DIR__ . &apos;/../doctrine-orm/lib/&apos;));
$classLoader-&amp;gt;register();

$config = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Configuration;
$cache = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Cache\ApcCache;
$config-&amp;gt;setMetadataCacheImpl($cache);
$driverImpl = $config-&amp;gt;newDefaultAnnotationDriver(realpath(__DIR__. &apos;/Infofab/Entities&apos;));
$config-&amp;gt;setMetadataDriverImpl($driverImpl);
$config-&amp;gt;setQueryCacheImpl($cache);
$config-&amp;gt;setProxyDir(&apos;Proxies&apos;);
$config-&amp;gt;setProxyNamespace(&apos;Infofab&apos;);
$connectionOptions = array(
    &apos;dbname&apos; =&amp;gt; &apos;bddmkk&apos;,
    &apos;user&apos; =&amp;gt; &apos;doctrine&apos;,
    &apos;password&apos; =&amp;gt; &apos;xxxxxxx&apos;,
    &apos;host&apos; =&amp;gt; &apos;localhost&apos;,
    &apos;driver&apos; =&amp;gt; &apos;pdo_oci&apos;,
    &apos;driverOptions&apos; =&amp;gt; array(PDO::ATTR_CASE =&amp;gt; PDO::CASE_LOWER)
);

$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);

$sm = $em-&amp;gt;getConnection()-&amp;gt;getSchemaManager();

$em-&amp;gt;getConfiguration()-&amp;gt;setMetadataDriverImpl(
    &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Mapping\Driver\DatabaseDriver(
        $em-&amp;gt;getConnection()-&amp;gt;getSchemaManager()
    )
);

$cmf = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Tools\DisconnectedClassMetadataFactory($em);
$metadata = $cmf-&amp;gt;getAllMetadata();

$cme = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Tools\Export\ClassMetadataExporter();
$exporter = $cme-&amp;gt;getExporter(&apos;annotation&apos;, &apos;Infofab&apos;);
$exporter-&amp;gt;setMetadata($metadata);
$etg = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\Tools\EntityGenerator;
$exporter-&amp;gt;setEntityGenerator($etg);
$exporter-&amp;gt;export();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I run this code, I obtain 2 entities:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * TableTest1
 *
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TABLE_TEST1&quot;&lt;/span&gt;)
 * @Entity
 */
class TableTest1
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $test1FirstColumn
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST1_FIRST_COLUMN&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     * @Id
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
     * @SequenceGenerator(sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;TABLE_TEST1_TEST1_FIRST_COLUMN&quot;&lt;/span&gt;, allocationSize=&lt;span class=&quot;code-quote&quot;&gt;&quot;10&quot;&lt;/span&gt;, initialValue=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $test1FirstColumn;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $test1SecondColumn
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST1_SECOND_COLUMN&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=50, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $test1SecondColumn;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; datetime $test1ThirdColumn
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST1_THIRD_COLUMN&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $test1ThirdColumn;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * TableTest2
 *
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TABLE_TEST2&quot;&lt;/span&gt;)
 * @Entity
 */
class TableTest2
{
    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $test2FirstColumn
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST2_FIRST_COLUMN&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     * @Id
     * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
     * @SequenceGenerator(sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;TABLE_TEST2_TEST2_FIRST_COLUMN&quot;&lt;/span&gt;, allocationSize=&lt;span class=&quot;code-quote&quot;&gt;&quot;10&quot;&lt;/span&gt;, initialValue=&lt;span class=&quot;code-quote&quot;&gt;&quot;1&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $test2FirstColumn;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; integer $test1FirstColumn
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST1_FIRST_COLUMN&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $test1FirstColumn;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string $test2SecondColumn
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST2_SECOND_COLUMN&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, length=50, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $test2SecondColumn;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; datetime $test2ThirdColumn
     *
     * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST2_THIRD_COLUMN&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;datetime&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $test2ThirdColumn;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; TABLETEST1
     *
     * @OneToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;TABLETEST1&quot;&lt;/span&gt;)
     * @JoinColumns({
     *   @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST1_FIRST_COLUMN&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;TEST1_FIRST_COLUMN&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $tEST1FIRSTCOLUMN;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, it declares 2 times the same column: private $test1FirstColumn; and private $tEST1FIRSTCOLUMN;&lt;/p&gt;</description>
                <environment>Ubuntu 10.04 + Oracle 11g Entreprise + PHP 5.3.2 + Doctrine2 Git (up-to-date)</environment>
            <key id="11425">DDC-616</key>
            <summary>Reverse engineering with Oracle</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="mikaelkael">Mickael Perraud</reporter>
                        <labels>
                    </labels>
                <created>Sat, 29 May 2010 09:53:50 +0000</created>
                <updated>Sun, 20 Jun 2010 13:35:02 +0000</updated>
                    <resolved>Sun, 20 Jun 2010 13:35:02 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13301" author="beberlei" created="Sun, 13 Jun 2010 14:13:31 +0000"  >&lt;p&gt;Fixed and scheduled for BETA 3&lt;/p&gt;</comment>
                    <comment id="13304" author="mikaelkael" created="Sun, 13 Jun 2010 16:45:36 +0000"  >&lt;p&gt;Something is broken with your commit:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Fatal error: Uncaught exception &apos;Doctrine\ORM\Mapping\MappingException&apos; with message &apos;No identifier/primary key specified &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; Entity &apos;OUTILLAGE_OPERATION_COLLECTE&apos;. Every Entity must have an identifier/primary key.&apos; in /mkk01/doctrine/doctrine-orm/lib/Doctrine/ORM/Mapping/MappingException.php on line 37

Doctrine\ORM\Mapping\MappingException: No identifier/primary key specified &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; Entity &apos;OUTILLAGE_OPERATION_COLLECTE&apos;. Every Entity must have an identifier/primary key. in /mkk01/doctrine/doctrine-orm/lib/Doctrine/ORM/Mapping/MappingException.php on line 37
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In file &apos;lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php &apos; (&lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/b7db8df7efed4517859be562fd58e6ce4cc6354a&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/b7db8df7efed4517859be562fd58e6ce4cc6354a&lt;/a&gt;) around line 86, the iteration is not complete and it is not able to define the primary key&lt;/p&gt;</comment>
                    <comment id="13305" author="beberlei" created="Sun, 13 Jun 2010 17:10:08 +0000"  >&lt;p&gt;It seems the detection of many to many tables can cause severe problems. Some internal refactoring has to be done to get this reverse-engineering right.&lt;/p&gt;</comment>
                    <comment id="13380" author="beberlei" created="Sun, 20 Jun 2010 13:35:02 +0000"  >&lt;p&gt;This should now be finally solved. Many-To-Many tables are detected and supported in reverse engineering now.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11456">DDC-627</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-614] Multiple Entities in FROM clause throws exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-614</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When I query,&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT k, d FROM OneMind\Domain\Sales\Kendaraan k, OneMind\Domain\Sales\DeliveryOrder d
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;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;SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; table &lt;span class=&quot;code-quote&quot;&gt;&quot;d1_&quot;&lt;/span&gt; 
LINE 1: ...gan AS pelanggan8, k0_.keterangan AS keterangan9, d1_.id AS ... ^ 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;then I try to var_dump the sql:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT k0_.id AS id0, k0_.tipe_kendaraan AS tipe_kendaraan1, k0_.warna AS warna2, k0_.no_rangka AS no_rangka3,
 k0_.no_mesin AS no_mesin4, k0_.tahun AS tahun5, k0_.rrn AS rrn6, k0_.salesman AS salesman7, k0_.pelanggan AS 
pelanggan8, k0_.keterangan AS keterangan9, d1_.id AS id10, d1_.nomor AS nomor11, d1_.tanggal AS tanggal12, 
d1_.kode_supplier AS kode_supplier13, d1_.tipe_kendaraan AS tipe_kendaraan14, d1_.warna AS warna15, 
d1_.no_rangka AS no_rangka16, d1_.no_mesin AS no_mesin17, d1_.tahun AS tahun18, d1_.harga_beli AS harga_beli19, 
d1_.no_sap AS no_sap20, d1_.tgl_sap AS tgl_sap21, d1_.dpp AS dpp22, d1_.ppn_masuk AS ppn_masuk23, d1_.bunga 
AS bunga24, d1_.jatuh_tempo AS jatuh_tempo25, d1_.rrn AS rrn26 FROM kendaraan k0_

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

&lt;p&gt;Only the first entity appears in SQL FROM clause. The second one is missing. It is likely affect JOIN as well.&lt;/p&gt;</description>
                <environment>PostgreSql 8.4</environment>
            <key id="11421">DDC-614</key>
            <summary>Multiple Entities in FROM clause throws exception</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="andyajadeh">Andy Aja deh</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 May 2010 08:45:25 +0000</created>
                <updated>Tue, 20 Jul 2010 00:11:32 +0000</updated>
                    <resolved>Tue, 20 Jul 2010 00:11:32 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13549" author="felixjendrusch" created="Fri, 9 Jul 2010 11:21:41 +0000"  >&lt;p&gt;&lt;b&gt;PDOException&lt;/b&gt;&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;SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table &quot;t2_&quot; LINE 1: ...N terminal_file t1_ ON f0_.id = t1_.file_ref AND (t2_.id IN ... ^&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Join&lt;/b&gt;&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;                        $qb-&amp;gt;innerJoin(&apos;f.terminals&apos;, &apos;cts&apos;, Expr\Join::WITH,
                                $qb-&amp;gt;expr()-&amp;gt;in(&apos;cts.terminalRef.id&apos;, array_map(function($value) {
                                    return (integer) $value;
                                }, (array) $value)));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;DQL&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT f FROM [...]\File f INNER JOIN f.terminals cts WITH cts.terminalRef.id IN(5) [...]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;SQL&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT [...] FROM file f0_ INNER JOIN terminal_file t1_ ON f0_.id = t1_.file_ref AND (t2_.id IN (5)) INNER JOIN terminal t2_ ON t1_.terminal_ref = t2_.id [...]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

</comment>
                    <comment id="13614" author="guilhermeblanco" created="Tue, 20 Jul 2010 00:11:32 +0000"  >&lt;p&gt;On &lt;a href=&quot;http://github.com/doctrine/doctrine2/commit/2c28872af820a27b36e4ff3ca28ef92ea8c1f0f3&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/commit/2c28872af820a27b36e4ff3ca28ef92ea8c1f0f3&lt;/a&gt; this issue was fixed.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="11431">DDC-620</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-613] QueryBuilder doesn&apos;t permit any functions in select()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-613</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Example:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;        $expr = $qb-&amp;gt;expr();
        $qb-&amp;gt;select($expr-&amp;gt;count(&apos;e.id&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;InvalidArgumentException: Expression of type &apos;Doctrine\ORM\Query\Expr\Func&apos; not allowed in this context.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11417">DDC-613</key>
            <summary>QueryBuilder doesn&apos;t permit any functions in select()</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="hobodave">David Abdemoulaie</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 May 2010 21:34:50 +0000</created>
                <updated>Wed, 16 Jun 2010 11:55:54 +0000</updated>
                    <resolved>Wed, 16 Jun 2010 11:55:54 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-611] Clearing APC cache is broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-611</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When running ./doctrine orm:clear-cache with the APC cache, it simply won&apos;t work because the cache is not shared between the different PHP processes.&lt;/p&gt;

&lt;p&gt;So, the php instance run by ./doctrine and the one run by apache are different and won&apos;t share their cache. This is an APC feature.&lt;/p&gt;

&lt;p&gt;A workaround is needed, other than calling it via apache, or simply remove it. And write it in the documentation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11405">DDC-611</key>
            <summary>Clearing APC cache is broken</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="artefact2">Romain D.</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 May 2010 13:29:35 +0000</created>
                <updated>Mon, 28 Jun 2010 17:36:28 +0000</updated>
                    <resolved>Mon, 28 Jun 2010 17:36:28 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13450" author="beberlei" created="Mon, 28 Jun 2010 17:36:28 +0000"  >&lt;p&gt;Fixed, throwing an exception now&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-600] Persisting Entities with unmanaged related associations produces ugly notices</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-600</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It often happens that you forget to persist related entities during development, producing ugly notices about $object hash not being part of certain arrays, for example in &quot;getEntityIdentifier&quot;.&lt;/p&gt;

&lt;p&gt;Maybe this can be gracefully intercepted without cluttering the code?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11386">DDC-600</key>
            <summary>Persisting Entities with unmanaged related associations produces ugly notices</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>Tue, 18 May 2010 15:15:07 +0000</created>
                <updated>Sat, 24 Jul 2010 03:58:13 +0000</updated>
                    <resolved>Wed, 7 Jul 2010 18:34:43 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                            <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="11677">DDC-718</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-596] Add @DiscriminatorMap validation to orm:validate-schema</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-596</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Assuming that all child classes of an @InheritanceType(&quot;SINGLE_TABLE&quot;) and @InheritanceType(&quot;JOINED&quot;) table should be defined in the topmost parent&apos;s @DiscriminatorMap, it would be very helpful to add this validation to the CLI orm:valdiate-schema.&lt;/p&gt;

&lt;p&gt;At present, if a child table is defined in the topmost table @DiscriminatorMap on a SINGLE_TABLE inheritance, then orm:validate-schema states that the mapping files are correct but then a Doctrine\DBAL\Schema\SchemaException is thrown.  The same exception is also thrown for other schema-tool commands (such as &apos;create&apos;).&lt;/p&gt;

&lt;p&gt;Haven&apos;t tested what happens on a JOINED table..&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/**
 * @Entity @InheritanceType(&quot;SINGLE_TABLE&quot;)
 * @DiscriminatorColumn(name=&quot;discr&quot;, type=&quot;string&quot;)
 * @DiscriminatorMap({&quot;employee&quot; = &quot;Employee&quot;})   // note, the second child table was accidentally omitted here
 */
class Person
{
    // ...
}

/**
 * @Entity
 */
class Employee extends Person
{
    // ...
}

/**
 * @Entity
 */
class Customer extends Person
{
    // ....
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Schema tool commands (create, validate-schema) then throw:&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;  [Doctrine\DBAL\Schema\SchemaException]
  The table with name &apos;person&apos; already exists.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;... and orm:validate-schema actually says that the mapping is correct (which it obviously isn&apos;t) before throwing the exception:&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;[Mapping]  OK - The mapping files are correct.

  [Doctrine\DBAL\Schema\SchemaException]
  The table with name &apos;person&apos; already exists.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Not critical since the mapping is obviously wrong here, but having this extra check in the validator could save a lot of debugging time.  A duplicate table name error is confusing in this situation, and it seems wrong that the validate-schema command presently reports that the mapping files are correct when in fact the inheritance is broken.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11375">DDC-596</key>
            <summary>Add @DiscriminatorMap validation to orm:validate-schema</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="mjh_ca">Marc Hodgins</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 May 2010 00:35:09 +0000</created>
                <updated>Sat, 10 Jul 2010 03:13:23 +0000</updated>
                    <resolved>Sat, 10 Jul 2010 03:13:23 +0000</resolved>
                            <version>2.0-BETA2</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12982" author="romanb" created="Mon, 17 May 2010 04:59:01 +0000"  >&lt;p&gt;Note: Not &lt;b&gt;all&lt;/b&gt; child classes must be specified, only those that are &lt;b&gt;entities&lt;/b&gt;. You can have non-mapped as well as mapped-superclasses as subclasses as well.&lt;/p&gt;</comment>
                    <comment id="13470" author="beberlei" created="Wed, 30 Jun 2010 16:07:43 +0000"  >&lt;p&gt;The validation task to perform here would be:&lt;/p&gt;

&lt;p&gt;Throw a warning if there exists and entity that extends the Parentclass, is however not part of the DiscriminatorMap&lt;/p&gt;</comment>
                    <comment id="13559" author="beberlei" created="Sat, 10 Jul 2010 03:13:23 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-591] Support Pessimistic Locks for Entities with a JoinedSubclassPersister</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-591</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Support Pessimistic Locks for Entities with a JoinedSubclassPersister&lt;/p&gt;</description>
                <environment></environment>
            <key id="11366">DDC-591</key>
            <summary>Support Pessimistic Locks for Entities with a JoinedSubclassPersister</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="10518">DDC-178</parent>
                        <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>Sat, 15 May 2010 04:31:08 +0000</created>
                <updated>Sun, 4 Jul 2010 08:38:21 +0000</updated>
                    <resolved>Sun, 4 Jul 2010 08:38:21 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13508" author="beberlei" created="Sun, 4 Jul 2010 08:38:21 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-577] Change default allocationSize from 10 to 1</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-577</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I propose to change the default value of  allocationSize for sequence columns from current 10 to 1. It&apos;s defined in  $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;allocationSize&amp;#39;&amp;#93;&lt;/span&gt;  in Doctrine/ORM/Mapping/ClassMetaFactory.php.&lt;/p&gt;

&lt;p&gt;The improvement request is based on detailed discussion on &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-569?focusedCommentId=12855&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12855&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-569?focusedCommentId=12855&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12855&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Current default value for allocationSize=10 is CONFUSING and I am sure it will cause problems and misunderstoods for many people in future.&lt;/p&gt;

&lt;p&gt;The core of the problem is that lot of people define table structure manually, separately from entity annotations. And while the default allocationSize is 10, they have to remember (and they have to know they should remember) each time they write new table and new entity, that:&lt;/p&gt;

&lt;p&gt;a) They have to define each the sequence in database manually with INCREMENT BY 10&lt;br/&gt;
b) OR they have to define in each entity manually the annotation for @SequenceGenerator - allocationSize=1&lt;br/&gt;
c) OR they have to manually use strategy=&quot;IDENTITY&quot;, but it&apos;s primarily related to primary keys, not to all sequences at general.&lt;/p&gt;

&lt;p&gt;Shortly, in an intuitive way everybody assumes the behaviour as allocationSize would be 1. Current default value 10 is not in accord with this intuitive perception and will cause many questions and misunderstoods.&lt;/p&gt;

&lt;p&gt;The &quot;preloading&quot; of 10 values at once is a kind of &quot;advanced optimalization&quot; - it&apos;s great it is available and implemented - but it should not be applied automatically, but only after explicit setup.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11332">DDC-577</key>
            <summary>Change default allocationSize from 10 to 1</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jantichy">Jan Tich&#253;</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 May 2010 08:34:41 +0000</created>
                <updated>Thu, 12 Aug 2010 00:09:19 +0000</updated>
                    <resolved>Sun, 13 Jun 2010 14:12:58 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13106" author="romanb" created="Sat, 5 Jun 2010 07:03:16 +0000"  >&lt;p&gt;This should be changed for BETA3.&lt;/p&gt;</comment>
                    <comment id="13299" author="beberlei" created="Sun, 13 Jun 2010 14:12:58 +0000"  >&lt;p&gt;Fixed and scheduled for 2.0 BETA 3&lt;/p&gt;</comment>
                    <comment id="13925" author="guilhermeblanco" created="Thu, 12 Aug 2010 00:09:19 +0000"  >&lt;p&gt;Actually patch was only committed now.&lt;/p&gt;

&lt;p&gt;&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-575] Ignoring some annotations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-575</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Some placement of handler annotation is ignored.&lt;/p&gt;

&lt;p&gt;PrePersist is ignored:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
 * @PrePersist
 *
 * Will trigger error.
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function error()
{
	trigger_error(&apos;ERROR&apos;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;PrePersist works 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;/**
 * @PrePersist
 * @foo
 *
 * Will trigger error.
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function error()
{
	trigger_error(&apos;ERROR&apos;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11329">DDC-575</key>
            <summary>Ignoring some annotations</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="5">Cannot Reproduce</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="drevolution">V&#225;clav Novotn&#253;</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 May 2010 05:30:12 +0000</created>
                <updated>Fri, 9 Jul 2010 17:15:56 +0000</updated>
                    <resolved>Fri, 9 Jul 2010 17:15:43 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13482" author="romanb" created="Thu, 1 Jul 2010 14:58:16 +0000"  >&lt;p&gt;Is this issue still valid? Is Doctrine Common Beta3 still affected? or is it an ORM issue?&lt;/p&gt;</comment>
                    <comment id="13553" author="beberlei" created="Fri, 9 Jul 2010 17:15:43 +0000"  >&lt;p&gt;Cannot reproduce, i have added a test-case that shows exactly the described code:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/common/commit/3b42776ada70cf4161082c155f5d8ba9326ce674&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/common/commit/3b42776ada70cf4161082c155f5d8ba9326ce674&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However here the relevant annotation is detected correctly in both cases.&lt;/p&gt;

&lt;p&gt;Closed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10595" name="example.tar.gz" size="1186" author="drevolution" created="Fri, 7 May 2010 05:30:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-555] @ManyToMany - curious behaviour - assigned values toggle</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-555</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;BUG: &lt;br/&gt;
the entries in M:N table article_categories toggle&lt;/p&gt;

&lt;p&gt;SOLUTION: &lt;br/&gt;
extra flush entry at &lt;span class=&quot;error&quot;&gt;&amp;#91;*&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Code:&lt;br/&gt;
&amp;#8212;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$article = $em-&amp;gt;find(&apos;Entity\Blog\Article&apos;, 1);

printf(&lt;span class=&quot;code-quote&quot;&gt;&quot;-- %s\n&quot;&lt;/span&gt;, count($article-&amp;gt;getCategories()));

$article-&amp;gt;getCategories()-&amp;gt;clear();
&lt;span class=&quot;code-comment&quot;&gt;//$em-&amp;gt;flush(); // [*]
&lt;/span&gt;
foreach(array(4) as $id)$article-&amp;gt;getCategories()-&amp;gt;add(
            $em-&amp;gt;getReference(&apos;Entity\Blog\Category&apos;, $id)
        );

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

&lt;p&gt;===&lt;/p&gt;

&lt;p&gt;Entities:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Article
{
/**
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity\Blog\Category&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;articles&quot;&lt;/span&gt;)
     * @JoinTable(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;article_category&quot;&lt;/span&gt;,
     *             joinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fk_article&quot;&lt;/span&gt;,  referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&quot;&lt;/span&gt;)},
     *      inverseJoinColumns={@JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fk_category&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&quot;&lt;/span&gt;)}
     * )
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $categories;
}

class Category
{
    /**
     * @ManyToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Entity\Blog\Article&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;categories&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $articles;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;tried to apply cascade=&lt;/p&gt;
{&quot;all&quot;}
&lt;p&gt;, but has no effect.&lt;/p&gt;</description>
                <environment>ubuntu x86_64&lt;br/&gt;
&lt;br/&gt;
PHP Version 5.3.2-0.dotdeb.2 (/etc/apt/sources.list: deb &lt;a href=&quot;http://php53.dotdeb.org&quot;&gt;http://php53.dotdeb.org&lt;/a&gt; stable all)&lt;br/&gt;
&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2010 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.31, Copyright (c) 2007-2010, by SektionEins GmbH</environment>
            <key id="11290">DDC-555</key>
            <summary>@ManyToMany - curious behaviour - assigned values toggle</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="jellobird">Romeo Disca</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Apr 2010 14:52:29 +0000</created>
                <updated>Sat, 3 Jul 2010 13:40:34 +0000</updated>
                    <resolved>Sat, 3 Jul 2010 13:40:34 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12779" author="beberlei" created="Thu, 29 Apr 2010 15:44:12 +0000"  >&lt;p&gt;I dont understand this issue, can you please elaborate what exactly is wrong?&lt;/p&gt;</comment>
                    <comment id="12790" author="jellobird" created="Fri, 30 Apr 2010 08:18:30 +0000"  >&lt;p&gt;To be more verbose:&lt;/p&gt;

&lt;p&gt;I have two tables article and category.&lt;br/&gt;
These tables are connected via a m:n-relationship with table article_category.&lt;/p&gt;

&lt;p&gt;You can see the entity configuration snippets within the code Entities.&lt;/p&gt;

&lt;p&gt;To reconstruct this bug, set up your database with these 3 tables. Put in some data, but keep the table article_category empty.&lt;/p&gt;

&lt;p&gt;Now, with an properly configured entity manager, you can execute the displayed code.&lt;/p&gt;

&lt;p&gt;There is a line &lt;blockquote&gt;&lt;p&gt;printf(&quot;-- %s\n&quot;, count($article-&amp;gt;getCategories()));&lt;/p&gt;&lt;/blockquote&gt; which shows the number of categories connected with one article.&lt;/p&gt;

&lt;p&gt;Please adjust array(4) to use valid category primary keys.&lt;/p&gt;

&lt;p&gt;You will notice, as a result of this script, that sequential uses will produce &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;-- 0
-- n
-- 0
-- n
-- 0
... 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;with n the number of categories you add. it will be 1 in this example (see: array(4))&lt;/p&gt;

&lt;p&gt;If you check the database between the runs, you will notice that the table article_categories is filled, empty, filled, empty, filled, ... corresponding to the script results.&lt;/p&gt;

&lt;p&gt;SOLUTION: You can solve this with one extra line: &lt;/p&gt;
&lt;div class=&quot;code panel&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;span class=&quot;code-comment&quot;&gt;// [*]&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think the described behavior is not intended.&lt;/p&gt;</comment>
                    <comment id="13486" author="beberlei" created="Thu, 1 Jul 2010 18:14:56 +0000"  >&lt;p&gt;The problem is that clear() is actually scheduling the deletion of the whole colleciton. This is a completly different operation compared 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;foreach ($col AS $obj) {
    $col-&amp;gt;removeElement($obj);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you do it this way and than re-add some of the objects, those associations will not be changed.&lt;/p&gt;

&lt;p&gt;clear() however deletes all, then adds the new ones. again&lt;/p&gt;</comment>
                    <comment id="13499" author="beberlei" created="Sat, 3 Jul 2010 08:19:09 +0000"  >&lt;p&gt;Verified as a bug though.&lt;/p&gt;</comment>
                    <comment id="13500" author="jellobird" created="Sat, 3 Jul 2010 12:47:44 +0000"  >&lt;p&gt;I see.&lt;/p&gt;

&lt;p&gt;I suggest an additional method:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeElements() { ... }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-665&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-665&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13501" author="beberlei" created="Sat, 3 Jul 2010 13:40:34 +0000"  >&lt;p&gt;Not necessary, this was actually a bug. It should be fixed in the current master.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-544] Extract Interface on Doctrine\ORM\Repository</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-544</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;There should be an interface composed of all the methods on the Repository, so that in userland you can do something like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; IMyRepository &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine\ORM\IEntityRepository
{

}

class MyRepository &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine\ORM\EntityRepository &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; IMyRepository
{

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

&lt;p&gt;That way in your code you could type-hint for IMyRepository, or for the EntityRepository Interface even and it would be indefinately easier to mock or replace the implementation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11274">DDC-544</key>
            <summary>Extract Interface on Doctrine\ORM\Repository</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="2">Won&apos;t Fix</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Apr 2010 05:37:17 +0000</created>
                <updated>Tue, 9 Apr 2013 18:57:24 +0000</updated>
                    <resolved>Fri, 9 Jul 2010 17:37:22 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12770" author="romanb" created="Wed, 28 Apr 2010 04:10:27 +0000"  >&lt;p&gt;To match our naming conventions that should rather be: interface EntityRepository and the old EntityRepository =&amp;gt; BasicEntityRepository or similar.&lt;/p&gt;</comment>
                    <comment id="12835" author="shurakai" created="Tue, 4 May 2010 10:35:39 +0000"  >&lt;p&gt;Roman, do you mean that we should rename the file (and class) EntityRepository to BasicEntityRepository and create a new EntityRepository that contains an interface EntityRepository?&lt;/p&gt;

&lt;p&gt;If you want me to, I could do this.&lt;/p&gt;

&lt;p&gt;Regards&lt;br/&gt;
Christian&lt;/p&gt;</comment>
                    <comment id="12995" author="romanb" created="Wed, 19 May 2010 06:30:35 +0000"  >&lt;p&gt;@Christian: Yes, thats what I meant. I will schedule this for BETA3 though. I want BETA2 to be a smooth upgrade without any BC issues, if possible.&lt;/p&gt;</comment>
                    <comment id="13284" author="romanb" created="Sun, 13 Jun 2010 03:50:58 +0000"  >&lt;p&gt;I am wondering whether this is really necessary? There are not many methods on EntityRepository and its easy to create your own interface(s) for your repositories that include these few methods. To be consistent with our naming standards there would have to be a bc break which seems unnecessary to me, unless we invent some other name for the interface, i.e. &quot;ObjectRepository&quot;.&lt;/p&gt;</comment>
                    <comment id="13555" author="beberlei" created="Fri, 9 Jul 2010 17:37:22 +0000"  >&lt;p&gt;Wont fix&lt;/p&gt;</comment>
                    <comment id="19958" author="saem" created="Mon, 8 Apr 2013 18:51:48 +0000"  >&lt;p&gt;It&apos;s unfortunate this wasn&apos;t implemented, it&apos;s actually a significant issue for us. I have to say I completely disagree with Roman&apos;s reasoning in his last comment.&lt;/p&gt;

&lt;p&gt;We have a very large database and commensurately many repositories. We&apos;re now at a point that we need to fire our own application level events (as an example, we end up having to compose in services a lot), some of them originating within repositories (doctrine events are insufficient, and we need application specific ones). We&apos;re using Symfony2 for DIC and build repositories not through doctrine but via services. We consider using setter injection to be a significant anti-pattern, an object should be valid/fully-initialized post construction so we&apos;d rather not do that &amp;#8211; if you were wondering. Now for all our repositories that we would like to build in extra functionality we create our own repository class, compose in the doctrine repository and implement the interface by convention (we could write our own, but the mileage sucks). Now where we could have passed in an instance of anything obeying that interface we&apos;re stuck (there goes type hinting). We can avoid some drudgery through traits but it&apos;s still an unfortunate solution.&lt;/p&gt;

&lt;p&gt;If this is at all possible (even if it has a less than ideal name), we&apos;d very much appreciate this, thank you.&lt;/p&gt;

&lt;p&gt;PS. A BC break in beta would have been very easy and now it sucks even more.&lt;/p&gt;</comment>
                    <comment id="19959" author="ocramius" created="Mon, 8 Apr 2013 18:57:52 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=saem&quot; class=&quot;user-hover&quot; rel=&quot;saem&quot;&gt;Saem Ghani&lt;/a&gt; there is such an interface in doctrine common. Check Doctrine\Common\Persistence\ObjectRepository at &lt;a href=&quot;https://github.com/doctrine/common/blob/2.3.2/lib/Doctrine/Common/Persistence/ObjectRepository.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/common/blob/2.3.2/lib/Doctrine/Common/Persistence/ObjectRepository.php&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19960" author="saem" created="Mon, 8 Apr 2013 19:15:57 +0000"  >&lt;p&gt;Marco: I&apos;m afraid that is incomplete. EntityRepository has a number of methods that fall outside of the scope of those prototyped in ObjectRepository and Selectable interfaces that it implements.&lt;/p&gt;</comment>
                    <comment id="19961" author="beberlei" created="Mon, 8 Apr 2013 19:43:25 +0000"  >&lt;p&gt;Why don&apos;t you ship your own layer of repositories and disregard the Doctrine ones completly? I do that all the time, and then constructor injection is very simple as well.&lt;/p&gt;</comment>
                    <comment id="19962" author="saem" created="Mon, 8 Apr 2013 20:08:29 +0000"  >&lt;p&gt;Because the repositories provide features we use. Reusing/staying close to Symfony/Doctrine makes it easier to learn/train, and gives us herd immunity benefits around shared knowledge and most importantly testing. We&apos;re trying to reduce maintenance burden, this interface would not only help us do that but anyone else in a similar situation. Additionally, we have many projects most of them large, going across them we&apos;ve got something like 400+ tables.&lt;/p&gt;</comment>
                    <comment id="19964" author="ocramius" created="Mon, 8 Apr 2013 21:22:28 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=saem&quot; class=&quot;user-hover&quot; rel=&quot;saem&quot;&gt;Saem Ghani&lt;/a&gt; your last comment does not really provide any rationale behind extraction of the remaining methods into an interface. There&apos;s no advantage in extracting those methods to an own interface. createQueryBuilder, createResultSetMappingBuilder, createNamedQuery, createNativeNamedQuery, clear, __call, getEntityManager, getClassMetadata are all utility methods that are not good candidates for an interface. You can easily re-implement those on an existing entity manager.&lt;/p&gt;

&lt;p&gt;Just use the Doctrine\Common\Persistence\ObjectRepository API: you should actually stick to that to increase portability across the various object managers in doctrine project.&lt;/p&gt;

&lt;p&gt;If you need all those methods too, you are looking for inheritance, not composition (and probably are delegating too much responsibility to the repository).&lt;/p&gt;</comment>
                    <comment id="19967" author="saem" created="Tue, 9 Apr 2013 18:57:24 +0000"  >&lt;p&gt;Marco, rather than looking at each comment in isolation (which is what seems to be happening), please take things in aggregate. I&apos;ve provided the rationale in previous comments. If you require more information I can clarify further.&lt;/p&gt;

&lt;p&gt;Extracting as an interface would:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Make it easier to make mocks during testing (right now a mock EntityManager and ClassMetadata instance must also be mocked out), this is significant friction/noise during testing&lt;/li&gt;
	&lt;li&gt;Allow people to compose as opposed to inherit, especially important when you have features that are specific to relational stores&lt;/li&gt;
	&lt;li&gt;We have Entities that are represented by data in the database AND on the file system. All of a sudden inheriting from a doctrine EntityRepository makes just as much sense as inheriting from a FileSystemRepository (of our own making). All the while the responsibility is the same, load/store of Entities, the finders/query methods still make sense.&lt;/li&gt;
	&lt;li&gt;At the same time the finder API is very useful (duplicating the code would suck, as was suggested earlier), but having to manually maintain that contract with each doctrine release is an unnecessary burden, not just for us, but anyone else in our predicament&lt;/li&gt;
	&lt;li&gt;Creating our own interface means we can&apos;t abstract over 3rd party repositories provided by other bundles.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

&lt;span class=&quot;code-comment&quot;&gt;// This &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; InvalidArgumentException: The given entity has no identity. in D:\Projects\ORM\flextrine2\flextrine\web\lib\Doctrine\ORM\UnitOfWork.php on line 1014
&lt;/span&gt;$em-&amp;gt;merge($patient);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDENTITY&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
	
    /** @Column(length=100, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
	
	/**
     * @OneToMany(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;Patient&quot;&lt;/span&gt;, mappedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;doctor&quot;&lt;/span&gt;, fetch=&lt;span class=&quot;code-quote&quot;&gt;&quot;EAGER&quot;&lt;/span&gt;)
     */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $patients;
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct() {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;patients = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
	}
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

&lt;p&gt;The following should work:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// Merge detached patient
&lt;/span&gt;$managedPatient = $em-&amp;gt;merge($patient);

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

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

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

&lt;p&gt;Note that the part within the stars that creates the unmanaged doctor and the detached patient simulates exactly what is received by Doctrine in my application so I can&apos;t put any merges in here.&lt;/p&gt;

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DDC-501] Merging entities that contained unloaded proxy collections will delete those associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-501</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If loading an entity without its -to-many-collections, detaching and merging it back WITHOUT having touched those associations will result in two strange behaviours:&lt;/p&gt;

&lt;p&gt;oneToMany (bidrectional, mapped by loaded entity): After merge the collection remains empty. Flushing EM and reloading entity will reveal associated entities again&lt;/p&gt;

&lt;p&gt;manyToMany (bidirectional, mapped by targeted entity): After merge the collection remains empty. Flushing EM will physically delete associations.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;----------------- !! NOTE !! --------------------&lt;/li&gt;
	&lt;li&gt;To reproduce the manyToMany-Bug it&apos;s necessary&lt;/li&gt;
	&lt;li&gt;to cascade &quot;merge&quot; on cmUser::groups&lt;/li&gt;
	&lt;li&gt;-------------------------------------------------&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>PHP-Version 5.3.2&lt;br/&gt;
PHPUnit-Version 3.4.11&lt;br/&gt;
PDO Driver for MySQL, client library version =&amp;gt; 5.0.83&lt;br/&gt;
&lt;a href=&apos;mailto:doctrine-trunk@7546&apos;&gt;doctrine-trunk@7546&lt;/a&gt;&lt;br/&gt;
Kubuntu 9.10 / 32bit&lt;br/&gt;
</environment>
            <key id="11191">DDC-501</key>
            <summary>Merging entities that contained unloaded proxy collections will delete those 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="markus.woessner">Markus W&#246;&#223;ner</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Apr 2010 15:33:36 +0000</created>
                <updated>Thu, 1 Jul 2010 17:50:33 +0000</updated>
                    <resolved>Thu, 1 Jul 2010 17:50:33 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12607" author="markus.woessner" created="Thu, 8 Apr 2010 15:34:48 +0000"  >&lt;p&gt;Forgot to tell trunk revision&lt;/p&gt;</comment>
                    <comment id="12925" author="shurakai" created="Wed, 12 May 2010 10:35:57 +0000"  >&lt;p&gt;This issue is mainly caused by the entity not being initialized before serialization. Additionally, the PersistenCollection does loose all information that is needed to regain the kept entities because the collection itself is not initialized before serialization.&lt;/p&gt;

&lt;p&gt;I&apos;ve added an initialization call here &lt;a href=&quot;http://github.com/Shurakai/doctrine2/commit/6c185a2891111dfbd83d381bad8c5a2b16536cad#diff-0&quot; class=&quot;external-link&quot;&gt;http://github.com/Shurakai/doctrine2/commit/6c185a2891111dfbd83d381bad8c5a2b16536cad#diff-0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, I&apos;m not sure whether this is the best solution. Any thoughts?&lt;/p&gt;</comment>
                    <comment id="12932" author="romanb" created="Thu, 13 May 2010 05:38:57 +0000"  >&lt;p&gt;@Christian: I looked at the testcase you committed there and the assumptions it makes are not correct. The original test case provided by Markus made the right assumptions, that is, after the user is unserialized it can and should not know about its groups or phonenumbers since these were not serialized.&lt;br/&gt;
When you serialize an entity, you serialize a partial snapshot of its state. When you unserialize it you have all the state that was loaded prior to serialization but you can not get at the rest, the object is detached from the rest of the object graph. Thats where merge() comes in, it reattaches a detached entity to a managed environment where associations can be lazy-loaded, state changes are tracked, etc.&lt;/p&gt;

&lt;p&gt;So the problem must come later, at the point of merging.&lt;/p&gt;</comment>
                    <comment id="13095" author="romanb" created="Thu, 3 Jun 2010 05:41:05 +0000"  >&lt;p&gt;Pushing back to beta3.&lt;/p&gt;</comment>
                    <comment id="13484" author="beberlei" created="Thu, 1 Jul 2010 17:50:33 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10562" name="DetachedPartiallyLoadedEntityTest.php" size="3517" author="markus.woessner" created="Thu, 8 Apr 2010 15:33:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-455] E_NOTICE Undefined index when setting field to a property that is not persisted</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-455</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Affects trunk.&lt;/p&gt;

&lt;p&gt;A and B have a One-To-One mapping, with A being the owning side of the relationship. No cascade persist is set.&lt;/p&gt;

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

echo &lt;span class=&quot;code-quote&quot;&gt;&quot;Created A {$b-&amp;gt;getId()}\n&quot;&lt;/span&gt;;

&lt;span class=&quot;code-comment&quot;&gt;// Create B and add it to A
&lt;/span&gt;$b = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; B();
$a-&amp;gt;setB($b);
&lt;span class=&quot;code-comment&quot;&gt;//$em-&amp;gt;persist($b); // oops, forgot
&lt;/span&gt;
$em-&amp;gt;flush();

echo &lt;span class=&quot;code-quote&quot;&gt;&quot;Created B {$b-&amp;gt;getId()}\n&quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected: either throw an exception saying that A is attempting to reference an instance of B that is not persisted, or silently ignore the field.&lt;/p&gt;

&lt;p&gt;Actual: Cryptic notice:&lt;/p&gt;

&lt;p&gt;E_NOTICE (8): Undefined index: 0000000069d80795000000006ebfc57d (Doctrine/ORM/UnitOfWork.php:1903)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11107">DDC-455</key>
            <summary>E_NOTICE Undefined index when setting field to a property that is not persisted</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="jakajancar">Jaka Jancar</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Mar 2010 16:16:22 +0000</created>
                <updated>Wed, 7 Jul 2010 18:34:30 +0000</updated>
                    <resolved>Wed, 7 Jul 2010 18:34:30 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12439" author="guilhermeblanco" created="Tue, 23 Mar 2010 11:43:38 +0000"  >&lt;p&gt;The issue you have is the same as if you use result cache. The entity is not managed by EM.&lt;br/&gt;
Maybe an &quot;Entity of class &quot; . get_class($entity) . &quot; not managed by EntityManager.&quot; exception is the best solution here.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="12440" author="beberlei" created="Tue, 23 Mar 2010 13:38:12 +0000"  >&lt;p&gt;Given that the combination:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$hash = spl_object_hash($object);
&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;somefoo[$hash];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;is probably one of the most called constructs in the complete code I tend to disagree with a check on each and everyone of them. However i to see the tendency towards errors of this kind as annoying, but maybe we can catch them earlier in those spots where they occour most often?&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10595">DDC-203</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-410] review all sql to ensure that it works with concurrent requests</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-410</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;this is just a reminder ticket .. it is important that all SQL code in D2 takes concurrent requests into account. this means simply fetching data and then writing data back to the RDBMS needs to take into account that there could be concurrent requests that change the fetched data. this means employing necessary explicit locking or optimistic locking etc.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11033">DDC-410</key>
            <summary>review all sql to ensure that it works with concurrent requests</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="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Mar 2010 14:47:47 +0000</created>
                <updated>Sun, 4 Jul 2010 11:21:11 +0000</updated>
                    <resolved>Sun, 4 Jul 2010 11:21:11 +0000</resolved>
                            <version>2.0-ALPHA4</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12106" author="romanb" created="Fri, 12 Mar 2010 04:43:24 +0000"  >&lt;p&gt;I think we dont use a read - update - write approach that is supposed to be atomic anywhere. Its obvious that this is fragile. Its like the select max() + increment in memory + write record variant for generating primary keys which is obviously a bad idea (at least it would need SERIALIZABLE transaction isolation I think).&lt;/p&gt;

&lt;p&gt;(Obviously, any object retrieval -&amp;gt; modification -&amp;gt; persistence is a read-update-write but thats expectedly not &quot;concurrency safe&quot;. Thats what optimistic or pessimistic (not yet implemented) locking is for.)&lt;/p&gt;</comment>
                    <comment id="12107" author="romanb" created="Fri, 12 Mar 2010 04:45:25 +0000"  >&lt;p&gt;As this is a &quot;reminder&quot; and I dont see any issues currently, this is surely not a blocker until someone finds a serious (and valid) problem related to this.&lt;/p&gt;</comment>
                    <comment id="12117" author="lsmith" created="Fri, 12 Mar 2010 08:50:57 +0000"  >&lt;p&gt;and i want to reverse that logic .. i want to ensure that things have been reviewed so that it is clear that things will work concurrently. for example using CURRENT_TIMESTAMP, even just as an option, for versionable versions is uhm a very bad idea. at least make it microtime.&lt;/p&gt;

&lt;p&gt;also D2 needs to support LOCK TABLE and it needs to be ensured that its possible to write &quot;behaviors&quot; that figure out the list of tables that need to be locked at the beginning of a flush() execution, because without it you are in a world of concurrency hurt when you want to implement stuff like Sortable or NestedSet on top of D2.&lt;/p&gt;</comment>
                    <comment id="12119" author="romanb" created="Fri, 12 Mar 2010 10:32:00 +0000"  >&lt;p&gt;What is your definition of &quot;that things work concurrently&quot; ? The default transaction isolation for most databases (READ COMMITTED) is designed to allow concurrency for more liveness. This implies that things like lost updates and other stuff are allowed to happen. If you dont want that you can simply use a SERIALIZABLE isolation level for the transactions which will give stronger consistency but less liveness/performance, right?&lt;/p&gt;

&lt;p&gt;I&apos;m not convinced (yet) that timestamps are a &quot;very bad idea&quot; for optimistic locking (thats what it is used for, there is no &quot;versionable&quot; behavior or whatever built into Doctrine). Yes, you can still get lost updates in rare, high concurrency situations but most of the time lost updates are prevented and if this is fine for the particular application and a timestamp is a more useable and meaningful value then I dont see anything wrong with it. We added that feature because it was in the JPA spec and every major ORM I know supports timestamps for optimistic locking and I&apos;m relatively confident that they know what they&apos;re doing (Its still possible that we just have a broken implementation in Doctrine, I dont know that yet, I didnt have the time to look in detail at the other implementations).&lt;/p&gt;

&lt;p&gt;As for LOCK TABLE, we will probably provide an abstraction over the specific SQL in the different platforms in the DBAL. Then maybe Doctrine will use these in some scenarios for pessimistic locking but that is stuff for the future.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure where you&apos;re aiming at with this ticket. Yes, locking features are going to be improved. Yes, concurrent transactions can cause lost updates and other stuff unless you use a higher isolation level. But this is all not new. The transaction isolation level is already under your control. The locking features will be improved. Where is the flaw you&apos;re apparently seeing? At least I get the feeling out of your ticket and comment that you seem to be very worried about concurrency, thinking that Doctrine doesnt do enough or does it wrong. I, however, dont yet see what more we should do than to provide support for optimistic and pessimistic locking and I dont see the world of concurrency hurt you&apos;re seeing and in which way this is the fault of Doctrine. I think I am very aware of concurrency-related problems but as its often a very difficult topic, its easy to overlook something.&lt;/p&gt;</comment>
                    <comment id="12120" author="lsmith" created="Fri, 12 Mar 2010 10:42:16 +0000"  >&lt;p&gt;i am aiming at being able to deliver algorithms on top of D2 that ensure the C in ACID .. for simple INSERT/UPDATE etc you can rely on transactions and native isolation levels, but for the things D2 needs to be able to do (versionable, sortable etc.) we need more than that. of course most apps do not going to have a bazillion of parallel requests .. but its still quite common for people to double submit .. or for multiple admins spotting and fixing the same data issue at the same time and if this breaks your nested set tree .. you are screwed. currently i have no reason to believe that D2 was written with sufficient brain cycles spend on these issues. if you are willing to release D2 1.0 without this being checked, then i think you are doing a horrible mistake.&lt;/p&gt;

&lt;p&gt;D1 behaviors have tons of flaws that you have mentioned in your blog. but the biggest one never got mentioned, nor did it ever generate a response when i mailed the dev list. i fear that there is just too little attention being paid to this topic, maybe also because there isnt enough expertise in this area. but i think its mainly just not being looked at enough.&lt;/p&gt;

&lt;p&gt;anyways, if you are certain enough that none of my concerns above are valid and that if there are any issues you can fix them without a BC break, then close the ticket.&lt;/p&gt;</comment>
                    <comment id="12121" author="romanb" created="Fri, 12 Mar 2010 11:43:16 +0000"  >&lt;p&gt;&quot;i am aiming at being able to deliver algorithms on top of D2 that ensure the C in ACID .. for simple INSERT/UPDATE etc you can rely on transactions and native isolation levels, but for the things D2 needs to be able to do (versionable, sortable etc.) we need more than that.&quot;&lt;/p&gt;

&lt;p&gt;I assume you mean the &quot;application level&quot; consistency right? Such that an ordering is not messed up with 2 items having the same position or that a nested set tree is not corrupt? I understand that but why can&apos;t these be solved with a higher isolation level for the operations that modify the order/the tree?. I would be especially interested in such examples that can not be solved by using a higher isolation level. I currently cant see how it would be possible to break consistency of a sorted association or nestedset tree when using a SERIALIZABLE isolation level for the transactions that modify the order or the tree.&lt;/p&gt;

&lt;p&gt;I&apos;m not trying to dismiss your critiques here, I&apos;m taking you very seriously, but you need to get more specific than &quot;ensure the sql works with concurrent requests&quot;. That alone doesnt tell us much. We need concrete examples of problematic concurrent scenarios and what Doctrine itself can or should do to avoid these problems.&lt;/p&gt;

&lt;p&gt;Currently, we dont know what to look for.&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;</comment>
                    <comment id="12122" author="lsmith" created="Fri, 12 Mar 2010 12:02:44 +0000"  >&lt;p&gt;the issue is that with FOR UPDATE .. and ultra paranoid isolation levels you can get locks on things that exist, but its not possible to necessarily get a LOCK on things that are just being inserted or altered to suddenly fall in your &quot;range&quot; or worse yet that get appended to your &quot;range&quot;. some RDBMS do support range locks (like if I do WHERE foo BETWEEN 1 AND 100), but not all do .. and IIRC you do not really have much control over those (its simply a LOCK escalation strategy RDBMS may use to reduce the number of row level locks). this means in many situations fetching data with a FOR UPDATE even, might not be enough to ensure consistency when you do rights later on.&lt;/p&gt;

&lt;p&gt;i have not done a code review of D2 .. actually i have spend very little time looking at any of the code, but from the questions and comments i have seen, there doesnt seem to be enough emphasis. for example i also saw code for the slug extension. which again employs the model of fetching all potential collisions and then doing an insert on the fetched data, without ensuring that between fetching and inserting there are no new collisions. stuff like this should try harder to do things in a single commit if possible, or getting the necessary locks.&lt;/p&gt;

&lt;p&gt;locking is non trivial business and so expecting end users to get this right is a bad move imho.&lt;/p&gt;

&lt;p&gt;but aside from any of the internal sql, i would also urge to ensure that some of the things i have been asking for (an efficient way to determine the affected tables and if they need to be locked at the start of a flush) a solid way to mark specific models or all model instances as dirty to ensure that users can either choose to reload certain dirty models at once or automatically when they are accessed again (see &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-343&quot; title=&quot;Make it possible to force reloading of instanciated models&quot;&gt;&lt;del&gt;DDC-343&lt;/del&gt;&lt;/a&gt;) is really possible.&lt;/p&gt;

&lt;p&gt;at the same time i acknowledge that i am just pointing at theoretical problems, without a promise to do the actual analysis and fixing. its just that this month i have promised people to spend my spare time on other stuff. next month might be more doable, i am traveling a lot .. where i can hopefully spend some time reviewing, then again traveling means that providing feedback and discussing things is more difficult.&lt;/p&gt;</comment>
                    <comment id="12128" author="beberlei" created="Sat, 13 Mar 2010 04:16:33 +0000"  >&lt;p&gt;Ok I have read some stuff, InnoDb for example locks on index ranges also locking the prev and next keys to avoid insert behind problms.&lt;/p&gt;

&lt;p&gt;We are also planing to add support for &quot;FOR UPDATE&quot; and &quot;FOR SHARE&quot; as a query hint to all DQL queries aswell as a &quot;Lock&quot; Enum that allows to set this flags for transactions with the Entity Repositories (i.e ntityManager::find(), EntityRepository::findOne, findall() and such). See the linked issue &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-178&quot; title=&quot;Query Hint for LOCK mechanisms plus support in $em-&amp;gt;find()&quot;&gt;&lt;del&gt;DDC-178&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An automatic lock table is slightly more complex to compute but its possible using the &quot;onFlush&quot; event. My draft of a table locking manager is attached to the ticket.&lt;/p&gt;</comment>
                    <comment id="12129" author="beberlei" created="Sat, 13 Mar 2010 04:25:19 +0000"  >&lt;p&gt;A TableLocking Manager, usage:&lt;/p&gt;

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

$evm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; EventManager();
$evm-&amp;gt;addListener($lock);

$em = EntityManager::create(..., $evm);

&lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; stuff
&lt;/span&gt;$em-&amp;gt;flush();
$lock-&amp;gt;unlockTables();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There should probably be a postCommit() event or something to clean up the mess automatically &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;

&lt;p&gt;Btw, this won&apos;t work at all with Joined Inheritance.&lt;/p&gt;

&lt;p&gt;@lsmith: can you comment on the code? &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="12132" author="lsmith" created="Sat, 13 Mar 2010 07:07:57 +0000"  >&lt;p&gt;This is looking quite promising. I guess it would be wise to give each model class the choice if it wants to cause a lock or not, because especially in high concurrency scenarios locking a table can of course have some drastic performance effects. Actually if I for example have a sortable behavior and I am not messing with the sorting at all, I do not need to lock the table either. So probably the best approach would be that if a model method is called that requires locking. Each model could register an onFlush() event (theoretically it could try and be smart and only register the event when it knows it has something to do) and then given the value of the flag tell the lock class to issue a lock for the given underlying table.&lt;/p&gt;

&lt;p&gt;BTW: as for innodb .. like i said some RDBMS have this behavior .. but its nothing we can rely on at all ..&lt;/p&gt;</comment>
                    <comment id="12156" author="beberlei" created="Sun, 14 Mar 2010 13:11:39 +0000"  >&lt;p&gt;yeah of course, this code locks all the time, however some kind of configuration to check for models that need full table locks is probably necessary, but as you can see from the code, easy to implement.&lt;/p&gt;

&lt;p&gt;My idea would be to add a &quot;TableLockRequired&quot; marker interface and in the loops check if any dirty model implements this marker interface.&lt;/p&gt;</comment>
                    <comment id="12158" author="seldaek" created="Sun, 14 Mar 2010 13:23:24 +0000"  >&lt;p&gt;Just as a reminder, I think if some code attempts to lock and the current RDBMS/Engine doesn&apos;t allow the requested lock, D2 should (make it an option maybe, but default true imo) throw an exception saying locking doesn&apos;t work with the current engine. Silently doing nothing is good in production to avoid pages exploding, but in development I want to know when I lock if it&apos;s not really locking in the background. And if I can know that without reading all detailed specs about whatever engine is in use that&apos;s even better.&lt;/p&gt;</comment>
                    <comment id="12265" author="romanb" created="Mon, 15 Mar 2010 18:28:20 +0000"  >&lt;p&gt;Synchronizing schedule with &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-178&quot; title=&quot;Query Hint for LOCK mechanisms plus support in $em-&amp;gt;find()&quot;&gt;&lt;del&gt;DDC-178&lt;/del&gt;&lt;/a&gt;. This issue is considered resolved when the improved locking support from &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-178&quot; title=&quot;Query Hint for LOCK mechanisms plus support in $em-&amp;gt;find()&quot;&gt;&lt;del&gt;DDC-178&lt;/del&gt;&lt;/a&gt; has been implemented. As Benjamin demonstrated more custom (and generic, reusable) locking strategies are possible through the use of the event system.&lt;/p&gt;</comment>
                    <comment id="13514" author="beberlei" created="Sun, 4 Jul 2010 11:21:11 +0000"  >&lt;p&gt;resolved.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10518">DDC-178</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10450" name="TableLocking.php" size="2669" author="beberlei" created="Sat, 13 Mar 2010 04:25:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-203] Detached entities are recognized as new ones</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-203</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;From&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects&lt;/a&gt;&lt;br/&gt;
on using persist() on an entity X:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;If X is a detached entity, an InvalidArgumentException will be thrown.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So I do this:&lt;br/&gt;
       $picard = $this-&amp;gt;_getUser(&apos;Picard&apos;);&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;persist($picard);&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;flush();&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;detach($picard);&lt;br/&gt;
        $this-&amp;gt;_em-&amp;gt;persist($picard);&lt;br/&gt;
        $this-&amp;gt;_howMany(&quot;Picard&quot;, 1);&lt;br/&gt;
Result:&lt;br/&gt;
    1) NakedPhp\Storage\DoctrineTest::testSavesUpdatedEntities&lt;br/&gt;
    There are 2 instances of Picard saved instead of 1.&lt;br/&gt;
    Failed asserting that &amp;lt;string:2&amp;gt; matches expected &amp;lt;integer:1&amp;gt;.&lt;br/&gt;
The entity is recognized as new instead of detached, so no error is thrown and it is duplicated in the database.&lt;/p&gt;</description>
                <environment>Cli tests with PHPUnit&lt;br/&gt;
PHP 5.3.1 (cli) (built: Nov 27 2009 10:08:49) &lt;br/&gt;
PHPUnit 3.4.1</environment>
            <key id="10595">DDC-203</key>
            <summary>Detached entities are recognized as new ones</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="giorgiosironi">Giorgio Sironi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2009 16:34:15 +0000</created>
                <updated>Tue, 6 Jul 2010 06:03:30 +0000</updated>
                    <resolved>Tue, 6 Jul 2010 06:03:30 +0000</resolved>
                            <version>2.0-ALPHA3</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11145" author="giorgiosironi" created="Wed, 9 Dec 2009 17:16:40 +0000"  >&lt;p&gt;Patch tentative. Resolved this bug but breaks another test of DetachedEntityTest, so I added another to make clear what is the issue: relying on keys to know if an entity is detached is not correct when entities have natural keys like CmsPhonenumber.&lt;br/&gt;
It seems that the only option would be hitting the database to see if the entity is already present.&lt;br/&gt;
Eliminating the error and simply persisting the entity anyway would not be cool because a duplicate will be created everytime entity is passed to persist(); even to pass it internally to merge() we have to know if it&apos;s new or detached.&lt;br/&gt;
A last option would be declaring: pass detached entities to persist at your own risk. It&apos;s normal for Doctrine not being aware of the difference between new and detached, if not &apos;detached&apos; would not be so detached if the Orm remembers it. I have no problem in keeping new entities separated from detached ones in my data structure. Or I can simply merge() all, catching exceptions and add the entity that resulted in exceptions with persist().&lt;/p&gt;</comment>
                    <comment id="11146" author="romanb" created="Wed, 9 Dec 2009 17:24:06 +0000"  >&lt;p&gt;Yes, that exactly is the problem and I am/was aware of this but hitting the database is a no-go for that. Determining the state (UnitOfWork#getEntityState) has to be very fast. So its just a matter of finding the best compromise.&lt;/p&gt;</comment>
                    <comment id="11151" author="giorgiosironi" created="Wed, 9 Dec 2009 19:12:33 +0000"  >&lt;p&gt;We can&apos;t save any information in Doctrine objects because serialized or cached entities travel between http requests and sessions. merge() uses the same assumption that entities without identifiers defined are new and when passing a phonenumber it gives a false protection because the defined natural key does not result always in a real entity in the database.&lt;br/&gt;
Substituting a proxy subclass which adds a $_state private property is definitely an overkill. I suggest removing the exception and assuming that detached objects should be passed to merge() before any operation is performed on them, and only detached objects should be passed to merge(). Behavior if other operations are done previously would be undefined.&lt;br/&gt;
The use case for the merge()/detach() methods is serialization/unserialization of objects from a cache. A developer would then only merge objects in the access point of the cache or on saving.&lt;/p&gt;</comment>
                    <comment id="11631" author="beberlei" created="Sun, 7 Feb 2010 09:16:25 +0000"  >&lt;p&gt;My take at this issue:&lt;/p&gt;

&lt;p&gt;1. _doPersist() assumes all entities are new. This is wrong.&lt;br/&gt;
2. An entity is new if it has no identifier.&lt;br/&gt;
3. Detached entities have identifiers.&lt;/p&gt;

&lt;p&gt;Now the heuristics:&lt;/p&gt;

&lt;p&gt;1. If the IdGenerator is NOT (Assigned &amp;lt;-&amp;gt; None) and we find identifiers then it is obviusly a detached Entity&lt;br/&gt;
2. If we dont find identifiers the entity is obviusly is new.&lt;/p&gt;

&lt;p&gt;Problematic case: IdGenerator is Assigned and we find identifiers: Here i assume the entity is new, by definition of an entity persist() leads to a duplicate key error and catches this error.&lt;/p&gt;

&lt;p&gt;I think this is the best approach.&lt;/p&gt;</comment>
                    <comment id="11632" author="beberlei" created="Sun, 7 Feb 2010 10:40:55 +0000"  >&lt;p&gt;Updated version that introduces the &quot;EntityExistsException&quot;&lt;/p&gt;</comment>
                    <comment id="11731" author="romanb" created="Tue, 16 Feb 2010 06:04:13 +0000"  >&lt;p&gt;The problem I have with this is that by doing this, every single entity passed to persist() gets its identifier read out using reflection just to determine whether its really new.&lt;/p&gt;

&lt;p&gt;I would rather change the contract and the documentation to clearly indicate that detached instances must not be passed to persist().&lt;/p&gt;</comment>
                    <comment id="11744" author="giorgiosironi" created="Tue, 16 Feb 2010 14:16:38 +0000"  >&lt;p&gt;There are no problems in a stricter contract for persist() if detached instances are kept separate from new ones in applications, which is usually true since they come from a cache or a store. I would go with the change as it&apos;s the simplest reliable solution.&lt;/p&gt;</comment>
                    <comment id="12857" author="romanb" created="Thu, 6 May 2010 07:18:59 +0000"  >&lt;p&gt;I updated the documentation to be more clear about this issue: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects:persisting-entities&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/2_0/en/working-with-objects:persisting-entities&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;The problem is, we can not do it reliably for all cases. Yes, we could look into the identifier property if the identifier is &lt;b&gt;generated&lt;/b&gt; and conclude from that whether it is detached or not but that does not work for manually assigned identifiers. For these we would need to hit the database and I just don&apos;t think we can do that.&lt;/p&gt;

&lt;p&gt;So right now changing the persist contract as I did in the documentation, explicitly stating that detached entities should not be passed to persist() and that the behavior is undefined if done so, is the &quot;best&quot; thing.&lt;/p&gt;

&lt;p&gt;Tell me what you think. The alternative would be to do the above (peek into identifier field of generated identifiers or look the identifier up in the db if it is assigned manually). I&apos;m pretty sure the JPA implementations do just that but I dont know for sure and I dont think we want that.&lt;/p&gt;

&lt;p&gt;I am still undecided though &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Something inside me prefers to go the other route, even if it means some additional db hits for manually assigned identifiers. Please make your vote.&lt;/p&gt;</comment>
                    <comment id="12860" author="giorgiosironi" created="Thu, 6 May 2010 13:35:12 +0000"  >&lt;p&gt;If an identifier is a natural key, and not generated,  a detached object of that class and a new one are really indistinguishable if they have the same values on the other columns.&lt;br/&gt;
I am for simplicity: the detached/merge entities are related to use cases like caches, sessions and serialization of every kind. So typically you in an application you always know when they come from such a source and can call merge() appropriately.&lt;br/&gt;
If calling persist() erroneously will result in throwing an exception &lt;b&gt;on flush()&lt;/b&gt; (primary key value already present), the application developer will notice the problem.&lt;/p&gt;</comment>
                    <comment id="13096" author="romanb" created="Thu, 3 Jun 2010 05:43:58 +0000"  >&lt;p&gt;Pushing final resolution back to beta3. The problem is that this missing detection of detached objects can lead to weird errors in other cases as well. Need to think about it some more.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11107">DDC-455</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10224" name="ddc-203.patch" size="2898" author="giorgiosironi" created="Wed, 9 Dec 2009 17:16:40 +0000" />
                    <attachment id="10354" name="ddc203-beberlei-update.patch" size="2995" author="beberlei" created="Sun, 7 Feb 2010 10:40:55 +0000" />
                    <attachment id="10351" name="ddc203-beberlei.patch" size="1312" author="beberlei" created="Sun, 7 Feb 2010 09:16:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-178] Query Hint for LOCK mechanisms plus support in $em-&gt;find()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-178</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;In some scenarios it is necessary to explicitly lock rows for update in a select query. My idea would be to support it twofold:&lt;/p&gt;

&lt;p&gt;1. Add a LockMode Class:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Lock
{
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; NONE = 0;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; OPTIMISTIC = 1;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_READ = 2;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_WRITE = 4;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;2. Add methods to platforms that can add necessary READ/WRITE Lock query additions like FOR UPDATE/SHARED which afaik are supported by all rmdbs in some way.&lt;br/&gt;
3. Add a query hint &quot;lockMode&quot; which takes a Lock constant.&lt;br/&gt;
4. Add a query hint &quot;lockVersion&quot; which takes an integer or timestamp versioning value.&lt;br/&gt;
5. Change DQL Parser to apply lock mode if set, and if lock_mode = optimistic, add a where clause for the only top-level class (more not supported? Reread Evans DDD / Aggregates)&lt;br/&gt;
6. Change the $em-&amp;gt;find() method to the following signature:&lt;/p&gt;

&lt;div class=&quot;code panel&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 find($class, $identifier, $lockMode=0, $lockVersion=&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And if the values are set, set the appropriate query hints.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2&gt;&lt;a name=&quot;UpdatedAPIspecification&quot;&gt;&lt;/a&gt;Updated API specification&lt;/h2&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class LockMode
{
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; NONE = 0;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; OPTIMISTIC = 1;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_READ = 2;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_WRITE = 4;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;ul&gt;
	&lt;li&gt;LockMode::OPTIMISTIC requires entities to be versioned&lt;/li&gt;
	&lt;li&gt;LockMode::PESSIMISTIC_READ/WRITE works similarly for versioned as well as non-versioned entities. However, lock() after read only works for versioned entities.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;&lt;a name=&quot;APIspec&quot;&gt;&lt;/a&gt;API spec&lt;/h3&gt;

&lt;h4&gt;&lt;a name=&quot;%24query%3EsetLockMode%28LockMode%3A%3AOPTIMISTIC%29&quot;&gt;&lt;/a&gt;$query-&amp;gt;setLockMode(LockMode::OPTIMISTIC)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw OptimisticLockException if any of the entities fetched (or fetch-joined) by the query are not versioned.&lt;/li&gt;
	&lt;li&gt;Otherwise proceed normally, SQL is not modified.&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24query%3EsetLockMode%28LockMode%3A%3APESSIMISTICREAD%2FW...&quot;&gt;&lt;/a&gt;$query-&amp;gt;setLockMode(LockMode::PESSIMISTIC_READ/WRITE)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw TransactionRequiredException if there is no running transaction.&lt;/li&gt;
	&lt;li&gt;Modify the SQL with an appropriate locking clause (i.e. FOR UPDATE) that can be platform-specific, to acquire a pessimistic lock on all read entities.&lt;/li&gt;
	&lt;li&gt;Throw PessimisticLockException if lock(s) could not be obtained.&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24em%3Efind%28%24entity%2CLockMode%3A%3AOPTIMISTIC%29%28orfindByetal%29&quot;&gt;&lt;/a&gt;$em-&amp;gt;find($entity, LockMode::OPTIMISTIC) (or findBy et al)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw OptimisticLockException if entity is not versioned.&lt;/li&gt;
	&lt;li&gt;Otherwise proceeed normally.&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24em%3Efind%28%24entity%2CLockMode%3A%3AOPTIMISTIC%2C%24version%29%28orfindByetal%29&quot;&gt;&lt;/a&gt;$em-&amp;gt;find($entity, LockMode::OPTIMISTIC, $version) (or findBy et al)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw OptimisticLockException if entity is not versioned.&lt;/li&gt;
	&lt;li&gt;find() entity normally, no SQL modification.&lt;/li&gt;
	&lt;li&gt;Throw OptimisticLockException if there is a version mismatch ($version != $entity-&amp;gt;version)&lt;/li&gt;
	&lt;li&gt;Otherwise proceed normally.&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24em%3Efind%28%24entity%2CLockMode%3A%3APESSIMISTICREAD%2FWRITE%29&quot;&gt;&lt;/a&gt;$em-&amp;gt;find($entity, LockMode::PESSIMISTIC_READ/WRITE)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw TransactionRequiredException if there is no active transaction.&lt;/li&gt;
	&lt;li&gt;Modify the SQL to incude an appropriate platform-specific pessimistic lock (i.e. FOR UPDATE)&lt;/li&gt;
	&lt;li&gt;throw PessimisticLockException If lock could not be obtained&lt;/li&gt;
	&lt;li&gt;Otherwise proceed normally&lt;/li&gt;
	&lt;li&gt;Refresh entity with lock when entity with id exists in identity map already&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24em%3Erefresh%28%24entity%2CLockMode%3A%3AOPTIMISTIC%29&quot;&gt;&lt;/a&gt;$em-&amp;gt;refresh($entity, LockMode::OPTIMISTIC)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw OptimisticLockException if entity is not versioned.&lt;/li&gt;
	&lt;li&gt;Otherwise proceed normally. (What about cascades here? Need to take that into account probably)&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24em%3Erefresh%28%24entity%2CLockMode%3A%3APESSIMISTICREAD%2FWRITE%29&quot;&gt;&lt;/a&gt;$em-&amp;gt;refresh($entity, LockMode::PESSIMISTIC_READ/WRITE)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw TransactionRequiredException if there is no active transaction.&lt;/li&gt;
	&lt;li&gt;Ensure the SQL used for refreshing is modified accordingly with the platform-specific pessimistic locking clause.&lt;/li&gt;
	&lt;li&gt;Throw PessimisticLockException if the lock could not be obtained.&lt;/li&gt;
	&lt;li&gt;Otherwise proceed normally.&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24em%3Elock%28%24entity%2CLockMode%3A%3AOPTIMISTIC%29&quot;&gt;&lt;/a&gt;$em-&amp;gt;lock($entity, LockMode::OPTIMISTIC)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw OptimisticLockException if entity is not versioned.&lt;/li&gt;
	&lt;li&gt;Otherwise do nothing (NOOP).&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;%24em%3Elock%28%24entity%2CLockMode%3A%3APESSIMISTICREAD%2FWRITE%29&quot;&gt;&lt;/a&gt;$em-&amp;gt;lock($entity, LockMode::PESSIMISTIC_READ/WRITE)&lt;/h4&gt;

&lt;p&gt;Effects:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Throw TransactionRequiredException if there is no active transaction.&lt;/li&gt;
	&lt;li&gt;Throw PessimisticLockException if entity is not versioned (this is always a &quot;lock after read&quot;)&lt;/li&gt;
	&lt;li&gt;Issue straight, minimal locking SQL (we probably &lt;b&gt;must&lt;/b&gt; include the version column in the select), platform-specific. Note: Probably get the SQL from the persisters to account for different inheritance mapping strategies. The last part of the SQL, the locking clause, is taken from the platforms.&lt;/li&gt;
	&lt;li&gt;Throw PessimisticLockException if the lock could not be obtained.&lt;/li&gt;
	&lt;li&gt;Compare the newly read version with the old version. If they dont match throw PessimisticLockException (this means the entity was changed since it was read).&lt;/li&gt;
	&lt;li&gt;Otherwise proceed normally.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="10518">DDC-178</key>
            <summary>Query Hint for LOCK mechanisms plus support in $em-&gt;find()</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="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 Nov 2009 19:49:11 +0000</created>
                <updated>Sun, 4 Jul 2010 08:38:45 +0000</updated>
                    <resolved>Sun, 4 Jul 2010 08:38:45 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="11112" author="guilhermeblanco" created="Wed, 9 Dec 2009 03:33:01 +0000"  >&lt;p&gt;We should be aware that PHP 5.3 now uses mysqlnd driver internally.&lt;br/&gt;
This means that queries like LOCK are applied via unbuffered queries, which may compromise subsequent data changes on DB table.&lt;/p&gt;

&lt;p&gt;We need to do some testing before effectively apply any type of approach here.&lt;/p&gt;</comment>
                    <comment id="11133" author="beberlei" created="Wed, 9 Dec 2009 13:44:59 +0000"  >&lt;p&gt;What does this have to do with locking? I don&apos;t understand 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; Please elaborate &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="11152" author="beberlei" created="Wed, 9 Dec 2009 21:52:43 +0000"  >&lt;p&gt;Attached a quick try for pessimistic lock.&lt;/p&gt;

&lt;p&gt;Optimistic lock enforcement is much more difficult...&lt;/p&gt;</comment>
                    <comment id="11155" author="beberlei" created="Wed, 9 Dec 2009 22:15:55 +0000"  >&lt;p&gt;Update of the patch adding tests to the Query SELECT tests.&lt;/p&gt;</comment>
                    <comment id="11235" author="romanb" created="Sat, 19 Dec 2009 13:45:42 +0000"  >&lt;p&gt;Regarding Nr. 5, indeed more than one root entity is supported in DOctrine 2 when querying.&lt;/p&gt;

&lt;p&gt;Example (assuming Customer and Employee are not related in any way):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q = $em-&amp;gt;createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT c, e FROM Customer c, Employee e WHERE c.hatsize = e.shoesize&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result would (or should) be an array with both Customer and Employee objects.&lt;/p&gt;</comment>
                    <comment id="11486" author="beberlei" created="Tue, 26 Jan 2010 10:51:37 +0000"  >&lt;p&gt;We should probably go only for the PESSIMISTIC lock in the interface.&lt;/p&gt;

&lt;p&gt;However it might be convenient to make optimistic locking possible via an additional parameter. Given that PHP is Stateless it might be a good pattern to do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$id = $_POST[&apos;id&apos;];
$lastKnownVersion = $_POST[&apos;version&apos;];
$entity = $em-&amp;gt;find(&apos;Yadda&apos;, $id, $lastKnownVersion);
&lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; stuff with $entity
&lt;/span&gt;
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12130" author="beberlei" created="Sat, 13 Mar 2010 05:20:48 +0000"  >&lt;p&gt;Hm given our discussion yesterday, we should translate the OPTIMISTIC_FORCE_INCREMENT into PHPs execution context (script per request):&lt;/p&gt;

&lt;div class=&quot;code panel&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;final&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Lock
{
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; NONE = 0;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; OPTIMISTIC_READ = 1;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_READ = 2;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_WRITE = 4;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;OPTIMISTIC_READ requires the fourth parameter of EM::find() to find being a positive integer and adds a version chck for that given version. This wont work with Dql though.&lt;/p&gt;

&lt;p&gt;EntityRepository should also be changed, this affects:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;EntityRepository::find($id, Lock $lockMode = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $lockVersion = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
EntityRpository::findOneBy(array $criteria, Lock $lockMode = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $lockVersion = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Entity Repository would translate a $lockVersion != null into a $criteria. Then we onlly need to change:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;StandardEntityPersister::load($criteria, $entity, $assoc, $hints = array(), $lockMode = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
StandardEntityPersister::_getSelectEntitiesSQL($criteria, $assoc=&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $lockMode = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The all queries have to be done with DQL to get pessimistic locks imho. A DQL Query with locking would 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;$q-&amp;gt;setHint(Query::HINT_LOCK_MODE, Lock::PESSIMISTIC_READ);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12134" author="romanb" created="Sat, 13 Mar 2010 16:46:47 +0000"  >&lt;p&gt;I would also like to see an EntityManager#lock() method. However, after re-reading the spec and testing with Hibernate 3.5.0-CR-2, I&apos;m not sure we really need the *_FORCE_INCREMENT variations. In Hibernate, em.lock() with OPTIMISTIC doesnt do anything (it doesnt need to, versions are compared on update anyway). Even with OPTIMISTIC_FORCE_INCREMENT nothing happens, except the normal version update when the entity changed. Not sure whether this is a bug or intended. PESSIMISTIC_FORCE_INCREMENT works as expected.&lt;/p&gt;

&lt;p&gt;So I currently think we should have the following as a start:&lt;/p&gt;

&lt;div class=&quot;code panel&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;final&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class LockMode
{
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; NONE = 1; &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_READ = 2;
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; PESSIMISTIC_WRITE = 3;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The LockMode can then be used either in queries or with EntityManager#lock(). Moreso, these lock modes work independantly of whether the entity is versioned (@Version) or not. PESSIMISTIC_READ would acquire a shared read lock while PESSIMISTIC_WRITE would acquire an exclusive write lock.&lt;/p&gt;

&lt;p&gt;What I&apos;m not sure yet about are the following things:&lt;/p&gt;

&lt;p&gt;1) Whether to add a query hint or an explicit setLockMode() method + $_lockMode property on the query. I&apos;m tending towards the latter to give a more explicit API for locking (hints are a bit non-obvious and may be overlooked).&lt;/p&gt;

&lt;p&gt;2) Whether we need any kind of OPTIMISTIC support in LockMode or *_FORCE_INCREMENT support. I currently think we should start without both.&lt;/p&gt;</comment>
                    <comment id="12142" author="beberlei" created="Sun, 14 Mar 2010 04:54:54 +0000"  >&lt;p&gt;In my opinion EntityManager#lock() is not necessary for PHP&lt;/p&gt;

&lt;p&gt;I think it has a place in long running scripts, where you dont know if you have already a write lock for an entity you have retrieved from the session some time ago, however in PHP you certainly know if a script you are executing needs a read/write consistency lock or not. &lt;/p&gt;

&lt;p&gt;This is also where optimistic force increment shines in Java, because you update the version column you are certain you have a read consistent version of your entity. In PHP the time-frame between retrievial and a call to lock() is just unnecessary small and could be solved by directly locking the entity.&lt;/p&gt;

&lt;p&gt;This is why i think EntityManager::find needs to be able to set the version also. A long running script in php means:&lt;/p&gt;

&lt;p&gt;1. Session A retrieves Entity with Id 1 and Version 1 and displays a form&lt;br/&gt;
2. Session B retrieves Entity with Id 1 and Version 1and displays a form&lt;br/&gt;
3. Session B retrieves Entity withId 1 and Version 1 and updates it to Version 2&lt;br/&gt;
4. Session A retrieves Entity with Id 1 and Version 2 and a lost update happens.&lt;/p&gt;

&lt;p&gt;This would be the case without checking the version column.  A pessimistic lock in this case is not possible, because it would be lost between point 1 and point 4. However an optimistic lock could check upon retrieval of the entity in point 4, if it is still at version 1.&lt;/p&gt;</comment>
                    <comment id="12143" author="romanb" created="Sun, 14 Mar 2010 05:20:08 +0000"  >&lt;p&gt;You dont always know at the point of reading an entity whether you want to lock it or not because these decisions can be made in different layers of the application, even during a single HTTP request. And pessimistic (online) locks are never retrieved in &quot;long-running scripts&quot; / &quot;business transactions&quot;, i.e. held during user think time, that would be a concurrency nightmare! And the pessimistic locks in JPA are online locks (select ... for update), not offline locks, so there is no difference between Java and PHP when it comes to the pessimistic online locks (select ... for update).&lt;/p&gt;

&lt;p&gt;We are really only talking about pessimistic online locks and optimistic offline locks here. (I dont even know if there is such a thing as an optimistic &lt;b&gt;online&lt;/b&gt; lock).&lt;/p&gt;

&lt;p&gt;All/Most of the examples on the following blog do not refer to long-running business transactions (transactions that span multiple database transactions with user-think time in between).&lt;br/&gt;
&lt;a href=&quot;http://weblogs.java.net/blog/2009/07/30/jpa-20-concurrency-and-locking&quot; class=&quot;external-link&quot;&gt;http://weblogs.java.net/blog/2009/07/30/jpa-20-concurrency-and-locking&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course EntityManaher#find et al should be extended with optional lockMode and lockVersion arguments like you said but nevertheless there should still be EntityManager#lock().&lt;/p&gt;</comment>
                    <comment id="12144" author="romanb" created="Sun, 14 Mar 2010 05:23:43 +0000"  >&lt;p&gt;Let me clarify, pessimistic online locks only really make sense for the duration of a transaction since they&apos;re released at the end of a transaction. You dont want to hold such a transaction open during a long-running business transaction (user-think time / multiple requests). Thats why there is no difference in usage of such locks in Java or PHP.&lt;/p&gt;</comment>
                    <comment id="12145" author="lsmith" created="Sun, 14 Mar 2010 05:30:14 +0000"  >&lt;p&gt;actually pessimistic (time limited) offline locks are also commonly used.&lt;/p&gt;</comment>
                    <comment id="12146" author="romanb" created="Sun, 14 Mar 2010 05:32:47 +0000"  >&lt;p&gt;Moreso, even if you &lt;b&gt;do&lt;/b&gt; know you want to lock at the point of reading the entity (which may not be the case like I said above, these decisions can be made in different layers, or even in code of an extension that receives an existing object and now wants to lock it to do its work properly. Without em.lock() that would mean re-reading the whole entity), you may still not want to lock at the point of reading:&lt;/p&gt;

&lt;div class=&quot;code panel&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) read entity
2) &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; some (potentially expensive) computations/calculations/whatever based on the state of the entity but we dont need a lock yet
3) after inspecting the outcome of 2) we decide we want to lock
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(yes, locking after reading risks stale data but it locks for a shorter duration, its a compromise)&lt;/p&gt;

&lt;p&gt;When you can only lock during reading, this would mean in such a case holding the lock unnecessarily long.&lt;/p&gt;</comment>
                    <comment id="12147" author="lsmith" created="Sun, 14 Mar 2010 05:37:38 +0000"  >&lt;p&gt;Err .. what you just described is optimistic offline locking. Aka you read the version identifier, go off do your thing, commit .. possibly discover that there was a concurrent write ..&lt;/p&gt;</comment>
                    <comment id="12148" author="romanb" created="Sun, 14 Mar 2010 05:42:43 +0000"  >&lt;p&gt;@Lukas: Yea. We&apos;re really only talking about pessimistic online locks and optimistic offline locks here. I know there are pessimistic offline locks (D1 even has an implementation of that which I wrote) its not currently in the focus for D2 and can even be provided by an extension.&lt;/p&gt;</comment>
                    <comment id="12149" author="beberlei" created="Sun, 14 Mar 2010 05:48:07 +0000"  >&lt;p&gt;Ok given layering EntityManager#lock() has use-cases.&lt;/p&gt;

&lt;p&gt;However from my experience I want to lock entities at the beginning of long running scripts, because these runs are more important to my business than those small runs from users.&lt;/p&gt;

&lt;p&gt;Say i have an entity that at a certain point in time needs to calculate very expensive stuff, before I start the calculations i would want to make sure that these wont get busted by a user updating the entity during that run, so i would apply SELECT * FOR UPDATE before the calculations and not after them. At point 3 when you apply the lock, you only know if you have a consistent lock between 1 and 3 when you have a version field to check against, a pessimistic lock wont help there.&lt;/p&gt;

&lt;p&gt;The pessimistic lock in EntityManager#lock() makes sense if you want to make sure that after the aquiring no changes happen, for example:&lt;/p&gt;

&lt;p&gt;1. read entity&lt;br/&gt;
2. do some simple checks&lt;br/&gt;
3. realize after 2, we need to make expensive computations, lock() or refresh(entity, lockMode) here? (probably depends if the entity has a version column or not)&lt;br/&gt;
4. do expensive computations&lt;br/&gt;
5. flush&lt;/p&gt;</comment>
                    <comment id="12151" author="romanb" created="Sun, 14 Mar 2010 07:04:28 +0000"  >&lt;p&gt;Based on all the discussion so far I updated the main issue description with an API specification. Feel free to comment.&lt;/p&gt;</comment>
                    <comment id="12152" author="romanb" created="Sun, 14 Mar 2010 07:15:00 +0000"  >&lt;p&gt;Next on my list is working out the transaction semantics for all the cases, i.e. where to enforce that it is invoked inside an active transaction and in which cases the Optimistic/Pessimistic exceptions cause a transaction rollback (or whether there is actually a case in which they do &lt;b&gt;not&lt;/b&gt; result in a rollback).&lt;/p&gt;</comment>
                    <comment id="12153" author="romanb" created="Sun, 14 Mar 2010 07:46:03 +0000"  >&lt;p&gt;First update for transaction requirements.&lt;/p&gt;</comment>
                    <comment id="12179" author="romanb" created="Mon, 15 Mar 2010 10:04:13 +0000"  >&lt;p&gt;Updated refresh() specification.&lt;/p&gt;</comment>
                    <comment id="12560" author="beberlei" created="Sat, 3 Apr 2010 05:50:28 +0000"  >&lt;p&gt;Add another condition for PESSIMITIC locks in combination with find()*&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Refresh entity with lock when entity with id exists in identity map already&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="12561" author="beberlei" created="Sat, 3 Apr 2010 05:57:24 +0000"  >&lt;p&gt;hm actually only EntityManager#lock($entity, $mode) has to be called.&lt;/p&gt;</comment>
                    <comment id="12562" author="beberlei" created="Sat, 3 Apr 2010 10:44:27 +0000"  >&lt;p&gt;Patch for the said functionality, its missing refresh() changes though.&lt;/p&gt;</comment>
                    <comment id="12565" author="beberlei" created="Sun, 4 Apr 2010 12:10:02 +0000"  >&lt;p&gt;I made the following observations on lock timeouts:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;MySQL supports them for InnoDb at the Database Configuration level&lt;/li&gt;
	&lt;li&gt;Postgres has either NO WAIT or no timeout at all&lt;/li&gt;
	&lt;li&gt;Oracle has either NO WAIT, no timeout, or a specified number of miliseconds.&lt;/li&gt;
	&lt;li&gt;Sqlite has no locking&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Unrelated but:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;MsSql has a very weird row lock syntax, we need a new construct in AbstractPlatform for this.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Question:&lt;/p&gt;

&lt;p&gt;Should we support something like lock timeouts via a query hint? If yes:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Should we only specifiy something like setHint(Query::HINT_LOCK_TIMEOUT_NOWAIT, true);&lt;/li&gt;
	&lt;li&gt;or like setHint(Query::HINT_LOCK_TIMEOUT, 0);&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Vendors except Oracle and Postgres would simply ignore this option. Postgres would only support TIMEOUT = 0 as NOWAIT&lt;/p&gt;</comment>
                    <comment id="12818" author="beberlei" created="Sun, 2 May 2010 09:20:25 +0000"  >&lt;p&gt;The latest version of lock-support is available here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/beberlei/doctrine2/tree/lock-support&quot; class=&quot;external-link&quot;&gt;http://github.com/beberlei/doctrine2/tree/lock-support&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Lock Support is now tested using Gearman Job Server allowing to have functional scenarios where waiting for lock releases is necessary, see:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.whitewashing.de/blog/articles/129&quot; class=&quot;external-link&quot;&gt;http://www.whitewashing.de/blog/articles/129&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Refresh() is still missing, I am not sure if this should be included in the 2.0 version (use-case is very slim).&lt;/p&gt;</comment>
                    <comment id="12998" author="romanb" created="Wed, 19 May 2010 06:38:20 +0000"  >&lt;p&gt;Great work so far. I think we can skip refresh() support for now, so post-2.0 if at all.&lt;/p&gt;

&lt;p&gt;@&quot;Should we support something like lock timeouts via a query hint?&quot;&lt;/p&gt;

&lt;p&gt;I think setHint(Query::HINT_LOCK_TIMEOUT, 0) would be good. That way we keep the possibility open for later enhancements regarding other timeout values (i.e. if features change on databases) without requiring public API changes. However, it should be clearly documented that this is a &lt;b&gt;hint&lt;/b&gt; and not a guarantee and it should be documented which database vendors interpret the timeout in which way I think.&lt;br/&gt;
As a start, only having timeout = 0 =&amp;gt; NOWAIT would be enough.&lt;/p&gt;</comment>
                    <comment id="12999" author="romanb" created="Wed, 19 May 2010 06:40:13 +0000"  >&lt;p&gt;You can reschedule the lock timeout / nowait to beta3 if you want that. I think we already have enough for beta2.&lt;/p&gt;</comment>
                    <comment id="13107" author="romanb" created="Sat, 5 Jun 2010 07:06:28 +0000"  >&lt;p&gt;Pushing outstanding work back to beta3.&lt;/p&gt;</comment>
                    <comment id="13509" author="beberlei" created="Sun, 4 Jul 2010 08:38:45 +0000"  >&lt;p&gt;Implemented, Lock Timeouts will be handled in a dedicated ticket.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11033">DDC-410</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10542" name="ddc178_locking.diff" size="26565" author="beberlei" created="Sat, 3 Apr 2010 10:44:27 +0000" />
                    <attachment id="10227" name="ddc178_pessimistic.diff" size="7313" author="beberlei" created="Wed, 9 Dec 2009 22:15:55 +0000" />
                </attachments>
            <subtasks>
            <subtask id="11365">DDC-590</subtask>
            <subtask id="11366">DDC-591</subtask>
        </subtasks>
        </item>

<item>
            <title>[DDC-167] New method: EntityManager#getPartialReference</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-167</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently, EntityManager#getReference can be used to retrieve cheap references to &quot;persistent&quot; objects without actually loading them. The returned proxies only initialize themselves automatically when one of their methods is invoked. This can lead to unnecessary/unwanted initialization in cases of bidirectional associations where the &quot;association management methods&quot; (setFoo) properly set the other side of the association. Example (one-one, User-Address, User owning side):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class User {
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $address;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setAddress(Address $address) {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($address !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;address) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;address = $address;
            $address-&amp;gt;setUser($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        }
    }
}

class Address {
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $user;
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUser(User $user) {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($user !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user = $user;
            $user-&amp;gt;setAddress($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, assuming the following code that makes use of getReference to associate a user to an address but actually wants to avoid loading the address.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// assuming $user is already loaded and now we want to associate it to an existing address
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// but without actually loading the address
&lt;/span&gt;
$addressId = 42; &lt;span class=&quot;code-comment&quot;&gt;// from request, $_POST/$_GET/...
&lt;/span&gt;$address = $em-&amp;gt;getReference(&apos;Address&apos;, $addressId);

$user-&amp;gt;setAddress($address); &lt;span class=&quot;code-comment&quot;&gt;// calls $address-&amp;gt;setUser which initializes the proxy!
&lt;/span&gt;$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A possible solution could be to allow obtaining single references to partial objects through the EntityManager. Partial objects can already be fetched through querying with the Query::HINT_FORCE_PARTIAL_LOAD query hint so the possibility to get a single partial object by ID seems to make sense.&lt;/p&gt;

&lt;p&gt;A proposed method name is: getPartialReference($className, $id). It would return a managed (partial) instance of $className where only the identifier is populated and that will not initialize itself (hence &quot;partial&quot;). In the example above, usage of a partial reference object would avoid the extra initialization.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10482">DDC-167</key>
            <summary>New method: EntityManager#getPartialReference</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Nov 2009 21:54:10 +0000</created>
                <updated>Thu, 22 Jul 2010 09:43:58 +0000</updated>
                    <resolved>Tue, 20 Jul 2010 08:28:48 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10808" author="beberlei" created="Fri, 20 Nov 2009 23:58:58 +0000"  >&lt;p&gt;Sounds good to me, the method name is also very clear about that the retrieved object is partial, the only negative is that its really the only use-case for this method.&lt;/p&gt;</comment>
                    <comment id="10809" author="romanb" created="Sat, 21 Nov 2009 08:38:56 +0000"  >&lt;p&gt;I think this has some more use-cases. For example if you only want a single object and you have its ID and all you really need is the ID during that request. Proxy objects are initialized even if you call getId() because we (the proxy) cant know what happens inside that method.&lt;/p&gt;

&lt;p&gt;Of course, partial objects are always dangerous and I think this is made pretty clear in the manual but the choice is up to the user in the end.&lt;/p&gt;</comment>
                    <comment id="12113" author="romanb" created="Fri, 12 Mar 2010 06:25:23 +0000"  >&lt;p&gt;Another interesting use-case: updating an object without loading it (as an alternative to a DQL bulk UPDATE):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$user = $em-&amp;gt;getPartialReference(&apos;User&apos;, $userId);
$user-&amp;gt;setName(&apos;newname&apos;);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of course one needs to be aware that the original entity data in such an update is not &quot;correct&quot;, i.e. when using event listeners.&lt;/p&gt;</comment>
                    <comment id="13002" author="romanb" created="Wed, 19 May 2010 06:43:31 +0000"  >&lt;p&gt;Rescheduling for beta3.&lt;/p&gt;</comment>
                    <comment id="13630" author="mzach" created="Wed, 21 Jul 2010 06:36:39 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;this fix needs to be implemented in UnitOfWork on line 612 (function persistNew()) as well - when I try to save an entity, I get an Exception from my error handler:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ErrorException with Argument 2 passed to Doctrine\ORM\Mapping\ClassMetadata::setIdentifierValues() must be an array, integer given, called in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php on line 612 and defined
Backtrace: #0: Doctrine\ORM\Mapping\ClassMetadata-&amp;gt;setIdentifierValues at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:612
#1: Doctrine\ORM\UnitOfWork-&amp;gt;persistNew at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:1247
#2: Doctrine\ORM\UnitOfWork-&amp;gt;doPersist at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/UnitOfWork.php:1210
#3: Doctrine\ORM\UnitOfWork-&amp;gt;persist at /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/svn/cWorld_ZF/branches/devel-trunk/library/Doctrine/ORM/EntityManager.php:438
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The relevant code in UoW 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;            $idValue = $idGen-&amp;gt;generate($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;em, $entity);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $idGen &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; \Doctrine\ORM\Id\AssignedGenerator) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityIdentifiers[$oid] = array($class-&amp;gt;identifier[0] =&amp;gt; $idValue);
                $class-&amp;gt;setIdentifierValues($entity, $idValue);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We&apos;re using the SequenceGenerator&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;@SequenceGenerator(allocationSize=1,sequenceName=&lt;span class=&quot;code-quote&quot;&gt;&quot;address_id_seq&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which doesn&apos;t return an array, so the array typehint fails and generates an error.&lt;/p&gt;</comment>
                    <comment id="13631" author="mzach" created="Wed, 21 Jul 2010 08:20:40 +0000"  >&lt;p&gt;Possible fix in UoW, line 612:&lt;/p&gt;

&lt;div class=&quot;code panel&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-&amp;gt;setIdentifierValues($entity, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityIdentifiers[$oid]);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13635" author="beberlei" created="Wed, 21 Jul 2010 08:49:01 +0000"  >&lt;p&gt;please open a new issue, or reopen this one. posting into closed issues does more harm than good &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="13655" author="mzach" created="Thu, 22 Jul 2010 08:15:36 +0000"  >&lt;p&gt;Hello Benjamin,&lt;/p&gt;

&lt;p&gt;since I&apos;ve no rights to re-open this entry I had to create a new one: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-714&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-714&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13656" author="beberlei" created="Thu, 22 Jul 2010 09:43:58 +0000"  >&lt;p&gt;hm, maybe our user-rirghts arre strange. I look into it later&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-130] Cascading and @ManyToMany associations is broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-130</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have two Entities: Users and Alerts. They are associated with @ManyToMany, the assiciation table should be &quot;user_alert&quot;. &lt;/p&gt;

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

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


&lt;p&gt;The &quot;remove&quot; command in the sample code deletes the user entry and alert entry, but not the user_alert entry (which was automatically created though). This leaves an orphan entry (or the DBMS will complain because of FK constraints).&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;INSERT INTO users (name) VALUES (?)
array(1) {
  [1]=&amp;gt;
  string(3) &quot;Bob&quot;
}
INSERT INTO alert (name) VALUES (?)
array(1) {
  [1]=&amp;gt;
  string(9) &quot;Testalert&quot;
}
INSERT INTO user_alert (userId, alertId) VALUES (?, ?)
array(2) {
  [0]=&amp;gt;
  int(1)
  [1]=&amp;gt;
  int(1)
}
DELETE FROM users WHERE id = ?
array(1) {
  [0]=&amp;gt;
  int(1)
}
DELETE FROM alert WHERE id = ?
array(1) {
  [0]=&amp;gt;
  int(1)
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The user_alert table should be automatically updated (on creation &lt;em&gt;and&lt;/em&gt; removal)...&lt;/p&gt;</description>
                <environment></environment>
            <key id="10368">DDC-130</key>
            <summary>Cascading and @ManyToMany associations is broken</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="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="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Nov 2009 09:28:08 +0000</created>
                <updated>Sat, 10 Jul 2010 08:11:06 +0000</updated>
                    <resolved>Sat, 10 Jul 2010 08:10:29 +0000</resolved>
                                            <fixVersion>2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10586" author="romanb" created="Wed, 11 Nov 2009 12:52:25 +0000"  >&lt;p&gt;I think in most cases the entry in the association table should be deleted by the FK constraint. However I think that is currently not the default. You can force it by using onDelete=&quot;CASCADE&quot; on the @JoinColumn definitions inside the @JoinTable. That should probably be set by default on join columns on an association table.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure its worth supporting manual deletion of association table entries through Doctrine as all databases support proper foreign key constraints and this is the most effective way to delete these entries and also enforces the integrity on the database side.&lt;/p&gt;

&lt;p&gt;So I&apos;m rather voting for making onDelete=&quot;CASCADE&quot; the default for join columns of association tables unless specified otherwise.&lt;/p&gt;</comment>
                    <comment id="10637" author="romanb" created="Fri, 13 Nov 2009 18:54:55 +0000"  >&lt;p&gt;It appears that this doesnt work in JPA(2) either, or well, it depends on the implementation provider. But cascade=REMOVE on @ManyToMany is not allowed per the spec.&lt;/p&gt;

&lt;p&gt;This issue here is probably one of the reasons for this. Meaning there might be no easy way for the ORM to deal with entries in association tables transparently on cascade=REMOVE.&lt;/p&gt;

&lt;p&gt;We have the following options:&lt;/p&gt;

&lt;p&gt;1) Disallow cascade=REMOVE on ManyToManyMapping (throw a MappingException)&lt;/p&gt;

&lt;p&gt;2) Allow it but clearly document that entries in association tables are not removed by Doctrine, so that you need to apply onDelete=&quot;CASCADE&quot; on the @JoinColumn definitions. Are there any more caveats with this I can not think of currently?&lt;/p&gt;

&lt;p&gt;3) Someone has an idea for transparently deleting entries in association tables on cascade=REMOVE. Solutions would need to be performant and not too cumbersome to implement.&lt;/p&gt;

&lt;p&gt;Waiting for feedback.&lt;/p&gt;</comment>
                    <comment id="10639" author="beberlei" created="Sat, 14 Nov 2009 12:21:03 +0000"  >&lt;p&gt;Hm after thinking about it the problem is that the collection has to be either:&lt;/p&gt;

&lt;p&gt;1. loaded into memory completely and put through to regular remove a single entity process. This would be required to mark entities for deleted that are also hydrated but attached to another many to many collection of this type.&lt;br/&gt;
2. selected for all their ids and there should be a many to many deletion mechanism that works based on id, however then also finds also hydrated entities based on their id.&lt;/p&gt;</comment>
                    <comment id="10648" author="nicokaiser" created="Mon, 16 Nov 2009 08:57:00 +0000"  >&lt;p&gt;Hm, I don&apos;t know if my report was unclear... What I meant was automatic update of the join table (&quot;user_alert&quot; in this example). When I delete e.g. a User, I don&apos;t want to have to care about updates in the &quot;user_alert&quot; table - this table was automatically generated (by the @JoinTable statement), so it should be automatically updated, e.g. when I delete either a User or an Alert...&lt;/p&gt;</comment>
                    <comment id="10770" author="alex" created="Thu, 19 Nov 2009 11:22:56 +0000"  >&lt;p&gt;How about removing a relation between a user and an alert?&lt;/p&gt;

&lt;p&gt;Meaning the user and alert both remain in the database but they are not connected anymore (think about users with multiple roles).&lt;/p&gt;</comment>
                    <comment id="10771" author="romanb" created="Thu, 19 Nov 2009 11:33:54 +0000"  >&lt;p&gt;@Alexander: Just like in normal OOP. If a user as a collection of alerts and an alert a collection of users (bidirectional many-many) and you want to remove an alert from a user you simply remove the alert from the collection and the user from the collection of the corresponding alert. This is very clean, the only problem with this is the efficiency because in order to remove the elements from the collections, the collections must be loaded. (Strictly speaking, you only need to adjust the &quot;owning side&quot;, so only 1 collection needs to be loaded). Of course you can always use some custom SQL that directly manipulates the intermediate table. See also &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-128&quot; title=&quot;Consider adding EntityManager#link/unlink methods for direct association manipulation&quot;&gt;DDC-128&lt;/a&gt;. Also there is &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-45&quot; title=&quot;Consider changing the contract of Collection#remove&quot;&gt;&lt;del&gt;DDC-45&lt;/del&gt;&lt;/a&gt; but I dont think thats doable.&lt;/p&gt;

&lt;p&gt;Collections of entities always only represent the association of the entity that has the collection and the contained entities. If you remove an entity from a collection, the association is removed, not the entity itself. &quot;The association is removed&quot; means that either the foreign key is NULLed out (in the case of one-to-many) or that the entry in the association table is removed.&lt;/p&gt;</comment>
                    <comment id="10772" author="alex" created="Thu, 19 Nov 2009 12:01:55 +0000"  >&lt;p&gt;@Roman: All sounds very simple. But in practice this doesn&apos;t seem to work.&lt;br/&gt;
I have the following:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$uRep = $em-&amp;gt;getRepository(&apos;System_User&apos;);
$user = $uRep-&amp;gt;findOneById(1);
unset($user-&amp;gt;roles[0]);
$em-&amp;gt;persist($user);
$em-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, when I clear the manager and reload the user:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;If the user had 1 role -&amp;gt; it still has one role&lt;/li&gt;
	&lt;li&gt;If the user had more roles -&amp;gt; it still has the removed role and all others are duplicated.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="10773" author="romanb" created="Thu, 19 Nov 2009 12:07:34 +0000"  >&lt;p&gt;@Alexander: Please open a separate issue for this. Thanks.&lt;/p&gt;</comment>
                    <comment id="12859" author="mjh_ca" created="Thu, 6 May 2010 12:51:19 +0000"  >&lt;p&gt;Pastebin entries have expired and this bug is not attached to a specific version so it is difficult to tell the status.  Nico, is this still a problem with the current release?&lt;/p&gt;</comment>
                    <comment id="12987" author="romanb" created="Mon, 17 May 2010 14:30:42 +0000"  >&lt;p&gt;My currently proposed solution to this would be to simply make onDelete=&quot;CASCADE&quot; the default for join columns in join tables. Anyone has a strong objection or better idea?&lt;/p&gt;</comment>
                    <comment id="13469" author="beberlei" created="Wed, 30 Jun 2010 16:05:30 +0000"  >&lt;p&gt;sounds good to me&lt;/p&gt;</comment>
                    <comment id="13550" author="beberlei" created="Fri, 9 Jul 2010 14:02:27 +0000"  >&lt;p&gt;Other tools actually delete the related records manually, no cascading involved. Since Sqlite doesn&apos;t even support foreign keys we should probably do the same instead of relying on &quot;onDelete&quot;=&quot;cascade&quot;.&lt;/p&gt;

&lt;p&gt;Whats your take roman?&lt;/p&gt;</comment>
                    <comment id="13551" author="beberlei" created="Fri, 9 Jul 2010 14:11:58 +0000"  >&lt;p&gt;We have to support this anyways for the following reason:&lt;/p&gt;

&lt;p&gt;Doctrine 2 gives you absolutely no access to the many-to-many join table, i.e. to be working with cascade it should not only be the default, but the only option (since other options don&apos;t work). We need to extend the way &quot;delete&quot; works inside each persister to also clean up many-to-many tables.&lt;/p&gt;

&lt;p&gt;We need this mechanism anyways for Element Collections to delete all the related entries.&lt;/p&gt;

&lt;p&gt;The option onDelete=&quot;cascade|noaction&quot; is therefore only a hint for the persisters to decide if they perform this action themselves, or let the database vendor perform it.&lt;/p&gt;</comment>
                    <comment id="13552" author="beberlei" created="Fri, 9 Jul 2010 16:57:06 +0000"  >&lt;p&gt;I pushed my proposed changes to a feature branch: &lt;a href=&quot;http://github.com/doctrine/doctrine2/tree/DDC-130&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine2/tree/DDC-130&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are definatly refactorings that need to be done, however in that state its currently doing its job very well.&lt;/p&gt;</comment>
                    <comment id="13557" author="beberlei" created="Sat, 10 Jul 2010 02:15:50 +0000"  >&lt;p&gt;What about DQL DELETE?&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;DELETE FROM Boo WHERE bar
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For each join table:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;DELETE FROM join_foo WHERE (SELECT id FROM foo WHERE bar)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Can this be done determinstically?&lt;/p&gt;</comment>
                    <comment id="13558" author="beberlei" created="Sat, 10 Jul 2010 02:52:56 +0000"  >&lt;p&gt;The DQL stuff is just way to much to add. Foreign Key constraints should fail in these cases imho&lt;/p&gt;</comment>
                    <comment id="13560" author="romanb" created="Sat, 10 Jul 2010 04:39:30 +0000"  >&lt;p&gt;I think we have to do this on bulk deletion then, too.&lt;/p&gt;

&lt;p&gt;Examples from EclipseLink:&lt;/p&gt;

&lt;div class=&quot;code panel&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.createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;delete from User2 u where u.id=1&quot;&lt;/span&gt;).executeUpdate();
=&amp;gt;
DELETE FROM USER2_GROUP2 WHERE EXISTS(SELECT ID FROM USER2 WHERE (ID = ?) AND ID = USER2_GROUP2.User2_ID)
DELETE FROM USER2 WHERE (ID = ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;em.createQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;delete from User2 u&quot;&lt;/span&gt;).executeUpdate();
=&amp;gt;
DELETE FROM USER2_GROUP2
DELETE FROM USER2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13561" author="beberlei" created="Sat, 10 Jul 2010 08:10:29 +0000"  >&lt;p&gt;Fixed in master using the following semantics:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;If a many-to-many join table is to be found not using onDelete=&quot;CASCADE&quot; execute this manually&lt;/li&gt;
	&lt;li&gt;In self-referential relationships delete both possible pairs.&lt;/li&gt;
	&lt;li&gt;Use Database onDelete=&quot;CASCADE&quot; if present on both foreign keys of the join table.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Tested against normal entities, self-referential, CTI and STI, from the owning and the inverse side.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="11605">DDC-677</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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


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

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

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

<item>
            <title>[DDC-13] Enhance DQL chapter</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-13</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The first half of the chapter &quot;DQL - Doctrine Query Language&quot; needs more examples and detailed explanations about DQL. The explanations need to be understandable and friendly for newcomers with no Doctrine 1.x experience. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10063">DDC-13</key>
            <summary>Enhance DQL chapter</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Sep 2009 10:04:03 +0000</created>
                <updated>Thu, 15 Jul 2010 10:55:57 +0000</updated>
                    <resolved>Thu, 15 Jul 2010 10:55:57 +0000</resolved>
                            <version>2.0-BETA1</version>
                                <fixVersion>2.0-BETA3</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12284" author="romanb" created="Tue, 16 Mar 2010 13:02:05 +0000"  >&lt;p&gt;Benjaming already made quite some progress on this chapter. More to come for BETA2.&lt;/p&gt;</comment>
                    <comment id="13587" author="romanb" created="Thu, 15 Jul 2010 10:07:00 +0000"  >&lt;p&gt;Feel free to close this if you think the DQL docs are already good enough &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="13588" author="beberlei" created="Thu, 15 Jul 2010 10:55:57 +0000"  >&lt;p&gt;Cover all the important topics now, refactoring and extension could be another ticket.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>