protected String getColumnNameFromLogicalColumn( LogicalColumn col ) { String columnName = ""; //$NON-NLS-1$ if ( col != null ) { IPhysicalColumn physicalColumn = col.getPhysicalColumn(); if ( physicalColumn != null ) { columnName = physicalColumn.getName( locale ); } } return columnName; }
@Bindable public void setColumnName( LogicalColumn col ) { String prevName = this.colName; // TODO: GWT LanguageChoice.getInstance().getDefaultLocale().toString() this.colName = ( col != null && col.getPhysicalColumn() != null ) ? col.getPhysicalColumn().getName( locale ) : ""; //$NON-NLS-1$ this.firePropertyChange( "columnName", prevName, this.colName ); //$NON-NLS-1$ }
private LogicalColumn findBusinessColumn( LogicalTable logicalTable, String columnName ) { for ( LogicalColumn logicalColumn : logicalTable.getLogicalColumns() ) { if ( columnName.equals( ( (SqlPhysicalColumn) logicalColumn.getPhysicalColumn() ).getTargetColumn() ) ) { return logicalColumn; } } return null; }
protected static LogicalColumn findCorrespondingOlapColumn( LogicalColumn relationalColumn, LogicalModel olapModel ) { LogicalTable olapTable = findCorrespondingOlapTable( relationalColumn.getLogicalTable(), olapModel ); if ( olapTable != null ) { for ( LogicalColumn col : olapTable.getLogicalColumns() ) { if ( col.getPhysicalColumn().getId().equals( relationalColumn.getPhysicalColumn().getId() ) ) { return col; } } } 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; }
@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 protected void removeAutoMeasure( final ModelerWorkspace workspace, final String column ) { LogicalColumn logicalColumn = locateLogicalColumn( workspace, column ); String locale = workspace.getWorkspaceHelper().getLocale(); for ( MeasureMetaData measure : workspace.getModel().getMeasures() ) { if ( measureNameEquals( column, measure ) && measure.getLogicalColumn().getPhysicalColumn().getName( locale ).equals( logicalColumn.getPhysicalColumn().getName( locale ) ) && measure.getDefaultAggregation().equals( AggregationType.SUM ) && !measure.getMemberAnnotations().containsKey( GeneratedbyMemberAnnotation.GEBERATED_BY_STRING ) ) { workspace.getModel().getMeasures().remove( measure ); break; } } }
@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() { // restrict to the table of the parent Level if ( ( (LevelMetaData) getParent() ).getLogicalColumn() != null ) { return ( (LevelMetaData) getParent() ).getLogicalColumn().getPhysicalColumn().getPhysicalTable(); } return ( (LevelMetaData) getParent() ).getTableRestriction(); } }
private void upConvertMeasuresAndDimensions() { if ( domain.getLogicalModels().size() == 1 ) { return; } LogicalModel model = domain.getLogicalModels().get( 1 ); // clean out the tables, we'll recreate the logical columns for ( LogicalTable table : model.getLogicalTables() ) { table.getLogicalColumns().clear(); } // set the dimension logical column references to the new olap columns for ( DimensionMetaData dim : getModel().getDimensions() ) { for ( HierarchyMetaData hier : dim ) { for ( LevelMetaData level : hier ) { // create new logical columns AvailableField field = new AvailableField( level.getLogicalColumn().getPhysicalColumn() ); ColumnBackedNode node = createColumnBackedNode( field, ModelerPerspective.ANALYSIS ); level.setLogicalColumn( node.getLogicalColumn() ); } } } // set the measure logical column references to the new olap columns for ( MeasureMetaData measure : getModel().getMeasures() ) { AvailableField field = new AvailableField( measure.getLogicalColumn().getPhysicalColumn() ); ColumnBackedNode node = createColumnBackedNode( field, ModelerPerspective.ANALYSIS ); measure.setLogicalColumn( node.getLogicalColumn() ); } // make sure the relationships are set too ModelerConversionUtil.duplicateRelationshipsForOlap( domain.getLogicalModels().get( 0 ), model ); return; }
"BUSINESS_COLUMN_BUSINESS_TABLE", column.getLogicalTable().getId(), idGen.getNextId() ) ); //$NON-NLS-1$ modelElement.appendChild( createTaggedValue( doc, "BUSINESS_COLUMN_PHYSICAL_COLUMN_NAME", column.getPhysicalColumn().getId(),
if ( logicalColumn.getPhysicalColumn().getProperty( "target_column" ).equals( joinModel.getLeftKeyFieldModel().getName() ) ) { fromColumn = logicalColumn; if ( logicalColumn.getPhysicalColumn().getProperty( "target_column" ).equals( joinModel.getRightKeyFieldModel().getName() ) ) { toColumn = logicalColumn;
for ( AvailableTable table : tablesList ) { 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 ( AvailableTable table : tablesList ) { 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 ( AvailableTable table : tablesList ) { for ( AvailableField f : table.getAvailableFields() ) { if ( f.getPhysicalColumn().getId().equals( field.getLogicalColumn().getPhysicalColumn().getId() ) && f.getPhysicalColumn().getPhysicalTable().getId().equals( field.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ) ) {
LogicalColumn olapCol = new LogicalColumn(); olapCol.setLogicalTable( copiedTable ); olapCol.setPhysicalColumn( col.getPhysicalColumn() ); olapCol.setDataType( col.getDataType() ); if ( col.getPhysicalColumn().getAggregationList() != null ) { olapCol.setAggregationList( col.getPhysicalColumn().getAggregationList() ); if ( col.getPhysicalColumn().getAggregationType() != null ) { olapCol.setAggregationType( col.getPhysicalColumn().getAggregationType() ); } else { if ( olapCol.getDataType().equals( DataType.NUMERIC ) ) { + ModelerWorkspace.toId( col.getPhysicalColumn().getId() ) + BaseModelerWorkspaceHelper.OLAP_SUFFIX;
&& locationField.isSameUnderlyingPhysicalColumn( level.getLogicalColumn().getPhysicalColumn() ) ) { for ( LevelMetaData existingLevel : existingHier ) { if ( locationField .isSameUnderlyingPhysicalColumn( existingLevel.getLogicalColumn().getPhysicalColumn() ) ) { setLocationMemberAnnotations( existingLevel, locationRole );
String fieldName = ( (InlineEtlPhysicalColumn) selection.getLogicalColumn().getPhysicalColumn() ).getFieldName(); String useFieldName = fieldName; int count = 1; for ( int i = 0; i < allSelections.size(); i++ ) { Selection selection = allSelections.get( i ); String fieldName = ( (InlineEtlPhysicalColumn) selection.getLogicalColumn().getPhysicalColumn() ).getFieldName(); String renameFieldName = selectionFieldNames.get( selection );
schemaMeta.findPhysicalColumn( column.getPhysicalColumn().getPhysicalTable().getId(), column .getPhysicalColumn().getId() );
logicalColumn ) ) { String targetColumn = (String) logicalColumn.getPhysicalColumn().getProperty( SqlPhysicalColumn.TARGET_COLUMN ); MeasureMetaData measureMetaData = new MeasureMetaData( targetColumn,