Package com.google.appengine.api.datastore

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


    return b;
  }
 
  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


    return ccio;
  }

  private List<Entity> getContactInformationEntityList() {
    Query q = new Query("Contact Information");
    Key k = KeyFactory.createKey("Contact Information Set", "CONTACT_SET");
    q.setAncestor(k);
    List<Entity> results = datastore.prepare(q).asList(
        FetchOptions.Builder.withDefaults());
    return results;
  }
View Full Code Here

 
  }

  private Entity createCacheEntity(Key courseKey)
      throws EntityNotFoundException {
    Key k = KeyFactory.createKey("Cache List", "CACHE_LIST");
    UBCSectionDetailService w = new UBCSectionDetailService();
    w.initContent(getUniqueCourse(courseKey));
    Entity e = new Entity("Cache", k);
    e.setProperty("courseKey", courseKey);
    e.setProperty("generalSeats", w.getGenSeatsRemain());
View Full Code Here

    }
  }

  private List<Entity> getCacheEntityList() {
    Query q = new Query("Cache");
    Key k = KeyFactory.createKey("Cache List", "CACHE_LIST");
    q.setAncestor(k);
    List<Entity> results = datastore.prepare(q).asList(
        FetchOptions.Builder.withDefaults());
    return results;
  }
View Full Code Here

    return results;
  }

  private void destroyContactEntry(Key contactEntryKey) throws EntityNotFoundException {
    Entity e = datastore.get(contactEntryKey);
    Key k = (Key)e.getProperty("contactKey");
    datastore.delete(k);
    datastore.delete(contactEntryKey);
  }
View Full Code Here

    return datastore.prepare(q).asSingleEntity();
  }

  private Entity createContactInformationEntity(ContactInformationObject cio) {
    Transaction txn = datastore.beginTransaction();
    Key k = KeyFactory.createKey("Contact Information Set", "CONTACT_SET");
    Entity e = new Entity("Contact Information", k);
    e.setProperty("emailAddress", cio.getEmailAddress());
    e.setProperty("phoneNumber", cio.getPhoneNumber());
    e.setProperty("seatConfig", cio.getSeatConfig());
    e.setProperty("notifyConfig", cio.getNotifyConfig());
View Full Code Here

  }

  private Entity createUniqueCourseEntity(UniqueCourseObject uco) {

    Transaction txn = datastore.beginTransaction();
    Key k = KeyFactory.createKey("Unique Course Set", "COURSE_ID_SET");
    Entity e = new Entity("Unique Course", k);
    e.setProperty("departmentName", uco.getDepartmentName());
    e.setProperty("courseNumber", uco.getCourseNumber());
    e.setProperty("sectionNumber", uco.getSectionNumber());
    datastore.put(e);
View Full Code Here

    A  a= new A();
    a.b = new B();
    a.b.a = a;
   
    ObjectStore os = ObjectStore.Factory.create();
    Key key = os.beginSession().store(a).now();
   
    A a2 = os.beginSession().load(key).now();
   
    assertEquals(a2, a2.b.a);
  }
View Full Code Here

    FindEnums fe = new FindEnums();
    fe.op = Find.Op.EqualTo;
    fe.sort = Find.Sort.Descending;
    fe.policy = Parent.FilterPolicy.AncestorQuery;

    Key key = ObjectStore.Factory.create().beginSession().store(fe).now();

    FindEnums fe2 = ObjectStore.Factory.create().beginSession().load(key).now();

    assertEquals(fe.op, fe2.op);
    assertEquals(fe.sort, fe2.sort);
View Full Code Here

    a.b = new A();
    a.b.name = "Fred";

    ObjectStoreSession oss = os.beginSession();

    Key key = oss.store(a).now();
    assertTrue(oss.isActivated(a));
    assertTrue(oss.isActivated(a.b));
    return key;
  }
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.