Package org.hibernate.metamodel.internal
Class AbstractCompositeIdentifierMapping
- java.lang.Object
-
- org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping
-
- All Implemented Interfaces:
Bindable,CompositeIdentifierMapping,EmbeddableValuedModelPart,EntityIdentifierMapping,JdbcMappingContainer,MappingModelExpressible,ModelPart,ModelPartContainer,SelectableMappings,ValuedModelPart,ValueMapping,TableGroupJoinProducer,TableGroupProducer,EmbeddableValuedFetchable,Fetchable,FetchableContainer,FetchOptions,FetchStyleAccess,FetchTimingAccess,JavaTypedExpressible
- Direct Known Subclasses:
EmbeddedIdentifierMappingImpl,NonAggregatedIdentifierMappingImpl
public abstract class AbstractCompositeIdentifierMapping extends Object implements CompositeIdentifierMapping, EmbeddableValuedFetchable, FetchOptions
Base implementation for composite identifier mappings
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
EntityIdentifierMapping.Nature
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.IndexedJdbcValueConsumer, ModelPart.JdbcValueConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected SessionFactoryImplementorsessionFactory-
Fields inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
ROLE_LOCAL_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractCompositeIdentifierMapping(EntityMappingType entityMapping, String tableExpression, MappingModelCreationProcess creationProcess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.TableGroupcreateRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)Create a TableGroupJoin as defined for this producer, but as root TableGroup.TableGroupJoincreateTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)Create a TableGroupJoin as defined for this producer The sqlAstJoinType may be null to signal that the join is for an implicit path.EntityMappingTypefindContainingEntityMapping()ModelPartfindSubPart(String name, EntityMappingType treatTargetType)intforEachJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)FetchgenerateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)Generates a Fetch of this fetchableStringgetContainingTableExpression()The table which contains the columns mapped by this valueEmbeddableMappingTypegetEmbeddableTypeDescriptor()protected EntityMappingTypegetEntityMapping()JavaType<?>getJavaType()The Java type for this part.FetchOptionsgetMappedFetchOptions()The configured fetch timing and styleEmbeddableMappingTypegetMappedType()Descriptor for the type of this mappingNavigableRolegetNavigableRole()FetchStylegetStyle()FetchTiminggetTiming()booleanhasContainingClass()Does the identifier have a corresponding EmbeddableId or IdClass?booleanhasPartitionedSelectionMapping()Objectinstantiate()Instantiate an instance of the identifier.SqlTupletoSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)voidvisitSubParts(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, forEachJdbcType, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.CompositeIdentifierMapping
getFetchableKey, getMappedIdEmbeddableTypeDescriptor, getPartMappingType, getUnsavedStrategy
-
Methods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable
getDefaultSqlAstJoinType, isSimpleJoinPredicate
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
disassemble, forEachDisassembledJdbcValue, forEachJdbcType, forEachSelectable, forEachSubPart, getJdbcMappings, getJdbcTypeCount, getParentInjectionAttributePropertyAccess, getSelectable
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
getAttributeName, getIdentifier, getIdentifierIfNotUnsaved, getNature, getPartName, setIdentifier
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, getFetchableName, incrementFetchDepth, resolveCircularFetch
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getFetchable, getKeyFetchable, getNumberOfFetchableKeys, getNumberOfFetchables, getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
applySqlSelections, applySqlSelections, areEqual, breakDownJdbcValues, decompose, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
createRootTableGroupJoin, createTableGroupJoin
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference, getSqlAliasStem
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachSelectable, forEachUpdatable
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Field Detail
-
sessionFactory
protected final SessionFactoryImplementor sessionFactory
-
-
Constructor Detail
-
AbstractCompositeIdentifierMapping
public AbstractCompositeIdentifierMapping(EntityMappingType entityMapping, String tableExpression, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
hasContainingClass
public boolean hasContainingClass()
Description copied from interface:CompositeIdentifierMappingDoes the identifier have a corresponding EmbeddableId or IdClass?- Specified by:
hasContainingClassin interfaceCompositeIdentifierMapping- Returns:
- false if there is not an IdCass or an EmbeddableId
-
getMappedType
public EmbeddableMappingType getMappedType()
Description copied from interface:ValueMappingDescriptor for the type of this mapping- Specified by:
getMappedTypein interfaceEmbeddableValuedModelPart- Specified by:
getMappedTypein interfaceValueMapping
-
getEmbeddableTypeDescriptor
public EmbeddableMappingType getEmbeddableTypeDescriptor()
- Specified by:
getEmbeddableTypeDescriptorin interfaceEmbeddableValuedModelPart
-
getJavaType
public JavaType<?> getJavaType()
Description copied from interface:ModelPartThe Java type for this part. Generally equivalent toMappingType.getMappedJavaType()relative toModelPart.getPartMappingType()- Specified by:
getJavaTypein interfaceModelPart
-
getContainingTableExpression
public String getContainingTableExpression()
Description copied from interface:ValuedModelPartThe table which contains the columns mapped by this value- Specified by:
getContainingTableExpressionin interfaceValuedModelPart
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
generateFetch
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:FetchableGenerates a Fetch of this fetchable- Specified by:
generateFetchin interfaceFetchable- Parameters:
fetchParent- The parent of the Fetch we are generatingfetchablePath- The overall path within the graphfetchTiming- The requested fetch timing
-
createTableGroupJoin
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)
Description copied from interface:TableGroupJoinProducerCreate a TableGroupJoin as defined for this producer The sqlAstJoinType may be null to signal that the join is for an implicit path. When addsPredicate istrue, the SQM join for the attribute contains an explicitONclause, and isfalseotherwise.- Specified by:
createTableGroupJoinin interfaceTableGroupJoinProducer
-
createRootTableGroupJoin
public TableGroup createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)
Description copied from interface:TableGroupJoinProducerCreate a TableGroupJoin as defined for this producer, but as root TableGroup. The main purpose of this is for correlating an association in a subquery i.e. `... alias where exists (select 1 from SomeEntity e where alias.association.attr = 1)`. The sqlAstJoinType may be null to signal that the join is for an implicit path.- Specified by:
createRootTableGroupJoinin interfaceTableGroupJoinProducer
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPartin interfaceEmbeddableValuedModelPart- Specified by:
findSubPartin interfaceModelPartContainer
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
- Specified by:
visitSubPartsin interfaceEmbeddableValuedModelPart- Specified by:
visitSubPartsin interfaceModelPartContainer
-
forEachJdbcValue
public int forEachJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachJdbcValuein interfaceBindable- Specified by:
forEachJdbcValuein interfaceEmbeddableValuedModelPart
-
toSqlExpression
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
- Specified by:
toSqlExpressionin interfaceEmbeddableValuedModelPart
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPartCreate a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResultin interfaceModelPart
-
instantiate
public Object instantiate()
Description copied from interface:EntityIdentifierMappingInstantiate an instance of the identifier.- Specified by:
instantiatein interfaceEntityIdentifierMapping
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
getMappedFetchOptions
public FetchOptions getMappedFetchOptions()
Description copied from interface:FetchableThe configured fetch timing and style- Specified by:
getMappedFetchOptionsin interfaceFetchable
-
getStyle
public FetchStyle getStyle()
- Specified by:
getStylein interfaceFetchStyleAccess
-
getTiming
public FetchTiming getTiming()
- Specified by:
getTimingin interfaceFetchTimingAccess
-
getEntityMapping
protected EntityMappingType getEntityMapping()
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()
- Specified by:
hasPartitionedSelectionMappingin interfaceModelPart
-
-