{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/481","labels_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/481/comments","events_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/481/events","html_url":"https://github.com/doctrine/DoctrineModule/issues/481","id":59618513,"number":481,"title":"Embeddables on a inherited entity","user":{"login":"vvh-empora","id":5236105,"avatar_url":"https://avatars.githubusercontent.com/u/5236105?v=3","gravatar_id":"","url":"https://api.github.com/users/vvh-empora","html_url":"https://github.com/vvh-empora","followers_url":"https://api.github.com/users/vvh-empora/followers","following_url":"https://api.github.com/users/vvh-empora/following{/other_user}","gists_url":"https://api.github.com/users/vvh-empora/gists{/gist_id}","starred_url":"https://api.github.com/users/vvh-empora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvh-empora/subscriptions","organizations_url":"https://api.github.com/users/vvh-empora/orgs","repos_url":"https://api.github.com/users/vvh-empora/repos","events_url":"https://api.github.com/users/vvh-empora/events{/privacy}","received_events_url":"https://api.github.com/users/vvh-empora/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/doctrine/DoctrineModule/labels/question","name":"question","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-03T09:54:15Z","updated_at":"2015-04-11T11:42:03Z","closed_at":null,"body":"hi, i have two problems for one issue. first the entity relations...\r\n\r\n```PHP\r\n/**\r\n * Description of GlobalObject\r\n * \r\n * @ORM\\Table(name=\"global_object\")\r\n * @ORM\\Entity(repositoryClass=\"KernelBundle\\Repository\\GlobalRepository\")\r\n * \r\n * @ORM\\InheritanceType(\"JOINED\")\r\n * @ORM\\DiscriminatorColumn(name=\"discriminator\", type=\"string\")\r\n * @ORM\\HasLifecycleCallbacks()\r\n */\r\nabstract class GlobalObject extends ActiveDBEntity { //ActiveDBEntity active record wrapper\r\n    use Dated; //this trait added a created & updated filed\r\n\t/**\r\n\t * Set createdAt \r\n\t * \r\n\t * @ORM\\PrePersist \r\n\t */\r\n\tpublic function _prePersist() {\r\n\t\tif (!($this->createdAt instanceof \\DateTime)) { //import fix\r\n\t\t\t$this->createdAt = new \\DateTime();\r\n\t\t}\r\n\t\t$this->updatedAt = new \\DateTime();\r\n\t}\r\n}\r\n\r\n\r\n/**\r\n * Description of Media\r\n *\r\n * @ORM\\Table(name=\"media\")\r\n * @ORM\\Entity(repositoryClass=\"MediathekBundle\\Repository\\MediaRepository\")\r\n * @ORM\\EntityListeners({\"MediathekBundle\\Entity\\Listener\\MediaListener\"})\r\n */\r\nabstract class Media extends KernelBundle\\Entity\\GlobalObject implements MediaInterface {\r\n    /**\r\n     * @var string\r\n     *\r\n     * @ORM\\Column(name=\"distribution_hash\", type=\"string\", length=128, nullable=false)\r\n     */\r\n    private $distributionHash;\r\n\r\n    /**\r\n     * @var integer\r\n     *\r\n     * @ORM\\Column(name=\"size\", type=\"integer\", nullable=false)\r\n     */\r\n    private $size = 0;\r\n\r\n    /**\r\n     * @var MimeType\r\n     * @ORM\\ManyToOne(targetEntity=\"MediathekBundle\\Entity\\MimeType\")\r\n     * @ORM\\JoinColumn(name=\"mime_type_id\", referencedColumnName=\"id\")\r\n     */\r\n    private $mimeType;\r\n\r\n    // ... getter and setter ...\r\n}\r\n\r\n/**\r\n * Description of Dimension\r\n *\r\n * @ORM\\Embeddable\r\n */\r\nclass Dimension {\r\n    /**\r\n     * @var int\r\n     * @ORM\\Column(name=\"width\", type=\"integer\", nullable=false)\r\n     */\r\n    private $width;\r\n\r\n    /**\r\n     * @var int\r\n     * @ORM\\Column(name=\"height\", type=\"integer\", nullable=false)\r\n     */\r\n    private $height;\r\n\r\n    // ... getter and setter ...\r\n}\r\n\r\n/**\r\n * Description of Image\r\n *\r\n * @ORM\\Table(name=\"media_image\")\r\n * @ORM\\Entity(repositoryClass=\"MediathekBundle\\Repository\\ImageRepository\")\r\n */\r\nclass Image extends Media implements ImageInterface {\r\n\r\n    /**\r\n     * @var Dimension\r\n     * @ORM\\Embedded(class = \"MediathekBundle\\Entity\\Embeddable\\Dimension\", columnPrefix = false)\r\n     */\r\n    protected $dimension;\r\n\r\n    // ... getter and setter ...\r\n}\r\n\r\n/**\r\n * Description of Image\r\n *\r\n * @ORM\\Table(name=\"media_video\")\r\n * @ORM\\Entity(repositoryClass=\"MediathekBundle\\Repository\\VideoRepository\")\r\n */\r\nclass Video extends Image implements VideoInterface {\r\n\r\n\t/**\r\n\t * @var integer\r\n\t *\r\n\t * @ORM\\Column(name=\"length\", type=\"integer\", nullable=false)\r\n\t */\r\n\tprivate $length;\r\n\r\n\t/**\r\n\t * @var string\r\n\t *\r\n\t * @ORM\\Column(name=\"codec\", type=\"string\", length=45, nullable=false)\r\n\t */\r\n\tprivate $codec;\r\n\r\n    // ... getter and setter ...\r\n}\r\n```\r\n\r\nthe first problem:\r\nif i set the \"dimension\" property from the \"Image\" entity to \"private\", i get for the \"Video\" entity this error:\r\n\r\n> Property MediathekBundle\\Entity\\Video::$dimension does not exist in vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php at line 80\r\n\r\nthis will \"easy fixing\" by set the \"dimension\" property to protected... but now the second problem:\r\n\r\nnow, i will get this error on persisting a new image entity:\r\n\r\n> DriverException: An exception occurred while executing 'INSERT INTO media_image (id, , width, height) VALUES (?, ?, ?, ?)' with params [2918195, 1024, 768]:\r\n>\r\n> SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens\r\n\r\nafter some debugging the code, i can see, that doctrine try to evulate the \"dimension\" property as a fully quallified field but it get a NULL value for a DB-Field (thats right, \"dimension\" dosnt exists...)...\r\n\r\nwhats wrong? how can i fix this?\r\n\r\ngreez & thx,,,"},"comment":{"url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/comments/91831485","html_url":"https://github.com/doctrine/DoctrineModule/issues/481#issuecomment-91831485","issue_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/481","id":91831485,"user":{"login":"gianarb","id":1630267,"avatar_url":"https://avatars.githubusercontent.com/u/1630267?v=3","gravatar_id":"","url":"https://api.github.com/users/gianarb","html_url":"https://github.com/gianarb","followers_url":"https://api.github.com/users/gianarb/followers","following_url":"https://api.github.com/users/gianarb/following{/other_user}","gists_url":"https://api.github.com/users/gianarb/gists{/gist_id}","starred_url":"https://api.github.com/users/gianarb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianarb/subscriptions","organizations_url":"https://api.github.com/users/gianarb/orgs","repos_url":"https://api.github.com/users/gianarb/repos","events_url":"https://api.github.com/users/gianarb/events{/privacy}","received_events_url":"https://api.github.com/users/gianarb/received_events","type":"User","site_admin":false},"created_at":"2015-04-11T11:42:03Z","updated_at":"2015-04-11T11:42:03Z","body":"Hi @vvh-empora have you solve this problem?\r\nHave you see this [docs](http://doctrine-orm.readthedocs.org/en/latest/reference/inheritance-mapping.html)? :)"}}