开发者社区 问答 正文

@Column注解的问题?报错

代码如下

@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

折腾一天了

展开
收起
爱吃鱼的程序员 2020-06-10 10:50:33 1240 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    没有<spanstyle="font-size:13.3333px;">name,length这两个类型,你看下是不是包引入没@column是column的注解模式。默认是用xml配置的,只是后来大家都懒,然后出现了@column。在hibernate运行的时候会从@column和xml里面读取你的配置,这两个东西没区别。另一个问题我用的是@Column为什么报错的是Columu呢?

    2020-06-10 10:50:51
    赞同 展开评论
问答分类:
问答地址: