<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 12:32:18 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/si/jira.issueviews:issue-xml/DDC-658/DDC-658.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

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

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

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

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

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

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

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

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

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

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

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

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

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

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