My issue is this, I have hashMap
//for (String tablaBuscar : listaTablas) {
// RECUPERAR REGISTROS POR TABLA
HashMap<String,String> listaRegistros =(HashMap<String,String>) RequerimientosTablaDestino
.getListaLineasPorTablaYColumna(idCabecera,idCriterio);
when I want to iterate (I have tried several ways, this is the last one)
Iterator<String> entradaMap = listaRegistros.keySet().iterator();
Iterator<String> valorMap = listaRegistros.values().iterator();
while(entradaMap.hasNext()&&valorMap.hasNext()) {
String elemento=entradaMap.next().toString();
int registro =(Integer.parseInt(elemento));
String tablaBuscar = (String)valorMap.next();
in "int registro" line I get "cannot cast from BigDecimal to Int" Debugging I have seen that ALLWAYS the key of the hash map is "big decimal type", no matter the way I have created it.
If I try to use it as a BigDecimal as seen in debugging time, I get compilations failures because "type missmatch" "cannot cast" etc...
So the compiler thinks that the key is the type I have put, but at runtime the program thinks that te key is allways a bigDecimal.
Any idea? thanks