Commit f0643bdb authored by Quxl's avatar Quxl

x

parent e9a68938
...@@ -415,12 +415,18 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate { ...@@ -415,12 +415,18 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
} }
public int[] batchSave(Object... objs) { public int[] batchSave(Object... objs) {
Sql i = dialect.batchInsert(objs); if(objs != null && objs.length > 0) {
return this.batchUpdate(i.getSql(), i.getBachArgs()); Sql i = dialect.batchInsert(objs);
return this.batchUpdate(i.getSql(), i.getBachArgs());
}
return new int[]{0};
} }
public int[] batchSave(List<?> objs) { public int[] batchSave(List<?> objs) {
return this.batchSave(objs.toArray()); if(objs != null && objs.size() > 0) {
return this.batchSave(objs.toArray());
}
return new int[]{0};
} }
public int batchSave(String tableName, List<Map<String, Object>> objs) { public int batchSave(String tableName, List<Map<String, Object>> objs) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment