mondrian.rolap
Class HierarchyUsage

java.lang.Object
  extended by mondrian.rolap.HierarchyUsage

public class HierarchyUsage
extends Object

A HierarchyUsage is the usage of a hierarchy in the context of a cube. Private hierarchies can only be used in their own cube. Public hierarchies can be used in several cubes. The problem comes when several cubes which the same public hierarchy are brought together in one virtual cube. There are now several usages of the same public hierarchy. Which one to use? It depends upon what measure we are currently using. We should use the hierarchy usage for the fact table which underlies the measure. That is what determines the foreign key to join on. A HierarchyUsage is identified by (hierarchy.sharedHierarchy, factTable) if the hierarchy is shared, or (hierarchy, factTable) if it is private.

Since:
21 March, 2002
Author:
jhyde
 

Nested Class Summary
(package private) static class HierarchyUsage.Kind
           
 
Field Summary
protected  MondrianDef.Relation fact
          Fact table (or relation) which this usage is joining to.
 
Constructor Summary
HierarchyUsage(RolapCube cube, RolapHierarchy hierarchy, MondrianDef.CubeDimension cubeDim)
          Creates a HierarchyUsage.
 
Method Summary
 boolean equals(Object o)
           
 String getForeignKey()
           
 String getFullName()
           
 String getHierarchyName()
           
 MondrianDef.Expression getJoinExp()
           
 MondrianDef.Relation getJoinTable()
           
 HierarchyUsage.Kind getKind()
           
 String getLevelName()
           
protected  org.apache.log4j.Logger getLogger()
           
 String getName()
           
 String getSource()
           
 String getUsagePrefix()
           
 int hashCode()
           
(package private)  void init(RolapCube cube, RolapHierarchy hierarchy, MondrianDef.DimensionUsage cubeDim)
           
 boolean isPrivate()
           
 boolean isShared()
           
 boolean isVirtual()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fact

protected final MondrianDef.Relation fact
Fact table (or relation) which this usage is joining to. This identifies the usage, and determines which join conditions need to be used.

Constructor Detail

HierarchyUsage

HierarchyUsage(RolapCube cube,
               RolapHierarchy hierarchy,
               MondrianDef.CubeDimension cubeDim)
Creates a HierarchyUsage.

Parameters:
cube - Cube
hierarchy - Hierarchy
cubeDim - XML definition of a dimension which belongs to a cube
Method Detail

getLogger

protected org.apache.log4j.Logger getLogger()

getHierarchyName

public String getHierarchyName()

getFullName

public String getFullName()

getName

public String getName()

getForeignKey

public String getForeignKey()

getSource

public String getSource()

getLevelName

public String getLevelName()

getUsagePrefix

public String getUsagePrefix()

getJoinTable

public MondrianDef.Relation getJoinTable()

getJoinExp

public MondrianDef.Expression getJoinExp()

getKind

public HierarchyUsage.Kind getKind()

isShared

public boolean isShared()

isVirtual

public boolean isVirtual()

isPrivate

public boolean isPrivate()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

init

void init(RolapCube cube,
          RolapHierarchy hierarchy,
          MondrianDef.DimensionUsage cubeDim)

SourceForge.net_Logo