Package mondrian.rolap
Class ChildByNameConstraint
- java.lang.Object
-
- mondrian.rolap.DefaultMemberChildrenConstraint
-
- 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
Constructors Constructor Description ChildByNameConstraint(List<Id.NameSegment> childNames)
ChildByNameConstraint(Id.NameSegment childName)
Creates aChildByNameConstraint
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.List<String>
getChildNames()
int
hashCode()
String
toString()
-
Methods inherited from class mondrian.rolap.DefaultMemberChildrenConstraint
addMemberConstraint, addMemberConstraint, instance
-
-
-
-
Constructor Detail
-
ChildByNameConstraint
public ChildByNameConstraint(Id.NameSegment childName)
Creates aChildByNameConstraint
.- Parameters:
childName
- Name of child
-
ChildByNameConstraint
public ChildByNameConstraint(List<Id.NameSegment> childNames)
-
-
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 interfaceMemberChildrenConstraint
- Overrides:
addLevelConstraint
in classDefaultMemberChildrenConstraint
- Parameters:
query
- the query to modifybaseCube
- base cube for virtual membersaggStar
- Aggregate table, or null if query is against fact tablelevel
- the level that contains the children
-
toString
public String toString()
- Overrides:
toString
in classDefaultMemberChildrenConstraint
-
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 interfaceSqlConstraint
- Overrides:
getCacheKey
in classDefaultMemberChildrenConstraint
- Returns:
- valid key or null to prevent the result from being cached
-
-