Top Description Inners Fields Methods
org.hibernate.metamodel.mapping

public Interface ForeignKeyDescriptor

extends VirtualModelPart, ValuedModelPart
Known Direct Implementers
org.hibernate.metamodel.mapping.internal.EmbeddedForeignKeyDescriptor, org.hibernate.metamodel.mapping.internal.SimpleForeignKeyDescriptor
Imports
java.util.function.IntFunction, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.spi.SqlAstCreationState, org.hibernate.sql.ast.tree.from.TableGroup, .TableGroupProducer, .TableReference, org.hibernate.sql.ast.tree.predicate.Predicate, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .FetchParent

Descriptor for foreign-keys

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static interface

Field Summary

Modifier and TypeField and Description
public static final String
public static final String

Method Summary

Modifier and TypeMethod and Description
public int
compare(Object key1, Object key2)

Compare the 2 values

public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, String resultVariable, DomainResultCreationState creationState)

Redeclares org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for the referring-side of the fk The table group must be the one containing the target.
public 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.

public 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.

public 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

public default int
public Predicate
generateJoinPredicate(TableGroup targetSideTableGroup, TableGroup keySideTableGroup, SqlAstCreationState creationState)

public Predicate
generateJoinPredicate(TableReference targetSideReference, TableReference keySideReference, SqlAstCreationState creationState)

public AssociationKey
public default Object
public Object
public default String
getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

The table which contains the columns mapped by this value
public ValuedModelPart
public ForeignKeyDescriptor.Side
public String
public default ValuedModelPart
public default String
getPartName()

Implements org.hibernate.metamodel.mapping.ModelPart.getPartName.

The local part name, which is generally the unqualified role name
public SelectableMapping
getSelectable(int columnIndex)

Redeclares org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Get the selectable at the given position
public default ForeignKeyDescriptor.Side
public ValuedModelPart
public ForeignKeyDescriptor.Side
public String
public boolean
public boolean
public boolean
public boolean
public int
public default int
public int
public default int
public 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.

public ForeignKeyDescriptor
withTargetPart(ValuedModelPart targetPart)

Return a copy of this foreign key descriptor with the target part as given by the argument.

Inherited from org.hibernate.metamodel.mapping.ValuedModelPart:
forEachInsertableforEachNonFormulaforEachSelectableforEachUpdatablegetJdbcTypeCountgetSingleJdbcMapping
Inherited from org.hibernate.metamodel.mapping.VirtualModelPart:
isVirtual

Field Detail

PART_NAMEback to summary
public static final String PART_NAME
TARGET_PART_NAMEback to summary
public static final String TARGET_PART_NAME

Method Detail

compareback to summary
public int compare(Object key1, Object key2)

Compare the 2 values

createDomainResultback to summary
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, String resultVariable, DomainResultCreationState creationState)

Redeclares org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for the referring-side of the fk The table group must be the one containing the target.

Annotations
@Override
createKeyDomainResultback to summary
public 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.

createKeyDomainResultback to summary
public 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. The Nature is the association side of the foreign key i.e. Association#getSideNature().

createTargetDomainResultback to summary
public 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

forEachSelectableback to summary
public default int forEachSelectable(int offset, SelectableConsumer consumer)

Overrides default org.hibernate.metamodel.mapping.ModelPart.forEachSelectable, org.hibernate.metamodel.mapping.ValuedModelPart.forEachSelectable.

Visits the FK "referring" columns

Annotations
@Override
generateJoinPredicateback to summary
public Predicate generateJoinPredicate(TableGroup targetSideTableGroup, TableGroup keySideTableGroup, SqlAstCreationState creationState)
generateJoinPredicateback to summary
public Predicate generateJoinPredicate(TableReference targetSideReference, TableReference keySideReference, SqlAstCreationState creationState)
getAssociationKeyback to summary
public AssociationKey getAssociationKey()
getAssociationKeyFromSideback to summary
public default Object getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Nature nature, SharedSessionContractImplementor session)
getAssociationKeyFromSideback to summary
public Object getAssociationKeyFromSide(Object targetObject, ForeignKeyDescriptor.Side side, SharedSessionContractImplementor session)
getContainingTableExpressionback to summary
public default String getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

