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 2525import org .hibernate .dialect .SelectItemReferenceStrategy ;
2626import org .hibernate .dialect .function .CaseLeastGreatestEmulation ;
2727import org .hibernate .dialect .function .CommonFunctionFactory ;
28+ import org .hibernate .dialect .function .NvlCoalesceEmulation ;
2829import org .hibernate .dialect .identity .IdentityColumnSupport ;
2930import org .hibernate .dialect .pagination .LimitHandler ;
3031import org .hibernate .dialect .sequence .SequenceSupport ;
@@ -285,12 +286,13 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
285286 functionFactory .variance ();
286287 functionFactory .bitLength_pattern ( "length(?1)*8" );
287288
288- if ( getVersion ().isSameOrAfter ( 12 ) ) {
289+ if ( getVersion ().isBefore ( 12 ) ) {
290+ functionContributions .getFunctionRegistry ().register ( "coalesce" , new NvlCoalesceEmulation () );
291+ }
292+ else {
293+ functionFactory .coalesce (SqlAstNodeRenderingMode .INLINE_ALL_PARAMETERS );
289294 functionFactory .locate_charindex ();
290295 }
291-
292- //coalesce() and nullif() both supported since Informix 12
293-
294296 functionContributions .getFunctionRegistry ().register ( "least" , new CaseLeastGreatestEmulation ( true ) );
295297 functionContributions .getFunctionRegistry ().register ( "greatest" , new CaseLeastGreatestEmulation ( false ) );
296298 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