Key pIdKey = (Key)pId.getKey();
Key cIdKey = (Key)cId.getKey();
oldPM.close();
// Migrate the data
Migrator migrator = new Migrator(((JDOPersistenceManagerFactory)oldPMF).getNucleusContext());
try {
// Migrate the parent
Entity pEntity = ds.get(pIdKey);
boolean changed = migrator.migrate(pEntity, MigratorOneToManyParent.class);
assertTrue("Parent entity should have been changed but wasnt", changed);
if (changed) {
ds.put(pEntity);
}
// Migrate the child
Entity cEntity = ds.get(cIdKey);
changed = migrator.migrate(cEntity, MigratorOneToManyChild.class);
assertFalse("Child entity shouldnt have been changed but was", changed);
if (changed) {
ds.put(cEntity);
}