Class UpdateConstantAction
java.lang.Object
org.apache.derby.impl.sql.execute.WriteCursorConstantAction
org.apache.derby.impl.sql.execute.UpdateConstantAction
- All Implemented Interfaces:
Externalizable, Serializable, Formatable, TypedFormat, ConstantAction
This class describes compiled constants that are passed into
UpdateResultSets.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long[](package private) RowLocation[]An array of row location objects (0 based), one for each column in the table.(package private) int[]This class implements Formatable.private String[](package private) String(package private) intprivate booleanprivate Stringprivate StringFields inherited from class WriteCursorConstantAction
conglomId, deferred, heapSCOCI, indexCIDS, indexNames, indexSCOCIs, irgs, lockMode, singleRowSource, targetUUIDFields inherited from interface ConstantAction
WHEN_MATCHED_THEN_DELETE, WHEN_MATCHED_THEN_UPDATE, WHEN_NOT_MATCHED_THEN_INSERT -
Constructor Summary
ConstructorsConstructorDescriptionPublic niladic constructor.UpdateConstantAction(TableDescriptor targetTableDesc, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, String[] indexNames, boolean deferred, UUID targetUUID, int lockMode, int[] changedColumnIds, FKInfo[] fkInfo, TriggerInfo triggerInfo, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, int numColumns, boolean positionedUpdate, boolean singleRowSource, RowLocation[] autoincRowLocation, boolean underMerge, String identitySequenceUUIDString) Make the ConstantAction for an UPDATE statement. -
Method Summary
Modifier and TypeMethodDescriptionlonggetAutoincIncrement(int i) gets the increment value for a column.(package private) RowLocation[]gets the row locationgetColumnName(int i) gets the name of the desired column in the taget table.(package private) String[]get the array of column names in the target table.intGet the formatID which corresponds to this class.booleanDoes the target table has autoincrement columns.voidRead this object from a stream of stored objects.voidWrite this object to a stream of stored objects.
-
Field Details
-
changedColumnIds
int[] changedColumnIdsThis 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. -
positionedUpdate
private boolean positionedUpdate -
numColumns
int numColumns -
schemaName
-
tableName
-
columnNames
-
identitySequenceUUIDString
String identitySequenceUUIDString -
autoincRowLocation
RowLocation[] autoincRowLocationAn 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 Details
-
UpdateConstantAction
public UpdateConstantAction()Public niladic constructor. Needed for Formatable interface to work. -
UpdateConstantAction
UpdateConstantAction(TableDescriptor targetTableDesc, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, String[] indexNames, boolean deferred, UUID targetUUID, int lockMode, int[] changedColumnIds, FKInfo[] fkInfo, TriggerInfo triggerInfo, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, int numColumns, boolean positionedUpdate, boolean singleRowSource, RowLocation[] autoincRowLocation, boolean underMerge, String identitySequenceUUIDString) throws StandardException Make the ConstantAction for an UPDATE statement.- Parameters:
targetTableDesc- descriptor for the table to be updatedheapSCOCI- 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 update.targetUUID- UUID of target tablelockMode- The lock mode to use (row or table, see TransactionController)changedColumnIds- Array of ids of changed columnsfkInfo- 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.baseRowReadMap- BaseRowReadMap[heapColId]->ReadRowColumnId. (0 based)streamStorableHeapColIds- Null for non rep. (0 based)numColumns- Number of columns being read.positionedUpdate- is this a positioned updatesingleRowSource- Whether or not source is a single row sourceautoincRowLocation- Array of rowlocations of autoincrement values in SYSCOLUMNS for each ai column.underMerge- True if this is an action of a MERGE statement.identitySequenceUUIDString- For 10.11 and higher, the handle on the sequence for the identity column- Throws:
StandardException
-
-
Method Details
-
hasAutoincrement
public boolean hasAutoincrement()Does the target table has autoincrement columns.- Returns:
- True if the table has ai columns
-
getAutoincRowLocation
RowLocation[] getAutoincRowLocation()gets the row location -
readExternal
Description copied from class:WriteCursorConstantActionRead this object from a stream of stored objects.- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classWriteCursorConstantAction- Parameters:
in- read this.- Throws:
IOException- thrown on errorClassNotFoundException- thrown on error- See Also:
-
writeExternal
Description copied from class:WriteCursorConstantActionWrite this object to a stream of stored objects.- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classWriteCursorConstantAction- Parameters:
out- write bytes here.- Throws:
IOException- thrown on error- See Also:
-
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Returns:
- the formatID of this class
-
getSchemaName
-
getTableName
-
getColumnName
gets the name of the desired column in the taget table.- Parameters:
i- the column number
-
getColumnNames
String[] getColumnNames()get the array of column names in the target table. -
getAutoincIncrement
public long getAutoincIncrement(int i) gets the increment value for a column.- Parameters:
i- the column number
-