|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.impl.sql.compile
Class ActivationClassBuilder

java.lang.Objectorg.apache.derby.impl.sql.compile.ExpressionClassBuilder
org.apache.derby.impl.sql.compile.ActivationClassBuilder
- All Implemented Interfaces:
- org.apache.derby.iapi.sql.compile.ExpressionClassBuilderInterface
- public class ActivationClassBuilder
- extends ExpressionClassBuilder
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, ...
| 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,
org.apache.derby.iapi.sql.compile.CompilerContext cc)
By the time this is done, it has constructed the following class: |
|
| 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. |
org.apache.derby.iapi.services.compiler.MethodBuilder |
beginExecuteMethod()
By the time this is done, it has generated the following code |
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 |
org.apache.derby.iapi.services.compiler.MethodBuilder |
getCloseActivationMethod()
|
protected org.apache.derby.iapi.services.compiler.LocalField |
getCurrentSetup()
|
java.lang.String |
getPackageName()
Get the package name that this generated class lives in |
void |
getParameterReference(java.lang.String name,
int position,
org.apache.derby.iapi.types.DataTypeDescriptor dataType,
org.apache.derby.iapi.services.compiler.MethodBuilder mb)
Generates a parameter reference. |
int |
getRowCount()
Get the number of ExecRows to allocate |
void |
rememberCursor(org.apache.derby.iapi.services.compiler.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(org.apache.derby.iapi.services.compiler.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 |
org.apache.derby.iapi.services.compiler.MethodBuilder |
startResetMethod()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
targetResultSetField
private org.apache.derby.iapi.services.compiler.LocalField targetResultSetField
cursorResultSetField
private org.apache.derby.iapi.services.compiler.LocalField cursorResultSetField
closeActivationMethod
private org.apache.derby.iapi.services.compiler.MethodBuilder closeActivationMethod
| Constructor Detail |
ActivationClassBuilder
public ActivationClassBuilder(java.lang.String superClass, org.apache.derby.iapi.sql.compile.CompilerContext cc) throws org.apache.derby.iapi.error.StandardException
- 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 Detail |
getPackageName
public java.lang.String getPackageName()
- Get the package name that this generated class lives in
- Specified by:
getPackageNamein classExpressionClassBuilder
getBaseClassName
public java.lang.String getBaseClassName()
- The base class for activations is BaseActivation
- Specified by:
getBaseClassNamein classExpressionClassBuilder
getRowCount
public int getRowCount()
throws org.apache.derby.iapi.error.StandardException
- Get the number of ExecRows to allocate
- Specified by:
getRowCountin classExpressionClassBuilder
setNumSubqueries
public void setNumSubqueries()
- Generate the assignment for numSubqueries = x
- Specified by:
setNumSubqueriesin classExpressionClassBuilder
beginExecuteMethod
public org.apache.derby.iapi.services.compiler.MethodBuilder beginExecuteMethod() throws org.apache.derby.iapi.error.StandardException
- By the time this is done, it has generated the following code
public ResultSet execute() throws StandardException { throwIfClosed("execute"); // statements must be added here } }- Specified by:
beginExecuteMethodin classExpressionClassBuilder
startResetMethod
public org.apache.derby.iapi.services.compiler.MethodBuilder startResetMethod()
finishExecuteMethod
public void finishExecuteMethod(boolean genMarkAsTopNode)
- 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
- Specified by:
finishExecuteMethodin classExpressionClassBuilder
addCursorPositionCode
public 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.
The code that is generated is:
public CursorResultSet getTargetResultSet() { return targetResultSet; } public CursorResultSet getCursorResultSet() { return cursorResultSet; }
rememberCursorTarget
public void rememberCursorTarget(org.apache.derby.iapi.services.compiler.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.
The code that is generated is:
The expression that is generated is:private CursorResultSet targetResultSet; (ResultSet) (targetResultSet = (CursorResultSet) #expression#)
rememberCursor
public void rememberCursor(org.apache.derby.iapi.services.compiler.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.
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#)
getCurrentSetup
protected org.apache.derby.iapi.services.compiler.LocalField getCurrentSetup()
- Overrides:
getCurrentSetupin classExpressionClassBuilder
getParameterReference
public void getParameterReference(java.lang.String name, int position, org.apache.derby.iapi.types.DataTypeDescriptor dataType, org.apache.derby.iapi.services.compiler.MethodBuilder mb) throws org.apache.derby.iapi.error.StandardException
- Generates a parameter reference. Only implemented for Filters right now.
- Specified by:
getParameterReferencein classExpressionClassBuilder
getCloseActivationMethod
public org.apache.derby.iapi.services.compiler.MethodBuilder getCloseActivationMethod()
|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC