title: Spring Repository method for first()
body: <p>In Grails, I can say <code>Foo.first()</code>. In Spring, I have repositories extending <code>PagingAndSortingRepository</code> and I've created a service method called <code>getFirst()</code> that does the following:</p>
  
  <pre><code>public Foo getFirst() {
    return fooRepository.findAll(new PageRequest(0, 1, new Sort("ASC", "id"))).getContent().get(0);
  }
  </code></pre>
  
  <p>Is this the best way or is there a convenience method I'm just missing?</p>