com.pugwoo.dbhelper.impl.part.P6_ExecuteOp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nimble-orm Show documentation
Show all versions of nimble-orm Show documentation
nimble-orm an ORM based on Spring jdbcTemplate.
package com.pugwoo.dbhelper.impl.part;
import java.util.HashMap;
import java.util.Map;
public class P6_ExecuteOp extends P5_DeleteOp {
@Override
public int executeRaw(String sql, Object... args) {
return namedJdbcExecuteUpdate(sql, args);
}
@Override
public int executeRaw(String sql, Map paramMap) {
sql = addComment(sql);
log(sql, 0, paramMap);
long start = System.currentTimeMillis();
int rows;
if (paramMap == null) {
rows = namedParameterJdbcTemplate.update(sql, new HashMap<>());
} else {
rows = namedParameterJdbcTemplate.update(sql, paramMap);
}
long cost = System.currentTimeMillis() - start;
logSlow(cost, sql, 0, paramMap);
return rows;
}
}