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

public Class InsertConstantAction

extends WriteCursorConstantAction
Class Inheritance
Imports
org.apache.derby.shared.common.stream.HeaderPrintWriter, org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.iapi.services.io.StoredFormatIds, .FormatIdUtil, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.sql.dictionary.IndexRowGenerator, .DataDictionary, .TableDescriptor, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ConstantAction, .ExecRow, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo, org.apache.derby.iapi.types.RowLocation, org.apache.derby.catalog.UUID, java.io.ObjectOutput, .ObjectInput, .IOException, java.util.Properties

This class describes compiled constants that are passed into InsertResultSets.

Field Summary

Modifier and TypeField and Description
private long[]
private boolean
pack-priv RowLocation[]
autoincRowLocation

An array of row location objects (0 based), one for each column in the table.

private String[]
private transient int
firstAutoGenColumn

Position of autogenerated column

public final boolean
pack-priv String
pack-priv boolean[]
indexedCols

This class implements Formatable.

private String
private String
Inherited from org.apache.derby.impl.sql.execute.WriteCursorConstantAction:
conglomIddeferredheapSCOCIindexCIDSindexNamesindexSCOCIsirgslockModesingleRowSourcetargetUUID

Constructor Summary

AccessConstructor and Description
public
InsertConstantAction()

Public niladic constructor.

pack-priv
InsertConstantAction(TableDescriptor tableDescriptor, long
Conglomerate ID.
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 insert.
deferred
,
boolean
The target table has deferrable CHECK constraints
hasDeferrableChecks
,
Properties
Properties on the target table.
targetProperties
,
UUID
UUID of target table
targetUUID
,
int
The lockMode to use on the target table
lockMode
,
FKInfo[]
Array of structures containing foreign key info, if any (may be null)
fkInfo
,
TriggerInfo
Array of structures containing trigger info, if any (may be null)
triggerInfo
,
int[]
Null for non rep. (0 based)
streamStorableHeapColIds
,
boolean[]
boolean[] of which (0-based) columns are indexed.
indexedCols
,
boolean
Whether or not source is a single row source
singleRowSource
,
RowLocation[]
Array of rowlocations of autoincrement values in SYSCOLUMNS for each ai column.
autoincRowLocation
,
boolean
True if this is an action of a MERGE statement.
underMerge
,
String
For 10.11 and higher, the handle on the sequence for the identity column
identitySequenceUUIDString
,
boolean
True if the query assigns a DEFAULT value to the identity column
autoincrementColumnSetToDEFAULT
)

Make the ConstantAction for an INSERT statement.

Method Summary

Modifier and TypeMethod and Description
public boolean
autoincrementColumnSetToDEFAULT()

Return true if the queryExpression sets the target table's identity column to DEFAULT.

public int
getAutoGenColumn()

Get the 0-based position of the autogenerated column

public long
getAutoincIncrement(int
the column number
i
)

gets the increment value for a column.

pack-priv RowLocation[]
getAutoincRowLocation()

gets the row location

public String
getColumnName(int
the column number
i
)

gets the name of the desired column in the taget table.

pack-priv String[]
getColumnNames()

get the array of column names in the target table.

public String

Returns:

schema name
getSchemaName
()

Gets the name of the schema that the table is in

public String

Returns:

name of table being inserted into
getTableName
()

Gets the name of the table being inserted into

public int

Returns:

the formatID of this class
getTypeFormatId
()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

public boolean

Returns:

True if the table has ai columns
hasAutoincrement
()

Does the target table has autoincrement columns.

public void
readExternal(ObjectInput
read this.
in
)

Overrides org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal.

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

public void
writeExternal(ObjectOutput
write bytes here.
out
)

Overrides org.apache.derby.impl.sql.execute.WriteCursorConstantAction.writeExternal.

Implements java.io.Externalizable.writeExternal.

Write this object to a stream of stored objects.