Doc from org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

The table which contains the columns mapped by this value

Annotations
@Override
getKeyPartback to summary
public ValuedModelPart getKeyPart()
getKeySideback to summary
public ForeignKeyDescriptor.Side getKeySide()
getKeyTableback to summary
public String getKeyTable()
getPartback to summary
public default ValuedModelPart getPart(ForeignKeyDescriptor.Nature nature)
getPartNameback to summary
public default String getPartName()

Implements org.hibernate.metamodel.mapping.ModelPart.getPartName.

Doc from org.hibernate.metamodel.mapping.ModelPart.getPartName.

The local part name, which is generally the unqualified role name

Annotations
@Override
getSelectableback to summary
public SelectableMapping getSelectable(int columnIndex)

Redeclares org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Get the selectable at the given position

Annotations
@Override
getSideback to summary
public default ForeignKeyDescriptor.Side getSide(ForeignKeyDescriptor.Nature nature)
getTargetPartback to summary
public ValuedModelPart getTargetPart()
getTargetSideback to summary
public ForeignKeyDescriptor.Side getTargetSide()
getTargetTableback to summary
public String getTargetTable()
hasConstraintback to summary
public boolean hasConstraint()
isEmbeddedback to summary
public boolean isEmbedded()
isKeyPartback to summary
public boolean isKeyPart(ValuedModelPart modelPart)
isSimpleJoinPredicateback to summary
public boolean isSimpleJoinPredicate(Predicate predicate)
visitKeySelectablesback to summary
public int visitKeySelectables(int offset, SelectableConsumer consumer)
visitKeySelectablesback to summary
public default int visitKeySelectables(SelectableConsumer consumer)
visitTargetSelectablesback to summary
public int visitTargetSelectables(int offset, SelectableConsumer consumer)
visitTargetSelectablesback to summary
public default int visitTargetSelectables(SelectableConsumer consumer)
withKeySelectionMappingback to summary
public 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.

withTargetPartback to summary
public ForeignKeyDescriptor withTargetPart(ValuedModelPart targetPart)

Return a copy of this foreign key descriptor with the target part as given by the argument.

org.hibernate.metamodel.mapping back to summary

public final Enum ForeignKeyDescriptor.Nature

extends Enum<ForeignKeyDescriptor.Nature>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ForeignKeyDescriptor.Nature
public static final ForeignKeyDescriptor.Nature

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ForeignKeyDescriptor.Nature
public static ForeignKeyDescriptor.Nature
public static ForeignKeyDescriptor.Nature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

KEYback to summary
public static final ForeignKeyDescriptor.Nature KEY
TARGETback to summary
public static final ForeignKeyDescriptor.Nature TARGET

Constructor Detail

Natureback to summary
private Nature()

Method Detail

inverseback to summary
public ForeignKeyDescriptor.Nature inverse()
valueOfback to summary
public static ForeignKeyDescriptor.Nature valueOf(String name)
valuesback to summary
public static ForeignKeyDescriptor.Nature[] values()
org.hibernate.metamodel.mapping back to summary

public Interface ForeignKeyDescriptor.Side

Known Direct Implementers
org.hibernate.metamodel.mapping.internal.EmbeddedForeignKeyDescriptorSide, org.hibernate.metamodel.mapping.internal.SimpleForeignKeyDescriptorSide

Method Summary

Modifier and TypeMethod and Description
public ValuedModelPart
public ForeignKeyDescriptor.Nature

Method Detail

getModelPartback to summary
public ValuedModelPart getModelPart()
getNatureback to summary
public ForeignKeyDescriptor.Nature getNature()