[Solved] Doctrine 'AnnotationException' when creating database from Entites with inheritance

0 votes
asked Feb 27, 2013 in Solved by renaatdemuynck (840 points)
recategorized Mar 13, 2013 by ludek.vodicka

When trying to create the database from generated Entity classes with inheritance I get an AnnotationException.

This is an example entity:

/** 
 * @ORM\Entity
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="dtype", type="string")
 * @ORM\DiscriminatorMap({
 *     administrator="Application\Model\Entity\Administrator"
 * })
 */
class User
{
    //...
}

This is the error I get:

[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] Couldn't find constant administrator, class Application\Model\Entity\User.

It seems that the keys in the DiscriminatorMap should be quoted like this:

 * @ORM\DiscriminatorMap({
 *     "administrator"="Application\Model\Entity\Administrator"
 * })
commented Feb 27, 2013 by ludek.vodicka Skipper developer (140,450 points)

Thanks for info, we will fix it.

commented Mar 7, 2013 by ludek.vodicka Skipper developer (140,450 points)

Fixed and prepared for release.

1 Answer

0 votes
answered Mar 13, 2013 by ludek.vodicka Skipper developer (140,450 points)
selected Mar 14, 2013 by renaatdemuynck
 
Best answer

New version 2.1.10.697 with this feature/bugfix was released.
Please download latest version here http://www.orm-designer.com/download-orm-designer

...