Top Fields Constructors Methods
org.hibernate.sql.exec.internal

public abstract Class AbstractJdbcParameter

extends Object
implements JdbcParameter, JdbcParameterBinder, MappingModelExpressible, SqlExpressible, BasicValuedMapping
Class Inheritance
All Implemented Interfaces
org.hibernate.metamodel.mapping.BasicValuedMapping, org.hibernate.metamodel.mapping.SqlExpressible, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.ValueMapping, org.hibernate.type.descriptor.java.JavaTypedExpressible, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.sql.exec.spi.JdbcParameterBinder, org.hibernate.sql.ast.tree.expression.JdbcParameter, org.hibernate.sql.ast.tree.expression.Expression, org.hibernate.sql.ast.spi.SqlSelectionProducer, org.hibernate.sql.ast.tree.SqlAstNode
Known Direct Subclasses
org.hibernate.sql.exec.internal.JdbcParameterImpl, org.hibernate.sql.exec.internal.SqlTypedMappingJdbcParameter, org.hibernate.sql.exec.internal.VersionTypeSeedParameterSpecification, org.hibernate.sql.model.ast.ColumnValueParameter, org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.IdGeneratorParameter, org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.OffsetJdbcParameter, org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.LimitJdbcParameter
Imports
java.sql.PreparedStatement, .SQLException, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.engine.internal.CacheHelper, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.util.IndexedConsumer, org.hibernate.metamodel.mapping.BasicValuedMapping, .JdbcMapping, .MappingModelExpressible, .MappingType, .SqlExpressible, org.hibernate.metamodel.model.domain.internal.BasicTypeImpl, org.hibernate.query.BindableType, org.hibernate.sql.ast.SqlAstWalker, org.hibernate.sql.ast.spi.SqlSelection, org.hibernate.sql.ast.tree.expression.JdbcParameter, org.hibernate.sql.exec.ExecutionException, org.hibernate.sql.exec.spi.ExecutionContext, .JdbcParameterBinder, .JdbcParameterBinding, .JdbcParameterBindings, org.hibernate.sql.results.internal.SqlSelectionImpl, org.hibernate.type.descriptor.java.EnumJavaType, .JavaType, org.hibernate.type.descriptor.jdbc.JdbcType, .JdbcTypeIndicators, org.hibernate.type.spi.TypeConfiguration

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final JdbcMapping

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addToCacheKey(MutableCacheKeyBuilder
the MutableCacheKey used to add the disassembled value and the hashCode
cacheKey
,
Object
the value to disassemble
value
,
SharedSessionContractImplementor
the SharedSessionContractImplementor
session
)

Overrides default org.hibernate.metamodel.mapping.BasicValuedMapping.addToCacheKey.

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.
public void
bindParameterValue(PreparedStatement statement, int startPosition, JdbcParameterBindings jdbcParamBindings, ExecutionContext executionContext)

Implements org.hibernate.sql.exec.spi.JdbcParameterBinder.bindParameterValue.

Bind the appropriate value in the JDBC statement
protected void
bindParameterValue(JdbcMapping jdbcMapping, PreparedStatement statement, Object bindValue, int startPosition, ExecutionContext executionContext)

private static <E extends Enum<E>> BasicTypeImpl<E>
createEnumType(ExecutionContext executionContext, Class<E> enumClass)

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 Object
public <X, Y> int
public int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

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

Visit each JdbcMapping starting from the given offset
public <X, Y> int
forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Visit each constituent JDBC value extracted from the entity instance itself.
public MappingModelExpressible<T>
public JdbcMapping
public int
public MappingType
getMappedType()

Implements org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Descriptor for the type of this mapping
public JdbcParameterBinder
public JdbcMapping
private JdbcMapping
guessBindType(ExecutionContext executionContext, Object bindValue, JdbcMapping jdbcMapping)

private JdbcMapping
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jdbcMappingback to summary
private final JdbcMapping jdbcMapping

Constructor Detail

AbstractJdbcParameterback to summary
public AbstractJdbcParameter(JdbcMapping jdbcMapping)

Method Detail

acceptback to summary
public void accept(SqlAstWalker sqlTreeWalker)

Implements org.hibernate.sql.ast.tree.SqlAstNode.accept.

