@Test public void executeRequestWithDownLimit() { createCars(); createCars(); Collection<Entity> result = gqlService.executeGqlRequest("SELECT * FROM Car", 2, 4); assertEquals(4, result.size()); }
@Override public Collection<Entity> executeGqlRequest(String gqlRequest, Integer offset, Integer limit) { AppEngineHelper.disableApiHooks(); FetchOptions fetchOptions = FetchOptions.Builder.withDefaults(); GqlQuery gql; if (offset != null) { fetchOptions.offset(offset); } if (limit != null) { fetchOptions.limit(limit); } try { gql = new GqlQuery(gqlRequest); return datastoreHelper.queryOnAllNamespaces(gql.query(), fetchOptions); } catch (IllegalArgumentException | NullPointerException e) { throw new InvalidGqlSyntaxException(); } }
GqlServiceImpl implements GqlService { @Override public Collection<Entity> executeGqlRequest(String gqlRequest, Integer offset, Integer limit) { AppEngineHelper.disableApiHooks(); FetchOptions fetchOptions = FetchOptions.Builder.withDefaults(); GqlQuery gql; if (offset != null) { fetchOptions.offset(offset); } if (limit != null) { fetchOptions.limit(limit); } try { gql = new GqlQuery(gqlRequest); return datastoreHelper.queryOnAllNamespaces(gql.query(), fetchOptions); } catch (IllegalArgumentException | NullPointerException e) { throw new InvalidGqlSyntaxException(); } } }
GqlServiceImpl implements GqlService { @Override public Collection<Entity> executeGqlRequest(String gqlRequest, Integer offset, Integer limit) { AppEngineHelper.disableApiHooks(); FetchOptions fetchOptions = FetchOptions.Builder.withDefaults(); GqlQuery gql; if (offset != null) { fetchOptions.offset(offset); } if (limit != null) { fetchOptions.limit(limit); } try { gql = new GqlQuery(gqlRequest); return datastoreHelper.queryOnAllNamespaces(gql.query(), fetchOptions); } catch (IllegalArgumentException | NullPointerException e) { throw new InvalidGqlSyntaxException(); } } @Inject  GqlServiceImpl(
            DatastoreHelper datastoreHelper); }
GqlServiceImpl implements GqlService { @Override public Collection<Entity> executeGqlRequest(String gqlRequest, Integer offset, Integer limit) { AppEngineHelper.disableApiHooks(); FetchOptions fetchOptions = FetchOptions.Builder.withDefaults(); GqlQuery gql; if (offset != null) { fetchOptions.offset(offset); } if (limit != null) { fetchOptions.limit(limit); } try { gql = new GqlQuery(gqlRequest); return datastoreHelper.queryOnAllNamespaces(gql.query(), fetchOptions); } catch (IllegalArgumentException | NullPointerException e) { throw new InvalidGqlSyntaxException(); } } @Inject  GqlServiceImpl(
            DatastoreHelper datastoreHelper); @Override Collection<Entity> executeGqlRequest(String gqlRequest, Integer offset, Integer limit); }
GqlServiceImpl implements GqlService { @Override public Collection<Entity> executeGqlRequest(String gqlRequest, Integer offset, Integer limit) { AppEngineHelper.disableApiHooks(); FetchOptions fetchOptions = FetchOptions.Builder.withDefaults(); GqlQuery gql; if (offset != null) { fetchOptions.offset(offset); } if (limit != null) { fetchOptions.limit(limit); } try { gql = new GqlQuery(gqlRequest); return datastoreHelper.queryOnAllNamespaces(gql.query(), fetchOptions); } catch (IllegalArgumentException | NullPointerException e) { throw new InvalidGqlSyntaxException(); } } @Inject  GqlServiceImpl(
            DatastoreHelper datastoreHelper); @Override Collection<Entity> executeGqlRequest(String gqlRequest, Integer offset, Integer limit);  }