Commit d6d27e68 authored by Quxl's avatar Quxl

x

parent 28f9bf78
package com.egolm.common.jdbc;
import java.beans.MethodDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -207,11 +209,14 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
Map<String, Object> map = new HashMap<String, Object>();
Field[] fields = obj.getClass().getDeclaredFields();
for(Field field : fields) {
int mod = field.getModifiers();
if(!Modifier.isStatic(mod) && !Modifier.isFinal(mod)) {
Object fieldValue = ReflexUtil.getFieldValue(field, obj);
if(fieldValue != null) {
map.put(field.getName(), fieldValue);
}
}
}
return this.updateByColumn(iSql.getName(), iSql.getColumnPkNames(), map);
} else if(objMaps.size() > 1) {
throw new MustBeOneRowException();
......
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