我有这样的类继承
/**
* @ORM\Entity
* @ORM\Table(name="persons")
* @@ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="person_types", type="string")
* @ORM\DiscriminatorMap({
* "insuree" = "Insuree",
* "third_party" = "ThirdParty"
* })
*/
abstract class Person {
/**
* @ORM\Entity
* @ORM\Table(name="insurees")
*/
abstract class Insuree extends Person
/**
* @ORM\Entity
* @ORM\Table(name="third_parties")
*/
final class ThirdParty extends Insuree {
当我执行schema:create,instad时,在Person类上创建了discriminator列,它创建了具有所属字段的persons表,仅此而已,然后,创建了具有persons表列和insures表的insurees表。属于自己的列,然后使用person和insures表中的列以及属于自己的列创建了third_parties表。当我执行EntityManager :: flush()时,third_parties表中的所有列均已填充,而其他两个表均为空。我想念什么?我遵循了教义官方网站上的文档,似乎我做对了所有事情。
答案 0 :(得分:1)