现在我回来了
Object。我不知道更好的解决方案,但是可以。
@RequestMapping(value="", method=RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE)public @ResponseBody ResponseEntity<Object> getAll() { List<Entity> entityList = entityManager.findAll(); List<JSONObject> entities = new ArrayList<JSONObject>(); for (Entity n : entityList) { JSonObject Entity = new JSonObject(); entity.put("id", n.getId()); entity.put("address", n.getAddress()); entities.add(entity); } return new ResponseEntity<Object>(entities, HttpStatus.OK);}


