I have the following instruction to combine two columns that work well
Expression<String> stringConcat = cb.concat(cb.concat(root.get(Employee_.userId), " # "), joinDept.get(Employee_.empName));
and SQL
select emp.user_id|| ' # '|| dept.emp_name from ..
I would like to concatenate another column, and SQL -
select emp.user_id|| ' # '|| dept.emp_name|| ' # '|| hist.user_name from ..
Not sure how to add other columns to the JPA API using CriteriaBuilder and Expression
Change 1
I am looking for concatenation using multiple columns, and the answer that is marked as duplicate does not help to solve the problem, and most importantly, this question is marked and finding a solution to the problem of concatenation relates to the JPA API and, of course, not to JPQL.
source share