I have the following statement to concatenate two columns which works well
Expression<String> stringConcat =
cb.concat(cb.concat(root.get(Employee_.userId), " # "),
joinDept.get(Employee_.empName));
and SQL is
select emp.user_id|| ' # '|| dept.emp_name from ..
I would like to concatenate one more column and SQL is
select emp.user_id|| ' # '|| dept.emp_name|| ' # '|| hist.user_name from ..
Not sure how add other columns in JPA API using CriteriaBuilder and Expression
Edit 1
I am looking for concatenation using multiple columns and answer which is marked as duplicate doesn't help to resolve the problem and most importantly this question is tagged and seeking solution to resolve concatenation issue pertains to JPA Criteria API and certainly not JPQL.