com.akiban.sql.parser
Class CursorNode

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.StatementNode
          extended by com.akiban.sql.parser.DMLStatementNode
              extended by com.akiban.sql.parser.CursorNode
All Implemented Interfaces:
Visitable

public class CursorNode
extends DMLStatementNode

A CursorNode represents a result set that can be returned to a client. A cursor can be a named cursor created by the DECLARE CURSOR statement, or it can be an unnamed cursor associated with a SELECT statement (more precisely, a table expression that returns rows to the client). In the latter case, the cursor does not have a name.


Nested Class Summary
static class CursorNode.UpdateMode
           
 
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
CursorNode()
           
 
Method Summary
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 ValueNode getFetchFirstClause()
           
 String getName()
           
 ValueNode getOffsetClause()
           
 OrderByList getOrderByList()
           
 IsolationLevel getScanIsolationLevel()
           
 List<String> getUpdatableColumns()
          Return collection of names from the FOR UPDATE OF List
 CursorNode.UpdateMode getUpdateMode()
           
 void init(Object statementType, Object resultSet, Object name, Object orderByList, Object offset, Object fetchFirst, Object updateMode, Object updatableColumns)
          Initializer for a CursorNode
 void printSubNodes(int depth)
          Prints the sub-nodes of this object.
 void setScanIsolationLevel(IsolationLevel isolationLevel)
           
 String statementToString()
           
 String toString()
          Convert this object to a String.
 
Methods inherited from class com.akiban.sql.parser.DMLStatementNode
getResultSetNode, init
 
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, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, 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

CursorNode

public CursorNode()
Method Detail

init

public void init(Object statementType,
                 Object resultSet,
                 Object name,
                 Object orderByList,
                 Object offset,
                 Object fetchFirst,
                 Object updateMode,
                 Object updatableColumns)
Initializer for a CursorNode

Overrides:
init in class QueryTreeNode
Parameters:
statementType - Type of statement (SELECT, UPDATE, INSERT)
resultSet - A ResultSetNode specifying the result set for the cursor
name - The name of the cursor, null if no name
orderByList - The order by list for the cursor, null if no order by list
offset - The value of a if present
fetchFirst - The value of a if present
updateMode - The user-specified update mode for the cursor, for example, CursorNode.READ_ONLY
updatableColumns - The list of updatable columns specified by the user in the FOR UPDATE clause, null if no updatable columns specified. May only be provided if the updateMode parameter is CursorNode.UPDATE.

copyFrom

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

Overrides:
copyFrom in class DMLStatementNode
Throws:
StandardException

setScanIsolationLevel

public void setScanIsolationLevel(IsolationLevel isolationLevel)

toString

public String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class StatementNode
Returns:
This object as a String

statementToString

public String statementToString()
Specified by:
statementToString in class StatementNode

printSubNodes

public void printSubNodes(int depth)
Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Overrides:
printSubNodes in class DMLStatementNode
Parameters:
depth - The depth of this node in the tree

getName

public String getName()

getOrderByList

public OrderByList getOrderByList()

getOffsetClause

public ValueNode getOffsetClause()

getFetchFirstClause

public ValueNode getFetchFirstClause()

getUpdateMode

public CursorNode.UpdateMode getUpdateMode()

getScanIsolationLevel

public IsolationLevel getScanIsolationLevel()

getUpdatableColumns

public List<String> getUpdatableColumns()
Return collection of names from the FOR UPDATE OF List

Returns:
List of names from the FOR UPDATE OF list.


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