org.apache.derby.impl.sql.execute
Class GenericConstantActionFactory

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.GenericConstantActionFactory

public class GenericConstantActionFactory
extends java.lang.Object

Factory for creating ConstantActions.

Implemetation note: For most operations, the ResultSetFactory determines if the operation is allowed in a readonly/target database. Because we perform JAR add/drop/replace with a utility rather than using normal language processing we never get a result set for these operations. For this reason, the ConstantActionFactory rather than the ResultSetFactory checks if the these operations are allowed.

Author:
Rick

Constructor Summary
GenericConstantActionFactory()
           
 
Method Summary
 ConstantAction getAddJarConstantAction(UUID id, java.lang.String schemaName, java.lang.String sqlName, java.lang.String externalPath)
          Make the ConstantAction to Add a jar file to a database.
 ConstantAction getAlterSPSConstantAction(SchemaDescriptor sd, java.lang.String spsName, java.lang.String usingText, boolean invalidOnly)
          Get ConstantAction for ALTER STATEMENT statement.
 ConstantAction getAlterTableConstantAction(SchemaDescriptor sd, java.lang.String tableName, UUID tableId, long tableConglomerateId, int tableType, ColumnInfo[] columnInfo, ConstraintConstantAction[] constraintActions, java.lang.Object[] stageControl, java.lang.Object[] ddlList, ListOfRowLists deleteRowLists, ListOfRowLists insertRowLists, UUID[] publicationIDs, DependableList[] dependableLists, char lockGranularity, boolean compressTable, int behavior, boolean sequential, boolean truncateTable)
          Make the AlterAction for an ALTER TABLE statement.
