org.hibernate.query.sqm.tree.expression.SqmSelfRenderingExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* 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.tree.expression;
import java.util.function.Function;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SemanticQueryWalker;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.sql.ast.tree.expression.Expression;
/**
* @author Steve Ebersole
*/
public class SqmSelfRenderingExpression extends AbstractSqmExpression {
private final Function renderer;
public SqmSelfRenderingExpression(
Function renderer,
SqmExpressable type,
NodeBuilder criteriaBuilder) {
super( type, criteriaBuilder );
this.renderer = renderer;
}
@Override
public X accept(SemanticQueryWalker walker) {
//noinspection unchecked
return (X) renderer.apply( walker );
}
@Override
public void appendHqlString(StringBuilder sb) {
throw new UnsupportedOperationException();
}
}