@Test public void assertGetValueByColumnLabel() { aggregationDistinctQueryResult.next(); assertThat(aggregationDistinctQueryResult.getValue("order_id", Object.class), is((Object) 10)); assertThat(aggregationDistinctQueryResult.getValue("a", Object.class), is((Object) 10)); }
private Object getValue(final int columnIndex) { if (metaData.isAggregationDistinctColumnIndex(columnIndex)) { return AggregationType.COUNT == metaData.getAggregationType(columnIndex) ? 1 : super.getValue(columnIndex, Object.class); } if (metaData.isDerivedCountColumnIndex(columnIndex)) { return 1; } if (metaData.isDerivedSumColumnIndex(columnIndex)) { return super.getValue(metaData.getAggregationDistinctColumnIndex(columnIndex), Object.class); } return super.getValue(columnIndex, Object.class); }
AggregationDistinctQueryResult extends DistinctQueryResult { private Object getValue(final int columnIndex) { if (metaData.isAggregationDistinctColumnIndex(columnIndex)) { return AggregationType.COUNT == metaData.getAggregationType(columnIndex) ? 1 : super.getValue(columnIndex, Object.class); } if (metaData.isDerivedCountColumnIndex(columnIndex)) { return 1; } if (metaData.isDerivedSumColumnIndex(columnIndex)) { return super.getValue(metaData.getAggregationDistinctColumnIndex(columnIndex), Object.class); } return super.getValue(columnIndex, Object.class); } }
AggregationDistinctQueryResult extends DistinctQueryResult { private Object getValue(final int columnIndex) { if (metaData.isAggregationDistinctColumnIndex(columnIndex)) { return AggregationType.COUNT == metaData.getAggregationType(columnIndex) ? 1 : super.getValue(columnIndex, Object.class); } if (metaData.isDerivedCountColumnIndex(columnIndex)) { return 1; } if (metaData.isDerivedSumColumnIndex(columnIndex)) { return super.getValue(metaData.getAggregationDistinctColumnIndex(columnIndex), Object.class); } return super.getValue(columnIndex, Object.class); } private  AggregationDistinctQueryResult(final QueryResultMetaData queryResultMetaData, final Iterator<QueryRow> resultData, final AggregationDistinctQueryMetaData distinctQueryMetaData);  AggregationDistinctQueryResult(final Collection<QueryResult> queryResults, final List<AggregationDistinctSelectItem> aggregationDistinctSelectItems); }
AggregationDistinctQueryResult extends DistinctQueryResult { private Object getValue(final int columnIndex) { if (metaData.isAggregationDistinctColumnIndex(columnIndex)) { return AggregationType.COUNT == metaData.getAggregationType(columnIndex) ? 1 : super.getValue(columnIndex, Object.class); } if (metaData.isDerivedCountColumnIndex(columnIndex)) { return 1; } if (metaData.isDerivedSumColumnIndex(columnIndex)) { return super.getValue(metaData.getAggregationDistinctColumnIndex(columnIndex), Object.class); } return super.getValue(columnIndex, Object.class); } private  AggregationDistinctQueryResult(final QueryResultMetaData queryResultMetaData, final Iterator<QueryRow> resultData, final AggregationDistinctQueryMetaData distinctQueryMetaData);  AggregationDistinctQueryResult(final Collection<QueryResult> queryResults, final List<AggregationDistinctSelectItem> aggregationDistinctSelectItems); @Override List<DistinctQueryResult> divide(); @Override Object getValue(final int columnIndex, final Class<?> type); @Override Object getValue(final String columnLabel, final Class<?> type); @Override Object getCalendarValue(final int columnIndex, final Class<?> type, final Calendar calendar); @Override Object getCalendarValue(final String columnLabel, final Class<?> type, final Calendar calendar); @Override InputStream getInputStream(final int columnIndex, final String type); @Override InputStream getInputStream(final String columnLabel, final String type); @Override boolean wasNull(); @Override String getColumnLabel(final int columnIndex); }
AggregationDistinctQueryResult extends DistinctQueryResult { private Object getValue(final int columnIndex) { if (metaData.isAggregationDistinctColumnIndex(columnIndex)) { return AggregationType.COUNT == metaData.getAggregationType(columnIndex) ? 1 : super.getValue(columnIndex, Object.class); } if (metaData.isDerivedCountColumnIndex(columnIndex)) { return 1; } if (metaData.isDerivedSumColumnIndex(columnIndex)) { return super.getValue(metaData.getAggregationDistinctColumnIndex(columnIndex), Object.class); } return super.getValue(columnIndex, Object.class); } private  AggregationDistinctQueryResult(final QueryResultMetaData queryResultMetaData, final Iterator<QueryRow> resultData, final AggregationDistinctQueryMetaData distinctQueryMetaData);  AggregationDistinctQueryResult(final Collection<QueryResult> queryResults, final List<AggregationDistinctSelectItem> aggregationDistinctSelectItems); @Override List<DistinctQueryResult> divide(); @Override Object getValue(final int columnIndex, final Class<?> type); @Override Object getValue(final String columnLabel, final Class<?> type); @Override Object getCalendarValue(final int columnIndex, final Class<?> type, final Calendar calendar); @Override Object getCalendarValue(final String columnLabel, final Class<?> type, final Calendar calendar); @Override InputStream getInputStream(final int columnIndex, final String type); @Override InputStream getInputStream(final String columnLabel, final String type); @Override boolean wasNull(); @Override String getColumnLabel(final int columnIndex);  }