*/
public static Collection loadAll(Collection sms, StoreManager store,
PCState state, int load, FetchConfiguration fetch, Object context) {
Collection failed = null;
OpenJPAStateManager sm;
LockManager lm;
for (Iterator itr = sms.iterator(); itr.hasNext();) {
sm = (OpenJPAStateManager) itr.next();
if (sm.getManagedInstance() == null) {
if (!store.initialize(sm, state, fetch, context))
failed = addFailedId(sm, failed);
} else if (load != StoreManager.FORCE_LOAD_NONE
|| sm.getPCState() == PCState.HOLLOW) {
lm = sm.getContext().getLockManager();
if (!store.load(sm, sm.getUnloaded(fetch), fetch,
lm.getLockLevel(sm), context))
failed = addFailedId(sm, failed);
} else if (!store.exists(sm, context))
failed = addFailedId(sm, failed);
}
return (failed == null) ? Collections.EMPTY_LIST : failed;