*/
public class JDOUnownedOneToManyTest extends JDOTestCase {
public void testSetPersistUniNewBoth() throws EntityNotFoundException {
// Persist A-B as unowned
UnownedJDOOneToManyUniSetSideA a = new UnownedJDOOneToManyUniSetSideA();
a.setName("Side A");
UnownedJDOOneToManyUniSideB b = new UnownedJDOOneToManyUniSideB();
b.setName("Side B");
a.addOther(b);
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
UnownedJDOOneToManyUniSetSideA a2 = (UnownedJDOOneToManyUniSetSideA)pm.getObjectById(aId);
assertNotNull(a2);
assertEquals("Side A", a2.getName());
Set<UnownedJDOOneToManyUniSideB> others = a2.getOthers();
assertNotNull(others);
assertEquals(1, others.size());
UnownedJDOOneToManyUniSideB b2 = others.iterator().next();
assertNotNull(b2);
assertNotNull("Side B", b2.getName());