类 OperationContext

java.lang.Object
com.elitesland.ystdms.sys.operationlog.OperationContext

public class OperationContext extends Object
操作日志上下文
  • 构造器详细资料

    • OperationContext

      public OperationContext()
  • 方法详细资料

    • setOperationType

      public static void setOperationType(String operationType)
      设置操作类型(字符串)
    • setOperationType

      public static void setOperationType(OperationType operationType)
      设置操作类型(枚举,兼容旧代码)
    • getOperationType

      public static String getOperationType()
      获取操作类型
    • setBusinessType

      public static void setBusinessType(String businessType)
      设置业务类型
    • getBusinessType

      public static String getBusinessType()
      获取业务类型
    • setEnabled

      public static void setEnabled(boolean enabled)
      设置是否启用日志记录
    • isEnabled

      public static boolean isEnabled()
      是否启用日志记录
    • setBatchCount

      public static void setBatchCount(int count)
      设置批量操作数量 用于批量插入或更新时,记录每一条数据的日志
      参数:
      count - 批量操作的数据条数,如果 > 1 则表示批量操作
    • getBatchCount

      public static Integer 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()
      清理上下文