title: Spring Boot EhCache: Storing a List of objects without a key
body: <p>I am using the @PostConstruct annotation on application start to query the entire list result from the DB and am storing it as a static global variable. I am parsing this result list and getting the responses I need. As shown below:</p>
  <pre><code>private static List&lt;Object[]&gt; allObjects;
  
  @PostConstruct
       public void test() {
          System.out.println(&quot;Calling Method&quot;);
          Query q = entityManager.createNativeQuery(query);
          List&lt;Object[]&gt; resultList = (List&lt;Object[]&gt;) q.getResultList();
          allObjects = resultList;
  }
  </code></pre>
  <p>However, I would like to use ehcache to store the result list so I can refresh the cache at any time or remove the items from the cache. Is it possible to store a result list (without a key) in the cache instead of storing it as a global variable?</p>