int f2 = 68746;
PersistenceManager pm = pmf.getPersistenceManager();
BasicB bb = new BasicB(id1, id2, f1, f2);
pm.makePersistent(bb);
StringLongId id = (StringLongId) pm.getObjectId(bb);
logger.log(BasicLevel.DEBUG, "UserId=" + id);
Assert.assertNotNull("identifier is null", id);
String strid = id.toString();
bb = null;
pm.close();
pm = pmf.getPersistenceManager();
Object o = pm.newObjectIdInstance(BasicB.class, strid);
bb = (BasicB) pm.getObjectById(o, false);
Assert.assertNotNull("returned object is null", bb);
Assert.assertEquals("Bad field 'id1' value", id1, bb.getId1());
Assert.assertEquals("Bad field 'di2' value", id2, bb.getId2());
Assert.assertEquals("Bad field 'f1' value", f1, bb.readF1());
Assert.assertEquals("Bad field 'f1' value", f2, bb.readF2());
Query q = pm.newQuery(BasicB.class);
Iterator it = ((Collection) q.execute()).iterator();
while(it.hasNext()) {
BasicB _bb = (BasicB) it.next();
StringLongId oid = (StringLongId) pm.getObjectId(_bb);
assertTrue(_bb == pm.getObjectById(oid, false));
}
q.closeAll();
pm.currentTransaction().begin();