protected static Authorizer getAuthorizer()
           
 ConstantAction getCreateAliasConstantAction(java.lang.String aliasName, java.lang.String schemaName, java.lang.String javaClassName, AliasInfo aliasInfo, char aliasType)
          Make the ConstantAction for a CREATE ALIAS statement.
 CreateConstraintConstantAction getCreateConstraintConstantAction(java.lang.String constraintName, int constraintType, java.lang.String tableName, UUID tableId, java.lang.String schemaName, java.lang.String[] columnNames, IndexConstantAction indexAction, java.lang.String constraintText, boolean enabled, ConstraintInfo otherConstraint, ProviderInfo[] providerInfo)
          Make a ConstantAction for a constraint.
 CreateIndexConstantAction getCreateIndexConstantAction(boolean unique, java.lang.String indexType, java.lang.String schemaName, java.lang.String indexName, java.lang.String tableName, UUID tableId, long conglomId, java.lang.String[] columnNames, boolean[] isAscending, boolean isConstraint, UUID conglomerateUUID, java.util.Properties properties)
          Make the ConstantAction for a CREATE INDEX statement.
 ConstantAction getCreateSchemaConstantAction(java.lang.String schemaName, java.lang.String aid)
          Make the ConstantAction for a CREATE SCHEMA statement.
 ConstantAction getCreateSPSConstantAction(java.lang.String schemaName, java.lang.String spsName, java.lang.String spsText, java.lang.String usingText, boolean okInSys, boolean nocompile, UUID compSchemaId)
          Make the ConstantAction for a CREATE STORED PREPARED STATEMENT statement.
 ConstantAction getCreateTableConstantAction(java.lang.String schemaName, java.lang.String tableName, int tableType, ColumnInfo[] columnInfo, CreateConstraintConstantAction[] constraintActions, java.util.Properties properties, char lockGranularity, boolean onCommitDeleteRows, boolean onRollbackDeleteRows)
          Make the ConstantAction for a CREATE TABLE statement.
 ConstantAction getCreateTriggerConstantAction(java.lang.String triggerSchemaName, java.lang.String triggerName, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor triggerTable, UUID whenSPSId, java.lang.String whenText, UUID actionSPSId, java.lang.String actionText, UUID spsCompSchemaId, java.sql.Timestamp creationTimestamp, int[] referencedCols, java.lang.String originalActionText, boolean referencingOld, boolean referencingNew, java.lang.String oldReferencingName, java.lang.String newReferencingName)
          Make the ConstantAction for a CREATE TRIGGER statement.
 ConstantAction getCreateViewConstantAction(java.lang.String schemaName, java.lang.String tableName, int tableType, java.lang.String viewText, int checkOption, ColumnInfo[] columnInfo, ProviderInfo[] providerInfo, UUID compSchemaId)
          Make the ConstantAction for a CREATE VIEW statement.
 ConstantAction getDeleteConstantAction(long conglomId, int tableType, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, ExecRow emptyHeapRow, boolean deferred, boolean tableIsPublished, UUID tableID, int lockMode, java.lang.Object deleteToken, java.lang.Object keySignature, int[] keyPositions, long keyConglomId, java.lang.String schemaName, java.lang.String tableName, ResultDescription resultDescription, FKInfo[] fkInfo, TriggerInfo triggerInfo, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, int numColumns, UUID dependencyId, boolean singleRowSource, ConstantAction[] dependentConstantActions)
          Make the ConstantAction for a Replicated DELETE statement.
 ConstantAction getDropAliasConstantAction(SchemaDescriptor sd, java.lang.String aliasName, char aliasType)
          Make the ConstantAction for a DROP ALIAS statement.
 ConstraintConstantAction getDropConstraintConstantAction(java.lang.String constraintName, java.lang.String constraintSchemaName, java.lang.String tableName, UUID tableId, java.lang.String tableSchemaName, IndexConstantAction indexAction, int behavior, int verifyType)
          Make ConstantAction to drop a constraint.
 DropIndexConstantAction getDropIndexConstantAction(java.lang.String fullIndexName, java.lang.String indexName, java.lang.String tableName, java.lang.String schemaName, UUID tableId, long tableConglomerateId)
          Make the ConstantAction for a DROP INDEX statement.
 ConstantAction getDropJarConstantAction(UUID id, java.lang.String schemaName, java.lang.String sqlName)
          Make the ConstantAction to drop a jar file from a database.
 ConstantAction getDropSchemaConstantAction(java.lang.String schemaName)
          Make the ConstantAction for a DROP TABLE statement.
 ConstantAction getDropSPSConstantAction(SchemaDescriptor sd, java.lang.String spsName)
          Make the ConstantAction for a DROP STATEMENT statement.
 ConstantAction getDropStatisticsConstantAction(SchemaDescriptor sd, java.lang.String fullTableName, java.lang.String objectName, boolean forTable)
          Make the constant action for Drop Statistics statement.
 ConstantAction getDropTableConstantAction(java.lang.String fullTableName, java.lang.String tableName, SchemaDescriptor sd, long conglomerateNumber, UUID tableId, int behavior)
          Make the ConstantAction for a DROP TABLE statement.
 ConstantAction getDropTriggerConstantAction(SchemaDescriptor sd, java.lang.String triggerName, UUID tableId)
          Make the ConstantAction for a DROP TRIGGER statement.
 ConstantAction getDropViewConstantAction(java.lang.String fullTableName, java.lang.String tableName, SchemaDescriptor sd)
          Make the ConstantAction for a DROP VIEW statement.
 ConstantAction getInsertConstantAction(TableDescriptor tableDescriptor, long conglomId, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, java.lang.String[] indexNames, boolean deferred, boolean tableIsPublished, UUID tableID, int lockMode, java.lang.Object insertToken, java.lang.Object rowSignature, java.util.Properties targetProperties, FKInfo[] fkInfo, TriggerInfo triggerInfo, int[] streamStorableHeapColIds, boolean[] indexedCols, UUID dependencyId, java.lang.Object[] stageControl, java.lang.Object[] ddlList, boolean singleRowSource, RowLocation[] autoincRowLocation)
          Make the ConstantAction for a Replicated INSERT statement.
 ConstantAction getLockTableConstantAction(java.lang.String fullTableName, long conglomerateNumber, boolean exclusiveMode)
          Make the ConstantAction for a LOCK TABLE statement.
 ConstantAction getRenameConstantAction(java.lang.String fullTableName, java.lang.String tableName, java.lang.String oldObjectName, java.lang.String newObjectName, SchemaDescriptor sd, UUID tableId, boolean usedAlterTable, int renamingWhat)
          Make the ConstantAction for a RENAME TABLE/COLUMN/INDEX statement.
 ConstantAction getReplaceJarConstantAction(UUID id, java.lang.String schemaName, java.lang.String sqlName, java.lang.String externalPath)
          Make the ConstantAction to replace a jar file in a database.
 ConstantAction getSavepointConstantAction(java.lang.String savepointName, int statementType)
          Make the ConstantAction for a savepoint statement (ROLLBACK savepoint, RELASE savepoint and SAVEPOINT).
 ConstantAction getSetConstraintsConstantAction(ConstraintDescriptorList cdl, boolean enable, boolean unconditionallyEnforce, java.lang.Object[] ddlList)
          Get ConstantAction for SET CONSTRAINTS statement.
 ConstantAction getSetSchemaConstantAction(java.lang.String schemaName, int type)
          Make the ConstantAction for a SET SCHEMA statement.
 ConstantAction getSetTransactionIsolationConstantAction(int isolationLevel)
          Make the ConstantAction for a SET TRANSACTION ISOLATION statement.
 ConstantAction getUpdatableVTIConstantAction(int statementType, boolean deferred)
          Make the ConstantAction for an updatable VTI statement.
 ConstantAction getUpdatableVTIConstantAction(int statementType, boolean deferred, int[] changedColumnIds)
          Make the ConstantAction for an updatable VTI statement.
 UpdateConstantAction getUpdateConstantAction(long conglomId, int tableType, StaticCompiledOpenConglomInfo heapSCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, java.lang.String[] indexNames, ExecRow emptyHeapRow, boolean deferred, UUID targetUUID, int lockMode, boolean tableIsPublished, int[] changedColumnIds, int[] keyPositions, java.lang.Object updateToken, FKInfo[] fkInfo, TriggerInfo triggerInfo, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableHeapColIds, int numColumns, boolean positionedUpdate, boolean singleRowSource)
          Make the ConstantAction for a Replicated DELETE statement.
 ConstantAction getUpdateStatisticsConstantAction(boolean forTable, java.lang.String objectName, UUID tableUUID, UUID[] objectUUID, long[] conglomerateNumber, ExecIndexRow[] indexRow)
          Make the constant action for a UPDATE STATISTICS statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericConstantActionFactory

