sql - How to set projection for concatenated result of two columns in Hibernate Criteria -
i have problem concatenated result of 2 columns single result in hibernate criteria.
sql query:
select firstname || ' ' || lastname person active_yn='y'
how set projection concatenated result of 2 columns in hibernate criteria?
/ elegant alternative? criteria.like(expression.concat(firstname, ' ', lastname), input); // sql-like function? criteria.like("concat(firstname, ' ', lastname)", input); // perhaps database-dependent concatenator? criteria.like("firstname + ' ' + lastname"); criteria.like("firstname || ' ' || lastname");
more ref
sql hibernate
No comments:
Post a Comment