Enum SqlNullSemantics

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SqlNullSemantics>

    public enum SqlNullSemantics
    extends java.lang.Enum<SqlNullSemantics>
    SqlNullSemantics defines the possible comparison rules for values which might be null. In SQL (and internal plans used to process SQL) different rules are used depending on the context.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SqlNullSemantics()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SqlNullSemantics valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SqlNullSemantics[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NULL_MATCHES_NOTHING

        public static final SqlNullSemantics NULL_MATCHES_NOTHING
        Predicate semantics: e.g. in the expression (WHERE X=5), if X is NULL, the comparison result is unknown, and so a filter used to evaluate the WHERE clause rejects the row.
      • NULL_MATCHES_NULL

        public static final SqlNullSemantics NULL_MATCHES_NULL
        GROUP BY key semantics: e.g. in the expression (GROUP BY A,B), the key (null,5) is treated as equal to another key (null,5).
      • NULL_MATCHES_ANYTHING

        public static final SqlNullSemantics NULL_MATCHES_ANYTHING
        Wildcard semantics: logically, this is not present in any SQL construct. However, it is required internally, for example to rewrite NOT IN to NOT EXISTS; when we negate a predicate, we invert the null semantics, so NULL_MATCHES_NOTHING must become NULL_MATCHES_ANYTHING.
    • Constructor Detail

      • SqlNullSemantics

        private SqlNullSemantics()
    • Method Detail

      • values

        public static SqlNullSemantics[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SqlNullSemantics c : SqlNullSemantics.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SqlNullSemantics valueOf​(java.lang.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.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null