Hi,
  > Can I convert this native MySQL query using purely the CriteriaBuilder
method: 
  Yes, you can. 

  Your question points to an important feature of Criteria query that is
distinct from string-based JPQL query. Criteria query API makes this
distinction via CriteriaBuilder.function() method -- that will allow you to
use database functions in your query.
 

  Similar expression is not possible to express with JPQL query that use a
fixed grammar.

  See usage of CriteriaBuilder.function() method.
  Or refer to this article [1] which has few examples of this method in its
'Advanced Features' section.


[1] http://www.ibm.com/developerworks/java/library/j-typesafejpa/

-----
Pinaki 
--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Is-this-possible-with-CriteriaBuilder-method-tp6283183p6289977.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to