hibernate错误org.hibernate.AnnotationException: No identifier specified for entity:

实体类继承BaseEntity时报错。
解决方法:在属性或者get方法上加@Id
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(unique=true, nullable=false)
public Long getId() {
return this.id;
}


public void setId(Long id) {
this.id = id;
}

posted @ 2020-07-30 14:44  牧之丨  阅读(347)  评论(0编辑  收藏  举报