Ignore:
Timestamp:
08/28/10 21:55:08 (21 months ago)
Author:
kasper
Message:

Ticket #382: Added CLI for executing jobs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • AnalyzerBeans/trunk/src/main/java/org/eobjects/analyzer/util/SchemaNavigator.java

    r978 r982  
    4747 
    4848        public Column convertToColumn(String columnName) { 
    49                 return dataContext.getColumnByQualifiedLabel(columnName); 
     49                Schema schema = null; 
     50                String[] schemaNames = dataContext.getSchemaNames(); 
     51                for (String schemaName : schemaNames) { 
     52                        if (columnName.startsWith(schemaName)) { 
     53                                schema = dataContext.getSchemaByName(schemaName); 
     54                                String remainingPath1 = columnName.substring(schemaName.length()); 
     55                                 
     56                                assert remainingPath1.charAt(0) == '.'; 
     57                                 
     58                                remainingPath1 = remainingPath1.substring(1); 
     59                                 
     60                                Table table = null; 
     61                                String[] tableNames = schema.getTableNames(); 
     62                                for (String tableName : tableNames) { 
     63                                        if (remainingPath1.startsWith(tableName)) { 
     64                                                table = schema.getTableByName(tableName); 
     65                                                String remainingPath2 = remainingPath1.substring(tableName.length()); 
     66                                                 
     67                                                assert remainingPath2.charAt(0) == '.'; 
     68                                                 
     69                                                remainingPath2 = remainingPath2.substring(1); 
     70                                                 
     71                                                Column column = table.getColumnByName(remainingPath2); 
     72                                                if (column != null) { 
     73                                                        return column; 
     74                                                } 
     75                                        } 
     76                                } 
     77                        } 
     78                } 
     79                 
     80                return null; 
    5081        } 
    5182} 
Note: See TracChangeset for help on using the changeset viewer.