switchDatasource(JDOTestCase.PersistenceManagerFactoryName.transactional);
Flight f1 = newFlight();
Flight f2 = newFlight();
Flight f3 = newFlight();
Flight f4 = newFlight();
BidirectionalChildListJDO bidirChild1 = new BidirectionalChildListJDO();
BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
BidirectionalChildListJDO bidirChild3 = new BidirectionalChildListJDO();
BidirectionalChildListJDO bidirChild4 = new BidirectionalChildListJDO();
HasOneToManyListJDO parent1 = new HasOneToManyListJDO();
parent1.setId(new KeyFactory.Builder("Yar", 43).addChild(HasOneToManyListJDO.class.getSimpleName(), "k1").getString());
parent1.getFlights().add(f1);
parent1.getFlights().add(f2);
parent1.getBidirChildren().add(bidirChild1);
parent1.getBidirChildren().add(bidirChild2);
HasOneToManyListJDO parent2 = new HasOneToManyListJDO();
parent2.setId(new KeyFactory.Builder("Yar", 43).addChild(HasOneToManyListJDO.class.getSimpleName(), "k2").getString());
parent2.getFlights().add(f3);
parent2.getFlights().add(f4);
parent2.getBidirChildren().add(bidirChild3);
parent2.getBidirChildren().add(bidirChild4);
beginTxn();
pm.makePersistentAll(parent1, parent2);
commitTxn();
assertEquals(2, countForClass(HasOneToManyListJDO.class));
assertEquals(4, countForClass(Flight.class));
assertEquals(4, countForClass(BidirectionalChildListJDO.class));
assertEquals(1, batchRecorder.batchOps);
Entity parent1Entity = ds.get(KeyFactory.stringToKey(parent1.getId()));
Entity parent2Entity = ds.get(KeyFactory.stringToKey(parent2.getId()));
Entity flight1Entity = ds.get(KeyFactory.stringToKey(f1.getId()));
Entity flight2Entity = ds.get(KeyFactory.stringToKey(f2.getId()));
Entity flight3Entity = ds.get(KeyFactory.stringToKey(f3.getId()));
Entity flight4Entity = ds.get(KeyFactory.stringToKey(f4.getId()));
Entity bidir1Entity = ds.get(KeyFactory.stringToKey(bidirChild1.getId()));
Entity bidir2Entity = ds.get(KeyFactory.stringToKey(bidirChild2.getId()));
Entity bidir3Entity = ds.get(KeyFactory.stringToKey(bidirChild3.getId()));
Entity bidir4Entity = ds.get(KeyFactory.stringToKey(bidirChild4.getId()));
assertEquals(4, parent1Entity.getProperties().size());
assertTrue(parent1Entity.hasProperty("hasKeyPks"));
assertNull(parent1Entity.getProperty("hasKeyPks"));
assertEquals(
Utils.newArrayList(flight1Entity.getKey(), flight2Entity.getKey()),