Inherited from org.apache.derby.impl.sql.execute.WriteCursorConstantAction:
executeConstantActiongetBaseRowReadListgetBaseRowReadMapgetConglomerateIdgetFKInfogetIndexNameFromCIDgetIndexNamesgetPropertygetStreamStorableHeapColIdsgetTargetPropertiesgetTriggerInfounderMerge

Field Detail

autoincIncrementback to summary
private long[] autoincIncrement
autoincrementColumnSetToDEFAULTback to summary
private boolean autoincrementColumnSetToDEFAULT
autoincRowLocationback to summary
pack-priv RowLocation[] autoincRowLocation

An 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.

columnNamesback to summary
private String[] columnNames
firstAutoGenColumnback to summary
private transient int firstAutoGenColumn

Position of autogenerated column

hasDeferrableChecksback to summary
public final boolean hasDeferrableChecks
identitySequenceUUIDStringback to summary
pack-priv String identitySequenceUUIDString
indexedColsback to summary
pack-priv boolean[] indexedCols

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.

schemaNameback to summary
private String schemaName
tableNameback to summary
private String tableName

Constructor Detail

InsertConstantActionback to summary
public InsertConstantAction()

Public niladic constructor. Needed for Formatable interface to work.

InsertConstantActionback to summary
pack-priv 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, boolean autoincrementColumnSetToDEFAULT)

Make the ConstantAction for an INSERT statement.

Parameters
conglomId:long

Conglomerate ID.

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 insert.

hasDeferrableChecks:boolean

The target table has deferrable CHECK constraints

targetProperties:Properties

Properties on the target table.

targetUUID:UUID

UUID of target table

lockMode:int

The lockMode to use on the target table

fkInfo:FKInfo[]

Array of structures containing foreign key info, if any (may be null)

triggerInfo:TriggerInfo

Array of structures containing trigger info, if any (may be null)

streamStorableHeapColIds:int[]

Null for non rep. (0 based)

indexedCols:boolean[]

boolean[] of which (0-based) columns are indexed.

singleRowSource:boolean

Whether or not source is a single row source

autoincRowLocation:RowLocation[]

Array of rowlocations of autoincrement values in SYSCOLUMNS for each ai column.

underMerge:boolean

True if this is an action of a MERGE statement.

identitySequenceUUIDString:String

For 10.11 and higher, the handle on the sequence for the identity column

autoincrementColumnSetToDEFAULT:boolean

True if the query assigns a DEFAULT value to the identity column

Method Detail

autoincrementColumnSetToDEFAULTback to summary
public boolean autoincrementColumnSetToDEFAULT()

Return true if the queryExpression sets the target table's identity column to DEFAULT.

getAutoGenColumnback to summary
public int getAutoGenColumn()

Get the 0-based position of the autogenerated column

getAutoincIncrementback to summary
public long getAutoincIncrement(int i)

gets the increment value for a column.

Parameters
i:int

the column number

getAutoincRowLocationback to summary
pack-priv RowLocation[] getAutoincRowLocation()

gets the row location

getColumnNameback to summary
public String getColumnName(int i)

gets the name of the desired column in the taget table.

Parameters
i:int

the column number

getColumnNamesback to summary
pack-priv String[] getColumnNames()

get the array of column names in the target table.

getSchemaNameback to summary
public String getSchemaName()

Gets the name of the schema that the table is in

Returns:String

schema name

getTableNameback to summary
public String getTableName()

Gets the name of the table being inserted into

Returns:String

name of table being inserted into

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

Returns:int

the formatID of this class

hasAutoincrementback to summary
public boolean hasAutoincrement()

Does the target table has autoincrement columns.

Returns:boolean

True if the table has ai columns

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

Overrides org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal.

Implements java.io.Externalizable.readExternal.

Doc from org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal.

Read this object from a stream of stored objects.

Parameters
in:ObjectInput

read this.

Exceptions
IOException:
thrown on error
ClassNotFoundException:
thrown on error
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Overrides org.apache.derby.impl.sql.execute.WriteCursorConstantAction.writeExternal.

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