1 21 22 package org.apache.derby.impl.sql.execute; 23 24 import org.apache.derby.iapi.sql.Activation; 25 26 import org.apache.derby.impl.sql.GenericColumnDescriptor; 27 import org.apache.derby.impl.sql.GenericResultDescription; 28 import org.apache.derby.iapi.services.monitor.ModuleControl; 29 import org.apache.derby.iapi.services.monitor.ModuleSupportable; 30 import org.apache.derby.iapi.services.monitor.Monitor; 31 import org.apache.derby.iapi.services.io.FormatIdUtil; 32 import org.apache.derby.iapi.error.StandardException; 33 import org.apache.derby.iapi.types.DataValueFactory; 34 35 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; 36 import org.apache.derby.iapi.sql.execute.ExecRow; 37 import org.apache.derby.iapi.sql.execute.ExecIndexRow; 38 import org.apache.derby.iapi.sql.execute.ExecutionContext; 39 import org.apache.derby.iapi.sql.execute.ExecutionFactory; 40 import org.apache.derby.iapi.sql.execute.ResultSetFactory; 41 import org.apache.derby.iapi.sql.execute.ResultSetStatisticsFactory; 42 import org.apache.derby.iapi.sql.execute.ScanQualifier; 43 import org.apache.derby.iapi.sql.Activation; 44 import org.apache.derby.iapi.sql.ResultColumnDescriptor; 45 import org.apache.derby.iapi.sql.ResultDescription; 46 47 import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo; 48 import org.apache.derby.iapi.store.access.Qualifier; 49 import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo; 50 import org.apache.derby.iapi.store.access.TransactionController; 51 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator; 52 import org.apache.derby.iapi.sql.execute.RowChanger; 53 import org.apache.derby.iapi.jdbc.ConnectionContext; 54 55 import org.apache.derby.iapi.services.loader.GeneratedMethod; 56 57 import org.apache.derby.iapi.services.context.ContextManager; 58 import org.apache.derby.catalog.UUID; 59 import org.apache.derby.iapi.services.io.FormatableBitSet; 60 import org.apache.derby.iapi.services.io.FormatableArrayHolder; 61 import org.apache.derby.iapi.services.io.FormatableHashtable; 62 import org.apache.derby.iapi.services.io.FormatableIntHolder; 63 import org.apache.derby.iapi.services.io.FormatableProperties; 64 import org.apache.derby.catalog.TypeDescriptor; 65 import java.util.Properties ; 66 import java.util.Vector ; 67 68 76 public class GenericExecutionFactory 77 implements ModuleControl, ModuleSupportable, ExecutionFactory { 78 79 public boolean canSupport(Properties startParams) 83 { 84 return Monitor.isDesiredType( startParams, org.apache.derby.iapi.reference.EngineType.NONE); 85 } 86 87 94 public void boot(boolean create, Properties startParams) 95 throws StandardException 96 { 97 100 104 105 } 108 109 public void stop() { 110 } 111 112 123 public ResultSetFactory getResultSetFactory() 124 { 125 if (rsFactory == null) 126 { 127 rsFactory = new GenericResultSetFactory(); 128 } 129 return rsFactory; 130 } 131 132 137 public GenericConstantActionFactory getConstantActionFactory() 138 { 139 if (genericConstantActionFactory == null) 140 { 141 genericConstantActionFactory = new GenericConstantActionFactory(); 142 } 143 return genericConstantActionFactory; 144 } 145 146 152 public ExecutionContext newExecutionContext(ContextManager cm) 153 { 154 160 return new GenericExecutionContext( 161 (ResultSetFactory) null, 162 cm, this); 163 } 164 165 168 public ScanQualifier[][] getScanQualifier(int numQualifiers) 169 { 170 ScanQualifier[] sqArray = new GenericScanQualifier[numQualifiers]; 171 172 for (int ictr = 0; ictr < numQualifiers; ictr++) 173 { 174 sqArray[ictr] = new GenericScanQualifier(); 175 } 176 177 ScanQualifier[][] ret_sqArray = { sqArray }; 178 179 return(ret_sqArray); 180 } 181 182 185 public ResultDescription getResultDescription( 186 ResultColumnDescriptor[] columns, String statementType) { 187 return new GenericResultDescription(columns, statementType); 188 } 189 190 198 public ResultColumnDescriptor getResultColumnDescriptor(ResultColumnDescriptor compileRCD) 199 { 200 return new GenericColumnDescriptor(compileRCD); 201 } 202 203 206 public void releaseScanQualifier(ScanQualifier[][] qualifiers) 207 { 208 } 209 210 213 public Qualifier getQualifier( 214 int columnId, 215 int operator, 216 GeneratedMethod orderableGetter, 217 Activation activation, 218 boolean orderedNulls, 219 boolean unknownRV, 220 boolean negateCompareResult, 221 int variantType) 222 { 223 return new GenericQualifier(columnId, operator, orderableGetter, 224 activation, orderedNulls, unknownRV, 225 negateCompareResult, variantType); 226 } 227 228 232 public RowChanger 233 getRowChanger(long heapConglom, 234 StaticCompiledOpenConglomInfo heapSCOCI, 235 DynamicCompiledOpenConglomInfo heapDCOCI, 236 IndexRowGenerator[] irgs, 237 long[] indexCIDS, 238 StaticCompiledOpenConglomInfo[] indexSCOCIs, 239 DynamicCompiledOpenConglomInfo[] indexDCOCIs, 240 int numberOfColumns, 241 TransactionController tc, 242 int[] changedColumnIds, 243 int[] streamStorableHeapColIds, 244 Activation activation) throws StandardException 245 { 246 return new RowChangerImpl( heapConglom, 247 heapSCOCI, heapDCOCI, 248 irgs, indexCIDS, indexSCOCIs, indexDCOCIs, 249 numberOfColumns, 250 changedColumnIds, tc, null, 251 streamStorableHeapColIds, activation ); 252 } 253 254 258 public RowChanger getRowChanger( 259 long heapConglom, 260 StaticCompiledOpenConglomInfo heapSCOCI, 261 DynamicCompiledOpenConglomInfo heapDCOCI, 262 IndexRowGenerator[] irgs, 263 long[] indexCIDS, 264 StaticCompiledOpenConglomInfo[] indexSCOCIs, 265 DynamicCompiledOpenConglomInfo[] indexDCOCIs, 266 int numberOfColumns, 267 TransactionController tc, 268 int[] changedColumnIds, 269 FormatableBitSet baseRowReadList, 270 int[] baseRowReadMap, 271 int[] streamStorableColIds, 272 Activation activation 273 ) 274 throws StandardException 275 { 276 return new RowChangerImpl( heapConglom, 277 heapSCOCI, heapDCOCI, 278 irgs, indexCIDS, indexSCOCIs, indexDCOCIs, 279 numberOfColumns, 280 changedColumnIds, tc, baseRowReadList, 281 baseRowReadMap, activation ); 282 } 283 284 285 290 public InternalTriggerExecutionContext getTriggerExecutionContext 291 ( 292 LanguageConnectionContext lcc, 293 ConnectionContext cc, 294 String statementText, 295 int dmlType, 296 int[] changedColIds, 297 String [] changedColNames, 298 UUID targetTableId, 299 String targetTableName, 300 Vector aiCounters 301 ) throws StandardException 302 { 303 return new InternalTriggerExecutionContext(lcc, cc, 304 statementText, dmlType, 305 changedColIds, 306 changedColNames, 307 targetTableId, 308 targetTableName, 309 aiCounters); 310 } 311 312 315 316 public ExecRow getValueRow(int numColumns) { 317 return new ValueRow(numColumns); 318 } 319 320 public ExecIndexRow getIndexableRow(int numColumns) { 321 return new IndexRow(numColumns); 322 } 323 324 public ExecIndexRow getIndexableRow(ExecRow valueRow) { 325 if (valueRow instanceof ExecIndexRow) 326 return (ExecIndexRow)valueRow; 327 return new IndexValueRow(valueRow); 328 } 329 330 334 public Object getJdbcCopyConstants 335 ( 336 int[][] paramReferences, 337 TypeDescriptor[][] columnTypes, 338 int[][] publishedTableSchemaCounts 339 ) 340 { return null; } 341 342 346 public Object getJdbcCreateConstants 347 ( 348 UUID[] publishedJarFileIDs, 349 Object publishedItems, 350 int[][] tableSchemaCounts 351 ) 352 { return null; } 353 354 public GenericExecutionFactory() { 358 } 359 360 public ResultSetFactory rsFactory; 364 protected GenericConstantActionFactory genericConstantActionFactory; 365 } 366 | Popular Tags |