org.hibernate.AnnotationException: No identifier specified for entity

org.hibernate.AnnotationException: No identifier specified for entity

报这个异常的原因是因为实体bean的主键没有注解映射关系

 @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="ID", unique=true, nullable=false, insertable=true, updatable=false, precision=20, scale=0)
 

猜你喜欢

转载自yaozhiqiang109.iteye.com/blog/1122291
今日推荐