OpenJPAEntityManager pm = getPM();
//FIXME jthomas
// pm.getFetchPlan().setDetachmentOptions(FetchPlanImpl.DETACH_LOAD_FIELDS | FetchPlanImpl.DETACH_UNLOAD_FIELDS);
pm.setDetachState(DetachStateType.FETCH_GROUPS);
pm.getFetchPlan().addFetchGroup("all");
AttachB b = pm.find(AttachB.class, oid);
assertNotNull("b is null in testDetachWithGroups", b);
b = (AttachB) pm.detach(b);
endEm(pm);
assertTrue(pm.isDetached(b));
assertEquals("b.getAint() not 5", 5, b.getAint());
assertEquals("b.getAint() not 5str", "5", b.getBstr());
assertEquals("b.getStringIntMap().size() not equal to 1", 1,
b.getStringIntMap().size());
b.setAint(12);
b.setBstr("12");
b.getStringIntMap().put("12", new Integer(12));
pm = getPM();
startTx(pm);
AttachB attached = (AttachB) pm.merge(b);
assertEquals("not 12", 12, attached.getAint());
assertEquals("not 12str", "12", attached.getBstr());
assertEquals("not newInteger(12)", new Integer(12),
attached.getStringIntMap().get("12"));
assertEquals("not newInteger(5)", new Integer(5),
attached.getStringIntMap().get("5"));
endTx(pm);
endEm(pm);
pm = getPM();
b = (AttachB) pm.find(AttachB.class, oid);