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.iapi.sql.compile.CostEstimate; 27 import org.apache.derby.iapi.sql.compile.Optimizable; 28 import org.apache.derby.iapi.sql.compile.OptimizableList; 29 import org.apache.derby.iapi.sql.compile.OptimizablePredicate; 30 import org.apache.derby.iapi.sql.compile.OptimizablePredicateList; 31 import org.apache.derby.iapi.sql.compile.Optimizer; 32 import org.apache.derby.iapi.sql.compile.Visitable; 33 import org.apache.derby.iapi.sql.compile.Visitor; 34 import org.apache.derby.iapi.sql.compile.RequiredRowOrdering; 35 36 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 37 import org.apache.derby.iapi.reference.ClassName; 38 39 import org.apache.derby.iapi.sql.Activation; 40 import org.apache.derby.iapi.sql.ResultSet; 41 42 import org.apache.derby.iapi.error.StandardException; 43 44 import org.apache.derby.impl.sql.compile.ActivationClassBuilder; 45 46 import org.apache.derby.iapi.services.compiler.MethodBuilder; 47 48 import org.apache.derby.iapi.services.sanity.SanityManager; 49 50 import org.apache.derby.iapi.util.JBitSet; 51 import org.apache.derby.iapi.services.classfile.VMOpcode; 52 53 import java.util.Properties ; 54 55 61 62 public class NormalizeResultSetNode extends SingleChildResultSetNode 63 { 64 70 private boolean forUpdate; 71 72 81 82 public void init( 83 Object childResult, 84 Object rcl, 85 Object tableProperties, 86 Object forUpdate) 87 { 88 super.init(childResult, tableProperties); 89 resultColumns = (ResultColumnList) rcl; 90 this.forUpdate = ((Boolean )forUpdate).booleanValue(); 91 } 92 93 94 99 public void generate(ActivationClassBuilder acb, 100 MethodBuilder mb) 101 throws StandardException 102 { 103 int erdNumber; 104 105 if (SanityManager.DEBUG) 106 SanityManager.ASSERT(resultColumns != null, "Tree structure bad"); 107 108 111 assignResultSetNumber(); 112 113 115 117 costEstimate = childResult.getFinalCostEstimate(); 119 120 erdNumber = acb.addItem(makeResultDescription()); 121 122 acb.pushGetResultSetFactoryExpression(mb); 123 childResult.generate(acb, mb); 124 mb.push(resultSetNumber); 125 mb.push(erdNumber); 126 mb.push(costEstimate.rowCount()); 127 mb.push(costEstimate.getEstimatedCost()); 128 mb.push(forUpdate); 129 130 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "getNormalizeResultSet", 131 ClassName.NoPutResultSet, 6); 132 } 133 134 138 public void setRefActionInfo(long fkIndexConglomId, 139 int[]fkColArray, 140 String parentResultSetId, 141 boolean dependentScan) 142 { 143 childResult.setRefActionInfo(fkIndexConglomId, 144 fkColArray, 145 parentResultSetId, 146 dependentScan); 147 } 148 149 150 } 151 | Popular Tags |