Top Description Classes
[default module]

Package org.hibernate.dialect.function


Contains implementations of org.hibernate.query.sqm.function.SqmFunctionDescriptor describing a range of relatively-sophisticated SQL functions available in various dialects.

Class Summary

Modifier and TypeClass and Description
public class
AggregateWindowEmulationQueryTransformer

Since the query spec will render a hypothetical set window function instead of an aggregate, the following query transformer will wrap the query spec and apply aggregation in the outer query.

public class
AvgFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
CaseLeastGreatestEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
Some databases don't have a function like least() or greatest(), and on those platforms we emulate the function using case.
public class
CastFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
ANSI SQL-inspired cast() function, where the target types are enumerated by CastType, and portability is achieved by delegating to Dialect#castPattern(CastType, CastType).
public class
CastingConcatFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
CastStrEmulation

The HQL str() function is now considered a synonym for cast(x as String).

public class
ChrLiteralEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
A chr implementation that translates integer literals to string literals.
public class
public class
CommonFunctionFactory

Enumeratoes common function template definitions.

public class
ConcatPipeFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
A concat function with a pattern for clob arguments.
public class
CountFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
CurrentFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
A "function" with no parameters that returns the current date, time, or timestamp.
public class
DateTruncEmulation

Deprecated as a consequence of FunctionRenderer being deprecated.
Emulation of trunc(datetime, temporal_unit) function that leverages formatting the datetime to string and back to truncate it
public class
DB2FormatEmulation

Deprecated as a consequence of FormatFunction being deprecated.
DB2's varchar_format() can't handle quoted literal strings in the format pattern.
public class
DB2PositionFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
DB2's position() function always requires a code unit before version 11.
public class
DB2SubstringFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
DB2's substring() function requires a code unit and substr() can't optionally take it, so we render substr() by default.
public class
DerbyLpadEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
A derby implementation for lpad.
public class
DerbyRpadEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
A derby implementation for rpad.
public class
EveryAnyEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
Most databases don't have a function like every() or any().
public class
ExtractFunction

Deprecated as a consequence of FunctionRenderer being deprecated.
ANSI SQL-inspired extract() function, where the date/time fields are enumerated by TemporalUnit, and portability is achieved by delegating to Dialect#extractPattern(TemporalUnit).
public class
FormatFunction

Deprecated as a consequence of FunctionRenderer being deprecated.
A format function with support for composite temporal expressions.
public class
HypotheticalSetFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
HypotheticalSetWindowEmulation

Deprecated as a consequence of HypotheticalSetFunction being deprecated.
public class
InsertSubstringOverlayEmulation

Emulates the ANSI SQL-standard overlay() function using insert() substring(), and concat().

public class
IntegralTimestampaddFunction

Deprecated as a consequence of TimestampaddFunction being deprecated.
Used in place of TimestampaddFunction for databases which don't support fractional seconds in the timestampadd() function.
public class
InverseDistributionFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
InverseDistributionWindowEmulation

Deprecated as a consequence of InverseDistributionFunction being deprecated.
public class
LengthFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
A length function with separate patterns for string and clob argument.
public class
ListaggFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
ListaggGroupConcatEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
ListaggStringAggEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
LocatePositionEmulation

Emulates the ANSI SQL-standard position() function using locate().

public class
LpadRpadPadEmulation

HQL function inspired by the ANSI SQL trim function, with a funny syntax involving a TrimSpec.

public class
MinMaxCaseEveryAnyEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
Most databases don't have a function like every() or any().
public class
ModeStatsModeEmulation

Deprecated as a consequence of InverseDistributionFunction being deprecated.
public class
NvlCoalesceEmulation

Oracle 8i had no coalesce() function, so we emulate it using chained nvl()s.

public class
OracleTruncFunction

Custom TruncFunction for Oracle which uses emulation when truncating datetimes to seconds

public class
PostgreSQLMinMaxFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
PostgreSQL doesn't support min/max for uuid yet, but since that type is comparable we want to support this operation.
public class
PostgreSQLTruncFunction

Custom TruncFunction for PostgreSQL which uses the dialect-specific function for numeric truncation

public class
PostgreSQLTruncRoundFunction

Deprecated as a consequence of FunctionRenderer being deprecated.
PostgreSQL only supports the two-argument trunc and round functions with the following signatures:
  • trunc(numeric, integer)
  • round(numeric, integer)
public class
QuantifiedLeastGreatestEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
public class
SqlFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
A function to pass through a SQL fragment.
public class
SqlServerConvertTruncFunction

Custom TruncFunction for SQL Server versions < 16 which uses the custom DateTruncConvertEmulation

public class
SQLServerEveryAnyEmulation

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
SQL Server doesn't have a function like every() or any().
public class
SQLServerFormatEmulation

Deprecated as a consequence of FormatFunction being deprecated.
SQL Server behaves strangely when the first argument to format is of the type time, so we cast to datetime.
public class
StandardSQLFunction

Deprecated as a consequence of NamedSqmFunctionDescriptor being deprecated.
Simplified API allowing users to contribute org.hibernate.query.sqm.function.SqmFunctionDescriptors to HQL.
pack-priv class
SumReturnTypeResolver

Resolve according to JPA spec 4.8.5 SUM returns:

  • Long when applied to state fields of integral types (other than BigInteger);
  • Double when applied to state fields of floating point types;
  • BigInteger when applied to state fields of type BigInteger;
  • and BigDecimal when applied to state fields of type BigDecimal.
public class
SybaseTruncFunction

Custom TruncFunction for Sybase which uses a dialect-specific emulation function for datetimes

public class
TimestampaddFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
The timestampadd() or dateadd() function has a funny syntax which accepts a TemporalUnit as the first argument, and the actual set of accepted units varies widely.
public class
TimestampdiffFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
The timestampdiff() or datediff() function has a funny syntax which accepts a TemporalUnit as the first argument, and the actual set of accepted units varies widely.
public class
TransactSQLStrFunction

Deprecated as a consequence of FunctionRenderer being deprecated.
A special function that renders a T-SQL str() function if more than a single argument is given, or otherwise renders a cast() expression just like CastStrEmulation.
public class
TrimFunction

Deprecated as a consequence of AbstractSqmSelfRenderingFunctionDescriptor being deprecated.
ANSI SQL-standard trim() function, which has a funny syntax involving a TrimSpec, and portability is achieved using Dialect#trimPattern(TrimSpec, boolean).
public class
TruncFunction

Custom function that manages both numeric and datetime truncation