diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmFunctionDescriptor.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmFunctionDescriptor.java index ea37a65dfd..bd0a21f11f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmFunctionDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmFunctionDescriptor.java @@ -222,8 +222,6 @@ public abstract class AbstractSqmFunctionDescriptor implements SqmFunctionDescri * function descriptors that wish to customize creation of the node. * * @param arguments the arguments of the function invocation - * @param respectNulls - * @param fromFirst * @param impliedResultType the function return type as inferred from its usage */ protected SelfRenderingSqmWindowFunction generateSqmWindowFunctionExpression( diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmSelfRenderingFunctionDescriptor.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmSelfRenderingFunctionDescriptor.java index 5a6078a829..3eaf8d80aa 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmSelfRenderingFunctionDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/AbstractSqmSelfRenderingFunctionDescriptor.java @@ -66,43 +66,43 @@ public abstract class AbstractSqmSelfRenderingFunctionDescriptor List> arguments, ReturnableType impliedResultType, QueryEngine queryEngine) { - switch ( functionKind ) { - case ORDERED_SET_AGGREGATE: - return generateOrderedSetAggregateSqmExpression( - arguments, - null, - null, - impliedResultType, - queryEngine - ); - case AGGREGATE: - return generateAggregateSqmExpression( - arguments, - null, - impliedResultType, - queryEngine - ); - case WINDOW: - return generateWindowSqmExpression( - arguments, - null, - null, - null, - impliedResultType, - queryEngine - ); - default: - return new SelfRenderingSqmFunction<>( - this, - this, - arguments, - impliedResultType, - getArgumentsValidator(), - getReturnTypeResolver(), - queryEngine.getCriteriaBuilder(), - getName() - ); - } + return switch (functionKind) { + case ORDERED_SET_AGGREGATE -> + generateOrderedSetAggregateSqmExpression( + arguments, + null, + null, + impliedResultType, + queryEngine + ); + case AGGREGATE -> + generateAggregateSqmExpression( + arguments, + null, + impliedResultType, + queryEngine + ); + case WINDOW -> + generateWindowSqmExpression( + arguments, + null, + null, + null, + impliedResultType, + queryEngine + ); + default -> + new SelfRenderingSqmFunction<>( + this, + this, + arguments, + impliedResultType, + getArgumentsValidator(), + getReturnTypeResolver(), + queryEngine.getCriteriaBuilder(), + getName() + ); + }; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/FunctionRenderer.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/FunctionRenderer.java index 177691824e..e7d82be11e 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/FunctionRenderer.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/FunctionRenderer.java @@ -27,7 +27,7 @@ import org.hibernate.sql.ast.tree.select.SortSpecification; * @since 6.4 */ @FunctionalInterface -public interface FunctionRenderer extends FunctionRenderingSupport { +public interface FunctionRenderer { /** * @deprecated Use {@link #render(SqlAppender, List, ReturnableType, SqlAstTranslator)} instead */ diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/FunctionRenderingSupport.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/FunctionRenderingSupport.java deleted file mode 100644 index d4418d7a68..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/FunctionRenderingSupport.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later - * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html - */ -package org.hibernate.query.sqm.function; - -import org.hibernate.query.ReturnableType; -import org.hibernate.sql.ast.SqlAstTranslator; -import org.hibernate.sql.ast.spi.SqlAppender; -import org.hibernate.sql.ast.tree.SqlAstNode; -import org.hibernate.sql.ast.tree.predicate.Predicate; -import org.hibernate.sql.ast.tree.select.SortSpecification; - -import java.util.List; - -/** - * Support for {@link SqmFunctionDescriptor}s that ultimately want - * to perform SQL rendering themselves. This is a protocol passed - * from the {@link AbstractSqmSelfRenderingFunctionDescriptor} - * along to its {@link SelfRenderingSqmFunction} and ultimately to - * the {@link SelfRenderingFunctionSqlAstExpression} which calls it - * to finally render SQL. - * - * @author Steve Ebersole - * @deprecated Use {@link FunctionRenderer} instead - */ -@Deprecated(forRemoval = true) -@FunctionalInterface -public interface FunctionRenderingSupport { - void render( - SqlAppender sqlAppender, - List sqlAstArguments, - SqlAstTranslator walker); - - /** - * @since 6.4 - */ - default void render( - SqlAppender sqlAppender, - List sqlAstArguments, - ReturnableType returnType, - SqlAstTranslator walker) { - // Ignore the return type by default. Subclasses will override this - render( sqlAppender, sqlAstArguments, walker ); - } - - /** - * @since 6.4 - */ - default void render( - SqlAppender sqlAppender, - List sqlAstArguments, - Predicate filter, - ReturnableType returnType, - SqlAstTranslator walker) { - // Ignore the filter by default. Subclasses will override this - render( sqlAppender, sqlAstArguments, returnType, walker ); - } - - /** - * @since 6.4 - */ - default void render( - SqlAppender sqlAppender, - List sqlAstArguments, - Predicate filter, - List withinGroup, - ReturnableType returnType, - SqlAstTranslator walker) { - // Ignore the filter by default. Subclasses will override this - render( sqlAppender, sqlAstArguments, returnType, walker ); - } - - /** - * @since 6.4 - */ - default void render( - SqlAppender sqlAppender, - List sqlAstArguments, - Predicate filter, - Boolean respectNulls, - Boolean fromFirst, - ReturnableType returnType, - SqlAstTranslator walker) { - // Ignore the filter by default. Subclasses will override this - render( sqlAppender, sqlAstArguments, returnType, walker ); - } -}