1 21 22 package org.apache.derby.impl.sql.execute; 23 24 import org.apache.derby.iapi.reference.SQLState; 25 26 import org.apache.derby.iapi.services.io.Storable; 27 28 import org.apache.derby.iapi.error.StandardException; 29 30 import org.apache.derby.iapi.store.access.SortObserver; 31 32 import org.apache.derby.iapi.sql.execute.ExecRow; 33 34 import org.apache.derby.iapi.types.DataValueDescriptor; 35 36 42 class UniqueIndexSortObserver extends BasicSortObserver 43 { 44 private boolean isConstraint; 45 private String indexOrConstraintName; 46 private String tableName; 47 48 public UniqueIndexSortObserver(boolean doClone, boolean isConstraint, 49 String indexOrConstraintName, ExecRow execRow, 50 boolean reuseWrappers, String tableName) 51 { 52 super(doClone, true, execRow, reuseWrappers); 53 this.isConstraint = isConstraint; 54 this.indexOrConstraintName = indexOrConstraintName; 55 this.tableName = tableName; 56 } 57 58 61 62 67 public DataValueDescriptor[] insertDuplicateKey( 68 DataValueDescriptor[] in, 69 DataValueDescriptor[] dup) 70 throws StandardException 71 { 72 StandardException se = null; 73 se = StandardException.newException( 74 SQLState.LANG_DUPLICATE_KEY_CONSTRAINT, indexOrConstraintName, tableName); 75 throw se; 76 } 77 78 } 79 | Popular Tags |