1 21 22 package org.apache.derby.iapi.sql.dictionary; 23 24 import org.apache.derby.iapi.error.StandardException; 25 26 import org.apache.derby.catalog.UUID; 27 import org.apache.derby.iapi.services.sanity.SanityManager; 28 36 37 public abstract class KeyConstraintDescriptor extends ConstraintDescriptor 38 { 39 48 49 UUID indexId; 51 52 private ConglomerateDescriptor indexConglom; 53 54 68 KeyConstraintDescriptor( 69 DataDictionary dataDictionary, 70 TableDescriptor table, 71 String constraintName, 72 boolean deferrable, 73 boolean initiallyDeferred, 74 int[] referencedColumns, 75 UUID constraintId, 76 UUID indexId, 77 SchemaDescriptor schemaDesc, 78 boolean isEnabled 79 ) 80 { 81 super(dataDictionary, table, constraintName, deferrable, 82 initiallyDeferred, referencedColumns, 83 constraintId, schemaDesc, isEnabled); 84 this.indexId = indexId; 85 } 86 87 92 public UUID getIndexId() 93 { 94 return indexId; 95 } 96 97 104 public ConglomerateDescriptor getIndexConglomerateDescriptor(DataDictionary dd) 105 throws StandardException 106 { 107 if (indexConglom == null) 108 { 109 indexConglom = getTableDescriptor().getConglomerateDescriptor(indexId); 110 } 111 return indexConglom; 112 } 113 114 119 public String getIndexUUIDString() 120 { 121 return indexId.toString(); 122 } 123 124 129 public boolean hasBackingIndex() 130 { 131 return true; 132 } 133 134 139 public UUID getConglomerateId() 140 { 141 return indexId; 142 } 143 144 149 150 public String toString() 151 { 152 if (SanityManager.DEBUG) 153 { 154 return "indexId: " + indexId + "\n" + 155 super.toString(); 156 } 157 else 158 { 159 return ""; 160 } 161 } 162 163 } 164 | Popular Tags |