be.personify.iam.model.provisioning.TargetSystemLink 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.provisioning;
import java.io.Serializable;
import javax.persistence.Entity;
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.Persisted;
import be.personify.util.generator.MetaInfo;
@Entity
@MetaInfo( group="provisioning", frontendGroup="TargetSystem", name="Targetsystem link", description="A link to a targetsystem",
iconClass = "location-arrow",
sortOrderInGroup=5,
number=8,
showOnHomePage=false
)
@Table(name="target_system_link",
indexes = {
@Index(name = "idx_external_id", columnList = "externalId"),
@Index(name = "idx_account_id", columnList = "accountId")
}
)
public class TargetSystemLink extends Persisted implements Serializable {
private static final long serialVersionUID = 6688414872275354803L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(name="id", description="The id of the object", showInSearchResultGrid=false)
private long id;
@ManyToOne( targetEntity=TargetSystem.class)
@MetaInfo( showInSearchResultGrid=false, name="TargetSystem", description="The targetsystem_ for which this link is relevant", searchable = false)
private TargetSystem targetSystem;
@MetaInfo(name="External id", description="The external id (used in the route_)")
private String externalId;
@MetaInfo(name="Account id", description="The id used in the remote targetsystem_")
private String accountId;
@MetaInfo(name="Account type", description="The account type for which this link is relevant")
private String accountType;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getExternalId() {
return externalId;
}
public void setExternalId(String externalId) {
this.externalId = externalId;
}
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public String getAccountType() {
return accountType;
}
public void setAccountType(String accountType) {
this.accountType = accountType;
}
public TargetSystem getTargetSystem() {
return targetSystem;
}
public void setTargetSystem(TargetSystem targetSystem) {
this.targetSystem = targetSystem;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((accountId == null) ? 0 : accountId.hashCode());
result = prime * result + ((accountType == null) ? 0 : accountType.hashCode());
result = prime * result + ((externalId == null) ? 0 : externalId.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((targetSystem == null) ? 0 : targetSystem.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;
TargetSystemLink other = (TargetSystemLink) obj;
if (accountId == null) {
if (other.accountId != null)
return false;
} else if (!accountId.equals(other.accountId))
return false;
if (accountType == null) {
if (other.accountType != null)
return false;
} else if (!accountType.equals(other.accountType))
return false;
if (externalId == null) {
if (other.externalId != null)
return false;
} else if (!externalId.equals(other.externalId))
return false;
if (id != other.id)
return false;
if (targetSystem == null) {
if (other.targetSystem != null)
return false;
} else if (!targetSystem.equals(other.targetSystem))
return false;
return true;
}
}