Package com.google.appengine.datanucleus.test.jdo

Examples of com.google.appengine.datanucleus.test.jdo.HasOneToManyChildAtMultipleLevelsJDO


    switchDatasource(PersistenceManagerFactoryName.nontransactional);
    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testOneToManyChildAtMultipleLevels(NEW_PM_START_END);
  }
  public void testOneToManyChildAtMultipleLevels(StartEnd startEnd) {
    HasOneToManyChildAtMultipleLevelsJDO pojo = new HasOneToManyChildAtMultipleLevelsJDO();
    Flight f1 = new Flight();
    pojo.setFlights(Utils.newArrayList(f1));
    HasOneToManyChildAtMultipleLevelsJDO child = new HasOneToManyChildAtMultipleLevelsJDO();
    Flight f2 = new Flight();
    child.setFlights(Utils.newArrayList(f2));
    pojo.setChild(child);
    startEnd.start();
    pm.makePersistent(pojo);
    startEnd.end();
    startEnd.start();
    assertEquals(2, countForClass(Flight.class));
    pojo = pm.getObjectById(HasOneToManyChildAtMultipleLevelsJDO.class, pojo.getId());
    assertEquals(child.getId(), pojo.getChild().getId());
    assertEquals(1, pojo.getFlights().size());
    assertTrue(pojo.getFlights().get(0).customEquals(f1));
    assertTrue(child.getFlights().get(0).customEquals(f2));
    assertEquals(1, child.getFlights().size());
    startEnd.end();
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.HasOneToManyChildAtMultipleLevelsJDO

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.