|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.ExpressionClassBuilder
org.apache.derby.impl.sql.compile.ActivationClassBuilder
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, ...
Field Summary | |
private MethodBuilder |
closeActivationMethod
|
private LocalField |
cursorResultSetField
|
private LocalField |
targetResultSetField
|
Fields inherited from class org.apache.derby.impl.sql.compile.ExpressionClassBuilder |
cb, cdtField, constructor, currentDatetimeFieldName, executeMethod, gc, myCompCtx, nextExprNum, nextFieldNum, nextNonFastExpr, resultSetClosedMethod |
Constructor Summary | |
ActivationClassBuilder(java.lang.String superClass,
CompilerContext cc)
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(); } } |
Method Summary | |
void |
addCursorPositionCode()
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. |
MethodBuilder |
beginExecuteMethod()
By the time this is done, it has generated the following code public ResultSet execute() throws StandardException { throwIfClosed("execute"); // statements must be added here } } |
void |
finishExecuteMethod(boolean genMarkAsTopNode)
An execute method always ends in a return statement, returning the result set that has been constructed. |
java.lang.String |
getBaseClassName()
The base class for activations is BaseActivation |
MethodBuilder |
getCloseActivationMethod()
|
protected LocalField |
getCurrentSetup()
|
java.lang.String |
getPackageName()
Get the package name that this generated class lives in |
void |
getParameterReference(java.lang.String name,
int position,
DataTypeDescriptor dataType,
MethodBuilder mb)
Generates a parameter reference. |
int |
getRowCount()
Get the number of ExecRows to allocate |
void |
rememberCursor(MethodBuilder mb)
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. |
void |
rememberCursorTarget(MethodBuilder mb)
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. |
void |
setNumSubqueries()
Generate the assignment for numSubqueries = x |
MethodBuilder |
startResetMethod()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private LocalField targetResultSetField
private LocalField cursorResultSetField
private MethodBuilder closeActivationMethod
Constructor Detail |
public ActivationClassBuilder(java.lang.String superClass, CompilerContext cc) throws StandardException
public class #className extends #superClass { // public void reset() { return; } public ResultSet execute() throws StandardException { throwIfClosed("execute"); // statements must be added here } public #className() { super(); } }
StandardException
- thrown on failureMethod Detail |
public java.lang.String getPackageName()
getPackageName
in class ExpressionClassBuilder
public java.lang.String getBaseClassName()
getBaseClassName
in class ExpressionClassBuilder
public int getRowCount() throws StandardException
getRowCount
in class ExpressionClassBuilder
StandardException
- thrown on failurepublic void setNumSubqueries()
setNumSubqueries
in class ExpressionClassBuilder
StandardException
- thrown on failurepublic MethodBuilder beginExecuteMethod() throws StandardException
public ResultSet execute() throws StandardException { throwIfClosed("execute"); // statements must be added here } }
beginExecuteMethod
in class ExpressionClassBuilder
StandardException
- thrown on failurepublic MethodBuilder startResetMethod()
public void finishExecuteMethod(boolean genMarkAsTopNode)
finishExecuteMethod
in class ExpressionClassBuilder
public void addCursorPositionCode()
The code that is generated is:
public CursorResultSet getTargetResultSet() { return targetResultSet; } public CursorResultSet getCursorResultSet() { return cursorResultSet; }
public void rememberCursorTarget(MethodBuilder mb)
The code that is generated is:
The expression that is generated is:private CursorResultSet targetResultSet;
(ResultSet) (targetResultSet = (CursorResultSet) #expression#)
public void rememberCursor(MethodBuilder mb)
The code that is generated is:
The expression that is generated is:private CursorResultSet cursorResultSet;
The expression must be the top stack word when this method is called.(ResultSet) (cursorResultSet = (CursorResultSet) #expression#)
protected LocalField getCurrentSetup()
getCurrentSetup
in class ExpressionClassBuilder
public void getParameterReference(java.lang.String name, int position, DataTypeDescriptor dataType, MethodBuilder mb) throws StandardException
getParameterReference
in class ExpressionClassBuilder
name
- Parameter name.position
- Parameter id.dataType
- Parameter datatype.mb
- The method to put the generated code into
StandardException
- thrown on failurepublic MethodBuilder getCloseActivationMethod()
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |