use of mondrian.olap.MondrianDef.FactLink in project collect by openforis.
the class Mondrian4SchemaGenerator method createDimensionLink.
private DimensionLink createDimensionLink(Dimension dimension, AttributeDefinition attrDef) {
DimensionLink dimensionLink;
if (attrDef instanceof CodeAttributeDefinition) {
CodeAttributeDefinition codeAttrDef = (CodeAttributeDefinition) attrDef;
if (codeAttrDef.isMultiple()) {
dimensionLink = new NoLink();
} else if (codeAttrDef.getList().isExternal()) {
dimensionLink = new FactLink();
} else {
dimensionLink = new ForeignKeyLink();
DataTable dataTable = rdbSchema.getDataTable(attrDef.getParentEntityDefinition());
CodeValueFKColumn fkColumn = dataTable.getForeignKeyCodeColumn((CodeAttributeDefinition) attrDef);
((ForeignKeyLink) dimensionLink).foreignKeyColumn = fkColumn.getName();
}
} else {
dimensionLink = new FactLink();
}
dimensionLink.dimension = dimension.name;
return dimensionLink;
}
Aggregations