Class 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
  • Field Details

    • usingCubeFact

      protected final boolean usingCubeFact
      True if the hierarchy is degenerate - has no dimension table of its own, just drives from the cube's fact table.
  • Constructor Details

    • RolapCubeHierarchy

      public RolapCubeHierarchy(RolapCubeDimension cubeDimension, MondrianDef.CubeDimension cubeDim, RolapHierarchy rolapHierarchy, String subName, int ordinal)
      Creates a RolapCubeHierarchy.
      Parameters:
      cubeDimension - Dimension
      cubeDim - XML dimension element
      rolapHierarchy - Wrapped hierarchy
      subName - Name of hierarchy within dimension
      ordinal - 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 - Dimension
      cubeDim - XML dimension element
      rolapHierarchy - Wrapped hierarchy
      subName - Name of hierarchy within dimension
      ordinal - Ordinal of hierarchy within cube
      factCube - Optional - specified for virtual cube dimension
  • Method Details

    • 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 interface Hierarchy
      Overrides:
      getLevels in class HierarchyBase
    • getAllMemberName

      public String getAllMemberName()
      Overrides:
      getAllMemberName in class HierarchyBase
    • 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 class RolapHierarchy
    • getAllLevelName

      public String getAllLevelName()
      Description copied from class: HierarchyBase
      Returns the name of the 'all' level in this hierarchy.
      Overrides:
      getAllLevelName in class HierarchyBase
      Returns:
      name of the 'all' level
    • isUsingCubeFact

      public boolean isUsingCubeFact()
    • lookupAlias

      public String lookupAlias(String origTable)
    • 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 class RolapHierarchy
      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 schema
      newrel - New star relation, generated by RolapStar, canonical, and shared between all cubes with similar structure
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class RolapHierarchy
    • computeHashCode

      protected int computeHashCode()
      Description copied from class: OlapElementBase
      Computes this object's hash code. Called at most once.
      Overrides:
      computeHashCode in class RolapHierarchy
      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, and formula must not be null.
      Specified by:
      createMember in interface Hierarchy
      Overrides:
      createMember in class RolapHierarchy
    • 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 its particular join path
      Overrides:
      getRelation in class RolapHierarchy
      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 interface Hierarchy
      Overrides:
      getDefaultMember in class RolapHierarchy
    • 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 as Lead, NextMember and ParentMember walk off the end of the hierarchy.
      Specified by:
      getNullMember in interface Hierarchy
      Overrides:
      getNullMember in class RolapHierarchy
    • getAllMember

      public RolapCubeMember getAllMember()
      Returns the 'all' member.
      Specified by:
      getAllMember in interface Hierarchy
      Overrides:
      getAllMember in class RolapHierarchy
    • setDefaultMember

      public void setDefaultMember(Member defaultMeasure)
      Description copied from class: RolapHierarchy
      Sets default member of this Hierarchy.
      Overrides:
      setDefaultMember in class RolapHierarchy
      Parameters:
      defaultMeasure - Default member
    • getCube

      public final RolapCube getCube()