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.Optimizable; 27 import org.apache.derby.iapi.sql.compile.OptimizableList; 28 import org.apache.derby.iapi.sql.compile.OptimizablePredicate; 29 import org.apache.derby.iapi.sql.compile.OptimizablePredicateList; 30 import org.apache.derby.iapi.sql.compile.Optimizer; 31 import org.apache.derby.iapi.sql.compile.Visitable; 32 import org.apache.derby.iapi.sql.compile.Visitor; 33 import org.apache.derby.iapi.sql.compile.RequiredRowOrdering; 34 35 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 36 37 import org.apache.derby.iapi.sql.Activation; 38 import org.apache.derby.iapi.sql.ResultSet; 39 40 import org.apache.derby.iapi.error.StandardException; 41 42 import org.apache.derby.impl.sql.compile.ActivationClassBuilder; 43 44 import org.apache.derby.iapi.services.compiler.MethodBuilder; 45 46 import org.apache.derby.iapi.services.sanity.SanityManager; 47 import org.apache.derby.iapi.reference.ClassName; 48 49 import org.apache.derby.iapi.services.classfile.VMOpcode; 50 51 import java.util.Properties ; 52 53 59 60 public class MaterializeResultSetNode extends SingleChildResultSetNode 61 { 62 69 70 public void init(Object childResult, 71 Object rcl, 72 Object tableProperties) 73 { 74 super.init(childResult, tableProperties); 75 resultColumns = (ResultColumnList) rcl; 76 } 77 78 84 85 public void printSubNodes(int depth) 86 { 87 if (SanityManager.DEBUG) 88 { 89 super.printSubNodes(depth); 90 } 91 } 92 93 98 public void generate(ActivationClassBuilder acb, 99 MethodBuilder mb) 100 throws StandardException 101 { 102 if (SanityManager.DEBUG) 103 SanityManager.ASSERT(resultColumns != null, "Tree structure bad"); 104 105 108 assignResultSetNumber(); 109 110 costEstimate = childResult.getFinalCostEstimate(); 112 113 115 acb.pushGetResultSetFactoryExpression(mb); 117 118 childResult.generate(acb, mb); 119 mb.push(resultSetNumber); 120 mb.push(costEstimate.rowCount()); 121 mb.push(costEstimate.getEstimatedCost()); 122 123 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "getMaterializedResultSet", 124 ClassName.NoPutResultSet, 4); 125 } 126 } 127 | Popular Tags |