be.personify.iam.model.provisioning.TargetSystemAttributeMapping 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 java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import be.personify.iam.model.util.Persisted;
import be.personify.util.generator.MetaInfo;
@Entity
@MetaInfo( group="provisioning", frontendGroup="TargetSystem", name="Targetsystem attribute mapping", description="A TargetSystemAttribute mapping",
iconClass = "location-arrow",
afterDeleteGoToLink="targetSystem",
afterCreateGoToLink="targetSystem",
afterUpdateGoToLink = "targetSystem",
showInMenu=false,
number = 2,
sortOrderInGroup=2,
rst_include_description = false,
showOnHomePage=false
)
public class TargetSystemAttributeMapping extends Persisted implements Serializable {
private static final long serialVersionUID = -5660173065659749002L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(name="id", description="the id of the targetsystem attribute mapping", searchable=false,showInSearchResultGrid=false)
private long id;
@MetaInfo(name="localName", description="the local name of local attribute", editable = false)
private String localName;
@MetaInfo(name="remoteName", description="the remote name of attribute", editable = false)
private String remoteName;
@OneToOne( targetEntity=TargetSystem.class)
@MetaInfo( showInSearchResultGrid=false, name="targetsystem", description="the link to the targetsystem_", searchable = false, editable = false)
private TargetSystem targetSystem;
@ManyToOne( targetEntity=TargetSystemAttribute.class)
@MetaInfo( showInSearchResultGrid=false, name="targetSystemAttribute", description="the link to the targetSystemAttribute_", searchable = false, editable = false )
private TargetSystemAttribute targetSystemAttribute;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getLocalName() {
return localName;
}
public void setLocalName(String localName) {
this.localName = localName;
}
public TargetSystemAttribute getTargetSystemAttribute() {
return targetSystemAttribute;
}
public void setTargetSystemAttribute(TargetSystemAttribute targetSystemAttribute) {
this.targetSystemAttribute = targetSystemAttribute;
}
public TargetSystem getTargetSystem() {
return targetSystem;
}
public void setTargetSystem(TargetSystem targetSystem) {
this.targetSystem = targetSystem;
}
public String getRemoteName() {
return remoteName;
}
public void setRemoteName(String remoteName) {
this.remoteName = remoteName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((localName == null) ? 0 : localName.hashCode());
result = prime * result + ((remoteName == null) ? 0 : remoteName.hashCode());
result = prime * result + ((targetSystem == null) ? 0 : targetSystem.hashCode());
result = prime * result + ((targetSystemAttribute == null) ? 0 : targetSystemAttribute.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;
TargetSystemAttributeMapping other = (TargetSystemAttributeMapping) obj;
if (id != other.id)
return false;
if (localName == null) {
if (other.localName != null)
return false;
} else if (!localName.equals(other.localName))
return false;
if (remoteName == null) {
if (other.remoteName != null)
return false;
} else if (!remoteName.equals(other.remoteName))
return false;
if (targetSystem == null) {
if (other.targetSystem != null)
return false;
} else if (!targetSystem.equals(other.targetSystem))
return false;
if (targetSystemAttribute == null) {
if (other.targetSystemAttribute != null)
return false;
} else if (!targetSystemAttribute.equals(other.targetSystemAttribute))
return false;
return true;
}
public static List toGenericList(List targetSystemAttributeMappings) {
List genericList = new ArrayList();
if ( targetSystemAttributeMappings != null ) {
for( TargetSystemAttributeMapping t : targetSystemAttributeMappings) {
genericList.add(t.toGeneric());
}
}
return genericList;
}
private be.personify.util.provisioning.TargetSystemAttributeMapping toGeneric() {
be.personify.util.provisioning.TargetSystemAttributeMapping generic = new be.personify.util.provisioning.TargetSystemAttributeMapping();
generic.setId(id);
generic.setLocalName(localName);
generic.setRemoteName(remoteName);
generic.setTargetSystemAttribute(targetSystemAttribute.toGeneric());
return generic;
}
}