Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.PreparedQuery


     *
     * @return entities as query result iterator
     */
    protected QueryResultIterator<Entity> asQueryResultEntityIterator() {
        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        PreparedQuery pq =
            txSet ? DatastoreUtil.prepare(ds, tx, query) : DatastoreUtil
                .prepare(ds, query);
        return DatastoreUtil.asQueryResultIterator(pq, fetchOptions);
    }
View Full Code Here


     *
     * @return entities as query result iterable
     */
    protected QueryResultIterable<Entity> asQueryResultEntityIterable() {
        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        PreparedQuery pq =
            txSet ? DatastoreUtil.prepare(ds, tx, query) : DatastoreUtil
                .prepare(ds, query);
        return DatastoreUtil.asQueryResultIterable(pq, fetchOptions);
    }
View Full Code Here

                throw new PreparedQuery.TooManyResultsException();
            }
            return list.get(0);
        }
        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        PreparedQuery pq =
            txSet ? DatastoreUtil.prepare(ds, tx, query) : DatastoreUtil
                .prepare(ds, query);
        return DatastoreUtil.asSingleEntity(pq);
    }
View Full Code Here

     *
     * @return a number of entities
     */
    public int countQuickly() {
        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        PreparedQuery pq =
            txSet ? DatastoreUtil.prepare(ds, tx, query) : DatastoreUtil
                .prepare(ds, query);
        return DatastoreUtil.countEntities(pq);
    }
View Full Code Here

     *
     * @return entities as {@link Iterable}
     */
    protected Iterable<Entity> asIterableEntities() {
        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        PreparedQuery pq =
            txSet ? DatastoreUtil.prepare(ds, tx, query) : DatastoreUtil
                .prepare(ds, query);
        return DatastoreUtil.asIterable(pq, fetchOptions);
    }
View Full Code Here

      if (null != this.lastUpdate) {
        Long now = new Date().getTime();
        query.addFilter("timestamp", FilterOperator.GREATER_THAN_OR_EQUAL, (now - (MAX_CLOCK_SKEW)));
      }
     
      PreparedQuery pq = asyncDatastoreService.prepare(query);
      Iterator<Entity> it = pq.asIterator();
     
      return it;
    } finally {
      NamespaceManager.set(originalNamespace);
    }
View Full Code Here

      .addFilter(
          "idNovedad",
          com.google.appengine.api.datastore.Query.FilterOperator.EQUAL,
          Long.valueOf(idNovedad));
      FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
      PreparedQuery pq = datastore.prepare(q);
      results=pq.asList(fetchOptions);
     
    } catch (Exception e) {
      log.error("DAO " + e.getMessage());
    } finally {
      pm.close();
View Full Code Here

    Query q = new Query(kind);
    if (searchFor != null) {
      q.addFilter(searchBy, FilterOperator.EQUAL, searchFor);
    }
    PreparedQuery pq = datastore.prepare(q);

    return pq.asIterable();
  }
View Full Code Here

    Query q = new Query(kind);
    if (searchFor != null && !"".equals(searchFor)) {
      q.addFilter(searchBy, FilterOperator.EQUAL, searchFor);
    }
    PreparedQuery pq = datastore.prepare(q);
    //logger.info(pq.toString());
    return pq.asIterable();
  }
View Full Code Here

 
  public static Iterable<Entity> listAllEntities(String kind) {

    Query q = new Query(kind);

    PreparedQuery pq = datastore.prepare(q);

    return pq.asIterable();
 
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.PreparedQuery

Copyright © 2018 www.massapicom. 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.