in Java i have one List of Objects from my database and i want to convert this objects into my class objects but i cant find the solution.
My List of objects is SalvaguardasAGR
and i want to convert this objects to List<AGRSalvaguardasInforme>
.
I tried with
List<AGRSalvaguardasInforme> InformeFinal = new ArrayList<AGRSalvaguardasInforme>(SalvaguardasAGR);
as i see in How to cast List<Object> to List<MyClass> and How to Convert List<String> to List<Object> but throw this exception:
25-sep-2014 17:40:47 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: El Servlet.service() para el servlet [procop2front] en el contexto con ruta [/CDNMS] lanzó la excepción [java.lang.Error: Unresolved compilation problem:
The constructor ArrayList<AGRSalvaguardasInforme>(List<Object>) is undefined
] con causa raíz
java.lang.Error: Unresolved compilation problem:
The constructor ArrayList<AGRSalvaguardasInforme>(List<Object>) is undefined at com.dominion.procop.agr.struts.actions.AGRInformes.mostrarInformeActivosAGR(AGRInformes.java:1140)
I tried a simple List<AGRSalvaguardasInforme> InformeFinal = (AGRSalvaguardasInforme)SalvaguardasAGR;
too but still not working.
What im doing wrong? how i can convert a List of objects into a List of AGRSalvaguardasInforme?
Thank you in advance.