Skip to content

Loading…

DDC-2189: Bidirectional one-to-many association with Class Table Inheritance do not work #2882

Closed
doctrinebot opened this Issue · 6 comments

2 participants

@doctrinebot

Jira issue originally created by user syao.work:

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.",

@doctrinebot

Comment created by @ocramius:

Not a blocker

@doctrinebot

Comment created by @ocramius:

[~syao.work] this looks invalid to me.

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

What's Asmuo?

@doctrinebot

Comment created by syao.work:

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

@doctrinebot

Comment created by @ocramius:

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

@doctrinebot

Comment created by @beberlei:

Error caused by Invalid mapping

@doctrinebot

Issue was closed with resolution "Invalid"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.