1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 25 import org.apache.derby.iapi.types.TypeId; 26 import org.apache.derby.iapi.types.DataValueDescriptor; 27 import org.apache.derby.iapi.types.DataTypeDescriptor; 28 import org.apache.derby.iapi.types.RefDataValue; 29 import org.apache.derby.iapi.types.RowLocation; 30 import org.apache.derby.iapi.sql.execute.CursorResultSet; 31 32 import org.apache.derby.iapi.services.compiler.ClassBuilder; 33 import org.apache.derby.iapi.services.compiler.MethodBuilder; 34 import org.apache.derby.iapi.services.compiler.LocalField; 35 36 37 import org.apache.derby.impl.sql.compile.ExpressionClassBuilder; 38 39 import java.lang.reflect.Modifier ; 40 import org.apache.derby.iapi.reference.ClassName; 41 42 import org.apache.derby.iapi.services.classfile.VMOpcode; 43 44 import org.apache.derby.iapi.error.StandardException; 45 46 import org.apache.derby.catalog.TypeDescriptor; 47 48 import java.util.Vector ; 49 50 56 57 public class CurrentRowLocationNode extends ValueNode 58 { 59 72 73 public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, 74 Vector aggregateVector) 75 throws StandardException 76 { 77 setType(new DataTypeDescriptor(TypeId.getBuiltInTypeId(TypeId.REF_NAME), 78 false 79 ) 80 ); 81 return this; 82 } 83 84 121 public void generateExpression(ExpressionClassBuilder acb, 122 MethodBuilder mbex) 123 throws StandardException 124 { 125 126 127 MethodBuilder mb = acb.newGeneratedFun(ClassName.DataValueDescriptor, Modifier.PROTECTED); 128 129 130 LocalField field = 131 acb.newFieldDeclaration(Modifier.PRIVATE, ClassName.RefDataValue); 132 133 134 139 140 mb.pushThis(); 141 mb.getField((String )null, acb.getRowLocationScanResultSetName(), ClassName.CursorResultSet); 142 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "getRowLocation", ClassName.RowLocation, 0); 143 144 145 acb.generateDataValue(mb, getTypeCompiler(), field); 146 147 151 mb.putField(field); 152 153 156 mb.methodReturn(); 157 158 mb.complete(); 160 161 162 mbex.pushThis(); 163 mbex.callMethod(VMOpcode.INVOKEVIRTUAL, (String ) null, mb.getName(), ClassName.DataValueDescriptor, 0); 164 } 165 166 protected boolean isEquivalent(ValueNode o) 167 { 168 return false; 169 } 170 } 171 | Popular Tags |