be.personify.iam.model.provisioning.Route 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.List;
import javax.persistence.CascadeType;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import be.personify.iam.model.util.Persisted;
import be.personify.util.generator.MetaInfo;
@Entity
@MetaInfo( group="provisioning", frontendGroup="Provisioning", name="Route", description="Route to connectors",
showInMenu=true,
sortOrderInGroup=1,
iconClass = "road",
number=13,
rst_include_description=true
)
@Table(name="route", indexes = {@Index(name = "idx_name", columnList = "name", unique=true)})
public class Route extends Persisted implements Serializable{
private static final long serialVersionUID = -1673332614501994392L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@MetaInfo(name="id", description="the id of the route", searchable=false,showInSearchResultGrid=false)
private long id;
@MetaInfo(name="name", description="the unique name of the route, this will also be used in the URL of the exposed REST endpoint.")
private String name;
@MetaInfo(name="active", description="indicating if the route is activated")
private boolean active;
@OneToMany(cascade=CascadeType.ALL, mappedBy="route")
@ElementCollection(targetClass=RouteEntry.class)
@MetaInfo(name="routeEntries", description="a list of route entries, containing a mapping towards one or multiple targetsystems. see routeEntry_")
private List routeEntries;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public List getRouteEntries() {
return routeEntries;
}
public void setRouteEntries(List routeEntries) {
this.routeEntries = routeEntries;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + (active ? 1231 : 1237);
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((routeEntries == null) ? 0 : routeEntries.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;
Route other = (Route) obj;
if (active != other.active)
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;
if (routeEntries == null) {
if (other.routeEntries != null)
return false;
} else if (!routeEntries.equals(other.routeEntries))
return false;
return true;
}
}