title: what does the return value of @Modifying methods in Spring Data JPA mean
body: <pre><code>@Repository
  public interface LoginDao extends JpaRepository&lt;LoginEntity, Integer&gt; { //}, LoginDaoCustom {
      LoginEntity findByLogin(String login);
  
      @Modifying
      int changePassword(String password, String login);
  }
  </code></pre>
  
  <p>If I change the return value of the changePassword to anything other than int, I get the error below. </p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Modifying queries can only use void or int/Integer as return type!
      at org.springframework.util.Assert.isTrue(Assert.java:65)
      at org.springframework.data.jpa.repository.query.JpaQueryExecution$ModifyingExecution.&lt;init&gt;(JpaQueryExecution.java:166)
      at org.springframework.data.jpa.repository.query.AbstractJpaQuery.getExecution(AbstractJpaQuery.java:106)
      at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:86)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:337)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
      ... 46 more
  </code></pre>
  
  <p>What does this integer return value mean ? I am sure spring has it documented somewhere, but I can't find it. It is not listed in the <a href="http://docs.spring.io/spring-data/jpa/docs/1.0.0.M1/reference/html/#jpa.modifying-queries" rel="noreferrer">jpa.modifying-queries</a> </p>
  
  <p>I should add that if do declare the return type as int, the update fails silently and values aren't updated.</p>