mondrian.rolap
Class RolapNativeFilter.FilterConstraint

java.lang.Object
  extended by mondrian.rolap.SqlContextConstraint
      extended by mondrian.rolap.RolapNativeSet.SetConstraint
          extended by mondrian.rolap.RolapNativeFilter.FilterConstraint
All Implemented Interfaces:
MemberChildrenConstraint, SqlConstraint, TupleConstraint
Enclosing class:
RolapNativeFilter

static class RolapNativeFilter.FilterConstraint
extends RolapNativeSet.SetConstraint


Field Summary
(package private)  Exp filterExpr
           
 
Fields inherited from class mondrian.rolap.RolapNativeSet.SetConstraint
args
 
Fields inherited from class mondrian.rolap.SqlContextConstraint
cacheKey
 
Constructor Summary
RolapNativeFilter.FilterConstraint(RolapNativeSet.CrossJoinArg[] args, RolapEvaluator evaluator, Exp filterExpr)
           
 
Method Summary
 void addConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar)
          Called from LevelMembers: restricts the SQL resultset to the current context.
 Object getCacheKey()
          returns a key to cache the result
protected  boolean isJoinRequired()
          Returns whether a join with the fact table is required.
 
Methods inherited from class mondrian.rolap.RolapNativeSet.SetConstraint
getMemberChildrenConstraint
 
Methods inherited from class mondrian.rolap.SqlContextConstraint
addLevelConstraint, addMemberConstraint, addMemberConstraint, getEvaluator, isValidContext, isValidContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filterExpr

Exp filterExpr
Constructor Detail

RolapNativeFilter.FilterConstraint

public RolapNativeFilter.FilterConstraint(RolapNativeSet.CrossJoinArg[] args,
                                          RolapEvaluator evaluator,
                                          Exp filterExpr)
Method Detail

isJoinRequired

protected boolean isJoinRequired()
Returns whether a join with the fact table is required. A join is required if the context contains members from dimensions other than level. If we are interested in the members of a level or a members children then it does not make sense to join only one dimension (the one that contains the requested members) with the fact table for NON EMPTY optimization.

If there is a crossjoin, we need to join the fact table - even if the evaluator context is empty.

A FilterConstraint always needs to join the fact table because we want to evaluate the filter expression against a fact.

Overrides:
isJoinRequired in class RolapNativeSet.SetConstraint

addConstraint

public void addConstraint(SqlQuery sqlQuery,
                          RolapCube baseCube,
                          AggStar aggStar)
Description copied from class: SqlContextConstraint
Called from LevelMembers: restricts the SQL resultset to the current context.

Specified by:
addConstraint in interface TupleConstraint
Overrides:
addConstraint in class RolapNativeSet.SetConstraint
Parameters:
sqlQuery - the query to modify
baseCube - base cube for virtual cube constraints
aggStar - aggregate star to use

getCacheKey

public Object getCacheKey()
Description copied from class: RolapNativeSet.SetConstraint
returns a key to cache the result

Specified by:
getCacheKey in interface SqlConstraint
Overrides:
getCacheKey in class RolapNativeSet.SetConstraint
Returns:
valid key or null to prevent the result from being cached

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads