0

This post explains how to cache query results.

But I am more interested in caching the results of jpa criteria query. My criteria query is roughly as below -

CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<MyDTO> query = cb.createQuery(MyDTO.class);
Root<Packages> root = query.from(Packages.class);
Join<Packages, ProtectedItems> protectedItemsJoin = root.join("protectedItemsList", JoinType.LEFT);
    

I can seem to find any cache method on the query or the criteriabuilder i.e cb object.

How can I cache the above.

samshers
  • 1
  • 6
  • 37
  • 84
  • Does this answer your question? [CriteriaQuery set cacheable](https://stackoverflow.com/questions/46600617/criteriaquery-set-cacheable) – Augusto Oct 26 '22 at 09:18

0 Answers0