Examples of DatastoreService


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

    return patientEntity;
  }

  private void UploadComments(Key dataEntity, ArrayList<Comment> comments) {
    DatastoreService datastore = DatastoreServiceFactory
        .getDatastoreService();
    for (Comment c: comments) {
      Entity commentEntity = new Entity("Comment", dataEntity);
      commentEntity.setProperty("Text", c.getContent());
      // Author entry consists of user's google account
      commentEntity.setProperty("Author", c.getAuthor().getGoogleUser());
      commentEntity.setProperty("Timestamp", c.getTimestamp());
      commentEntity.setProperty("Title", c.getTitle());
      ArrayList<String> keywords = extractKeywords(c.getContent());
      datastore.put(commentEntity);
      for (String keyword : keywords) {
        Entity kwEntity = new Entity("Keyword", commentEntity.getKey());
        kwEntity.setProperty("Word", keyword.replaceAll("[^A-Za-z]", "").toUpperCase());
        // If this is a chief complaint (first comment), set it as such
        if (c.getTitle().equals("Complaint")) {
          kwEntity.setProperty("Type", "CC");
        }
        else if (c.getTitle().equals("Reason")){
          kwEntity.setProperty("Type", "RE");
        }
        else {
          kwEntity.setProperty("Type", "KW");
        }
        datastore.put(kwEntity);
      }
    }
  }
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.