Interface SqmFunctionDescriptor

    • Method Detail

      • generateSqmExpression

        <T> SelfRenderingSqmFunction<T> generateSqmExpression​(List<? extends SqmTypedNode<?>> arguments,
                                                              ReturnableType<T> impliedResultType,
                                                              QueryEngine queryEngine)
        Instantiate this template with the given arguments and expected return type. This produces a tree of SQM nodes representing a tree of function invocations. This allows a single HQL function to be defined in terms of other predefined (database independent) HQL functions, simplifying the task of writing HQL functions which are portable between databases.
      • alwaysIncludesParentheses

        default boolean alwaysIncludesParentheses()
        Will a call to the described function always include parentheses?

        Instances of this interface are usually used for rendering of functions. 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 opening parenthesis, we can safely assume the token is a function name. Bur if the next token is not an opening parenthesis, the token might still represent a function if the function has a "no paren" form in the case of no arguments.

        For example, many databases do not require parentheses for functions like current_timestamp and friends. This method helps account for those cases.

        Returns:
        true by default
        API Note:
        The most common case, by far, is that a function call requires the parentheses. So this method returns true by default.
      • getSignature

        default String getSignature​(String name)
        Used only for pretty-printing the function signature in the log.
        Parameters:
        name - the function name
        Returns:
        the signature of the function