org.eigenbase.sql.type
Enum SqlTypeFamily

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

public enum SqlTypeFamily
extends Enum<SqlTypeFamily>
implements RelDataTypeFamily

SqlTypeFamily provides SQL type categorization.

The primary family categorization is a complete disjoint partitioning of SQL types into families, where two types are members of the same primary family iff instances of the two types can be the operands of an SQL equality predicate such as WHERE v1 = v2. Primary families are returned by RelDataType.getFamily().

There is also a secondary family categorization which overlaps with the primary categorization. It is used in type strategies for more specific or more general categorization than the primary families. Secondary families are never returned by RelDataType.getFamily().

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/type/SqlTypeFamily.java#17 $
Author:
John V. Sichi

Enum Constant Summary
ANY
           
APPROXIMATE_NUMERIC
           
BINARY
           
BOOLEAN
           
CHARACTER
           
COLUMN_LIST
           
CURSOR
           
DATE
           
DATETIME
           
DATETIME_INTERVAL
           
EXACT_NUMERIC
           
INTEGER
           
INTERVAL_DAY_TIME
           
INTERVAL_YEAR_MONTH
           
MULTISET
           
NUMERIC
           
STRING
           
TIME
           
TIMESTAMP
           
 
Field Summary
private static SqlTypeFamily[] jdbcTypeToFamily
           
private  int ordinal
           
private static SqlTypeFamily[] sqlTypeToFamily
           
private  List<SqlTypeName> typeNames
          List of SqlTypeNames included in this family.
 
Method Summary
static SqlTypeFamily getFamilyForJdbcType(int jdbcType)
          Gets the primary family containing a JDBC type.
static SqlTypeFamily getFamilyForSqlType(SqlTypeName sqlTypeName)
          Gets the primary family containing a SqlTypeName.
 Collection<SqlTypeName> getTypeNames()
           
private static void setFamilyForJdbcType(int jdbcType, SqlTypeFamily family)
           
static SqlTypeFamily valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SqlTypeFamily[] 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

CHARACTER

public static final SqlTypeFamily CHARACTER

BINARY

public static final SqlTypeFamily BINARY

NUMERIC

public static final SqlTypeFamily NUMERIC

DATE

public static final SqlTypeFamily DATE

TIME

public static final SqlTypeFamily TIME

TIMESTAMP

public static final SqlTypeFamily TIMESTAMP

BOOLEAN

public static final SqlTypeFamily BOOLEAN

INTERVAL_YEAR_MONTH

public static final SqlTypeFamily INTERVAL_YEAR_MONTH

INTERVAL_DAY_TIME

public static final SqlTypeFamily INTERVAL_DAY_TIME

STRING

public static final SqlTypeFamily STRING

APPROXIMATE_NUMERIC

public static final SqlTypeFamily APPROXIMATE_NUMERIC

EXACT_NUMERIC

public static final SqlTypeFamily EXACT_NUMERIC

INTEGER

public static final SqlTypeFamily INTEGER

DATETIME

public static final SqlTypeFamily DATETIME

DATETIME_INTERVAL

public static final SqlTypeFamily DATETIME_INTERVAL

MULTISET

public static final SqlTypeFamily MULTISET

ANY

public static final SqlTypeFamily ANY

CURSOR

public static final SqlTypeFamily CURSOR

COLUMN_LIST

public static final SqlTypeFamily COLUMN_LIST
Field Detail

jdbcTypeToFamily

private static SqlTypeFamily[] jdbcTypeToFamily

sqlTypeToFamily

private static SqlTypeFamily[] sqlTypeToFamily

typeNames

private List<SqlTypeName> typeNames
List of SqlTypeNames included in this family.


ordinal

private int ordinal
Method Detail

values

public static final SqlTypeFamily[] 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(SqlTypeFamily c : SqlTypeFamily.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SqlTypeFamily 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

setFamilyForJdbcType

private static void setFamilyForJdbcType(int jdbcType,
                                         SqlTypeFamily family)

getFamilyForSqlType

public static SqlTypeFamily getFamilyForSqlType(SqlTypeName sqlTypeName)
Gets the primary family containing a SqlTypeName.

Parameters:
sqlTypeName - the type of interest
Returns:
containing family, or null for none

getFamilyForJdbcType

public static SqlTypeFamily getFamilyForJdbcType(int jdbcType)
Gets the primary family containing a JDBC type.

Parameters:
jdbcType - the JDBC type of interest
Returns:
containing family

getTypeNames

public Collection<SqlTypeName> getTypeNames()
Returns:
collection of SqlTypeNames included in this family