diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/expression/NullLiteralExpression.java b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/expression/NullLiteralExpression.java index 4cf290e118..4f34779ba4 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/expression/NullLiteralExpression.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/expression/NullLiteralExpression.java @@ -28,10 +28,10 @@ public class NullLiteralExpression extends ExpressionImpl implements Seria } public String render(RenderingContext renderingContext) { - return CastFunction.CAST_NAME + "( null as " + renderingContext.getCastType( getJavaType() ) + ')'; + return "null"; } public String renderProjection(RenderingContext renderingContext) { - return render( renderingContext ); + return CastFunction.CAST_NAME + "( null as " + renderingContext.getCastType( getJavaType() ) + ')'; } }