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 = "library_id", nullable = false)
    private Integer libraryId;

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

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

    public Integer getLibraryId() {
        return libraryId;
    }

    public void setLibraryId(Integer libraryId) {
        this.libraryId = libraryId;
    }

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

}
