org.eigenbase.sql.type
Class ObjectSqlType

java.lang.Object
  extended by org.eigenbase.reltype.RelDataTypeImpl
      extended by org.eigenbase.sql.type.AbstractSqlType
          extended by org.eigenbase.sql.type.ObjectSqlType
All Implemented Interfaces:
Serializable, Cloneable, RelDataType, RelDataTypeFamily

public class ObjectSqlType
extends AbstractSqlType

ObjectSqlType represents an SQL structured user-defined type.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/type/ObjectSqlType.java#11 $
Author:
John V. Sichi
See Also:
Serialized Form

Field Summary
private  RelDataTypeComparability comparability
           
private  RelDataTypeFamily family
           
private  SqlIdentifier sqlIdentifier
           
 
Fields inherited from class org.eigenbase.sql.type.AbstractSqlType
isNullable, typeName
 
Fields inherited from class org.eigenbase.reltype.RelDataTypeImpl
digest, fieldList, fields
 
Constructor Summary
ObjectSqlType(SqlTypeName typeName, SqlIdentifier sqlIdentifier, boolean nullable, RelDataTypeField[] fields, RelDataTypeComparability comparability)
          Constructs an object type.
 
Method Summary
protected  void generateTypeString(StringBuilder sb, boolean withDetail)
          Generates a string representation of this type.
 RelDataTypeComparability getComparability()
           
 RelDataTypeFamily getFamily()
          Gets a canonical object representing the family of this type.
 SqlIdentifier getSqlIdentifier()
          Gets the SqlIdentifier associated with this type.
 void setFamily(RelDataTypeFamily family)
           
 
Methods inherited from class org.eigenbase.sql.type.AbstractSqlType
getPrecedenceList, getSqlTypeName, isNullable
 
Methods inherited from class org.eigenbase.reltype.RelDataTypeImpl
computeDigest, equals, getCharset, getCollation, getComponentType, getField, getFieldCount, getFieldList, getFieldOrdinal, getFields, getFullTypeString, getIntervalQualifier, getPrecision, getScale, hashCode, isStruct, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

sqlIdentifier

private final SqlIdentifier sqlIdentifier

comparability

private final RelDataTypeComparability comparability

family

private RelDataTypeFamily family
Constructor Detail

ObjectSqlType

public ObjectSqlType(SqlTypeName typeName,
                     SqlIdentifier sqlIdentifier,
                     boolean nullable,
                     RelDataTypeField[] fields,
                     RelDataTypeComparability comparability)
Constructs an object type. This should only be called from a factory method.

Parameters:
typeName - SqlTypeName for this type (either Distinct or Structured)
sqlIdentifier - identifier for this type
nullable - whether type accepts nulls
fields - object attribute definitions
Method Detail

setFamily

public void setFamily(RelDataTypeFamily family)

getComparability

public RelDataTypeComparability getComparability()
Specified by:
getComparability in interface RelDataType
Overrides:
getComparability in class RelDataTypeImpl
Returns:
the category of comparison operators which make sense when applied to values of this type

getSqlIdentifier

public SqlIdentifier getSqlIdentifier()
Description copied from interface: RelDataType
Gets the SqlIdentifier associated with this type. For a predefined type, this is a simple identifier based on RelDataType.getSqlTypeName(). For a user-defined type, this is a compound identifier which uniquely names the type.

Specified by:
getSqlIdentifier in interface RelDataType
Overrides:
getSqlIdentifier in class RelDataTypeImpl
Returns:
SqlIdentifier, or null if this is not an SQL type

getFamily

public RelDataTypeFamily getFamily()
Description copied from interface: RelDataType
Gets a canonical object representing the family of this type. Two values can be compared if and only if their types are in the same family.

Specified by:
getFamily in interface RelDataType
Overrides:
getFamily in class AbstractSqlType
Returns:
canonical object representing type family

generateTypeString

protected void generateTypeString(StringBuilder sb,
                                  boolean withDetail)
Description copied from class: RelDataTypeImpl
Generates a string representation of this type.

Specified by:
generateTypeString in class RelDataTypeImpl
Parameters:
sb - StringBuffer into which to generate the string
withDetail - when true, all detail information needed to compute a unique digest (and return from getFullTypeString) should be included;