package com.bankaudit.model;

import java.io.Serializable;

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

@Embeddable
public class MaintAuditTypeDescId implements Serializable {


	private static final long serialVersionUID = 1L;

	@Column(name="legal_entity_code")
	private Integer legalEntityCode;
	
	@Column(name="audit_type_code")
	private String auditTypeCode;

	/**
	 * @return the legalEntityCode
	 */
	public Integer getLegalEntityCode() {
		return legalEntityCode;
	}

	/**
	 * @param legalEntityCode the legalEntityCode to set
	 */
	public void setLegalEntityCode(Integer legalEntityCode) {
		this.legalEntityCode = legalEntityCode;
	}

	/**
	 * @return the auditTypeCode
	 */
	public String getAuditTypeCode() {
		return auditTypeCode;
	}

	/**
	 * @param auditTypeCode the auditTypeCode to set
	 */
	public void setAuditTypeCode(String auditTypeCode) {
		this.auditTypeCode = auditTypeCode;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((auditTypeCode == null) ? 0 : auditTypeCode.hashCode());
		result = prime * result + ((legalEntityCode == null) ? 0 : legalEntityCode.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof MaintAuditTypeDescId)) {
			return false;
		}
		MaintAuditTypeDescId other = (MaintAuditTypeDescId) obj;
		if (auditTypeCode == null) {
			if (other.auditTypeCode != null) {
				return false;
			}
		} else if (!auditTypeCode.equals(other.auditTypeCode)) {
			return false;
		}
		if (legalEntityCode == null) {
			if (other.legalEntityCode != null) {
				return false;
			}
		} else if (!legalEntityCode.equals(other.legalEntityCode)) {
			return false;
		}
		return true;
	}
	
	
}
