title: Spring Data CrudRepository @Query With LIKE and IgnoreCase
body: <p>I need to retrieve some Entity fields from CrudRepository:</p>
  
  <pre><code>public class User {
      private String name;
  
      // getters and setters
  }
  
  public interface UserRepository extends CrudRepository&lt;User, Long&gt; { 
  
     @Query("SELECT U.name FROM User U WHERE LOWER(U.name) LIKE LOWER(?1)")
     List&lt;String&gt; findByName(String matchPhrase);
  }
  </code></pre>
  
  <p>Basically, I want to get equivalent of SQL query:</p>
  
  <pre><code>SELECT u.name FROM user u WHERE LOWER(u.name) LIKE LOWER('match%')
  </code></pre>
  
  <p>The problem is that @Query doesn't works (empty list returned), hibernate generates log:</p>
  
  <blockquote>
    <p>Hibernate: select user0_.name as col_0_0_ from user user0_ where lower(user0_.name) like lower(?)</p>
  </blockquote>
  
  <p>I actually didn't get how to specify a parameter bound with appended %.</p>
  
  <pre><code>// also fails at compile-time
  @Query("SELECT U.name FROM User U WHERE LOWER(U.name) LIKE LOWER(?1%)")
  </code></pre>
  
  <blockquote>
    <p>org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: null near line ...</p>
  </blockquote>
  
  <p>This works fine but returns whole Entity, what may produce long response because I need retrieve only specific fields:</p>
  
  <pre><code>List&lt;User&gt; findByNameStartingWithIgnoreCase(String match);
  </code></pre>