correct comment
All checks were successful
WEB karideo and rabbit/archidata/pipeline/head This commit looks good

This commit is contained in:
Edouard DUPIN 2023-01-29 23:13:07 +01:00
parent 50cb92703b
commit b85d5ec423

View File

@ -387,11 +387,12 @@ public class SqlWrapper {
} }
return data; return data;
} }
// seems a good idea, but very dangerous if we not filter input data... if set an id it can be complicated...
public static <T> T insertWithJson(Class<T> clazz, String jsonData) throws Exception { public static <T> T insertWithJson(Class<T> clazz, String jsonData) throws Exception {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
// parse the object to be sure the data are valid: // parse the object to be sure the data are valid:
T data = mapper.readValue(jsonData, clazz); T data = mapper.readValue(jsonData, clazz);
return insert(data); return insert(data);
} }