org.hibernate.AnnotationException: No identifier specified for entity
来源:互联网 发布:d3.js 中文官网 编辑:程序博客网 时间:2024/06/05 11:14
使用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
- 分页显示数据库数据
- 正方形计数问题(穷举+pair+struct/C++)
- JavaScript之正则表达式入门
- js关闭页面不提示
- 通过uri呼起本地app
- org.hibernate.AnnotationException: No identifier specified for entity
- iOS 应用名称的国际化图解
- SAP产品价格
- NoSuchMethodException问题总结
- eclipse打开文件位置插件
- Js setInterval与setTimeout(定时执行与循环执行)的代码(可以传入参数)
- IOS 播放雪花的两种方式(代码方式)
- spring中IOC是什么意思 个人觉得解释的非常有意思
- Java面向对象基础知识