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

import java.io.Serializable;

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

@Embeddable
public class AnswerCardPK implements Serializable {

    private static final long serialVersionUID = 7454931281820903561L;

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

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

    public AnswerCardPK() {

    }

    public Integer getExamId() {
        return examId;
    }

    public void setExamId(Integer examId) {
        this.examId = examId;
    }

    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 + ((examId == null) ? 0 : examId.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 AnswerCardPK other = (AnswerCardPK) obj;
        if (examId == null) {
            if (other.examId != null)
                return false;
        } else if (!examId.equals(other.examId))
            return false;

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

        return true;
    }

}
