package Bean; import javax.persistence.*; import java.util.Objects; @Entity @Table(name = "class", schema = "homework_system", catalog = "") public class ClassEntity { private int classId; private String name; private Integer sumNum; @Id @Column(name = "class_id") public int getClassId() { return classId; } public void setClassId(int classId) { this.classId = classId; } @Basic @Column(name = "name") public String getName() { return name; } public void setName(String name) { this.name = name; } @Basic @Column(name = "sum_num") public Integer getSumNum() { return sumNum; } public void setSumNum(Integer sumNum) { this.sumNum = sumNum; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ClassEntity that = (ClassEntity) o; return classId == that.classId && Objects.equals(name, that.name) && Objects.equals(sumNum, that.sumNum); } @Override public int hashCode() { return Objects.hash(classId, name, sumNum); } }