/** * 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; }
LogicalColumn businessColumn = category.findLogicalColumn( column ); if ( businessColumn != null ) { query.getSelections().add( new AliasedSelection( category, businessColumn, null, alias ) );
if ( seg != null && seg.length > 1 ) { Category cat = query.getLogicalModel().findCategory( seg[0] ); LogicalColumn col = cat.findLogicalColumn( seg[1] ); if ( col == null ) { logger.error( Messages.getErrorString(
column = category.findLogicalColumn( columnId ); } else { column = query.getLogicalModel().findLogicalColumnInCategories( columnId );
"QueryXmlHelper.ERROR_0015_BUSINESS_CATEGORY_NOT_FOUND", view ) ); //$NON-NLS-1$ LogicalColumn businessColumn = category.findLogicalColumn( column ); if ( businessColumn == null ) { throw new PentahoMetadataException( Messages.getErrorString(
protected void addOrderBy( Query query, Category category, String columnId, String aggregation, Order.Type orderType ) throws PentahoMetadataException { if ( category == null ) { throw new PentahoMetadataException( Messages.getErrorString( "QueryXmlHelper.ERROR_0016_BUSINESS_CATEGORY_NULL" ) ); //$NON-NLS-1$ } LogicalColumn column = category.findLogicalColumn( columnId ); if ( column == null ) { throw new PentahoMetadataException( Messages.getErrorString( "QueryXmlHelper.ERROR_0013_BUSINESS_COL_NOT_FOUND", category.getId(), columnId ) ); //$NON-NLS-1$ } // this code verifies the aggregation setting provided is a // valid option AggregationType aggsetting = null; if ( aggregation != null ) { AggregationType setting = AggregationType.valueOf( aggregation.toUpperCase() ); if ( ( column.getAggregationType() == setting ) || column.getAggregationList() != null && column.getAggregationList().contains( setting ) ) { aggsetting = setting; } } query.getOrders().add( new Order( new Selection( category, column, aggsetting ), orderType ) ); }
column = category.findLogicalColumn( tblcol[1] ); if ( column == null ) { throw new PentahoMetadataException( Messages.getErrorString( logger.warn( Messages.getErrorString( "SqlOpenFormula.ERROR_0023_UNASSOCIATED_LOGICAL_COL", column.getId() ) ); //$NON-NLS-1$ for ( Category cat : model.getCategories() ) { if ( cat.findLogicalColumn( column.getId() ) != null ) { category = cat; break;