Annotations
@Override
addToCacheKeyback to summary
public void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.BasicValuedMapping.addToCacheKey.

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Doc from org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.

Parameters
cacheKey:MutableCacheKeyBuilder

the MutableCacheKey used to add the disassembled value and the hashCode

value:Object

the value to disassemble

session:SharedSessionContractImplementor

the SharedSessionContractImplementor

Annotations
@Override
bindParameterValueback to summary
public void bindParameterValue(PreparedStatement statement, int startPosition, JdbcParameterBindings jdbcParamBindings, ExecutionContext executionContext) throws SQLException

Implements org.hibernate.sql.exec.spi.JdbcParameterBinder.bindParameterValue.

Doc from org.hibernate.sql.exec.spi.JdbcParameterBinder.bindParameterValue.

Bind the appropriate value in the JDBC statement

Annotations
@Override
bindParameterValueback to summary
protected void bindParameterValue(JdbcMapping jdbcMapping, PreparedStatement statement, Object bindValue, int startPosition, ExecutionContext executionContext) throws SQLException
createEnumTypeback to summary
private static <E extends Enum<E>> BasicTypeImpl<E> createEnumType(ExecutionContext executionContext, Class<E> enumClass)
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
disassembleback to summary
public Object disassemble(Object value, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.BasicValuedMapping.disassemble.

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

Doc from org.hibernate.metamodel.mapping.Bindable.disassemble.

Breaks down a value of J into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.

Generally speaking, this is the form in which entity state is kept relative to a Session via EntityEntry.

@Entity class Person {
    @Id Integer id;
    @Embedded Name name;
    int age;
}

@Embeddable class Name {
    String familiarName;
    String familyName;
}

At the top level, we would want to disassemble a Person value, so we'd ask the Bindable for the Person entity to disassemble. Given a Person value:

Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )

this disassemble would result in a multidimensional array:

[ ["Steve", "Ebersole"], 28 ]

Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.

Annotations
@Override
forEachDisassembledJdbcValueback to summary
public <X, Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.forEachDisassembledJdbcValue.

Doc from org.hibernate.metamodel.mapping.Bindable.forEachDisassembledJdbcValue.

Like forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), but additionally receives an offset by which the selectionIndex is incremented when calling JdbcValuesBiConsumer#consume(int, Object, Object, Object, JdbcMapping).

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
forEachJdbcValueback to summary
public <X, Y> int forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Doc from org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Visit each constituent JDBC value extracted from the entity instance itself. Short-hand form of calling disassemble and piping its result to forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)

Annotations
@Override
getExpressionTypeback to summary
public MappingModelExpressible<T> 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
getJdbcMappingback to summary
public JdbcMapping getJdbcMapping()

Implements org.hibernate.metamodel.mapping.SqlExpressible.getJdbcMapping, org.hibernate.metamodel.mapping.BasicValuedMapping.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
getJdbcTypeCountback to summary
public int getJdbcTypeCount()

Overrides default org.hibernate.metamodel.mapping.Bindable.getJdbcTypeCount, org.hibernate.metamodel.mapping.JdbcMappingContainer.getJdbcTypeCount, org.hibernate.metamodel.mapping.BasicValuedMapping.getJdbcTypeCount.

Doc from org.hibernate.metamodel.mapping.Bindable.getJdbcTypeCount.

The number of JDBC mappings

Annotations
@Override
getMappedTypeback to summary
public MappingType getMappedType()

Implements org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Doc from org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Descriptor for the type of this mapping

Annotations
@Override
getParameterBinderback to summary
public JdbcParameterBinder getParameterBinder()

Implements org.hibernate.sql.ast.tree.expression.JdbcParameter.getParameterBinder.

Annotations
@Override
getSingleJdbcMappingback to summary
public JdbcMapping getSingleJdbcMapping()

Overrides default org.hibernate.metamodel.mapping.JdbcMappingContainer.getSingleJdbcMapping, org.hibernate.metamodel.mapping.BasicValuedMapping.getSingleJdbcMapping.

Annotations
@Override
guessBindTypeback to summary
private JdbcMapping guessBindType(ExecutionContext executionContext, Object bindValue, JdbcMapping jdbcMapping)
jdbcMappingback to summary
private JdbcMapping jdbcMapping(ExecutionContext executionContext, JdbcParameterBinding binding)