Package mondrian.rolap
Class MemberExcludeConstraint
- java.lang.Object
-
- mondrian.rolap.MemberExcludeConstraint
-
- All Implemented Interfaces:
SqlConstraint
,TupleConstraint
class MemberExcludeConstraint extends java.lang.Object implements TupleConstraint
Constraint which excludes the members in the list received in constructor.- Author:
- Pedro Vale
-
-
Constructor Summary
Constructors Constructor Description MemberExcludeConstraint(java.util.List<RolapMember> excludes, RolapLevel level, RolapNativeSet.SetConstraint csc)
Creates aMemberExcludeConstraint
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar)
Modifies a Level.Members query.void
addLevelConstraint(SqlQuery query, RolapCube baseCube, AggStar aggStar, RolapLevel level)
Will be called multiple times for every "group by" level in Level.Members query, i.e.boolean
equals(java.lang.Object obj)
java.lang.Object
getCacheKey()
Returns a key that becomes part of the key for caching the result of the SQL query.Evaluator
getEvaluator()
MemberChildrenConstraint
getMemberChildrenConstraint(RolapMember parent)
When the members of a level are fetched, the result is grouped by into parents and their children.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
MemberExcludeConstraint
public MemberExcludeConstraint(java.util.List<RolapMember> excludes, RolapLevel level, RolapNativeSet.SetConstraint csc)
Creates aMemberExcludeConstraint
.
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
addLevelConstraint
public void addLevelConstraint(SqlQuery query, RolapCube baseCube, AggStar aggStar, RolapLevel level)
Description copied from interface:TupleConstraint
Will be called multiple times for every "group by" level in Level.Members query, i.e. the level that contains the members and all parent levels except All. If the condition requires so, it may join the levels table to the fact table.- Specified by:
addLevelConstraint
in interfaceTupleConstraint
- Parameters:
query
- the query to modifybaseCube
- base cube for virtual cube constraintsaggStar
- Aggregate table, or null if query is against fact tablelevel
- the level which is accessed in the Level.Members query
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getCacheKey
public java.lang.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
- Returns:
- valid key or null to prevent the result from being cached
-
getMemberChildrenConstraint
public MemberChildrenConstraint getMemberChildrenConstraint(RolapMember parent)
Description copied from interface:TupleConstraint
When the members of a level are fetched, the result is grouped by into parents and their children. These parent/children are stored in the parent/children cache, whose key consists of the parent and the MemberChildrenConstraint#hashKey(). So we need a matching MemberChildrenConstraint to store the parent with its children into the parent/children cache.The returned MemberChildrenConstraint must be one that would have returned the same children for the given parent as the MemberLevel query has found for that parent.
If null is returned, the parent/children will not be cached (but the level/members still will be).
- Specified by:
getMemberChildrenConstraint
in interfaceTupleConstraint
-
addConstraint
public void addConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar)
Description copied from interface:TupleConstraint
Modifies a Level.Members query.- Specified by:
addConstraint
in interfaceTupleConstraint
- Parameters:
sqlQuery
- the query to modifybaseCube
- base cube for virtual cube constraintsaggStar
- aggregate star to use
-
getEvaluator
public Evaluator getEvaluator()
- Specified by:
getEvaluator
in interfaceTupleConstraint
- Returns:
- the evaluator currently associated with the constraint; null if there is no associated evaluator
-
-