mondrian.rolap.sql
Interface TupleConstraint

All Superinterfaces:
SqlConstraint
All Known Implementing Classes:
DefaultTupleConstraint, DescendantsConstraint, RolapNativeCrossJoin.NonEmptyCrossJoinConstraint, RolapNativeFilter.FilterConstraint, RolapNativeSet.SetConstraint, RolapNativeTopCount.TopCountConstraint, SqlContextConstraint

public interface TupleConstraint
extends SqlConstraint

Restricts the SQL result of TupleReader. This is also used by SqlMemberSource.getMembersInLevel(RolapLevel, int, int, TupleConstraint).

Author:
av
See Also:
TupleReader, SqlMemberSource
 

Method Summary
 void addConstraint(SqlQuery sqlQuery, RolapCube baseCube)
          Modifies a Level.Members query.
 void addLevelConstraint(SqlQuery query, RolapCube baseCube, AggStar aggStar, RolapLevel level)
          Will be called multiple times for every "group by" level in Level.Members query, i.e.
 Evaluator getEvaluator()
           
 MemberChildrenConstraint getMemberChildrenConstraint(RolapMember parent)
          When the members of a level are fetched, the result is grouped by into parents and their children.
 
Methods inherited from interface mondrian.rolap.sql.SqlConstraint
getCacheKey
 

Method Detail

addConstraint

void addConstraint(SqlQuery sqlQuery,
                   RolapCube baseCube)
Modifies a Level.Members query.

Parameters:
sqlQuery - the query to modify
baseCube - base cube for virtual cube constraints

addLevelConstraint

void addLevelConstraint(SqlQuery query,
                        RolapCube baseCube,
                        AggStar aggStar,
                        RolapLevel level)
Will be called multiple times for every "group by" level in Level.Members query, i.e. the level that contains the members and all parent levels except All. If the condition requires so, it may join the levels table to the fact table.

Parameters:
query - the query to modify
baseCube - base cube for virtual cube constraints
aggStar - Aggregate table, or null if query is against fact table
level - the level which is accessed in the Level.Members query

getMemberChildrenConstraint

MemberChildrenConstraint getMemberChildrenConstraint(RolapMember parent)
When the members of a level are fetched, the result is grouped by into parents and their children. These parent/children are stored in the parent/children cache, whose key consists of the parent and the MemberChildrenConstraint#hashKey(). So we need a matching MemberChildrenConstraint to store the parent with its children into the parent/children cache.

The returned MemberChildrenConstraint must be one that would have returned the same children for the given parent as the MemberLevel query has found for that parent.

If null is returned, the parent/children will not be cached (but the level/members still will be).


getEvaluator

Evaluator getEvaluator()
Returns:
the evaluator currently associated with the constraint; null if there is no associated evaluator

SourceForge.net_Logo