title: Validate collection is not empty in Spring Data query parameter
body: <p>Let's say I have a Spring Data repository with query method</p>
  
  <pre><code>public interface SomeRepository extends JpaRepository&lt;Something, Long&gt; {
  
      @Query("select s from Something s where s.val in :values")
      List&lt;Something&gt; findSomethingsByValIn(@Param("values") Collection&lt;Long&gt; values);
  }
  </code></pre>
  
  <p>When passed Collection of values is empty, I've got</p>
  
  <pre><code>SQL Error: 1064, SQL State: 42000
  You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1
  </code></pre>
  
  <p>because of something like</p>
  
  <pre><code>Hibernate: select something0_ as col_0_0_ from Something something0_ where something0_.val in ())
  </code></pre>
  
  <p>Of course, I could easily check passed parameter before method calling. And I even could describe it in javadoc. But is it possible to validate argument inside query method? </p>