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

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

abstract class WriteCursorConstantAction
extends java.lang.Object
implements ConstantAction, Formatable

This abstract class describes compiled constants that are passed into Delete, Insert, and Update ResultSets. This class and its sub-classes are not really implementations of ConstantAction, since they are not executed. A better name for these classes would be 'Constants'. E.g. WriteCursorConstants, DeleteConstants. Ideally one day the split will occur.


Field Summary
private  FormatableBitSet baseRowReadList
           
private  int[] baseRowReadMap
           
(package private)  long conglomId
          This class implements Formatable.
(package private)  boolean deferred
           
private  ExecRow emptyHeapRow
           
private  FKInfo[] fkInfo
           
(package private)  StaticCompiledOpenConglomInfo heapSCOCI
           
(package private)  long[] indexCIDS
           
(package private)  java.lang.String[] indexNames
           
(package private)  StaticCompiledOpenConglomInfo[] indexSCOCIs
           
(package private)  IndexRowGenerator[] irgs
           
(package private)  int lockMode
           
(package private)  boolean singleRowSource
           
private  int[] streamStorableHeapColIds
           
private  java.util.Properties targetProperties
           
(package private)  UUID targetUUID
           
private  TriggerInfo triggerInfo
           
 
Constructor Summary
WriteCursorConstantAction()
          Public niladic constructor.
WriteCursorConstantAction(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, ExecRow emptyHeapRow, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, boolean singleRowSource)
          Make the ConstantAction for a DELETE, INSERT, or UPDATE statement.
 
Method Summary
 void executeConstantAction(Activation activation)
          NOP routine.
 FormatableBitSet getBaseRowReadList()
           
 int[] getBaseRowReadMap()
           
 long getConglomerateId()
          Get the conglomerate id for the changed heap.
 ExecRow getEmptyHeapRow(LanguageConnectionContext lcc)
          Get emptyHeapRow
(package private)  FKInfo[] getFKInfo()
          Gets the foreign key information for this constant action.
 java.lang.String getIndexNameFromCID(long indexCID)
          get the index name given the conglomerate id of the index.
 java.lang.String[] getIndexNames()
           
 java.lang.String getProperty(java.lang.String key)
          The the value of the specified key, if it exists, from the targetProperties.
 int[] getStreamStorableHeapColIds()
           
 java.util.Properties getTargetProperties()
          Get the targetProperties from the constant action.
(package private)  TriggerInfo getTriggerInfo()
          Basically, the same as getFKInfo but for triggers.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.services.io.TypedFormat
getTypeFormatId
 

Field Detail

conglomId

long conglomId
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.


heapSCOCI

StaticCompiledOpenConglomInfo heapSCOCI

irgs

IndexRowGenerator[] irgs

indexCIDS

long[] indexCIDS

indexSCOCIs

StaticCompiledOpenConglomInfo[] indexSCOCIs

indexNames

java.lang.String[] indexNames

deferred

boolean deferred

targetProperties

private java.util.Properties targetProperties

targetUUID

UUID targetUUID

lockMode

int lockMode

fkInfo

private FKInfo[] fkInfo

triggerInfo

private TriggerInfo triggerInfo

emptyHeapRow

private ExecRow emptyHeapRow

baseRowReadList

private FormatableBitSet baseRowReadList

baseRowReadMap

private int[] baseRowReadMap

streamStorableHeapColIds

private int[] streamStorableHeapColIds

singleRowSource

boolean singleRowSource
Constructor Detail

WriteCursorConstantAction

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


WriteCursorConstantAction

public WriteCursorConstantAction(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,
                                 ExecRow emptyHeapRow,
                                 FormatableBitSet baseRowReadList,
                                 int[] baseRowReadMap,
                                 int[] streamStorableHeapColIds,
                                 boolean singleRowSource)
Make the ConstantAction for a DELETE, INSERT, or UPDATE statement.

Parameters:
conglomId - Conglomerate ID of heap.
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 update
targetProperties - Properties on the target table
targetUUID - UUID of target table
lockMode - The lock mode to use on the target table
fkInfo - Structure containing foreign key info, if any (may be null)
triggerInfo - Structure containing trigger info, if any (may be null)
emptyHeapRow - an empty heap row
baseRowReadMap - BaseRowReadMap[heapColId]->ReadRowColumnId. (0 based)
streamStorableHeapColIds - Null for non rep. (0 based)
singleRowSource - Whether or not source is a single row source
Method Detail

getFKInfo

final FKInfo[] getFKInfo()
Gets the foreign key information for this constant action. A full list of foreign keys was compiled into this constant action.

Returns:
the list of foreign keys to enforce for this action

getTriggerInfo

TriggerInfo getTriggerInfo()
Basically, the same as getFKInfo but for triggers.

Returns:
the triggers that should be fired

executeConstantAction

public final void executeConstantAction(Activation activation)
                                 throws StandardException
NOP routine. The work is done in InsertResultSet.

Specified by:
executeConstantAction in interface ConstantAction
Parameters:
activation - The execution environment for this constant action.
Throws:
StandardException - Thrown on failure
See Also:
ConstantAction.executeConstantAction(org.apache.derby.iapi.sql.Activation)

readExternal

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

Specified by:
readExternal in interface java.io.Externalizable
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
Parameters:
out - write bytes here.
Throws:
java.io.IOException - thrown on error

getConglomerateId

public long getConglomerateId()
Get the conglomerate id for the changed heap.

Returns:
the conglomerate id.

getEmptyHeapRow

public ExecRow getEmptyHeapRow(LanguageConnectionContext lcc)
                        throws StandardException
Get emptyHeapRow

Parameters:
lcc - The LanguageConnectionContext to use.
Returns:
an empty base table row for the table being updated.
Throws:
StandardException - on error

getTargetProperties

public java.util.Properties getTargetProperties()
Get the targetProperties from the constant action.

Returns:
The targetProperties

getProperty

public java.lang.String getProperty(java.lang.String key)
The the value of the specified key, if it exists, from the targetProperties.

Parameters:
key - The key to search for
Returns:
The value for the specified key if it exists, otherwise null. (Return null if targetProperties is null.)

getBaseRowReadList

public FormatableBitSet getBaseRowReadList()

getBaseRowReadMap

public int[] getBaseRowReadMap()

getStreamStorableHeapColIds

public int[] getStreamStorableHeapColIds()

getIndexNameFromCID

public java.lang.String getIndexNameFromCID(long indexCID)
get the index name given the conglomerate id of the index.

Parameters:
indexCID - conglomerate ID of the index.
Returns:
index name of given index.

getIndexNames

public java.lang.String[] getIndexNames()

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

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