be.personify.iam.model.vault.PropertyProvider 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.io.Serializable;
import java.util.Map;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.MapKeyColumn;
import be.personify.util.generator.MetaInfo;
import be.personify.iam.model.util.Persisted;
@Entity
@MetaInfo( group="vault", frontendGroup="Entitlement", name="PropertyProvider",
description="A property provider", showInMenu = true,
number=14,
iconClass = "key")
public class PropertyProvider extends Persisted implements Serializable {
private static final long serialVersionUID = -3762237343471274202L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(name="The id of the object", description="The id of the object", showInSearchResultGrid = false)
private long id;
@Column
@MetaInfo( name="the code", description="the code of the propertyprovider", searchable=true, required = true )
private String code;
@MetaInfo( name="the name", description="the name of the propertyprovider", searchable=true, showInSearchResultGrid = false )
private String name;
@MetaInfo( name="the classname", description="the classname indicating the implementation of the propertyprovider", searchable=false, showInSearchResultGrid = false )
private String className;
@ElementCollection(fetch = FetchType.EAGER)
@JoinTable(name="propertyprovider_configuration", joinColumns=@JoinColumn(name="id"))
@MapKeyColumn (name="configuration_id")
@Column(name="value")
private Map configuration;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Map getConfiguration() {
return configuration;
}
public void setConfiguration(Map configuration) {
this.configuration = configuration;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((className == null) ? 0 : className.hashCode());
result = prime * result + ((code == null) ? 0 : code.hashCode());
result = prime * result + ((configuration == null) ? 0 : configuration.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((name == null) ? 0 : name.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;
PropertyProvider other = (PropertyProvider) obj;
if (className == null) {
if (other.className != null)
return false;
} else if (!className.equals(other.className))
return false;
if (code == null) {
if (other.code != null)
return false;
} else if (!code.equals(other.code))
return false;
if (configuration == null) {
if (other.configuration != null)
return false;
} else if (!configuration.equals(other.configuration))
return false;
if (id != other.id)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
}