Package org.hibernate.metamodel.mapping
Interface ForeignKeyDescriptor
-
- All Superinterfaces:
Bindable,JavaTypedExpressible,JdbcMappingContainer,MappingModelExpressible,ModelPart,SelectableMappings,ValuedModelPart,ValueMapping,VirtualModelPart
- All Known Implementing Classes:
EmbeddedForeignKeyDescriptor,SimpleForeignKeyDescriptor
public interface ForeignKeyDescriptor extends VirtualModelPart, ValuedModelPart
Descriptor for foreign-keys
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classForeignKeyDescriptor.Naturestatic interfaceForeignKeyDescriptor.Side-
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
-
-
Field Summary
Fields Modifier and Type Field Description static StringPART_NAMEstatic StringTARGET_PART_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intcompare(Object key1, Object key2)Compare the 2 values<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for the referring-side of the fk The table group must be the one containing the target.DomainResult<?>createKeyDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, ForeignKeyDescriptor.Nature fromSide, FetchParent fetchParent, DomainResultCreationState creationState)Create a DomainResult for the referring-side of the fk The table group must be the one containing the target.DomainResult<?>createKeyDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)Create a DomainResult for the referring-side of the fk The table group must be the one containing the target.DomainResult<?>createTargetDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)Create a DomainResult for the target-side of the fk The table group must be the one containing the targetdefault intforEachSelectable(int offset, SelectableConsumer consumer)Visits the FK "referring" columnsPredicategenerateJoinPredicate(TableGroup targetSideTableGroup, TableGroup keySideTableGroup, SqlAstCreationState creationState)PredicategenerateJoinPredicate(TableReference targetSideReference, TableReference keySideReference, SqlAstCreationState creationState)AssociationKeygetAssociationKey()default ObjectgetAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Nature nature, SharedSessionContractImplementor session)ObjectgetAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Side side, SharedSessionContractImplementor session)default StringgetContainingTableExpression()The table which contains the columns mapped by this valueValuedModelPartgetKeyPart()ForeignKeyDescriptor.SidegetKeySide()StringgetKeyTable()default ValuedModelPartgetPart(ForeignKeyDescriptor.Nature nature)default StringgetPartName()The local part name, which is generally the unqualified role nameSelectableMappinggetSelectable(int columnIndex)Get the selectable at the given positiondefault ForeignKeyDescriptor.SidegetSide(ForeignKeyDescriptor.Nature nature)ValuedModelPartgetTargetPart()ForeignKeyDescriptor.SidegetTargetSide()StringgetTargetTable()booleanhasConstraint()booleanisEmbedded()booleanisKeyPart(ValuedModelPart modelPart)booleanisSimpleJoinPredicate(Predicate predicate)intvisitKeySelectables(int offset, SelectableConsumer consumer)default intvisitKeySelectables(SelectableConsumer consumer)intvisitTargetSelectables(int offset, SelectableConsumer consumer)default intvisitTargetSelectables(SelectableConsumer consumer)ForeignKeyDescriptorwithKeySelectionMapping(ManagedMappingType declaringType, TableGroupProducer declaringTableGroupProducer, IntFunction<SelectableMapping> selectableMappingAccess, MappingModelCreationProcess creationProcess)Return a copy of this foreign key descriptor with the selectable mappings as provided by the given accessor.ForeignKeyDescriptorwithTargetPart(ValuedModelPart targetPart)Return a copy of this foreign key descriptor with the target part as given by the argument.-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
addToCacheKey, disassemble, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaTypedExpressible
addToCacheKey
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
forEachJdbcType, getJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
applySqlSelections, applySqlSelections, areEqual, asAttributeMapping, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, breakDownJdbcValues, decompose, decompose, findContainingEntityMapping, getJavaType, getNavigableRole, getPartMappingType, hasPartitionedSelectionMapping, isEntityIdentifierMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachNonFormula, forEachSelectable, forEachUpdatable, getJdbcTypeCount, getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, getMappedType, treatAs
-
Methods inherited from interface org.hibernate.metamodel.mapping.VirtualModelPart
isVirtual
-
-
-
-
Field Detail
-
PART_NAME
static final String PART_NAME
- See Also:
- Constant Field Values
-
TARGET_PART_NAME
static final String TARGET_PART_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPartName
default String getPartName()
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein interfaceModelPart
-
getKeyTable
String getKeyTable()
-
getTargetTable
String getTargetTable()
-
getKeyPart
ValuedModelPart getKeyPart()
-
getTargetPart
ValuedModelPart getTargetPart()
-
isKeyPart
boolean isKeyPart(ValuedModelPart modelPart)
-
getPart
default ValuedModelPart getPart(ForeignKeyDescriptor.Nature nature)
-
getKeySide
ForeignKeyDescriptor.Side getKeySide()
-
getTargetSide
ForeignKeyDescriptor.Side getTargetSide()
-
getSide
default ForeignKeyDescriptor.Side getSide(ForeignKeyDescriptor.Nature nature)
-
getContainingTableExpression
default String getContainingTableExpression()
Description copied from interface:ValuedModelPartThe table which contains the columns mapped by this value- Specified by:
getContainingTableExpressionin interfaceValuedModelPart
-
createKeyDomainResult
DomainResult<?> createKeyDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)
Create a DomainResult for the referring-side of the fk The table group must be the one containing the target.
-
createKeyDomainResult
DomainResult<?> createKeyDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, ForeignKeyDescriptor.Nature fromSide, FetchParent fetchParent, DomainResultCreationState creationState)
Create a DomainResult for the referring-side of the fk The table group must be the one containing the target. TheForeignKeyDescriptor.Natureis the association side of the foreign key i.e.Association.getSideNature().
-
createTargetDomainResult
DomainResult<?> createTargetDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)
Create a DomainResult for the target-side of the fk The table group must be the one containing the target
-
createDomainResult
<T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, String resultVariable, DomainResultCreationState creationState)
Create a DomainResult for the referring-side of the fk The table group must be the one containing the target.- Specified by:
createDomainResultin interfaceModelPart
-
generateJoinPredicate
Predicate generateJoinPredicate(TableGroup targetSideTableGroup, TableGroup keySideTableGroup, SqlAstCreationState creationState)
-
generateJoinPredicate
Predicate generateJoinPredicate(TableReference targetSideReference, TableReference keySideReference, SqlAstCreationState creationState)
-
isSimpleJoinPredicate
boolean isSimpleJoinPredicate(Predicate predicate)
-
getSelectable
SelectableMapping getSelectable(int columnIndex)
Description copied from interface:SelectableMappingsGet the selectable at the given position- Specified by:
getSelectablein interfaceSelectableMappings
-
forEachSelectable
default int forEachSelectable(int offset, SelectableConsumer consumer)Visits the FK "referring" columns- Specified by:
forEachSelectablein interfaceModelPart- Specified by:
forEachSelectablein interfaceSelectableMappings- Specified by:
forEachSelectablein interfaceValuedModelPart- See Also:
SelectableConsumer.accept(int, SelectableMapping)
-
getAssociationKeyFromSide
default Object getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Nature nature, SharedSessionContractImplementor session)
-
getAssociationKeyFromSide
Object getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Side side, SharedSessionContractImplementor session)
-
visitKeySelectables
int visitKeySelectables(int offset, SelectableConsumer consumer)
-
visitKeySelectables
default int visitKeySelectables(SelectableConsumer consumer)
-
visitTargetSelectables
int visitTargetSelectables(int offset, SelectableConsumer consumer)
-
visitTargetSelectables
default int visitTargetSelectables(SelectableConsumer consumer)
-
withKeySelectionMapping
ForeignKeyDescriptor withKeySelectionMapping(ManagedMappingType declaringType, TableGroupProducer declaringTableGroupProducer, IntFunction<SelectableMapping> selectableMappingAccess, MappingModelCreationProcess creationProcess)
Return a copy of this foreign key descriptor with the selectable mappings as provided by the given accessor.
-
withTargetPart
ForeignKeyDescriptor withTargetPart(ValuedModelPart targetPart)
Return a copy of this foreign key descriptor with the target part as given by the argument.
-
getAssociationKey
AssociationKey getAssociationKey()
-
hasConstraint
boolean hasConstraint()
-
isEmbedded
boolean isEmbedded()
-
-