title: How to write Spring Data method name to retrieve all elements in a column?
body: <p>Suppose I have the class:</p>
  
  <pre><code>@Entity
  public class Bean {
      @Id
      private String beanId;
      //other fields &amp; setters and getters
  }
  </code></pre>
  
  <p>And the corresponding Spring Data JPA repository, where I want to have in a <code>List&lt;String&gt;</code> all the <code>beanIds</code>.</p>
  
  <pre><code>@RepositoryDefinition(domainClass = Bean.class, idClass = String.class)
  public interface BeanRepository {
      @Query("select b.beanId from Bean b")
      List&lt;String&gt; findAllBeanId();
  }
  </code></pre>
  
  <p>As written above, everything works as expected; but this is a simple operation and I do not want to write a query explicitly. What should the name of the method be such that Spring Data can parse it and obtain the above mentioned query (or the same functionality). I have searched in both the reference documentation as two books I have on Spring Data. The above name (<code>findAllBeanId</code>) and others that I have tried (<code>findBeanId</code>, <code>findBeanBeanId</code> etc.) throw the following exception as root cause: </p>
  
  <pre><code>org.springframework.data.mapping.PropertyReferenceException: No property find found for type Trade
      at org.springframework.data.mapping.PropertyPath.&lt;init&gt;(PropertyPath.java:75)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:353)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:353)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:271)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:245)
      at org.springframework.data.repository.query.parser.Part.&lt;init&gt;(Part.java:72)
      at org.springframework.data.repository.query.parser.PartTree$OrPart.&lt;init&gt;(PartTree.java:180)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.&lt;init&gt;(PartTree.java:240)
      at org.springframework.data.repository.query.parser.PartTree.&lt;init&gt;(PartTree.java:68)
      at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.&lt;init&gt;(PartTreeJpaQuery.java:57)
      at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:90)
      at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:162)
      at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:68)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.&lt;init&gt;(RepositoryFactorySupport.java:279)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:147)
      at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:153)
      at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:43)
      at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
      ... 22 more
  </code></pre>