Package mondrian.rolap.aggmatcher
Class ExplicitRules.TableDef
- java.lang.Object
-
- mondrian.rolap.aggmatcher.ExplicitRules.TableDef
-
- Direct Known Subclasses:
ExplicitRules.PatternTableDef
- Enclosing class:
- ExplicitRules
public abstract static class ExplicitRules.TableDef extends Object
This is the base class for the exact name based and name pattern based aggregate table mapping definitions. It contains the mappings for the fact count column, optional ignore columns, foreign key mappings, measure column mappings and level column mappings.
-
-
Field Summary
Fields Modifier and Type Field Description protected ExplicitRules.GroupaggGroupprotected intapproxRowCountprotected StringfactCountNameprotected intidprotected booleanignoreCaseprotected List<String>ignoreColumnNamesprotected Map<String,String>measuresFactCount
-
Constructor Summary
Constructors Modifier Constructor Description protectedTableDef(boolean ignoreCase, ExplicitRules.Group aggGroup)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidadd(mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Level level)Adds a Level.protected voidadd(mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Measure measure)Adds a Measure.protected voidaddFK(MondrianDef.AggForeignKey fk)Add foreign key mapping entry (maps from fact table foreign key column name to aggregate table foreign key column name).protected voidaddIgnoreColumnName(String ignoreName)Adds the name of an aggregate table column that is to be ignored.static voidaddLevelTo(ExplicitRules.TableDef tableDef, String name, String columnName, boolean collapsed, String ordinalColumn, String captionColumn, MondrianDef.AggLevelProperty[] properties)static voidaddMeasureTo(ExplicitRules.TableDef tableDef, String name, String column, String rollupType)booleancolumnsOK(RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table dbTable, MessageRecorder msgRecorder)Checks that ALL of the columns in the dbTable have a mapping in the tableDef.ExplicitRules.GroupgetAggGroup()Get the Group with which is a part.protected StringgetAggregateFK(String baseFK)Get the name of the aggregate table's foreign key column that matches the base fact table's foreign key column or return null.intgetApproxRowCount()Returns an approximate number of rows in this table.protected mondrian.rolap.aggmatcher.Recognizer.MatchergetFactCountMatcher()Get Matcher for the fact count column.protected StringgetFactCountName()Get the name of the fact count column.protected Iterator<String>getIgnoreColumnNames()Get an Iterator over all ignore column name entries.protected mondrian.rolap.aggmatcher.Recognizer.MatchergetIgnoreMatcher()Get Matcher for ignore columns.List<mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Level>getLevels()Gets all level mappings.protected mondrian.rolap.aggmatcher.Recognizer.MatchergetMeasureFactCountMatcher()List<mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Measure>getMeasures()Gets all level mappings.Map<String,String>getMeasuresFactCount()RolapStargetStar()Get the RolapStar associated with this cube.booleanisIgnoreCase()Return true if this name/pattern matching ignores case.abstract booleanmatches(String tableName)Does the TableDef match a table with name tableName.voidprint(PrintWriter pw, String prefix)protected voidsetFactCountName(String factCountName)Set the name of the fact count column.StringtoString()voidvalidate(MessageRecorder msgRecorder)Validate the Levels and Measures, also make sure each definition is different, both name and column.
-
-
-
Field Detail
-
id
protected final int id
-
ignoreCase
protected final boolean ignoreCase
-
aggGroup
protected final ExplicitRules.Group aggGroup
-
factCountName
protected String factCountName
-
approxRowCount
protected int approxRowCount
-
-
Constructor Detail
-
TableDef
protected TableDef(boolean ignoreCase, ExplicitRules.Group aggGroup)
-
-
Method Detail
-
addLevelTo
public static void addLevelTo(ExplicitRules.TableDef tableDef, String name, String columnName, boolean collapsed, String ordinalColumn, String captionColumn, MondrianDef.AggLevelProperty[] properties)
-
addMeasureTo
public static void addMeasureTo(ExplicitRules.TableDef tableDef, String name, String column, String rollupType)
-
getApproxRowCount
public int getApproxRowCount()
Returns an approximate number of rows in this table. A negative value indicates that no estimate is available.- Returns:
- An estimated row count, or a negative value if no row count approximation was available.
-
isIgnoreCase
public boolean isIgnoreCase()
Return true if this name/pattern matching ignores case.
-
getStar
public RolapStar getStar()
Get the RolapStar associated with this cube.
-
getAggGroup
public ExplicitRules.Group getAggGroup()
Get the Group with which is a part.
-
getFactCountName
protected String getFactCountName()
Get the name of the fact count column.
-
setFactCountName
protected void setFactCountName(String factCountName)
Set the name of the fact count column.
-
getIgnoreColumnNames
protected Iterator<String> getIgnoreColumnNames()
Get an Iterator over all ignore column name entries.
-
getLevels
public List<mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Level> getLevels()
Gets all level mappings.
-
getMeasures
public List<mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Measure> getMeasures()
Gets all level mappings.
-
getIgnoreMatcher
protected mondrian.rolap.aggmatcher.Recognizer.Matcher getIgnoreMatcher()
Get Matcher for ignore columns.
-
getFactCountMatcher
protected mondrian.rolap.aggmatcher.Recognizer.Matcher getFactCountMatcher()
Get Matcher for the fact count column.
-
getMeasureFactCountMatcher
protected mondrian.rolap.aggmatcher.Recognizer.Matcher getMeasureFactCountMatcher()
-
columnsOK
public boolean columnsOK(RolapStar star, JdbcSchema.Table dbFactTable, JdbcSchema.Table dbTable, MessageRecorder msgRecorder)
Checks that ALL of the columns in the dbTable have a mapping in the tableDef.It is an error if there is a column that does not have a mapping.
-
addIgnoreColumnName
protected void addIgnoreColumnName(String ignoreName)
Adds the name of an aggregate table column that is to be ignored.
-
addFK
protected void addFK(MondrianDef.AggForeignKey fk)
Add foreign key mapping entry (maps from fact table foreign key column name to aggregate table foreign key column name).
-
getAggregateFK
protected String getAggregateFK(String baseFK)
Get the name of the aggregate table's foreign key column that matches the base fact table's foreign key column or return null.
-
add
protected void add(mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Level level)
Adds a Level.
-
add
protected void add(mondrian.rolap.aggmatcher.ExplicitRules.TableDef.Measure measure)
Adds a Measure.
-
matches
public abstract boolean matches(String tableName)
Does the TableDef match a table with name tableName.
-
validate
public void validate(MessageRecorder msgRecorder)
Validate the Levels and Measures, also make sure each definition is different, both name and column.
-
print
public void print(PrintWriter pw, String prefix)
-
-