检测{@link CacheBy}定位到的参数db中是否有用到，如果db中没有用到，
则抛出{@link IncorrectCacheByException}
545492
private static void checkCacheBy(ASTRootNode rootNode, List<CacheByItem> cacheByItems) {
    List<ASTJDBCParameter> jps = rootNode.getJDBCParameters();
    for (CacheByItem cacheByItem : cacheByItems) {
      String parameterName = cacheByItem.getParameterName();
      String propertyPath = cacheByItem.getPropertyPath();
      boolean pass = false;
      for (ASTJDBCParameter jp : jps) {
        if (jp.getBindingParameter().getParameterName().equals(parameterName) &&
            jp.getBindingParameter().getPropertyPath().equals(propertyPath)) {
          pass = true;
          break;
        }
      }
      List<ASTJDBCIterableParameter> jips = rootNode.getJDBCIterableParameters();
      for (ASTJDBCIterableParameter jip : jips) {
        if (jip.getBindingParameter().getParameterName().equals(parameterName) &&
            jip.getBindingParameter().getPropertyPath().equals(propertyPath)) {
          pass = true;
          break;
        }
      }
      if (!pass) {
        throw new IncorrectCacheByException("CacheBy " +
            cacheByItem.getFullName() + " can't match any db parameter");
      }
    }
  }
695873
@Override
    @SuppressWarnings("unchecked")
    public <K extends Serializable, V> Map<K, V> getCache(String cacheName)
            throws IllegalArgumentException {
        return (Map<K, V>) this.mapCacheCreator.get(cacheName);
    }
1269724
@Override
	public void cacheResult(List<CommercePriceList> commercePriceLists) {
		for (CommercePriceList commercePriceList : commercePriceLists) {
			if (entityCache.getResult(
						CommercePriceListModelImpl.ENTITY_CACHE_ENABLED,
						CommercePriceListImpl.class,
						commercePriceList.getPrimaryKey()) == null) {
				cacheResult(commercePriceList);
			}
			else {
				commercePriceList.resetOriginalValues();
			}
		}
	}
669506
@Override
	public void cacheResult(CPFriendlyURLEntry cpFriendlyURLEntry) {
		entityCache.putResult(CPFriendlyURLEntryModelImpl.ENTITY_CACHE_ENABLED,
			CPFriendlyURLEntryImpl.class, cpFriendlyURLEntry.getPrimaryKey(),
			cpFriendlyURLEntry);

		finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
			new Object[] {
				cpFriendlyURLEntry.getUuid(), cpFriendlyURLEntry.getGroupId()
			}, cpFriendlyURLEntry);

		finderCache.putResult(FINDER_PATH_FETCH_BY_G_C_L_U,
			new Object[] {
				cpFriendlyURLEntry.getGroupId(),
				cpFriendlyURLEntry.getClassNameId(),
				cpFriendlyURLEntry.getLanguageId(),
				cpFriendlyURLEntry.getUrlTitle()
			}, cpFriendlyURLEntry);

		finderCache.putResult(FINDER_PATH_FETCH_BY_G_C_C_L_U,
			new Object[] {
				cpFriendlyURLEntry.getGroupId(),
				cpFriendlyURLEntry.getClassNameId(),
				cpFriendlyURLEntry.getClassPK(),
				cpFriendlyURLEntry.getLanguageId(),
				cpFriendlyURLEntry.getUrlTitle()
			}, cpFriendlyURLEntry);

		finderCache.putResult(FINDER_PATH_FETCH_BY_G_C_C_L_M,
			new Object[] {
				cpFriendlyURLEntry.getGroupId(),
				cpFriendlyURLEntry.getClassNameId(),
				cpFriendlyURLEntry.getClassPK(),
				cpFriendlyURLEntry.getLanguageId(), cpFriendlyURLEntry.isMain()
			}, cpFriendlyURLEntry);

		cpFriendlyURLEntry.resetOriginalValues();
	}
1265801
public static RuntimeException launderCacheListenerException(CacheListenerException e) {
      Throwable cause = e.getCause();

      if (cause instanceof CacheEntryListenerException)
         return (CacheEntryListenerException) cause;

      if (cause instanceof Exception)
         return new CacheEntryListenerException(cause);

      if (cause instanceof Error)
         throw (Error) cause;

      return e;
   }
903028
public List<M> findByCache(String cacheName, Object key, String sql, Object... paras) {
		Config config = _getConfig();
		ICache cache = config.getCache();
		List<M> result = cache.get(cacheName, key);
		if (result == null) {
			result = find(config, sql, paras);
			cache.put(cacheName, key, result);
		}
		return result;
	}
