net.sf.farrago.ojrex
Class FarragoOJRexStaticMethodImplementor

java.lang.Object
  extended by net.sf.farrago.ojrex.FarragoOJRexImplementor
      extended by net.sf.farrago.ojrex.FarragoOJRexStaticMethodImplementor
All Implemented Interfaces:
OJRexImplementor

public class FarragoOJRexStaticMethodImplementor
extends FarragoOJRexImplementor

FarragoOJRexStaticMethodImplementor implements OJRexImplementor by generating a call to a static Java method.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/ojrex/FarragoOJRexStaticMethodImplementor.java#15 $
Author:
John V. Sichi

Field Summary
private  boolean allowSql
           
private  Class declaringClass
           
private  Method method
           
private  String methodName
           
private  RelDataType returnType
           
 
Constructor Summary
FarragoOJRexStaticMethodImplementor(Class declaringClass, String methodName)
          Creates an implementor for a call to a system-provided static method.
FarragoOJRexStaticMethodImplementor(Method method, boolean allowSql, RelDataType returnType)
          Creates an implementor for a call to a user-defined routine (UDR) implemented as an external Java static method.
 
Method Summary
 Expression implementFarrago(FarragoRexToOJTranslator translator, RexCall call, Expression[] operands)
          Refined version of OJRexImplementor.implement(org.eigenbase.oj.rex.RexToOJTranslator, org.eigenbase.rex.RexCall, openjava.ptree.Expression[]).
private  Expression implementSystemCall(FarragoRexToOJTranslator translator, RexCall call, Expression[] operands)
           
 
Methods inherited from class net.sf.farrago.ojrex.FarragoOJRexImplementor
canImplement, implement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

method

private final Method method

allowSql

private final boolean allowSql

returnType

private final RelDataType returnType

declaringClass

private final Class declaringClass

methodName

private final String methodName
Constructor Detail

FarragoOJRexStaticMethodImplementor

public FarragoOJRexStaticMethodImplementor(Method method,
                                           boolean allowSql,
                                           RelDataType returnType)
Creates an implementor for a call to a user-defined routine (UDR) implemented as an external Java static method.

Parameters:
method - UDR implementation
allowSql - whether to allow reentrant invocation of SQL from within the called method
returnType - SQL type to impose on returned Java value

FarragoOJRexStaticMethodImplementor

public FarragoOJRexStaticMethodImplementor(Class declaringClass,
                                           String methodName)
Creates an implementor for a call to a system-provided static method.

Parameters:
declaringClass - class which declares method
methodName - name of static method; overload resolution happens implicitly based on operand types in each invocation
Method Detail

implementFarrago

public Expression implementFarrago(FarragoRexToOJTranslator translator,
                                   RexCall call,
                                   Expression[] operands)
Description copied from class: FarragoOJRexImplementor
Refined version of OJRexImplementor.implement(org.eigenbase.oj.rex.RexToOJTranslator, org.eigenbase.rex.RexCall, openjava.ptree.Expression[]).

Specified by:
implementFarrago in class FarragoOJRexImplementor
Parameters:
translator - provides Farrago-specific translation context
call - the call to be translated
operands - call's operands, which have already been translated independently

implementSystemCall

private Expression implementSystemCall(FarragoRexToOJTranslator translator,
                                       RexCall call,
                                       Expression[] operands)