I am retrieving my object from the dataTable plus the time I redirect the dataTable to another page to make change, it presents an error. Plus it takes the ID of the object, I did a convert more without success.
MyConverter
packageconverter;importjavax.faces.component.UIComponent;importjavax.faces.context.FacesContext;importjavax.faces.convert.Converter;importjavax.faces.convert.FacesConverter;importjavax.inject.Inject;importdao.FabricanteDAO;importmodelo.Fabricante;@FacesConverter(forClass=Fabricante.class)publicclassFabricanteConverterimplementsConverter{@InjectprivateFabricanteDAOdao;publicObjectgetAsObject(FacesContextarg0,UIComponentarg1,Stringvalue){Fabricantefabricante=null;if(value!=null){fabricante=this.dao.buscarPeloCodigo(newLong(value));}returnfabricante;}publicStringgetAsString(FacesContextarg0,UIComponentarg1,Objectvalor){if(valor!=null){Fabricantefabricante=(Fabricante)valor;returnfabricante.getCodigo()==null?null:fabricante.getCodigo().toString();}return"";
}
}