Class PostgreSQLTruncRoundFunction

java.lang.Object
org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor
org.hibernate.dialect.function.PostgreSQLTruncRoundFunction
All Implemented Interfaces:
FunctionRenderer, FunctionRenderingSupport, SqmFunctionDescriptor

public class PostgreSQLTruncRoundFunction extends AbstractSqmFunctionDescriptor implements FunctionRenderer
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: