Collection exceps = psMgr.getExceptions();
Collection mappedByIdStates = new ArrayList();
for (Iterator itr = states.iterator(); itr.hasNext();) {
OpenJPAStateManager obj = (OpenJPAStateManager)itr.next();
if (obj instanceof StateManagerImpl) {
StateManagerImpl sm = (StateManagerImpl) obj;
if (sm.getMappedByIdFields() != null)
mappedByIdStates.add(sm);
else exceps = populateRowManager(sm, rowMgr, store, exceps,
customs);
} else
exceps = populateRowManager(obj, rowMgr, store, exceps,
customs);
}
// flush rows
exceps = flush(rowMgr, psMgr, exceps);
if (mappedByIdStates.size() != 0) {
for (Iterator itr = mappedByIdStates.iterator(); itr.hasNext();) {
StateManagerImpl sm = (StateManagerImpl) itr.next();
exceps = populateRowManager(sm, rowMgr, store, exceps, customs);
}
// flush rows
exceps = flush(rowMgr, psMgr, exceps);
}