7
如何在类似子句中转义通配符?如何在HQL中的“like”子句中转义通配符?
例如为:
select foo from Foo as foo where foo.bar like '%' || :filter ||'%'
query.setParameter("filter", "%"); query.list(); // I'd expect to get the foo's containing the '%' in bar, not all of them!
任何想法?
@DeanPovey没有与我的工作:'引起:org.hibernate.hql.internal.ast.QuerySyntaxException:意外的标记:靠近第1行,列175转义[选择e.id,e.title,e。 type.icon,e.typeObject,e.idDomain from package.SomeClass e where(UPPER(e.title)LIKE?)AND e.idDomain =?逃脱'!' ]' – ViniciusPires 2014-12-01 15:28:09