Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv abstract Class WriteCursorConstantAction

extends Object
implements ConstantAction, Formatable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable, org.apache.derby.iapi.sql.execute.ConstantAction
Known Direct Subclasses
org.apache.derby.impl.sql.execute.DeleteConstantAction, org.apache.derby.impl.sql.execute.InsertConstantAction, org.apache.derby.impl.sql.execute.UpdatableVTIConstantAction, org.apache.derby.impl.sql.execute.UpdateConstantAction
Imports
java.io.IOException, .ObjectInput, .ObjectOutput, java.util.Properties, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.iapi.services.io.Formatable, .FormatableBitSet, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.dictionary.IndexRowGenerator, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo

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

Modifier and TypeField and Description
private FormatableBitSet
private int[]
pack-priv long
conglomId

This class implements Formatable.

pack-priv boolean
private FKInfo[]
pack-priv StaticCompiledOpenConglomInfo
pack-priv long[]
pack-priv String[]
pack-priv StaticCompiledOpenConglomInfo[]
pack-priv IndexRowGenerator[]
pack-priv int
pack-priv boolean
private int[]
private Properties
pack-priv UUID
private TriggerInfo
private boolean
underMerge

True if this is an action of a MERGE statement

Constructor Summary

AccessConstructor and Description
public
WriteCursorConstantAction()

Public niladic constructor.

public
WriteCursorConstantAction(long
Conglomerate ID of heap.
conglomId
,
StaticCompiledOpenConglomInfo
StaticCompiledOpenConglomInfo for heap.
heapSCOCI
,
IndexRowGenerator[]
Index descriptors
irgs
,
long[]
Conglomerate IDs of indices
indexCIDS
,
StaticCompiledOpenConglomInfo[]
StaticCompiledOpenConglomInfos for indexes.
indexSCOCIs
,
String[]
Names of indices on this table for error reporting.
indexNames
,
boolean
True means process as a deferred update
deferred
,
Properties
Properties on the target table
targetProperties
,
UUID
UUID of target table
targetUUID
,
int
The lock mode to use on the target table
lockMode
,
FKInfo[]
Structure containing foreign key info, if any (may be null)
fkInfo
,
TriggerInfo
Structure containing trigger info, if any (may be null)
triggerInfo
,
FormatableBitSet baseRowReadList, int[]
BaseRowReadMap[heapColId]->ReadRowColumnId. (0 based)
baseRowReadMap
,
int[]
Null for non rep. (0 based)
streamStorableHeapColIds
,
boolean
Whether or not source is a single row source
singleRowSource
,
boolean
True if this action is under a MERGE statement
underMerge
)

Make the ConstantAction for a DELETE, INSERT, or UPDATE statement.

Method Summary

Modifier and TypeMethod and Description
public final void
executeConstantAction(Activation
The execution environment for this constant action.
activation
)

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

NOP routine.

public FormatableBitSet
public int[]
public long

Returns:

the conglomerate id.
getConglomerateId
()

Get the conglomerate id for the changed heap.

pack-priv final FKInfo[]

Returns:

the list of foreign keys to enforce for this action
getFKInfo
()

Gets the foreign key information for this constant action.

public String

Returns:

index name of given index.
getIndexNameFromCID
(long
conglomerate ID of the index.
indexCID
)

get the index name given the conglomerate id of the index.

public String[]
public String

Returns:

The value for the specified key if it exists, otherwise null. (Return null if targetProperties is null.)
getProperty
(String
The key to search for
key
)

The the value of the specified key, if it exists, from the targetProperties.

public int[]
public Properties

Returns:

The targetProperties
getTargetProperties
()

Get the targetProperties from the constant action.

pack-priv TriggerInfo

Returns:

the triggers that should be fired
getTriggerInfo
()

Basically, the same as getFKInfo but for triggers.

public void
readExternal(ObjectInput
read this.
in
)

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

public boolean
underMerge()

Return true if this is an action of a MERGE statement

public void
writeExternal(ObjectOutput
write bytes here.
out
)

Implements java.io.Externalizable.writeExternal.

Write this object to a stream of stored objects.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseRowReadListback to summary
private FormatableBitSet baseRowReadList
baseRowReadMapback to summary
private int[] baseRowReadMap
conglomIdback to summary
pack-priv 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.

