remove deprecated FunctionRenderingSupport

This commit is contained in:
Gavin King 2024-09-10 22:02:52 +02:00
parent f2f802645c
commit 58a6afe78d
4 changed files with 38 additions and 130 deletions

View File

@ -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 <T> SelfRenderingSqmWindowFunction<T> generateSqmWindowFunctionExpression(

View File

@ -66,43 +66,43 @@ public abstract class AbstractSqmSelfRenderingFunctionDescriptor
List<? extends SqmTypedNode<?>> arguments,
ReturnableType<T> 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

View File

@ -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
*/

View File

@ -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<? extends SqlAstNode> sqlAstArguments,
SqlAstTranslator<?> walker);
/**
* @since 6.4
*/
default void render(
SqlAppender sqlAppender,
List<? extends SqlAstNode> 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<? extends SqlAstNode> 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<? extends SqlAstNode> sqlAstArguments,
Predicate filter,
List<SortSpecification> 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<? extends SqlAstNode> 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 );
}
}