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

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.BasicSortObserver
      extended by 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.


Field Summary
private  java.lang.String indexOrConstraintName
           
private  boolean isConstraint
           
private  java.lang.String tableName
           
 
Fields inherited from class org.apache.derby.impl.sql.execute.BasicSortObserver
distinct, doClone
 
Constructor Summary
UniqueWithDuplicateNullsIndexSortObserver(boolean doClone, boolean isConstraint, java.lang.String indexOrConstraintName, ExecRow execRow, boolean reuseWrappers, java.lang.String tableName)
          Constructs an object of UniqueWithDuplicateNullsIndexSortObserver
 
Method Summary
 DataValueDescriptor[] insertDuplicateKey(DataValueDescriptor[] in, DataValueDescriptor[] dup)
          Methods to check if the duplicate key can be inserted or not.
 
Methods inherited from class org.apache.derby.impl.sql.execute.BasicSortObserver
addToFreeList, getArrayClone, insertNonDuplicateKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isConstraint

private boolean isConstraint

indexOrConstraintName

private java.lang.String indexOrConstraintName

tableName

private java.lang.String tableName
Constructor Detail

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 constraint
indexOrConstraintName - name of index of constraint
execRow - ExecRow to use as source of clone for store.
reuseWrappers - Whether or not we can reuse the wrappers
tableName - name of the table
Method Detail

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 key
dup - 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

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.