public GenericConstantActionFactory()
Method Detail

getAlterSPSConstantAction

public ConstantAction getAlterSPSConstantAction(SchemaDescriptor sd,
                                                java.lang.String spsName,
                                                java.lang.String usingText,
                                                boolean invalidOnly)
Get ConstantAction for ALTER STATEMENT statement.

Parameters:
sd - descriptor of the schema in which our beloved stmt resides
spsName - Name of sps. if null, all statements are recompiled
usingText - the text of the USING clause
invalidOnly - only recompile if invalid. Only used for the case where all statements are recompiled.

getSetConstraintsConstantAction

public ConstantAction getSetConstraintsConstantAction(ConstraintDescriptorList cdl,
                                                      boolean enable,
                                                      boolean unconditionallyEnforce,
                                                      java.lang.Object[] ddlList)
Get ConstantAction for SET CONSTRAINTS statement.

Parameters:
cdl - the constraints to set, if null, we'll go ahead and set them all
enable - if true, turn them on, if false disable them
unconditionallyEnforce - Replication sets this to true at the end of REFRESH. This forces us to run the included foreign key constraints even if they're already marked ENABLED.
ddlList - Replication list of actions to propagate, null unless a replication source

getAlterTableConstantAction

public ConstantAction getAlterTableConstantAction(SchemaDescriptor sd,
                                                  java.lang.String tableName,
                                                  UUID tableId,
                                                  long tableConglomerateId,
                                                  int tableType,
                                                  ColumnInfo[] columnInfo,
                                                  ConstraintConstantAction[] constraintActions,
                                                  java.lang.Object[] stageControl,
                                                  java.lang.Object[] ddlList,
                                                  ListOfRowLists deleteRowLists,
                                                  ListOfRowLists insertRowLists,
                                                  UUID[] publicationIDs,
                                                  DependableList[] dependableLists,
                                                  char lockGranularity,
                                                  boolean compressTable,
                                                  int behavior,
                                                  boolean sequential,
                                                  boolean truncateTable)
Make the AlterAction for an ALTER TABLE statement.

Parameters:
sd - descriptor for the schema that table lives in.
tableName - Name of table.
tableId - UUID of table.
tableConglomerateId - heap conglomerate id of table
tableType - Type of table (e.g., BASE).
columnInfo - Information on all the columns in the table.
constraintActions - ConstraintConstantAction[] for constraints
deleteRowLists - lists of tuples to be deleted from Publication catalogs.
insertRowLists - lists of tuples to be inserted into Publication catalogs.
publicationIDs - IDs of publications which must be altered
dependableLists - List, per publication, of objects that this publication depends on.
lockGranularity - The lock granularity.
compressTable - Whether or not this is a compress table
behavior - drop behavior of dropping column
sequential - If compress table/drop column, whether or not sequential

getCreateConstraintConstantAction

public CreateConstraintConstantAction getCreateConstraintConstantAction(java.lang.String constraintName,
                                                                        int constraintType,
                                                                        java.lang.String tableName,
                                                                        UUID tableId,
                                                                        java.lang.String schemaName,
                                                                        java.lang.String[] columnNames,
                                                                        IndexConstantAction indexAction,
                                                                        java.lang.String constraintText,
                                                                        boolean enabled,
                                                                        ConstraintInfo otherConstraint,
                                                                        ProviderInfo[] providerInfo)
