代码如下
@Column(name="user_phon",length=30)
public String getUser_phon() {
return user_phon;
}
public void setUser_phon(String user_phon) {
this.user_phon = user_phon;
}
@Column(name="user_depart",length=30)
public int getUser_depart() {
return user_depart;
}
public void setUser_depart(int user_depart) {
this.user_depart = user_depart;
}
简单的注解
报错如下:
严重: Servlet.service() for servlet [spring] in context with path [/toms] threw exception [Handler processing failed; nested exception is java.lang.Error: Unresolved compilation problems:
Columu cannot be resolved to a type
The attribute name is undefined for the annotation type Columu
The attribute length is undefined for the annotation type Columu
] with root cause
折腾一天了
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
没有<spanstyle="font-size:13.3333px;">name,length这两个类型,你看下是不是包引入没@column是column的注解模式。默认是用xml配置的,只是后来大家都懒,然后出现了@column。在hibernate运行的时候会从@column和xml里面读取你的配置,这两个东西没区别。另一个问题我用的是@Column为什么报错的是Columu呢?