title: JPA Criteria api with CONTAINS function
body: <p>I'm trying to crete Criteria API query with CONTAINS function(MS SQL):</p>
  
  <p>select * from com.t_person where contains(last_name,'xxx')</p>
  
  <pre><code>CriteriaBuilder cb = em.getCriteriaBuilder();
  CriteriaQuery&lt;Person&gt; cq = cb.createQuery(Person.class);
  Root&lt;Person&gt; root = cq.from(Person.class);
  
  Expression&lt;Boolean&gt; function = cb.function("CONTAINS", Boolean.class, 
  root.&lt;String&gt;get("lastName"),cb.parameter(String.class, "containsCondition"));
  cq.where(function);
  TypedQuery&lt;Person&gt; query = em.createQuery(cq);
  query.setParameter("containsCondition", lastName);
  return query.getResultList();
  </code></pre>
  
  <p>But getting exception:
      org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: </p>
  
  <p>Any help?</p>