Tabnine Logo
StructuredQuery.getLimit
Code IndexAdd Tabnine to your IDE (free)

How to use
getLimit
method
in
com.google.cloud.datastore.StructuredQuery

Best Java code snippets using com.google.cloud.datastore.StructuredQuery.getLimit (Showing top 5 results out of 315)

origin: googleapis/google-cloud-java

private void compareMergedQuery(StructuredQuery<?> expected, StructuredQuery<?> actual) {
 assertEquals(expected.getKind(), actual.getKind());
 assertEquals(expected.getStartCursor(), actual.getStartCursor());
 assertEquals(expected.getEndCursor(), actual.getEndCursor());
 assertEquals(expected.getOffset(), actual.getOffset());
 assertEquals(expected.getLimit(), actual.getLimit());
 assertEquals(expected.getFilter(), actual.getFilter());
 assertEquals(expected.getOrderBy(), actual.getOrderBy());
 assertEquals(expected.getProjection(), actual.getProjection());
 assertEquals(expected.getDistinctOn(), actual.getDistinctOn());
}
origin: googleapis/google-cloud-java

private void compareBaseBuilderFields(StructuredQuery<?> query) {
 assertEquals(NAMESPACE, query.getNamespace());
 assertEquals(KIND, query.getKind());
 assertEquals(START_CURSOR, query.getStartCursor());
 assertEquals(END_CURSOR, query.getEndCursor());
 assertEquals(OFFSET, query.getOffset());
 assertEquals(LIMIT, query.getLimit());
 assertEquals(FILTER, query.getFilter());
 assertEquals(ORDER_BY, query.getOrderBy());
}
origin: objectify/objectify

/**
 * Copy all the behavior characteristics of the orignial query into the builder.
 */
public static <T, B extends StructuredQuery.Builder<T>> B clone(final StructuredQuery<?> orig, final Supplier<B> into) {
  final B builder = into.get();
  builder.setNamespace(orig.getNamespace());
  builder.setEndCursor(orig.getEndCursor());
  builder.setFilter(orig.getFilter());
  builder.setKind(orig.getKind());
  builder.setLimit(orig.getLimit());
  builder.setOffset(orig.getOffset());
  builder.setStartCursor(orig.getStartCursor());
  addOrderBy(builder, orig.getOrderBy());
  return builder;
}
origin: spring-cloud/spring-cloud-gcp

private Slice executeSliceQuery(Object[] parameters) {
  EntityQuery.Builder builder = StructuredQuery.newEntityQueryBuilder()
      .setKind(this.datastorePersistentEntity.kindName());
  StructuredQuery query = applyQueryBody(parameters, builder, false);
  List items = this.datastoreTemplate.query((query), (x) -> x);
  Integer limit = (query.getLimit() == null) ? null : query.getLimit() - 1;
  boolean exceedsLimit = false;
  if (limit != null) {
    //for slice queries we retrieve one additional item to check if the next slice exists
    //the additional item will not be converted on read
    exceedsLimit = items.size() > limit;
    if (exceedsLimit) {
      items = items.subList(0, limit);
    }
  }
  ParameterAccessor paramAccessor = new ParametersParameterAccessor(getQueryMethod().getParameters(), parameters);
  Pageable pageable = paramAccessor.getPageable();
  List entities = (List) this.datastoreTemplate
      .convertEntitiesForRead(items.iterator(), this.entityType).stream()
      .map((o) -> this.processRawObjectForProjection((T) o)).collect(Collectors.toList());
  return new SliceImpl(entities, pageable, exceedsLimit);
}
origin: org.springframework.cloud/spring-cloud-gcp-data-datastore

private Slice executeSliceQuery(Object[] parameters) {
  EntityQuery.Builder builder = StructuredQuery.newEntityQueryBuilder()
      .setKind(this.datastorePersistentEntity.kindName());
  StructuredQuery query = applyQueryBody(parameters, builder, false);
  List items = this.datastoreTemplate.query((query), (x) -> x);
  Integer limit = (query.getLimit() == null) ? null : query.getLimit() - 1;
  boolean exceedsLimit = false;
  if (limit != null) {
    //for slice queries we retrieve one additional item to check if the next slice exists
    //the additional item will not be converted on read
    exceedsLimit = items.size() > limit;
    if (exceedsLimit) {
      items = items.subList(0, limit);
    }
  }
  ParameterAccessor paramAccessor = new ParametersParameterAccessor(getQueryMethod().getParameters(), parameters);
  Pageable pageable = paramAccessor.getPageable();
  List entities = (List) this.datastoreTemplate
      .convertEntitiesForRead(items.iterator(), this.entityType).stream()
      .map((o) -> this.processRawObjectForProjection((T) o)).collect(Collectors.toList());
  return new SliceImpl(entities, pageable, exceedsLimit);
}
com.google.cloud.datastoreStructuredQuerygetLimit

Javadoc

Returns the limit for this query.

Popular methods of StructuredQuery

  • getKind
    Returns the kind for this query.
  • getNamespace
  • toBuilder
  • fromPb
  • getEndCursor
    Returns the end cursor for this query.
  • getFilter
    Returns the filter for this query.
  • getOffset
    Returns the offset for this query.
  • getOrderBy
    Returns the order by clause for this query.
  • getStartCursor
    Returns the start cursor for this query.
  • getDistinctOn
    Returns the distinct on clause for this query.
  • getProjection
    Returns the projection for this query.
  • getType
  • getProjection,
  • getType,
  • newEntityQueryBuilder,
  • nextQuery,
  • toPb,
  • toStringHelper

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now