Class RolapHierarchy
- java.lang.Object
-
- mondrian.olap.OlapElementBase
-
- mondrian.olap.HierarchyBase
-
- mondrian.rolap.RolapHierarchy
-
- All Implemented Interfaces:
Annotated
,Hierarchy
,OlapElement
- Direct Known Subclasses:
RolapCubeHierarchy
public class RolapHierarchy extends HierarchyBase
RolapHierarchy
implementsHierarchy
for a ROLAP database.The ordinal of a hierarchy within a particular cube is found by calling
getOrdinalInCube()
. Ordinals are contiguous and zero-based. Zero is always the[Measures]
dimension.NOTE: It is only valid to call that method on the measures hierarchy, and on members of the
RolapCubeHierarchy
subclass. When the measures hierarchy is of that class, we will move the method down.)- Since:
- 10 August, 2001
- Author:
- jhyde
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RolapHierarchy.LimitedRollupMember
Substitute for a member in a hierarchy whose rollup policy is 'partial' or 'hidden'.protected class
RolapHierarchy.RolapCalculatedMeasure
Calculated member which is also a measure (that is, a member of the [Measures] dimension).-
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected RolapLevel
nullLevel
The level that the null member belongs too.protected MondrianDef.RelationOrJoin
relation
protected MondrianDef.Hierarchy
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
computeHashCode()
Computes this object's hash code.static Map<String,Annotation>
createAnnotationMap(MondrianDef.Annotations annotations)
Member
createMember(Member parent, Level level, String name, Formula formula)
Creates a member of this hierarchy.boolean
equals(Object o)
RolapMember
getAllMember()
Returns the 'all' member.Map<String,Annotation>
getAnnotationMap()
Returns a list of annotations.Member
getDefaultMember()
Returns the default member of this hierarchy.protected org.apache.logging.log4j.Logger
getLogger()
Member
getNullMember()
Returns a special member representing the "null" value.int
getOrdinalInCube()
Returns the ordinal of this hierarchy in its cube.MondrianDef.RelationOrJoin
getRelation()
RolapSchema
getRolapSchema()
String
getSharedHierarchyName()
Returns the name of the source hierarchy, if this hierarchy is shared, otherwise null.String
getUniqueKeyLevelName()
Gets "unique key level name" attribute of this Hierarchy, if set.MondrianDef.Hierarchy
getXmlHierarchy()
boolean
isRagged()
A hierarchy is ragged if it contains one or more levels with hidden members.void
setDefaultMember(Member defaultMember)
Sets default member of this Hierarchy.-
Methods inherited from class mondrian.olap.HierarchyBase
equals, getAllLevelName, getAllMemberName, getDescription, getDimension, getHierarchy, getLevels, 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
-
-
-
-
Field Detail
-
xmlHierarchy
protected MondrianDef.Hierarchy xmlHierarchy
-
relation
protected MondrianDef.RelationOrJoin relation
-
nullLevel
protected final RolapLevel nullLevel
The level that the null member belongs too.
-
-
Method Detail
-
createAnnotationMap
public static Map<String,Annotation> createAnnotationMap(MondrianDef.Annotations annotations)
-
getLogger
protected org.apache.logging.log4j.Logger getLogger()
- Specified by:
getLogger
in classOlapElementBase
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classOlapElementBase
-
computeHashCode
protected int computeHashCode()
Description copied from class:OlapElementBase
Computes this object's hash code. Called at most once.- Overrides:
computeHashCode
in classOlapElementBase
- Returns:
- hash code
-
getAnnotationMap
public Map<String,Annotation> getAnnotationMap()
Description copied from interface:Annotated
Returns a list of annotations.The map may be empty, never null.
- Returns:
- Map from annotation name to annotations.
-
getRolapSchema
public RolapSchema getRolapSchema()
-
getRelation
public MondrianDef.RelationOrJoin getRelation()
-
getXmlHierarchy
public MondrianDef.Hierarchy getXmlHierarchy()
-
getDefaultMember
public Member 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)
.
-
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.
-
getAllMember
public RolapMember getAllMember()
Returns the 'all' member.
-
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.
-
getSharedHierarchyName
public String getSharedHierarchyName()
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]".
-
isRagged
public boolean isRagged()
A hierarchy is ragged if it contains one or more levels with hidden members.- Specified by:
isRagged
in classHierarchyBase
-
setDefaultMember
public void setDefaultMember(Member defaultMember)
Sets default member of this Hierarchy.- Parameters:
defaultMember
- Default member
-
getUniqueKeyLevelName
public String getUniqueKeyLevelName()
Gets "unique key level name" attribute of this Hierarchy, if set. If set, this property indicates that all level properties are functionally dependent (invariant) on their associated levels, and that the set of levels from the root to the named level (inclusive) effectively defines an alternate key.
This allows the GROUP BY to be eliminated from associated queries.
- Returns:
- the name of the "unique key" level, or null if not specified
-
getOrdinalInCube
public int getOrdinalInCube()
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.
- Returns:
- Ordinal of this hierarchy in its cube
-
-