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

                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

  }

  private static Entity findDeviceByRegId(String regId) {
    Query query = new Query(DEVICE_TYPE).addFilter(DEVICE_REG_ID_PROPERTY, FilterOperator.EQUAL, regId);
    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

  public static void deleteAllEntities(String type) {
    Query query = new Query(type);
    PreparedQuery preparedQuery = datastore.prepare(query);

    List<Entity> entities = preparedQuery.asList(DEFAULT_FETCH_OPTIONS);

    for (int i = 0; i < entities.size(); i++) {
      datastore.delete(entities.get(i)
          .getKey());
    }
View Full Code Here

    Datastore.logger.info("Getting ServerDescriptor");
 
    Query query = new Query(Datastore.SERVER_TYPE);
    PreparedQuery preparedQuery = Datastore.datastore.prepare(query);
 
    List<Entity> entities = preparedQuery.asList(Datastore.DEFAULT_FETCH_OPTIONS);
 
    List<ServerDescriptor> list = new ArrayList<ServerDescriptor>();
 
    Entity entity = null;
    ServerDescriptor sd;
View Full Code Here

    Datastore.logger.info("Getting Messages");
 
    Query query = new Query(Datastore.MESSAGE_TYPE);
    PreparedQuery preparedQuery = Datastore.datastore.prepare(query);
 
    List<Entity> entities = preparedQuery.asList(Datastore.DEFAULT_FETCH_OPTIONS);
 
    List<MessageDescriptor> list = new ArrayList<MessageDescriptor>(entities.size());
    for (Entity entity : entities) {
      MessageDescriptor descriptor = MessageDescriptor.fromEntity(entity);
 
View Full Code Here

     */
    public static List<Entity> getProperties(DatastoreService service, String kind, FetchOptions options) {
        Query query = new Query(Query.PROPERTY_METADATA_KIND);
        query.setAncestor(createKindKey(kind));
        PreparedQuery preparedQuery = service.prepare(query);
        return preparedQuery.asList(options);
    }

    /**
     * Gets datastore kind properties.
     *
 
View Full Code Here

    public static List<Entity> getProperties(DatastoreService service, String kind, FetchOptions options, Closure<?> closure) {
        Query query = new Query(Query.PROPERTY_METADATA_KIND);
        query.setAncestor(createKindKey(kind));
        closure.call(query);
        PreparedQuery preparedQuery = service.prepare(query);
        return preparedQuery.asList(options);
    }

    /**
     * Gets datastore kind properties. The Closure<?> lets you apply additional filters to your query.
     *
 
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.