我正在使用postgresql和jpa在playframework 2.2中。
我试图通过使用类似于like with in线程的similar to在JPQL中使用this。
select * from table where lower(value) similar to '%(foo|bar|baz)%';我曾尝试过similar to和~*在我的JPQL,但这两种能力的工作。
关于使用similar to,它给出了
IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: similar near line 1除了在similar to中使用like之外,还有其他方法可以使用类似于JPQL的功能吗?
谢谢
发布于 2015-03-24 13:20:06
在EclipseLink中有regex支持,请检查2.4的发布说明:
但我不知道hibernate是否也支持它。认为这不是JPA规范的一部分。
https://stackoverflow.com/questions/29226962
复制相似问题