Examples of Child22


Examples of com.google.appengine.datanucleus.test.jpa.SingleTableInheritanceJPA.Child22

    Assert.assertEquals(21L, c21.getChild21Long());
    Assert.assertNull(c21.getParentStr());
    startEnd.end();

    //  create Child22
    Child22 c22 = newChild22(startEnd, "ParentChild22", "Child22", Boolean.TRUE, new Embedded2("Embedded2Child22", -7d));
    Long c22Id = c22.getId();
    Key c22Key = KeyFactory.createKey(PARENT_KIND, c22Id);

    //  verify Child22 entity
    Entity c22e = ds.get(c22Key);
    Assert.assertEquals(c22Key, c22e.getKey());   
    Assert.assertEquals("C22", c22e.getProperty("DTYPE"));
    Assert.assertEquals("ParentChild22", c22e.getProperty("parentStr"));
    Assert.assertEquals("Child22", c22e.getProperty("child22Str"));
    Assert.assertEquals(0L, c22e.getProperty("child21Long"));
    Assert.assertEquals(Boolean.TRUE, c22e.getProperty("value_0"));
    Assert.assertEquals(new Text("Embedded2Child22"), c22e.getProperty("str"));
    Assert.assertEquals(-7d, c22e.getProperty("dbl"));
    Assert.assertEquals(7, c22e.getProperties().size());

    //  verify Child22 object
    startEnd.start();
    c22 = em.find(Child22.class, c22Id);
    Assert.assertEquals(c22Id, c22.getId());
    Assert.assertEquals("ParentChild22", c22.getParentStr());
    Assert.assertEquals(0L, c22.getChild21Long());
    Assert.assertEquals("Child22", c22.getChild22Str());
    startEnd.end();
   
    Assert.assertEquals(5, countForKind(PARENT_KIND));
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.SingleTableInheritanceJPA.Child22

    Long pId = p.getId();

    Child21 c21 = newChild21(startEnd, "D", 121L);
    Long c21Id = c21.getId();

    Child22 c22 = newChild22(startEnd, "E", "Child22", Boolean.TRUE, null);
    Long c22Id = c22.getId();
   
    Assert.assertEquals(5, countForKind(PARENT_KIND));
   
    if (em.isOpen()) {
      em.close();
    }
    em = emf.createEntityManager();
   
    startEnd.start();
    Query q = em.createQuery("select p from " + Parent.class.getName() + " p order by parentStr desc");
    List<Parent> r = (List<Parent>)q.getResultList();
    Assert.assertEquals(5, r.size());

    c22 = (Child22)r.get(0);
    Assert.assertEquals(c22Id, c22.getId());
    Assert.assertEquals("E", c22.getParentStr());
    Assert.assertEquals("Child22", c22.getChild22Str());
    Assert.assertEquals(Boolean.TRUE, c22.getValue());

    c21 = (Child21)r.get(1);
    Assert.assertEquals(c21Id, c21.getId());
    Assert.assertEquals("D", c21.getParentStr());
    Assert.assertEquals(121L, c21.getChild21Long());
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.SingleTableInheritanceJPA.Child22

    makePersistent(c21, startEnd);
    return c21;
  }
 
  private Child22 newChild22(StartEnd startEnd, String parentStr, String child22Str, Boolean value, Embedded2 embedded2) {
    Child22 c22 = new Child22();
    c22.setParentStr(parentStr);
    c22.setChild22Str("Child22");
    c22.setEmbedded2(embedded2);
    c22.setValue(value);
    makePersistent(c22, startEnd);
    return c22;
  }
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.