我有一个postgres存储函数返回一个表,当我试图在我的Junit测试中调用它时,它会给我以下异常:
SQLGrammarException: user lacks privilege or object not found "function_name"
爪哇:
Session session = (Session) entityManager.getDelegate();
SQLQuery query = session.createSQLQuery(SELECT * from function_name())
我存储的函数的开头如下:
CREATE OR REPLACE FUNCTION function_name()
RETURNS TABLE(
userid BIGINT,
user_height DOUBLE PRECISION
)
AS
我检查了属性文件,它是:
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.format_sql=true
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create
任何想法?