mondrian.rolap
Class RolapCubeHierarchy

java.lang.Object
  extended by mondrian.olap.OlapElementBase
      extended by mondrian.olap.HierarchyBase
          extended by mondrian.rolap.RolapHierarchy
              extended by mondrian.rolap.RolapCubeHierarchy
All Implemented Interfaces:
Hierarchy, OlapElement

public class RolapCubeHierarchy
extends RolapHierarchy

Hierarchy that is associated with a specific Cube.

Author:
Will Gorman (wgorman@pentaho.org)
 

Nested Class Summary
 class RolapCubeHierarchy.CacheRolapCubeHierarchyMemberReader
          member reader wrapper - uses existing member reader, but wraps and caches all intermediate members
 class RolapCubeHierarchy.NoCacheRolapCubeHierarchyMemberReader
          Same as 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 hirarchy.
static class RolapCubeHierarchy.RolapCubeSqlMemberSource
           
 
Nested classes/interfaces inherited from class mondrian.rolap.RolapHierarchy
RolapHierarchy.LimitedRollupMember, RolapHierarchy.RolapCalculatedMeasure, RolapHierarchy.RolapNullMember
 
Field Summary
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
memberType, 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
 
Constructor Summary
RolapCubeHierarchy(RolapCubeDimension dimension, MondrianDef.CubeDimension cubeDim, RolapHierarchy rolapHierarchy, String subName)
           
 
Method Summary
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()
           
 String getCaption()
          Returns the display name of this catalog element.
 Member getDefaultMember()
          Returns the default member of this hierarchy.
 RolapCubeDimension getDimension()
          Returns the dimension this hierarchy belongs to.
(package private)  MemberReader getMemberReader()
           
 Member getNullMember()
          Returns a special member representing the "null" value.
 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
 RolapHierarchy getRolapHierarchy()
           
 String getSharedHierarchyName()
          Returns the name of the source hierarchy, if this hierarchy is shared, otherwise null.
(package private)  void init(MondrianDef.CubeDimension xmlDimension)
          Initializes a hierarchy within the context of a cube.
 boolean isUsingCubeFact()
           
 String lookupAlias(String origTable)
           
 void setCaption(String caption)
          Sets the display name of this catalog element.
 void setDefaultMember(Member defaultMeasure)
          Sets default member of this Hierarchy.
(package private)  void setMemberReader(MemberReader memberReader)
           
(package private)  boolean tableExists(String tableName)
           
 
Methods inherited from class mondrian.rolap.RolapHierarchy
addToFrom, addToFrom, createClosedPeerDimension, createMemberReader, getAggregateChildrenExpression, getAlias, getLogger, getRolapSchema, getUniqueTable, getXmlHierarchy, isRagged, newMeasuresLevel
 
Methods inherited from class mondrian.olap.HierarchyBase
equals, getDescription, getHierarchy, getLevels, getName, getQualifiedName, getSubName, getUniqueName, hasAll, lookupChild, lookupChild
 
Methods inherited from class mondrian.olap.OlapElementBase
clone, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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 Detail

RolapCubeHierarchy

public RolapCubeHierarchy(RolapCubeDimension dimension,
                          MondrianDef.CubeDimension cubeDim,
                          RolapHierarchy rolapHierarchy,
                          String subName)
Method Detail

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)

getDimension

public RolapCubeDimension getDimension()
Description copied from interface: Hierarchy
Returns the dimension this hierarchy belongs to.

Specified by:
getDimension in interface Hierarchy
Specified by:
getDimension in interface OlapElement
Overrides:
getDimension in class HierarchyBase

getRolapHierarchy

public RolapHierarchy getRolapHierarchy()

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

tableExists

boolean tableExists(String tableName)
Overrides:
tableExists 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 it's particular join path

Overrides:
getRelation in class RolapHierarchy
Returns:
rolap cube hierarchy relation

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).

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

getCaption

public String getCaption()
Returns the display name of this catalog element. If no caption is defined, the name is returned.

Specified by:
getCaption in interface OlapElement
Overrides:
getCaption in class OlapElementBase

setCaption

public void setCaption(String caption)
Sets the display name of this catalog element.

Overrides:
setCaption in class OlapElementBase

setMemberReader

void setMemberReader(MemberReader memberReader)
Overrides:
setMemberReader in class RolapHierarchy

getMemberReader

MemberReader getMemberReader()
Overrides:
getMemberReader 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

init

void init(MondrianDef.CubeDimension xmlDimension)
Description copied from class: RolapHierarchy
Initializes a hierarchy within the context of a cube.

Overrides:
init in class RolapHierarchy

SourceForge.net_Logo