else
{
// this sets up the method and the static field.
// generates:
// Object userExprFun { }
MethodBuilder userExprFun = acb.newUserExprFun();
// restriction knows it is returning its value;
/* generates:
* return <restriction.generate(acb)>;
* and adds it to userExprFun
* NOTE: The explicit cast to DataValueDescriptor is required
* since the restriction may simply be a boolean column or subquery
* which returns a boolean. For example:
* where booleanColumn
*/
restriction.generateExpression(acb, userExprFun);
userExprFun.methodReturn();
// we are done modifying userExprFun, complete it.
userExprFun.complete();
// restriction is used in the final result set as an access of the new static
// field holding a reference to this new method.
// generates:
// ActivationClass.userExprFun
// which is the static field that "points" to the userExprFun
// that evaluates the where clause.
acb.pushMethodReference(mb, userExprFun);
}
/* Determine whether or not reflection is needed for the projection.
* Reflection is not needed if all of the columns map directly to source
* columns.
*/
if (reflectionNeededForProjection())
{
// for the resultColumns, we generate a userExprFun
// that creates a new row from expressions against
// the current row of the child's result.
// (Generate optimization: see if we can simply
// return the current row -- we could, but don't, optimize
// the function call out and have execution understand
// that a null function pointer means take the current row
// as-is, with the performance trade-off as discussed above.)
/* Generate the Row function for the projection */
resultColumns.generateCore(acb, mb, false);
}
else
{
mb.pushNull(ClassName.GeneratedMethod);
}
mb.push(resultSetNumber);
// if there is no constant restriction, we just want to pass null.
if (constantRestriction == null)
{
mb.pushNull(ClassName.GeneratedMethod);
}
else
{
// this sets up the method and the static field.
// generates:
// userExprFun { }
MethodBuilder userExprFun = acb.newUserExprFun();
// restriction knows it is returning its value;
/* generates:
* return <restriction.generate(acb)>;
* and adds it to userExprFun
* NOTE: The explicit cast to DataValueDescriptor is required
* since the restriction may simply be a boolean column or subquery
* which returns a boolean. For example:
* where booleanColumn
*/
constantRestriction.generateExpression(acb, userExprFun);
userExprFun.methodReturn();
// we are done modifying userExprFun, complete it.
userExprFun.complete();
// restriction is used in the final result set as an access
// of the new static field holding a reference to this new method.
// generates:
// ActivationClass.userExprFun