Hi Guys,
I'm currently working with Class Table Inheritance, but I can't even get the
most simple DQL query to work.
The following DQL query:
SELECT b FROM \Fruitbomen\Models\Organization\Employee b
Results in the following SQL query:
SELECT p0_.id AS id0, p0_.givenname AS givenname1, p0_.surname AS surname2,
e1_.username AS username3, e1_.password AS password4, e1_.showprofile AS
showprofile5, e1_.description AS description6, e1_.email AS email7 FROM
employees e1_
The code I use to describe the two classes is as following:
Person.php
/** * @ORM\Entity @ORM\Table(name="persons") * *
> ORM\@InheritanceType("JOINED") * ORM\@DiscriminatorColumn(name="discr",
> type="string") * ORM\@DiscriminatorMap({"person" = "Person", "employee" =
> "Employee"}) */ class Person extends \Fruitbomen\Models\ModelBase{ /**
> @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue **/ protected $id;
> /** @ORM\Column(type="string") */ protected $givenname; /**
> @ORM\Column(type="string") */ protected $surname; // Skipped for clarity..
>
> Employee.php
> /** * Class Employee * @package Fruitbomen\Models\Organization *
> @ORM\Entity(repositoryClass="\Fruitbomen\Repositories\Organization\Employee")
> @ORM\Table(name="employees") */ class Employee extends Person{ /**
> @ORM\Column(type="string", unique=true, nullable=true) */ protected
> $username = null; /** @ORM\Column(type="string", nullable=true) */
> protected $password = null; /** @ORM\Column(type="boolean") */ protected
> $showprofile = false; /** @ORM\Column(type="text", nullable=true) */
> protected $description; /** @var @ORM\Column(type="string", nullable=true)
> */ protected $email; // Skipped for clarity..
>
I think there might be something wrong with the annotations, but the weird
thing is that the table generation goes just fine. So it might also be a
bug.
Thanks in advance for your help!
Regards,
Frank Houweling
--
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.