有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

hibernate java JPA使用限制api调用sql函数

我需要使用Restrictions API调用sql函数。 尝试了以下代码,但失败

...
Criterion criterion = Restrictions.gt("SQRT(POW(a.column1-b.column1,2))/1609", 90);
criteria.add(criterion);
...

出现以下异常

org.hibernate.QueryException: could not resolve property: SQRT(POW(...

注意 由于使用了其他表别名,我无法使用sqlRestriction方法。 也不希望使用本机查询


共 (0) 个答案