my code is as below...
@ResponseBody
@RequestMapping(value ="/updateAll", method=RequestMethod.POST)
public JSONObject update( @RequestBody List<T> list){
try{
T entity = list.get(0);
System.out.println(entity.getClass());
dbService.update(entityName + ".update", list);
return jsonResult(null, null, null, 0);
}catch(Exception ex){
return jsonResult(null, null, ex, 0);
}
}
It returns an proper object name when I get only one entity through @RequestBody, but the code above returns java.util.LinkedHashMap which i cannot use the merit of parameterClass in iBatis. (sorry for my poor english... )
I cast again the list to T , but still it returns LinkedHashMap.
isn't the code [ T entity = list.get(0); ] means it recognize the list as the collection of object T ?
@ResponseBody
@RequestMapping(value ="/updateAll", method=RequestMethod.POST)
public JSONObject update( @RequestBody T entity){
try{
System.out.println(entity.getClass());
dbService.update(entityName + ".update", entity);
return jsonResult(null, null, null, 0);
}catch(Exception ex){
return jsonResult(null, null, ex, 0);
}
}
This prints the entity name exactly without any problem.
Can anybody explain me why this happen? where I can learn more about this?