title: setMaxResults for Spring-Data-JPA annotation?
body: <p>I am trying to incorporate Spring-Data-JPA into my project.
  One thing that confuses me is how do I achieve setMaxResults(n) by annotation ?</p>
  <p>for example, my code:</p>
  <pre><code>public interface UserRepository extends CrudRepository&lt;User , Long&gt;
  {
    @Query(value=&quot;From User u where u.otherObj = ?1 &quot;)
    public User findByOtherObj(OtherObj otherObj);
  }
  </code></pre>
  <p>I only need to return <code>one (and only one)</code> User from otherObj, but I cannot find a way to annotate the maxResults. Can somebody give me a hint ?</p>
  <p>(mysql complains :</p>
  <pre><code>com.mysql.jdbc.JDBC4PreparedStatement@5add5415: select user0_.id as id100_, user0_.created as created100_ from User user0_ where user0_.id=2 limit ** NOT SPECIFIED **
  WARN  util.JDBCExceptionReporter - SQL Error: 0, SQLState: 07001
  ERROR util.JDBCExceptionReporter - No value specified for parameter 2
  </code></pre>
  <p>)</p>
  <p>I found a link : <a href="https://jira.springsource.org/browse/DATAJPA-147" rel="noreferrer">https://jira.springsource.org/browse/DATAJPA-147</a>,
  I tried but failed. It seems not possible now?
  Why is such an important feature not built into Spring-Data?</p>
  <p>If I implement this feature manually:</p>
  <pre><code>public class UserRepositoryImpl implements UserRepository
  </code></pre>
  <p>I have to implement tons of predefined methods in <code>CrudRepository</code>, this would be terrible.</p>
  <p>environments : spring-3.1 , spring-data-jpa-1.0.3.RELEASE.jar , spring-data-commons-core-1.1.0.RELEASE.jar</p>