Class PostgreSQLTruncRoundFunction

  • All Implemented Interfaces:
    FunctionRenderingSupport, SqmFunctionDescriptor

    public class PostgreSQLTruncRoundFunction
    extends AbstractSqmFunctionDescriptor
    implements FunctionRenderingSupport
    PostgreSQL only supports the two-argument trunc and round functions with the following signatures:
    • trunc(numeric, integer)
    • round(numeric, integer)

    This custom function falls back to using floor as a workaround only when necessary, e.g. when there are 2 arguments to the function and either:

    • The first argument is not of type numeric
    • or
    • The dialect doesn't support the two-argument trunc function
    See Also:
    PostgreSQL documentation