Examples of common queries are here
All examples are in this form:
CriteriaBuilder cb = em.getCriteriaBuilder();
// Query for a List of objects.
CriteriaQuery cq = cb.createQuery();
Root e = cq.from(Employee.class);
cq.where(cb.greaterThan(e.get("salary"), 100000));
Query query = em.createQuery(cq);
List<Employee> result = query.getResultList();
If you are also considering other technologies you should seriously consider querydsl. Main advantages over criteria include shorter code, good readability and similar syntax to regular sql.
Example QueryDSL code here:
JPAQuery query = new JPAQuery(entityManager);
List<Person> persons = query.from(person)
.where(
person.firstName.eq("John")),
.list(person);