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; }
private static LogicalRelationship findRelationshipUsing( LogicalModel model, LogicalTable one, LogicalTable two ) { for ( LogicalRelationship rel : model.getLogicalRelationships() ) { if ( rel.isUsingTable( one ) && rel.isUsingTable( two ) ) { return rel; } } return null; }
/** * The security parent for category is the logical model. */ @Override public IConcept getSecurityParentConcept() { return getParent(); }
private LogicalColumn findPrimaryKeyFor( LogicalModel model, LogicalTable factTable, LogicalTable dimTable ) { LogicalRelationship ship = model.findRelationshipUsing( dimTable, factTable ); if ( ship == null ) { throw new IllegalStateException( "Unable to find a primary key for table: " + dimTable.getId() ); } if ( ship.getFromTable().equals( dimTable ) ) { return ship.getFromColumn(); } else { return ship.getToColumn(); } }
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; }
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; }
@Override public void serializeIntoDomain( Domain d ) { LogicalModel lm = d.getLogicalModels().get( 0 ); lm.setProperty( "source_type", SOURCE_TYPE ); }
public Category findCategory( String categoryId ) { for ( Category category : getCategories() ) { if ( categoryId.equals( category.getId() ) ) { return category; } } return null; }
/** * Returns the full category object for a given column within the logical model * * @param columnId * @param logicalModel * @return */ protected org.pentaho.metadata.model.Category getCategory( String columnId, LogicalModel logicalModel ) { for ( org.pentaho.metadata.model.Category category : logicalModel.getCategories() ) { if ( category.findLogicalColumn( columnId ) != null ) { return category; } } return null; }
private LogicalColumn findBusinessColumn( LogicalTable logicalTable, String columnName ) { for ( LogicalColumn logicalColumn : logicalTable.getLogicalColumns() ) { if ( columnName.equals( ( (SqlPhysicalColumn) logicalColumn.getPhysicalColumn() ).getTargetColumn() ) ) { return logicalColumn; } } return null; }
public String toString() { String thisPath = ""; //$NON-NLS-1$ for ( int i = 0; i < size(); i++ ) { LogicalRelationship relationship = getRelationship( i ); if ( i > 0 ) { thisPath += ", "; //$NON-NLS-1$ } thisPath += "[" + relationship.getFromTable().getId() + "-" + relationship.getToTable().getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } return thisPath; }
public LogicalRelationship() { super(); setComplex( false ); setRelationshipType( RelationshipType.UNDEFINED ); }
@SuppressWarnings( "unchecked" ) public List<AggregationType> getAggregationList() { return (List<AggregationType>) getProperty( IPhysicalColumn.AGGREGATIONLIST_PROPERTY ); }
@Override public IConcept getSecurityParentConcept() { return getLogicalTable(); }
/** * return a list of supported locales for this domain. * * @return supported locales */ @SuppressWarnings( "unchecked" ) public List<LocaleType> getLocales() { return (List<LocaleType>) getProperty( LOCALES_PROPERTY ); }
public LogicalRelationship( LogicalModel logicalModel, LogicalTable fromTable, LogicalTable toTable, LogicalColumn fromColumn, LogicalColumn toColumn ) { this(); setParent( logicalModel ); this.fromTable = fromTable; this.toTable = toTable; this.fromColumn = fromColumn; this.toColumn = toColumn; }
public SqlPhysicalColumn( SqlPhysicalTable table ) { this(); setParent( table ); }
@Override public IConcept getSecurityParentConcept() { return getLogicalModel(); }
public void setRelativeSize( Integer relativeSize ) { setProperty( RELATIVE_SIZE, relativeSize ); } }
public LogicalRelationship findRelationshipUsing( LogicalTable one, LogicalTable two ) { for ( LogicalRelationship relationship : getLogicalRelationships() ) { if ( relationship.isUsingTable( one ) && relationship.isUsingTable( two ) ) { return relationship; } } return null; }