Top Description Fields Constructors Methods
org.hibernate.query.sqm.function

public Class SelfRenderingFunctionSqlAstExpression

extends Object
implements SelfRenderingExpression, Selectable, SqlExpressible, DomainResultProducer, FunctionExpression
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.ast.tree.expression.FunctionExpression, org.hibernate.sql.ast.tree.expression.Expression, org.hibernate.sql.ast.spi.SqlSelectionProducer, org.hibernate.sql.ast.tree.SqlAstNode, org.hibernate.query.sqm.sql.internal.DomainResultProducer, org.hibernate.metamodel.mapping.SqlExpressible, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.mapping.Selectable, org.hibernate.sql.ast.tree.expression.SelfRenderingExpression
Known Direct Subclasses
org.hibernate.query.sqm.function.SelfRenderingWindowFunctionSqlAstExpression, org.hibernate.query.sqm.function.SelfRenderingAggregateFunctionSqlAstExpression
Imports
java.util.List, org.hibernate.dialect.Dialect, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.internal.util.IndexedConsumer, org.hibernate.mapping.Selectable, .Table, org.hibernate.metamodel.mapping.JdbcMapping, .JdbcMappingContainer, .SqlExpressible, org.hibernate.type.descriptor.converter.spi.BasicValueConverter, org.hibernate.query.ReturnableType, org.hibernate.query.sqm.sql.internal.DomainResultProducer, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.spi.SqlAppender, .SqlAstCreationState, .SqlSelection, org.hibernate.sql.ast.tree.SqlAstNode, org.hibernate.sql.ast.tree.expression.FunctionExpression, .SelfRenderingExpression, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, org.hibernate.sql.results.graph.basic.BasicResult, org.hibernate.sql.results.internal.SqlSelectionImpl, org.hibernate.type.descriptor.java.JavaType, org.hibernate.type.spi.TypeConfiguration

Representation of a function call in the SQL AST for impls that know how to render themselves.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final JdbcMappingContainer
private final String
private final FunctionRenderer
renderer

Deprecated as a consequence of FunctionRenderer being deprecated.
private final List<? extends SqlAstNode>
private final ReturnableType<?>

Constructor Summary

AccessConstructor and Description
public
public
SelfRenderingFunctionSqlAstExpression(String functionName, FunctionRenderer renderer, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> type, JdbcMappingContainer expressible)

Deprecated as a consequence of FunctionRenderer being deprecated.

Method Summary

