Top Description Inners Methods
org.hibernate.metamodel.mapping

public Interface Bindable

extends JdbcMappingContainer
Known Direct Subinterfaces
org.hibernate.metamodel.mapping.MappingModelExpressible
Annotations
@Incubating
Imports
org.hibernate.Incubating, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.util.IndexedConsumer

Contract for things at the domain mapping level that can be bound into a JDBC java.sql.PreparedStatement.
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Bindable.JdbcValuesBiConsumer<X, Y>

Functional interface for consuming the JDBC values, along with two values of type X and Y.

public static interface
Bindable.JdbcValuesConsumer

Functional interface for consuming the JDBC values.

Method Summary

Modifier and TypeMethod and Description
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
)

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

public Object
disassemble(Object value, SharedSessionContractImplementor session)

Breaks down a value of J into its simple pieces.

public default <X, Y> int
forEachDisassembledJdbcValue(Object value, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Visit each constituent JDBC value over the result from disassemble.

public <X, Y> int
public default int
public default int
public default int
public default <X, Y> int
forEachJdbcValue(Object value, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Visit each constituent JDBC value extracted from the entity instance itself.

public default <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.

public default int
public default int
public default int
Inherited from org.hibernate.metamodel.mapping.JdbcMappingContainer:
forEachJdbcTypegetJdbcMappinggetSingleJdbcMapping

Method Detail

addToCacheKeyback to summary
public 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.

Parameters
cacheKey:MutableCacheKeyBuilder

the MutableCacheKey used to add the disassembled value and the hashCode

value:Object

the value to disassemble

session:SharedSessionContractImplementor

the SharedSessionContractImplementor

disassembleback to summary
public Object disassemble(Object value, SharedSessionContractImplementor session)

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.

See Also
<p>
forEachDisassembledJdbcValueback to summary
public default <X, Y> int forEachDisassembledJdbcValue(Object value, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Visit each constituent JDBC value over the result from disassemble.

Given the example in disassemble, this results in the consumer being called for each simple value. E.g.:

consumer.consume( "Steve" );
consumer.consume( "Ebersole" );
consumer.consume( 28 );

Think of it as breaking the multidimensional array into a visitable flat array. Additionally, it passes through the values X and Y to the consumer.

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

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).

forEachDisassembledJdbcValueback to summary
public default int forEachDisassembledJdbcValue(Object value, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)

A short hand form of forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), that passes null for the two values X and Y.

forEachDisassembledJdbcValueback to summary
public default int forEachDisassembledJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)

A short hand form of forEachDisassembledJdbcValue(Object, int, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), that passes null for the two values X and Y .

forEachJdbcTypeback to summary
public default int forEachJdbcType(IndexedConsumer<JdbcMapping> action)

Overrides default org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each of JdbcMapping

API Note

Same as forEachJdbcType(int, IndexedConsumer) starting from `0`

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

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

forEachJdbcValueback to summary
public default <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. Short-hand form of calling disassemble and piping its result to forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)

forEachJdbcValueback to summary
public default int forEachJdbcValue(Object value, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)

A short hand form of forEachJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), that passes null for the two values X and Y.

forEachJdbcValueback to summary
public default int forEachJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)

A short hand form of forEachJdbcValue(Object, int, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), that passes null for the two values X and Y.

getJdbcTypeCountback to summary
public default int getJdbcTypeCount()

Overrides default org.hibernate.metamodel.mapping.JdbcMappingContainer.getJdbcTypeCount.

The number of JDBC mappings

Annotations
@Override
org.hibernate.metamodel.mapping back to summary

public Interface Bindable.JdbcValuesBiConsumer<X, Y>

Known Direct Subinterfaces
org.hibernate.metamodel.mapping.Bindable.JdbcValuesConsumer
Annotations
@FunctionalInterface

Functional interface for consuming the JDBC values, along with two values of type X and Y.

Method Summary

Modifier and TypeMethod and Description
public void
consume(int valueIndex, X x, Y y, Object jdbcValue, JdbcMapping jdbcMapping)

Consume a JDBC-level jdbcValue.

Method Detail

consumeback to summary
public void consume(int valueIndex, X x, Y y, Object jdbcValue, JdbcMapping jdbcMapping)

Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in

org.hibernate.metamodel.mapping back to summary

public Interface Bindable.JdbcValuesConsumer

extends Bindable.JdbcValuesBiConsumer<Object, Object>
Annotations
@FunctionalInterface

Functional interface for consuming the JDBC values.

Method Summary

Modifier and TypeMethod and Description
public default void
consume(int valueIndex, Object o, Object o2, Object jdbcValue, JdbcMapping jdbcMapping)

Implements org.hibernate.metamodel.mapping.Bindable.JdbcValuesBiConsumer.consume.

Consume a JDBC-level jdbcValue.
public void
consume(int valueIndex, Object jdbcValue, JdbcMapping jdbcMapping)

Consume a JDBC-level jdbcValue.

Method Detail

consumeback to summary
public default void consume(int valueIndex, Object o, Object o2, Object jdbcValue, JdbcMapping jdbcMapping)

Implements org.hibernate.metamodel.mapping.Bindable.JdbcValuesBiConsumer.consume.

Doc from org.hibernate.metamodel.mapping.Bindable.JdbcValuesBiConsumer.consume.

Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in

Annotations
@Override
consumeback to summary
public void consume(int valueIndex, Object jdbcValue, JdbcMapping jdbcMapping)

Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in