我试着把这些映射做好,但我似乎不能,也不会喜欢一些建议.
Entities\User:
type: entity
oneToMany:
citations:
targetEntity: Citation
mappedBy: user
cascade: ["all"]
Entities\Citation:
type: entity
manyToOne:
item:
targetEntity: Item
inversedBy: citations
joinColumn:
name: item_id
referencedColumnName: id
manyToOne:
user:
targetEntity: User
inversedBy: citations
joinColumn:
name: user_id
referencedColumnName: id
Entities\Item:
type: entity
oneToMany:
authors:
targetEntity: Author
mappedBy: item
cascade: ["all"]
oneToMany:
citations:
targetEntity: Citation
mappedBy: item
Entities\Author:
type: entity
manyToOne:
item:
targetEntity: Item
inversedBy: authors我从模式验证器工具获得的错误是:
映射失败-实体类‘实体\项’映射无效:*关联Entities\Item#citations引用不存在的拥有侧字段Entities\Citation#item。 映射失败-实体类‘实体\引号’映射无效:*关联Entities\Citation#user引用不存在的逆侧字段Entities\User#citations。 映射失败-实体类‘实体\作者’映射无效:*关联Entities\Author#item引用不存在的逆侧字段Entities\Item#authors。
正如你所看到的,我有相反的一面,为什么它没有看到它们?
发布于 2012-07-06 00:15:40
您是否在类上(在php文件中)创建了相关属性?
ie:实体\引号有项目属性吗?property $item;
https://stackoverflow.com/questions/11302890
复制相似问题