org.hibernate.AnnotationException: No identifier specified for entity
来源:互联网 发布:mac系统重装教程 u盘 编辑:程序博客网 时间:2024/05/30 07:14
使用hibernate的e-r映射pojo类的时候遇到org.hibernate.AnnotationException: Noidentifier specified forentity异常。可是entity类的注释没有问题,唯一的不正常的地方是这张表比较特殊没有主键,好像在使用hibernate的映射表的时候entity类是必须要主键的,否则就会报出这个异常。
解决办法自然是add一个主键进去,添加主键的神器就在我的上一篇文章中,这里主要是对实体类的注释,应该做添加
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name= "id", nullable = false)
privateint id;
解决办法自然是add一个主键进去,添加主键的神器就在我的上一篇文章中,这里主要是对实体类的注释,应该做添加
- hibernate错误org.hibernate.AnnotationException: No identifier specified for entity:
- hibernate exception: org.hibernate.AnnotationException: No identifier specified for entity:
- hibernate错误org.hibernate.AnnotationException: No identifier specified for entity:
- org.hibernate.AnnotationException: No identifier specified for entity
- 解决:org.hibernate.annotationexception no identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- PHP取多个不重复的随机数
- PHP获取文件目录dirname(__FILE__),getcwd(),
- Android之使用Android-query框架进行开发(二)
- 对象内存布局
- 免费的jquery-CDN加速点
- org.hibernate.AnnotationException: No identifier specified for entity
- Node groups和Compound matchers(混合匹配)
- 寻找数组中两个数的和为M的组合
- pentaho-hadoop-cdh3u0配置
- 学习下载文件
- yii 时间控件
- 130407周赛
- 从java类库看设计模式
- VC++慎用错误之3---1行不认的,必须分2行写