Class EmbeddedAttributeMapping
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
-
- org.hibernate.metamodel.mapping.internal.AbstractStateArrayContributorMapping
-
- org.hibernate.metamodel.mapping.internal.AbstractSingularAttributeMapping
-
- org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping
-
- All Implemented Interfaces:
AttributeMapping,Bindable,EmbeddableValuedModelPart,JdbcMappingContainer,MappingModelExpressible,ModelPart,ModelPartContainer,OwnedValuedModelPart,PropertyBasedMapping,SelectableMappings,SingularAttributeMapping,ValuedModelPart,ValueMapping,TableGroupJoinProducer,TableGroupProducer,DatabaseSnapshotContributor,EmbeddableValuedFetchable,Fetchable,FetchableContainer,FetchOptions,FetchStyleAccess,FetchTimingAccess,JavaTypedExpressible,MutabilityPlanExposer
- Direct Known Subclasses:
InverseNonAggregatedIdentifierMapping,VirtualEmbeddedAttributeMapping
public class EmbeddedAttributeMapping extends AbstractSingularAttributeMapping implements EmbeddableValuedFetchable, Fetchable
-
-
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.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
-
Constructor Summary
Constructors Constructor Description EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, String parentInjectionAttributeName, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, PropertyAccess parentInjectionAttributePropertyAccess, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplySqlSelections(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.EmbeddedAttributeMappingasEmbeddedAttributeMapping()A utility method to avoid casting explicitly to EmbeddedAttributeMappingintcompare(Object value1, Object value2)booleancontainsTableReference(String tableExpression)<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, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType sqlAstJoinType, boolean fetched, @Nullable Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)Create the "join", but return a TableGroup.TableGroupJoincreateTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)Create a TableGroupJoin.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()EmbeddableMappingTypegetMappedType()Descriptor for the type of this mappingNavigableRolegetNavigableRole()PropertyAccessgetParentInjectionAttributePropertyAccess()StringgetSqlAliasStem()Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedbooleanisEmbeddedAttributeMapping()booleanisSelectable()SqlTupletoSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)StringtoString()-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractSingularAttributeMapping
getGenerator
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractStateArrayContributorMapping
getFetchableName, getMappedFetchOptions, getStyle, getTiming
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
getAttributeMetadata, getAttributeName, getDeclaringType, getFetchableKey, getJavaType, getPartMappingType, getPropertyAccess, getStateArrayPosition
-
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.AttributeMapping
asAttributeMapping, asPluralAttributeMapping, findContainingEntityMapping, getAttributeMetadata, getAttributeName, getDeclaringType, getExposedMutabilityPlan, getPartName, getPropertyAccess, getStateArrayPosition, getValue, isPluralAttributeMapping, setValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.sql.results.graph.DatabaseSnapshotContributor
createSnapshotDomainResult
-
Methods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable
getDefaultSqlAstJoinType, isSimpleJoinPredicate
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
addToCacheKey, breakDownJdbcValues, decompose, disassemble, findSubPart, forEachDisassembledJdbcValue, forEachInsertable, forEachJdbcType, forEachJdbcValue, forEachSelectable, forEachSubPart, forEachUpdatable, getFetchable, getJavaType, getJdbcMapping, getJdbcTypeCount, getNumberOfFetchables, getSelectable, getSelectableIndex, hasPartitionedSelectionMapping, visitSubParts
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
getFetchableKey, getFetchableName, getMappedFetchOptions, incrementFetchDepth, resolveCircularFetch
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaTypedExpressible
addToCacheKey
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, getPartMappingType, 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
forEachNonFormula, forEachSelectable, getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Constructor Detail
-
EmbeddedAttributeMapping
public EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, String parentInjectionAttributeName, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)
-
EmbeddedAttributeMapping
public EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, PropertyAccess parentInjectionAttributePropertyAccess, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)
-
-
Method Detail
-
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
-
getContainingTableExpression
public String getContainingTableExpression()
Description copied from interface:ValuedModelPartThe table which contains the columns mapped by this value- Specified by:
getContainingTableExpressionin interfaceValuedModelPart
-
getParentInjectionAttributePropertyAccess
public PropertyAccess getParentInjectionAttributePropertyAccess()
- Specified by:
getParentInjectionAttributePropertyAccessin interfaceEmbeddableValuedModelPart- See Also:
Parent
-
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
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
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
-
toSqlExpression
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
- Specified by:
toSqlExpressionin interfaceEmbeddableValuedModelPart
-
createTableGroupJoin
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducerCreate a TableGroupJoin.- Specified by:
createTableGroupJoinin interfaceTableGroupJoinProducer- Parameters:
navigablePath- The NavigablePath to the joinlhs- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase- A specific SqlAliasBase to use. May benullindicating one should be created using the SqlAliasBaseGenerator fromcreationStaterequestedJoinType- 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)
-
createRootTableGroupJoin
public TableGroup createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType sqlAstJoinType, boolean fetched, @Nullable Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducerCreate 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:
createRootTableGroupJoinin interfaceTableGroupJoinProducer- Parameters:
navigablePath- The NavigablePath to the joinlhs- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase- A specific SqlAliasBase to use. May benullindicating one should be created using the SqlAliasBaseGenerator fromcreationStatesqlAstJoinType- 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.
-
getSqlAliasStem
public String getSqlAliasStem()
Description copied from interface:TableGroupProducerGet 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:
getSqlAliasStemin interfaceTableGroupProducer- See Also:
SqlAliasBaseManager.createSqlAliasBase(java.lang.String)
-
asEmbeddedAttributeMapping
public EmbeddedAttributeMapping asEmbeddedAttributeMapping()
Description copied from interface:AttributeMappingA utility method to avoid casting explicitly to EmbeddedAttributeMapping- Specified by:
asEmbeddedAttributeMappingin interfaceAttributeMapping- Returns:
- EmbeddedAttributeMapping if this is an instance of EmbeddedAttributeMapping otherwise
null
-
isEmbeddedAttributeMapping
public boolean isEmbeddedAttributeMapping()
- Specified by:
isEmbeddedAttributeMappingin interfaceAttributeMapping
-
isSelectable
public boolean isSelectable()
- Specified by:
isSelectablein interfaceFetchable
-
containsTableReference
public boolean containsTableReference(String tableExpression)
- Specified by:
containsTableReferencein interfaceTableGroupProducer
-
compare
public int compare(Object value1, Object value2)
- Specified by:
comparein interfaceAttributeMapping
-
-