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

pack-priv Class DefaultVTIModDeferPolicy

extends Object
implements DeferModification
Class Inheritance
All Implemented Interfaces
org.apache.derby.vti.DeferModification
Imports
org.apache.derby.vti.DeferModification

This class implements the default policy for defering modifications to virtual tables.

Field Summary

Modifier and TypeField and Description
private final String
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultVTIModDeferPolicy(String targetVTIClassName, boolean VTIResultSetIsSensitive)

Method Summary

Modifier and TypeMethod and Description
public boolean
alwaysDefer(int
One of INSERT_STATEMENT, UPDATE_STATEMENT, DELETE_STATEMENT.
statementType
)

Implements org.apache.derby.vti.DeferModification.alwaysDefer.

This method is called during preparation of an insert, update, or delete statement with this VTI as the target.

public boolean
columnRequiresDefer(int
UPDATE_STATEMENT or DELETE_STATEMENT.
statementType
,
String
the name of one of the columns being updated
columnName
,
boolean
indicates whether the column also appears in the where clause
inWhereClause
)

Implements org.apache.derby.vti.DeferModification.columnRequiresDefer.

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.

public void
modificationNotify(int
one of INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT
statementType
,
boolean
true if the modification will be deferred, false if not.
deferred
)

Implements org.apache.derby.vti.DeferModification.modificationNotify.

This VTI method is called by Derby when a VTI modification (insert, update, or delete) is executed.

public boolean
subselectRequiresDefer(int
the statement type: INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT.
statementType
,
String
the schema of the table in the sub-select.
schemaName
,
String
the name of the table in the sub-select.
tableName
)

Implements org.apache.derby.vti.DeferModification.subselectRequiresDefer.

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.

public boolean
subselectRequiresDefer(int
the statement type: INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT.
statementType
,
String
the name of the class implementing the VTI in the sub-select.
VTIClassName
)

Implements org.apache.derby.vti.DeferModification.subselectRequiresDefer.

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

targetVTIClassNameback to summary
private final String targetVTIClassName
VTIResultSetIsSensitiveback to summary
private final boolean VTIResultSetIsSensitive

Constructor Detail

DefaultVTIModDeferPolicyback to summary
pack-priv DefaultVTIModDeferPolicy(String targetVTIClassName, boolean VTIResultSetIsSensitive)

Method Detail

alwaysDeferback to summary
public boolean alwaysDefer(int statementType)

Implements org.apache.derby.vti.DeferModification.alwaysDefer.

Doc from org.apache.derby.vti.DeferModification.alwaysDefer.

This 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).

Parameters
statementType:int

One of INSERT_STATEMENT, UPDATE_STATEMENT, DELETE_STATEMENT.

Returns:boolean

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
org.apache.derby.vti.DeferModification#alwaysDefer
columnRequiresDeferback to summary
public boolean columnRequiresDefer(int statementType, String columnName, boolean inWhereClause)

Implements org.apache.derby.vti.DeferModification.columnRequiresDefer.

Doc from org.apache.derby.vti.DeferModification.columnRequiresDefer.

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

Parameters
statementType:int

UPDATE_STATEMENT or DELETE_STATEMENT.

columnName:String

the name of one of the columns being updated

inWhereClause:boolean

indicates whether the column also appears in the where clause

Returns:boolean

true if the update must be deferred false if this column does not require a deferred update

See Also
org.apache.derby.vti.DeferModification#columnRequiresDefer
modificationNotifyback to summary
public void modificationNotify(int statementType, boolean deferred)

Implements org.apache.derby.vti.DeferModification.modificationNotify.

Doc from org.apache.derby.vti.DeferModification.modificationNotify.

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

Parameters
statementType:int

one of INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT

deferred:boolean

true if the modification will be deferred, false if not.

subselectRequiresDeferback to summary
public boolean subselectRequiresDefer(int statementType, String schemaName, String tableName)

Implements org.apache.derby.vti.DeferModification.subselectRequiresDefer.

Doc from org.apache.derby.vti.DeferModification.subselectRequiresDefer.

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

Parameters
statementType:int

the statement type: INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT.

schemaName:String

the schema of the table in the sub-select.

tableName:String

the name of the table in the sub-select.

Returns:boolean

true if the modification must be deferred false if this source table does not necessitate a deferred modification

See Also
org.apache.derby.vti.DeferModification#subselectRequiresDefer(int, String, String)
subselectRequiresDeferback to summary
public boolean subselectRequiresDefer(int statementType, String VTIClassName)

Implements org.apache.derby.vti.DeferModification.subselectRequiresDefer.

Doc from org.apache.derby.vti.DeferModification.subselectRequiresDefer.

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

Parameters
statementType:int

the statement type: INSERT_STATEMENT, UPDATE_STATEMENT, or DELETE_STATEMENT.

VTIClassName:String

the name of the class implementing the VTI in the sub-select.

Returns:boolean

true if the modification must be deferred false if this source table does not necessitate a deferred modification

See Also
org.apache.derby.vti.DeferModification#subselectRequiresDefer(int, String)