Class EmbeddedForeignKeyDescriptor
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.EmbeddedForeignKeyDescriptor
-
- All Implemented Interfaces:
Bindable
,ForeignKeyDescriptor
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,ValueMapping
,VirtualModelPart
,JavaTypedExpressible
public class EmbeddedForeignKeyDescriptor extends Object implements ForeignKeyDescriptor
-
-
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.ForeignKeyDescriptor
ForeignKeyDescriptor.Nature, ForeignKeyDescriptor.Side
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueConsumer
-
-
Field Summary
-
Fields inherited from interface org.hibernate.metamodel.mapping.ForeignKeyDescriptor
PART_NAME, TARGET_PART_NAME
-
-
Constructor Summary
Constructors Constructor Description EmbeddedForeignKeyDescriptor(EmbeddableValuedModelPart keyMappingType, EmbeddableValuedModelPart targetMappingType, String keyTable, SelectableMappings keySelectableMappings, String targetTable, SelectableMappings targetSelectableMappings, boolean hasConstraint, MappingModelCreationProcess creationProcess)
-
Method Summary
-
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, forEachJdbcValue, getJdbcMappings, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.metamodel.mapping.ForeignKeyDescriptor
forEachSelectable, getPart, getPartName, getSide, getTable, visitKeySelectables, visitTargetSelectables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, forEachSelectable
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Constructor Detail
-
EmbeddedForeignKeyDescriptor
public EmbeddedForeignKeyDescriptor(EmbeddableValuedModelPart keyMappingType, EmbeddableValuedModelPart targetMappingType, String keyTable, SelectableMappings keySelectableMappings, String targetTable, SelectableMappings targetSelectableMappings, boolean hasConstraint, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
getKeyTable
public String getKeyTable()
- Specified by:
getKeyTable
in interfaceForeignKeyDescriptor
-
getTargetTable
public String getTargetTable()
- Specified by:
getTargetTable
in interfaceForeignKeyDescriptor
-
getKeyPart
public ModelPart getKeyPart()
- Specified by:
getKeyPart
in interfaceForeignKeyDescriptor
-
getTargetPart
public ModelPart getTargetPart()
- Specified by:
getTargetPart
in interfaceForeignKeyDescriptor
-
getKeySide
public ForeignKeyDescriptor.Side getKeySide()
- Specified by:
getKeySide
in interfaceForeignKeyDescriptor
-
getTargetSide
public ForeignKeyDescriptor.Side getTargetSide()
- Specified by:
getTargetSide
in interfaceForeignKeyDescriptor
-
withKeySelectionMapping
public ForeignKeyDescriptor withKeySelectionMapping(ManagedMappingType declaringType, TableGroupProducer declaringTableGroupProducer, IntFunction<SelectableMapping> selectableMappingAccess, MappingModelCreationProcess creationProcess)
Description copied from interface:ForeignKeyDescriptor
Return a copy of this foreign key descriptor with the selectable mappings as provided by the given accessor.- Specified by:
withKeySelectionMapping
in interfaceForeignKeyDescriptor
-
createKeyDomainResult
public DomainResult<?> createKeyDomainResult(NavigablePath navigablePath, TableGroup tableGroup, FetchParent fetchParent, DomainResultCreationState creationState)
Description copied from interface:ForeignKeyDescriptor
Create a DomainResult for the referring-side of the fk- Specified by:
createKeyDomainResult
in interfaceForeignKeyDescriptor
-
createTargetDomainResult
public DomainResult<?> createTargetDomainResult(NavigablePath navigablePath, TableGroup tableGroup, FetchParent fetchParent, DomainResultCreationState creationState)
Description copied from interface:ForeignKeyDescriptor
Create a DomainResult for the target-side of the fk- Specified by:
createTargetDomainResult
in interfaceForeignKeyDescriptor
-
createDomainResult
public DomainResult<?> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, ForeignKeyDescriptor.Nature side, FetchParent fetchParent, DomainResultCreationState creationState)
- Specified by:
createDomainResult
in interfaceForeignKeyDescriptor
-
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 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 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 interfaceModelPart
-
generateJoinPredicate
public Predicate generateJoinPredicate(TableGroup targetSideTableGroup, TableGroup keySideTableGroup, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)
- Specified by:
generateJoinPredicate
in interfaceForeignKeyDescriptor
-
generateJoinPredicate
public Predicate generateJoinPredicate(TableReference targetSideReference, TableReference keySideReference, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)
- Specified by:
generateJoinPredicate
in interfaceForeignKeyDescriptor
-
isSimpleJoinPredicate
public boolean isSimpleJoinPredicate(Predicate predicate)
- Specified by:
isSimpleJoinPredicate
in interfaceForeignKeyDescriptor
-
visitKeySelectables
public int visitKeySelectables(int offset, SelectableConsumer consumer)
- Specified by:
visitKeySelectables
in interfaceForeignKeyDescriptor
-
visitTargetSelectables
public int visitTargetSelectables(int offset, SelectableConsumer consumer)
- Specified by:
visitTargetSelectables
in interfaceForeignKeyDescriptor
-
hasConstraint
public boolean hasConstraint()
- Specified by:
hasConstraint
in interfaceForeignKeyDescriptor
-
getAssociationKey
public AssociationKey getAssociationKey()
- Specified by:
getAssociationKey
in interfaceForeignKeyDescriptor
-
getMappedType
public MappingType getMappedType()
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
getPartMappingType
public MappingType getPartMappingType()
- Specified by:
getPartMappingType
in interfaceModelPart
-
getJavaType
public JavaType<?> getJavaType()
- Specified by:
getJavaType
in interfaceModelPart
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRole
in interfaceModelPart
- See Also:
ModelPart.getPartName()
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
getAssociationKeyFromSide
public Object getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Nature nature, SharedSessionContractImplementor session)
- Specified by:
getAssociationKeyFromSide
in interfaceForeignKeyDescriptor
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
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
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValue
in interfaceBindable
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemble
in interfaceBindable
- See Also:
As an example, consider the following domain model: ````
-
-