Class WriteCursorConstantAction
java.lang.Object
org.apache.derby.impl.sql.execute.WriteCursorConstantAction
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
,ConstantAction
- Direct Known Subclasses:
DeleteConstantAction
,InsertConstantAction
,UpdatableVTIConstantAction
,UpdateConstantAction
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
FieldsModifier and TypeFieldDescriptionprivate FormatableBitSet
private int[]
(package private) long
This class implements Formatable.(package private) boolean
private FKInfo[]
(package private) StaticCompiledOpenConglomInfo
(package private) long[]
(package private) String[]
(package private) StaticCompiledOpenConglomInfo[]
(package private) IndexRowGenerator[]
(package private) int
(package private) boolean
private int[]
private Properties
(package private) UUID
private TriggerInfo
private boolean
True if this is an action of a MERGE statementFields inherited from interface org.apache.derby.iapi.sql.execute.ConstantAction
WHEN_MATCHED_THEN_DELETE, WHEN_MATCHED_THEN_UPDATE, WHEN_NOT_MATCHED_THEN_INSERT
-
Constructor Summary
ConstructorsConstructorDescriptionPublic niladic constructor.WriteCursorConstantAction
(long conglomId, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, String[] indexNames, boolean deferred, Properties targetProperties, UUID targetUUID, int lockMode, FKInfo[] fkInfo, TriggerInfo triggerInfo, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, boolean singleRowSource, boolean underMerge) Make the ConstantAction for a DELETE, INSERT, or UPDATE statement. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
executeConstantAction
(Activation activation) NOP routine.int[]
long
Get the conglomerate id for the changed heap.(package private) final FKInfo[]
Gets the foreign key information for this constant action.getIndexNameFromCID
(long indexCID) get the index name given the conglomerate id of the index.String[]
getProperty
(String key) The the value of the specified key, if it exists, from the targetProperties.int[]
Get the targetProperties from the constant action.(package private) TriggerInfo
Basically, the same as getFKInfo but for triggers.void
Read this object from a stream of stored objects.boolean
Return true if this is an action of a MERGE statementvoid
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 Details
-
conglomId
long conglomIdThis 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
String[] indexNames -
deferred
boolean deferred -
targetProperties
-
targetUUID
UUID targetUUID -
lockMode
int lockMode -
fkInfo
-
triggerInfo
-
baseRowReadList
-
baseRowReadMap
private int[] baseRowReadMap -
streamStorableHeapColIds
private int[] streamStorableHeapColIds -
singleRowSource
boolean singleRowSource -
underMerge
private boolean underMergeTrue if this is an action of a MERGE statement
-
-
Constructor Details
-
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, String[] indexNames, boolean deferred, Properties targetProperties, UUID targetUUID, int lockMode, FKInfo[] fkInfo, TriggerInfo triggerInfo, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, boolean singleRowSource, boolean underMerge) Make the ConstantAction for a DELETE, INSERT, or UPDATE statement.- Parameters:
conglomId
- Conglomerate ID of heap.heapSCOCI
- StaticCompiledOpenConglomInfo for heap.irgs
- Index descriptorsindexCIDS
- Conglomerate IDs of indicesindexSCOCIs
- StaticCompiledOpenConglomInfos for indexes.indexNames
- Names of indices on this table for error reporting.deferred
- True means process as a deferred updatetargetProperties
- Properties on the target tabletargetUUID
- UUID of target tablelockMode
- The lock mode to use on the target tablefkInfo
- Structure containing foreign key info, if any (may be null)triggerInfo
- Structure containing trigger info, if any (may be null)baseRowReadMap
- BaseRowReadMap[heapColId]->ReadRowColumnId. (0 based)streamStorableHeapColIds
- Null for non rep. (0 based)singleRowSource
- Whether or not source is a single row sourceunderMerge
- True if this action is under a MERGE statement
-
-
Method Details
-
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
NOP routine. The work is done in InsertResultSet.- Specified by:
executeConstantAction
in interfaceConstantAction
- Parameters:
activation
- The execution environment for this constant action.- Throws:
StandardException
- Thrown on failure- See Also:
-
readExternal
Read this object from a stream of stored objects.- Specified by:
readExternal
in interfaceExternalizable
- Parameters:
in
- read this.- Throws:
IOException
- thrown on errorClassNotFoundException
- thrown on error
-
writeExternal
Write this object to a stream of stored objects.- Specified by:
writeExternal
in interfaceExternalizable
- Parameters:
out
- write bytes here.- Throws:
IOException
- thrown on error
-
underMerge
public boolean underMerge()Return true if this is an action of a MERGE statement -
getConglomerateId
public long getConglomerateId()Get the conglomerate id for the changed heap.- Returns:
- the conglomerate id.
-
getTargetProperties
Get the targetProperties from the constant action.- Returns:
- The targetProperties
-
getProperty
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
-
getBaseRowReadMap
public int[] getBaseRowReadMap() -
getStreamStorableHeapColIds
public int[] getStreamStorableHeapColIds() -
getIndexNameFromCID
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
-