/** * find a physical table in the domain * * @param tableId * the table id * @return physical table */ public IPhysicalTable findPhysicalTable( String tableId ) { for ( IPhysicalModel model : getPhysicalModels() ) { for ( IPhysicalTable table : model.getPhysicalTables() ) { if ( tableId.equals( table.getId() ) ) { return table; } } } return null; }
private void moveDimensionToModel( final ModelerWorkspace dimensionWorkspace, final ModelerWorkspace factWorkspace, final String factKey, final String dimKey ) throws ModelerException { DimensionMetaData dimension = getLastDimension( dimensionWorkspace ); dimension.setName( getName() ); removeExistingDimension( factWorkspace ); factWorkspace.addDimension( dimension ); LogicalTable dimTable = dimensionWorkspace.getLogicalModel( ModelerPerspective.ANALYSIS ).getLogicalTables().get( 0 ); LogicalTable factTable = factWorkspace.getLogicalModel( ModelerPerspective.ANALYSIS ).getLogicalTables().get( 0 ); LogicalModel logicalModel = factWorkspace.getLogicalModel( ModelerPerspective.ANALYSIS ); logicalModel.addLogicalTable( dimTable ); @SuppressWarnings( "unchecked" ) List<SqlPhysicalTable> physicalTables = (List<SqlPhysicalTable>) factWorkspace.getDomain().getPhysicalModels().get( 0 ).getPhysicalTables(); physicalTables.add( (SqlPhysicalTable) dimTable.getPhysicalTable() ); logicalModel.addLogicalRelationship( new LogicalRelationship( logicalModel, factTable, dimTable, locateLogicalColumn( factWorkspace, factKey ), locateLogicalColumn( dimensionWorkspace, dimKey ) ) ); }
List<? extends IPhysicalTable> tables = workspace.getDomain().getPhysicalModels().get( 0 ).getPhysicalTables(); Set<String> tableIds = new HashSet<String>();
for ( IPhysicalTable table : domain.getPhysicalModels().get( 0 ).getPhysicalTables() ) { Boolean isFact = (Boolean) table.getProperty( "FACT_TABLE" ); items.add( new AvailableTable( table, isFact == null ? false : isFact.booleanValue() ) );
domain = generator.generateDomain( importStrategy ); for ( IPhysicalModel physicalModel : domain.getPhysicalModels() ) { for ( IPhysicalTable physicalTable : physicalModel.getPhysicalTables() ) { physicalTable.setName( new LocalizedString( locale, datasourceName ) );
targetTable = ( (SqlPhysicalTable) domain.getPhysicalModels().get( 0 ).getPhysicalTables().get( 0 ) ).getTargetTable(); DatasourceDTO datasource = null;
public void refresh( Domain newDomain ) throws ModelerException { for ( IPhysicalTable table : newDomain.getPhysicalModels().get( 0 ).getPhysicalTables() ) { boolean isFact = table.getProperty( "FACT_TABLE" ) != null ? (Boolean) table.getProperty( "FACT_TABLE" ) : false; items.add( new AvailableTable( table, isFact ) );