Package com.google.code.gaeom

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


    x1.blah = null;
    x2.blah = null;
    x3.blah = null;

    // without refresh
    List<X> same = Lists.newArrayList(oss.load(keys).<X> now());
    assertNull(same.get(0).blah);
    assertNull(same.get(1).blah);
    assertNull(same.get(2).blah);

    List<X> list = Lists.newArrayList(oss.refresh(same).now());
View Full Code Here


    ObjectStoreSession oss = os.beginSession();
    X parent = new X();
    oss.store(parent).now();
    oss.store(new X()).id("a").parent(parent).now();

    assertEquals(X.class, oss.load(X.class).id("a").parent(parent).now().getClass());
  }

  @Test
  public void testLoadMultipleParentedStringId()
  {
View Full Code Here

    ObjectStoreSession oss = os.beginSession();
    X parent = new X();
    oss.store(parent).now();
    oss.store(new X(), new X(), new X()).ids("a", "b", "c").parent(parent).now();

    assertEquals(3, oss.load(X.class).ids("a", "b", "c").parent(parent).now().size());
  }

  // TODO: test failure of parents to get key
  // TODO: think about if we should allow ids to not match the number of objects in store()
  // TODO: should we unify the code path between single and double for the loaders (maybe we already have?)
View Full Code Here

   
    Key key = oss1.store(tc).now();
   
    ObjectStoreSession oss2 = os.beginSession();

    TestCache tc2 = (TestCache)oss2.load(key).now();
   
    assertTrue("same instance", tc == tc2);
  }
}
View Full Code Here

    Key key = oss.store(a).now();

    ObjectStoreSession oss2 = os.beginSession();

    A a2 = (A) oss2.load(key).now();

    assertEquals(a.name, a2.name);
    assertNotNull(a2.b);
    assertEquals(a.b.name, a2.b.name);
  }
View Full Code Here

    Key key = oss.store(a).now();
    oss.delete(a.b).now();

    ObjectStoreSession oss2 = os.beginSession();

    oss2.load(key).retries(1).now();
    assertTrue(false);
  }

  public static class Family
  {
View Full Code Here

    Key key = oss.store(family).now();

    ObjectStoreSession oss2 = os.beginSession();

    Family family2 = (Family) oss2.load(key).now();

    assertEquals(family.name, family2.name);
    assertEquals(family.heads.size(), family2.heads.size());
    assertEquals(family.children.size(), family2.children.size());
    assertEquals(family.heads.get(0).name, family2.heads.get(0).name);
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.