Class DefaultRecognizer
- java.lang.Object
-
- mondrian.rolap.aggmatcher.Recognizer
-
- mondrian.rolap.aggmatcher.DefaultRecognizer
-
class DefaultRecognizer extends Recognizer
This is the default Recognizer. It uses the rules found in the file DefaultRules.xml to find aggregate tables and there columns.- 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 DefaultRecognizer(DefaultRules aggDefault, RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
checkMeasures()
Create measures for an 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 Recognizer.Matcher
getMeasureMatcher(JdbcSchema.Table.Column.Usage factUsage)
Get the Match used to identify columns that are measures.(package private) DefaultRules
getRules()
Get the DefaultRules instance associated with this object.protected int
matchForeignKey(JdbcSchema.Table.Column.Usage factUsage)
This creates a foreign key usage.protected void
matchLevels(Hierarchy hierarchy, HierarchyUsage hierarchyUsage)
Create level usages.-
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
-
DefaultRecognizer
DefaultRecognizer(DefaultRules aggDefault, RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder)
-
-
Method Detail
-
getRules
DefaultRules getRules()
Get the DefaultRules instance associated with this object.
-
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
-
getMeasureMatcher
protected Recognizer.Matcher getMeasureMatcher(JdbcSchema.Table.Column.Usage factUsage)
Get the Match used to identify columns that are measures.
-
checkMeasures
protected int checkMeasures()
Create measures for an aggregate table.First, iterator through all fact table measure usages. Create a Matcher for each such usage. Iterate through all aggregate table columns. For each column that matches create a measure usage.
Per fact table measure usage, at most only one aggregate measure should be created.
- Specified by:
checkMeasures
in classRecognizer
- Returns:
- number of measures created.
-
matchForeignKey
protected int matchForeignKey(JdbcSchema.Table.Column.Usage factUsage)
This creates a foreign key usage.Using the foreign key Matcher with the fact usage's column name the aggregate table's columns are searched for one that matches. For each that matches a foreign key usage is created (thought if more than one is created its is an error which is handled in the calling code.
- Specified by:
matchForeignKey
in classRecognizer
-
matchLevels
protected void matchLevels(Hierarchy hierarchy, HierarchyUsage hierarchyUsage)
Create level usages.A Matcher is created using the Hierarchy's name, the RolapLevel name, and the column name associated with the RolapLevel's key expression. The aggregate table columns are search for the first match and, if found, a level usage is created for that column.
- Specified by:
matchLevels
in classRecognizer
-
-