Class DefaultVTIModDeferPolicy
java.lang.Object
org.apache.derby.impl.sql.compile.DefaultVTIModDeferPolicy
- All Implemented Interfaces:
DeferModification
This class implements the default policy for defering modifications to virtual
tables.
-
Field Summary
FieldsFields inherited from interface DeferModification
DELETE_STATEMENT, INSERT_STATEMENT, UPDATE_STATEMENT -
Constructor Summary
ConstructorsConstructorDescriptionDefaultVTIModDeferPolicy(String targetVTIClassName, boolean VTIResultSetIsSensitive) -
Method Summary
Modifier and TypeMethodDescriptionbooleanalwaysDefer(int statementType) This method is called during preparation of an insert, update, or delete statement with this VTI as the target.booleancolumnRequiresDefer(int statementType, String columnName, boolean inWhereClause) This method is called during preparation of an update or delete statement on the virtual table if getResultSetType() returns ResultSet.TYPE_SCROLL_SENSITIVE or TYPE_SCROLL_SENSITIVE and alwaysDefer( statementType) returns false.voidmodificationNotify(int statementType, boolean deferred) This VTI method is called by Derby when a VTI modification (insert, update, or delete) is executed.booleansubselectRequiresDefer(int statementType, String VTIClassName) This method is called during preparation of an insert, update, or delete statement that has this virtual table as its target and that has a sub-select.booleansubselectRequiresDefer(int statementType, String schemaName, String tableName) This method is called during preparation of an insert, update, or delete statement that has this virtual table as its target and that has a sub-select.
-
Field Details
-
targetVTIClassName
-
VTIResultSetIsSensitive
private final boolean VTIResultSetIsSensitive
-
-
Constructor Details
-
DefaultVTIModDeferPolicy
DefaultVTIModDeferPolicy(String targetVTIClassName, boolean VTIResultSetIsSensitive)
-
-
Method Details
-
alwaysDefer
public boolean alwaysDefer(int statementType) Description copied from interface:DeferModificationThis method is called during preparation of an insert, update, or delete statement with this VTI as the target. It indicates whether the statement should be deferred irregardless of the other clauses in the statement. If alwaysDefer returns true then the other methods in this interface are not called. (At least not for this statement type).- Specified by:
alwaysDeferin interfaceDeferModification- Parameters:
statementType- One of INSERT_STATEMENT, UPDATE_STATEMENT, DELETE_STATEMENT.- Returns:
- true if the statement type should always be deferred on this VTI, false other criteria (see below) should be examined to determine whether to defer the modification.
- See Also:
-
columnRequiresDefer
Description copied from interface:DeferModificationThis method is called during preparation of an update or delete statement on the virtual table if getResultSetType() returns ResultSet.TYPE_SCROLL_SENSITIVE or TYPE_SCROLL_SENSITIVE and alwaysDefer( statementType) returns false. ColumnRequiresDefer is called once for each column that is being updated, or each column in a DELETE where clause until it returns true or until all the columns have been exhausted.- Specified by:
columnRequiresDeferin interfaceDeferModification- Parameters:
statementType- UPDATE_STATEMENT or DELETE_STATEMENT.columnName- the name of one of the columns being updatedinWhereClause- indicates whether the column also appears in the where clause- Returns:
- true if the update must be deferred false if this column does not require a deferred update
- See Also:
-
subselectRequiresDefer
Description copied from interface:DeferModificationThis method is called during preparation of an insert, update, or delete statement that has this virtual table as its target and that has a sub-select. It is invoked once for each regular table in a sub-select, if it has not already been determined that the statement should be deferred or that the VTI does not support deferral.- Specified by:
subselectRequiresDeferin interfaceDeferModification- Parameters:
statementType- the statement type: INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT.schemaName- the schema of the table in the sub-select.tableName- the name of the table in the sub-select.- Returns:
- true if the modification must be deferred false if this source table does not necessitate a deferred modification
- See Also:
-
subselectRequiresDefer
Description copied from interface:DeferModificationThis method is called during preparation of an insert, update, or delete statement that has this virtual table as its target and that has a sub-select. It is invoked once for each virtual table in the sub-select, if it has not already been determined that the statement should be deferred or that the VTI does not support deferral.- Specified by:
subselectRequiresDeferin interfaceDeferModification- Parameters:
statementType- the statement type: INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT.VTIClassName- the name of the class implementing the VTI in the sub-select.- Returns:
- true if the modification must be deferred false if this source table does not necessitate a deferred modification
- See Also:
-
modificationNotify
public void modificationNotify(int statementType, boolean deferred) Description copied from interface:DeferModificationThis VTI method is called by Derby when a VTI modification (insert, update, or delete) is executed. It is called after the VTI has been instantiated but before any rows are read, inserted, updated, or deleted.- Specified by:
modificationNotifyin interfaceDeferModification- Parameters:
statementType- one of INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENTdeferred- true if the modification will be deferred, false if not.
-