net.sf.farrago.query
Class FarragoUserDefinedRoutineLookup

java.lang.Object
  extended by net.sf.farrago.query.FarragoUserDefinedRoutineLookup
All Implemented Interfaces:
SqlOperatorTable

public class FarragoUserDefinedRoutineLookup
extends Object
implements SqlOperatorTable

FarragoUserDefinedRoutineLookup implements the SqlOperatorTable interface by looking up user-defined functions from the repository.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/query/FarragoUserDefinedRoutineLookup.java#20 $
Author:
John V. Sichi

Field Summary
private  FarragoPreparingStmt preparingStmt
           
private  FarragoSessionStmtValidator stmtValidator
           
private  FemRoutine validatingRoutine
           
 
Constructor Summary
FarragoUserDefinedRoutineLookup(FarragoSessionStmtValidator stmtValidator, FarragoPreparingStmt preparingStmt, FemRoutine validatingRoutine)
           
 
Method Summary
 FarragoUserDefinedRoutine convertRoutine(FemRoutine femRoutine)
          Converts the validated catalog definition of a routine into SqlFunction representation.
 List<SqlOperator> getOperatorList()
          Retrieves a list of all functions and operators in this table.
 List<SqlOperator> lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax)
          Retrieves a list of operators with a given name and syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stmtValidator

private final FarragoSessionStmtValidator stmtValidator

preparingStmt

private final FarragoPreparingStmt preparingStmt

validatingRoutine

private final FemRoutine validatingRoutine
Constructor Detail

FarragoUserDefinedRoutineLookup

public FarragoUserDefinedRoutineLookup(FarragoSessionStmtValidator stmtValidator,
                                       FarragoPreparingStmt preparingStmt,
                                       FemRoutine validatingRoutine)
Method Detail

lookupOperatorOverloads

public List<SqlOperator> lookupOperatorOverloads(SqlIdentifier opName,
                                                 SqlFunctionCategory category,
                                                 SqlSyntax syntax)
Description copied from interface: SqlOperatorTable
Retrieves a list of operators with a given name and syntax. For example, by passing SqlSyntax.Function, the returned list is narrowed to only matching SqlFunction objects.

Specified by:
lookupOperatorOverloads in interface SqlOperatorTable
Parameters:
opName - name of operator
category - function category to look up, or null for any matching operator
syntax - syntax type of operator
Returns:
mutable list of SqlOperator objects (or immutable empty list if no matches)

getOperatorList

public List<SqlOperator> getOperatorList()
Description copied from interface: SqlOperatorTable
Retrieves a list of all functions and operators in this table. Used for automated testing.

Specified by:
getOperatorList in interface SqlOperatorTable
Returns:
list of SqlOperator objects

convertRoutine

public FarragoUserDefinedRoutine convertRoutine(FemRoutine femRoutine)
Converts the validated catalog definition of a routine into SqlFunction representation.

Parameters:
femRoutine - catalog definition
Returns:
converted function