Package com.google.appengine.api.datastore

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


      q_wio.addFilter(WORKLIST_ITEM_COURSE_PROPERTY, FilterOperator.EQUAL, wio.getCourseId());
      q_wio.addFilter(WORKLIST_ITEM_SECTION_PROPERTY, FilterOperator.EQUAL, wio.getSectionId());
      PreparedQuery pq_wio = datastore.prepare(q_wio);
      if(pq_wio.asSingleEntity() == null)
        return false;
      Transaction txn = datastore.beginTransaction();
      datastore.delete(pq_wio.asSingleEntity().getKey());
      txn.commit();
      return true;
  }
View Full Code Here


    datastore.put(qe);
    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

    q.setAncestor(cacheKey);
    q.setKeysOnly();
    List<Entity> results = datastore.prepare(q).asList(
        FetchOptions.Builder.withDefaults());
    for (Iterator i = results.iterator(); i.hasNext();) {
      Transaction txn = datastore.beginTransaction();
      Entity e = (Entity) i.next();
      datastore.delete(e.getKey());
      txn.commit();
    }
  }
View Full Code Here

  private Entity createContactEntryEntity(UniqueCourseObject uco,
      Key contactKey) {
    Entity e = new Entity("Contact Entry", getCacheEntity(uco).getKey());
    e.setProperty("contactKey", contactKey);
    Transaction txn = datastore.beginTransaction();
    datastore.put(e);
    txn.commit();
    return e;
  }
View Full Code Here

        .getGateway());
    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());
    e.setProperty("carrier", cio.getCarrier().getGateway());
    datastore.put(e);
    txn.commit();
    return e;
  }
View Full Code Here

    txn.commit();
    return e;
  }

  private void destroyContactInformationEntity(Key contactKey) {
    Transaction txn = datastore.beginTransaction();
    datastore.delete(contactKey);
    txn.commit();
  }
View Full Code Here

    txn.commit();
  }

  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);
    txn.commit();
    return e;
  }
View Full Code Here

    txn.commit();
    return e;
  }

  private void destroyUniqueCourseEntity(Key courseKey) {
    Transaction txn = datastore.beginTransaction();
    datastore.delete(courseKey);
    txn.commit();
  }
View Full Code Here

    throw new UnsupportedOperationException();
  }

  public Transaction beginTransaction()
  {
    return new Transaction()
    {

      public void commit()
      {
      }
View Full Code Here

        new Value(10000), new Value(1500));
    Iterable<CompressionType> compressionTypes =
        asList(CompressionType.NONE, CompressionType.GZIP, null);
    for (Value original : values) {
      for (CompressionType compression : compressionTypes) {
        Transaction tx = datastore.beginTransaction();
        Entity entity = new Entity(key);
        SerializationUtil.serializeToDatastoreProperty(tx, entity, "foo", original, compression);
        datastore.put(entity);
        tx.commit();
        entity = datastore.get(key);
        Serializable restored = SerializationUtil.deserializeFromDatastoreProperty(entity, "foo");
        assertEquals(original, restored);
      }
    }
View Full Code Here

TOP

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

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.