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

import java.io.Serializable;

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

@Embeddable
public class TrialHistoryPK implements Serializable {

    private static final long serialVersionUID = 7082004881704656373L;

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

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

    public Integer getLibraryId() {
        return libraryId;
    }

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

    public Integer getMarkerId() {
        return markerId;
    }

    public void setMarkerId(Integer markerId) {
        this.markerId = markerId;
    }

    @Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result + ((libraryId == null) ? 0 : libraryId.hashCode());
        result = PRIME * result + ((markerId == null) ? 0 : markerId.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 TrialHistoryPK other = (TrialHistoryPK) obj;
        if (libraryId == null) {
            if (other.libraryId != null)
                return false;
        } else if (!libraryId.equals(other.libraryId))
            if (markerId == null) {
                if (other.markerId != null)
                    return false;
            } else if (!markerId.equals(other.markerId))
                return false;

        return true;
    }

}
