我可以在postgresql中执行此操作:
SELECT my_func(t) FROM my_table t;
其中my_func
的定义如下:
CREATE OR REPLACE FUNCTION my_func(t my_table)
...
如何使用JPA Critera API调用my_func?这样做不起作用:
criteriaBuilder.isTrue(
criteriaBuilder.function("my_func", Boolean.class, myTablePath));
它生成的sql:
(my_func() = ?))
即忽略参数myTablePath
。
我使用的是eclipselink 2.6.1和postgresql 9.3。