SYSTIMESTAMP in @Function

Hello all,

once upon a time, Hibernate was able to detect database specific functions (like SYSTIMESTAMP) in @Function annotations. Today, for example with 7.4, this ability was removed. Those functions, if not suffixed by (), aren’t any longer detected as functions and therefore prefixed with the table alias (rendering in b1_0.systimestamp, which is rejected by the database).

The reason for this I discovered lies in commit a20fb5663d titled “major rework of Template + battery of new tests” which removed the “isFunction” method from org.hibernate.sql.Template class which had been responsible to lookup the database specific function descriptors.

May I suppose this is a bug (in this case, I would create an Issue), or could it in any way be intended behaviour?

Marcus.

I’d say that the OracleDialect should probably register such functions without parenthesis as “keywords”, such that org.hibernate.sql.Template#isKeyword would return true for systimestamp etc.

Well the dialect actually does, but with the refactoring mentioned above, it isn’t queried any longer …

I checked the code and the isKeyword method should be called, which checks the dialect keywords, but maybe there is a bug.
Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.