Package com.vercer.engine.persist.annotation

Examples of com.vercer.engine.persist.annotation.AnnotationObjectDatastore.load()


    Key key = datastore.store(musicFestival);

    AnnotationObjectDatastore typesafe2 = new AnnotationObjectDatastore();
    typesafe2.setActivationDepth(5);
    Object reloaded = typesafe2.load(key);

    // they should be different instances from distinct sessions
    assertNotSame(musicFestival, reloaded);

    // they should have the same data
View Full Code Here


      datastore.store(foo);
    }

    {
      ObjectDatastore datastore = new AnnotationObjectDatastore(false);
      Foo foundFoo = datastore.load(Foo.class, "foo1");

      assertEquals("foo1", foundFoo.myKey);
      assertEquals("foo1Name", foundFoo.innerFoo.myName);
      assertEquals(2, foundFoo.moreInnerFoos.size());
      assertEquals("helloFoo", foundFoo.moreInnerFoos.get("hello").myName);
View Full Code Here

    ObjectDatastore datastore = new AnnotationObjectDatastore();
    Key key = datastore.store(container);
   
    datastore.disassociateAll();
   
    EnumContainer loaded = datastore.load(key);
   
    Assert.assertTrue(loaded.theEnumSet instanceof EnumSet<?>);
    Assert.assertTrue(loaded.theEnumSet.size() == 2);
  }
}
View Full Code Here

    b1.cs = Lists.newArrayList(c11, c12);
   
    ObjectDatastore datastore = new AnnotationObjectDatastore();
    Key key = datastore.store(a);
    datastore.disassociateAll();
    A reloaded = datastore.load(key);
   
    Assert.assertNull(reloaded.bs.get(0).cs.get(0).field);
  }
}
View Full Code Here

                ObjectDatastore ods1 = new AnnotationObjectDatastore();
                ExampleModel model = new ExampleModel();
                model.setTransientField("xxx");
                ods1.store(model);
                ObjectDatastore ods2 = new AnnotationObjectDatastore();
                ExampleModel reloadedModel = ods2.load(ods1.associatedKey(model));
                assertEquals("xxx", reloadedModel.getTransientField());
        }
}
View Full Code Here

    AnnotationObjectDatastore datastore = new AnnotationObjectDatastore();
    Key key = datastore.store(created);
   
    datastore.disassociateAll();
   
    Object loaded = datastore.load(key);
   
    Assert.assertEquals(created, loaded);
  }
}
View Full Code Here

    item.things.add(thing);
    item.things.add(null);
   
    datastore.disassociateAll();
   
    TypeWithCollections loaded = datastore.load(key);
    Assert.assertNotNull(loaded);
  }
}
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.