hibernate报错:
Could not determine type for: java.util.Set
解决:
实体类中的所有注解,要么全写在属性上,要么全写在get方法上,绝对不要有的写在属性上有的写在get方法上
public A {
@Column
private String t;
public String getT(){
return t;
}
public void setT(String t){
this.t=t;
}
}
public B {
private String t;
@Column
public String getT(){
return t;
}
public void setT(String t){
this.t=t;
}
}
本文解决了一个常见的Hibernate问题:Could not determine type for: java.util.Set。错误的原因通常是实体类中注解的位置不一致,即有的注解放在属性上而有的放在get方法上。文章通过两个示例详细说明了正确的做法。
630

被折叠的 条评论
为什么被折叠?



