Skip to content

Commit

Permalink
替换DataChangeRecorderInnerInterceptor获取元数据方法.
Browse files Browse the repository at this point in the history
  • Loading branch information
nieqiurong committed Jul 13, 2023
1 parent 5abbd4f commit 46f8eee
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.SystemMetaObject;
import org.apache.ibatis.scripting.defaults.DefaultParameterHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -220,7 +219,7 @@ public OperationResult processUpdate(Update updateStmt, MappedStatement mappedSt
BoundSql boundSql4Select = new BoundSql(mappedStatement.getConfiguration(), selectStmt.toString(),
prepareParameterMapping4Select(boundSql.getParameterMappings(), updateStmt),
boundSql.getParameterObject());
MetaObject metaObject = SystemMetaObject.forObject(boundSql);
MetaObject metaObject = PluginUtils.getMetaObject(boundSql);
Map<String, Object> additionalParameters = (Map<String, Object>) metaObject.getValue("additionalParameters");
if (additionalParameters != null && !additionalParameters.isEmpty()) {
for (Map.Entry<String, Object> ety : additionalParameters.entrySet()) {
Expand Down Expand Up @@ -285,7 +284,7 @@ private List<DataChangedRecord> compareAndGetUpdatedColumnDatas(String tableName
//FIRSTNAME: FIRST_NAME/FIRST-NAME/FIRST$NAME/FIRST.NAME
relatedColumnsUpperCaseWithoutUnderline.put(item.toString().replaceAll("[._\\-$]", "").toUpperCase(), item.toString().toUpperCase());
}
MetaObject metaObject = SystemMetaObject.forObject(updateSql.getParameterObject());
MetaObject metaObject = PluginUtils.getMetaObject(updateSql.getParameterObject());

for (ParameterMapping parameterMapping : updateSql.getParameterMappings()) {
String propertyName = parameterMapping.getProperty();
Expand Down Expand Up @@ -324,7 +323,7 @@ private List<DataChangedRecord> compareAndGetUpdatedColumnDatas(String tableName


private Map<String, Object> buildParameterObjectMap(BoundSql boundSql) {
MetaObject metaObject = SystemMetaObject.forObject(boundSql.getParameterObject());
MetaObject metaObject = PluginUtils.getMetaObject(boundSql.getParameterObject());
Map<String, Object> propertyValMap = new HashMap<>(boundSql.getParameterMappings().size());
for (ParameterMapping parameterMapping : boundSql.getParameterMappings()) {
String propertyName = parameterMapping.getProperty();
Expand Down

0 comments on commit 46f8eee

Please sign in to comment.