类 CacheUtil

java.lang.Object
org.anyline.data.cache.CacheUtil

public class CacheUtil extends Object
  • 构造器详细资料

    • CacheUtil

      public CacheUtil()
  • 方法详细资料

    • start

      public static boolean start(String key, int sec)
      开始刷新 如果不符合刷新条件返回false
      参数:
      key - key
      sec - sec
      返回:
      boolean
    • start

      public static boolean start(String key)
    • stop

      public static void stop(String key, int sec)
      刷新完成
      参数:
      key - key
      sec - sec
    • stop

      public static void stop(String key)
    • isRun

      public static boolean isRun(String key)
    • getRunTime

      public static long getRunTime(String key)
      已执行时间
      参数:
      key - key
      返回:
      long
    • crateCachePrimaryKey

      public static String crateCachePrimaryKey(String table, DataRow row)
      创建集中缓存的key
      参数:
      table - 表
      row - row
      返回:
      String
    • createCacheElementKey

      public static String createCacheElementKey(boolean page, boolean order, String dest, ConfigStore store, String... conditions)
      创建cache key
      参数:
      page - 是否需要拼接分页下标
      order - order
      dest - 查询或操作的目标(表、存储过程、SQL等)
      store - 根据http等上下文构造查询条件
      conditions - 查询条件 支持k:v k:v::type 以及原生sql形式(包含ORDER、GROUP、HAVING)默认忽略空值条件
      返回:
      String
    • createCacheElementKey

      public static String createCacheElementKey(boolean page, boolean order, Table dest, ConfigStore store, String... conditions)