json直接存入数据库

1.json对象 

JSON.parseObject(jsonObject.get("data").toString(), SettlementList.class);

2.json数组

 List<DoctorAdviceRecords> doctorAdviceRecords = JSON.parseArray(jsonObject.get("data").toString(), DoctorAdviceRecords.class);
        for(DoctorAdviceRecords doctorAdviceRecord : doctorAdviceRecords){
            int count = session.insert("doctorAdviceRecords.insert", doctorAdviceRecord);
        }

 

posted @ 2021-04-25 08:47  耳屎收藏家  阅读(708)  评论(0)    收藏  举报