public boolean isSameUnderlyingPhysicalColumn( IPhysicalColumn column ) { IPhysicalTable table = column.getPhysicalTable(); return getPhysicalColumn().getId().equals( column.getId() ) && getPhysicalColumn().getPhysicalTable().getId().equals( table.getId() ); } }
@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; }
@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; }
@Override public IPhysicalTable getTableRestriction() { // if the level has children (member props), restrict to the current table if ( this.size() > 0 && this.getLogicalColumn() != null ) { return this.getLogicalColumn().getPhysicalColumn().getPhysicalTable(); } // restricted by siblings table if ( parent != null && parent.size() > 0 ) { for ( LevelMetaData sibling : getHierarchyMetaData() ) { if ( sibling != this && sibling.getLogicalColumn() != null ) { return sibling.getLogicalColumn().getPhysicalColumn().getPhysicalTable(); } } } return null; }
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 IPhysicalTable getTableRestriction() { // restrict to the table of the parent Level if ( ( (LevelMetaData) getParent() ).getLogicalColumn() != null ) { return ( (LevelMetaData) getParent() ).getLogicalColumn().getPhysicalColumn().getPhysicalTable(); } return ( (LevelMetaData) getParent() ).getTableRestriction(); } }
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() ) ) {
if ( aTable.isSameUnderlyingPhysicalTable( table ) ) { for ( AvailableField field : aTable.getAvailableFields() ) { if ( field.getPhysicalColumn().getPhysicalTable().getId().equals( table.getId() ) ) { category.add( workspace.createFieldForParentWithNode( category, field ) );
@Override public boolean acceptsDrop( Object obj ) { boolean isSupportedType = false; isSupportedType = ( obj instanceof AvailableField || obj instanceof AvailableTable || obj instanceof MeasureMetaData ); if ( !isSupportedType ) { return false; } if ( obj instanceof MeasureMetaData ) { return true; } else if ( obj instanceof AvailableField ) { AvailableField field = (AvailableField) obj; if ( isFactTable( field.getPhysicalColumn().getPhysicalTable() ) || getWorkspace().getAvailableTables().size() == 1 ) { return true; } } else if ( obj instanceof AvailableTable ) { AvailableTable field = (AvailableTable) obj; if ( isFactTable( field.getPhysicalTable() ) || getWorkspace().getAvailableTables().size() == 1 ) { return true; } } return false; }
public ColumnBackedNode createColumnBackedNode( AvailableField field, ModelerPerspective perspective ) { String locale = workspaceHelper.getLocale(); ColumnBackedNode node = new BaseColumnBackedMetaData( field.getName() ); LogicalTable lTab = findLogicalTable( field.getPhysicalColumn().getPhysicalTable(), perspective ); LogicalColumn lCol = null;
schemaMeta.findPhysicalColumn( column.getPhysicalColumn().getPhysicalTable().getId(), column .getPhysicalColumn().getId() );