mondrian.rolap
Class ChildByNameConstraint

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

 class ChildByNameConstraint
extends DefaultMemberChildrenConstraint

Constraint which optimizes the search for a child by name. This is used whenever the string representation of a member is parsed, e.g. [Customers].[All Customers].[USA].[CA]. Restricts the result to the member we are searching for.

Author:
avix
 

Field Summary
(package private)  Object cacheKey
           
(package private)  String childName
           
 
Constructor Summary
ChildByNameConstraint(Id.Segment childName)
          Creates a ChildByNameConstraint.
 
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.
 Object getCacheKey()
          Returns a key that becomes part of the key for caching the result of the SQL query.
 String toString()
           
 
Methods inherited from class mondrian.rolap.DefaultMemberChildrenConstraint
addMemberConstraint, addMemberConstraint, getMaxRows, instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

childName

String childName

cacheKey

Object cacheKey
Constructor Detail

ChildByNameConstraint

public ChildByNameConstraint(Id.Segment childName)
Creates a ChildByNameConstraint.

Parameters:
childName - Name of child
Method Detail

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
Overrides:
addLevelConstraint in class DefaultMemberChildrenConstraint
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 DefaultMemberChildrenConstraint

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
Overrides:
getCacheKey in class DefaultMemberChildrenConstraint
Returns:
valid key or null to prevent the result from being cached

SourceForge.net_Logo