具有约定的流畅 NHibernate 多对多
我在两个类之间有多对多:
User
RetailOutlet
似乎约定已将 RetailOutlet 指定为关系的所有者。因此,当我将 RetailOutlet 添加到用户的集合中时,什么也没有发生。我必须设置关系的两端。
因此,我尝试覆盖映射,并且:
如果我从两侧指定ManyToMany,它会告诉我我已经重复了映射
如果我只在一侧指定它,它会说类似的内容
我认为我需要覆盖约定,只是告诉 Fluent 忘记这两个类的任何约定。
我可能是错的,在两个映射文件中设置ManyToMany正是网上所有示例所做的。
干杯
I have a many to many between two classes:
User
RetailOutlet
It seems that the conventions have specified the RetailOutlet as the owner for the relationship. So when I add a RetailOutlet to the collection on the User - nothing happens. I have to set both ends of the relationship.
So I try and override the mappings and:
if I specify the ManyToMany from both sides it tells me I've duplicated mappings
if I only specify it on one side it say something similar
I think I need to override the conventions and just tell Fluent to forget any conventions for both these classes.
I could be wrong, setting the ManyToMany in both mapping files is exactly what all the examples on the net do.
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
修好了。 IAutoMappingOverride。
Fixed it. IAutoMappingOverride.