Complex queries with JPA Criteria builder
Can someone suggest me how to build up the following query using JPA Criteria builder API? SELECT id,status,created_at from transactions where status='1' and currency='USD' and appId='123' order by id It's better if I can find a solution which creates dynamically based on the parameters given as a Map<String,String> using metamodel classes or any other way. It's like this (without metamodel): Map<String, Object> params = ...; CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<Tuple> cq = cb.createTupleQuery(); Root<Transaction> r = cq.from(Transaction.class); Predicate p= cb