Class CurrentFunction

    • Method Detail

      • alwaysIncludesParentheses

        public boolean alwaysIncludesParentheses()
        Description copied from interface: SqmFunctionDescriptor
        Will a call to the described function always include parentheses?

        SqmFunctionTemplate is generally used for rendering of a function. However there are cases where Hibernate needs to consume a fragment and decide if a token represents a function name. In cases where the token is followed by an open-paren we can safely assume the token is a function name. However, if the next token is not an open-paren, the token can still represent a function provided that the function has a "no paren" form in the case of no arguments. E.g. Many databases do not require parentheses on functions like `current_timestamp`, etc. This method helps account for those cases.

        Note that the most common case, by far, is that a function will always include the parentheses - therefore this return is defined as true by default. see Template#isFunction