Make a ConstantAction for a constraint.

Parameters:
constraintName - Constraint name.
constraintType - Constraint type.
tableName - Table name.
tableId - UUID of table.
schemaName - Schema that table lives in.
columnNames - String[] for column names
indexAction - IndexConstantAction for constraint (if necessary)
constraintText - Text for check constraint RESOLVE - the next parameter should go away once we use UUIDs (Generated constraint names will be based off of uuids)
enabled - Should the constraint be created as enabled (enabled == true), or disabled (enabled == false).
providerInfo - Information on all the Providers

getCreateIndexConstantAction

public CreateIndexConstantAction getCreateIndexConstantAction(boolean unique,
                                                              java.lang.String indexType,
                                                              java.lang.String schemaName,
                                                              java.lang.String indexName,
                                                              java.lang.String tableName,
                                                              UUID tableId,
                                                              long conglomId,
                                                              java.lang.String[] columnNames,
                                                              boolean[] isAscending,
                                                              boolean isConstraint,
                                                              UUID conglomerateUUID,
                                                              java.util.Properties properties)
Make the ConstantAction for a CREATE INDEX statement.

Parameters:
unique - True means it will be a unique index
indexType - The type of index (BTREE, for example)
schemaName - the schema that table (and index) lives in.
indexName - Name of the index
tableName - Name of table the index will be on
tableId - UUID of table.
conglomId - Conglomerate ID of the index, if known in advance
columnNames - Names of the columns in the index, in order
isAscending - Array of booleans telling asc/desc on each column
isConstraint - TRUE if index is backing up a constraint, else FALSE
conglomerateUUID - ID of conglomerate
properties - The optional properties list associated with the index.

getCreateAliasConstantAction

public ConstantAction getCreateAliasConstantAction(java.lang.String aliasName,
                                                   java.lang.String schemaName,
                                                   java.lang.String javaClassName,
                                                   AliasInfo aliasInfo,
                                                   char aliasType)
Make the ConstantAction for a CREATE ALIAS statement.

Parameters:
aliasName - Name of alias.
schemaName - Alias's schema.
javaClassName - Name of java class.
aliasType - The alias type

getCreateSPSConstantAction

public ConstantAction getCreateSPSConstantAction(java.lang.String schemaName,
                                                 java.lang.String spsName,
                                                 java.lang.String spsText,
                                                 java.lang.String usingText,
                                                 boolean okInSys,
                                                 boolean nocompile,
                                                 UUID compSchemaId)
Make the ConstantAction for a CREATE STORED PREPARED STATEMENT statement. Adds an extra parameter that allows the user to designate whether this sps can be created in the SYS schema.

Parameters:
schemaName - name for the schema that table lives in.
spsName - Name of statement
spsText - Text of query expression for sps definition
usingText - the text of the USING clause
okInSys - ok to create in sys schema
nocompile - don't try to compile the sps when it is created
compSchemaId - the compilation schema id

getCreateSchemaConstantAction

public ConstantAction getCreateSchemaConstantAction(java.lang.String schemaName,
                                                    java.lang.String aid)
Make the ConstantAction for a CREATE SCHEMA statement.

Parameters:
schemaName - Name of table.
aid - Authorizaton id

getCreateTableConstantAction

public ConstantAction getCreateTableConstantAction(java.lang.String schemaName,
                                                   java.lang.String tableName,
                                                   int tableType,
                                                   ColumnInfo[] columnInfo,
                                                   CreateConstraintConstantAction[] constraintActions,
                                                   java.util.Properties properties,
                                                   char lockGranularity,
                                                   boolean onCommitDeleteRows,
                                                   boolean onRollbackDeleteRows)
Make the ConstantAction for a CREATE TABLE statement.

Parameters:
schemaName - name for the schema that table lives in.
tableName - Name of table.
tableType - Type of table (e.g., BASE, global temporary table).
columnInfo - Information on all the columns in the table. (REMIND tableDescriptor ignored)
constraintActions - CreateConstraintConstantAction[] for constraints
properties - Optional table properties
lockGranularity - The lock granularity.
onCommitDeleteRows - If true, on commit delete rows else on commit preserve rows of temporary table.
onRollbackDeleteRows - If true, on rollback, delete rows from temp tables which were logically modified. true is the only supported value

getSavepointConstantAction

public ConstantAction getSavepointConstantAction(java.lang.String savepointName,
                                                 int statementType)
Make the ConstantAction for a savepoint statement (ROLLBACK savepoint, RELASE savepoint and SAVEPOINT).

