Package com.google.appengine.api.datastore

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


    q_from.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, from);
    PreparedQuery from_key = datastore.prepare(q_from);
    Entity e_from = from_key.asSingleEntity();
    if(e_from == null)
      return false;
    Key key_from = e_from.getKey();
   
    Query q_to = new Query(ACCOUNT_KIND);
    q_to.setKeysOnly();
    q_to.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, to);
    PreparedQuery to_key = datastore.prepare(q_to);
    Entity e_to = to_key.asSingleEntity();
    if(e_to == null)
      return false;
    Key key_to = e_to.getKey();
   
   
    Query s_to = new Query(SUBSCRIPTION_KIND);
    s_to.setAncestor(key_to);
    s_to.addFilter(SUBSCRIPTION_EMAIL_PROPERTY, FilterOperator.EQUAL, from);
View Full Code Here


    q_from.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, from);
    PreparedQuery from_key = datastore.prepare(q_from);
    Entity e_from = from_key.asSingleEntity();
    if(e_from == null)
      return false;
    Key key_from = e_from.getKey();
   
    Query q_to = new Query(ACCOUNT_KIND);
    q_to.setKeysOnly();
    q_to.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, to);
    PreparedQuery to_key = datastore.prepare(q_to);
    Entity e_to = to_key.asSingleEntity();
    if(e_to == null)
      return false;
    Key key_to = e_to.getKey();
   
   
    Query s_to = new Query(SUBSCRIPTION_KIND);
    s_to.setAncestor(key_to);
    s_to.addFilter(SUBSCRIPTION_EMAIL_PROPERTY, FilterOperator.EQUAL, from);
View Full Code Here

    key_query.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, user);
    PreparedQuery pq_key = datastore.prepare(key_query);
    Entity e_user = pq_key.asSingleEntity();
    if(e_user == null)
      return subl;
    Key key = e_user.getKey();
    Query q_sub = new Query(SUBSCRIPTION_KIND);
    q_sub.setAncestor(key);
    if(type.equalsIgnoreCase(SUBSCRIPTION_STATUS_WAITING) || type.equalsIgnoreCase(SUBSCRIPTION_STATUS_PENDING)) {
      q_sub.addFilter(SUBSCRIPTION_STATUS_PROPERTY, FilterOperator.NOT_EQUAL, SUBSCRIPTION_STATUS_ACTIVE);
      q_sub.addSort(SUBSCRIPTION_STATUS_PROPERTY, SortDirection.DESCENDING);
View Full Code Here

    key_query.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, email);
    PreparedQuery pq_key = datastore.prepare(key_query);
    Entity e_from = pq_key.asSingleEntity();
    if(e_from == null)
      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();){
View Full Code Here

    key_query.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, subscriber);
    PreparedQuery pq_key = datastore.prepare(key_query);
    Entity e_subscriber = pq_key.asSingleEntity();
    if(e_subscriber == null)
      return false;
    Key sub_key = e_subscriber.getKey();
    Query q_sub_sender = new Query(SUBSCRIPTION_KIND);
    q_sub_sender.setAncestor(sub_key);
    q_sub_sender.setKeysOnly();
    q_sub_sender.addFilter(SUBSCRIPTION_EMAIL_PROPERTY, FilterOperator.EQUAL, sender);
    q_sub_sender.addFilter(SUBSCRIPTION_STATUS_PROPERTY, FilterOperator.EQUAL, "Active");
    PreparedQuery pq_sender = datastore.prepare(q_sub_sender);
    Entity sender_entity = pq_sender.asSingleEntity();
    if(sender_entity == null)
      return false;
    Key sender_key = sender_entity.getKey();
    Transaction txn = datastore.beginTransaction();
    Entity sender_feed = new Entity(FEED_KIND, sender_key);
    sender_feed.setProperty(FEED_READ_STATUS_PROPERTY, false);
    sender_feed.setProperty(FEED_MESSAGE_PROPERTY, new Text(message));
    sender_feed.setProperty(FEED_TIMESTAMP_PROPERTY, new Date());
View Full Code Here

    PreparedQuery pq = datastore.prepare(q);
    Entity e = pq.asSingleEntity();
    if(e == null) {
      return feeds;
    }
    Key k = e.getKey();
    Query q_feed = new Query(FEED_KIND);
    q_feed.setAncestor(k);
    q_feed.addSort(FEED_TIMESTAMP_PROPERTY,SortDirection.DESCENDING);
    if(getUnreadOnly)
      q_feed.addFilter(FEED_READ_STATUS_PROPERTY, FilterOperator.EQUAL, false);
View Full Code Here

      q_user.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, user);
      PreparedQuery pq = datastore.prepare(q_user);
      Entity e_user = pq.asSingleEntity();
      if (e_user == null)
        return false;
      Key k = e_user.getKey();
      Transaction txn = datastore.beginTransaction();
      Entity e_wli = new Entity(WORKLIST_ITEM_KIND, k);
      e_wli.setProperty(WORKLIST_ITEM_DEPT_PROPERTY, wio.getDeptId());
      e_wli.setProperty(WORKLIST_ITEM_COURSE_PROPERTY, wio.getCourseId());
      e_wli.setProperty(WORKLIST_ITEM_SECTION_PROPERTY, wio.getSectionId());
View Full Code Here

    q_user.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, user);
    PreparedQuery pq = datastore.prepare(q_user);
    Entity e_user = pq.asSingleEntity();
    if(e_user == null)
      return false;
    Key k = e_user.getKey();
    Query q_wio = new Query(WORKLIST_ITEM_KIND);
    q_wio.setAncestor(k);
    q_wio.addFilter(WORKLIST_ITEM_DEPT_PROPERTY, FilterOperator.EQUAL, wio.getDeptId());
    q_wio.addFilter(WORKLIST_ITEM_COURSE_PROPERTY, FilterOperator.EQUAL, wio.getCourseId());
    q_wio.addFilter(WORKLIST_ITEM_SECTION_PROPERTY, FilterOperator.EQUAL, wio.getSectionId());
View Full Code Here

      q_user.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, user);
      PreparedQuery pq = datastore.prepare(q_user);
      Entity e_user = pq.asSingleEntity();
      if (e_user == null)
        return false;
      Key k = e_user.getKey();
      Query q_wio = new Query(WORKLIST_ITEM_KIND);
      q_wio.setAncestor(k);
      q_wio.setKeysOnly();
      q_wio.addFilter(WORKLIST_ITEM_DEPT_PROPERTY, FilterOperator.EQUAL, wio.getDeptId());
      q_wio.addFilter(WORKLIST_ITEM_COURSE_PROPERTY, FilterOperator.EQUAL, wio.getCourseId());
View Full Code Here

    q_user.addFilter(ACCOUNT_ID_PROPERTY, FilterOperator.EQUAL, user);
    PreparedQuery pq = datastore.prepare(q_user);
    Entity e_user = pq.asSingleEntity();
    if(e_user == null)
      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(); ) {
View Full Code Here

TOP

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

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.