/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.inbio.ara.persistence.person;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
/**
*
* @author esmata
*/
@Embeddable
public class PersonProfilePK implements Serializable {
@Basic(optional = false)
@Column(name = "person_id")
private Long personId;
@Basic(optional = false)
@Column(name = "profile_id")
private Long profileId;
public PersonProfilePK() {
}
public PersonProfilePK(Long personId, Long profileId) {
this.personId = personId;
this.profileId = profileId;
}
public Long getPersonId() {
return personId;
}
public void setPersonId(Long personId) {
this.personId = personId;
}
public Long getProfileId() {
return profileId;
}
public void setProfileId(Long profileId) {
this.profileId = profileId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (personId != null ? personId.hashCode() : 0);
hash += (profileId != null ? profileId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof PersonProfilePK)) {
return false;
}
PersonProfilePK other = (PersonProfilePK) object;
if ((this.personId == null && other.personId != null) || (this.personId != null && !this.personId.equals(other.personId))) {
return false;
}
if ((this.profileId == null && other.profileId != null) || (this.profileId != null && !this.profileId.equals(other.profileId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "org.inbio.ara.persistence.person.PersonProfilePK[personId=" + personId + ", profileId=" + profileId + "]";
}
}