@Test public void testSimpleAggregate() throws Exception { String query = "SELECT Count(*) FROM People"; String expectedURL = "People/$count"; ResultSetExecution excution = helpExecute(TestODataMetadataProcessor.tripPinMetadata(), query, "19", expectedURL); assertEquals(Arrays.asList(19), excution.next()); }
@Override public List<?> next() throws TranslatorException, DataNotAvailableException { if (isCount && this.countResponse != -1) { int count = this.countResponse; this.countResponse = -1; return Arrays.asList(count); } if (this.response != null) { Map<String, Object> row = this.response.getNext(); if (row != null) { return buildRow(visitor.getODataQuery().getRootDocument().getTable(), visitor.getProjectedColumns(), this.expectedColumnTypes, row); } } return null; }
ODataQueryExecution extends BaseQueryExecution implements ResultSetExecution { @Override public List<?> next() throws TranslatorException, DataNotAvailableException { if (isCount && this.countResponse != -1) { int count = this.countResponse; this.countResponse = -1; return Arrays.asList(count); } if (this.response != null) { Map<String, Object> row = this.response.getNext(); if (row != null) { return buildRow(visitor.getODataQuery().getRootDocument().getTable(), visitor.getProjectedColumns(), this.expectedColumnTypes, row); } } return null; } }
ODataQueryExecution extends BaseQueryExecution implements ResultSetExecution { @Override public List<?> next() throws TranslatorException, DataNotAvailableException { if (isCount && this.countResponse != -1) { int count = this.countResponse; this.countResponse = -1; return Arrays.asList(count); } if (this.response != null) { Map<String, Object> row = this.response.getNext(); if (row != null) { return buildRow(visitor.getODataQuery().getRootDocument().getTable(), visitor.getProjectedColumns(), this.expectedColumnTypes, row); } } return null; } ODataQueryExecution(ODataExecutionFactory translator,
            QueryExpression command, ExecutionContext executionContext,
            RuntimeMetadata metadata, WSConnection connection); }
ODataQueryExecution extends BaseQueryExecution implements ResultSetExecution { @Override public List<?> next() throws TranslatorException, DataNotAvailableException { if (isCount && this.countResponse != -1) { int count = this.countResponse; this.countResponse = -1; return Arrays.asList(count); } if (this.response != null) { Map<String, Object> row = this.response.getNext(); if (row != null) { return buildRow(visitor.getODataQuery().getRootDocument().getTable(), visitor.getProjectedColumns(), this.expectedColumnTypes, row); } } return null; } ODataQueryExecution(ODataExecutionFactory translator,
            QueryExpression command, ExecutionContext executionContext,
            RuntimeMetadata metadata, WSConnection connection); @Override void execute(); @Override List<?> next(); @Override void close(); @Override void cancel(); }
ODataQueryExecution extends BaseQueryExecution implements ResultSetExecution { @Override public List<?> next() throws TranslatorException, DataNotAvailableException { if (isCount && this.countResponse != -1) { int count = this.countResponse; this.countResponse = -1; return Arrays.asList(count); } if (this.response != null) { Map<String, Object> row = this.response.getNext(); if (row != null) { return buildRow(visitor.getODataQuery().getRootDocument().getTable(), visitor.getProjectedColumns(), this.expectedColumnTypes, row); } } return null; } ODataQueryExecution(ODataExecutionFactory translator,
            QueryExpression command, ExecutionContext executionContext,
            RuntimeMetadata metadata, WSConnection connection); @Override void execute(); @Override List<?> next(); @Override void close(); @Override void cancel();  }