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

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

public class DeleteConstantAction
extends WriteCursorConstantAction

This class describes compiled constants that are passed into DeleteResultSets.

Author:
Rick Hillegas
See Also:
Serialized Form

Field Summary
 long conglomId
          This class implements Formatable.
 boolean deferred
           
(package private)  ConstantAction[] dependentCActions
           
 StaticCompiledOpenConglomInfo heapSCOCI
           
 long[] indexCIDS
           
 java.lang.String[] indexNames
           
 StaticCompiledOpenConglomInfo[] indexSCOCIs
           
 IndexRowGenerator[] irgs
           
 int lockMode
           
(package private)  int numColumns
          This class implements Formatable.
(package private)  ResultDescription resultDescription
           
 boolean singleRowSource
           
 java.util.Properties targetProperties
           
 UUID targetUUID
           
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.ConstantAction
RUNTIMESTATISTICS, STATISTICSTIMING
 
Constructor Summary
DeleteConstantAction()
          Public niladic constructor.
DeleteConstantAction(long conglomId, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, ExecRow emptyHeapRow, boolean deferred, UUID targetUUID, int lockMode, FKInfo[] fkInfo, TriggerInfo triggerInfo, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, int numColumns, boolean singleRowSource, ResultDescription resultDescription, ConstantAction[] dependentCActions)
          Make the ConstantAction for an DELETE 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
 FKInfo[] getFKInfo(ExecutionContext ec)
          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.
 TriggerInfo getTriggerInfo(ExecutionContext ec)
          Basically, the same as getFKInfo but for triggers.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 boolean modifiesTableId(UUID tableId)
          Does this constant action modify the passed in table uuid?
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
 boolean upToDate()
          Reports whether these constants are up-to-date.
 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
 

Field Detail

numColumns

int numColumns
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.


dependentCActions

ConstantAction[] dependentCActions

resultDescription

ResultDescription resultDescription

conglomId

public 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

public StaticCompiledOpenConglomInfo heapSCOCI

irgs

public IndexRowGenerator[] irgs

indexCIDS

public long[] indexCIDS

indexSCOCIs

public StaticCompiledOpenConglomInfo[] indexSCOCIs

indexNames

public java.lang.String[] indexNames

deferred

public boolean deferred

targetProperties

public java.util.Properties targetProperties

targetUUID

public UUID targetUUID

lockMode

public int lockMode

singleRowSource

public boolean singleRowSource
Constructor Detail

DeleteConstantAction

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


DeleteConstantAction

public DeleteConstantAction(long conglomId,
                            StaticCompiledOpenConglomInfo heapSCOCI,
                            IndexRowGenerator[] irgs,
                            long[] indexCIDS,
                            StaticCompiledOpenConglomInfo[] indexSCOCIs,
                            ExecRow emptyHeapRow,
                            boolean deferred,
                            UUID targetUUID,
                            int lockMode,
                            FKInfo[] fkInfo,
                            TriggerInfo triggerInfo,
                            FormatableBitSet baseRowReadList,
                            int[] baseRowReadMap,
                            int[] streamStorableHeapColIds,
                            int numColumns,
                            boolean singleRowSource,
                            ResultDescription resultDescription,
                            ConstantAction[] dependentCActions)
Make the ConstantAction for an DELETE statement.

Parameters:
conglomId - Conglomerate ID.
heapSCOCI - StaticCompiledOpenConglomInfo for heap.
irgs - Index descriptors
indexCIDS - Conglomerate IDs of indices
indexSCOCIs - StaticCompiledOpenConglomInfos for indexes.
emptyHeapRow - Template for heap row.
deferred - True means process as a deferred insert.
targetUUID - UUID of target table
lockMode - The lock mode to use (row or table, see TransactionController)
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)
baseRowReadList - Map of columns read in. 1 based.
streamStorableHeapColIds - Null for non rep. (0 based)
numColumns - Number of columns to read.
singleRowSource - Whether or not source is a single row source
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
See Also:
Externalizable.readExternal(java.io.ObjectInput)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Description copied from class: WriteCursorConstantAction
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

getTypeFormatId

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

Returns:
the formatID of this class

getFKInfo

public FKInfo[] getFKInfo(ExecutionContext ec)
                   throws StandardException
Gets the foreign key information for this constant action. A full list of foreign keys was compiled into this constant action. However, we prune this list at run time so that we enforce only the foreign keys that we absolutely must. What's going on here? Well, in certain contexts (REFRESH and when intially booting a Target), we don't have to enforce some foreign keys. We allow the ExecutionContext to rule on which foreign keys are relevant and which aren't.

Parameters:
ec - the ExecutionContext
Returns:
the list of foreign keys to enforce for this action
Throws:
StandardException - Thrown on failure

getTriggerInfo

public TriggerInfo getTriggerInfo(ExecutionContext ec)
                           throws StandardException
Basically, the same as getFKInfo but for triggers.

Returns:
the triggers that should be fired
Throws:
StandardException - Thrown on failure

upToDate

public boolean upToDate()
Reports whether these constants are up-to-date. This returns true for homogenous Cloudscape/Cloudsync. For the Plugin, this may return false;

Specified by:
upToDate in interface ConstantAction
Returns:
true if these constants are up-to-date false otherwise

executeConstantAction

public 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)

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()

modifiesTableId

public boolean modifiesTableId(UUID tableId)
Does this constant action modify the passed in table uuid? By modify we mean add or drop things tied to this table (e.g. index, trigger, constraint). Things like views or spses that reference this table don't count.

Specified by:
modifiesTableId in interface ConstantAction
Parameters:
tableId - on error

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.