Is it possible to mix JPQL and CriteriaQuery?
I have a String that contains a where condition in JPQL and a CriteriaQuery that is already built and got from somewhere else. I wonder if I can add the where condition String to CriteriaQuery.where(). The where condition could be multiple conditions “and-ed”/”or-ed” together.
Can I do this without parsing the where condition String?
Well one thing you can do is to convert the CriteriaQuery to JPQL and concatenate the two WHERE parts of the strings.
See “JPQL equivalent of the Criteria query” on http://www.datanucleus.org/products/accessplatform/jpa/jpql_criteria.html