1. tbrugz
  2. sqldump

Commits

tbrugz  committed bc24f70

mondrian: procHierRecursive() small refactoring

  • Participants
  • Parent commits d480632
  • Branches default

Comments (0)

Files changed (1)

File src_mondrian/tbrugz/sqldump/mondrianschema/MondrianSchemaDumper.java

View file
  • Ignore whitespace
 		}
 		
 		if(!isLevelLeaf) { return; }
-		{
+		makeLeafLevel(pkTable, cube, dim, thisLevels);
+	}
+	
+	void makeLeafLevel(Table pkTable, Cube cube, Dimension dim, List<HierarchyLevelData> thisLevels) throws XOMException {
 			Hierarchy hier = new Hierarchy();
 			//hier.setPrimaryKey(fk.pkColumns.iterator().next());
 			hier.primaryKey = sqlIdDecorator.get( thisLevels.get(0).levelColumn );
 			//Table / Join
 			if(thisLevels.size()==1) {
 				mondrian.olap.MondrianDef.Table table = new mondrian.olap.MondrianDef.Table();
-				table.schema = schemaName;
-				table.name = sqlIdDecorator.get( pkTableName );
+				table.schema = pkTable.getSchemaName();
+				table.name = sqlIdDecorator.get( pkTable.getName() );
 				
 				hier.relation = table;
 			}
 			else {
 				dim.hierarchies = concatenate(dim.hierarchies, new Hierarchy[]{hier});
 			}
-		}
 	}
 	
 	boolean isCycle(List<HierarchyLevelData> hierdata) {