Caused by: org.hibernate.AnnotationException: No identifier specified for entity
2018-01-14 13:30
531 查看
今天在测试 jpa 读取数据库时出现这错误,指示没有实体标识符
Caused by: org.hibernate.AnnotationException: No identifier specified for entity
根据Hinbernate的规范,一定要为实体类添加唯一的标识符,即主键id。在私有变量或set方法之上添加注解即可。
Caused by: org.hibernate.AnnotationException: No identifier specified for entity
根据Hinbernate的规范,一定要为实体类添加唯一的标识符,即主键id。在私有变量或set方法之上添加注解即可。
@Id @GeneratedValue private Integer categoryId;
相关文章推荐
- org.hibernate.AnnotationException: No identifier specified for entity: entity.Student
- 报错Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.liuyanzhao.b
- 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
- Hinernate:org.hibernate.AnnotationException: No identifier specified for entity
- Entity 类中加了@Id 注解后仍然出现org.hibernate.AnnotationException: No identifier specified for entity 错误
- org.hibernate.AnnotationException: No identifier specified for entity
- org.hibernate.AnnotationException: No identifier specified for entity
- java框架整合错误: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: cn.itcast.domain.Counter
- 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: com.bjsxt.hibernate.Teacher
- org.hibernate.AnnotationException: No identifier specified for entity