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