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 2323import org .hibernate .dialect .SelectItemReferenceStrategy ;
2424import org .hibernate .dialect .function .CaseLeastGreatestEmulation ;
2525import org .hibernate .dialect .function .CommonFunctionFactory ;
26+ import org .hibernate .dialect .function .NvlCoalesceEmulation ;
2627import org .hibernate .dialect .identity .IdentityColumnSupport ;
2728import org .hibernate .dialect .pagination .LimitHandler ;
2829import org .hibernate .dialect .sequence .SequenceSupport ;
@@ -281,12 +282,13 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
281282 functionFactory .variance ();
282283 functionFactory .bitLength_pattern ( "length(?1)*8" );
283284
284- if ( getVersion ().isSameOrAfter ( 12 ) ) {
285+ if ( getVersion ().isBefore ( 12 ) ) {
286+ functionContributions .getFunctionRegistry ().register ( "coalesce" , new NvlCoalesceEmulation () );
287+ }
288+ else {
289+ functionFactory .coalesce (SqlAstNodeRenderingMode .INLINE_ALL_PARAMETERS );
285290 functionFactory .locate_charindex ();
286291 }
287-
288- //coalesce() and nullif() both supported since Informix 12
289-
290292 functionContributions .getFunctionRegistry ().register ( "least" , new CaseLeastGreatestEmulation ( true ) );
291293 functionContributions .getFunctionRegistry ().register ( "greatest" , new CaseLeastGreatestEmulation ( false ) );
292294 if ( supportsWindowFunctions () ) {
Original file line number Diff line number Diff line change @@ -1562,9 +1562,14 @@ public void atan2_atn2() {
15621562 }
15631563
15641564 public void coalesce () {
1565+ coalesce ( SqlAstNodeRenderingMode .DEFAULT );
1566+ }
1567+
1568+ public void coalesce ( SqlAstNodeRenderingMode inferenceArgumentRenderingMode ) {
15651569 functionRegistry .namedDescriptorBuilder ( "coalesce" )
15661570 .setMinArgumentCount ( 1 )
15671571 .setArgumentTypeResolver ( StandardFunctionArgumentTypeResolvers .ARGUMENT_OR_IMPLIED_RESULT_TYPE )
1572+ .setArgumentRenderingMode ( inferenceArgumentRenderingMode )
15681573 .register ();
15691574 }
15701575
You can’t perform that action at this time.
0 commit comments