[DDC-2189] Bidirectional one-to-many association with Class Table Inheritance do not work Created: 06/Dec/12  Updated: 24/Dec/12  Resolved: 24/Dec/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Ro Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: Mapping
Environment:

PHP 5.4.8 (cli) (built: Oct 18 2012 13:02:07)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

Fedora Linux 17

mysql Ver 14.14 Distrib 5.5.28, for Linux (x86_64) using readline 5.1


Attachments: File Box.php     File Box.php     File BoxItem.php     File BoxItem.php     File Item.php     File Item.php     File testing_box.sql    

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



 Comments   
Comment by Marco Pivetta [ 06/Dec/12 ]

Not a blocker

Comment by Marco Pivetta [ 06/Dec/12 ]

Ro this looks invalid to me.

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

What's `Asmuo`?

Comment by Ro [ 06/Dec/12 ]

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

Comment by Marco Pivetta [ 06/Dec/12 ]

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`.

Comment by Benjamin Eberlei [ 24/Dec/12 ]

Error caused by Invalid mapping

Generated at Thu Jul 31 17:53:39 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.