if (!this.batchFetchPolicy.getMappingQueries().containsKey(mapping)) { this.batchFetchPolicy.getMappingQueries().put(mapping, nestedQuery);
if (!this.batchFetchPolicy.getMappingQueries().containsKey(mapping)) { this.batchFetchPolicy.getMappingQueries().put(mapping, nestedQuery);
this.batchFetchPolicy.getMappingQueries().put(mapping, nestedQuery);
this.batchFetchPolicy.getMappingQueries().put(mapping, nestedQuery);
/** * INTERNAL: * Retrieve the value through using batch reading. * This executes a single query to read the target for all of the objects and stores the * result of the batch query in the original query to allow the other objects to share the results. */ protected Object batchedValueFromRow(AbstractRecord row, ObjectLevelReadQuery query, CacheKey parentCacheKey) { ReadQuery batchQuery = (ReadQuery)query.getProperty(this); if (batchQuery == null) { if (query.hasBatchReadAttributes()) { Map<DatabaseMapping, ReadQuery> queries = query.getBatchFetchPolicy().getMappingQueries(); if (queries != null) { batchQuery = queries.get(this); } } if (batchQuery == null) { batchQuery = prepareNestedBatchQuery(query); batchQuery.setIsExecutionClone(true); } else { batchQuery = (ReadQuery)batchQuery.clone(); batchQuery.setIsExecutionClone(true); } query.setProperty(this, batchQuery); } return this.indirectionPolicy.valueFromBatchQuery(batchQuery, row, query, parentCacheKey); }
/** * INTERNAL: * Retrieve the value through using batch reading. * This executes a single query to read the target for all of the objects and stores the * result of the batch query in the original query to allow the other objects to share the results. */ protected Object batchedValueFromRow(AbstractRecord row, ObjectLevelReadQuery query, CacheKey parentCacheKey) { ReadQuery batchQuery = (ReadQuery)query.getProperty(this); if (batchQuery == null) { if (query.hasBatchReadAttributes()) { Map<DatabaseMapping, ReadQuery> queries = query.getBatchFetchPolicy().getMappingQueries(); if (queries != null) { batchQuery = queries.get(this); } } if (batchQuery == null) { batchQuery = prepareNestedBatchQuery(query); batchQuery.setIsExecutionClone(true); } else { batchQuery = (ReadQuery)batchQuery.clone(); batchQuery.setIsExecutionClone(true); } query.setProperty(this, batchQuery); } return this.indirectionPolicy.valueFromBatchQuery(batchQuery, row, query, parentCacheKey); }