1141899
@Override
    protected T readCacheDataFromFile(File file) throws CacheLoadingException {
        try {
            JsonParser jsonParser = jsonFactory.createJsonParser(new FileReader(file));
            T result = jsonParser.parse(getHandledClass(), null);
            jsonParser.close();
            return result;
        } catch (FileNotFoundException e) {
            // Should not occur (we test before if file exists)
            // Do not throw, file is not cached
            Ln.w("file " + file.getAbsolutePath() + " does not exists", e);
            return null;
        } catch (Exception e) {
            throw new CacheLoadingException(e);
        }
    }
157305
public static CacheLoadingException newCacheLoadingException(Exception e, Exception suppressed) {
    CacheLoadingException ne = new CacheLoadingException(e);
    ne.addSuppressed(e);
    return ne;
  }
807519
@Override
	public void cacheResult(List<CommerceWarehouseItem> commerceWarehouseItems) {
		for (CommerceWarehouseItem commerceWarehouseItem : commerceWarehouseItems) {
			if (entityCache.getResult(
						CommerceWarehouseItemModelImpl.ENTITY_CACHE_ENABLED,
						CommerceWarehouseItemImpl.class,
						commerceWarehouseItem.getPrimaryKey()) == null) {
				cacheResult(commerceWarehouseItem);
			}
			else {
				commerceWarehouseItem.resetOriginalValues();
			}
		}
	}
328551
@Override
   public void setCacheManager(EmbeddedCacheManager cm) {
      String name = cacheName.toString();
      if (cm.cacheExists(name)) {
         Cache cache = cm.getCache(name);
         searchFactory = ComponentRegistryUtils.getSearchIntegrator(cache);
         queryInterceptor = ComponentRegistryUtils.getQueryInterceptor(cache);
      } else {
         throw new CacheException("Cache named '" + name + "' does not exist on this CacheManager, or was not started");
      }
   }
1151013
protected static ArrayCache getArrayCache() {
        ArrayCache cache = (ArrayCache) AppContext.getAppContext().get(ArrayCache.class);

        if (cache == null) {
            cache = new ArrayCache();
            AppContext.getAppContext().put(ArrayCache.class, cache);
        }

        return cache;
    }
286913
@Override
    public boolean isDataInCache(Class<?> clazz, Object cacheKey, long maxTimeInCacheBeforeExpiry) throws CacheCreationException {
        return getObjectPersister(clazz).isDataInCache(cacheKey, maxTimeInCacheBeforeExpiry);
    }
726348
public static Single<Boolean> addAll(String cacheKey, List list) {
        return addAll(CacheService.CACHE_CONFIG_BEAN, cacheKey, list);
    }
1072087
@Override
    public <K, V> Cache<K, V> getCache(String cacheName) {
        return this.getCache(cacheName, true);
    }
978155
function preCacheQueries(queries) {
  var groupBy = {};
  _.each(queries, function (query) {
    if (!query.queryKey) {
      return;
    }
    var hasAllValues = _.reduce(_.values(query.queryParams), function (acc, val) {
      return acc && (val !== null);
    }, true);
    if (hasAllValues) {
      var cacheKey = _executionCache.getKey(query);
      groupBy[cacheKey] = groupBy[cacheKey] || [];
      groupBy[cacheKey].push(query);
    }
  });

  _.each(groupBy, function (groupedQueries, key) {
    var aggregateShape = _.reduce(_.map(groupedQueries, 'shape'), _.assign, {});
    var query = _.cloneDeep(groupedQueries[0]);
    query.shape = aggregateShape;
    _executionCache.execute(query);
  });
}
823973
private void onCachesCollected() {
      if (isTraceEnabled()) {
         log().tracef("[%s] All caches collected: %s", xid, cacheNames);
      }
      int size = cacheNames.size();
      if (size == 0) {
         //it can happen if all caches either commit or thrown an exception
         sendReply();
         return;
      }

      List<CompletableFuture<Void>> futures = new ArrayList<>(size);
      for (ByteString cacheName : cacheNames) {
         try {
            futures.add(completeCache(cacheName));
         } catch (Throwable t) {
            hasErrors = true;
         }
      }
      CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).thenRun(this::sendReply);
   }
1126115
protected void applyCacheHints(TypedQuery<?> typedQuery, SearchParameters sp) {
        if (sp.isCacheable()) {
            typedQuery.setHint("org.hibernate.cacheable", true);

            if (sp.hasCacheRegion()) {
                typedQuery.setHint("org.hibernate.cacheRegion", sp.getCacheRegion());
            } else {
                typedQuery.setHint("org.hibernate.cacheRegion", cacheRegion);
            }
        }
    }