Modifier and TypeMethod and Description
public void
applySqlSelections(DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Used when this producer is a selection in a sub-query.
public DomainResult<?>
public SqlSelection
createSqlSelection(int
The index position used to read values from JDBC
jdbcPosition
,
int
The position in our "current JDBC values array"
valuesArrayPosition
,
JavaType<T>
The descriptor for the Java type to read the value as
javaType
,
TypeConfiguration
The associated TypeConfiguration
typeConfiguration
)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position
public SqlSelection
createSqlSelection(int
The index position used to read values from JDBC
jdbcPosition
,
int
The position in our "current JDBC values array"
valuesArrayPosition
,
JavaType<T>
The descriptor for the Java type to read the value as
javaType
,
boolean
Whether the select is virtual or real. See SqlSelection#isVirtual()
virtual
,
TypeConfiguration
The associated TypeConfiguration
typeConfiguration
)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position
public int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each JdbcMapping starting from the given offset
public String
public String
public List<? extends SqlAstNode>
public String
getCustomReadExpression()

Implements org.hibernate.mapping.Selectable.getCustomReadExpression.

Any custom read expression for this selectable.
public String
getCustomWriteExpression()

Implements org.hibernate.mapping.Selectable.getCustomWriteExpression.

Any custom write expression for this selectable.
public JdbcMappingContainer
public String
protected FunctionRenderer
getFunctionRenderer()

Deprecated as a consequence of FunctionRenderer being deprecated.
public JdbcMapping
getJdbcMapping()

Implements org.hibernate.metamodel.mapping.SqlExpressible.getJdbcMapping.

Anything that is expressible at the SQL AST level would be of basic type.
protected FunctionRenderingSupport
getRenderer()

Deprecated for removal. Use getFunctionRenderer() instead
public String
public String
getText(Dialect dialect)

Implements org.hibernate.mapping.Selectable.getText.

The selectable's text representation accounting for the Dialect's quoting, if quoted
public String
getText()

Implements org.hibernate.mapping.Selectable.getText.

The selectable's "canonical" text representation
protected ReturnableType<?>
public boolean
isFormula()

Implements org.hibernate.mapping.Selectable.isFormula.

Does this selectable represent a formula?
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

expressibleback to summary
private final JdbcMappingContainer expressible
functionNameback to summary
private final String functionName
rendererback to summary
private final FunctionRenderer renderer

Deprecated

as a consequence of FunctionRenderer being deprecated. See corresponding docs for further information.

sqlAstArgumentsback to summary
private final List<? extends SqlAstNode> sqlAstArguments
typeback to summary
private final ReturnableType<?> type

Constructor Detail

SelfRenderingFunctionSqlAstExpressionback to summary
public SelfRenderingFunctionSqlAstExpression(String functionName, FunctionRenderingSupport renderer, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> type, JdbcMappingContainer expressible)
Annotations
@Deprecated
forRemoval:true
SelfRenderingFunctionSqlAstExpressionback to summary
public SelfRenderingFunctionSqlAstExpression(String functionName, FunctionRenderer renderer, List<? extends SqlAstNode> sqlAstArguments, ReturnableType<?> type, JdbcMappingContainer expressible)

Deprecated

as a consequence of FunctionRenderer being deprecated. See corresponding docs for further information.

Method Detail

applySqlSelectionsback to summary
public void applySqlSelections(DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Used when this producer is a selection in a sub-query. The DomainResult is only needed for root query of a SELECT statement. This default impl assumes this producer is a true (Sql)Expression

Annotations
@Override
createDomainResultback to summary
public DomainResult<?> createDomainResult(String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.createDomainResult.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.createDomainResult.

Produce the domain query

Annotations
@Override
createSqlSelectionback to summary
public SqlSelection createSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType<T> javaType, TypeConfiguration typeConfiguration)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Doc from org.hibernate.sql.ast.spi.SqlSelectionProducer.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position

Parameters
jdbcPosition:int

The index position used to read values from JDBC

valuesArrayPosition:int

The position in our "current JDBC values array"

javaType:JavaType<T>

The descriptor for the Java type to read the value as

typeConfiguration:TypeConfiguration

The associated TypeConfiguration

Annotations
@Override
createSqlSelectionback to summary
public SqlSelection createSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType<T> javaType, boolean virtual, TypeConfiguration typeConfiguration)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Doc from org.hibernate.sql.ast.spi.SqlSelectionProducer.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position

Parameters
jdbcPosition:int

The index position used to read values from JDBC

valuesArrayPosition:int

The position in our "current JDBC values array"

javaType:JavaType<T>

The descriptor for the Java type to read the value as

virtual:boolean

Whether the select is virtual or real. See SqlSelection#isVirtual()

typeConfiguration:TypeConfiguration

The associated TypeConfiguration

Annotations
@Override
forEachJdbcTypeback to summary
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Doc from org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each JdbcMapping starting from the given offset

Annotations
@Override
getAliasback to summary
public String getAlias(Dialect dialect)

Implements org.hibernate.mapping.Selectable.getAlias.

Annotations
@Override
getAliasback to summary
public String getAlias(Dialect dialect, Table table)

Implements org.hibernate.mapping.Selectable.getAlias.

Annotations
@Override
getArgumentsback to summary
public List<? extends SqlAstNode> getArguments()

Implements org.hibernate.sql.ast.tree.expression.FunctionExpression.getArguments.

Annotations
@Override
getCustomReadExpressionback to summary
public String getCustomReadExpression()

Implements org.hibernate.mapping.Selectable.getCustomReadExpression.

Doc from org.hibernate.mapping.Selectable.getCustomReadExpression.

Any custom read expression for this selectable. Only pertinent for physical columns (not formulas)

Annotations
@Override
getCustomWriteExpressionback to summary
public String getCustomWriteExpression()

Implements org.hibernate.mapping.Selectable.getCustomWriteExpression.

Doc from org.hibernate.mapping.Selectable.getCustomWriteExpression.

Any custom write expression for this selectable. Only pertinent for physical columns (not formulas)

Annotations
@Override
getExpressionTypeback to summary
public JdbcMappingContainer getExpressionType()

Implements org.hibernate.sql.ast.tree.expression.Expression.getExpressionType.

Doc from org.hibernate.sql.ast.tree.expression.Expression.getExpressionType.

The type for this expression

Annotations
@Override
getFunctionNameback to summary
public String getFunctionName()

Implements org.hibernate.sql.ast.tree.expression.FunctionExpression.getFunctionName.

Annotations
@Override
getFunctionRendererback to summary
protected FunctionRenderer getFunctionRenderer()

Deprecated

as a consequence of FunctionRenderer being deprecated. See corresponding docs for further information.

getJdbcMappingback to summary
public JdbcMapping getJdbcMapping()

Implements org.hibernate.metamodel.mapping.SqlExpressible.getJdbcMapping.

Doc from org.hibernate.metamodel.mapping.SqlExpressible.getJdbcMapping.

Anything that is expressible at the SQL AST level would be of basic type.

Annotations
@Override
getRendererback to summary
protected FunctionRenderingSupport getRenderer()

Deprecated

for removal.

Use getFunctionRenderer() instead

Annotations
@Deprecated
forRemoval:true
getTemplateback to summary
public String getTemplate(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry registry)

Implements org.hibernate.mapping.Selectable.getTemplate.

Annotations
@Override
getTextback to summary
public String getText(Dialect dialect)

Implements org.hibernate.mapping.Selectable.getText.

Doc from org.hibernate.mapping.Selectable.getText.

The selectable's text representation accounting for the Dialect's quoting, if quoted

Annotations
@Override
getTextback to summary
public String getText()

Implements org.hibernate.mapping.Selectable.getText.

Doc from org.hibernate.mapping.Selectable.getText.

The selectable's "canonical" text representation

Annotations
@Override
getTypeback to summary
protected ReturnableType<?> getType()
isFormulaback to summary
public boolean isFormula()

Implements org.hibernate.mapping.Selectable.isFormula.

Doc from org.hibernate.mapping.Selectable.isFormula.

Does this selectable represent a formula? true indicates it is a formula; false indicates it is a physical column

Annotations
@Override
renderToSqlback to summary
public void renderToSql(SqlAppender sqlAppender, SqlAstTranslator<?> walker, SessionFactoryImplementor sessionFactory)

Implements org.hibernate.sql.ast.tree.expression.SelfRenderingExpression.renderToSql.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Annotations
@Override