title: Spring JPA Repository dynamic query
body: <p>Currently I have been using following Spring JPA Repository base custom query and it works fine,</p>
  
  <pre><code> @Query("SELECT usr FROM User usr  WHERE usr.configurable = TRUE "
                + "AND (" +
                          "lower(usr.name) like lower(:filterText) OR lower(usr.userType.classType.displayName) like lower(:filterText) OR lower(usr.userType.model) like lower(:filterText)"
                +      ")"
                + "")
    public List&lt;User&gt; findByFilterText(@Param("filterText") String filterText, Sort sort);
  </code></pre>
  
  <p>I need to modify this query when filter text going to be a comma separated value. But as following manner it will be a dynamic query and how can I execute it. </p>
  
  <p>Dynamic query I need to build, </p>
  
  <pre><code>String sql = "SELECT usr FROM User usr WHERE usr.configurable = TRUE";
  
  for(String word : filterText.split(",")) {
                  sql += " AND (lower(usr.name) like lower(:" + word + ") OR lower(usr.userType.classType.displayName) like lower(:" + word + ") OR lower(usr.userType.model) like lower(:" + word + "))";
  }
  </code></pre>