package com.fp.armas.portal.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.*;

/**
 * The primary key class for the TCUSTPERSONADDRESS database table.
 * 
 */
@Embeddable
public class TcustpersonaddressPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column
	private long personcode;

	private long addressnumber;

	@Temporal(TemporalType.TIMESTAMP)
	private java.util.Date dateto;

	public TcustpersonaddressPK() {
	}
	
	public TcustpersonaddressPK(long personcode, long addressnumber, Date dateto) {
		super();
		this.personcode = personcode;
		this.addressnumber = addressnumber;
		this.dateto = dateto;
	}



	public long getPersoncode() {
		return this.personcode;
	}
	public void setPersoncode(long personcode) {
		this.personcode = personcode;
	}
	public long getAddressnumber() {
		return this.addressnumber;
	}
	public void setAddressnumber(long addressnumber) {
		this.addressnumber = addressnumber;
	}
	public java.util.Date getDateto() {
		return this.dateto;
	}
	public void setDateto(java.util.Date dateto) {
		this.dateto = dateto;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TcustpersonaddressPK)) {
			return false;
		}
		TcustpersonaddressPK castOther = (TcustpersonaddressPK)other;
		return 
			(this.personcode == castOther.personcode)
			&& (this.addressnumber == castOther.addressnumber)
			&& this.dateto.equals(castOther.dateto);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.personcode ^ (this.personcode >>> 32)));
		hash = hash * prime + ((int) (this.addressnumber ^ (this.addressnumber >>> 32)));
		hash = hash * prime + this.dateto.hashCode();
		
		return hash;
	}
}