Parameters:
savepointName - name for the savepoint.
statementType - Type of savepoint statement ie rollback, release or set savepoint

getCreateViewConstantAction

public ConstantAction getCreateViewConstantAction(java.lang.String schemaName,
                                                  java.lang.String tableName,
                                                  int tableType,
                                                  java.lang.String viewText,
                                                  int checkOption,
                                                  ColumnInfo[] columnInfo,
                                                  ProviderInfo[] providerInfo,
                                                  UUID compSchemaId)
Make the ConstantAction for a CREATE VIEW statement.

Parameters:
tableName - Name of table.
tableType - Type of table (e.g., BASE).
viewText - Text of query expression for view definition
checkOption - Check option type
columnInfo - Information on all the columns in the table.
providerInfo - Information on all the Providers
compSchemaId - ID of schema in which the view is to be bound when accessed in the future. (REMIND tableDescriptor ignored)

getDeleteConstantAction

public ConstantAction getDeleteConstantAction(long conglomId,
                                              int tableType,
                                              StaticCompiledOpenConglomInfo heapSCOCI,
                                              IndexRowGenerator[] irgs,
                                              long[] indexCIDS,
                                              StaticCompiledOpenConglomInfo[] indexSCOCIs,
                                              ExecRow emptyHeapRow,
                                              boolean deferred,
                                              boolean tableIsPublished,
                                              UUID tableID,
                                              int lockMode,
                                              java.lang.Object deleteToken,
                                              java.lang.Object keySignature,
                                              int[] keyPositions,
                                              long keyConglomId,
                                              java.lang.String schemaName,
                                              java.lang.String tableName,
                                              ResultDescription resultDescription,
                                              FKInfo[] fkInfo,
                                              TriggerInfo triggerInfo,
                                              FormatableBitSet baseRowReadList,
                                              int[] baseRowReadMap,
                                              int[] streamStorableHeapColIds,
                                              int numColumns,
                                              UUID dependencyId,
                                              boolean singleRowSource,
                                              ConstantAction[] dependentConstantActions)
                                       throws StandardException
Make the ConstantAction for a Replicated DELETE statement.

Parameters:
conglomId - Conglomerate ID.
tableType - type of this table
heapSCOCI - StaticCompiledOpenConglomInfo for heap.
irgs - Index descriptors
indexCIDS - Conglomerate IDs of indices
indexSCOCIs - StaticCompiledOpenConglomInfos for indexes.
emptyHeapRow - Template for heap row.
deferred - True means deferred delete
tableIsPublished - true if table is published
tableID - table id
lockMode - The lock mode to use (row or table, see TransactionController)
keySignature - signature for the key(null for source)
keyPositions - positions of primary key columns in base row
keyConglomId - conglomerate id for the key (-1 for the souce)
schemaName - schemaName(null for source)
tableName - tableName(null for source)
resultDescription - A description of the columns in the row to be deleted. Only set in replication or during cascade Delete.
fkInfo - Array of structures containing foreign key info, if any (may be null)
triggerInfo - Array of structures containing trigger info, if any (may be null)
numColumns - Number of columns to read
dependencyId - UUID for dependency system
baseRowReadList - Map of columns read in. 1 based.
baseRowReadMap - BaseRowReadMap[heapColId]->ReadRowColumnId.
streamStorableHeapColIds - Null for non rep. (0 based)
singleRowSource - Whether or not source is a single row source
Throws:
StandardException - Thrown on failure

getDropConstraintConstantAction

public ConstraintConstantAction getDropConstraintConstantAction(java.lang.String constraintName,
                                                                java.lang.String constraintSchemaName,
                                                                java.lang.String tableName,
                                                                UUID tableId,
                                                                java.lang.String tableSchemaName,
                                                                IndexConstantAction indexAction,
                                                                int behavior,
                                                                int verifyType)
Make ConstantAction to drop a constraint.

Parameters:
constraintName - Constraint name.
constraintSchemaName - Constraint Schema Name
tableName - Table name.
tableId - UUID of table.
tableSchemaName - the schema that table lives in.
indexAction - IndexConstantAction for constraint (if necessary)
behavior - The drop behavior (e.g. StatementType.RESTRICT)
verifyType - Verify that the constraint is of this type.

getDropIndexConstantAction

public DropIndexConstantAction getDropIndexConstantAction(java.lang.String fullIndexName,
                                                          java.lang.String indexName,
                                                          java.lang.String tableName,
                                                          java.lang.String schemaName,
                                                          UUID tableId,
                                                          long tableConglomerateId)
Make the ConstantAction for a DROP INDEX statement.

