title: JPA lower() function on parameter
body: <p>I have updated project from spring 3.2 to 4.1 and hibernate 4.2 to 4.3.7 and got interesting problem.
  I have query:</p>
  
  <pre><code>function parameter: String email;
  getQuery(getSelect() + "where lower(o.email) = lower(:email)").setParameter("email", email);
  </code></pre>
  
  <p>now, on getting result I got </p>
  
  <blockquote>
    <p>org.postgresql.util.PSQLException: ERROR: function lower(bytea) does
    not exist   Hint: No function matches the given name and argument
    types. You might need to add explicit type casts.</p>
  </blockquote>
  
  <p>but if I call</p>
  
  <pre><code>getQuery(getSelect() + "where lower(o.email) = lower('test')")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>getQuery(getSelect() + "where lower(o.email) = lower(:email)").setParameter("email", "test")
  </code></pre>
  
  <p>it works fine. </p>