如何指定一个用通配符括起来的JPA命名参数?
2022-08-31 17:07:06
如何指定 JPA 查询,例如:
Query q =
em.createQuery(
"SELECT x FROM org.SomeTable x WHERE x.someString LIKE '%:someSymbol%'"
);
其次:
q.setParameter("someSymbol", "someSubstring");
并且不触发
org.hibernate.QueryParameterException: could not locate named parameter [id]
非常感谢!