Package com.google.code.gaeom

Examples of com.google.code.gaeom.ObjectStoreSession.store()


    e.embeddee.size = 55L;
    e.embeddee.ork = new Embeddee2();
    e.embeddee.ork.foo = "Ork";
    e.embeddee.ork.goo = 44L;

    oss.store(e).now();

    e.name = null;
    e.embeddee = null;
   
    oss.refresh(e).now();
View Full Code Here


    for (int ct = 0; ct < 10; ct++)
      objs.add(new EnumObject());

    ObjectStore os = ObjectStore.Factory.create();
    ObjectStoreSession oss = os.beginSession();
    oss.store(objs).now();

    // will get new objects b/c we are using a new session
    Set<EnumObject> result = Sets.newHashSet(os.beginSession().find(EnumObject.class).now());

    assertEquals(objs, result);
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

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

    ObjectStoreSession oss = os.beginSession();

    Key key = oss.store(a).now();
    assertTrue(oss.isActivated(a));
    assertTrue(oss.isActivated(a.b));
    Key key1 = oss.getKey(a.b);

    ObjectStoreSession oss2 = os.beginSession();
View Full Code Here

    Key key = load();
    ObjectStoreSession oss2 = os.beginSession();
    A a = oss2.load(key).activate(0).now();

    a.b.name = "bob";
    oss2.store(a.b).now();
  }

}
View Full Code Here

    ObjectStoreSession oss = os.beginSession();

    List<Foo> foos = Lists.newArrayList();
    for (int ct = 0; ct < 100; ct++)
      foos.add(new Foo(ct));
    oss.store(foos).now();

    assertEquals(100, oss.find(Foo.class).count().now().intValue());

    assertEquals(50, oss.find(Foo.class).filter("value", Op.LessThan, 50).count().now().intValue());
    assertEquals(51, oss.find(Foo.class).filter("value", Op.LessThanOrEqualTo, 50).count().now().intValue());
View Full Code Here

    foo.values.add("Foo");
    foo.values.add("Bar");
    foo.values.add("Bas");
   
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    oss.store(foo).now();
   
    List<String> orig = foo.values;
    foo.values = null;
   
    oss.refresh(foo).now();
View Full Code Here

    p.phones.add(new Phone(207, 686, 7777));
    p.phones.add(new Phone(207, 555, 7777));
    p.phones.get(1).prefix = null// prove out the rectangulation of the thing
   
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    oss.store(p).now();
   
    List<Phone> orig = p.phones;
    p.phones = null;
   
    oss.refresh(p).now();
View Full Code Here

    ObjectStore os = ObjectStore.Factory.create();
    ObjectStoreSession oss = os.beginSession();

    Tester t1 = new Tester();
    t1.name = "Fred Flintstone";
    Key key = oss.store(t1).now();

    oss.delete(t1).now();

    os.beginSession().load(key).now(); // may not fail because changes not rolled forward see superclass
View Full Code Here

    ObjectStore os = ObjectStore.Factory.create();
    ObjectStoreSession oss = os.beginSession();

    Tester t1 = new Tester();
    t1.name = "Fred Flintstone";
    Key key = oss.store(t1).now();

    oss.delete(t1).now();

    os.beginSession().load(key).now(); // may not fail because changes not rolled forward see superclass
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.