be.personify.iam.model.vault.prerequisites.OrganisationPrerequisite Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of personify-model Show documentation
Show all versions of personify-model Show documentation
a possible model for personify
package be.personify.iam.model.vault.prerequisites;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import be.personify.iam.model.util.Persisted;
import be.personify.iam.model.vault.Entitlement;
import be.personify.iam.model.vault.Organisation;
import be.personify.util.generator.MetaInfo;
@Entity
@MetaInfo( group="vault", frontendGroup="Entitlement", name="OrganisationPrerequisite", description="A organisation prerequisite",
afterCreateGoToLink = "entitlement",
afterDeleteGoToLink = "entitlement",
afterUpdateGoToLink = "entitlement",
iconClass = "quote-right", number=37)
public class OrganisationPrerequisite extends Persisted implements Serializable {
private static final long serialVersionUID = 1257896869269094821L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(name="id", description="The id of the org prereq", showInSearchResultGrid = false)
private long id;
@OneToOne
private Organisation organisation;
@OneToOne
@MetaInfo(name="entitlement", description="the entitlement for this prerq : see entitlement_", searchable = false, showInSearchResultGrid = false)
private Entitlement entitlement;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Organisation getOrganisation() {
return organisation;
}
public void setOrganisation(Organisation organisation) {
this.organisation = organisation;
}
public Entitlement getEntitlement() {
return entitlement;
}
public void setEntitlement(Entitlement entitlement) {
this.entitlement = entitlement;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((entitlement == null) ? 0 : entitlement.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((organisation == null) ? 0 : organisation.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
OrganisationPrerequisite other = (OrganisationPrerequisite) obj;
if (entitlement == null) {
if (other.entitlement != null)
return false;
} else if (!entitlement.equals(other.entitlement))
return false;
if (id != other.id)
return false;
if (organisation == null) {
if (other.organisation != null)
return false;
} else if (!organisation.equals(other.organisation))
return false;
return true;
}
}