以下代码在第15列给出了错误说明意外令牌的错误,我正在尝试连接两列,然后想要将该字符串与like运算符匹配:
entityManager.createQuery(
"select p from
(select o,CONCAT(organizationName,'|',emailId)as txt from Organization o ) p
where p.txt like:%o%", Organization.class);
答案 0 :(得分:1)
entityManager.createQuery("select o from Organization o where" +
" o.organizationName like:sSearch or" +
" o.emailId like:sSearch",Organization.class);