1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.services.context.ContextManager; 25 26 import org.apache.derby.impl.sql.compile.ActivationClassBuilder; 27 import org.apache.derby.impl.sql.execute.BaseActivation; 28 import org.apache.derby.iapi.sql.ResultSet; 29 30 import org.apache.derby.iapi.error.StandardException; 31 32 import org.apache.derby.iapi.sql.compile.CompilerContext; 33 import org.apache.derby.iapi.sql.StatementType; 34 35 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor; 36 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 37 import org.apache.derby.iapi.sql.dictionary.DataDictionaryContext; 38 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor; 39 import org.apache.derby.iapi.sql.dictionary.TableDescriptor; 40 41 import org.apache.derby.iapi.reference.SQLState; 42 43 import org.apache.derby.iapi.sql.execute.ConstantAction; 44 45 import org.apache.derby.iapi.services.sanity.SanityManager; 46 47 53 54 public class DropTableNode extends DDLStatementNode 55 { 56 private long conglomerateNumber; 57 private int dropBehavior; 58 private TableDescriptor td; 59 60 67 68 public void init(Object dropObjectName, Object dropBehavior) 69 throws StandardException 70 { 71 initAndCheck(dropObjectName); 72 this.dropBehavior = ((Integer ) dropBehavior).intValue(); 73 } 74 75 81 82 public String toString() 83 { 84 if (SanityManager.DEBUG) 85 { 86 return super.toString() + 87 "conglomerateNumber: " + conglomerateNumber + "\n" + 88 "td: " + ((td == null) ? "null" : td.toString()) + "\n" + 89 "dropBehavior: " + "\n" + dropBehavior + "\n"; 90 } 91 else 92 { 93 return ""; 94 } 95 } 96 97 public String statementToString() 98 { 99 return "DROP TABLE"; 100 } 101 102 110 111 public QueryTreeNode bind() throws StandardException 112 { 113 CompilerContext cc = getCompilerContext(); 114 115 td = getTableDescriptor(); 116 117 conglomerateNumber = td.getHeapConglomerateId(); 118 119 120 ConglomerateDescriptor cd = td.getConglomerateDescriptor(conglomerateNumber); 121 122 123 cc.createDependency(td); 124 cc.createDependency(cd); 125 126 return this; 127 } 128 129 136 public boolean referencesSessionSchema() 137 throws StandardException 138 { 139 return isSessionSchema(td.getSchemaDescriptor()); 141 } 142 143 145 146 151 public ConstantAction makeConstantAction() throws StandardException 152 { 153 return getGenericConstantActionFactory().getDropTableConstantAction( getFullName(), 154 getRelativeName(), 155 getSchemaDescriptor(), 156 conglomerateNumber, 157 td.getUUID(), 158 dropBehavior); 159 } 160 } 161 | Popular Tags |