我有一个问题是在Hibernate中将两列的连接结果转换为单个结果 标准。
SQL查询:
SELECT firstName || ' ' || lastName FROM person WHERE active_yn='Y'
如何在Hibernate Criteria中为两列的连续结果设置投影?
答案 0 :(得分:0)
/ an elegant alternative?
criteria.like(Expression.concat(firstname, ' ', lastName), input);
// an sql-like function?
criteria.like("concat(firstName, ' ', lastName)", input);
// perhaps a database-dependent concatenator?
criteria.like("firstName + ' ' + lastName");
criteria.like("firstName || ' ' || lastName");