Examples of UnownedJDOOneToManyBiSideA


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

    assertEquals(bId, pm.getObjectId(b2));
  }

  public void testSetPersistBiNewBoth() throws EntityNotFoundException {
    // Persist A-B as unowned
    UnownedJDOOneToManyBiSideA a = new UnownedJDOOneToManyBiSideA();
    a.setName("Side A");
    UnownedJDOOneToManyBiSideB b = new UnownedJDOOneToManyBiSideB();
    b.setName("Side B");
    a.addOther(b);
    b.setRelated(a);

    pm.makePersistent(a);

    Object aId = pm.getObjectId(a);
    Object bId = pm.getObjectId(b);

    pm.evictAll(); // Make sure we go to the datastore

    // Retrieve by id and check
    UnownedJDOOneToManyBiSideA a2 = (UnownedJDOOneToManyBiSideA)pm.getObjectById(aId);
    assertNotNull(a2);
    assertEquals("Side A", a2.getName());
    Set<UnownedJDOOneToManyBiSideB> others = a2.getOthers();
    assertNotNull(others);
    assertEquals(1, others.size());
    UnownedJDOOneToManyBiSideB b2 = others.iterator().next();
    assertNotNull(b2);
    assertNotNull("Side B", b2.getName());
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.