com.akiban.sql.parser
Class UserTypeConstantNode

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.ValueNode
          extended by com.akiban.sql.parser.ConstantNode
              extended by com.akiban.sql.parser.UserTypeConstantNode
All Implemented Interfaces:
Visitable

public class UserTypeConstantNode
extends ConstantNode

User type constants. These are created by built-in types that use user types as their implementation. This could also potentially be used by an optimizer that wanted to store plans for frequently-used parameter values. This is also used to represent nulls in user types, which occurs when NULL is inserted into or supplied as the update value for a usertype column.


Field Summary
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
UserTypeConstantNode()
           
 
Method Summary
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 Object getConstantValueAsObject()
          Return an Object representing the bind time value of this expression tree.
 Object getObjectValue()
          Return the object value of this user defined type.
 void init(Object arg1)
          Initializer for a typed null node or a date, time, or timestamp value.
 boolean isNull()
          Return whether or not this node represents a typed null constant.
 
Methods inherited from class com.akiban.sql.parser.ConstantNode
getValue, init, isConstantExpression, isEquivalent, setValue, toString
 
Methods inherited from class com.akiban.sql.parser.ValueNode
getColumnName, getSchemaName, getSourceResultColumn, getTableName, getType, getTypeId, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, setNullability, setType
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, printSubNodes, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, treePrint, treePrint, treePrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserTypeConstantNode

public UserTypeConstantNode()
Method Detail

init

public void init(Object arg1)
          throws StandardException
Initializer for a typed null node or a date, time, or timestamp value. Parameters may be:

- OR -

Overrides:
init in class QueryTreeNode
Throws:
StandardException - thrown on failure

copyFrom

public void copyFrom(QueryTreeNode node)
              throws StandardException
Fill this node with a deep copy of the given node.

Overrides:
copyFrom in class ConstantNode
Throws:
StandardException

getObjectValue

public Object getObjectValue()
Return the object value of this user defined type.

Returns:
the value of this constant. can't use getValue() for this. getValue() returns the DataValueDescriptor for the built-in types that are implemented as user types (date, time, timestamp)

isNull

public boolean isNull()
Return whether or not this node represents a typed null constant.


getConstantValueAsObject

public Object getConstantValueAsObject()
Return an Object representing the bind time value of this expression tree. If the expression tree does not evaluate to a constant at bind time then we return null. This is useful for bind time resolution of VTIs. RESOLVE: What do we do for primitives?

Returns:
An Object representing the bind time value of this expression tree. (null if not a bind time constant.)


Copyright © 2013 Akiban Technologies, Inc. All rights reserved.