类 OperationContext
java.lang.Object
com.elitesland.ystdms.sys.operationlog.OperationContext
操作日志上下文
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidclear()清理上下文static int批量计数减1,返回剩余数量static Integer获取批量操作数量static String获取业务类型static String获取操作类型static boolean是否启用日志记录static boolean是否是部分更新模式static voidsetBatchCount(int count) 设置批量操作数量 用于批量插入或更新时,记录每一条数据的日志static voidsetBusinessType(String businessType) 设置业务类型static voidsetEnabled(boolean enabled) 设置是否启用日志记录static voidsetOperationType(OperationType operationType) 设置操作类型(枚举,兼容旧代码)static voidsetOperationType(String operationType) 设置操作类型(字符串)static voidsetPartialUpdateMode(boolean partialUpdate) 设置部分更新模式 在此模式下,只比较 newEntity 中有值的字段,避免出现大量"从有值改为空"的变更记录
-
构造器详细资料
-
OperationContext
public OperationContext()
-
-
方法详细资料
-
setOperationType
设置操作类型(字符串) -
setOperationType
设置操作类型(枚举,兼容旧代码) -
getOperationType
获取操作类型 -
setBusinessType
设置业务类型 -
getBusinessType
获取业务类型 -
setEnabled
public static void setEnabled(boolean enabled) 设置是否启用日志记录 -
isEnabled
public static boolean isEnabled()是否启用日志记录 -
setBatchCount
public static void setBatchCount(int count) 设置批量操作数量 用于批量插入或更新时,记录每一条数据的日志- 参数:
count- 批量操作的数据条数,如果 > 1 则表示批量操作
-
getBatchCount
获取批量操作数量 -
decrementBatchCount
public static int decrementBatchCount()批量计数减1,返回剩余数量- 返回:
- 剩余数量
-
setPartialUpdateMode
public static void setPartialUpdateMode(boolean partialUpdate) 设置部分更新模式 在此模式下,只比较 newEntity 中有值的字段,避免出现大量"从有值改为空"的变更记录- 参数:
partialUpdate- true 表示只比较有值字段,false 表示比较所有字段
-
isPartialUpdateMode
public static boolean isPartialUpdateMode()是否是部分更新模式- 返回:
- true 表示只比较有值字段,false 表示比较所有字段
-
clear
public static void clear()清理上下文
-