2
我正在使用Doctrine模式,但遇到了麻烦,因为其中一个manytoOne-关系不会持久存在于数据库中。我无能为力,为什么这样,因为在我看来,语法看起来是正确的。Symfony2/Doctrine manytoOne-relationship没有出现在表中
任何人都可以找出问题吗?
以下是我在yaml中的模式。在运行 php app\console doctrine:schema:update --force
后,我的mysql数据库中没有关联这两个实体的表。
Me\MyBundle\Entity\FreeTextField:
type: entity
table: null
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
name:
type: string
flagPrivate:
type: boolean
description:
type: text
nullable: TRUE
oneToMany:
entries:
targetEntity: FreeTextEntry
mappedBy: xfield
lifecycleCallbacks: { }
Me\MyBundle\Entity\FreeTextEntry:
type: entity
table: null
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
content:
type: text
manyToOne:
xfield:
targetEntity: FreeTextField
inversedBy: entries
manyToOne:
registration:
targetEntity: Registration
inversedBy: freeTextEntries
lifecycleCallbacks: { }
我不知道如何YAWL语法声明,但你为什么设置_table_关键_空值_? – manix
它只是告诉教义使用任何(默认)名称的表。它是自动生成的,实际上是一个毫无意义的行,但这里不是问题。 – massives