package HibernateEntities;

import javax.persistence.*;

/**
 * Created by Кинетик on 28.12.2016.
 */
@Entity
@Table(name = "students", schema = "anketa")
public class StudentsEntity {
    private int studentsId;
    private String stFamily;
    private String stFirstName;
    private String stSecName;
    private String stPkNumber;
    private Integer stGroup;

    @Basic
    @Column(name = "group_id")
    public Integer getStGroup() {
        return stGroup;
    }

    public void setStGroup(Integer stGroup) {
        this.stGroup = stGroup;
    }

    @Id
    @Column(name = "students_id")
    public int getStudentsId() {
        return studentsId;
    }

    public void setStudentsId(int studentsId) {
        this.studentsId = studentsId;
    }

    @Basic
    @Column(name = "st_family")
    public String getStFamily() {
        return stFamily;
    }

    public void setStFamily(String stFamily) {
        this.stFamily = stFamily;
    }

    @Basic
    @Column(name = "st_first_name")
    public String getStFirstName() {
        return stFirstName;
    }

    public void setStFirstName(String stFirstName) {
        this.stFirstName = stFirstName;
    }

    @Basic
    @Column(name = "st_sec_name")
    public String getStSecName() {
        return stSecName;
    }

    public void setStSecName(String stSecName) {
        this.stSecName = stSecName;
    }

    @Basic
    @Column(name = "st_pk_number")
    public String getStPkNumber() {
        return stPkNumber;
    }

    public void setStPkNumber(String stPkNumber) {
        this.stPkNumber = stPkNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StudentsEntity that = (StudentsEntity) o;

        if (studentsId != that.studentsId) return false;
        if (stFamily != null ? !stFamily.equals(that.stFamily) : that.stFamily != null) return false;
        if (stFirstName != null ? !stFirstName.equals(that.stFirstName) : that.stFirstName != null) return false;
        if (stSecName != null ? !stSecName.equals(that.stSecName) : that.stSecName != null) return false;
        if (stPkNumber != null ? !stPkNumber.equals(that.stPkNumber) : that.stPkNumber != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = studentsId;
        result = 31 * result + (stFamily != null ? stFamily.hashCode() : 0);
        result = 31 * result + (stFirstName != null ? stFirstName.hashCode() : 0);
        result = 31 * result + (stSecName != null ? stSecName.hashCode() : 0);
        result = 31 * result + (stPkNumber != null ? stPkNumber.hashCode() : 0);
        return result;
    }
}
