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:
getKeyTablein interfaceForeignKeyDescriptor
-
getTargetTable
public String getTargetTable()
- Specified by:
getTargetTablein interfaceForeignKeyDescriptor
-
getKeyPart
public ModelPart getKeyPart()
- Specified by:
getKeyPartin interfaceForeignKeyDescriptor
-
getTargetPart
public ModelPart getTargetPart()
- Specified by:
getTargetPartin interfaceForeignKeyDescriptor
-
getKeySide
public ForeignKeyDescriptor.Side getKeySide()
- Specified by:
getKeySidein interfaceForeignKeyDescriptor
-
getTargetSide
public ForeignKeyDescriptor.Side getTargetSide()
- Specified by:
getTargetSidein interfaceForeignKeyDescriptor
-
withKeySelectionMapping
public ForeignKeyDescriptor withKeySelectionMapping(ManagedMappingType declaringType, TableGroupProducer declaringTableGroupProducer, IntFunction<SelectableMapping> selectableMappingAccess, MappingModelCreationProcess creationProcess)
Description copied from interface:ForeignKeyDescriptorReturn a copy of this foreign key descriptor with the selectable mappings as provided by the given accessor.- Specified by:
withKeySelectionMappingin interfaceForeignKeyDescriptor
-
createKeyDomainResult
public DomainResult<?> createKeyDomainResult(NavigablePath navigablePath, TableGroup tableGroup, FetchParent fetchParent, DomainResultCreationState creationState)
Description copied from interface:ForeignKeyDescriptorCreate a DomainResult for the referring-side of the fk- Specified by:
createKeyDomainResultin interfaceForeignKeyDescriptor
-
createTargetDomainResult
public DomainResult<?> createTargetDomainResult(NavigablePath navigablePath, TableGroup tableGroup, FetchParent fetchParent, DomainResultCreationState creationState)
Description copied from interface:ForeignKeyDescriptorCreate a DomainResult for the target-side of the fk- Specified by:
createTargetDomainResultin interfaceForeignKeyDescriptor
-
createDomainResult
public DomainResult<?> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, ForeignKeyDescriptor.Nature side, FetchParent fetchParent, DomainResultCreationState creationState)
- Specified by:
createDomainResultin interfaceForeignKeyDescriptor
-
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
-
generateJoinPredicate
public Predicate generateJoinPredicate(TableGroup targetSideTableGroup, TableGroup keySideTableGroup, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)
- Specified by:
generateJoinPredicatein interfaceForeignKeyDescriptor
-
generateJoinPredicate
public Predicate generateJoinPredicate(TableReference targetSideReference, TableReference keySideReference, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)
- Specified by:
generateJoinPredicatein interfaceForeignKeyDescriptor
-
isSimpleJoinPredicate
public boolean isSimpleJoinPredicate(Predicate predicate)
- Specified by:
isSimpleJoinPredicatein interfaceForeignKeyDescriptor
-
visitKeySelectables
public int visitKeySelectables(int offset, SelectableConsumer consumer)- Specified by:
visitKeySelectablesin interfaceForeignKeyDescriptor
-
visitTargetSelectables
public int visitTargetSelectables(int offset, SelectableConsumer consumer)- Specified by:
visitTargetSelectablesin interfaceForeignKeyDescriptor
-
hasConstraint
public boolean hasConstraint()
- Specified by:
hasConstraintin interfaceForeignKeyDescriptor
-
getAssociationKey
public AssociationKey getAssociationKey()
- Specified by:
getAssociationKeyin interfaceForeignKeyDescriptor
-
getMappedType
public MappingType getMappedType()
Description copied from interface:ValueMappingDescriptor for the type of this mapping- Specified by:
getMappedTypein interfaceValueMapping
-
getPartMappingType
public MappingType getPartMappingType()
- Specified by:
getPartMappingTypein interfaceModelPart
-
getJavaType
public JavaType<?> getJavaType()
- Specified by:
getJavaTypein interfaceModelPart
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValuesin interfaceModelPart
-
getAssociationKeyFromSide
public Object getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Nature nature, SharedSessionContractImplementor session)
- Specified by:
getAssociationKeyFromSidein interfaceForeignKeyDescriptor
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValuein interfaceBindable
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemblein interfaceBindable- See Also:
As an example, consider the following domain model: ````
-
-