我尝试在我的两个实体上创建一个manyToMany关系,其中一个id已经在内部关系中使用。为了更好的理解,我把你的代码放到了你的身上。
Entities\Engine\Process:
type: entity
table: Engine__Process
id:
id:
type: smallint
manyToOne:
initiatorProcess:
targetEntity: Entities\Engine\Process
inversedBy: childrenInitiatorProcess
joinColumn:
name: initiatorProcessId
referencedColumnName: id
manyToMany:
tags:
targetEntity: Entities\Engine\Tag
mappedBy: processes
Entities\Engine\Tag:
type: entity
table: Engine__Tag
id:
id:
type: smallint
manyToMany:
processes:
targetEntity: Entities\Engine\Process
inversedBy: tags
joinTable:
name: Engine__ProcessTag
joinColumns:
tagId:
referencedColumnName: id
inverseJoinColumns:
processId:
referencedColumnName: initiatorProcessId
我试图切换manyToMany定义,但也没有。我总是有相同的错误消息:
从Entities \ Engine \ Tag到Entities \ Engine \ Process的关系引用的列名initiatorProcessId
不存在。
有人已经尝试过类似的东西吗?