Parameters:
fullIndexName - Fully qualified index name
indexName - Index name.
tableName - The table name
schemaName - Schema that index lives in.
tableId - UUID for table
tableConglomerateId - heap conglomerate ID for table

getDropAliasConstantAction

public ConstantAction getDropAliasConstantAction(SchemaDescriptor sd,
                                                 java.lang.String aliasName,
                                                 char aliasType)
Make the ConstantAction for a DROP ALIAS statement.

Parameters:
aliasName - Alias name.
aliasType - Alias type.

getDropSPSConstantAction

public ConstantAction getDropSPSConstantAction(SchemaDescriptor sd,
                                               java.lang.String spsName)
Make the ConstantAction for a DROP STATEMENT statement.

Parameters:
sd - Schema that stored prepared statement lives in.
spsName - Name of the SPS

getDropSchemaConstantAction

public ConstantAction getDropSchemaConstantAction(java.lang.String schemaName)
Make the ConstantAction for a DROP TABLE statement.

Parameters:
schemaName - Table name.

getDropTableConstantAction

public ConstantAction getDropTableConstantAction(java.lang.String fullTableName,
                                                 java.lang.String tableName,
                                                 SchemaDescriptor sd,
                                                 long conglomerateNumber,
                                                 UUID tableId,
                                                 int behavior)
Make the ConstantAction for a DROP TABLE statement.

Parameters:
fullTableName - Fully qualified table name
tableName - Table name.
sd - Schema that table lives in.
tableId - UUID for table
behavior - drop behavior, CASCADE, RESTRICT or DEFAULT

getDropViewConstantAction

public ConstantAction getDropViewConstantAction(java.lang.String fullTableName,
                                                java.lang.String tableName,
                                                SchemaDescriptor sd)
Make the ConstantAction for a DROP VIEW statement.

Parameters:
fullTableName - Fully qualified table name
tableName - Table name.
sd - Schema that view lives in.

getRenameConstantAction

public ConstantAction getRenameConstantAction(java.lang.String fullTableName,
                                              java.lang.String tableName,
                                              java.lang.String oldObjectName,
                                              java.lang.String newObjectName,
                                              SchemaDescriptor sd,
                                              UUID tableId,
                                              boolean usedAlterTable,
                                              int renamingWhat)
Make the ConstantAction for a RENAME TABLE/COLUMN/INDEX statement.

Parameters:
fullTableName - Fully qualified table name
tableName - Table name.
oldObjectName - Old object name
newObjectName - New object name.
sd - Schema that table lives in.
tableId - UUID for table
usedAlterTable - True if used Alter Table command, false if used Rename
renamingWhat - Value indicates if Rename Column/Index.

getInsertConstantAction

public ConstantAction getInsertConstantAction(TableDescriptor tableDescriptor,
                                              long conglomId,
                                              StaticCompiledOpenConglomInfo heapSCOCI,
                                              IndexRowGenerator[] irgs,
                                              long[] indexCIDS,
                                              StaticCompiledOpenConglomInfo[] indexSCOCIs,
                                              java.lang.String[] indexNames,
                                              boolean deferred,
                                              boolean tableIsPublished,
                                              UUID tableID,
                                              int lockMode,
                                              java.lang.Object insertToken,
                                              java.lang.Object rowSignature,
                                              java.util.Properties targetProperties,
                                              FKInfo[] fkInfo,
                                              TriggerInfo triggerInfo,
                                              int[] streamStorableHeapColIds,
                                              boolean[] indexedCols,
                                              UUID dependencyId,
                                              java.lang.Object[] stageControl,
                                              java.lang.Object[] ddlList,
                                              boolean singleRowSource,
                                              RowLocation[] autoincRowLocation)
                                       throws StandardException
Make the ConstantAction for a Replicated INSERT statement.

Parameters:
conglomId - Conglomerate ID.
heapSCOCI - StaticCompiledOpenConglomInfo for target heap.
irgs - Index descriptors
indexCIDS - Conglomerate IDs of indices
indexSCOCIs - StaticCompiledOpenConglomInfos for indexes.
indexNames - Names of indices on this table for error reporting.
deferred - True means deferred insert
tableIsPublished - true if table is published, false otherwise
tableID - table id
targetProperties - Properties on the target table
fkInfo - Array of structures containing foreign key info, if any (may be null)
triggerInfo - Array of structures containing trigger info,
streamStorableHeapColIds - Null for non rep. (0 based) if any (may be null)
indexedCols - boolean[] of which (0-based) columns are indexed.
dependencyId - UUID for dependency system
stageControl - Stage Control Tokens
ddlList - List of DDL to log. This is for BULK INSERT into a published table at the Source.
singleRowSource - Whether or not source is a single row source
autoincRowLocation - array of row locations into syscolumns for autoincrement columns
Throws:
StandardException - Thrown on failure

