java前端传入的json字符串保存到表中的方法
表 service_goods_base 字段如下: 传入的json 字符串: servicePictureArray : [{"picServiceUrl": "http://qimg.app.yiguanjiaclub.org/20180308/a48210dc7bfe4b34b3d7de114ef01f85","mainPage": "1"}] 方法如下: if (StringUtil.isNotEmpty(servicePictureArray)) { JSONArray array = JSONArray.fromObject(servicePictureArray); List <ServiceGoodsPicture> list = new ArrayList<ServiceGoodsPicture> (); for ( int i = 0; i < array.size(); i++ ) { Map <String, Object> object = (Map<String, Object> ) array .get(i); ServiceGoodsPicture entity = ClassUtil.mapToEntity(ServiceGoodsPicture. class , object); list.add(entity); }