Class JdbcLiteral<T>
java.lang.Object
org.hibernate.sql.ast.tree.expression.JdbcLiteral<T>
- All Implemented Interfaces:
Bindable
,JdbcMappingContainer
,MappingModelExpressible<T>
,DomainResultProducer<T>
,SqlSelectionProducer
,Expression
,Literal
,SqlAstNode
,JdbcParameterBinder
,JavaTypedExpressible<T>
public class JdbcLiteral<T>
extends Object
implements Literal, MappingModelExpressible<T>, DomainResultProducer<T>, JavaTypedExpressible<T>
Represents a literal in the SQL AST. This form accepts a
JdbcMapping
and acts
as its own MappingModelExpressible
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,
Y>, Bindable.JdbcValuesConsumer -
Field Summary
Fields inherited from interface org.hibernate.sql.exec.spi.JdbcParameterBinder
NOOP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(SqlAstWalker sqlTreeWalker) void
addToCacheKey
(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session) Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.void
applySqlSelections
(DomainResultCreationState creationState) Used when this producer is a selection in a sub-query.void
bindParameterValue
(PreparedStatement statement, int startPosition, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext) Bind the appropriate value in the JDBC statementcreateDomainResult
(String resultVariable, DomainResultCreationState creationState) Produce the domain querydisassemble
(Object value, SharedSessionContractImplementor session) Breaks down a value ofJ
into its simple pieces.<X,
Y> int forEachDisassembledJdbcValue
(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session) LikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)
, but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping)
.int
forEachJdbcType
(int offset, IndexedConsumer<JdbcMapping> action) Visit each JdbcMapping starting from the given offset<X,
Y> int forEachJdbcValue
(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session) Visit each constituent JDBC value extracted from the entity instance itself.The type for this expressiongetJdbcMapping
(int index) int
The number of JDBC mappingsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
Methods inherited from interface org.hibernate.sql.ast.tree.expression.Expression
createDomainResultSqlSelection, createSqlSelection, getColumnReference
-
Constructor Details
-
JdbcLiteral
-
-
Method Details
-
getLiteralValue
- Specified by:
getLiteralValue
in interfaceLiteral
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceLiteral
-
accept
- Specified by:
accept
in interfaceSqlAstNode
-
bindParameterValue
public void bindParameterValue(PreparedStatement statement, int startPosition, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext) throws SQLException Description copied from interface:JdbcParameterBinder
Bind the appropriate value in the JDBC statement- Specified by:
bindParameterValue
in interfaceJdbcParameterBinder
- Throws:
SQLException
-
getExpressionType
Description copied from interface:Expression
The type for this expression- Specified by:
getExpressionType
in interfaceExpression
-
getJdbcTypeCount
public int getJdbcTypeCount()Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
getSingleJdbcMapping
- Specified by:
getSingleJdbcMapping
in interfaceJdbcMappingContainer
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
createDomainResult
public DomainResult<T> createDomainResult(String resultVariable, DomainResultCreationState creationState) Description copied from interface:DomainResultProducer
Produce the domain query- Specified by:
createDomainResult
in interfaceDomainResultProducer<T>
-
applySqlSelections
Description copied from interface:DomainResultProducer
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- Specified by:
applySqlSelections
in interfaceDomainResultProducer<T>
-
getExpressibleJavaType
- Specified by:
getExpressibleJavaType
in interfaceJavaTypedExpressible<T>
-