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) {
                    getLogger()
                            .log(Level.INFO,
                                    "Vaadin cleanup deleting {0} 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()
                            .log(Level.INFO,
                                    "Vaadin cleanup deleting {0} expired appengine sessions.",
View Full Code Here

  public List<DepartmentInformationObject> queryDepartmentByPrefix(String prefix) {
    Query q = new Query(DEPARTMENT_KIND);
    q.addFilter(DEPARTMENT_ID_PROPERTY, FilterOperator.GREATER_THAN_OR_EQUAL, prefix);
    q.addSort(DEPARTMENT_ID_PROPERTY,SortDirection.ASCENDING);
    PreparedQuery pq = datastore.prepare(q);
    List<Entity> results = pq.asList(FetchOptions.Builder.withLimit(10));
    List<DepartmentInformationObject> diol = new ArrayList<DepartmentInformationObject>();
    for(Iterator<Entity> i = results.iterator(); i.hasNext();) {
      Entity e = i.next();
      String deptId = (String)e.getProperty(DEPARTMENT_ID_PROPERTY);
      if(deptId.startsWith(prefix))
View Full Code Here

    q.addFilter(DEPARTMENT_ID_PROPERTY, FilterOperator.EQUAL, deptId);
    q.addFilter(COURSE_ID_PROPERTY, FilterOperator.GREATER_THAN_OR_EQUAL, prefix);
    q.addSort(DEPARTMENT_ID_PROPERTY, SortDirection.ASCENDING);
    q.addSort(COURSE_ID_PROPERTY, SortDirection.ASCENDING);
    PreparedQuery pq = datastore.prepare(q)
    List<Entity> results = pq.asList(FetchOptions.Builder.withLimit(10));
    List<CourseInformationObject> ciol = new ArrayList<CourseInformationObject>();
    for(Iterator<Entity> i = results.iterator(); i.hasNext();) {
      Entity e = i.next();
      String courseId = (String)e.getProperty(COURSE_ID_PROPERTY);
      if(courseId.startsWith(prefix))
View Full Code Here

    q.addFilter(SECTION_ID_PROPERTY, FilterOperator.GREATER_THAN_OR_EQUAL, prefix);
    q.addSort(DEPARTMENT_ID_PROPERTY, SortDirection.ASCENDING);
    q.addSort(COURSE_ID_PROPERTY, SortDirection.ASCENDING);
    q.addSort(SECTION_ID_PROPERTY, SortDirection.ASCENDING);
    PreparedQuery pq = datastore.prepare(q);
    List<Entity> results = pq.asList(FetchOptions.Builder.withLimit(10));
    List<SectionInformationObject> siol = new ArrayList<SectionInformationObject>();
    for(Iterator<Entity> i = results.iterator(); i.hasNext();){
      Entity e = i.next();
      String sectionId = (String)e.getProperty(SECTION_ID_PROPERTY);
      if(sectionId.startsWith(prefix))
View Full Code Here

      q_sub.addSort(SUBSCRIPTION_STATUS_PROPERTY, SortDirection.DESCENDING);
    }
    else if (type.equalsIgnoreCase(SUBSCRIPTION_STATUS_ACTIVE))
      q_sub.addFilter(SUBSCRIPTION_STATUS_PROPERTY, FilterOperator.EQUAL, SUBSCRIPTION_STATUS_ACTIVE);
    PreparedQuery pq = datastore.prepare(q_sub);
    List<Entity> entityList = pq.asList(FetchOptions.Builder.withDefaults());
    for(Iterator<Entity> i = entityList.iterator(); i.hasNext();){
      Entity e = i.next();
      String email = (String) e.getProperty(SUBSCRIPTION_EMAIL_PROPERTY);
      String status = (String) e.getProperty(SUBSCRIPTION_STATUS_PROPERTY);
      subl.add(new SubscriptionInformationObject(email,status));
View Full Code Here

      return false;
    Key key = e_from.getKey();
    Query q_sub = new Query(SUBSCRIPTION_KIND);
    q_sub.setAncestor(key);
    PreparedQuery pq = datastore.prepare(q_sub);
    List<Entity> entityList = pq.asList(FetchOptions.Builder.withDefaults());
    for(Iterator<Entity> i = entityList.iterator(); i.hasNext();){
      Entity e = i.next();
      String to_email = (String) e.getProperty(SUBSCRIPTION_EMAIL_PROPERTY);
      addFeed(to_email,email,message);
    }
View Full Code Here

    q_feed.setAncestor(k);
    q_feed.addSort(FEED_TIMESTAMP_PROPERTY,SortDirection.DESCENDING);
    if(getUnreadOnly)
      q_feed.addFilter(FEED_READ_STATUS_PROPERTY, FilterOperator.EQUAL, false);
    PreparedQuery pq_feed = datastore.prepare(q_feed);
    List<Entity> entityList = pq_feed.asList(FetchOptions.Builder.withDefaults());
    for(Iterator<Entity> i = entityList.iterator(); i.hasNext();) {
      Entity e_feed = i.next();
      Text feed_message_t = (Text)e_feed.getProperty(FEED_MESSAGE_PROPERTY);
      String feed_message = feed_message_t.getValue();
      boolean feed_read = (Boolean)e_feed.getProperty(FEED_READ_STATUS_PROPERTY);
View Full Code Here

      return siol;
    Key k = e_user.getKey();
    Query q = new Query(WORKLIST_ITEM_KIND);
    q.setAncestor(k);
    PreparedQuery pq_wl = datastore.prepare(q);
    List<Entity> el = pq_wl.asList(FetchOptions.Builder.withDefaults());
    for(Iterator<Entity> i = el.iterator(); i.hasNext(); ) {
      Entity e = i.next();
      String dept = (String) e.getProperty(WORKLIST_ITEM_DEPT_PROPERTY);
      String course = (String)e.getProperty(WORKLIST_ITEM_COURSE_PROPERTY);
      String section = (String)e.getProperty(WORKLIST_ITEM_SECTION_PROPERTY);
View Full Code Here

      return wiol;
    Key k = e_user.getKey();
    Query q = new Query(WORKLIST_ITEM_KIND);
    q.setAncestor(k);
    PreparedQuery pq_wl = datastore.prepare(q);
    List<Entity> el = pq_wl.asList(FetchOptions.Builder.withDefaults());
    for(Iterator<Entity> i = el.iterator(); i.hasNext(); ) {
      Entity e = i.next();
      String dept = (String) e.getProperty(WORKLIST_ITEM_DEPT_PROPERTY);
      String course = (String)e.getProperty(WORKLIST_ITEM_COURSE_PROPERTY);
      String section = (String)e.getProperty(WORKLIST_ITEM_SECTION_PROPERTY);
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.