1 21 22 package org.apache.derby.impl.sql.execute.rts; 23 24 import org.apache.derby.iapi.services.i18n.MessageService; 25 import org.apache.derby.iapi.reference.SQLState; 26 27 33 public class RealDeleteCascadeResultSetStatistics 34 extends RealDeleteResultSetStatistics 35 { 36 37 38 public ResultSetStatistics[] dependentTrackingArray; 39 40 42 46 public RealDeleteCascadeResultSetStatistics( 47 int rowCount, 48 boolean deferred, 49 int indexesUpdated, 50 boolean tableLock, 51 long executeTime, 52 ResultSetStatistics sourceResultSetStatistics, 53 ResultSetStatistics[] dependentTrackingArray 54 ) 55 { 56 super(rowCount, deferred, indexesUpdated, tableLock, executeTime, sourceResultSetStatistics); 57 this.dependentTrackingArray = dependentTrackingArray; 58 } 59 60 61 62 64 71 public String getStatementExecutionPlanText(int depth) 72 { 73 74 String dependentInfo = ""; 75 76 initFormatInfo(depth); 77 78 79 if (dependentTrackingArray != null) 80 { 81 boolean foundAttached = false; 82 83 for (int index = 0; index < dependentTrackingArray.length; index++) 84 { 85 if (dependentTrackingArray[index] != null) 86 { 87 88 if (! foundAttached) 89 { 90 dependentInfo = indent + "\n" + 91 MessageService.getTextMessage( 92 SQLState.RTS_REFACTION_DEPENDENT) + 93 ":\n"; 94 foundAttached = true; 95 } 96 dependentInfo = dependentInfo + 97 dependentTrackingArray[index].getStatementExecutionPlanText(sourceDepth); 98 } 99 } 100 } 101 102 return 103 indent + 104 MessageService.getTextMessage(SQLState.RTS_DELETE_CASCADE_RS_USING) + 105 " " + 106 MessageService.getTextMessage( 107 ((tableLock) ? 108 SQLState.RTS_TABLE_LOCKING : SQLState.RTS_ROW_LOCKING)) 109 + ":\n" + 110 indent + MessageService.getTextMessage(SQLState.RTS_DEFERRED) + 111 ": " + deferred + "\n" + 112 indent + 113 MessageService.getTextMessage(SQLState.RTS_ROWS_DELETED) + 114 " = " + rowCount + "\n" + 115 indent + 116 MessageService.getTextMessage(SQLState.RTS_INDEXES_UPDATED) + 117 " = " + indexesUpdated + "\n" + 118 dumpTimeStats(indent) + ((sourceResultSetStatistics == null) ? "" : 119 sourceResultSetStatistics.getStatementExecutionPlanText(1)) + 120 dependentInfo; 121 } 122 123 132 public String getScanStatisticsText(String tableName, int depth) 133 { 134 String dependentInfo = ""; 135 136 137 138 if (dependentTrackingArray != null) 139 { 140 for (int index = 0; index < dependentTrackingArray.length; index++) 141 { 142 if (dependentTrackingArray[index] != null) 143 { 144 dependentInfo = dependentInfo + 145 "\n" + 146 MessageService.getTextMessage( 147 SQLState.RTS_BEGIN_DEPENDENT_NUMBER) + 148 " " + index + "\n" + 149 dependentTrackingArray[index].getScanStatisticsText(tableName, depth) + 150 MessageService.getTextMessage( 151 SQLState.RTS_END_DEPENDENT_NUMBER) + 152 " " + index + "\n\n"; 153 } 154 } 155 } 156 157 return dependentInfo 158 + ((sourceResultSetStatistics == null) ? "" : 159 sourceResultSetStatistics.getScanStatisticsText(tableName, depth)); 160 } 161 162 163 164 168 public String getNodeName(){ 169 return MessageService.getTextMessage(SQLState.RTS_DELETE_CASCADE); 170 } 171 } 172 173 174 175 176 177 178 | Popular Tags |