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

pack-priv Class UniqueIndexSortObserver

extends BasicSortObserver
Class Inheritance
Imports
org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ExecRow, org.apache.derby.iapi.store.access.BackingStoreHashtable, .TransactionController, org.apache.derby.iapi.types.DataValueDescriptor

Unique index aggregator. Enforces uniqueness when creating a unique index or constraint.

Field Summary

Modifier and TypeField and Description
private final UUID
private final boolean
private final boolean
private BackingStoreHashtable
private final String
private final LanguageConnectionContext
private final String
Inherited from org.apache.derby.impl.sql.execute.BasicSortObserver:
distinctdoClone

Constructor Summary

AccessConstructor and Description
public
UniqueIndexSortObserver(LanguageConnectionContext lcc, UUID constraintId, boolean doClone, boolean deferrable, boolean deferred, String indexOrConstraintName, ExecRow execRow, boolean reuseWrappers, String tableName)

Method Summary

Modifier and TypeMethod and Description
public boolean
deferrable()

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.deferrable.

Implements org.apache.derby.iapi.store.access.SortObserver.deferrable.

Overridden by subclasses that observe sorters with uniqueness checking.

public boolean
deferred()

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.deferred.

Implements org.apache.derby.iapi.store.access.SortObserver.deferred.

Overridden by subclasses that observe sorters with uniqueness checking.

public DataValueDescriptor[]
insertDuplicateKey(DataValueDescriptor[]
the current row that the sorter is on the verge of retaining. It is a duplicate of existingRow.
in
,
DataValueDescriptor[]
the row that is already in the the sorter which is a duplicate of insertRow
dup
)

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.insertDuplicateKey.

Implements org.apache.derby.iapi.store.access.SortObserver.insertDuplicateKey.

Called prior to inserting a duplicate sort key.

public void
rememberDuplicate(DataValueDescriptor[]
data of offending key
row
)

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.rememberDuplicate.

Implements org.apache.derby.iapi.store.access.SortObserver.rememberDuplicate.

Overridden by subclasses that observe sorters with uniqueness checking.

Inherited from org.apache.derby.impl.sql.execute.BasicSortObserver:
addToFreeListgetArrayCloneinsertNonDuplicateKey

Field Detail

constraintIdback to summary
private final UUID constraintId
deferrableback to summary
private final boolean deferrable
deferredback to summary
private final boolean deferred
deferredDuplicatesback to summary
private BackingStoreHashtable deferredDuplicates
indexOrConstraintNameback to summary
private final String indexOrConstraintName
lccback to summary
private final LanguageConnectionContext lcc
tableNameback to summary
private final String tableName

Constructor Detail

UniqueIndexSortObserverback to summary
public UniqueIndexSortObserver(LanguageConnectionContext lcc, UUID constraintId, boolean doClone, boolean deferrable, boolean deferred, String indexOrConstraintName, ExecRow execRow, boolean reuseWrappers, String tableName)

Method Detail

deferrableback to summary
public boolean deferrable()

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.deferrable.

Implements org.apache.derby.iapi.store.access.SortObserver.deferrable.

Doc from org.apache.derby.iapi.store.access.SortObserver.deferrable.

Overridden by subclasses that observe sorters with uniqueness checking.

Returns:boolean

true if the index's constraint is deferrable. Any SortObserver implementations that implement uniqueness checking need to keep track of this information.

Annotations
@Override
deferredback to summary
public boolean deferred()

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.deferred.

Implements org.apache.derby.iapi.store.access.SortObserver.deferred.

Doc from org.apache.derby.iapi.store.access.SortObserver.deferred.

Overridden by subclasses that observe sorters with uniqueness checking.

Returns:boolean

true if constraint mode of the index's constraint is effectively deferred. Any SortObserver implementations that implement uniqueness checking need to keep track of this information.

Annotations
@Override
insertDuplicateKeyback to summary
public DataValueDescriptor[] insertDuplicateKey(DataValueDescriptor[] in, DataValueDescriptor[] dup) throws StandardException

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.insertDuplicateKey.

Implements org.apache.derby.iapi.store.access.SortObserver.insertDuplicateKey.

Doc from org.apache.derby.impl.sql.execute.BasicSortObserver.insertDuplicateKey.

Called prior to inserting a duplicate sort key.

Parameters
in:DataValueDescriptor[]

the current row that the sorter is on the verge of retaining. It is a duplicate of existingRow.

dup:DataValueDescriptor[]

the row that is already in the the sorter which is a duplicate of insertRow

Returns:DataValueDescriptor[]

Doc from org.apache.derby.iapi.store.access.SortObserver.insertDuplicateKey.

the row to be inserted by the sorter. If null, then nothing is inserted by the sorter. Distinct sorts will want to return null.

Annotations
@Override
Exceptions
StandardException:
never thrown
rememberDuplicateback to summary
public void rememberDuplicate(DataValueDescriptor[] row) throws StandardException

Overrides org.apache.derby.impl.sql.execute.BasicSortObserver.rememberDuplicate.

Implements org.apache.derby.iapi.store.access.SortObserver.rememberDuplicate.

Doc from org.apache.derby.iapi.store.access.SortObserver.rememberDuplicate.

Overridden by subclasses that observe sorters with uniqueness checking. Will be called by sorters iff deferrable() and deferred() and uniqueness violation, so implementations that sometimes return true to these must implement this method to save duplicate information till commit time.

Parameters
row:DataValueDescriptor[]

data of offending key

Annotations
@Override
Exceptions
StandardException:
standard error policy