Enum Class WhereOption

java.lang.Object
java.lang.Enum<WhereOption>
cool.scx.data.query.WhereOption
所有已实现的接口:
Serializable, Comparable<WhereOption>, Constable

public enum WhereOption extends Enum<WhereOption>
a
版本:
0.0.1
作者:
scx567888
  • 枚举常量详细资料

    • REPLACE

      public static final WhereOption REPLACE
      替换同名的 where 参数
    • SKIP_IF_NULL

      public static final WhereOption SKIP_IF_NULL
      如果查询的参数值为 null 则跳过添加而不是报错
      这里虽然叫做 SKIP_IF_NULL 但实际上表示的有效参数数量是不是和所接受的参数数量一致
      只是为了简化书写
    • SKIP_IF_EMPTY_LIST

      public static final WhereOption SKIP_IF_EMPTY_LIST
      在 in 或 not in 中 如果有效的参数条目 (指去除 null 后的) 为空 则跳过添加而不是报错
      SKIP_IF_NULL 相同 是为了简化书写 其实际意义为参数中去除非法数值(为 null)后的列表长度是否为 0
    • USE_ORIGINAL_NAME

      public static final WhereOption USE_ORIGINAL_NAME
      使用原始名称 (不进行转换)
    • USE_JSON_EXTRACT

      public static final WhereOption USE_JSON_EXTRACT
      使用 json 查询
      注意和 WhereType.JSON_CONTAINS 一起使用时无效 因为 WhereType.JSON_CONTAINS 自己有针对 Json 的特殊实现
    • JSON_CONTAINS_INCLUDE_NULL_VALUE

      public static final WhereOption JSON_CONTAINS_INCLUDE_NULL_VALUE
      包含 null 值 只适用于 JSON_CONTAINS
    • USE_ORIGINAL_VALUE

      public static final WhereOption USE_ORIGINAL_VALUE
      注意只适用于 JSON_CONTAINS JSON_CONTAINS 默认会将值转换为 JSON 并去除为 value 为 null 的 字段 使用 原始值 时会将值 直接传递到 SQL 语句 若值为 实体类 则会转换为 JSON 不过 和默认情况相比, 转换的 JSON 会包含 value 为 null 的字段
  • 方法详细资料

    • values

      public static WhereOption[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      返回:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static WhereOption valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - 如果参数为空值