欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

hibernate报错:JoinColumn cannot be resolved to a type

程序员文章站 2022-04-25 21:27:22
...

添加多对多关系时(如下)报错:JoinColumn cannot be resolved to a type

@ManyToMany(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
    @JoinTable(name ="course",
    joinColumns = {@JoinColumn(name = "preplan_sn", referencedColumnName = "preplan_sn")},
    inverseJoinColumns = {@JoinColumn(name = "domain_sn", referencedColumnName ="domain_sn")})

这里需要导入一个包的
import javax.persistence.JoinColumn;
但是他不提示要导入这个是要手动导入的。