org.hibernate.AnnotationException: No identifier specified for entity
来源:互联网 发布:类似知乎的网站 编辑:程序博客网 时间:2024/06/02 02:22
转载自:http://blog.sina.com.cn/s/blog_529aacbd0100z8u2.html
使用hibernate的e-r映射pojo类的时候遇到org.hibernate.AnnotationException: No identifier specified for entity异常。可是entity类的注释没有问题,唯一的不正常的地方是这张表比较特殊没有主键,好像在使用hibernate的映射表的时候entity类是必须要主键的,否则就会报出这个异常。解决办法自然是add一个主键进去,这里主要是对实体类的注释,应该做添加
@Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "id", nullable = false) private int id;
0 0
- 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
- 学习锋利的jqurey笔记
- 面向对象有什么用
- Initialization Demand Holder
- iOS零碎知识
- JAVAHOME的配置--Java基础003
- org.hibernate.AnnotationException: No identifier specified for entity
- C/C++ OpenCV图像的线性混合
- Recyclerview中最后一个可见Item的位置以及是否滑动到底部
- win10卸载linux子系统
- 【Eclipse】设置控制台Console不限日志行数
- collectionView viewForSupplementaryElementOfKind footer没有回调的原因
- vps建站教程 CentOS6如何安装配置FTP服务器
- Oracle11G多列收集统计信息实验
- .NET中ThreadStart和ParameterizedThreadStart区别