| java.lang.Object org.apache.derby.impl.sql.compile.ExpressionClassBuilder org.apache.derby.impl.sql.compile.ActivationClassBuilder
ActivationClassBuilder | class ActivationClassBuilder extends ExpressionClassBuilder (Code) | | ActivationClassBuilder
provides an interface to satisfy generation's
common tasks in building an activation class,
as well as a repository for the JavaFactory used
to generate the basic language constructs for the methods in the class.
Common tasks include the setting of a static field for each
expression function that gets added, the creation
of the execute method that gets expanded as the query tree
is walked, setting the superclass.
An activation class is defined for each statement. It has
the following basic layout: TBD
See the document
\\Jeeves\Unversioned Repository 1\Internal Technical Documents\Other\GenAndExec.doc
for details.
We could also verify methods as they are
added, to have 0 parameters, ...
author: ames |
ActivationClassBuilder | ActivationClassBuilder(String superClass, CompilerContext cc) throws StandardException(Code) | | By the time this is done, it has constructed the following class:
public class #className extends #superClass {
// public void reset() { return; }
public ResultSet execute() throws StandardException {
throwIfClosed("execute");
// statements must be added here
}
public #className() { super(); }
}
exception: StandardException - thrown on failure |
addCursorPositionCode | void addCursorPositionCode()(Code) | | Updatable cursors
need to add a getter method for use in BaseActivation to access
the result set that identifies target rows for a positioned
update or delete.
The code that is generated is:
public CursorResultSet getTargetResultSet() {
return targetResultSet;
}
public CursorResultSet getCursorResultSet() {
return cursorResultSet;
}
|
beginExecuteMethod | public MethodBuilder beginExecuteMethod() throws StandardException(Code) | | By the time this is done, it has generated the following code
public ResultSet execute() throws StandardException {
throwIfClosed("execute");
// statements must be added here
}
}
exception: StandardException - thrown on failure |
finishExecuteMethod | void finishExecuteMethod(boolean genMarkAsTopNode)(Code) | | An execute method always ends in a return statement, returning
the result set that has been constructed. We want to
do some bookkeeping on that statement, so we generate
the return given the result set.
Upon entry the only word on the stack is the result set expression
|
getBaseClassName | String getBaseClassName()(Code) | | The base class for activations is BaseActivation
|
getPackageName | public String getPackageName()(Code) | | Get the package name that this generated class lives in
package name |
rememberCursor | void rememberCursor(MethodBuilder mb)(Code) | | Updatable cursors
need to add a field and its initialization
for use in BaseActivation to access the result set that
identifies cursor result rows for a positioned update or delete.
The code that is generated is:
private CursorResultSet cursorResultSet;
The expression that is generated is:
(ResultSet) (cursorResultSet = (CursorResultSet) #expression#)
The expression must be the top stack word when this method is called.
|
rememberCursorTarget | void rememberCursorTarget(MethodBuilder mb)(Code) | | Updatable cursors
need to add a field and its initialization
for use in BaseActivation to access the result set that
identifies target rows for a positioned update or delete.
The code that is generated is:
private CursorResultSet targetResultSet;
The expression that is generated is:
(ResultSet) (targetResultSet = (CursorResultSet) #expression#)
|
setNumSubqueries | public void setNumSubqueries()(Code) | | Generate the assignment for numSubqueries = x
exception: StandardException - thrown on failure |
Methods inherited from org.apache.derby.impl.sql.compile.ExpressionClassBuilder | FormatableArrayHolder addColumnToOrdering(FormatableArrayHolder orderingHolder, int columnNum)(Code)(Java Doc) int addItem(Object o)(Code)(Java Doc) abstract MethodBuilder beginExecuteMethod() throws StandardException(Code)(Java Doc) void finishConstructor() throws StandardException(Code)(Java Doc) abstract void finishExecuteMethod(boolean genMarkAsTopNode) throws StandardException(Code)(Java Doc) void generateDataValue(MethodBuilder mb, TypeCompiler tc, LocalField field)(Code)(Java Doc) void generateNull(MethodBuilder mb, TypeCompiler tc)(Code)(Java Doc) void generateNullWithExpress(MethodBuilder mb, TypeCompiler tc)(Code)(Java Doc) abstract String getBaseClassName()(Code)(Java Doc) ClassBuilder getClassBuilder()(Code)(Java Doc) FormatableArrayHolder getColumnOrdering(ResultColumnList rclist)(Code)(Java Doc) FormatableArrayHolder getColumnOrdering(OrderedColumnList oclist)(Code)(Java Doc) MethodBuilder getConstructor()(Code)(Java Doc) void getCurrentDateExpression(MethodBuilder mb)(Code)(Java Doc) protected LocalField getCurrentSetup()(Code)(Java Doc) void getCurrentTimeExpression(MethodBuilder mb)(Code)(Java Doc) void getCurrentTimestampExpression(MethodBuilder mb)(Code)(Java Doc) MethodBuilder getExecuteMethod()(Code)(Java Doc) GeneratedClass getGeneratedClass(ByteArray savedBytes) throws StandardException(Code)(Java Doc) abstract String getPackageName()(Code)(Java Doc) abstract int getRowCount() throws StandardException(Code)(Java Doc) String getRowLocationScanResultSetName()(Code)(Java Doc) protected TypeCompiler getTypeCompiler(TypeId typeId)(Code)(Java Doc) MethodBuilder newExprFun()(Code)(Java Doc) LocalField newFieldDeclaration(int modifiers, String type, String name)(Code)(Java Doc) LocalField newFieldDeclaration(int modifiers, String type)(Code)(Java Doc) MethodBuilder newGeneratedFun(String returnType, int modifiers)(Code)(Java Doc) MethodBuilder newGeneratedFun(String returnType, int modifiers, String[] params)(Code)(Java Doc) String newRowLocationScanResultSetName()(Code)(Java Doc) MethodBuilder newUserExprFun()(Code)(Java Doc) void pushColumnReference(MethodBuilder mb, int rsNumber, int colId)(Code)(Java Doc) void pushDataValueFactory(MethodBuilder mb)(Code)(Java Doc) void pushGetExecutionFactoryExpression(MethodBuilder mb)(Code)(Java Doc) void pushGetResultSetFactoryExpression(MethodBuilder mb)(Code)(Java Doc) void pushMethodReference(MethodBuilder mb, MethodBuilder exprMethod)(Code)(Java Doc) void pushPVSReference(MethodBuilder mb)(Code)(Java Doc) void pushThisAsActivation(MethodBuilder mb)(Code)(Java Doc) abstract void setNumSubqueries() throws StandardException(Code)(Java Doc)
|
|
|