org.hibernate.AnnotationException: No identifier specified for entity: com.repast.foresetting.entity.Period
@Entity
@Table(name = "Period")
public class Period {
//columns START
private int id;
private String periodId;
@Id
public int getId() {
return id;
}
@Id
public void setId(int id) {
this.id = id;
}
public String getPeriodId() {
return periodId;
}
public void setPeriodId(String periodId) {
this.periodId = periodId;
}
主要是红字的部分,类前要加
@Entity
@Table(name = "Period")
主键id的get和set方法前要加
@Id