package cn.com.qmth.stmms.biz.mark.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class MarkTrackPK implements Serializable {

    private static final long serialVersionUID = 9096523417236451724L;

    @Column(name = "student_id", nullable = false)
    private Integer studentId;

    @Column(name = "question_number", nullable = false)
    private String questionNumber;

    @Column(name = "number", nullable = false)
    private Integer number;

    public Integer getStudentId() {
        return studentId;
    }

    public void setStudentId(Integer studentId) {
        this.studentId = studentId;
    }

    public String getQuestionNumber() {
        return questionNumber;
    }

    public void setQuestionNumber(String questionNumber) {
        this.questionNumber = questionNumber;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    @Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result + ((studentId == null) ? 0 : studentId.hashCode());
        result = PRIME * result + ((questionNumber == null) ? 0 : questionNumber.hashCode());
        result = PRIME * result + ((number == null) ? 0 : number.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        final MarkTrackPK other = (MarkTrackPK) obj;
        if (studentId == null) {
            if (other.studentId != null)
                return false;
        } else if (!studentId.equals(other.studentId))
            return false;
        if (questionNumber == null) {
            if (other.questionNumber != null)
                return false;
        } else if (!questionNumber.equals(other.questionNumber))
            return false;

        if (number == null) {
            if (other.number != null)
                return false;
        } else if (!number.equals(other.number))
            return false;

        return true;
    }

}
