Package com.google.appengine.api.datastore

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


  public List<CachedCourseInformationObject> getCachedCourseInformationObjectList()
      throws EntityNotFoundException {
    List<Entity> cel = getCacheEntityList();
    List<CachedCourseInformationObject> cciol = new ArrayList<CachedCourseInformationObject>();
    for (Iterator i = cel.iterator(); i.hasNext();) {
      Entity e = (Entity) i.next();
      cciol.add(getCourseInformation(e.getKey()));
    }
    return cciol;
  }
View Full Code Here


  public List<ContactInformationObject> getContactEntryList(
      UniqueCourseObject uco) throws EntityNotFoundException {
    Query q = new Query("Cache");
    q.addFilter("courseKey", Query.FilterOperator.EQUAL,
        getUniqueCourseEntity(uco).getKey());
    Entity qe = datastore.prepare(q).asSingleEntity();
    List<Entity> ceel = getContactEntryEntityList(qe.getKey());
    List<ContactInformationObject> ciol = new ArrayList<ContactInformationObject>();
    for (Iterator i = ceel.iterator(); i.hasNext();) {
      Entity e = (Entity) i.next();
      ciol.add(getContactInformation((Key) e.getProperty("contactKey")));
    }
    return ciol;
  }
View Full Code Here

  public boolean addCourse(UniqueCourseObject uco)
      throws EntityNotFoundException {
    boolean b = checkCourseExist(uco);
    if (!b) {
      Entity course = createUniqueCourseEntity(uco);
      createCacheEntity(course.getKey());
    }
    return !b;
  }
View Full Code Here

  }
 
  public LoginInformationObject getLoginInformationObject(String username) {
    Query q = new Query("Login Information");
    q.addFilter("username", Query.FilterOperator.EQUAL, username);
    Entity qe = datastore.prepare(q).asSingleEntity();
    String password = (String) qe.getProperty("password");
    boolean active = (Boolean) qe.getProperty("active");
    LoginInformationObject lio = new LoginInformationObject(username,password,active);
    return lio;
  }
View Full Code Here

  }
 
  public boolean validateLogin(String username) {
    Query q = new Query("Login Information");
    q.addFilter("username", Query.FilterOperator.EQUAL, username);
    Entity qe = datastore.prepare(q).asSingleEntity();
    boolean b = !(Boolean) qe.getProperty("active");
    if (b)
      qe.setProperty("active", true);
    datastore.put(qe);
    return b;
  }
View Full Code Here

  }
 
  private void createLoginInformationEntity(LoginInformationObject lio){
    Transaction txn = datastore.beginTransaction();
    Key k = KeyFactory.createKey("Login Information Set", "LOGIN_SET");
    Entity e = new Entity("Login Information", k);
    e.setProperty("username", lio.getUsername());
    e.setProperty("password", lio.getPassword());
    datastore.put(e);
    txn.commit();
   
  }
View Full Code Here

  public boolean addNotifier(UniqueCourseObject uco,
      ContactInformationObject cio) throws EntityNotFoundException {
    boolean b = checkNotifierExist(uco, cio);
    if (!b){
      Entity contactInfo = createContactInformationEntity(cio);
      createContactEntryEntity(uco, contactInfo.getKey());
    }
    return !b;
  }
View Full Code Here

    return !b;
  }

  private UniqueCourseObject getUniqueCourse(Key courseKey)
      throws EntityNotFoundException {
    Entity e = datastore.get(courseKey);
    UniqueCourseObject uco = new UniqueCourseObject(
        (String) e.getProperty("departmentName"),
        (String) e.getProperty("courseNumber"),
        (String) e.getProperty("sectionNumber"));
    return uco;
  }
View Full Code Here

    return uco;
  }

  private CachedCourseInformationObject getCourseInformation(Key cacheKey)
      throws EntityNotFoundException {
    Entity e = datastore.get(cacheKey);
    CachedCourseInformationObject ccio = new CachedCourseInformationObject(
        (Long) e.getProperty("generalSeats"),
        (Long) e.getProperty("restrictedSeats"));
    return ccio;
  }
View Full Code Here

    return results;
  }

  private ContactInformationObject getContactInformation(Key contactKey)
      throws EntityNotFoundException {
    Entity e = datastore.get(contactKey);
    ContactInformationObject cio = new ContactInformationObject(
        (String) e.getProperty("emailAddress"),
        (String) e.getProperty("phoneNumber"),
        (Long) e.getProperty("seatConfig"),
        (Long) e.getProperty("notifyConfig"),
        (String) e.getProperty("carrier"));
    return cio;
 
  }
View Full Code Here

TOP

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

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.