org.eigenbase.sql
Enum SqlNullSemantics

java.lang.Object
  extended by java.lang.Enum<SqlNullSemantics>
      extended by org.eigenbase.sql.SqlNullSemantics
All Implemented Interfaces:
Serializable, Comparable<SqlNullSemantics>

public enum SqlNullSemantics
extends 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.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/SqlNullSemantics.java#8 $
Author:
John V. Sichi

Enum Constant Summary
NULL_MATCHES_ANYTHING
          Wildcard semantics: logically, this is not present in any SQL construct.
NULL_MATCHES_NOTHING
          Predicate semantics: e.g.
NULL_MATCHES_NULL
          GROUP BY key semantics: e.g.
 
Method Summary
static SqlNullSemantics valueOf(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're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, 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.

Method Detail

values

public static final SqlNullSemantics[] values()
Returns an array containing the constants of this enum type, in the order they're 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're declared

valueOf

public static SqlNullSemantics 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.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name