org.eigenbase.sql2rel
Interface DefaultValueFactory

All Known Implementing Classes:
ReposDefaultValueFactory, SqlToRelConverter.NullDefaultValueFactory

public interface DefaultValueFactory

DefaultValueFactory supplies default values for INSERT, UPDATE, and NEW.

TODO jvs 26-Feb-2005: rename this to InitializerExpressionFactory, since it is in the process of being generalized to handle constructor invocations and eventually generated columns.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql2rel/DefaultValueFactory.java#12 $
Author:
John V. Sichi

Method Summary
 boolean isGeneratedAlways(RelOptTable table, int iColumn)
          Whether a column is always generated.
 RexNode newAttributeInitializer(RelDataType type, SqlFunction constructor, int iAttribute, RexNode[] constructorArgs)
          Creates an expression which evaluates to the initializer expression for a particular attribute of a structured type.
 RexNode newColumnDefaultValue(RelOptTable table, int iColumn)
          Creates an expression which evaluates to the default value for a particular column.
 

Method Detail

isGeneratedAlways

boolean isGeneratedAlways(RelOptTable table,
                          int iColumn)
Whether a column is always generated. If a column is always generated, then non-generated values cannot be inserted into the column.


newColumnDefaultValue

RexNode newColumnDefaultValue(RelOptTable table,
                              int iColumn)
Creates an expression which evaluates to the default value for a particular column.

Parameters:
table - the table containing the column
iColumn - the 0-based offset of the column in the table
Returns:
default value expression

newAttributeInitializer

RexNode newAttributeInitializer(RelDataType type,
                                SqlFunction constructor,
                                int iAttribute,
                                RexNode[] constructorArgs)
Creates an expression which evaluates to the initializer expression for a particular attribute of a structured type.

Parameters:
type - the structured type
constructor - the constructor invoked to initialize the type
iAttribute - the 0-based offset of the attribute in the type
constructorArgs - arguments passed to the constructor invocation
Returns:
default value expression