// PERF: Fixed to not query each unit of work cache (is not conforming),
// avoid hashtable and primary key indexing.
// At some point we may need to support some kind of in-memory with conforming option,
// but we do not currently allow this.
AbstractSession rootSession = session;
while (rootSession.isUnitOfWork()) {
rootSession = ((UnitOfWorkImpl)rootSession).getParent();
}
Vector allCachedVector = rootSession.getIdentityMapAccessor().getAllFromIdentityMap(getSelectionCriteria(), getReferenceClass(), translationRow, getInMemoryQueryIndirectionPolicy(), false);
// Must ensure that all of the objects returned are correctly registered in the unit of work.
if (session.isUnitOfWork()) {
allCachedVector = ((UnitOfWorkImpl)session).registerAllObjects(allCachedVector);
}