org.apache.derby.impl.sql.execute
Class UniqueWithDuplicateNullsIndexSortObserver
java.lang.Object
org.apache.derby.impl.sql.execute.BasicSortObserver
org.apache.derby.impl.sql.execute.UniqueWithDuplicateNullsIndexSortObserver
- All Implemented Interfaces:
- SortObserver
public class UniqueWithDuplicateNullsIndexSortObserver
- extends BasicSortObserver
UniqueWithDuplicateNullsIndexSortObserver is implementation of BasicSortObserver for
eliminating non null duplicates from the backing index of unique constraint.
This class is implemented to check for special case of distinct sorting where
duplicate keys are allowed only if there is a null in the key part.
Constructor Summary |
UniqueWithDuplicateNullsIndexSortObserver(boolean doClone,
boolean isConstraint,
java.lang.String indexOrConstraintName,
ExecRow execRow,
boolean reuseWrappers,
java.lang.String tableName)
Constructs an object of UniqueWithDuplicateNullsIndexSortObserver |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isConstraint
private boolean isConstraint
indexOrConstraintName
private java.lang.String indexOrConstraintName
tableName
private java.lang.String tableName
UniqueWithDuplicateNullsIndexSortObserver
public UniqueWithDuplicateNullsIndexSortObserver(boolean doClone,
boolean isConstraint,
java.lang.String indexOrConstraintName,
ExecRow execRow,
boolean reuseWrappers,
java.lang.String tableName)
- Constructs an object of UniqueWithDuplicateNullsIndexSortObserver
- Parameters:
doClone
- If true, then rows that are retained
by the sorter will be cloned. This is needed
if language is reusing row wrappers.isConstraint
- is this part of a constraintindexOrConstraintName
- name of index of constraintexecRow
- ExecRow to use as source of clone for store.reuseWrappers
- Whether or not we can reuse the wrapperstableName
- name of the table
insertDuplicateKey
public DataValueDescriptor[] insertDuplicateKey(DataValueDescriptor[] in,
DataValueDescriptor[] dup)
throws StandardException
- Methods to check if the duplicate key can be inserted or not. It throws
exception if the duplicates has no null part in the key.
- Specified by:
insertDuplicateKey
in interface SortObserver
- Overrides:
insertDuplicateKey
in class BasicSortObserver
- Parameters:
in
- new keydup
- the new key is duplicate of this key
- Returns:
- DVD [] if there is at least one null in
the key else thorws StandardException
- Throws:
StandardException
- is the duplicate key has all non null parts
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.