I had exactly the same problem and renamed the discriminator column from `type` to `reference_type`. This solved the issue.
Am Sonntag, 24. März 2013 22:41:49 UTC+1 schrieb [email protected]: > > Hello, i'm having a few issues with my CTI setup, i'm receiving the bleow > error message:- > > The discriminator column "type" is missing for "User" using the DQL alias > "r". > > When running the below in my application:- > > $user = $this->entityManager->getRepository("Ajfit\Entity\User") > ->findOneById($userId); > > this is my abstract entity:- > > /** > * User > * > * @ORM\Table(name="user") > * @ORM\InheritanceType("JOINED") > * @ORM\DiscriminatorColumn(name="type", type="string") > * @ORM\DiscriminatorMap({"user" = "User", "customer" = > "Customer", "engineer" = "Engineer"}) > * @ORM\Entity(repositoryClass="Ajfit\Repository\User") > */ > abstract class User > { > /** > * @var integer $id > * > * @ORM\Column(type="integer") > * @ORM\Id > * @ORM\GeneratedValue > */ > protected $id; > } > > these are my child entities:- > > /** > * Engineer > * > * @ORM\Table(name="engineer") > * @ORM\Entity(repositoryClass="Ajfit\Repository\Engineer") > * @ORM\HasLifecycleCallbacks > */ > > class Engineer extends User > { > } > > /** > * Customer > * > * @ORM\Table(name="customer") > * @ORM\Entity(repositoryClass="Ajfit\Repository\Customer") > * @ORM\HasLifecycleCallbacks > */ > > class Customer extends User > { > } > > This is the SQL DDL in the mysql database:- > > CREATE TABLE `user` ( > `id` int(11) unsigned NOT NULL AUTO_INCREMENT, > `type` varchar(45) DEFAULT NULL, > PRIMARY KEY (`id`), > KEY `type` (`type`) > ); > > CREATE TABLE `customer` ( > `id` int(11) unsigned NOT NULL, > KEY `customer_user_idx` (`id`), > CONSTRAINT `customer_user` FOREIGN KEY (`id`) REFERENCES `user` (`id`) > ON DELETE NO ACTION ON UPDATE NO ACTION > ); > > CREATE TABLE `engineer` ( > `id` int(11) unsigned NOT NULL, > KEY `engineer_user_idx` (`id`), > CONSTRAINT `engineer_user` FOREIGN KEY (`id`) REFERENCES `user` (`id`) > ON DELETE NO ACTION ON UPDATE NO ACTION > ); > > Please can someone help me with this because it seems like i'm going round > and round in circles. > > Thanks > > Andrew > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
