Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-2189

Bidirectional one-to-many association with Class Table Inheritance do not work

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
    • Environment:

      Description

      Bidirectional one-to-many association with Class Table Inheritance does not work. Example.

      Entity Box;
      Entity Item;
      Entity BoxItem extends Item;

      BoxItem has ManyToOne to Box;
      Box has OneToMany to BoxItems;

      Validation Error:
      Got an error: Entities\Box: "The association Entities\Box#items refers to the owning side field Entities\BoxItem#box which does not exist.",

      1. Box.php
        0.6 kB
        Marco Pivetta
      2. Box.php
        0.6 kB
        Ro
      3. BoxItem.php
        0.4 kB
        Marco Pivetta
      4. BoxItem.php
        0.5 kB
        Ro
      5. Item.php
        0.5 kB
        Marco Pivetta
      6. Item.php
        0.6 kB
        Ro
      7. testing_box.sql
        2 kB
        Ro

        Activity

        syao.work Ro created issue -
        Hide
        ocramius Marco Pivetta added a comment -

        Not a blocker

        Show
        ocramius Marco Pivetta added a comment - Not a blocker
        ocramius Marco Pivetta made changes -
        Field Original Value New Value
        Priority Blocker [ 1 ] Major [ 3 ]
        syao.work Ro made changes -
        Attachment BoxItem.php [ 11356 ]
        syao.work Ro made changes -
        Attachment BoxItem.php [ 11359 ]
        Hide
        ocramius Marco Pivetta added a comment -

        Ro this looks invalid to me.

            /**
             * @MayToOne(targetEntity="Asmuo", inversedBy="items")
             * @JoinColumn(name="box_id", referencedColumnName="id")
             */
            protected $box;
        

        What's `Asmuo`?

        Show
        ocramius Marco Pivetta added a comment - Ro this looks invalid to me. /** * @MayToOne(targetEntity= "Asmuo" , inversedBy= "items" ) * @JoinColumn(name= "box_id" , referencedColumnName= "id" ) */ protected $box; What's `Asmuo`?
        Hide
        syao.work Ro added a comment -

        Sorry, I did post wrong file BoxItem, my mistake, but the bug persists.

        Show
        syao.work Ro added a comment - Sorry, I did post wrong file BoxItem, my mistake, but the bug persists.
        Hide
        ocramius Marco Pivetta added a comment - - edited

        Just checked on my side with attached entities (changed some namespaces, see latest attached files) and everything's fine.
        Ro you got a typo on one of your annotations, which is `MayToOne` and should be `ManyToOne`.

        Show
        ocramius Marco Pivetta added a comment - - edited Just checked on my side with attached entities (changed some namespaces, see latest attached files) and everything's fine. Ro you got a typo on one of your annotations, which is `MayToOne` and should be `ManyToOne`.
        ocramius Marco Pivetta made changes -
        Attachment Box.php [ 11360 ]
        Attachment BoxItem.php [ 11361 ]
        Attachment Item.php [ 11362 ]
        ocramius Marco Pivetta made changes -
        Status Open [ 1 ] Awaiting Feedback [ 10000 ]
        beberlei Benjamin Eberlei made changes -
        Status Awaiting Feedback [ 10000 ] In Progress [ 3 ]
        Hide
        beberlei Benjamin Eberlei added a comment -

        Error caused by Invalid mapping

        Show
        beberlei Benjamin Eberlei added a comment - Error caused by Invalid mapping
        beberlei Benjamin Eberlei made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={expand=changesets[0:20].revisions[0:29],reviews, query=DDC-2189}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            beberlei Benjamin Eberlei
            Reporter:
            syao.work Ro
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: