class EntityReference implements Serializable, Cloneable, Comparable<EntityReference> {

    public EntityReference getRoot()
    {
        EntityReference reference = this;
        while (reference.getParent() != null) {
            reference = reference.getParent();
        }
        return reference;
    }

    public  EntityReference(String name, EntityType type);
    public  EntityReference(String name, EntityType type, EntityReference parent);

}