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].[USA].[CA]. Restricts the result to the member we are searching for.

Author:
avix

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.
 boolean equals(Object obj)
           
 Object getCacheKey()
          Returns a key that becomes part of the key for caching the result of the SQL query.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class mondrian.rolap.DefaultMemberChildrenConstraint
addMemberConstraint, addMemberConstraint, instance
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChildByNameConstraint

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

Parameters:
childName - Name of child
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

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

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads