public int score() { int score = 0; Number relSize = null; for ( int i = 0; i < size(); i++ ) { LogicalRelationship rel = getRelationship( i ); LogicalTable from = rel.getFromTable(); relSize = (Number) from.getProperty( SqlPhysicalTable.RELATIVE_SIZE ); if ( ( relSize != null ) && ( relSize.intValue() > 0 ) ) { score += relSize.intValue(); } } if ( size() > 0 ) { LogicalTable to = getLastRelationship().getToTable(); relSize = (Number) to.getProperty( SqlPhysicalTable.RELATIVE_SIZE ); if ( ( relSize != null ) && ( relSize.intValue() > 0 ) ) { score += relSize.intValue(); } } return score; }
public static final String proposeSqlBasedCategoryId( String locale, LogicalTable table, Category category ) { String baseID = ( table != null ) ? Util.toId( (String) table.getProperty( SqlPhysicalTable.TARGET_TABLE ) ) : ""; //$NON-NLS-1$ String namePart = ( ( category != null ) && ( category.getName( locale ) != null ) ) ? "_" + Util.toId( category.getName( locale ) ) : ""; //$NON-NLS-1$ //$NON-NLS-2$ String id = Util.getCategoryIdPrefix() + baseID + namePart; return id.toUpperCase(); }
/** * Calculates rating of current solution that is in progress * * @param searchTechnique * Technique being used in searching to determine rating method */ private int getRatingForCurrentState( PathType searchTechnique ) { int rating = 0; switch ( searchTechnique ) { case SHORTEST: for ( Node n : nodes ) { if ( n.isRequired() ) { rating++; } } break; case LOWEST_SCORE: for ( Node n : nodes ) { if ( n.isRequired() ) { Integer relSize = (Integer) n.getTable().getProperty( SqlPhysicalTable.RELATIVE_SIZE ); // If relative size is not null, use it, otherwise, increment by just 1 rating += ( relSize != null ) ? ( relSize + 1 ) : 1; } } break; default: return 0; } return rating; }
if ( olapHierarchy.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_TABLE_TYPE ) == TargetTableType.INLINE_SQL ) { xml.append( " <View alias=\"FACT\">" ).append( Util.CR ); xml.append( " <SQL dialect=\"generic\">" ).append( Util.CR ); xml.append( " <![CDATA[" + olapHierarchy.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_TABLE ) + "]]>" ).append( Util.CR ); xml.append( " </SQL>" ).append( Util.CR ); xml.append( " <Table" ); //$NON-NLS-1$ xml.append( " name=\"" ); //$NON-NLS-1$ XMLHandler.appendReplacedChars( xml, cleanseDbName( (String) olapHierarchy.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_TABLE ) ) ); xml.append( "\"" ); //$NON-NLS-1$ if ( !StringUtils.isBlank( (String) olapHierarchy.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_SCHEMA ) ) ) { xml.append( " schema=\"" ); //$NON-NLS-1$ XMLHandler.appendReplacedChars( xml, cleanseDbName( (String) olapHierarchy.getLogicalTable() .getProperty( SqlPhysicalTable.TARGET_SCHEMA ) ) ); xml.append( "\"" ); //$NON-NLS-1$ if ( olapCube.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_TABLE_TYPE ) == TargetTableType.INLINE_SQL ) { xml.append( " <View alias=\"FACT\">" ).append( Util.CR ); xml.append( " <SQL dialect=\"generic\">" ).append( Util.CR ); xml.append( " <![CDATA[" + olapCube.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_TABLE ) + "]]>" ) .append( Util.CR ); xml.append( " </SQL>" ).append( Util.CR ); xml.append( " <Table" ); //$NON-NLS-1$
LogicalTable businessTable = usedBusinessTables.get( i ); String schemaName = null; if ( businessTable.getProperty( SqlPhysicalTable.TARGET_SCHEMA ) != null ) { schemaName = databaseMeta.quoteField( (String) businessTable.getProperty( SqlPhysicalTable.TARGET_SCHEMA ) ); String tableName = (String) businessTable.getProperty( SqlPhysicalTable.TARGET_TABLE ); TargetTableType type = (TargetTableType) businessTable.getProperty( SqlPhysicalTable.TARGET_TABLE_TYPE ); if ( type == TargetTableType.INLINE_SQL || tableName.contains( "," ) ) { tableName = "(" + tableName + ")"; //$NON-NLS-1$ //$NON-NLS-2$ databaseMeta.getQuotedSchemaTableCombination( (String) relation.getFromTable().getProperty( SqlPhysicalTable.TARGET_SCHEMA ), (String) relation.getFromTable().getProperty( SqlPhysicalTable.TARGET_TABLE ) ); String leftTableAlias = databaseMeta.quoteField( tableAliases.get( relation.getFromTable() ) ); String rightTableName = databaseMeta.getQuotedSchemaTableCombination( (String) relation.getToTable().getProperty( SqlPhysicalTable.TARGET_SCHEMA ), (String) relation.getToTable().getProperty( SqlPhysicalTable.TARGET_TABLE ) ); String rightTableAlias = databaseMeta.quoteField( tableAliases.get( relation.getToTable() ) );
createDescriptions( doc, table, "CWMMDB:Dimension", tblidstr, allDescriptions, idGen ); //$NON-NLS-1$ Element modelElement = doc.createElement( "CWM:ModelElement.taggedValue" ); //$NON-NLS-1$ if ( table.getProperty( "__LEGACY_TABLE_IS_DRAWN" ) != null ) { //$NON-NLS-1$ modelElement.appendChild( createTaggedValue( doc, "TABLE_IS_DRAWN", (String) table.getProperty( "__LEGACY_TABLE_IS_DRAWN" ), if ( table.getProperty( "__LEGACY_TAG_POSITION_Y" ) != null ) { //$NON-NLS-1$ modelElement.appendChild( createTaggedValue( doc, "TAG_POSITION_Y", (String) table.getProperty( "__LEGACY_TAG_POSITION_Y" ), if ( table.getProperty( "__LEGACY_TAG_POSITION_X" ) != null ) { //$NON-NLS-1$ modelElement.appendChild( createTaggedValue( doc, "TAG_POSITION_X", (String) table.getProperty( "__LEGACY_TAG_POSITION_X" ),
if ( tbl.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_SCHEMA ) != null ) { schemaName = databaseMeta.quoteField( (String) tbl.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_SCHEMA ) ); databaseMeta.quoteField( (String) tbl.getLogicalTable().getProperty( SqlPhysicalTable.TARGET_TABLE ) ); sqlquery.addTable( databaseMeta.getSchemaTableCombination( schemaName, tableName ), databaseMeta .quoteField( alias ) ); (String) aliasedRelation.relation.getFromTable().getProperty( SqlPhysicalTable.TARGET_SCHEMA ); String leftTable = (String) aliasedRelation.relation.getFromTable().getProperty( SqlPhysicalTable.TARGET_TABLE ); String rightSchema = (String) aliasedRelation.relation.getToTable().getProperty( SqlPhysicalTable.TARGET_SCHEMA ); String rightTable = (String) aliasedRelation.relation.getToTable().getProperty( SqlPhysicalTable.TARGET_TABLE );