public String getAsString(FacesContext ctx, UIComponent component, Object value) {
if (value != null
&& !"".equals(value)) {
BaseEntity entity = (BaseEntity) value;
this.addAttribute(component, entity);
Serializable codigo = entity.getId();
if (codigo != null) {
return String.valueOf(codigo);
}
}