/* 563 */ for (int nodeInd = 0; nodeInd < onFindCMRNodes.size(); nodeInd++)
/* */ {
/* 565 */ LeftJoinCMRNode node = (LeftJoinCMRNode)onFindCMRNodes.get(nodeInd);
/* 566 */ JDBCCMRFieldBridge cmrField = node.cmrField;
/* 567 */ ReadAheadCache myCache = cmrField.getJDBCStoreManager().getReadAheadCache();
/* 568 */ JDBCEntityBridge relatedEntity = cmrField.getRelatedJDBCEntity();
/* 569 */ ReadAheadCache relatedCache = cmrField.getRelatedManager().getReadAheadCache();
/* */
/* 572 */ ref[0] = null;
/* 573 */ index = relatedEntity.loadPrimaryKeyResults(rs, index, ref);
/* 574 */ Object relatedId = ref[0];
/* 575 */ boolean cacheRelatedData = relatedId != null;
/* */
/* 577 */ if (pk != null)
/* */ {
/* 579 */ if (cmrField.getMetaData().getRelatedRole().isMultiplicityOne())
/* */ {
/* 582 */ myCache.addPreloadData(pk, cmrField, relatedId == null ? Collections.EMPTY_LIST : Collections.singletonList(relatedId));
/* */ }
/* */ else
/* */ {
/* 588 */ Collection cachedValue = myCache.getCachedCMRValue(pk, cmrField);
/* 589 */ if (cachedValue == null)
/* */ {
/* 591 */ cachedValue = new ArrayList();
/* 592 */ myCache.addPreloadData(pk, cmrField, cachedValue);
/* */ }
/* */
/* 595 */ if (relatedId != null)
/* */ {
/* 597 */ if (cachedValue.contains(relatedId))
/* */ {
/* 599 */ cacheRelatedData = false;
/* */ }
/* */ else
/* */ {
/* 603 */ cachedValue.add(relatedId);
/* */ }
/* */ }
/* */ }
/* */
/* */ }
/* */
/* 610 */ if (node.eagerLoadMask != null)
/* */ {
/* 612 */ JDBCFieldBridge[] tableFields = relatedEntity.getTableFields();
/* 613 */ for (int fieldInd = 0; fieldInd < tableFields.length; fieldInd++)
/* */ {
/* 615 */ if (node.eagerLoadMask[fieldInd] == 0)
/* */ continue;
/* 617 */ JDBCFieldBridge field = tableFields[fieldInd];
/* 618 */ ref[0] = null;
/* 619 */ index = field.loadArgumentResults(rs, index, ref);
/* */
/* 621 */ if (!cacheRelatedData)
/* */ continue;
/* 623 */ if (log.isTraceEnabled())
/* */ {
/* 625 */ log.trace("Caching " + relatedEntity.getEntityName() + '[' + relatedId + "]." + field.getFieldName() + "=" + ref[0]);
/* */ }
/* */
/* 632 */ relatedCache.addPreloadData(relatedId, field, ref[0]);
/* */ }
/* */