All Downloads are FREE. Search and download functionalities are using the official Maven repository.

be.personify.iam.model.vault.prerequisites.EntitlementPrerequisite Maven / Gradle / Ivy

There is a newer version: 1.5.2.RELEASE
Show newest version
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.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 EntitlementPrerequisite extends Persisted implements Serializable {

	private static final long serialVersionUID = 1257896869269094821L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@MetaInfo(name="id", description="The id of the entitlement prereq", showInSearchResultGrid = false)
	private long id;
	
	@OneToOne
	private Entitlement requiredEntitlement;
	
	
	private boolean requiredWithinOrganisation;

	
	@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 Entitlement getRequiredEntitlement() {
		return requiredEntitlement;
	}


	public void setRequiredEntitlement(Entitlement requiredEntitlement) {
		this.requiredEntitlement = requiredEntitlement;
	}


	public Entitlement getEntitlement() {
		return entitlement;
	}


	public void setEntitlement(Entitlement entitlement) {
		this.entitlement = entitlement;
	}
	
	
	public boolean isRequiredWithinOrganisation() {
		return requiredWithinOrganisation;
	}


	public void setRequiredWithinOrganisation(boolean requiredWithinOrganisation) {
		this.requiredWithinOrganisation = requiredWithinOrganisation;
	}


	@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 + ((requiredEntitlement == null) ? 0 : requiredEntitlement.hashCode());
		result = prime * result + (requiredWithinOrganisation ? 1231 : 1237);
		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;
		EntitlementPrerequisite other = (EntitlementPrerequisite) 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 (requiredEntitlement == null) {
			if (other.requiredEntitlement != null)
				return false;
		} else if (!requiredEntitlement.equals(other.requiredEntitlement))
			return false;
		if (requiredWithinOrganisation != other.requiredWithinOrganisation)
			return false;
		return true;
	}


	

	
	
	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy