情境:需要将数据库中俩个字段拼接起来然后用传入的参数进行模糊查询.
用HQL解决如下:
1 From ns.project.persistence.model.TZhidao as tz
2 where status = '1'
3 /~title: and tz.title || ':' || tz.description like '%'||{title}||'%' ~/
4 /~sortColumn: ORDER BY tz.[sortColumn] [sortDirection] ~/
posted on 2009-06-03 17:22
teok 阅读(1271)
评论(2) 编辑 收藏