/** * Returns the hierarchies on a non-filter axis. * * @return List of hierarchies, never null */ private List<Hierarchy> getHierarchiesNonFilter() { final Exp exp = queryAxis.getSet(); if (exp == null) { return Collections.emptyList(); } Type type = exp.getType(); if (type instanceof SetType) { type = ((SetType) type).getElementType(); } final MondrianOlap4jConnection olap4jConnection = cellSetMetaData.olap4jStatement.olap4jConnection; if (type instanceof TupleType) { final TupleType tupleType = (TupleType) type; List<Hierarchy> hierarchyList = new ArrayList<Hierarchy>(); for (Type elementType : tupleType.elementTypes) { hierarchyList.add(olap4jConnection.toOlap4j(elementType.getHierarchy())); } return hierarchyList; } else { return Collections.singletonList((Hierarchy) olap4jConnection.toOlap4j(type.getHierarchy())); } }
public static LevelType forType(Type type) { return new LevelType(type.getDimension(), type.getHierarchy(), type.getLevel()); }