title: How do I tell Spring cache not to cache null value in @Cacheable annotation
body: <p>Is there a way to specify that if the method returns null value, then don't cache the result in @Cacheable annotation for a method like this?</p>
  
  <pre><code>@Cacheable(value="defaultCache", key="#pk")
  public Person findPerson(int pk) {
     return getSession.getPerson(pk);
  }
  </code></pre>
  
  <p>Update:
  here is the JIRA issue submitted regarding caching null value last November, which hasn't resolved yet: 
  <a href="https://jira.springsource.org/browse/SPR-8871" rel="noreferrer">[#SPR-8871] @Cachable condition should allow referencing return value - Spring Projects Issue Tracker</a></p>