使用SSH框架的时候:使用注解创建表格时出现错误:
Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: healt,
是因为在对多对多或者一对多初始化对象的时候接收的类型不对:
错误:
正确:
【如果接着出现错误:】
mappedBy reference an unknown target entity property: healthy.model.User.user in healthy.model.Disease.users
是因为关联错了。
从表(Disease):
主表(User):