I want to have the following hierarchy in Doctrine2:
- Message - SMS - SentSMS - ScheduledSMS - FailedSMS - Newsletter - SystemComunication
But when I try to generate objects in Symfony 2, I get the following error:
[Teaching \ ORM \ Mappin \ MappingException]
Entity 'Acme \ HelloBundle \ Entity \ FailedSMS' has a composite identifier but uses an ID generator other than the manual assignment (Identity, Sequence). This is not supported.
I think that because the id of FailedSMS (inherited from Message ), it contradicts the fact that FailedSMS itself must have an assigned id for CTI (with SMS ) before it works.
Am I asking the moon, or is there a way to make it work? A small overview of the hierarchy:
/** * @ORM\Entity * @ORM\Table(name="message") * @ORM\InheritanceType("JOINED") * @ORM\DiscriminatorColumn(name="type", type="string") * @ORM\DiscriminatorMap({"newsletter" = "Newsletter", "sms" = "SMS"}) */ class Message {} /** * @ORM\Entity * @ORM\Table(name="newsletter") */ class Newsletter extends Message {} /** * @ORM\Entity * @ORM\Table(name="sms") * @ORM\InheritanceType("JOINED") * @ORM\DiscriminatorColumn(name="status", type="string") * @ORM\DiscriminatorMap({"sent"="SentSMS", "scheduled"="ScheduledSMS", * "failed"="FailedSMS" * }) */ class SMS extends Message {} /** * @ORM\Entity * @ORM\Table(name="failed_sms") */ class FailedSMS extends SMS {}
gremo
source share