Package com.googlecode.objectify.test.entity

Examples of com.googlecode.objectify.test.entity.Name


  public void bigStringsAreAllowedInEmbeddedCollections() throws Exception
  {
    fact().register(HasNames.class);

    HasNames has = new HasNames();
    has.names = new Name[] { new Name("Bob", BIG_STRING) };

    HasNames fetched = ofy().saveClearLoad(has);
    assert fetched.names[0].lastName.equals(BIG_STRING);
  }
View Full Code Here


    assert t2.mayor != null;
    assert t2.mayor.name == null;

    // mayor with null names
    t1 = new Town();
    t1.mayor = new Someone(new Name(null, null), 30);

    t1Key = ofy().save().entity(t1).now();

    t2 = ofy().load().key(t1Key).now();
View Full Code Here

  public void testUnindexed() throws Exception {
    fact().register(PartiallyIndexedEntity.class);

    PartiallyIndexedEntity obj = new PartiallyIndexedEntity(
        new PartiallyIndexedStruct(
            new Someone(new Name("A", "B"), 30),
            new Someone(new Name("C", "D"), 31), "1", "2"),
        new PartiallyIndexedStruct(
            new Someone(new Name("a", "b"), 32),
            new Someone(new Name("c", "d"), 33), "3", "4")
    );

    checkUnindexed(obj);
  }
View Full Code Here

    fact().register(PartiallyIndexedEntity.class);
    fact().register(PartiallyIndexedStructSubclass.class);
   
    PartiallyIndexedEntity obj = new PartiallyIndexedEntity(
        new PartiallyIndexedStructSubclass(
            new Someone(new Name("A", "B"), 30),
            new Someone(new Name("C", "D"), 31), "1", "2"),
        new PartiallyIndexedStructSubclass(
            new Someone(new Name("a", "b"), 32),
            new Someone(new Name("c", "d"), 33), "3", "4")
    );
   
    checkUnindexed(obj);
  }
View Full Code Here

  public void testDeepEmbeddedArrays() throws Exception {
    fact().register(TeamEntity.class);

    TeamEntity t = new TeamEntity();
    t.members = new Names();
    t.members.names = new Name[]{new Name("Joe", "Smith"), new Name("Jane", "Foo")};
    Key<TeamEntity> k = ofy().save().entity(t).now();

    System.out.println(ds().get(k.getRaw()));

    t = ofy().load().key(k).now();
View Full Code Here

  public void setUpExtra()
  {
    fact().register(Criminal.class);

    Criminal avoid = new Criminal();
    avoid.aliases = new Name[] { new Name("Bob", "Dobbs") };
    avoid.moreAliases = Collections.singletonList(new Name("Bob", "Dobbs"));
    ofy().save().entity(avoid).now();
  }
View Full Code Here

   */
  @Test
  public void easierTestCollectionContainingNullAndOtherStuff() throws Exception
  {
    Criminal crim = new Criminal();
    crim.aliases = new Name[] { new Name("Bob", "Dobbs"), null, new Name("Ivan", "Stang") };

    Criminal fetched = ofy().saveClearLoad(crim);

    assert fetched.aliases != null;
    assert fetched.aliases.length == 3;
View Full Code Here

   */
  @Test
  public void testCollectionContainingNullAndOtherStuff() throws Exception
  {
    Criminal crim = new Criminal();
    crim.aliases = new Name[] { new Name("Bob", "Dobbs"), null, new Name("Ivan", "Stang") };
    crim.moreAliases = Arrays.asList(crim.aliases);

    Criminal fetched = ofy().saveClearLoad(crim);

    assert fetched.aliases != null;
View Full Code Here

   */
  @Test
  public void testEmbeddedSetWithNullField() throws Exception
  {
    Criminal crim = new Criminal();
    crim.aliases = new Name[] { new Name("Bob", "Dobbs"), new Name("Mojo", null), new Name("Ivan", "Stang") };
    crim.aliasesSet = new HashSet<>(Arrays.asList(crim.aliases));

    Criminal fetched = ofy().saveClearLoad(crim);

    for (Name name: crim.aliases)
View Full Code Here

TOP

Related Classes of com.googlecode.objectify.test.entity.Name

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.