package com.qmth.qrzk.batch.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.IdClass;


@IdClass(BatchPaperPK.class)
public class BatchPaperPK implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Column(name="paper_batch_id")
	private Integer batchId;
	@Column(name="paper_id")
	private long paperId;
	
	public Integer getBatchId() {
		return batchId;
	}
	public void setBatchId(Integer batchId) {
		this.batchId = batchId;
	}
	public long getPaperId() {
		return paperId;
	}
	public void setPaperId(long paperId) {
		this.paperId = paperId;
	}
	public boolean equals(Object obj){
		 if(obj instanceof BatchPaperPK){
		 BatchPaperPK bpPK = (BatchPaperPK)obj;
		 if(this.batchId == bpPK.getBatchId() && this.paperId == bpPK.getPaperId()){
		 return true;
		 }
		 }
		 else {
		 return false;
		 }
		 return false;
		 }
		// The override of hashCode, see the rules mentioned above for creating a composite primary key
		 public int hashCode(){
		 return super.hashCode();
		 }
}
