mondrian.rolap
Class SqlConstraintFactory

java.lang.Object
  extended by mondrian.rolap.SqlConstraintFactory

public class SqlConstraintFactory
extends Object

Creates the right constraint for common tasks.

Since:
Nov 21, 2005
Author:
av
 

Field Summary
(package private)  boolean enabled
           
 
Method Summary
 MemberChildrenConstraint getChildByNameConstraint(RolapMember parent, Id.Segment childName)
           
 TupleConstraint getDescendantsConstraint(List<RolapMember> parentMembers, MemberChildrenConstraint mcc)
          Returns a constraint that allows to read all children of multiple parents at once using a LevelMember query style.
 TupleConstraint getLevelMembersConstraint(Evaluator context)
           
 TupleConstraint getLevelMembersConstraint(Evaluator context, Level[] levels, boolean[] satisfied)
          Returns a constraint that restricts the members of a level to those that are non-empty in the given context.
 MemberChildrenConstraint getMemberChildrenConstraint(Evaluator context)
           
static SqlConstraintFactory instance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

boolean enabled
Method Detail

instance

public static SqlConstraintFactory instance()

getMemberChildrenConstraint

public MemberChildrenConstraint getMemberChildrenConstraint(Evaluator context)

getLevelMembersConstraint

public TupleConstraint getLevelMembersConstraint(Evaluator context)

getLevelMembersConstraint

public TupleConstraint getLevelMembersConstraint(Evaluator context,
                                                 Level[] levels,
                                                 boolean[] satisfied)
Returns a constraint that restricts the members of a level to those that are non-empty in the given context. If the constraint cannot be implemented (say if native constraints are disabled) returns null.

Parameters:
context - Context within which members must be non-empty
levels - levels being referenced in the current context
satisfied - Set to false if constraint does not satisfy non-empty context and caller still has to do it
Returns:
Constraint

getChildByNameConstraint

public MemberChildrenConstraint getChildByNameConstraint(RolapMember parent,
                                                         Id.Segment childName)

getDescendantsConstraint

public TupleConstraint getDescendantsConstraint(List<RolapMember> parentMembers,
                                                MemberChildrenConstraint mcc)
Returns a constraint that allows to read all children of multiple parents at once using a LevelMember query style. This does not work for parent/child hierarchies.

Parameters:
parentMembers - List of parents (all must belong to same level)
mcc - The constraint that would return the children for each single parent
Returns:
constraint

SourceForge.net_Logo