程序包 cool.scx.dao

类 ColumnFilter

java.lang.Object
cool.scx.dao.ColumnFilter

public final class ColumnFilter extends Object
列过滤器
版本:
0.1.3
作者:
scx567888
  • 方法详细资料

    • ofIncluded

      public static ColumnFilter ofIncluded()
      启用白名单模式 (当一个实体类所对应的 field 的值为 null 时, 会将此 field 所对应的列排除, 详情请看 ofIncluded(boolean))
      返回:
      a
    • ofIncluded

      public static ColumnFilter ofIncluded(boolean excludeIfFieldValueIsNull)
      启用白名单模式
      参数:
      excludeIfFieldValueIsNull - 当一个实体类所对应的 field 的值为 null 时, 是否将此 field 所对应的列排除
      返回:
      a
    • ofIncluded

      public static ColumnFilter ofIncluded(String... fieldNames)
      白名单模式
      参数:
      fieldNames - a
      返回:
      a
    • ofIncluded

      public static ColumnFilter ofIncluded(boolean excludeIfFieldValueIsNull, String... fieldNames)
      白名单模式
      参数:
      excludeIfFieldValueIsNull - a
      fieldNames - a
      返回:
      a
    • ofExcluded

      public static ColumnFilter ofExcluded()
      启用黑名单模式 (当一个实体类所对应的 field 的值为 null 时, 会将此 field 所对应的列排除, 详情请看 ofExcluded(boolean))
      返回:
      a
    • ofExcluded

      public static ColumnFilter ofExcluded(boolean excludeIfFieldValueIsNull)
      启动黑名单模式
      参数:
      excludeIfFieldValueIsNull - 当一个实体类所对应的 field 的值为 null 时, 是否将此 field 所对应的列排除
      返回:
      a
    • ofExcluded

      public static ColumnFilter ofExcluded(String... fieldNames)
      黑名单模式
      参数:
      fieldNames - a
      返回:
      a
    • ofExcluded

      public static ColumnFilter ofExcluded(boolean excludeIfFieldValueIsNull, String... fieldNames)
      黑名单模式
      参数:
      excludeIfFieldValueIsNull - a
      fieldNames - a
      返回:
      a
    • addIncluded

      public ColumnFilter addIncluded(String... fieldNames)
      添加 白名单
      参数:
      fieldNames - 包含的列名 (注意是 java 字段名称 ,不是 数据库 字段名称)
      返回:
      this 方便链式调用
    • addExcluded

      public ColumnFilter addExcluded(String... fieldNames)
      添加 黑名单
      参数:
      fieldNames - 包含的列名 (注意是 java 字段名称 ,不是 数据库 字段名称)
      返回:
      this 方便链式调用
    • removeIncluded

      public ColumnFilter removeIncluded(String... fieldNames)
      移除白名单
      参数:
      fieldNames - 包含的列名 (注意是 java 字段名称 ,不是 数据库 字段名称)
      返回:
      this 方便链式调用
    • removeExcluded

      public ColumnFilter removeExcluded(String... fieldNames)
      移除黑名单
      参数:
      fieldNames - 包含的列名 (注意是 java 字段名称 ,不是 数据库 字段名称)
      返回:
      this 方便链式调用
    • clear

      public ColumnFilter clear()
      清除所有 包含类型的列
      返回:
      this 方便链式调用
    • filter

      public ColumnMapping[] filter(Table<? extends ColumnMapping> tableInfo)
      过滤
      参数:
      tableInfo - 带过滤的列表
      返回:
      过滤后的列表
    • filterMode

      public ColumnFilter.FilterMode filterMode()
      获取当前模式
      返回:
      mode 分三种 禁用 : 0 ,包含模式 : 1 排除模式 : 2
    • filter

      public ColumnMapping[] filter(Object entity, Table<? extends ColumnMapping> tableInfo)
      过滤
      参数:
      entity - a
      tableInfo - 带过滤的列表
      返回:
      过滤后的列表