Class ArrayTupleType
- java.lang.Object
-
- org.hibernate.metamodel.model.domain.internal.ArrayTupleType
-
- All Implemented Interfaces:
Type<Object[]>
,Bindable
,JdbcMappingContainer
,MappingModelExpressible<Object[]>
,DomainType<Object[]>
,SimpleDomainType<Object[]>
,TupleType<Object[]>
,BindableType<Object[]>
,ReturnableType<Object[]>
,SqmExpressible<Object[]>
public class ArrayTupleType extends Object implements TupleType<Object[]>, ReturnableType<Object[]>, MappingModelExpressible<Object[]>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface jakarta.persistence.metamodel.Type
Type.PersistenceType
-
-
Constructor Summary
Constructors Constructor Description ArrayTupleType(SqmExpressible<?>[] components)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.metamodel.model.domain.DomainType
getSqmType, getTupleLength
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.model.domain.SimpleDomainType
getBindableJavaType
-
Methods inherited from interface org.hibernate.query.sqm.SqmExpressible
getRelationalJavaType, getTypeName, isInstance, resolveExpressible
-
-
-
-
Constructor Detail
-
ArrayTupleType
public ArrayTupleType(SqmExpressible<?>[] components)
-
-
Method Detail
-
componentCount
public int componentCount()
- Specified by:
componentCount
in interfaceTupleType<Object[]>
-
getComponentName
public String getComponentName(int index)
- Specified by:
getComponentName
in interfaceTupleType<Object[]>
-
getComponentNames
public List<String> getComponentNames()
- Specified by:
getComponentNames
in interfaceTupleType<Object[]>
-
get
public SqmExpressible<?> get(int index)
-
get
public SqmExpressible<?> get(String componentName)
-
getExpressibleJavaType
public JavaType<Object[]> getExpressibleJavaType()
Description copied from interface:SqmExpressible
The Java type descriptor for this expressible- Specified by:
getExpressibleJavaType
in interfaceSqmExpressible<Object[]>
-
getPersistenceType
public Type.PersistenceType getPersistenceType()
- Specified by:
getPersistenceType
in interfaceType<Object[]>
-
getJavaType
public Class<Object[]> getJavaType()
- Specified by:
getJavaType
in interfaceType<Object[]>
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Breaks down a value ofJ
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 theBindable
for thePerson
entity to disassemble. Given aPerson
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.
- Specified by:
disassemble
in interfaceBindable
- See Also:
EntityEntry
-
addToCacheKey
public void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.- Specified by:
addToCacheKey
in interfaceBindable
- Parameters:
cacheKey
- the MutableCacheKey used to add the disassembled value and the hashCodevalue
- the value to disassemblesession
- the SharedSessionContractImplementor
-
forEachDisassembledJdbcValue
public <X,Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
Description copied from interface:Bindable
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)
.- Specified by:
forEachDisassembledJdbcValue
in interfaceBindable
-
getJdbcMapping
public JdbcMapping getJdbcMapping(int index)
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
-