@Test(expected = InvalidQueryException.class) public void test_query01() throws InvalidQueryException { QuerySpec query = new QuerySpec(); query.addCondition(new QueryCondition("FOO", "=", "BAR")); client.query(query); }
@Override public QueryResult<T> query(QuerySpec querySpec) throws InvalidQueryException { SimpleHttpRequest request = newQuerySpecRequest("query", querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } return getQueryResult(request.getResponseBody(), queryResultTypeReference()); }
NbaClient extends Client implements INbaAccess<T> { @Override public QueryResult<T> query(QuerySpec querySpec) throws InvalidQueryException { SimpleHttpRequest request = newQuerySpecRequest("query", querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } return getQueryResult(request.getResponseBody(), queryResultTypeReference()); } }
NbaClient extends Client implements INbaAccess<T> { @Override public QueryResult<T> query(QuerySpec querySpec) throws InvalidQueryException { SimpleHttpRequest request = newQuerySpecRequest("query", querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } return getQueryResult(request.getResponseBody(), queryResultTypeReference()); } NbaClient(ClientConfig config, String rootPath); }
NbaClient extends Client implements INbaAccess<T> { @Override public QueryResult<T> query(QuerySpec querySpec) throws InvalidQueryException { SimpleHttpRequest request = newQuerySpecRequest("query", querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } return getQueryResult(request.getResponseBody(), queryResultTypeReference()); } NbaClient(ClientConfig config, String rootPath); @Override T find(String id); @Override T[] findByIds(String[] ids); @Override QueryResult<T> query(QuerySpec querySpec); @Override long count(QuerySpec querySpec); @Override long countDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> countDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec); @Override Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> getDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec); }
NbaClient extends Client implements INbaAccess<T> { @Override public QueryResult<T> query(QuerySpec querySpec) throws InvalidQueryException { SimpleHttpRequest request = newQuerySpecRequest("query", querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } return getQueryResult(request.getResponseBody(), queryResultTypeReference()); } NbaClient(ClientConfig config, String rootPath); @Override T find(String id); @Override T[] findByIds(String[] ids); @Override QueryResult<T> query(QuerySpec querySpec); @Override long count(QuerySpec querySpec); @Override long countDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> countDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec); @Override Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> getDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec);  }