protected static LogicalTable findCorrespondingOlapTable( LogicalTable relationalTable, LogicalModel olapModel ) { for ( LogicalTable table : olapModel.getLogicalTables() ) { if ( table.getPhysicalTable().getId().equals( relationalTable.getPhysicalTable().getId() ) ) { return table; } } return null; }
public LogicalTable findLogicalTable( IPhysicalTable table, ModelerPerspective perspective ) { LogicalModel logicalModel = this.getLogicalModel( perspective ); if ( logicalModel == null ) { return null; } for ( LogicalTable logicalTable : logicalModel.getLogicalTables() ) { if ( logicalTable.getPhysicalTable().equals( table ) || logicalTable.getPhysicalTable().getId().equals( table.getId() ) || logicalTable.getId().equals( table.getId() ) ) { return logicalTable; // boolean isOlapTable = logicalTable.getId().endsWith(BaseModelerWorkspaceHelper.OLAP_SUFFIX); // if (perspective == ModelerPerspective.ANALYSIS && isOlapTable) { // return logicalTable; // } else if (perspective == ModelerPerspective.REPORTING && !isOlapTable) { // return logicalTable; // } } } return null; }
/** * 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; }
@Override public boolean acceptsDrop( Object obj ) { String myTableId = this.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId(); if ( obj instanceof AvailableField ) { AvailableField field = (AvailableField) obj; return myTableId.equals( field.getPhysicalColumn().getPhysicalTable().getId() ); } else if ( obj instanceof MemberPropertyMetaData ) { MemberPropertyMetaData field = (MemberPropertyMetaData) obj; if ( field.getLogicalColumn() != null ) { return myTableId.equals( field.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ); } } return false; }
public LogicalColumn findLogicalColumn( IPhysicalColumn column, ModelerPerspective perspective ) { LogicalColumn col = null; IPhysicalTable physicalTable = column.getPhysicalTable(); LogicalModel logicalModel = this.getLogicalModel( perspective ); if ( logicalModel == null ) { return col; } for ( LogicalTable table : logicalModel.getLogicalTables() ) { if ( table.getPhysicalTable().getId().equals( physicalTable.getId() ) ) { if ( ( perspective == ModelerPerspective.ANALYSIS && table.getId().endsWith( BaseModelerWorkspaceHelper.OLAP_SUFFIX ) ) || ( perspective == ModelerPerspective.REPORTING && !table.getId().endsWith( BaseModelerWorkspaceHelper.OLAP_SUFFIX ) ) ) { for ( LogicalColumn lCol : table.getLogicalColumns() ) { if ( lCol.getPhysicalColumn().getId().equals( column.getId() ) ) { return lCol; } } } } } return col; }
@Override public boolean acceptsDrop( Object obj ) { boolean isSupportedType = false; isSupportedType = ( obj instanceof AvailableField || obj instanceof LevelMetaData || obj instanceof MeasureMetaData || obj instanceof MemberPropertyMetaData ); // get the columns of children, make sure the potential drop object is backed by the same table if ( isSupportedType ) { if ( size() == 0 ) { // no children to compare tables with, accept the drop return true; } LevelMetaData level = this.get( 0 ); if ( level.getLogicalColumn() == null ) { return false; // make them fix the broken column first } String myTableId = level.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId(); if ( obj instanceof AvailableField ) { AvailableField field = (AvailableField) obj; return myTableId.equals( field.getPhysicalColumn().getPhysicalTable().getId() ); } else if ( obj instanceof ColumnBackedNode ) { // this will take care of both Levels & Measures ColumnBackedNode field = (ColumnBackedNode) obj; return myTableId.equals( field.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ); } } return false; }
if ( !tableIds.contains( table.getId() ) ) { tableIds.add( table.getId() ); String catName = BaseModelerWorkspaceHelper.getCleanCategoryName( table.getName( locale ), workspace, tableIds.size() ); if ( aTable.isSameUnderlyingPhysicalTable( table ) ) { for ( AvailableField field : aTable.getAvailableFields() ) { if ( field.getPhysicalColumn().getPhysicalTable().getId().equals( table.getId() ) ) { category.add( workspace.createFieldForParentWithNode( category, field ) );
"BUSINESS_TABLE_PHYSICAL_TABLE_NAME", table.getPhysicalTable().getId(),
for ( AvailableField f : table.getAvailableFields() ) { if ( f.getPhysicalColumn().getId().equals( measure.getLogicalColumn().getPhysicalColumn().getId() ) && f.getPhysicalColumn().getPhysicalTable().getId().equals( measure.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ) ) { for ( AvailableField f : table.getAvailableFields() ) { if ( f.getPhysicalColumn().getId().equals( lm.getLogicalColumn().getPhysicalColumn().getId() ) && f.getPhysicalColumn().getPhysicalTable().getId().equals( lm.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ) ) { for ( AvailableField f : table.getAvailableFields() ) { if ( f.getPhysicalColumn().getId().equals( field.getLogicalColumn().getPhysicalColumn().getId() ) && f.getPhysicalColumn().getPhysicalTable().getId().equals( field.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ) ) {