Im having some issues trying to convert a List of Object to a custom DTO. However, all the answers that i found are focused on converting Entities or POJ0s to DTO. How can i do this in either some kind of iteration, or even manyally accesing all the Object properties?
Right now i have something like this that throw some casting errors, but idk if changing datatypes would work or if i should try something else.
List<Object> ls = myDAO.getSomethingFromDB();
List<MyDTO> ls2 = new ArrayList<MyDTO>();
for(Object o : ls){
ls2.add((MyDTO) o);
}
Also, first StackOverflow questing, sorry if im asking something dumb or in a bad way.