while (iter.hasNext())
{
// obtain a StateManager
pc = (PersistenceCapable) iter.next();
Identity oid = new Identity(pc, broker);
StateManagerInternal smi = pmi.getStateManager(oid, pc.getClass());
// fetch attributes into StateManager
JDOClass jdoClass = Helper.getJDOClass(pc.getClass());
fieldNums = jdoClass.getManagedFieldNumbers();
FieldManager fm = new OjbFieldManager(pc, broker);
smi.replaceFields(fieldNums, fm);
smi.retrieve();
// get JDO PersistencecCapable instance from SM and add it to result collection
Object instance = smi.getObject();
result.add(instance);
}
return result;
}