mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
update comments
This commit is contained in:
parent
01b7fcef9a
commit
ca180e18a4
@ -49,6 +49,7 @@ public @interface Column {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是逻辑删除字段,一张表中只能存在 1 一个逻辑删除字段
|
* 是否是逻辑删除字段,一张表中只能存在 1 一个逻辑删除字段
|
||||||
|
* 逻辑删除的字段,被删除时,会设置为 1,正常状态为 0
|
||||||
*/
|
*/
|
||||||
boolean isLogicDelete() default false;
|
boolean isLogicDelete() default false;
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user