Package com.googlecode.objectify.test.entity

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


  public void testNullHandling() throws Exception {
    fact().register(Town.class);

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

    Key<Town> t1Key = ofy().save().entity(t1).now();

    Town t2 = ofy().load().key(t1Key).now();

    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

TOP

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

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.