mondrian.rolap.aggmatcher
Class DefaultRecognizer

java.lang.Object
  extended by mondrian.rolap.aggmatcher.Recognizer
      extended by 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
DefaultRecognizer(DefaultRules aggDefault, RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder)
           
 
Method Summary
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  boolean matchLevel(Hierarchy hierarchy, HierarchyUsage hierarchyUsage, RolapLevel level)
          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, makeLevel, makeMeasure, makeMeasure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 class Recognizer

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 class Recognizer

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 class Recognizer
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 class Recognizer

matchLevel

protected boolean matchLevel(Hierarchy hierarchy,
                             HierarchyUsage hierarchyUsage,
                             RolapLevel level)
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 and true is returned.

Specified by:
matchLevel in class Recognizer

SourceForge.net_Logo