getUpdatableVTIConstantAction

public ConstantAction getUpdatableVTIConstantAction(int statementType,
                                                    boolean deferred)
                                             throws StandardException
Make the ConstantAction for an updatable VTI statement.

Parameters:
deferred - Deferred mode?
Throws:
StandardException - Thrown on failure

getUpdatableVTIConstantAction

public ConstantAction getUpdatableVTIConstantAction(int statementType,
                                                    boolean deferred,
                                                    int[] changedColumnIds)
                                             throws StandardException
Make the ConstantAction for an updatable VTI statement.

Parameters:
deferred - Deferred mode?
changedColumnIds - Array of ids of changed columns
Throws:
StandardException - Thrown on failure

getLockTableConstantAction

public ConstantAction getLockTableConstantAction(java.lang.String fullTableName,
                                                 long conglomerateNumber,
                                                 boolean exclusiveMode)
Make the ConstantAction for a LOCK TABLE statement.

Parameters:
fullTableName - Full name of the table.
conglomerateNumber - Conglomerate number for the heap
exclusiveMode - Whether or not to get an exclusive lock.

getSetSchemaConstantAction

public ConstantAction getSetSchemaConstantAction(java.lang.String schemaName,
                                                 int type)
Make the ConstantAction for a SET SCHEMA statement.

Parameters:
schemaName - Name of schema.
type - Literal, USER or ?

getSetTransactionIsolationConstantAction

public ConstantAction getSetTransactionIsolationConstantAction(int isolationLevel)
Make the ConstantAction for a SET TRANSACTION ISOLATION statement.

Parameters:
isolationLevel - The new isolation level.

getUpdateConstantAction

public UpdateConstantAction getUpdateConstantAction(long conglomId,
                                                    int tableType,
                                                    StaticCompiledOpenConglomInfo heapSCOCI,
                                                    IndexRowGenerator[] irgs,
                                                    long[] indexCIDS,
                                                    StaticCompiledOpenConglomInfo[] indexSCOCIs,
                                                    java.lang.String[] indexNames,
                                                    ExecRow emptyHeapRow,
                                                    boolean deferred,
                                                    UUID targetUUID,
                                                    int lockMode,
                                                    boolean tableIsPublished,
                                                    int[] changedColumnIds,
                                                    int[] keyPositions,
                                                    java.lang.Object updateToken,
                                                    FKInfo[] fkInfo,
                                                    TriggerInfo triggerInfo,
                                                    FormatableBitSet baseRowReadList,
                                                    int[] baseRowReadMap,
                                                    int[] streamStorableHeapColIds,
                                                    int numColumns,
                                                    boolean positionedUpdate,
                                                    boolean singleRowSource)
                                             throws StandardException
Make the ConstantAction for a Replicated DELETE statement.

Parameters:
conglomId - Conglomerate ID.
tableType - type of this table
heapSCOCI - StaticCompiledOpenConglomInfo for heap.
irgs - Index descriptors
indexCIDS - Conglomerate IDs of indices
indexSCOCIs - StaticCompiledOpenConglomInfos for indexes.
emptyHeapRow - Template for heap row.
deferred - True means deferred update
targetUUID - UUID of target table
lockMode - The lock mode to use (row or table, see TransactionController)
tableIsPublished - true if table is published, false otherwise
changedColumnIds - Array of ids of changes columns
keyPositions - positions of primary key columns in base row
fkInfo - Array of structures containing foreign key info, if any (may be null)
triggerInfo - Array of structures containing trigger info,
baseRowReadList - Map of columns read in. 1 based.
streamStorableHeapColIds - Null for non rep. (0 based) if any (may be null)
baseRowReadMap - map of columns to be selected from the base row (partial row). 1 based.
numColumns - The number of columns being read.
positionedUpdate - is this a positioned update
singleRowSource - Whether or not source is a single row source
Throws:
StandardException - Thrown on failure

getAddJarConstantAction

public ConstantAction getAddJarConstantAction(UUID id,
                                              java.lang.String schemaName,
                                              java.lang.String sqlName,
                                              java.lang.String externalPath)
                                       throws StandardException
Make the ConstantAction to Add a jar file to a database.

Parameters:
id - The id for the jar file - (null means create one)
schemaName - The SchemaName for the jar file.
sqlName - The sqlName for the jar file.
Throws:
StandardException - Ooops

getReplaceJarConstantAction

