File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
hibernate-community-dialects/src/main/java/org/hibernate/community/dialect
hibernate-core/src/main/java/org/hibernate/dialect/function Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 2929import org .hibernate .dialect .VarcharUUIDJdbcType ;
3030import org .hibernate .dialect .function .CaseLeastGreatestEmulation ;
3131import org .hibernate .dialect .function .CommonFunctionFactory ;
32+ import org .hibernate .dialect .function .NvlCoalesceEmulation ;
3233import org .hibernate .dialect .identity .IdentityColumnSupport ;
3334import org .hibernate .dialect .pagination .LimitHandler ;
3435import org .hibernate .dialect .sequence .SequenceSupport ;
@@ -336,12 +337,13 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
336337 functionFactory .variance ();
337338 functionFactory .bitLength_pattern ( "length(?1)*8" );
338339
339- if ( getVersion ().isSameOrAfter ( 12 ) ) {
340+ if ( getVersion ().isBefore ( 12 ) ) {
341+ functionContributions .getFunctionRegistry ().register ( "coalesce" , new NvlCoalesceEmulation () );
342+ }
343+ else {
344+ functionFactory .coalesce (SqlAstNodeRenderingMode .INLINE_ALL_PARAMETERS );
340345 functionFactory .locate_charindex ();
341346 }
342-
343- //coalesce() and nullif() both supported since Informix 12
344-
345347 functionContributions .getFunctionRegistry ().register ( "least" , new CaseLeastGreatestEmulation ( true ) );
346348 functionContributions .getFunctionRegistry ().register ( "greatest" , new CaseLeastGreatestEmulation ( false ) );
347349 if ( supportsWindowFunctions () ) {
Original file line number Diff line number Diff line change @@ -1566,9 +1566,14 @@ public void atan2_atn2() {
15661566 }
15671567
15681568 public void coalesce () {
1569+ coalesce ( SqlAstNodeRenderingMode .DEFAULT );
1570+ }
1571+
1572+ public void coalesce ( SqlAstNodeRenderingMode inferenceArgumentRenderingMode ) {
15691573 functionRegistry .namedDescriptorBuilder ( "coalesce" )
15701574 .setMinArgumentCount ( 1 )
15711575 .setArgumentTypeResolver ( StandardFunctionArgumentTypeResolvers .ARGUMENT_OR_IMPLIED_RESULT_TYPE )
1576+ .setArgumentRenderingMode ( inferenceArgumentRenderingMode )
15721577 .register ();
15731578 }
15741579
You can’t perform that action at this time.
0 commit comments