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

import java.io.Serializable;

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

@Embeddable
public class ScoreRatePK implements Serializable {

	private static final long serialVersionUID = -685920161409129861L;

	@Column(name = "exam_id")
    private Integer examId;
	
    @Column(name = "campus_name")
    private String campusName;

    @Column(name = "subject_code")
    private String subjectCode;

    @Column(name = "main_number")
    private Integer mainNumber;

    @Column(name = "sub_number")
    private Integer subNumber;

    @Column(name = "is_objective")
    private boolean objective;

    public Integer getExamId() {
        return examId;
    }

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

    public String getSubjectCode() {
        return subjectCode;
    }

    public void setSubjectCode(String subjectCode) {
        this.subjectCode = subjectCode;
    }

    public Integer getMainNumber() {
        return mainNumber;
    }

    public void setMainNumber(Integer mainNumber) {
        this.mainNumber = mainNumber;
    }

    public Integer getSubNumber() {
        return subNumber;
    }

    public void setSubNumber(Integer subNumber) {
        this.subNumber = subNumber;
    }

    public boolean isObjective() {
        return objective;
    }

    public void setObjective(boolean objective) {
        this.objective = objective;
    }

    public String getCampusName() {
		return campusName;
	}

	public void setCampusName(String campusName) {
		this.campusName = campusName;
	}

	@Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result + ((examId == null) ? 0 : examId.hashCode());
        result = PRIME * result + (campusName ==null ? 0 : campusName.hashCode());
        result = PRIME * result + ((subjectCode == null) ? 0 : subjectCode.hashCode());
        result = PRIME * result + ((mainNumber == null) ? 0 : mainNumber.hashCode());
        result = PRIME * result + ((subNumber == null) ? 0 : subNumber.hashCode());
        result = PRIME * result + (objective ? 1 : 0);
        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 ScoreRatePK other = (ScoreRatePK) obj;
        if (examId == null) {
            if (other.examId != null)
                return false;
        } else if (!examId.equals(other.examId))
            return false;
        if (campusName == null) {
            if (other.campusName != null)
                return false;
        } else if (!campusName.equals(other.campusName))
            return false;
        if (subjectCode == null) {
            if (other.subjectCode != null)
                return false;
        } else if (!subjectCode.equals(other.subjectCode))
            return false;

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

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

        if (objective != other.objective) {
            return false;
        }

        return true;
    }

}
