Package mondrian.rolap
Class RolapLevel
- java.lang.Object
-
- mondrian.olap.OlapElementBase
-
- mondrian.olap.LevelBase
-
- mondrian.rolap.RolapLevel
-
- All Implemented Interfaces:
Annotated,Level,OlapElement
- Direct Known Subclasses:
RolapCubeLevel
public class RolapLevel extends LevelBase
RolapLevelimplementsLevelfor a ROLAP database.- Since:
- 10 August, 2001
- Author:
- jhyde
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRolapLevel.HideMemberConditionConditions under which a level's members may be hidden (thereby creating a ragged hierarchy).-
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected MondrianDef.ExpressioncaptionExpThe column or expression which yields the level members' caption.(package private) static intFLAG_ALL(package private) static intFLAG_UNIQUEFor SQL generator.protected MondrianDef.ExpressionkeyExpThe column or expression which yields the level's key.protected MondrianDef.ExpressionnameExpThs expression which gives the name of members of this level.protected MondrianDef.ExpressionordinalExpThe column or expression which yields the level's ordinal.protected MondrianDef.ExpressionparentExpThe expression which joins to the parent member in a parent-child hierarchy, or null if this is a regular hierarchy.protected RolapProperty[]propertiesprotected MondrianDef.ClosurexmlClosure-
Fields inherited from class mondrian.olap.LevelBase
approxRowCount, depth, description, hierarchy, levelType, memberFormatter, name, uniqueName
-
Fields inherited from class mondrian.olap.OlapElementBase
caption, visible
-
-
Constructor Summary
Constructors Constructor Description RolapLevel(RolapHierarchy hierarchy, int depth, MondrianDef.Level xmlLevel)RolapLevel(RolapHierarchy hierarchy, String name, String caption, boolean visible, String description, int depth, MondrianDef.Expression keyExp, MondrianDef.Expression nameExp, MondrianDef.Expression captionExp, MondrianDef.Expression ordinalExp, MondrianDef.Expression parentExp, String nullParentValue, MondrianDef.Closure xmlClosure, RolapProperty[] properties, int flags, Dialect.Datatype datatype, SqlStatement.Type internalType, RolapLevel.HideMemberCondition hideMemberCondition, LevelType levelType, String approxRowCount, Map<String,Annotation> annotationMap)Creates a level.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareMembersUnique()Map<String,Annotation>getAnnotationMap()Returns a list of annotations.intgetApproxRowCount()Returns the approximate number of members in this level, orInteger.MIN_VALUEif no approximation is known.MondrianDef.ExpressiongetCaptionExp()RolapLevelgetClosedPeer()(package private) Dialect.DatatypegetDatatype()(package private) intgetFlags()(package private) RolapLevel.HideMemberConditiongetHideMemberCondition()RolapHierarchygetHierarchy()Property[]getInheritedProperties()Returns properties defined against this level and parent levels.SqlStatement.TypegetInternalType()MondrianDef.ExpressiongetKeyExp()protected org.apache.log4j.LoggergetLogger()MondrianDef.ExpressiongetNameExp()(package private) StringgetNullParentValue()MondrianDef.ExpressiongetOrdinalExp()(package private) MondrianDef.ExpressiongetParentExp()RolapProperty[]getProperties()Returns properties defined against this level.StringgetTableAlias()(package private) StringgetTableName()booleanhasCaptionColumn()(package private) booleanhasClosedPeer()Returns true when the level is part of a parent/child hierarchy and has an equivalent closed level.(package private) voidinit(MondrianDef.CubeDimension xmlDimension)booleanisAll()booleanisParentChild()Returns whether this level is parent-child.booleanisSimple()Indicates that level is not ragged and not a parent/child level.booleanisUnique()OlapElementlookupChild(SchemaReader schemaReader, Id.Segment name)OlapElementlookupChild(SchemaReader schemaReader, Id.Segment name, MatchType matchType)Looks up a child element, returning null if it does not exist.static RolapLevellookupLevel(RolapLevel[] levels, String levelName)-
Methods inherited from class mondrian.olap.LevelBase
getChildLevel, getDepth, getDescription, getDimension, getLevelType, getMemberFormatter, getName, getParentLevel, getQualifiedName, getUniqueName, isMeasure, setApproxRowCount
-
Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, equals, equals, 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
-
keyExp
protected MondrianDef.Expression keyExp
The column or expression which yields the level's key.
-
ordinalExp
protected MondrianDef.Expression ordinalExp
The column or expression which yields the level's ordinal.
-
captionExp
protected MondrianDef.Expression captionExp
The column or expression which yields the level members' caption.
-
FLAG_ALL
static final int FLAG_ALL
- See Also:
- Constant Field Values
-
FLAG_UNIQUE
static final int FLAG_UNIQUE
For SQL generator. Whether values of "column" are unique globally unique (as opposed to unique only within the context of the parent member).- See Also:
- Constant Field Values
-
properties
protected RolapProperty[] properties
-
nameExp
protected MondrianDef.Expression nameExp
Ths expression which gives the name of members of this level. If null, members are named using the key expression.
-
parentExp
protected MondrianDef.Expression parentExp
The expression which joins to the parent member in a parent-child hierarchy, or null if this is a regular hierarchy.
-
xmlClosure
protected final MondrianDef.Closure xmlClosure
-
-
Constructor Detail
-
RolapLevel
RolapLevel(RolapHierarchy hierarchy, String name, String caption, boolean visible, String description, int depth, MondrianDef.Expression keyExp, MondrianDef.Expression nameExp, MondrianDef.Expression captionExp, MondrianDef.Expression ordinalExp, MondrianDef.Expression parentExp, String nullParentValue, MondrianDef.Closure xmlClosure, RolapProperty[] properties, int flags, Dialect.Datatype datatype, SqlStatement.Type internalType, RolapLevel.HideMemberCondition hideMemberCondition, LevelType levelType, String approxRowCount, Map<String,Annotation> annotationMap)
Creates a level.- Pre-condition:
- parentExp != null || nullParentValue == null, properties != null, levelType != null, hideMemberCondition != null
-
RolapLevel
RolapLevel(RolapHierarchy hierarchy, int depth, MondrianDef.Level xmlLevel)
-
-
Method Detail
-
getHierarchy
public RolapHierarchy getHierarchy()
- Specified by:
getHierarchyin interfaceLevel- Specified by:
getHierarchyin interfaceOlapElement- Overrides:
getHierarchyin classLevelBase
-
getAnnotationMap
public Map<String,Annotation> getAnnotationMap()
Description copied from interface:AnnotatedReturns a list of annotations.The map may be empty, never null.
- Returns:
- Map from annotation name to annotations.
-
getLogger
protected org.apache.log4j.Logger getLogger()
- Specified by:
getLoggerin classOlapElementBase
-
getTableName
String getTableName()
-
getKeyExp
public MondrianDef.Expression getKeyExp()
-
getOrdinalExp
public MondrianDef.Expression getOrdinalExp()
-
getCaptionExp
public MondrianDef.Expression getCaptionExp()
-
hasCaptionColumn
public boolean hasCaptionColumn()
-
getFlags
final int getFlags()
-
getHideMemberCondition
RolapLevel.HideMemberCondition getHideMemberCondition()
-
isUnique
public final boolean isUnique()
-
getDatatype
final Dialect.Datatype getDatatype()
-
getNullParentValue
final String getNullParentValue()
-
isParentChild
public boolean isParentChild()
Returns whether this level is parent-child.
-
getParentExp
MondrianDef.Expression getParentExp()
-
getNameExp
public MondrianDef.Expression getNameExp()
-
init
void init(MondrianDef.CubeDimension xmlDimension)
-
isAll
public final boolean isAll()
-
areMembersUnique
public boolean areMembersUnique()
-
getTableAlias
public String getTableAlias()
-
getProperties
public RolapProperty[] getProperties()
Description copied from interface:LevelReturns properties defined against this level.
-
getInheritedProperties
public Property[] getInheritedProperties()
Description copied from interface:LevelReturns properties defined against this level and parent levels.
-
getApproxRowCount
public int getApproxRowCount()
Description copied from interface:LevelReturns the approximate number of members in this level, orInteger.MIN_VALUEif no approximation is known.
-
getInternalType
public SqlStatement.Type getInternalType()
-
lookupChild
public OlapElement lookupChild(SchemaReader schemaReader, Id.Segment name)
-
lookupChild
public OlapElement lookupChild(SchemaReader schemaReader, Id.Segment name, MatchType matchType)
Description copied from interface:OlapElementLooks up a child element, returning null if it does not exist.- Specified by:
lookupChildin interfaceOlapElement- Overrides:
lookupChildin classLevelBase
-
isSimple
public boolean isSimple()
Indicates that level is not ragged and not a parent/child level.
-
hasClosedPeer
boolean hasClosedPeer()
Returns true when the level is part of a parent/child hierarchy and has an equivalent closed level.
-
getClosedPeer
public RolapLevel getClosedPeer()
-
lookupLevel
public static RolapLevel lookupLevel(RolapLevel[] levels, String levelName)
-
-