Class ExplicitRecognizer
- java.lang.Object
-
- mondrian.rolap.aggmatcher.Recognizer
-
- mondrian.rolap.aggmatcher.ExplicitRecognizer
-
class ExplicitRecognizer extends Recognizer
This is the Recognizer for the aggregate table descriptions that appear in the catalog schema files; the user explicitly defines the aggregate.- Author:
- Richard M. Emberson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class mondrian.rolap.aggmatcher.Recognizer
Recognizer.Matcher
-
-
Field Summary
-
Fields inherited from class mondrian.rolap.aggmatcher.Recognizer
aggTable, dbFactTable, msgRecorder, returnValue, star
-
-
Constructor Summary
Constructors Constructor Description ExplicitRecognizer(ExplicitRules.TableDef tableDef, RolapStar star, RolapCube cube, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
checkMeasures()
Make the measures for this aggregate table.protected Recognizer.Matcher
getFactCountMatcher()
Get the Matcher to be used to match the column which is the fact count column.protected Recognizer.Matcher
getIgnoreMatcher()
Get the Matcher to be used to match columns to be ignored.protected ExplicitRules.TableDef
getTableDef()
Get the ExplicitRules.TableDef associated with this instance.protected void
makeMeasure(ExplicitRules.TableDef.Measure measure, RolapAggregator factAgg, JdbcSchema.Table.Column aggColumn)
Make a measure.protected int
matchForeignKey(JdbcSchema.Table.Column.Usage factUsage)
Creates a foreign key usage.protected void
matchLevels(Hierarchy hierarchy, HierarchyUsage hierarchyUsage)
Creates a level usage.-
Methods inherited from class mondrian.rolap.aggmatcher.Recognizer
check, checkFactCount, checkForeignKeys, checkIgnores, checkLevels, checkNosMeasures, checkUnusedColumns, convertAggregator, convertAggregator, findCubes, generateImpliedMeasures, getColumnName, inNotSeenForeignKeys, lookupInChildren, makeFactCount, makeForeignKey, makeIgnore, makeLevelColumnUsage, makeMeasure, makeMeasure
-
-
-
-
Constructor Detail
-
ExplicitRecognizer
ExplicitRecognizer(ExplicitRules.TableDef tableDef, RolapStar star, RolapCube cube, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder)
-
-
Method Detail
-
getTableDef
protected ExplicitRules.TableDef getTableDef()
Get the ExplicitRules.TableDef associated with this instance.
-
getIgnoreMatcher
protected Recognizer.Matcher getIgnoreMatcher()
Get the Matcher to be used to match columns to be ignored.- Specified by:
getIgnoreMatcher
in classRecognizer
-
getFactCountMatcher
protected Recognizer.Matcher getFactCountMatcher()
Get the Matcher to be used to match the column which is the fact count column.- Specified by:
getFactCountMatcher
in classRecognizer
-
checkMeasures
protected int checkMeasures()
Make the measures for this aggregate table.First, iterate through all of the columns in the table. For each column, iterate through all of the tableDef measures, the explicit definitions of a measure. If the table's column name matches the column name in the measure definition, then make a measure. Next, look through all of the fact table column usage measures. For each such measure usage that has a sibling foreign key usage see if the tableDef has a foreign key defined with the same name. If so, then, for free, we can make a measure for the aggregate using its foreign key.
- Specified by:
checkMeasures
in classRecognizer
- Returns:
- number of measures created.
-
makeMeasure
protected void makeMeasure(ExplicitRules.TableDef.Measure measure, RolapAggregator factAgg, JdbcSchema.Table.Column aggColumn)
Make a measure. This makes a measure usage using the Aggregator found in the RolapStar.Measure associated with the ExplicitRules.TableDef.Measure.
-
matchForeignKey
protected int matchForeignKey(JdbcSchema.Table.Column.Usage factUsage)
Creates a foreign key usage.First the column name of the fact usage which is a foreign key is used to search for a foreign key definition in the ExplicitRules.tableDef. If not found, thats ok, it is just a lost dimension. If found, look for a column in the aggregate table with that name and make a foreign key usage.
- Specified by:
matchForeignKey
in classRecognizer
-
matchLevels
protected void matchLevels(Hierarchy hierarchy, HierarchyUsage hierarchyUsage)
Creates a level usage. A level usage is a column that is used in a collapsed dimension aggregate table.First, iterate through the ExplicitRules.TableDef's level definitions for one with a name equal to the RolapLevel unique name, i.e., [Time].[Quarter]. Now, using the level's column name, search through the aggregate table's columns for one with that name and make a level usage for the column.
- Specified by:
matchLevels
in classRecognizer
-
-