Class RolapCubeHierarchy
- java.lang.Object
-
- mondrian.olap.OlapElementBase
-
- mondrian.olap.HierarchyBase
-
- mondrian.rolap.RolapHierarchy
-
- mondrian.rolap.RolapCubeHierarchy
-
- All Implemented Interfaces:
Annotated
,Hierarchy
,OlapElement
public class RolapCubeHierarchy extends RolapHierarchy
Hierarchy that is associated with a specific Cube.- Author:
- Will Gorman, 19 October 2007
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader
member reader wrapper - uses existing member reader, but wraps and caches all intermediate members.class
RolapCubeHierarchy.NoCacheRolapCubeHierarchyMemberReader
Same asRolapCubeHierarchy.RolapCubeHierarchyMemberReader
but without caching anything.static interface
RolapCubeHierarchy.RolapCubeHierarchyMemberReader
TODO: Since this is part of a caching strategy, should be implemented as a Strategy Pattern, avoiding hierarchy.static class
RolapCubeHierarchy.RolapCubeSqlMemberSource
-
Nested classes/interfaces inherited from class mondrian.rolap.RolapHierarchy
RolapHierarchy.LimitedRollupMember, RolapHierarchy.RolapCalculatedMeasure
-
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
usingCubeFact
True if the hierarchy is degenerate - has no dimension table of its own, just drives from the cube's fact table.-
Fields inherited from class mondrian.rolap.RolapHierarchy
nullLevel, relation, xmlHierarchy
-
Fields inherited from class mondrian.olap.HierarchyBase
allLevelName, allMemberName, description, dimension, hasAll, levels, name, subName, uniqueName
-
Fields inherited from class mondrian.olap.OlapElementBase
caption, visible
-
-
Constructor Summary
Constructors Constructor Description RolapCubeHierarchy(RolapCubeDimension cubeDimension, MondrianDef.CubeDimension cubeDim, RolapHierarchy rolapHierarchy, String subName, int ordinal)
Creates a RolapCubeHierarchy.RolapCubeHierarchy(RolapCubeDimension cubeDimension, MondrianDef.CubeDimension cubeDim, RolapHierarchy rolapHierarchy, String subName, int ordinal, RolapCube factCube)
Creates a RolapCubeHierarchy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
computeHashCode()
Computes this object's hash code.Member
createMember(Member parent, Level level, String name, Formula formula)
Creates a member of this hierarchy.boolean
equals(Object o)
protected void
extractNewAliases(MondrianDef.RelationOrJoin oldrel, MondrianDef.RelationOrJoin newrel)
Populates the alias map for the old and new relations.String
getAllLevelName()
Returns the name of the 'all' level in this hierarchy.RolapCubeMember
getAllMember()
Returns the 'all' member.String
getAllMemberName()
RolapCube
getCube()
RolapCubeMember
getDefaultMember()
Returns the default member of this hierarchy.RolapCubeLevel[]
getLevels()
Returns the levels in this hierarchy.Member
getNullMember()
Returns a special member representing the "null" value.int
getOrdinalInCube()
Returns the ordinal of this hierarchy in its cube.MondrianDef.RelationOrJoin
getRelation()
The currentRelation object is derived from the shared relation object it is generated via the RolapStar object, and contains unique aliases for it's particular join pathRolapHierarchy
getRolapHierarchy()
String
getSharedHierarchyName()
Returns the name of the source hierarchy, if this hierarchy is shared, otherwise null.boolean
isUsingCubeFact()
String
lookupAlias(String origTable)
void
setDefaultMember(Member defaultMeasure)
Sets default member of this Hierarchy.-
Methods inherited from class mondrian.rolap.RolapHierarchy
createAnnotationMap, getAnnotationMap, getLogger, getRolapSchema, getUniqueKeyLevelName, getXmlHierarchy, isRagged
-
Methods inherited from class mondrian.olap.HierarchyBase
equals, getDescription, getDimension, getHierarchy, getName, getQualifiedName, getSubName, getUniqueName, getUniqueNameSsas, hasAll, lookupChild
-
Methods inherited from class mondrian.olap.OlapElementBase
clone, getCaption, getLocalized, hashCode, isVisible, setCaption, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface mondrian.olap.OlapElement
getCaption, getLocalized, isVisible
-
-
-
-
Constructor Detail
-
RolapCubeHierarchy
public RolapCubeHierarchy(RolapCubeDimension cubeDimension, MondrianDef.CubeDimension cubeDim, RolapHierarchy rolapHierarchy, String subName, int ordinal)
Creates a RolapCubeHierarchy.- Parameters:
cubeDimension
- DimensioncubeDim
- XML dimension elementrolapHierarchy
- Wrapped hierarchysubName
- Name of hierarchy within dimensionordinal
- Ordinal of hierarchy within cube
-
RolapCubeHierarchy
public RolapCubeHierarchy(RolapCubeDimension cubeDimension, MondrianDef.CubeDimension cubeDim, RolapHierarchy rolapHierarchy, String subName, int ordinal, RolapCube factCube)
Creates a RolapCubeHierarchy.- Parameters:
cubeDimension
- DimensioncubeDim
- XML dimension elementrolapHierarchy
- Wrapped hierarchysubName
- Name of hierarchy within dimensionordinal
- Ordinal of hierarchy within cubefactCube
- Optional - specified for virtual cube dimension
-
-
Method Detail
-
getLevels
public RolapCubeLevel[] getLevels()
Description copied from interface:Hierarchy
Returns the levels in this hierarchy.If a hierarchy is subject to access-control, some of the levels may not be visible; use
SchemaReader.getHierarchyLevels(mondrian.olap.Hierarchy)
instead.- Specified by:
getLevels
in interfaceHierarchy
- Overrides:
getLevels
in classHierarchyBase
-
getAllMemberName
public String getAllMemberName()
- Overrides:
getAllMemberName
in classHierarchyBase
-
getSharedHierarchyName
public String getSharedHierarchyName()
Description copied from class:RolapHierarchy
Returns the name of the source hierarchy, if this hierarchy is shared, otherwise null.If this hierarchy is a public -- that is, it belongs to a dimension which is a usage of a shared dimension -- then
sharedHierarchyName
holds the unique name of the shared hierarchy; otherwise it is null.Suppose this hierarchy is "Weekly" in the dimension "Order Date" of cube "Sales", and that "Order Date" is a usage of the "Time" dimension. Then
sharedHierarchyName
will be "[Time].[Weekly]".- Overrides:
getSharedHierarchyName
in classRolapHierarchy
-
getAllLevelName
public String getAllLevelName()
Description copied from class:HierarchyBase
Returns the name of the 'all' level in this hierarchy.- Overrides:
getAllLevelName
in classHierarchyBase
- Returns:
- name of the 'all' level
-
isUsingCubeFact
public boolean isUsingCubeFact()
-
getRolapHierarchy
public final RolapHierarchy getRolapHierarchy()
-
getOrdinalInCube
public final int getOrdinalInCube()
Description copied from class:RolapHierarchy
Returns the ordinal of this hierarchy in its cube.Temporarily defined against RolapHierarchy; will be moved to RolapCubeHierarchy as soon as the measures hierarchy is a RolapCubeHierarchy.
- Overrides:
getOrdinalInCube
in classRolapHierarchy
- Returns:
- Ordinal of this hierarchy in its cube
-
extractNewAliases
protected void extractNewAliases(MondrianDef.RelationOrJoin oldrel, MondrianDef.RelationOrJoin newrel)
Populates the alias map for the old and new relations.This method may be simplified when we obsolete
HierarchyUsage
.- Parameters:
oldrel
- Original relation, as defined in the schemanewrel
- New star relation, generated by RolapStar, canonical, and shared between all cubes with similar structure
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classRolapHierarchy
-
computeHashCode
protected int computeHashCode()
Description copied from class:OlapElementBase
Computes this object's hash code. Called at most once.- Overrides:
computeHashCode
in classRolapHierarchy
- Returns:
- hash code
-
createMember
public Member createMember(Member parent, Level level, String name, Formula formula)
Description copied from interface:Hierarchy
Creates a member of this hierarchy. If this is the measures hierarchy, a calculated member is created, andformula
must not be null.- Specified by:
createMember
in interfaceHierarchy
- Overrides:
createMember
in classRolapHierarchy
-
getRelation
public MondrianDef.RelationOrJoin getRelation()
The currentRelation object is derived from the shared relation object it is generated via the RolapStar object, and contains unique aliases for it's particular join path- Overrides:
getRelation
in classRolapHierarchy
- Returns:
- rolap cube hierarchy relation
-
getDefaultMember
public final RolapCubeMember getDefaultMember()
Description copied from interface:Hierarchy
Returns the default member of this hierarchy.If a hierarchy is subject to access-control, the default member may not be visible, so use
SchemaReader.getHierarchyDefaultMember(mondrian.olap.Hierarchy)
.- Specified by:
getDefaultMember
in interfaceHierarchy
- Overrides:
getDefaultMember
in classRolapHierarchy
-
getNullMember
public Member getNullMember()
Description copied from interface:Hierarchy
Returns a special member representing the "null" value. This never occurs on an axis, but may occur if functions such asLead
,NextMember
andParentMember
walk off the end of the hierarchy.- Specified by:
getNullMember
in interfaceHierarchy
- Overrides:
getNullMember
in classRolapHierarchy
-
getAllMember
public RolapCubeMember getAllMember()
Returns the 'all' member.- Specified by:
getAllMember
in interfaceHierarchy
- Overrides:
getAllMember
in classRolapHierarchy
-
setDefaultMember
public void setDefaultMember(Member defaultMeasure)
Description copied from class:RolapHierarchy
Sets default member of this Hierarchy.- Overrides:
setDefaultMember
in classRolapHierarchy
- Parameters:
defaultMeasure
- Default member
-
getCube
public final RolapCube getCube()
-
-