org.apache.derby.impl.sql.execute
Class InsertConstantAction

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.WriteCursorConstantAction
      extended by org.apache.derby.impl.sql.execute.InsertConstantAction
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat, ConstantAction

public class InsertConstantAction
extends WriteCursorConstantAction

This class describes compiled constants that are passed into InsertResultSets.

See Also:
Serialized Form

Field Summary
private  long[] autoincIncrement
           
protected  RowLocation[] autoincRowLocation
          An array of row location objects (0 based), one for each column in the table.
private  java.lang.String[] columnNames
           
(package private)  boolean[] indexedCols
          This class implements Formatable.
private  java.lang.String schemaName
           
private  java.lang.String tableName
           
 
Fields inherited from class org.apache.derby.impl.sql.execute.WriteCursorConstantAction
conglomId, deferred, heapSCOCI, indexCIDS, indexNames, indexSCOCIs, irgs, lockMode, singleRowSource, targetUUID
 
Constructor Summary
InsertConstantAction()
          Public niladic constructor.
InsertConstantAction(TableDescriptor tableDescriptor, long conglomId, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, java.lang.String[] indexNames, boolean deferred, java.util.Properties targetProperties, UUID targetUUID, int lockMode, FKInfo[] fkInfo, TriggerInfo triggerInfo, int[] streamStorableHeapColIds, boolean[] indexedCols, boolean singleRowSource, RowLocation[] autoincRowLocation)
          Make the ConstantAction for an INSERT statement.
 
Method Summary
 long getAutoincIncrement(int i)
          gets the increment value for a column.
 RowLocation[] getAutoincRowLocation()
          gets the row location
 java.lang.String getColumnName(int i)
          gets the name of the desired column in the taget table.
 java.lang.String getSchemaName()
          Gets the name of the schema that the table is in
 java.lang.String getTableName()
          Gets the name of the table being inserted into
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 boolean hasAutoincrement()
          Does the target table has autoincrement columns.
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
 void writeExternal(java.io.ObjectOutput out)
          Write this object to a stream of stored objects.
 
Methods inherited from class org.apache.derby.impl.sql.execute.WriteCursorConstantAction
executeConstantAction, getBaseRowReadList, getBaseRowReadMap, getConglomerateId, getEmptyHeapRow, getFKInfo, getIndexNameFromCID, getIndexNames, getProperty, getStreamStorableHeapColIds, getTargetProperties, getTriggerInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexedCols

boolean[] indexedCols
This class implements Formatable. But it is NOT used across either major or minor releases. It is only written persistently in stored prepared statements, not in the replication stage. SO, IT IS OK TO CHANGE ITS read/writeExternal.


schemaName

private java.lang.String schemaName

tableName

private java.lang.String tableName

columnNames

private java.lang.String[] columnNames

autoincRowLocation

protected RowLocation[] autoincRowLocation
An array of row location objects (0 based), one for each column in the table. If the column is an autoincrement table then the array points to the row location of the column in SYSCOLUMNS. if not, then it contains null.


autoincIncrement

private long[] autoincIncrement
Constructor Detail

InsertConstantAction

public InsertConstantAction()
Public niladic constructor. Needed for Formatable interface to work.


InsertConstantAction

public InsertConstantAction(TableDescriptor tableDescriptor,
                            long conglomId,
                            StaticCompiledOpenConglomInfo heapSCOCI,
                            IndexRowGenerator[] irgs,
                            long[] indexCIDS,
                            StaticCompiledOpenConglomInfo[] indexSCOCIs,
                            java.lang.String[] indexNames,
                            boolean deferred,
                            java.util.Properties targetProperties,
                            UUID targetUUID,
                            int lockMode,
                            FKInfo[] fkInfo,
                            TriggerInfo triggerInfo,
                            int[] streamStorableHeapColIds,
                            boolean[] indexedCols,
                            boolean singleRowSource,
                            RowLocation[] autoincRowLocation)
Make the ConstantAction for an INSERT statement.

Parameters:
conglomId - Conglomerate ID.
heapSCOCI - StaticCompiledOpenConglomInfo for heap.
irgs - Index descriptors
indexCIDS - Conglomerate IDs of indices
indexSCOCIs - StaticCompiledOpenConglomInfos for indexes.
indexNames - Names of indices on this table for error reporting.
deferred - True means process as a deferred insert.
targetProperties - Properties on the target table.
targetUUID - UUID of target table
lockMode - The lockMode to use on the target table
fkInfo - Array of structures containing foreign key info, if any (may be null)
triggerInfo - Array of structures containing trigger info, if any (may be null)
streamStorableHeapColIds - Null for non rep. (0 based)
indexedCols - boolean[] of which (0-based) columns are indexed.
singleRowSource - Whether or not source is a single row source
autoincRowLocation - Array of rowlocations of autoincrement values in SYSCOLUMNS for each ai column.
Method Detail

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Description copied from class: WriteCursorConstantAction
Read this object from a stream of stored objects.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class WriteCursorConstantAction
Parameters:
in - read this.
Throws:
java.io.IOException - thrown on error
java.lang.ClassNotFoundException - thrown on error

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this object to a stream of stored objects.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class WriteCursorConstantAction
Parameters:
out - write bytes here.
Throws:
java.io.IOException - thrown on error

getSchemaName

public java.lang.String getSchemaName()
Gets the name of the schema that the table is in

Returns:
schema name

getTableName

public java.lang.String getTableName()
Gets the name of the table being inserted into

Returns:
name of table being inserted into

getColumnName

public java.lang.String getColumnName(int i)
gets the name of the desired column in the taget table.

Parameters:
i - the column number

getAutoincIncrement

public long getAutoincIncrement(int i)
gets the increment value for a column.

Parameters:
i - the column number

hasAutoincrement

public boolean hasAutoincrement()
Does the target table has autoincrement columns.

Returns:
True if the table has ai columns

getAutoincRowLocation

public RowLocation[] getAutoincRowLocation()
gets the row location


getTypeFormatId

public int getTypeFormatId()
Get the formatID which corresponds to this class.

Returns:
the formatID of this class

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.