title: Accessing returned data by method in spring cache
body: <p>I've a <code>Person</code> which has <code>id</code> and <code>name</code>. </p>
  
  <p>When I search by <code>Id</code> the method returned the <code>Person</code> Object and I want to make <code>name</code> as cache key but the returned data is not accessible in <code>key</code> tag of <code>Cacheable</code> annotation but the <code>name</code> is accessible in <code>unless</code> tag. </p>
  
  <pre><code>@Cacheable(value = "Cache", key = "#result.name", unless="#result.name == 'Foo'")
  public Person getById(String id){}
  </code></pre>
  
  <p>If I use <code>key = "#result.name"</code> it gives me exception : </p>
  
  <blockquote>
    <p>EL1007E: Property or field 'name' cannot be found on null</p>
  </blockquote>
  
  <p>What am I missing, How can I access returned data from method in <code>key</code> tag?</p>