File tree Expand file tree Collapse file tree 2 files changed +15
-3
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 +15
-3
lines changed Original file line number Diff line number Diff line change @@ -285,12 +285,15 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
285285 functionFactory .stddev ();
286286 functionFactory .variance ();
287287 functionFactory .bitLength_pattern ( "length(?1)*8" );
288-
288+
289289 if ( getVersion ().isBefore ( 12 ) ) {
290- functionContributions .getFunctionRegistry ().register ( "coalesce" , new NvlCoalesceEmulation () );
290+ functionContributions .getFunctionRegistry ().register (
291+ "coalesce" ,
292+ new NvlCoalesceEmulation ( SqlAstNodeRenderingMode .INLINE_ALL_PARAMETERS )
293+ );
291294 }
292295 else {
293- functionFactory .coalesce (SqlAstNodeRenderingMode .INLINE_ALL_PARAMETERS );
296+ functionFactory .coalesce ( SqlAstNodeRenderingMode .INLINE_ALL_PARAMETERS );
294297 functionFactory .locate_charindex ();
295298 }
296299 functionContributions .getFunctionRegistry ().register ( "least" , new CaseLeastGreatestEmulation ( true ) );
Original file line number Diff line number Diff line change 1616import org .hibernate .query .sqm .produce .function .StandardFunctionReturnTypeResolvers ;
1717import org .hibernate .query .sqm .tree .SqmTypedNode ;
1818import org .hibernate .query .sqm .tree .expression .SqmExpression ;
19+ import org .hibernate .sql .ast .SqlAstNodeRenderingMode ;
1920
2021import java .util .List ;
2122
3132public class NvlCoalesceEmulation
3233 extends AbstractSqmFunctionDescriptor {
3334
35+ private final SqlAstNodeRenderingMode inferenceArgumentRenderingMode ;
36+
3437 public NvlCoalesceEmulation () {
38+ this ( SqlAstNodeRenderingMode .DEFAULT );
39+ }
40+
41+ public NvlCoalesceEmulation (SqlAstNodeRenderingMode inferenceArgumentRenderingMode ) {
3542 super (
3643 "coalesce" ,
3744 StandardArgumentsValidators .min ( 2 ),
3845 StandardFunctionReturnTypeResolvers .useFirstNonNull (),
3946 StandardFunctionArgumentTypeResolvers .IMPLIED_RESULT_TYPE
4047 );
48+ this .inferenceArgumentRenderingMode = inferenceArgumentRenderingMode ;
4149 }
4250
4351 @ Override
@@ -50,6 +58,7 @@ protected <T> SelfRenderingSqmFunction<T> generateSqmFunctionExpression(
5058 queryEngine .getSqmFunctionRegistry ()
5159 .namedDescriptorBuilder ("nvl" )
5260 .setExactArgumentCount (2 )
61+ .setArgumentRenderingMode ( inferenceArgumentRenderingMode )
5362 .descriptor ();
5463
5564 int pos = arguments .size ();
You can’t perform that action at this time.
0 commit comments