List<Object> orderedResult = new ArrayList<Object>(keyInfo.length);
Map<Object, Object> fromCache = session.getIdentityMapAccessor().getAllFromIdentityMapWithEntityPK(keyInfo, referenceDescriptor);
DatabaseRecord translationRow = new DatabaseRecord();
List foreignKeyValues = new ArrayList(keyInfo.length - fromCache.size());
CacheKeyType cacheKeyType = referenceDescriptor.getCachePolicy().getCacheKeyType();
for (int index = 0; index < keyInfo.length; ++index){
Object pk = keyInfo[index];
if (!fromCache.containsKey(pk)){
if (cacheKeyType == CacheKeyType.CACHE_ID){
foreignKeyValues.add(Arrays.asList(((CacheId)pk).getPrimaryKey()));