remove deprecated FunctionRenderingSupport
This commit is contained in:
parent
f2f802645c
commit
58a6afe78d
|
@ -222,8 +222,6 @@ public abstract class AbstractSqmFunctionDescriptor implements SqmFunctionDescri
|
||||||
* function descriptors that wish to customize creation of the node.
|
* function descriptors that wish to customize creation of the node.
|
||||||
*
|
*
|
||||||
* @param arguments the arguments of the function invocation
|
* @param arguments the arguments of the function invocation
|
||||||
* @param respectNulls
|
|
||||||
* @param fromFirst
|
|
||||||
* @param impliedResultType the function return type as inferred from its usage
|
* @param impliedResultType the function return type as inferred from its usage
|
||||||
*/
|
*/
|
||||||
protected <T> SelfRenderingSqmWindowFunction<T> generateSqmWindowFunctionExpression(
|
protected <T> SelfRenderingSqmWindowFunction<T> generateSqmWindowFunctionExpression(
|
||||||
|
|
|
@ -66,43 +66,43 @@ public abstract class AbstractSqmSelfRenderingFunctionDescriptor
|
||||||
List<? extends SqmTypedNode<?>> arguments,
|
List<? extends SqmTypedNode<?>> arguments,
|
||||||
ReturnableType<T> impliedResultType,
|
ReturnableType<T> impliedResultType,
|
||||||
QueryEngine queryEngine) {
|
QueryEngine queryEngine) {
|
||||||
switch ( functionKind ) {
|
return switch (functionKind) {
|
||||||
case ORDERED_SET_AGGREGATE:
|
case ORDERED_SET_AGGREGATE ->
|
||||||
return generateOrderedSetAggregateSqmExpression(
|
generateOrderedSetAggregateSqmExpression(
|
||||||
arguments,
|
arguments,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
impliedResultType,
|
impliedResultType,
|
||||||
queryEngine
|
queryEngine
|
||||||
);
|
);
|
||||||
case AGGREGATE:
|
case AGGREGATE ->
|
||||||
return generateAggregateSqmExpression(
|
generateAggregateSqmExpression(
|
||||||
arguments,
|
arguments,
|
||||||
null,
|
null,
|
||||||
impliedResultType,
|
impliedResultType,
|
||||||
queryEngine
|
queryEngine
|
||||||
);
|
);
|
||||||
case WINDOW:
|
case WINDOW ->
|
||||||
return generateWindowSqmExpression(
|
generateWindowSqmExpression(
|
||||||
arguments,
|
arguments,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
impliedResultType,
|
impliedResultType,
|
||||||
queryEngine
|
queryEngine
|
||||||
);
|
);
|
||||||
default:
|
default ->
|
||||||
return new SelfRenderingSqmFunction<>(
|
new SelfRenderingSqmFunction<>(
|
||||||
this,
|
this,
|
||||||
this,
|
this,
|
||||||
arguments,
|
arguments,
|
||||||
impliedResultType,
|
impliedResultType,
|
||||||
getArgumentsValidator(),
|
getArgumentsValidator(),
|
||||||
getReturnTypeResolver(),
|
getReturnTypeResolver(),
|
||||||
queryEngine.getCriteriaBuilder(),
|
queryEngine.getCriteriaBuilder(),
|
||||||
getName()
|
getName()
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.hibernate.sql.ast.tree.select.SortSpecification;
|
||||||
* @since 6.4
|
* @since 6.4
|
||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface FunctionRenderer extends FunctionRenderingSupport {
|
public interface FunctionRenderer {
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #render(SqlAppender, List, ReturnableType, SqlAstTranslator)} instead
|
* @deprecated Use {@link #render(SqlAppender, List, ReturnableType, SqlAstTranslator)} instead
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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 );
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue