Package org.hibernate.query.derived
Class AnonymousTupleEntityValuedModelPart
- java.lang.Object
-
- org.hibernate.query.derived.AnonymousTupleEntityValuedModelPart
-
- All Implemented Interfaces:
Loadable
,Bindable
,Discriminable
,EntityMappingType
,EntityValuedModelPart
,FilterRestrictable
,JdbcMappingContainer
,ManagedMappingType
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,Restrictable
,SelectableMappings
,ValuedModelPart
,ValueMapping
,WhereRestrictable
,LazyTableGroup.ParentTableGroupUseChecker
,RootTableGroupProducer
,TableGroupJoinProducer
,TableGroupProducer
,FetchableContainer
,JavaTypedExpressible
@Incubating public class AnonymousTupleEntityValuedModelPart extends Object implements EntityValuedModelPart, EntityMappingType, TableGroupJoinProducer, ValuedModelPart, LazyTableGroup.ParentTableGroupUseChecker
-
-
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 org.hibernate.metamodel.mapping.EntityMappingType
EntityMappingType.ConstraintOrderedTableConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
-
Constructor Summary
Constructors Constructor Description AnonymousTupleEntityValuedModelPart(EntityIdentifierMapping identifierMapping, DomainType<?> domainType, String componentName, EntityValuedModelPart delegate, int fetchableIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.<X,Y>
intbreakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Breaks down the domain value to its constituent JDBC values.boolean
canUseParentTableGroup(TableGroupProducer producer, NavigablePath navigablePath, ValuedModelPart valuedModelPart)
boolean
containsTableReference(String tableExpression)
<T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Create a DomainResult for a specific reference to this ModelPart.LazyTableGroup
createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType sqlAstJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)
Create the "join", but return a TableGroup.TableGroup
createTableGroupInternal(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)
TableGroupJoin
createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)
Create a TableGroupJoin.Object
disassemble(Object value, SharedSessionContractImplementor session)
Breaks down a value ofJ
into its simple pieces.EntityMappingType
findContainingEntityMapping()
AttributeMapping
findDeclaredAttributeMapping(String name)
Find an attribute-mapping, declared on this entity mapping (not super or subs), by nameModelPart
findSubPart(String name, EntityMappingType treatTargetType)
void
forEachAttributeMapping(Consumer<? super AttributeMapping> action)
Visit each attribute mapping<X,Y>
intforEachDisassembledJdbcValue(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>
intforEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> consumer, SharedSessionContractImplementor session)
Visit each constituent JDBC value extracted from the entity instance itself.int
forEachSelectable(int offset, SelectableConsumer consumer)
Visits each selectable mapping with the selectable index offset by the given value.int
forEachSelectable(SelectableConsumer consumer)
A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.AttributeMapping
getAttributeMapping(int position)
Retrieve an attribute mapping by position, relative to all attributesAttributeMappingsList
getAttributeMappings()
The attributes mapping for this entity, including those declared on supertype mappingsint
getBatchSize()
String
getContainingTableExpression()
The table which contains the columns mapped by this valueAttributeMappingsMap
getDeclaredAttributeMappings()
Get access to the attributes defined on this class - do not access attributes defined on the superSqlAstJoinType
getDefaultSqlAstJoinType(TableGroup parentTableGroup)
EntityDiscriminatorMapping
getDiscriminatorMapping()
Mapping details for the entity's discriminator.String
getDiscriminatorSQLValue()
Object
getDiscriminatorValue()
The discriminator value which indicates this entity mappingEntityMappingType
getEntityMappingType()
The descriptor of the entity that is the type for this partString
getEntityName()
The entity name.EntityPersister
getEntityPersister()
Safety-net.ModelPart
getForeignKeyPart()
EntityIdentifierMapping
getIdentifierMapping()
Mapping details for the entity's identifier.TableDetails
getIdentifierTableDetails()
Details for the table that defines the identifier column(s) for an entity hierarchy.JavaType<?>
getJavaType()
The Java type for this part.JdbcMapping
getJdbcMapping(int index)
int
getJdbcTypeCount()
The number of JDBC mappingsJavaType<?>
getMappedJavaType()
The descriptor descriptor for the mapped Java typeTableDetails
getMappedTableDetails()
Details for the table this entity maps.MappingType
getMappedType()
Descriptor for the type of this mappingMultiNaturalIdLoader<?>
getMultiNaturalIdLoader()
Access to performing multi-value natural-id database selection.NaturalIdLoader<?>
getNaturalIdLoader()
Access to performing natural-id database selection.NaturalIdMapping
getNaturalIdMapping()
The mapping for the natural-id of the entity, if one is definedNavigableRole
getNavigableRole()
int
getNumberOfAttributeMappings()
The total number of attributes for this entity, including those declared on supertype mappingsint
getNumberOfFetchables()
The number of fetchables in the containerMappingType
getPartMappingType()
The type for this part.String
getPartName()
The local part name, which is generally the unqualified role nameEntityRowIdMapping
getRowIdMapping()
The mapping for the row-id of the entity, if one is defined.SelectableMapping
getSelectable(int columnIndex)
Get the selectable at the given positionJdbcMapping
getSingleJdbcMapping()
String
getSqlAliasStem()
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedObject
getValue(Object instance, int position)
Extract a specific attribute value from the entity instance, by positionObject[]
getValues(Object instance)
Extract the individual attribute values from the entity instanceEntityVersionMapping
getVersionMapping()
Mapping details for the entity's version when using the version strategy.boolean
isAffectedByInfluencers(LoadQueryInfluencers influencers)
boolean
isExplicitPolymorphism()
Is this class explicit polymorphism only?boolean
isNotAffectedByInfluencers(LoadQueryInfluencers influencers)
boolean
isSimpleJoinPredicate(Predicate predicate)
Returns whether the given predicate is a simple join predicate for this attribute.Object
loadByUniqueKey(String propertyName, Object uniqueKey, SharedSessionContractImplementor session)
Load an instance of the persistent class, by a unique key other than the primary key.OptimisticLockStyle
optimisticLockStyle()
The type of optimistic locking, if any, defined for this entity mappingvoid
setValue(Object instance, int position, Object value)
Inject a specific attribute value into the entity instance, by positionvoid
setValues(Object instance, Object[] resolvedValues)
Inject the attribute values into the entity instancevoid
visitConstraintOrderedTables(EntityMappingType.ConstraintOrderedTableConsumer consumer)
void
visitDeclaredAttributeMappings(Consumer<? super AttributeMapping> action)
Visit attributes defined on this class - do not visit attributes defined on the supervoid
visitQuerySpaces(Consumer<String> querySpaceConsumer)
Visit each "query space" for the mapped entity.void
visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
-
Methods 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.metamodel.mapping.EntityMappingType
applyBaseRestrictions, applyDiscriminator, applyFilterRestrictions, applyWhereRestrictions, asEntityMappingType, createPrimaryTableReference, createRootTableGroup, createTableReferenceJoin, extractConcreteTypeStateValues, findSubPart, findSubTypesSubPart, getContributor, getFetchable, getMappedSuperclass, getNumberOfDeclaredAttributeMappings, getRepresentationStrategy, getRootEntityDescriptor, getRootPathName, getSqmMultiTableInsertStrategy, getSqmMultiTableMutationStrategy, getSubclassEntityNames, getSubclassId, getSubMappingTypes, getSuperMappingType, hasSubclasses, hasWhereRestrictions, isAbstract, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEntityGraph, isTypeOrSuperType, isTypeOrSuperType, pruneForSubclasses, pruneForSubclasses, visitAttributeMappings, visitSubTypeAttributeMappings, visitSuperTypeAttributeMappings
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart
forEachSubPart
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
anyRequiresAggregateColumnWriter, findAttributeMapping, forEachAttributeMapping, hasPartitionedSelectionMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, breakDownJdbcValues, decompose, decompose, isEntityIdentifierMapping, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
determineSqlJoinType
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachNonFormula, forEachUpdatable
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Constructor Detail
-
AnonymousTupleEntityValuedModelPart
public AnonymousTupleEntityValuedModelPart(EntityIdentifierMapping identifierMapping, DomainType<?> domainType, String componentName, EntityValuedModelPart delegate, int fetchableIndex)
-
-
Method Detail
-
getForeignKeyPart
public ModelPart getForeignKeyPart()
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPart
in interfaceEntityValuedModelPart
- Specified by:
findSubPart
in interfaceModelPartContainer
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
- Specified by:
visitSubParts
in interfaceEntityValuedModelPart
- Specified by:
visitSubParts
in interfaceModelPartContainer
-
getPartMappingType
public MappingType getPartMappingType()
Description copied from interface:ModelPart
The type for this part.- Specified by:
getPartMappingType
in interfaceEntityMappingType
- Specified by:
getPartMappingType
in interfaceManagedMappingType
- Specified by:
getPartMappingType
in interfaceModelPart
-
getMappedType
public MappingType getMappedType()
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
getJavaType
public JavaType<?> getJavaType()
Description copied from interface:ModelPart
The Java type for this part. Generally equivalent toMappingType.getMappedJavaType()
relative toModelPart.getPartMappingType()
- Specified by:
getJavaType
in interfaceEntityMappingType
- Specified by:
getJavaType
in interfaceManagedMappingType
- Specified by:
getJavaType
in interfaceModelPart
-
getPartName
public String getPartName()
Description copied from interface:ModelPart
The local part name, which is generally the unqualified role name- Specified by:
getPartName
in interfaceEntityMappingType
- Specified by:
getPartName
in interfaceModelPart
-
getContainingTableExpression
public String getContainingTableExpression()
Description copied from interface:ValuedModelPart
The table which contains the columns mapped by this value- Specified by:
getContainingTableExpression
in interfaceValuedModelPart
-
getJdbcTypeCount
public int getJdbcTypeCount()
Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceEntityMappingType
- Specified by:
getJdbcTypeCount
in interfaceEntityValuedModelPart
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
- Specified by:
getJdbcTypeCount
in interfaceSelectableMappings
- Specified by:
getJdbcTypeCount
in interfaceValuedModelPart
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()
Description copied from interface:EntityMappingType
The total number of attributes for this entity, including those declared on supertype mappings- Specified by:
getNumberOfAttributeMappings
in interfaceEntityMappingType
- Specified by:
getNumberOfAttributeMappings
in interfaceManagedMappingType
-
getAttributeMapping
public AttributeMapping getAttributeMapping(int position)
Description copied from interface:EntityMappingType
Retrieve an attribute mapping by position, relative to all attributes- Specified by:
getAttributeMapping
in interfaceEntityMappingType
- Specified by:
getAttributeMapping
in interfaceManagedMappingType
-
getAttributeMappings
public AttributeMappingsList getAttributeMappings()
Description copied from interface:EntityMappingType
The attributes mapping for this entity, including those declared on supertype mappings- Specified by:
getAttributeMappings
in interfaceEntityMappingType
- Specified by:
getAttributeMappings
in interfaceManagedMappingType
-
forEachAttributeMapping
public void forEachAttributeMapping(Consumer<? super AttributeMapping> action)
Description copied from interface:EntityMappingType
Visit each attribute mapping- Specified by:
forEachAttributeMapping
in interfaceEntityMappingType
- Specified by:
forEachAttributeMapping
in interfaceManagedMappingType
- See Also:
EntityMappingType.getAttributeMappings()
-
getValues
public Object[] getValues(Object instance)
Description copied from interface:ManagedMappingType
Extract the individual attribute values from the entity instance- Specified by:
getValues
in interfaceManagedMappingType
-
getValue
public Object getValue(Object instance, int position)
Description copied from interface:ManagedMappingType
Extract a specific attribute value from the entity instance, by position- Specified by:
getValue
in interfaceManagedMappingType
-
setValues
public void setValues(Object instance, Object[] resolvedValues)
Description copied from interface:ManagedMappingType
Inject the attribute values into the entity instance- Specified by:
setValues
in interfaceManagedMappingType
-
setValue
public void setValue(Object instance, int position, Object value)
Description copied from interface:ManagedMappingType
Inject a specific attribute value into the entity instance, by position- Specified by:
setValue
in interfaceManagedMappingType
-
getJdbcMapping
public JdbcMapping getJdbcMapping(int index)
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
getSingleJdbcMapping
public JdbcMapping getSingleJdbcMapping()
- Specified by:
getSingleJdbcMapping
in interfaceJdbcMappingContainer
- Specified by:
getSingleJdbcMapping
in interfaceValuedModelPart
-
forEachSelectable
public int forEachSelectable(SelectableConsumer consumer)
Description copied from interface:ModelPart
A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in interfaceValuedModelPart
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)
Description copied from interface:ModelPart
Visits each selectable mapping with the selectable index offset by the given value. Returns the amount of jdbc types that have been visited.- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in interfaceValuedModelPart
- See Also:
SelectableConsumer.accept(int, SelectableMapping)
-
getSelectable
public SelectableMapping getSelectable(int columnIndex)
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
getMappedJavaType
public JavaType<?> getMappedJavaType()
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceEntityMappingType
- Specified by:
getMappedJavaType
in interfaceMappingType
-
createTableGroupJoin
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducer
Create a TableGroupJoin.- Specified by:
createTableGroupJoin
in interfaceTableGroupJoinProducer
- Parameters:
navigablePath
- The NavigablePath to the joinlhs
- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase
- A specific SqlAliasBase to use. May benull
indicating one should be created using the SqlAliasBaseGenerator fromcreationState
requestedJoinType
- An explicit join-type. May be null to signal that the join is for an implicit path.addsPredicate
- Indicates there are explicit, additional predicates (from an SQM tree ON/WITH clause)
-
createTableGroupInternal
public TableGroup createTableGroupInternal(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)
-
createRootTableGroupJoin
public LazyTableGroup createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType sqlAstJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducer
Create the "join", but return a TableGroup. Intended for creating sub-query correlations. E.g., givenfrom SomeEntity e where exists ( select 1 from AnotherEntity a where e.association.attr = 1 )
We call this for the `e.association` path.- Specified by:
createRootTableGroupJoin
in interfaceTableGroupJoinProducer
- Parameters:
navigablePath
- The NavigablePath to the joinlhs
- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase
- A specific SqlAliasBase to use. May benull
indicating one should be created using the SqlAliasBaseGenerator fromcreationState
sqlAstJoinType
- An explicit join-type. May be null to signal that the join is for an implicit path.predicateConsumer
- Consumer for additional predicates from the producer's mapping.
-
canUseParentTableGroup
public boolean canUseParentTableGroup(TableGroupProducer producer, NavigablePath navigablePath, ValuedModelPart valuedModelPart)
- Specified by:
canUseParentTableGroup
in interfaceLazyTableGroup.ParentTableGroupUseChecker
-
getSqlAliasStem
public String getSqlAliasStem()
Description copied from interface:TableGroupProducer
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedNote that this is a metadata-ive value. It is only ever used internal to the producer producing its TableGroup.
- Specified by:
getSqlAliasStem
in interfaceEntityMappingType
- Specified by:
getSqlAliasStem
in interfaceTableGroupProducer
- See Also:
SqlAliasBaseManager.createSqlAliasBase(java.lang.String)
-
getNumberOfFetchables
public int getNumberOfFetchables()
Description copied from interface:FetchableContainer
The number of fetchables in the container- Specified by:
getNumberOfFetchables
in interfaceEntityMappingType
- Specified by:
getNumberOfFetchables
in interfaceFetchableContainer
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRole
in interfaceModelPart
- See Also:
ModelPart.getPartName()
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMapping
in interfaceEntityMappingType
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Create a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResult
in interfaceEntityValuedModelPart
- Specified by:
createDomainResult
in interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceEntityValuedModelPart
- Specified by:
applySqlSelections
in interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceEntityValuedModelPart
- Specified by:
applySqlSelections
in interfaceModelPart
-
breakDownJdbcValues
public <X,Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Description copied from interface:ModelPart
Breaks down the domain value to its constituent JDBC values. Think of it as breaking the multi-dimensional array into a visitable flat array. Additionally, it passes through the valuesX
andY
to the consumer. Returns the amount of jdbc types that have been visited.- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
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
- Specified by:
disassemble
in interfaceEntityValuedModelPart
- 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
- Specified by:
addToCacheKey
in interfaceEntityValuedModelPart
- Specified by:
addToCacheKey
in interfaceJavaTypedExpressible
- 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
- Specified by:
forEachDisassembledJdbcValue
in interfaceEntityValuedModelPart
-
forEachJdbcValue
public <X,Y> int forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> consumer, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Visit each constituent JDBC value extracted from the entity instance itself. Short-hand form of callingBindable.disassemble(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor)
and piping its result toBindable.forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)
- Specified by:
forEachJdbcValue
in interfaceBindable
- Specified by:
forEachJdbcValue
in interfaceEntityValuedModelPart
-
isExplicitPolymorphism
public boolean isExplicitPolymorphism()
Description copied from interface:EntityMappingType
Is this class explicit polymorphism only?- Specified by:
isExplicitPolymorphism
in interfaceEntityMappingType
-
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 interfaceEntityValuedModelPart
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
getEntityPersister
public EntityPersister getEntityPersister()
Description copied from interface:EntityMappingType
Safety-net.- Specified by:
getEntityPersister
in interfaceEntityMappingType
-
getEntityName
public String getEntityName()
Description copied from interface:EntityMappingType
The entity name. For most entities, this will be the fully-qualified name of the entity class. The alternative is an explicit entity-name which takes precedence if provided- Specified by:
getEntityName
in interfaceEntityMappingType
-
getMappedTableDetails
public TableDetails getMappedTableDetails()
Description copied from interface:EntityMappingType
Details for the table this entity maps. Generally this is the same asEntityMappingType.getIdentifierTableDetails()
, though may be different for subtypes in joined andunion inheritance hierarchies- Specified by:
getMappedTableDetails
in interfaceEntityMappingType
- See Also:
EntityMappingType.getIdentifierTableDetails()
-
getIdentifierTableDetails
public TableDetails getIdentifierTableDetails()
Description copied from interface:EntityMappingType
Details for the table that defines the identifier column(s) for an entity hierarchy.- Specified by:
getIdentifierTableDetails
in interfaceEntityMappingType
-
visitQuerySpaces
public void visitQuerySpaces(Consumer<String> querySpaceConsumer)
Description copied from interface:EntityMappingType
Visit each "query space" for the mapped entity.- Specified by:
visitQuerySpaces
in interfaceEntityMappingType
-
findDeclaredAttributeMapping
public AttributeMapping findDeclaredAttributeMapping(String name)
Description copied from interface:EntityMappingType
Find an attribute-mapping, declared on this entity mapping (not super or subs), by name- Specified by:
findDeclaredAttributeMapping
in interfaceEntityMappingType
-
getDeclaredAttributeMappings
public AttributeMappingsMap getDeclaredAttributeMappings()
Description copied from interface:EntityMappingType
Get access to the attributes defined on this class - do not access attributes defined on the super- Specified by:
getDeclaredAttributeMappings
in interfaceEntityMappingType
-
visitDeclaredAttributeMappings
public void visitDeclaredAttributeMappings(Consumer<? super AttributeMapping> action)
Description copied from interface:EntityMappingType
Visit attributes defined on this class - do not visit attributes defined on the super- Specified by:
visitDeclaredAttributeMappings
in interfaceEntityMappingType
-
getIdentifierMapping
public EntityIdentifierMapping getIdentifierMapping()
Description copied from interface:EntityMappingType
Mapping details for the entity's identifier. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getIdentifierMapping
in interfaceEntityMappingType
-
getDiscriminatorMapping
public EntityDiscriminatorMapping getDiscriminatorMapping()
Description copied from interface:EntityMappingType
Mapping details for the entity's discriminator. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getDiscriminatorMapping
in interfaceDiscriminable
- Specified by:
getDiscriminatorMapping
in interfaceEntityMappingType
-
getDiscriminatorValue
public Object getDiscriminatorValue()
Description copied from interface:EntityMappingType
The discriminator value which indicates this entity mapping- Specified by:
getDiscriminatorValue
in interfaceEntityMappingType
-
getDiscriminatorSQLValue
public String getDiscriminatorSQLValue()
- Specified by:
getDiscriminatorSQLValue
in interfaceEntityMappingType
-
getVersionMapping
public EntityVersionMapping getVersionMapping()
Description copied from interface:EntityMappingType
Mapping details for the entity's version when using the version strategy. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getVersionMapping
in interfaceEntityMappingType
- Returns:
- The version mapping, or null if the entity is (1) defined
with a strategy other than
OptimisticLockStyle.VERSION
or (2) defined without optimistic locking - See Also:
EntityMappingType.optimisticLockStyle()
-
optimisticLockStyle
public OptimisticLockStyle optimisticLockStyle()
Description copied from interface:EntityMappingType
The type of optimistic locking, if any, defined for this entity mapping- Specified by:
optimisticLockStyle
in interfaceEntityMappingType
-
getNaturalIdMapping
public NaturalIdMapping getNaturalIdMapping()
Description copied from interface:EntityMappingType
The mapping for the natural-id of the entity, if one is defined- Specified by:
getNaturalIdMapping
in interfaceEntityMappingType
-
getRowIdMapping
public EntityRowIdMapping getRowIdMapping()
Description copied from interface:EntityMappingType
The mapping for the row-id of the entity, if one is defined.- Specified by:
getRowIdMapping
in interfaceEntityMappingType
-
visitConstraintOrderedTables
public void visitConstraintOrderedTables(EntityMappingType.ConstraintOrderedTableConsumer consumer)
- Specified by:
visitConstraintOrderedTables
in interfaceEntityMappingType
-
loadByUniqueKey
public Object loadByUniqueKey(String propertyName, Object uniqueKey, SharedSessionContractImplementor session)
Description copied from interface:EntityMappingType
Load an instance of the persistent class, by a unique key other than the primary key.- Specified by:
loadByUniqueKey
in interfaceEntityMappingType
-
getNaturalIdLoader
public NaturalIdLoader<?> getNaturalIdLoader()
Description copied from interface:EntityMappingType
Access to performing natural-id database selection. This is per-entity in the hierarchy- Specified by:
getNaturalIdLoader
in interfaceEntityMappingType
-
getMultiNaturalIdLoader
public MultiNaturalIdLoader<?> getMultiNaturalIdLoader()
Description copied from interface:EntityMappingType
Access to performing multi-value natural-id database selection. This is per-entity in the hierarchy- Specified by:
getMultiNaturalIdLoader
in interfaceEntityMappingType
-
getEntityMappingType
public EntityMappingType getEntityMappingType()
Description copied from interface:EntityValuedModelPart
The descriptor of the entity that is the type for this part- Specified by:
getEntityMappingType
in interfaceEntityValuedModelPart
-
getDefaultSqlAstJoinType
public SqlAstJoinType getDefaultSqlAstJoinType(TableGroup parentTableGroup)
- Specified by:
getDefaultSqlAstJoinType
in interfaceTableGroupJoinProducer
-
isSimpleJoinPredicate
public boolean isSimpleJoinPredicate(Predicate predicate)
Description copied from interface:TableGroupJoinProducer
Returns whether the given predicate is a simple join predicate for this attribute. This is useful to understand if a predicate has additional conjunctions other than the FK related predicate.- Specified by:
isSimpleJoinPredicate
in interfaceTableGroupJoinProducer
-
containsTableReference
public boolean containsTableReference(String tableExpression)
- Specified by:
containsTableReference
in interfaceTableGroupProducer
-
getBatchSize
public int getBatchSize()
- Specified by:
getBatchSize
in interfaceLoadable
-
isAffectedByInfluencers
public boolean isAffectedByInfluencers(LoadQueryInfluencers influencers)
- Specified by:
isAffectedByInfluencers
in interfaceLoadable
-
isNotAffectedByInfluencers
public boolean isNotAffectedByInfluencers(LoadQueryInfluencers influencers)
- Specified by:
isNotAffectedByInfluencers
in interfaceLoadable
-
-