mondrian.rolap.aggmatcher
Class ExplicitRecognizer

java.lang.Object
  extended by mondrian.rolap.aggmatcher.Recognizer
      extended by 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
ExplicitRecognizer(ExplicitRules.TableDef tableDef, RolapStar star, RolapCube cube, JdbcSchema.Table dbFactTable, JdbcSchema.Table aggTable, MessageRecorder msgRecorder)
           
 
Method Summary
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)
          This creates a foreign key usage.
protected  boolean matchLevel(Hierarchy hierarchy, HierarchyUsage hierarchyUsage, RolapLevel rlevel)
          This 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, makeLevel, makeMeasure, makeMeasure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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

Parameters:
measure -
aggColumn -

matchForeignKey

protected int matchForeignKey(JdbcSchema.Table.Column.Usage factUsage)
This 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 class Recognizer

matchLevel

protected boolean matchLevel(Hierarchy hierarchy,
                             HierarchyUsage hierarchyUsage,
                             RolapLevel rlevel)
This 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. Return true if the aggregate table's column was found.

Specified by:
matchLevel in class Recognizer

SourceForge.net_Logo