浏览代码

remove 系方法添加 modifyFlag支持

James 3 年之前
父节点
当前提交
889d130f5d
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/main/java/com/jfinal/plugin/activerecord/Record.java

+ 5 - 1
src/main/java/com/jfinal/plugin/activerecord/Record.java

@@ -137,6 +137,7 @@ public class Record implements IRow<Record>, Serializable {
 	 */
 	public Record remove(String column) {
 		getColumns().remove(column);
+		_getModifyFlag().remove(column);
 		return this;
 	}
 	
@@ -146,8 +147,10 @@ public class Record implements IRow<Record>, Serializable {
 	 */
 	public Record remove(String... columns) {
 		if (columns != null)
-			for (String c : columns)
+			for (String c : columns) {
 				this.getColumns().remove(c);
+				this._getModifyFlag().remove(c);
+			}
 		return this;
 	}
 	
@@ -159,6 +162,7 @@ public class Record implements IRow<Record>, Serializable {
 			Entry<String, Object> e = it.next();
 			if (e.getValue() == null) {
 				it.remove();
+				_getModifyFlag().remove(e.getKey());
 			}
 		}
 		return this;