public ConstantAction getReplaceJarConstantAction(UUID id,
                                                  java.lang.String schemaName,
                                                  java.lang.String sqlName,
                                                  java.lang.String externalPath)
                                           throws StandardException
Make the ConstantAction to replace a jar file in a database.

Parameters:
id - The id for the jar file - (Ignored if null)
schemaName - The SchemaName for the jar file.
sqlName - The sqlName for the jar file.
Throws:
StandardException - Ooops

getDropJarConstantAction

public ConstantAction getDropJarConstantAction(UUID id,
                                               java.lang.String schemaName,
                                               java.lang.String sqlName)
                                        throws StandardException
Make the ConstantAction to drop a jar file from a database.

Parameters:
id - The id for the jar file - (Ignored if null)
schemaName - The SchemaName for the jar file.
sqlName - The sqlName for the jar file.
Throws:
StandardException - Ooops

getAuthorizer

protected static Authorizer getAuthorizer()

getCreateTriggerConstantAction

public ConstantAction getCreateTriggerConstantAction(java.lang.String triggerSchemaName,
                                                     java.lang.String triggerName,
                                                     int eventMask,
                                                     boolean isBefore,
                                                     boolean isRow,
                                                     boolean isEnabled,
                                                     TableDescriptor triggerTable,
                                                     UUID whenSPSId,
                                                     java.lang.String whenText,
                                                     UUID actionSPSId,
                                                     java.lang.String actionText,
                                                     UUID spsCompSchemaId,
                                                     java.sql.Timestamp creationTimestamp,
                                                     int[] referencedCols,
                                                     java.lang.String originalActionText,
                                                     boolean referencingOld,
                                                     boolean referencingNew,
                                                     java.lang.String oldReferencingName,
                                                     java.lang.String newReferencingName)
Make the ConstantAction for a CREATE TRIGGER statement.

Parameters:
triggerName - Name of trigger
eventMask - TriggerDescriptor.TRIGGER_EVENT_XXXX
isBefore - is this a before (as opposed to after) trigger
isRow - is this a row trigger or statement trigger
isEnabled - is this trigger enabled or disabled
triggerTable - the table upon which this trigger is defined
whenSPSId - the sps id for the when clause (may be null)
whenText - the text of the when clause (may be null)
actionSPSId - the spsid for the trigger action (may be null)
actionText - the text of the trigger action (may be null)
spsCompSchemaId - the compilation schema for the action and when spses. If null, will be set to the current default schema
creationTimestamp - when was this trigger created? if null, will be set to the time that executeConstantAction() is invoked
referencedCols - what columns does this trigger reference (may be null)
originalActionText - The original user text of the trigger action
referencingOld - whether or not OLD appears in REFERENCING clause
referencingNew - whether or not NEW appears in REFERENCING clause
oldReferencingName - old referencing table name, if any, that appears in REFERCING clause
newReferencingName - new referencing table name, if any, that appears in REFERCING clause

getDropTriggerConstantAction

public ConstantAction getDropTriggerConstantAction(SchemaDescriptor sd,
                                                   java.lang.String triggerName,
                                                   UUID tableId)
Make the ConstantAction for a DROP TRIGGER statement.

Parameters:
sd - Schema that stored prepared statement lives in.
triggerName - Name of the Trigger
tableId - The table this trigger is defined upon

getUpdateStatisticsConstantAction

public ConstantAction getUpdateStatisticsConstantAction(boolean forTable,
                                                        java.lang.String objectName,
                                                        UUID tableUUID,
                                                        UUID[] objectUUID,
                                                        long[] conglomerateNumber,
                                                        ExecIndexRow[] indexRow)
Make the constant action for a UPDATE STATISTICS statement.

Parameters:
forTable - whether for an index or table.
objectName - name of the object (either table or index) for which this statistic is being created.
tableUUID - UUID of the table for which statistics are being created.
objectUUID - array of UUID's, one for each index conglomerate for which statistics are being created.
conglomerateNumber - array of conglomerate numbers, one for each index conglomerate for which statistics are being created.
indexRow - array of index rows, one for each index. This row is used by the constant action to read data from the indices.

getDropStatisticsConstantAction

public ConstantAction getDropStatisticsConstantAction(SchemaDescriptor sd,
                                                      java.lang.String fullTableName,
                                                      java.lang.String objectName,
                                                      boolean forTable)
Make the constant action for Drop Statistics statement.

Parameters:
sd - Schema Descriptor of the schema in which the object resides.
fullTableName - full name of the object for which statistics are being dropped.
objectName - object name for which statistics are being dropped.
forTable - is it an index or table whose statistics aer being consigned to the garbage heap?


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.