title: No value specified for parameter - CrudRepository
body: <pre><code>public interface UserRepository extends CrudRepository&lt;User, Integer&gt; {
  
  @Query(value = "select u from User u")
  List&lt;User&gt; selectAllUsers();
  
  @Query(value = "select u from User u where u.username = ?1")
  User findByName(String name);
  
  @Query(value = "select u from User u where u.id = ?1")
  User findById(Integer id);
  
  @Modifying
  @Transactional(readOnly = false)
  @Query("UPDATE User u SET u.friends = ?1 WHERE u.id = ?2")
  Integer setNewFriendsForId(Set&lt;User&gt; friends, Integer id);
  }
  </code></pre>
  
  <p>Spring provides me with implementation of this interface that is used in class called UserService. But when I try to execute this method I get a really huge stack of exceptions.</p>
  
  <pre><code> userService.setNewFriendsForId(invitingUser.getFriends(), invitingUser.getId());
  </code></pre>
  
  <p>The root cause is:</p>
  
  <p>org.postgresql.util.PSQLException: No value specified for parameter 2.
      org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:178)
      org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:246)
      org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
  (...)</p>
  
  <p>Any ideas what can be the reason? Select queries work right.</p>