use of com.yahoo.elide.modelconfig.model.Dimension in project elide by yahoo.
the class DynamicConfigValidator method populateInheritance.
private void populateInheritance(Table table, Set<Table> processed) {
if (processed.contains(table)) {
return;
}
processed.add(table);
if (!table.hasParent()) {
return;
}
Table parent = table.getParent(this.elideTableConfig);
if (!processed.contains(parent)) {
populateInheritance(parent, processed);
}
Map<String, Measure> measures = getInheritedMeasures(parent, attributesListToMap(table.getMeasures()));
table.setMeasures(new ArrayList<>(measures.values()));
Map<String, Dimension> dimensions = getInheritedDimensions(parent, attributesListToMap(table.getDimensions()));
table.setDimensions(new ArrayList<>(dimensions.values()));
Map<String, Join> joins = getInheritedJoins(parent, attributesListToMap(table.getJoins()));
table.setJoins(new ArrayList<>(joins.values()));
String schema = getInheritedSchema(parent, table.getSchema());
table.setSchema(schema);
String dbConnectionName = getInheritedConnection(parent, table.getDbConnectionName());
table.setDbConnectionName(dbConnectionName);
String sql = getInheritedSql(parent, table.getSql());
table.setSql(sql);
String tableName = getInheritedTable(parent, table.getTable());
table.setTable(tableName);
List<Argument> arguments = getInheritedArguments(parent, table.getArguments());
table.setArguments(arguments);
// isFact, isHidden, ReadAccess, namespace have default Values in schema, so can not be inherited.
// Other properties (tags, cardinality, etc.) have been categorized as non-inheritable too.
}