title: java.lang.IllegalArgumentException:Modifying queries can only use void or int/Integer as return type! while trying to use @Query in JpaRepository
body: <p>I need to update a string value in mysql table . For this I wrote a method as below.</p>
  
  <pre><code>@Repository
  public interface NotificationRepository extends JpaRepository&lt;Notification, Long&gt; {
  
      @Modifying
      @Query("update Notification msg set msg.message = ?1 where msg.applicationUser.id = ?2")
      String createNewNotification(String message, Long id);
  
  }
  </code></pre>
  
  <p>I get following exception.</p>
  
  <pre><code>java.lang.IllegalArgumentException: Modifying queries can only use void or int/Integer as return type!
  </code></pre>
  
  <p>Can't I update a string value in my table. Only void or int is possible?. Is this mean that? How do I can I handle this exception? Please help.</p>