deferredback to summary
pack-priv boolean deferred
fkInfoback to summary
private FKInfo[] fkInfo
heapSCOCIback to summary
pack-priv StaticCompiledOpenConglomInfo heapSCOCI
indexCIDSback to summary
pack-priv long[] indexCIDS
indexNamesback to summary
pack-priv String[] indexNames
indexSCOCIsback to summary
pack-priv StaticCompiledOpenConglomInfo[] indexSCOCIs
irgsback to summary
pack-priv IndexRowGenerator[] irgs
lockModeback to summary
pack-priv int lockMode
singleRowSourceback to summary
pack-priv boolean singleRowSource
streamStorableHeapColIdsback to summary
private int[] streamStorableHeapColIds
targetPropertiesback to summary
private Properties targetProperties
targetUUIDback to summary
pack-priv UUID targetUUID
triggerInfoback to summary
private TriggerInfo triggerInfo
underMergeback to summary
private boolean underMerge

True if this is an action of a MERGE statement

Constructor Detail

WriteCursorConstantActionback to summary
public WriteCursorConstantAction()

Public niladic constructor. Needed for Formatable interface to work.

WriteCursorConstantActionback to summary
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:long

Conglomerate ID of heap.

heapSCOCI:StaticCompiledOpenConglomInfo

StaticCompiledOpenConglomInfo for heap.

irgs:IndexRowGenerator[]

Index descriptors

indexCIDS:long[]

Conglomerate IDs of indices

indexSCOCIs:StaticCompiledOpenConglomInfo[]

StaticCompiledOpenConglomInfos for indexes.

indexNames:String[]

Names of indices on this table for error reporting.

deferred:boolean

True means process as a deferred update

targetProperties:Properties

Properties on the target table

targetUUID:UUID

UUID of target table

lockMode:int

The lock mode to use on the target table

fkInfo:FKInfo[]

Structure containing foreign key info, if any (may be null)

triggerInfo:TriggerInfo

Structure containing trigger info, if any (may be null)

baseRowReadMap:int[]

BaseRowReadMap[heapColId]->ReadRowColumnId. (0 based)

streamStorableHeapColIds:int[]

Null for non rep. (0 based)

singleRowSource:boolean

Whether or not source is a single row source

underMerge:boolean

True if this action is under a MERGE statement

Method Detail

executeConstantActionback to summary
public final void executeConstantAction(Activation activation) throws StandardException

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

NOP routine. The work is done in InsertResultSet.

Parameters
activation:Activation

Doc from org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

The execution environment for this constant action.

Exceptions
StandardException:
Thrown on failure
See Also
ConstantAction#executeConstantAction
getBaseRowReadListback to summary
public FormatableBitSet getBaseRowReadList()
getBaseRowReadMapback to summary
public int[] getBaseRowReadMap()
getConglomerateIdback to summary
public long getConglomerateId()

Get the conglomerate id for the changed heap.

Returns:long

the conglomerate id.

getFKInfoback to summary
pack-priv 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:FKInfo[]

the list of foreign keys to enforce for this action

getIndexNameFromCIDback to summary
public String getIndexNameFromCID(long indexCID)

get the index name given the conglomerate id of the index.

Parameters
indexCID:long

conglomerate ID of the index.

Returns:String

index name of given index.

getIndexNamesback to summary
public String[] getIndexNames()
getPropertyback to summary
public String getProperty(String key)

The the value of the specified key, if it exists, from the targetProperties.

Parameters
key:String

The key to search for

Returns:String

The value for the specified key if it exists, otherwise null. (Return null if targetProperties is null.)

getStreamStorableHeapColIdsback to summary
public int[] getStreamStorableHeapColIds()
getTargetPropertiesback to summary
public Properties getTargetProperties()

Get the targetProperties from the constant action.

Returns:Properties

The targetProperties

getTriggerInfoback to summary
pack-priv TriggerInfo getTriggerInfo()

Basically, the same as getFKInfo but for triggers.

Returns:TriggerInfo

the triggers that should be fired

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

Parameters
in:ObjectInput

read this.

Exceptions
IOException:
thrown on error
ClassNotFoundException:
thrown on error
underMergeback to summary
public boolean underMerge()

Return true if this is an action of a MERGE statement

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this object to a stream of stored objects.

Parameters
out:ObjectOutput

write bytes here.

Exceptions
IOException:
thrown on error