+ " CASE WHEN e.age > 30 THEN e.age - 1 "
+ " WHEN e.age < 15 THEN e.age + 1 ELSE e.age + 0 "
+ " END FROM CompUser e";
CriteriaQuery<Tuple> q = cb.createTupleQuery();
Root<CompUser> e = q.from(CompUser.class);
Expression cage = cb.selectCase().when(cb.gt(e.get(CompUser_.age), 30),
cb.diff(e.get(CompUser_.age), 1)).when(
cb.lt(e.get(CompUser_.age), 15),
cb.sum(e.get(CompUser_.age), 1)).otherwise(
cb.sum(e.get(CompUser_.age), 0));
q.multiselect(e.get(CompUser_.name), e.get(CompUser_.age), cage);