/** * Get all fact tables of the cube. * * @param cube Cube object * @return List of fact tables * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts()) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
/** * Get all facts of cube (optional virtual facts) * * @param cube Cube object * @param includeVirtualFacts set true for virtual facts * @return List of fact tables with optional virtual facts * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube, boolean includeVirtualFacts) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts(includeVirtualFacts)) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
/** * Get all fact tables of the cube. * * @param cube Cube object * @return List of fact tables * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts()) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
/** * Get all facts of cube (optional virtual facts) * * @param cube Cube object * @param includeVirtualFacts set true for virtual facts * @return List of fact tables with optional virtual facts * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube, boolean includeVirtualFacts) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts(includeVirtualFacts)) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
public static XFactTable factTableFromCubeFactTable(FactTable cFact) { XFactTable fact = XCF.createXFactTable(); fact.setName(cFact.getName()); fact.setColumns(new XColumns()); fact.setProperties(new XProperties()); fact.setStorageTables(new XStorageTables()); fact.getProperties().getProperty().addAll(xPropertiesFromMap(cFact.getProperties())); fact.getColumns().getColumn().addAll(columnsFromFieldSchemaList(cFact.getColumns())); fact.setWeight(cFact.weight()); fact.setCubeName(cFact.getCubeName()); return fact; }
public static XFactTable factTableFromCubeFactTable(FactTable cFact) { XFactTable fact = XCF.createXFactTable(); fact.setName(cFact.getName()); fact.setColumns(new XColumns()); fact.setProperties(new XProperties()); fact.setStorageTables(new XStorageTables()); fact.getProperties().getProperty().addAll(xPropertiesFromMap(cFact.getProperties())); fact.getColumns().getColumn().addAll(columnsFromFieldSchemaList(cFact.getColumns())); fact.setWeight(cFact.weight()); fact.setCubeName(cFact.getCubeName()); return fact; }