Package com.google.appengine.api.datastore

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


                q.setKeysOnly();

                q.addFilter(PROPERTY_EXPIRES,
                        FilterOperator.LESS_THAN_OR_EQUAL, expire);
                PreparedQuery pq = ds.prepare(q);
                List<Entity> entities = pq.asList(Builder
                        .withLimit(CLEANUP_LIMIT));
                if (entities != null) {
                    log.info("Vaadin cleanup deleting " + entities.size()
                            + " expired Vaadin sessions.");
                    List<Key> keys = new ArrayList<Key>();
View Full Code Here


                Query q = new Query(APPENGINE_SESSION_KIND);
                q.setKeysOnly();
                q.addFilter(PROPERTY_APPENGINE_EXPIRES,
                        FilterOperator.LESS_THAN_OR_EQUAL, expire);
                PreparedQuery pq = ds.prepare(q);
                List<Entity> entities = pq.asList(Builder
                        .withLimit(CLEANUP_LIMIT));
                if (entities != null) {
                    log.info("Vaadin cleanup deleting " + entities.size()
                            + " expired appengine sessions.");
                    List<Key> keys = new ArrayList<Key>();
View Full Code Here

    filters.add(less);
    CompositeFilter comp = new CompositeFilter(CompositeFilterOperator.AND, filters);
    q.setFilter(comp);
   
    PreparedQuery pq = datastore.prepare(q);
    List<Entity> results = pq.asList(FetchOptions.Builder.withLimit(1));
    if (results.size() != 1 || !results.get(0).getProperty("name").toString().contains(backupName)) {
      System.err.println("BuiltinDatatoreToBigqueryIngesterTask: can't find backupName: " + backupName);
    }
    Entity result = results.get(0);
   
View Full Code Here

  }

  private List<Entity> getCachedList(final String kind) {
    if (isCacheOutOfDate() || !cache.containsKey(kind)) {
      final PreparedQuery pq = db.prepare(new Query(kind));
      cache.put(kind, pq.asList(withDefaults()));
      lastCacheUpdate = System.currentTimeMillis();
      log.info("fulltext search cache updated");
    }

    return cache.get(kind);
View Full Code Here

  private static Entity findDeviceByRegId(String regId) {
    Filter filter =
        new FilterPredicate(DEVICE_REG_ID_PROPERTY, FilterOperator.EQUAL, regId);
    Query query = new Query(DEVICE_TYPE).setFilter(filter);
    PreparedQuery preparedQuery = datastore.prepare(query);
    List<Entity> entities = preparedQuery.asList(DEFAULT_FETCH_OPTIONS);
    Entity entity = null;
    if (!entities.isEmpty()) {
      entity = entities.get(0);
    }
    int size = entities.size();
View Full Code Here

    final PreparedQuery preparedQuery = dataStore.prepare(query);
    final FetchOptions options = FetchOptions.Builder.withChunkSize(500);
    return tryFiveTimes(new Operation<List<Entity>>("queryFullPipeline") {
      @Override
      public List<Entity> call() {
        return preparedQuery.asList(options);
      }
    });
  }

  @Override
View Full Code Here

          "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

                q.setKeysOnly();

                q.addFilter(PROPERTY_EXPIRES,
                        FilterOperator.LESS_THAN_OR_EQUAL, expire);
                PreparedQuery pq = ds.prepare(q);
                List<Entity> entities = pq.asList(Builder
                        .withLimit(CLEANUP_LIMIT));
                if (entities != null) {
                    getLogger().info(
                            "Vaadin cleanup deleting " + entities.size()
                                    + " expired Vaadin sessions.");
View Full Code Here

                Query q = new Query(APPENGINE_SESSION_KIND);
                q.setKeysOnly();
                q.addFilter(PROPERTY_APPENGINE_EXPIRES,
                        FilterOperator.LESS_THAN_OR_EQUAL, expire);
                PreparedQuery pq = ds.prepare(q);
                List<Entity> entities = pq.asList(Builder
                        .withLimit(CLEANUP_LIMIT));
                if (entities != null) {
                    getLogger().info(
                            "Vaadin cleanup deleting " + entities.size()
                                    + " expired appengine sessions.");
View Full Code Here

        req.setAttribute("isUserAdmin", userService.isUserAdmin());

        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
        Query q = new Query("ChatUser").addSort("jid");
        PreparedQuery pq = datastore.prepare(q);
        List<Entity> results = pq.asList(FetchOptions.Builder.withLimit(100));
        req.setAttribute("chatUsers", results);
        req.setAttribute("hasChatUsers", !results.isEmpty());

        req.setAttribute("status", getStatusEntity());
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.