Class InsertConstantAction
java.lang.Object
org.apache.derby.impl.sql.execute.WriteCursorConstantAction
org.apache.derby.impl.sql.execute.InsertConstantAction
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
,ConstantAction
This class describes compiled constants that are passed into
InsertResultSets.
- 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.private String[]
private int
Position of autogenerated columnfinal boolean
(package private) String
(package private) boolean[]
This class implements Formatable.private String
private String
Fields inherited from class org.apache.derby.impl.sql.execute.WriteCursorConstantAction
conglomId, deferred, heapSCOCI, indexCIDS, indexNames, indexSCOCIs, irgs, lockMode, singleRowSource, targetUUID
Fields 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.InsertConstantAction
(TableDescriptor tableDescriptor, long conglomId, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, String[] indexNames, boolean deferred, boolean hasDeferrableChecks, Properties targetProperties, UUID targetUUID, int lockMode, FKInfo[] fkInfo, TriggerInfo triggerInfo, int[] streamStorableHeapColIds, boolean[] indexedCols, boolean singleRowSource, RowLocation[] autoincRowLocation, boolean underMerge, String identitySequenceUUIDString) Make the ConstantAction for an INSERT statement. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the 0-based position of the autogenerated columnlong
getAutoincIncrement
(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.Gets the name of the schema that the table is inGets the name of the table being inserted intoint
Get the formatID which corresponds to this class.boolean
Does the target table has autoincrement columns.void
Read this object from a stream of stored objects.void
Write this object to a stream of stored objects.Methods inherited from class org.apache.derby.impl.sql.execute.WriteCursorConstantAction
executeConstantAction, getBaseRowReadList, getBaseRowReadMap, getConglomerateId, getFKInfo, getIndexNameFromCID, getIndexNames, getProperty, getStreamStorableHeapColIds, getTargetProperties, getTriggerInfo, underMerge
-
Field Details
-
indexedCols
boolean[] indexedColsThis 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. -
schemaName
-
tableName
-
columnNames
-
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 -
firstAutoGenColumn
private transient int firstAutoGenColumnPosition of autogenerated column -
hasDeferrableChecks
public final boolean hasDeferrableChecks -
identitySequenceUUIDString
String identitySequenceUUIDString
-
-
Constructor Details
-
InsertConstantAction
public InsertConstantAction()Public niladic constructor. Needed for Formatable interface to work. -
InsertConstantAction
InsertConstantAction(TableDescriptor tableDescriptor, long conglomId, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, String[] indexNames, boolean deferred, boolean hasDeferrableChecks, Properties targetProperties, UUID targetUUID, int lockMode, FKInfo[] fkInfo, TriggerInfo triggerInfo, int[] streamStorableHeapColIds, boolean[] indexedCols, boolean singleRowSource, RowLocation[] autoincRowLocation, boolean underMerge, String identitySequenceUUIDString) Make the ConstantAction for an INSERT statement.- Parameters:
tableDescriptor
-conglomId
- Conglomerate ID.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 insert.hasDeferrableChecks
- The target table has deferrable CHECK constraintstargetProperties
- Properties on the target table.targetUUID
- UUID of target tablelockMode
- The lockMode to use on the target tablefkInfo
- Array of structures containing foreign key info, if any (may be null)triggerInfo
- Array of structures containing trigger info, if any (may be null)streamStorableHeapColIds
- Null for non rep. (0 based)indexedCols
- boolean[] of which (0-based) columns are indexed.singleRowSource
- 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
-
-
Method Details
-
readExternal
Description copied from class:WriteCursorConstantAction
Read this object from a stream of stored objects.- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classWriteCursorConstantAction
- 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
- Overrides:
writeExternal
in classWriteCursorConstantAction
- Parameters:
out
- write bytes here.- Throws:
IOException
- thrown on error
-
getAutoGenColumn
public int getAutoGenColumn()Get the 0-based position of the autogenerated column -
getSchemaName
Gets the name of the schema that the table is in- Returns:
- schema name
-
getTableName
Gets the name of the table being inserted into- Returns:
- name of table being inserted into
-
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
-
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 -
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Returns:
- the formatID of this class
-