package org.mynonglam.entitys;

import java.io.Serializable;
import javax.persistence.*;

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

	private String emailfrom;

	private String emailto;

	public RelationshipPK() {
	}
	public String getEmailfrom() {
		return this.emailfrom;
	}
	public void setEmailfrom(String emailfrom) {
		this.emailfrom = emailfrom;
	}
	public String getEmailto() {
		return this.emailto;
	}
	public void setEmailto(String emailto) {
		this.emailto = emailto;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof RelationshipPK)) {
			return false;
		}
		RelationshipPK castOther = (RelationshipPK)other;
		return 
			this.emailfrom.equals(castOther.emailfrom)
			&& this.emailto.equals(castOther.emailto);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.emailfrom.hashCode();
		hash = hash * prime + this.emailto.hashCode();
		
		return hash;
	}
}