Package mondrian.rolap
Class RolapNativeSet.SetConstraint
- java.lang.Object
-
- mondrian.rolap.SqlContextConstraint
-
- mondrian.rolap.RolapNativeSet.SetConstraint
-
- All Implemented Interfaces:
MemberChildrenConstraint
,SqlConstraint
,TupleConstraint
- Enclosing class:
- RolapNativeSet
protected abstract static class RolapNativeSet.SetConstraint extends SqlContextConstraint
Constraint for non empty {crossjoin, member.children, member.descendants, level.members}
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar)
Called from LevelMembers: restricts the SQL resultset to the current context.protected boolean
canApplyCrossJoinArgConstraint(CrossJoinArg arg)
If the cross join argument has calculated members in its enumerated set, ignore the constraint since we won't produce that set through the native sql and instead will simply enumerate through the members in the setObject
getCacheKey()
returns a key to cache the resultMemberChildrenConstraint
getMemberChildrenConstraint(RolapMember parent)
Returns null to prevent the member/childern from being cached.protected boolean
isJoinRequired()
Returns whether a join with the fact table is required.-
Methods inherited from class mondrian.rolap.SqlContextConstraint
addLevelConstraint, addMemberConstraint, addMemberConstraint, getEvaluator, isValidContext, isValidContext, supportsAggTables
-
-
-
-
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.
- Overrides:
isJoinRequired
in classSqlContextConstraint
-
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 interfaceTupleConstraint
- Overrides:
addConstraint
in classSqlContextConstraint
- Parameters:
sqlQuery
- the query to modifybaseCube
- base cube for virtual cube constraintsaggStar
- aggregate star to use
-
canApplyCrossJoinArgConstraint
protected boolean canApplyCrossJoinArgConstraint(CrossJoinArg arg)
If the cross join argument has calculated members in its enumerated set, ignore the constraint since we won't produce that set through the native sql and instead will simply enumerate through the members in the set
-
getMemberChildrenConstraint
public MemberChildrenConstraint getMemberChildrenConstraint(RolapMember parent)
Returns null to prevent the member/childern from being cached. There exists no valid MemberChildrenConstraint that would fetch those children that were extracted as a side effect from evaluating a non empty crossjoin- Specified by:
getMemberChildrenConstraint
in interfaceTupleConstraint
- Overrides:
getMemberChildrenConstraint
in classSqlContextConstraint
-
getCacheKey
public Object getCacheKey()
returns a key to cache the result- Specified by:
getCacheKey
in interfaceSqlConstraint
- Overrides:
getCacheKey
in classSqlContextConstraint
- Returns:
- valid key or null to prevent the result from being cached
-
-