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 class
ForeignKeyDescriptor.Nature
static interface
ForeignKeyDescriptor.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 String
PART_NAME
static String
TARGET_PART_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
compare(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 int
forEachSelectable(int offset, SelectableConsumer consumer)
Visits the FK "referring" columnsPredicate
generateJoinPredicate(TableGroup targetSideTableGroup, TableGroup keySideTableGroup, SqlAstCreationState creationState)
Predicate
generateJoinPredicate(TableReference targetSideReference, TableReference keySideReference, SqlAstCreationState creationState)
AssociationKey
getAssociationKey()
default Object
getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Nature nature, SharedSessionContractImplementor session)
Object
getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Side side, SharedSessionContractImplementor session)
default String
getContainingTableExpression()
The table which contains the columns mapped by this valueValuedModelPart
getKeyPart()
ForeignKeyDescriptor.Side
getKeySide()
String
getKeyTable()
default ValuedModelPart
getPart(ForeignKeyDescriptor.Nature nature)
default String
getPartName()
The local part name, which is generally the unqualified role nameSelectableMapping
getSelectable(int columnIndex)
Get the selectable at the given positiondefault ForeignKeyDescriptor.Side
getSide(ForeignKeyDescriptor.Nature nature)
ValuedModelPart
getTargetPart()
ForeignKeyDescriptor.Side
getTargetSide()
String
getTargetTable()
boolean
hasConstraint()
boolean
isEmbedded()
boolean
isKeyPart(ValuedModelPart modelPart)
boolean
isSimpleJoinPredicate(Predicate predicate)
int
visitKeySelectables(int offset, SelectableConsumer consumer)
default int
visitKeySelectables(SelectableConsumer consumer)
int
visitTargetSelectables(int offset, SelectableConsumer consumer)
default int
visitTargetSelectables(SelectableConsumer consumer)
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.ForeignKeyDescriptor
withTargetPart(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:ModelPart
The local part name, which is generally the unqualified role name- Specified by:
getPartName
in 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:ValuedModelPart
The table which contains the columns mapped by this value- Specified by:
getContainingTableExpression
in 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.Nature
is 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:
createDomainResult
in 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:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
forEachSelectable
default int forEachSelectable(int offset, SelectableConsumer consumer)
Visits the FK "referring" columns- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in 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()
-
-