net.sf.saffron.sql
Class SqlInsert

java.lang.Object
  |
  +--net.sf.saffron.sql.SqlNode
        |
        +--net.sf.saffron.sql.SqlCall
              |
              +--net.sf.saffron.sql.SqlInsert

public class SqlInsert
extends SqlCall

A SqlInsert is a node of a parse tree which represents an INSERT statement.


Nested Class Summary
 
Nested classes inherited from class net.sf.saffron.sql.SqlNode
SqlNode.DatabaseMetaDataInvocationHandler
 
Field Summary
static int OPERAND_COUNT
           
static int SOURCE_OPERAND
           
static int TARGET_COLUMN_LIST_OPERAND
           
static int TARGET_TABLE_OPERAND
           
 
Fields inherited from class net.sf.saffron.sql.SqlCall
operands, operator
 
Constructor Summary
SqlInsert(SqlSpecialOperator operator, SqlIdentifier targetTable, SqlNode source, SqlNodeList columnList)
           
 
Method Summary
 SqlNode getSource()
          .
 SqlSelect getSourceSelect()
          Get the source SELECT expression for the data to be inserted.
 SqlNodeList getTargetColumnList()
          .
 SqlIdentifier getTargetTable()
          .
 void unparse(SqlWriter writer, int leftPrec, int rightPrec)
          Writes a SQL representation of this node to a writer.
 
Methods inherited from class net.sf.saffron.sql.SqlCall
addOperand, clone, getKind, getOperands, isA, setOperand
 
Methods inherited from class net.sf.saffron.sql.SqlNode
cloneArray, toString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TARGET_TABLE_OPERAND

public static final int TARGET_TABLE_OPERAND
See Also:
Constant Field Values

SOURCE_OPERAND

public static final int SOURCE_OPERAND
See Also:
Constant Field Values

TARGET_COLUMN_LIST_OPERAND

public static final int TARGET_COLUMN_LIST_OPERAND
See Also:
Constant Field Values

OPERAND_COUNT

public static final int OPERAND_COUNT
See Also:
Constant Field Values
Constructor Detail

SqlInsert

public SqlInsert(SqlSpecialOperator operator,
                 SqlIdentifier targetTable,
                 SqlNode source,
                 SqlNodeList columnList)
Method Detail

getTargetTable

public SqlIdentifier getTargetTable()
.

Returns:
the identifier for the target table of the insertion

getSourceSelect

public SqlSelect getSourceSelect()
Get the source SELECT expression for the data to be inserted. It is only safe to call this after non-SELECT source expressions (e.g. VALUES) have been expanded by SqlValidator.createInternalSelect

Returns:
the source SELECT for the data to be inserted

getSource

public SqlNode getSource()
.

Returns:
the source expression for the data to be inserted

getTargetColumnList

public SqlNodeList getTargetColumnList()
.

Returns:
the list of target column names, or null for all columns in the target table

unparse

public void unparse(SqlWriter writer,
                    int leftPrec,
                    int rightPrec)
Description copied from class: SqlNode
Writes a SQL representation of this node to a writer.

Overrides:
unparse in class SqlCall

SourceForge.net_Logo