title: Implementing custom methods of Spring Data repository and exposing them through REST
body: <p>I'm trying to add custom methods to my Spring Data repository <code>PersonRepository</code> as described in <a href="http://docs.spring.io/spring-data/jpa/docs/1.4.0.M1/reference/html/repositories.html">1.3 Custom implementations for Spring Data repositories</a> and exposing these method through REST. The initial code is from <a href="http://spring.io/guides/gs/accessing-data-rest/">Accessing JPA Data with REST</a> sample, here is the  code for added/modified classes:</p>
  
  <pre><code>interface PersonRepositoryCustom {
    List&lt;Person&gt; findByFistName(String name);
  }
  
  class PersonRepositoryImpl implements PersonRepositoryCustom, InitializingBean {
    @Override
    public void afterPropertiesSet() throws Exception {
      // initialization here
    }
    @Override
    public List&lt;Person&gt; findByFistName(String name) {
      // find the list of persons with the given firstname
    }
  }
  
  @RepositoryRestResource(collectionResourceRel = "people", path = "people")
  public interface PersonRepository extends PagingAndSortingRepository&lt;Person, Long&gt; {
    List&lt;Person&gt; findByLastName(@Param("name") String name);  
  }
  </code></pre>
  
  <p>When I run the application and visit <code>http://localhost:8080/portfolio/search/</code>, I get the following response body:</p>
  
  <pre><code>{
    "_links" : {
      "findByLastName" : {
        "href" : "http://localhost:8080/people/search/findByLastName{?name}",
        "templated" : true
       }
    }
  }
  </code></pre>
  
  <p>Why <code>findByFirstName</code> is not exposed even if it is available in the <code>PersonRepository</code> interface?</p>
  
  <p>Also, is there a way to dynamically/programmatically add respositories to be exposed via REST?</p>