criteria.setCacheable(true);

一下是Criteria的底层源代码

/**
* Enable caching of this query result, provided query caching is enabled
* for the underlying session factory.
*
* @param cacheable Should the result be considered cacheable; default is
* to not cache (false).
* @return this (for method chaining)
*/
public Criteria setCacheable(boolean cacheable);

意思是:

启用查询缓存结果,提供查询缓存
*为底层会话工厂。
*
* @param缓存的结果应该被认为是默认缓存;
*不缓存(false)。
*“退货(方法链接)

就是给criteria一个缓存

相关文章:

  • 2021-06-12
  • 2022-12-23
  • 2021-12-02
  • 2021-11-20
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-20
  • 2021-12-06
  • 2022-12-23
  • 2021-05-21
  • 2021-11-23
  • 2021-08-31
  • 2022-02-07
相关资源
相似解决方案