Error: Class …\\Entity\\.. has no association named

与世无争的帅哥 提交于 2019-12-05 17:28:20

I'm sure joinColumns: (notice the plural) is only used in Many-To-Many relation. In other relations you should use joinColumn.

In Cities XML, try putting:

joinColumn:
    name: state_id
    referencedColumnName: id

other than that try renaming 'ManyToOne' to 'manyToOne' in your XML but I doubt that case is the issue here...

Hope this helps...

Note that when using Symfony, it will look at mapping YAML files first and ignore your entity annotations. I spent ages changing my annotations whilst all the time it was loading the YAML mapping file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!