package org.mynonglam.entitys;

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

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

	private String email;

	private String idgroup;

	public MemberGroupPK() {
	}
	public String getEmail() {
		return this.email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getIdgroup() {
		return this.idgroup;
	}
	public void setIdgroup(String idgroup) {
		this.idgroup = idgroup;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof MemberGroupPK)) {
			return false;
		}
		MemberGroupPK castOther = (MemberGroupPK)other;
		return 
			this.email.equals(castOther.email)
			&& this.idgroup.equals(castOther.idgroup);
	}

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