be.personify.iam.model.vault.CampaignEntry 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;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import be.personify.iam.model.util.Concept;
import be.personify.iam.model.util.Persisted;
import be.personify.util.generator.MetaInfo;
@Entity
@MetaInfo( group="vault", frontendGroup="Governance", name="Campaign Entry", description="A certification campaign entry",
showInMenu=false,
number=3,
iconClass="certificate",
workflowEnabled=false,
isConcept = false,
searchable = false,
showDeleteButtonOnSearchResult = false,
dashboard = false)
@Table(name="campaign_entry",
indexes = {
@Index(name = "idx_status", columnList = "status"),
@Index(name = "idx_app_role", columnList = "approvalRole")
}
)
public class CampaignEntry extends Persisted {
private static final long serialVersionUID = 2137839254513776877L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(name="id", description="The id of the campaign entry", showInSearchResultGrid = false)
private long id;
@ManyToOne( targetEntity=CertificationCampaign.class)
@MetaInfo(searchable=false,showInSearchResultGrid=true, editable = false, name="campaign", description = "the campaign of this campaign entry")
private CertificationCampaign certificationCampaign;
@ManyToOne
@MetaInfo(searchable=false,showInSearchResultGrid=false, editable = false, name="concept", description = "the concept of this campaign entry")
private Concept concept;
@MetaInfo(editable = true)
@Enumerated(EnumType.STRING)
private CampaignEntryStatus status;
@MetaInfo(showInSearchResultGrid = false, editable = false)
private Date statusSetAt;
@MetaInfo(editable = false, showInSearchResultGrid = false)
private String approvalRole;
@MetaInfo(showInSearchResultGrid = false, editable = false)
private boolean approvalRoleOrganisationScope;
@MetaInfo(showInSearchResultGrid = true, editable = false)
@ManyToOne
private Identity identity;
@MetaInfo(showInSearchResultGrid = true, editable = false)
@ManyToOne
private Organisation organisation;
@MetaInfo(showInSearchResultGrid = true, editable = false)
@ManyToOne
private Entitlement entitlement;
@MetaInfo(showInSearchResultGrid = false, editable = true)
@ManyToOne
private Identity actor;
@MetaInfo(showInSearchResultGrid = false, editable = false)
private boolean executed;
@MetaInfo(showInSearchResultGrid = false, editable = false)
private Date executedAt;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Concept getConcept() {
return concept;
}
public void setConcept(Concept concept) {
this.concept = concept;
}
public CampaignEntryStatus getStatus() {
return status;
}
public void setStatus(CampaignEntryStatus status) {
this.status = status;
}
public Date getStatusSetAt() {
return statusSetAt;
}
public void setStatusSetAt(Date statusSetAt) {
this.statusSetAt = statusSetAt;
}
public Identity getActor() {
return actor;
}
public void setActor(Identity actor) {
this.actor = actor;
}
public boolean isExecuted() {
return executed;
}
public void setExecuted(boolean executed) {
this.executed = executed;
}
public Date getExecutedAt() {
return executedAt;
}
public void setExecutedAt(Date executedAt) {
this.executedAt = executedAt;
}
public CertificationCampaign getCertificationCampaign() {
return certificationCampaign;
}
public void setCertificationCampaign(CertificationCampaign certificationCampaign) {
this.certificationCampaign = certificationCampaign;
}
public String getApprovalRole() {
return approvalRole;
}
public void setApprovalRole(String approvalRole) {
this.approvalRole = approvalRole;
}
public boolean isApprovalRoleOrganisationScope() {
return approvalRoleOrganisationScope;
}
public void setApprovalRoleOrganisationScope(boolean approvalRoleOrganisationScope) {
this.approvalRoleOrganisationScope = approvalRoleOrganisationScope;
}
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;
}
public Identity getIdentity() {
return identity;
}
public void setIdentity(Identity identity) {
this.identity = identity;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((actor == null) ? 0 : actor.hashCode());
result = prime * result + ((approvalRole == null) ? 0 : approvalRole.hashCode());
result = prime * result + (approvalRoleOrganisationScope ? 1231 : 1237);
result = prime * result + ((certificationCampaign == null) ? 0 : certificationCampaign.hashCode());
result = prime * result + ((concept == null) ? 0 : concept.hashCode());
result = prime * result + ((entitlement == null) ? 0 : entitlement.hashCode());
result = prime * result + (executed ? 1231 : 1237);
result = prime * result + ((executedAt == null) ? 0 : executedAt.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((identity == null) ? 0 : identity.hashCode());
result = prime * result + ((organisation == null) ? 0 : organisation.hashCode());
result = prime * result + ((status == null) ? 0 : status.hashCode());
result = prime * result + ((statusSetAt == null) ? 0 : statusSetAt.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;
CampaignEntry other = (CampaignEntry) obj;
if (actor == null) {
if (other.actor != null)
return false;
} else if (!actor.equals(other.actor))
return false;
if (approvalRole == null) {
if (other.approvalRole != null)
return false;
} else if (!approvalRole.equals(other.approvalRole))
return false;
if (approvalRoleOrganisationScope != other.approvalRoleOrganisationScope)
return false;
if (certificationCampaign == null) {
if (other.certificationCampaign != null)
return false;
} else if (!certificationCampaign.equals(other.certificationCampaign))
return false;
if (concept == null) {
if (other.concept != null)
return false;
} else if (!concept.equals(other.concept))
return false;
if (entitlement == null) {
if (other.entitlement != null)
return false;
} else if (!entitlement.equals(other.entitlement))
return false;
if (executed != other.executed)
return false;
if (executedAt == null) {
if (other.executedAt != null)
return false;
} else if (!executedAt.equals(other.executedAt))
return false;
if (id != other.id)
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;
if (status != other.status)
return false;
if (statusSetAt == null) {
if (other.statusSetAt != null)
return false;
} else if (!statusSetAt.equals(other.statusSetAt))
return false;
return true;
}
}