|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.rolap.SqlConstraintUtils
public class SqlConstraintUtils
Utility class used by implementations of SqlConstraint
,
used to generate constraints into SqlQuery
.
Method Summary | |
---|---|
static void |
addContextConstraint(SqlQuery sqlQuery,
AggStar aggStar,
Evaluator evaluator,
boolean restrictMemberTypes)
For every restricting member in the current context, generates a WHERE condition and a join to the fact table. |
static void |
addMemberConstraint(SqlQuery sqlQuery,
RolapCube baseCube,
AggStar aggStar,
List<RolapMember> members,
boolean restrictMemberTypes,
boolean crossJoin)
Creates a "WHERE exp IN (...)" condition containing the values of all parents. |
static void |
addMemberConstraint(SqlQuery sqlQuery,
RolapCube baseCube,
AggStar aggStar,
RolapMember parent,
boolean restrictMemberTypes)
Creates a "WHERE parent = value" constraint. |
static String |
constrainLevel(RolapLevel level,
SqlQuery query,
RolapCube baseCube,
String columnValue,
boolean caseSensitive)
Generates a sql expression constraining a level by some value |
static boolean |
containsCalculatedMember(Member[] members)
|
static void |
joinLevelTableToFactTable(SqlQuery sqlQuery,
RolapCube baseCube,
AggStar aggStar,
Evaluator e,
RolapCubeLevel level)
Ensures that the table of level is joined to the fact
table |
(package private) static List<Member> |
removeCalculatedMembers(List<Member> members)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void addContextConstraint(SqlQuery sqlQuery, AggStar aggStar, Evaluator evaluator, boolean restrictMemberTypes)
sqlQuery
- the query to modifyaggStar
- Aggregate table, or null if query is against fact tablerestrictMemberTypes
- defines the behavior if the current context contains
calculated members.
If true, an exception is thrown.evaluator
- Evaluatorstatic List<Member> removeCalculatedMembers(List<Member> members)
public static boolean containsCalculatedMember(Member[] members)
public static void joinLevelTableToFactTable(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar, Evaluator e, RolapCubeLevel level)
level
is joined to the fact
table
sqlQuery
- sql query under constructionaggStar
- e
- evaluator corresponding to querylevel
- level to be added to querypublic static void addMemberConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar, RolapMember parent, boolean restrictMemberTypes)
sqlQuery
- the query to modifybaseCube
- base cube if virtualaggStar
- Definition of the aggregate table, or nullparent
- the list of parent membersrestrictMemberTypes
- defines the behavior if parent
is a calculated member. If true, an exception is thrownpublic static void addMemberConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar, List<RolapMember> members, boolean restrictMemberTypes, boolean crossJoin)
If this constraint is part of a native cross join, there are multiple constraining members, and the members comprise the cross product of all unique member keys referenced at each level, then generating IN expressions would result in incorrect results. In that case, "WHERE ((level1 = val1a AND level2 = val2a AND ...) OR (level1 = val1b AND level2 = val2b AND ...) OR ..." is generated instead.
sqlQuery
- the query to modifybaseCube
- base cube if virtualaggStar
- (not used)members
- the list of members for this constraintrestrictMemberTypes
- defines the behavior if parents
contains calculated members.
If true, and one of the members is calculated, an exception is thrown.crossJoin
- true if constraint is being generated as part of
a native crossjoinpublic static String constrainLevel(RolapLevel level, SqlQuery query, RolapCube baseCube, String columnValue, boolean caseSensitive)
level
- the levelquery
- the query that the sql expression will be added tobaseCube
- base cube for virtual levelscolumnValue
- value constraining the levelcaseSensitive
- if true, need to handle case sensitivity of the
member value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |