net.sf.farrago.test
Class FarragoAutoCalcRulesTest.TestDbSessionPersonality

java.lang.Object
  extended by net.sf.farrago.defimpl.FarragoDefaultSessionPersonality
      extended by net.sf.farrago.test.FarragoAutoCalcRulesTest.TestDbSessionPersonality
All Implemented Interfaces:
FarragoSessionPersonality, FarragoStreamFactoryProvider
Enclosing class:
FarragoAutoCalcRulesTest

private static class FarragoAutoCalcRulesTest.TestDbSessionPersonality
extends FarragoDefaultSessionPersonality

TestDbSession extends FarragoDefaultSessionPersonality to provide our custom OJRexImplementor table in place of Farrago's normal implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.farrago.defimpl.FarragoDefaultSessionPersonality
FarragoDefaultSessionPersonality.ParamValidator
 
Field Summary
private  CalcRexImplementorTable calcRexImplementor
           
private  OJRexImplementorTable ojRexImplementor
           
 
Fields inherited from class net.sf.farrago.defimpl.FarragoDefaultSessionPersonality
CACHE_STATEMENTS, CACHE_STATEMENTS_DEFAULT, database, DEGREE_OF_PARALLELISM, DEGREE_OF_PARALLELISM_DEFAULT, LABEL, LABEL_DEFAULT, paramValidator, REDUCE_NON_CORRELATED_SUBQUERIES, REDUCE_NON_CORRELATED_SUBQUERIES_FARRAGO_DEFAULT, SQUEEZE_JDBC_NUMERIC, SQUEEZE_JDBC_NUMERIC_DEFAULT, VALIDATE_DDL_ON_PREPARE, VALIDATE_DDL_ON_PREPARE_DEFAULT
 
Constructor Summary
FarragoAutoCalcRulesTest.TestDbSessionPersonality(FarragoDbSession session, OJRexImplementorTable ojRexImplementor, CalcRexImplementorTable calcRexImplementorTable)
           
 
Method Summary
 OJRexImplementorTable getOJRexImplementorTable(FarragoSessionPreparingStmt preparingStmt)
          Gets the implementation table to use for compiling a statement that uses a Java calculator.
 SqlOperatorTable getSqlOperatorTable(FarragoSessionPreparingStmt preparingStmt)
          Gets the SQL operator table to use for validating a statement.
<C> C
newComponentImpl(Class<C> componentInterface)
          Gets the component associated with the given Class object from the personality.
 FarragoSessionPlanner newPlanner(FarragoSessionPreparingStmt stmt, boolean init)
          Creates a new planner.
 
Methods inherited from class net.sf.farrago.defimpl.FarragoDefaultSessionPersonality
addRowCount, createInheritedSessionVariables, defineDdlHandlers, definePlannerListeners, definePrivileges, getDefaultLocalDataServerName, getRowCounts, getRuntimeContextClass, initPreparingStmt, isAlterTableAddColumnIncremental, isJavaUdxRestartable, isSupportedType, loadDefaultSessionVariables, newDdlValidator, newJmiQueryProcessor, newParser, newPreparingStmt, newPreparingStmt, newPreparingStmt, newRuntimeContext, newTypeFactory, registerRelMetadataProviders, registerStreamFactories, resetRowCounts, shouldReplacePreserveOriginalSql, supportsFeature, updateIndexRoot, updateRowCounts, validateSessionVariable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ojRexImplementor

private OJRexImplementorTable ojRexImplementor

calcRexImplementor

private CalcRexImplementorTable calcRexImplementor
Constructor Detail

FarragoAutoCalcRulesTest.TestDbSessionPersonality

public FarragoAutoCalcRulesTest.TestDbSessionPersonality(FarragoDbSession session,
                                                         OJRexImplementorTable ojRexImplementor,
                                                         CalcRexImplementorTable calcRexImplementorTable)
Method Detail

newPlanner

public FarragoSessionPlanner newPlanner(FarragoSessionPreparingStmt stmt,
                                        boolean init)
Description copied from interface: FarragoSessionPersonality
Creates a new planner.

Specified by:
newPlanner in interface FarragoSessionPersonality
Overrides:
newPlanner in class FarragoDefaultSessionPersonality
Parameters:
stmt - stmt on whose behalf planner will operate
init - whether to initialize default rules in new planner
Returns:
new planner

getSqlOperatorTable

public SqlOperatorTable getSqlOperatorTable(FarragoSessionPreparingStmt preparingStmt)
Description copied from interface: FarragoSessionPersonality
Gets the SQL operator table to use for validating a statement.

Specified by:
getSqlOperatorTable in interface FarragoSessionPersonality
Overrides:
getSqlOperatorTable in class FarragoDefaultSessionPersonality
Parameters:
preparingStmt - statement being prepared
Returns:
table of builtin SQL operators and functions to use for validation; user-defined functions are not included here

getOJRexImplementorTable

public OJRexImplementorTable getOJRexImplementorTable(FarragoSessionPreparingStmt preparingStmt)
Description copied from interface: FarragoSessionPersonality
Gets the implementation table to use for compiling a statement that uses a Java calculator.

Specified by:
getOJRexImplementorTable in interface FarragoSessionPersonality
Overrides:
getOJRexImplementorTable in class FarragoDefaultSessionPersonality
Parameters:
preparingStmt - statement being prepared
Returns:
table of implementations corresponding to result of FarragoSessionPersonality.getSqlOperatorTable(FarragoSessionPreparingStmt)

newComponentImpl

public <C> C newComponentImpl(Class<C> componentInterface)
Description copied from interface: FarragoSessionPersonality
Gets the component associated with the given Class object from the personality. If the personality does not support (or recognize) the component type, it returns null. The returned instance is guaranteed to be of type C or a subclass.

Specified by:
newComponentImpl in interface FarragoSessionPersonality
Overrides:
newComponentImpl in class FarragoDefaultSessionPersonality
Parameters:
componentInterface - the interface desired
Returns:
an implementation of componentInterface or null