Changeset 3451
- Timestamp:
- Jun 5, 2007, 12:07:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3.1/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java
r3441 r3451 206 206 throw new BaseException("Unknown field in reporter fields: "+field); 207 207 } 208 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));208 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), qi.getQueryAlias())); 209 209 } 210 210 for (String field : spotFields) … … 215 215 throw new BaseException("Unknown field in spot fields: "+field); 216 216 } 217 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));217 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), qi.getQueryAlias())); 218 218 } 219 219 if (mergeReporters) … … 221 221 throw new BaseException("'Merge on reporter' not implemented"); 222 222 } 223 exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, bas.getBioAssays().list(dc) );223 exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, bas.getBioAssays().list(dc), qis); 224 224 } 225 225 finally … … 293 293 if (qi == null) 294 294 throw new BaseException("Unknown column: "+field+" (you can add this field using a formula)"); 295 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));295 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), qi.getQueryAlias())); 296 296 } 297 297 for (String field : spotFields) … … 300 300 if (qi == null) 301 301 throw new BaseException("Unknwon field: "+field+" (you can add this field using a formula)"); 302 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));302 query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), qi.getQueryAlias())); 303 303 } 304 304 if (mergeReporters) … … 307 307 } 308 308 309 exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, Collections.singletonList(ba) );309 exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, Collections.singletonList(ba), qis); 310 310 311 311 out.println(); … … 320 320 321 321 private void exportBaseFileSectionSpots(PrintWriter out, DbControl dc, BioAssaySet bas, DynamicSpotQuery query, 322 List<String> reporterFields, List<String> spotFields, List<BioAssay> assays )322 List<String> reporterFields, List<String> spotFields, List<BioAssay> assays, Map<String, QueryItem> qi) 323 323 throws SQLException 324 324 { … … 365 365 for (String column : reporterFields) 366 366 { 367 reporterIndex.add(iterator.getIndex( column));367 reporterIndex.add(iterator.getIndex(qi.get(column).getQueryAlias())); 368 368 } 369 369 for (String field : spotFields) 370 370 { 371 spotIndex.add(iterator.getIndex( field));371 spotIndex.add(iterator.getIndex(qi.get(field).getQueryAlias())); 372 372 } 373 373 int posIndex = iterator.getIndex("_position"); … … 1024 1024 1025 1025 private String jep; 1026 1027 private String queryAlias; 1026 1028 1027 1029 QueryItem(String name, String title, String jep) … … 1030 1032 this.title = title; 1031 1033 this.jep = jep; 1032 } 1034 this.queryAlias = "a" + Math.abs(System.identityHashCode(name)); 1035 } 1033 1036 1034 1037 public final String getJep() … … 1045 1048 { 1046 1049 return title; 1050 } 1051 1052 public final String getQueryAlias() 1053 { 1054 return queryAlias; 1047 1055 } 1048 1056 }
Note: See TracChangeset
for help on using the changeset viewer.