update comments

This commit is contained in:
开源海哥 2023-03-02 15:06:52 +08:00
parent 01b7fcef9a
commit ca180e18a4
3 changed files with 5 additions and 6 deletions

View File

@ -49,6 +49,7 @@ public @interface Column {
/** /**
* 是否是逻辑删除字段一张表中只能存在 1 一个逻辑删除字段 * 是否是逻辑删除字段一张表中只能存在 1 一个逻辑删除字段
* 逻辑删除的字段被删除时会设置为 1正常状态为 0
*/ */
boolean isLogicDelete() default false; boolean isLogicDelete() default false;

View File

@ -59,14 +59,13 @@ public class Row extends HashMap<String, Object> implements ModifyAttrsRecord {
return row; return row;
} }
public static Row ofKey(RowKey ...rowKeys) { public static Row ofKey(RowKey... rowKeys) {
Row row = new Row(); Row row = new Row();
row.primaryKeys = rowKeys; row.primaryKeys = rowKeys;
return row; return row;
} }
public static Row ofKey(RowKey rowKey, Object value) { public static Row ofKey(RowKey rowKey, Object value) {
Row row = new Row(); Row row = new Row();
row.primaryKeys = new RowKey[]{rowKey}; row.primaryKeys = new RowKey[]{rowKey};
@ -88,16 +87,16 @@ public class Row extends HashMap<String, Object> implements ModifyAttrsRecord {
public Row set(String key, Object value) { public Row set(String key, Object value) {
put(key, value); put(key, value);
boolean isPrimaryKey = false; boolean isPrimaryKey = false;
if (this.primaryKeys != null){ if (this.primaryKeys != null) {
for (RowKey rowKey : primaryKeys) { for (RowKey rowKey : primaryKeys) {
if (rowKey.getKeyColumn().equals(key)){ if (rowKey.getKeyColumn().equals(key)) {
isPrimaryKey = true; isPrimaryKey = true;
break; break;
} }
} }
} }
if (!isPrimaryKey){ if (!isPrimaryKey) {
addModifyAttr(key); addModifyAttr(key);
} }

View File

@ -92,7 +92,6 @@ public interface RowMapper {
* @param row id 值的数据可以通过 {@link Row#ofKey(String, Object)} 来创建 * @param row id 值的数据可以通过 {@link Row#ofKey(String, Object)} 来创建
* @return 执行影响的行数 * @return 执行影响的行数
*/ */
default int deleteById(@Param(FlexConsts.TABLE_NAME) String tableName, @Param(FlexConsts.ROW) Row row) { default int deleteById(@Param(FlexConsts.TABLE_NAME) String tableName, @Param(FlexConsts.ROW) Row row) {
return deleteById(tableName, StringUtil.join(",", row.obtainsPrimaryKeyStrings()), row.obtainsPrimaryValues()); return deleteById(tableName, StringUtil.join(",", row.obtainsPrimaryKeyStrings()), row.obtainsPrimaryValues());
} }