Examples of countEntities()


Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    public int count() {
        PreparedQuery pq = prepareQuery();
        if (fetchOptions.getLimit() == null) {
            fetchOptions.limit(Integer.MAX_VALUE);
        }
        return pq.countEntities(fetchOptions);
    }

    /**
     * Use {@link #count()} instead of this method.
     *
 
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    public int count() {
        PreparedQuery pq = txSet ? ds.prepare(tx, query) : ds.prepare(query);
        if (fetchOptions.getLimit() == null) {
            fetchOptions.limit(Integer.MAX_VALUE);
        }
        return pq.countEntities(fetchOptions);
    }

    /**
     * Use {@link #count()} instead of this method.
     *
 
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

  public static Entity getEntity(Query query)
  {
    DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
    PreparedQuery pq = ds.prepare(query);
   
    if (pq.countEntities(fetchOptions) == 1)
    {
      return pq.asSingleEntity();
    }
    else
    {
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

      q.addFilter(propertyName,
          com.google.appengine.api.datastore.Query.FilterOperator.EQUAL,
          propertyMap.get(propertyName));
    }
    PreparedQuery pq = datastore.prepare(q);
    return pq.countEntities(FetchOptions.Builder.withLimit(100000));
  }
 
  @Override
  public <T> long count(Class<T> entityClass) {
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    // The Query interface assembles a query
    com.google.appengine.api.datastore.Query q =
      new com.google.appengine.api.datastore.Query(entityClass.getSimpleName());
    PreparedQuery pq = datastore.prepare(q)
    return pq.countEntities(FetchOptions.Builder.withLimit(100000));
  }
 
  @Override
  public <T> T findById(Class<T> clazz, Long id) throws Exception
    PersistenceManager pm = PMF.get().getPersistenceManager();
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

      q.addFilter(propertyName,
          com.google.appengine.api.datastore.Query.FilterOperator.EQUAL,
          propertyMap.get(propertyName));
    }
    PreparedQuery pq = datastore.prepare(q);
    return pq.countEntities(FetchOptions.Builder.withLimit(100000));
  }
 
  public <T extends BaseEntity> long count(Class<T> entityClass, List<GaeFilter> filters) {
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    // The Query interface assembles a query
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

      for(GaeFilter filter : filters) {
        q.addFilter(filter.getField(), filter.getOperator(), filter.getValue());
      }
    }
    PreparedQuery pq = datastore.prepare(q);
    return pq.countEntities(FetchOptions.Builder.withLimit(100000));
  }
 
  public <T extends BaseEntity> long count(Class<T> entityClass) {
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    // The Query interface assembles a query
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    // The Query interface assembles a query
    com.google.appengine.api.datastore.Query q =
      new com.google.appengine.api.datastore.Query(entityClass.getSimpleName());
    PreparedQuery pq = datastore.prepare(q)
    return pq.countEntities(FetchOptions.Builder.withLimit(100000));
  }
 
  @SuppressWarnings("unchecked")
  public <T extends BaseEntity> Collection<T> findEntitiesByRange(Class<T> entityClass,
      Locale locale, int init, int end, String ordering) {
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    // The Query interface assembles a query
    com.google.appengine.api.datastore.Query q =
      new com.google.appengine.api.datastore.Query(entityClass.getSimpleName());
    q.addFilter(idField, com.google.appengine.api.datastore.Query.FilterOperator.IN, ids);
    PreparedQuery pq = datastore.prepare(q);
    return pq.countEntities(FetchOptions.Builder.withLimit(100000));
  }
 
  private void setOrdering(Query query, String ordering) {
    if (ordering != null && !("").equals(ordering)){
      StringBuffer sb = new StringBuffer();
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

      applyFilter(q, queryInfo.filter);
    if (queryInfo.orderBy != null && queryInfo.orderBy.size() > 0)
      applySort(q, queryInfo.orderBy);
    PreparedQuery pq = datastore.prepare(q);

    Integer inlineCount = queryInfo.inlineCount == InlineCount.ALLPAGES ? pq.countEntities(FetchOptions.Builder.withDefaults()) : null;

    FetchOptions options = null;
    if (queryInfo.top != null)
      options = FetchOptions.Builder.withLimit(queryInfo.top);
    if (queryInfo.skip != null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.