Package com.google.appengine.datanucleus.test.jpa

Examples of com.google.appengine.datanucleus.test.jpa.HasGrandchildJPA


    assertEquals(KeyFactory.stringToKey(pojo.getId()), e.getKey().getParent());
  }

  public void testSerializeWithOneToMany_AddGrandchildToUnidirectionalDetached() throws Exception {
    beginTxn();
    HasGrandchildJPA hasGrandchild = new HasGrandchildJPA();
    HasOneToManySetJPA pojo = new HasOneToManySetJPA();
    hasGrandchild.getYar().add(pojo);
    pojo.setVal("yar");
    Book b = new Book();
    b.setAuthor("harry");
    pojo.getBooks().add(b);
    em.persist(hasGrandchild);
    commitTxn();
    em.close();
    em = emf.createEntityManager();

    hasGrandchild = toBytesAndBack(hasGrandchild);
    pojo = hasGrandchild.getYar().iterator().next();
    assertEquals("yar", pojo.getVal());
    assertEquals(1, pojo.getBooks().size());
    Book b2 = new Book();
    b2.setAuthor("yar3");
    pojo.getBooks().add(b2);
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jpa.HasGrandchildJPA

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.