mondrian.rolap
Class DefaultMemberChildrenConstraint

java.lang.Object
  extended by mondrian.rolap.DefaultMemberChildrenConstraint
All Implemented Interfaces:
MemberChildrenConstraint, SqlConstraint
Direct Known Subclasses:
ChildByNameConstraint

public class DefaultMemberChildrenConstraint
extends Object
implements MemberChildrenConstraint

Restricts the SQL result set to the parent member of a MemberChildren query. If called with a calculated member an exception will be thrown.

 

Constructor Summary
protected DefaultMemberChildrenConstraint()
           
 
Method Summary
 void addLevelConstraint(SqlQuery query, RolapCube baseCube, AggStar aggStar, RolapLevel level)
          Will be called once for the level that contains the children of a Member.Children query.
 void addMemberConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar, List<RolapMember> parents)
          Modifies a Member.Children query so that (all or some) children of all parent members contained in parents will be returned in the result set.
 void addMemberConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar, RolapMember parent)
          Modifies a Member.Children query so that only the children of parent will be returned in the result set.
 Object getCacheKey()
          Returns a key that becomes part of the key for caching the result of the SQL query.
 int getMaxRows()
           
static MemberChildrenConstraint instance()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMemberChildrenConstraint

protected DefaultMemberChildrenConstraint()
Method Detail

addMemberConstraint

public void addMemberConstraint(SqlQuery sqlQuery,
                                RolapCube baseCube,
                                AggStar aggStar,
                                RolapMember parent)
Description copied from interface: MemberChildrenConstraint
Modifies a Member.Children query so that only the children of parent will be returned in the result set.

Specified by:
addMemberConstraint in interface MemberChildrenConstraint
Parameters:
sqlQuery - the query to modify
baseCube - base cube for virtual members
aggStar - Aggregate star, if we are reading from an aggregate table,
parent - the parent member that restricts the returned children

addMemberConstraint

public void addMemberConstraint(SqlQuery sqlQuery,
                                RolapCube baseCube,
                                AggStar aggStar,
                                List<RolapMember> parents)
Description copied from interface: MemberChildrenConstraint
Modifies a Member.Children query so that (all or some) children of all parent members contained in parents will be returned in the result set.

Specified by:
addMemberConstraint in interface MemberChildrenConstraint
Parameters:
sqlQuery - the query to modify
baseCube - base cube for virtual members
aggStar - Aggregate table, or null if query is against fact table
parents - list of parent members that restrict the returned children.

addLevelConstraint

public void addLevelConstraint(SqlQuery query,
                               RolapCube baseCube,
                               AggStar aggStar,
                               RolapLevel level)
Description copied from interface: MemberChildrenConstraint
Will be called once for the level that contains the children of a Member.Children query. If the condition requires so, it may join the levels table to the fact table.

Specified by:
addLevelConstraint in interface MemberChildrenConstraint
Parameters:
query - the query to modify
baseCube - base cube for virtual members
aggStar - Aggregate table, or null if query is against fact table
level - the level that contains the children

toString

public String toString()
Overrides:
toString in class Object

getCacheKey

public Object getCacheKey()
Description copied from interface: SqlConstraint
Returns a key that becomes part of the key for caching the result of the SQL query. So SqlConstraint instances that produce the same SQL resultset must return equal keys in terms of equal() and hashCode().

Specified by:
getCacheKey in interface SqlConstraint
Returns:
valid key or null to prevent the result from being cached

instance

public static MemberChildrenConstraint instance()

getMaxRows

public int getMaxRows()

SourceForge.net_Logo