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

be.personify.iam.model.vault.EntitlementRequest Maven / Gradle / Ivy

There is a newer version: 1.5.2.RELEASE
Show newest version
package be.personify.iam.model.vault;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import be.personify.util.generator.MetaInfo;
import be.personify.iam.model.ConceptType;
import be.personify.iam.model.util.Concept;


@Entity
@MetaInfo( group="vault", frontendGroup="Entitlement", name="Entitlement request", 
	description="A request for a entitlement", iconClass = "magic",
	workflowEnabled=true,
	showInMenu = true,
	isConcept=true,
	addable = false,
	creatable = false,
			number=7)
@Table(name="entitlement_request", indexes = {
		@Index(name = "idx_entreq_uniq", columnList = "identity_id,organisation_id,entitlement_id", unique=true)
})
public class EntitlementRequest extends Concept implements Serializable {


	private static final long serialVersionUID = -7334395759507966905L;
	
	/**
	 * Constructor
	 */
	public EntitlementRequest() {
		this.conceptType = ConceptType.EntitlementRequest;
	}

	
	@OneToOne
	@MetaInfo(name="identity", description="the identity for which this request is done : see identity_",customRenderer = "autoCompleteTextField|search_fields=lastName|display_fields=lastName,firstName,code")
	private Identity identity;
	
	@OneToOne
	@MetaInfo(name="entitlement", description="the entitlement for which this request is done: see entitlement_")
	private Entitlement entitlement;
	
	@OneToOne
	@MetaInfo(name="organisation", description="the organisation for which this request is done: see organisation_",customRenderer = "autoCompleteTextField|search_fields=name|display_fields=name,code")
	private Organisation organisation;

	public Identity getIdentity() {
		return identity;
	}

	public void setIdentity(Identity identity) {
		this.identity = identity;
	}

	public Entitlement getEntitlement() {
		return entitlement;
	}

	public void setEntitlement(Entitlement entitlement) {
		this.entitlement = entitlement;
	}

	public Organisation getOrganisation() {
		return organisation;
	}

	public void setOrganisation(Organisation organisation) {
		this.organisation = organisation;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((entitlement == null) ? 0 : entitlement.hashCode());
		result = prime * result + ((identity == null) ? 0 : identity.hashCode());
		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;
		EntitlementRequest other = (EntitlementRequest) obj;
		if (entitlement == null) {
			if (other.entitlement != null)
				return false;
		} else if (!entitlement.equals(other.entitlement))
			return false;
		if (identity == null) {
			if (other.identity != null)
				return false;
		} else if (!identity.equals(other.identity))
			return false;
		if (organisation == null) {
			if (other.organisation != null)
				return false;
		} else if (!organisation.equals(other.organisation))
			return false;
		return true;
	}
	

	
	
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy