Enum NullCollation

All Implemented Interfaces:
Serializable, Comparable<NullCollation>, Constable

public enum NullCollation extends Enum<NullCollation>
Strategy for how NULL values are to be sorted if NULLS FIRST or NULLS LAST are not specified in an item in the ORDER BY clause.
  • Enum Constant Details

    • HIGH

      public static final NullCollation HIGH
      Nulls first for DESC, nulls last for ASC.
    • LOW

      public static final NullCollation LOW
      Nulls last for DESC, nulls first for ASC.
    • FIRST

      public static final NullCollation FIRST
      Nulls first for DESC and ASC.
    • LAST

      public static final NullCollation LAST
      Nulls last for DESC and ASC.
  • Method Details

    • values

      public static NullCollation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static NullCollation valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • last

      public boolean last(boolean desc)
      Returns whether NULL values should appear last.
      desc - Whether sort is descending
    • isDefaultOrder

      public boolean isDefaultOrder(boolean nullsFirst, boolean desc)
      Returns whether a given combination of null direction and sort order is the default order of nulls returned in the ORDER BY clause.