Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-117 Allow @Id on @ManyToOne fields
  3. DDC-658

Reverse engineering with Oracle (DBDriver and Associations as Identifier)

    Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.x
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Ubuntu 10.04 + Oracle 11g Entreprise + PHP 5.3.2 + Doctrine2 Git (up-to-date)

      Description

      I am playing with reverse engineering with Oracle and I have some problems:

      My schema:

      drop table PHONE_NUMBER;
      drop table CUSTOMER;
      
      create table CUSTOMER (
         CUSTOMER_ID             NUMBER(4)                       not null,
         CUSTOMER_LASTNAME       VARCHAR2(50)                    not null,
         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 null,
         CUSTOMER_ID             NUMBER(4)                       not null,
         PHONE_NUMBER            VARCHAR2(50)                    not null,
         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);
      

      I obtain "Fatal error: Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Property "customerId" in "PhoneNumber" was already declared, but it must be declared only once'"

      It's because a foreign key is a component of the primary key.

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Mickael Perraud
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: