My problem is how do I create the collection objects on the fly as I do not know how many I get.
I need to fill them with a collection of subunits, each of the subunit going to the unit that it belongs to ( it has a field called unitId).
So if I lood through the subunits in a switch as suggested, how do I know where to send them ( which collection? What should be the name).
If I want to call the collections as unit1Collection or UnitsOne or something similar where do I give them the names. I tried to use a
String object and append it the name of the unit in the loop but it is not compiling...
Like in the for loop of unitDTOs...
List<UnitDTO> new String("Unit").append(unitId) = new someList...
Thanks,
Vasu