Top Fields Constructors Methods
org.hibernate.metamodel.mapping.internal

public Class SimpleForeignKeyDescriptor

extends Object
implements ForeignKeyDescriptor, BasicValuedModelPart, FetchOptions
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.results.graph.FetchOptions, org.hibernate.sql.results.graph.FetchStyleAccess, org.hibernate.sql.results.graph.FetchTimingAccess, org.hibernate.metamodel.mapping.BasicValuedModelPart, org.hibernate.metamodel.mapping.SelectableMapping, org.hibernate.metamodel.mapping.SqlTypedMapping, org.hibernate.sql.results.graph.Fetchable, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.ValuedModelPart, org.hibernate.metamodel.mapping.SelectableMappings, org.hibernate.metamodel.mapping.ValueMapping, org.hibernate.type.descriptor.java.JavaTypedExpressible, org.hibernate.metamodel.mapping.BasicValuedMapping, org.hibernate.metamodel.mapping.SqlExpressible, org.hibernate.metamodel.mapping.ForeignKeyDescriptor, org.hibernate.metamodel.mapping.VirtualModelPart
Imports
java.util.Collections, .List, .Locale, java.util.function.BiConsumer, .IntFunction, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.engine.internal.CacheHelper, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.util.IndexedConsumer, org.hibernate.metamodel.mapping.AssociationKey, .BasicValuedModelPart, .EntityIdentifierMapping, .EntityMappingType, .ForeignKeyDescriptor, .JdbcMapping, .JdbcMappingContainer, .ManagedMappingType, .MappingType, .ModelPart, .PropertyBasedMapping, .SelectableConsumer, .SelectableMapping, .ValuedModelPart, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.property.access.spi.PropertyAccess, org.hibernate.proxy.HibernateProxy, .LazyInitializer, org.hibernate.query.sqm.ComparisonOperator, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.spi.SqlAstCreationState, .SqlExpressionResolver, .SqlSelection, org.hibernate.sql.ast.tree.expression.ColumnReference, .Expression, org.hibernate.sql.ast.tree.from.OneToManyTableGroup, .TableGroup, .TableGroupProducer, .TableReference, .UnknownTableReferenceException, .VirtualTableGroup, org.hibernate.sql.ast.tree.predicate.ComparisonPredicate, .Predicate, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .Fetch, .FetchOptions, .FetchParent, org.hibernate.sql.results.graph.basic.BasicResult, org.hibernate.type.descriptor.java.JavaType

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private AssociationKey
private final boolean
private final SimpleForeignKeyDescriptorSide
private final boolean
private final SimpleForeignKeyDescriptorSide

Constructor Summary

AccessConstructor and Description
public
SimpleForeignKeyDescriptor(ManagedMappingType keyDeclaringType, BasicValuedModelPart keyModelPart, PropertyAccess keyPropertyAccess, SelectableMapping keySelectableMapping, BasicValuedModelPart targetModelPart, boolean insertable, boolean updateable, boolean refersToPrimaryKey, boolean hasConstraint)

public
SimpleForeignKeyDescriptor(BasicValuedModelPart keyModelPart, BasicValuedModelPart targetModelPart, boolean refersToPrimaryKey, boolean hasConstraint, boolean swapDirection)

public
SimpleForeignKeyDescriptor(ManagedMappingType keyDeclaringType, SelectableMapping keySelectableMapping, BasicValuedModelPart targetModelPart, boolean refersToPrimaryKey, boolean hasConstraint)

public
SimpleForeignKeyDescriptor(ManagedMappingType keyDeclaringType, SelectableMapping keySelectableMapping, PropertyAccess valueAccess, BasicValuedModelPart targetModelPart, boolean refersToPrimaryKey, boolean hasConstraint, boolean swapDirection)

Method Summary

Modifier and TypeMethod and Description
public void
addToCacheKey(MutableCacheKeyBuilder
the MutableCacheKey used to add the disassembled value and the hashCode
cacheKey
,
Object
the value to disassemble
value
,
SharedSessionContractImplementor
the SharedSessionContractImplementor
session
)

Overrides default org.hibernate.metamodel.mapping.BasicValuedMapping.addToCacheKey.

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey, org.hibernate.type.descriptor.java.JavaTypedExpressible.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public <X, Y> int
breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Breaks down the domain value to its constituent JDBC values.
public int
public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ForeignKeyDescriptor.createDomainResult, 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.
private <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, BasicValuedModelPart selectableMapping, FetchParent fetchParent, DomainResultCreationState creationState)

public DomainResult<?>
createKeyDomainResult(NavigablePath navigablePath, TableGroup targetTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ForeignKeyDescriptor.createKeyDomainResult.

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)

Implements org.hibernate.metamodel.mapping.ForeignKeyDescriptor.createKeyDomainResult.

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)

Implements org.hibernate.metamodel.mapping.ForeignKeyDescriptor.createTargetDomainResult.

Create a DomainResult for the target-side of the fk The table group must be the one containing the target
public Object
public EntityMappingType
public <X, Y> int
public int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each JdbcMapping starting from the given offset
public <X, Y> int
forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Visit each constituent JDBC value extracted from the entity instance itself.
public int
public Fetch
generateFetch(FetchParent
The parent of the Fetch we are generating
fetchParent
,
NavigablePath
The overall path within the graph
fetchablePath
,
FetchTiming
The requested fetch timing
fetchTiming
,
boolean selected, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetchable.generateFetch.

Generates a Fetch of this fetchable
public Predicate
public Predicate
public AssociationKey
public Object
public String
public String
public String
getCustomReadExpression()

Implements org.hibernate.metamodel.mapping.SelectableMapping.getCustomReadExpression.

The selection's read expression accounting for formula treatment as well as ColumnTransformer#read()
public String
public int
public String
public JavaType<?>
getJavaType()

Implements org.hibernate.metamodel.mapping.ModelPart.getJavaType.

The Java type for this part.
public JdbcMapping
public JdbcMapping
public BasicValuedModelPart
public ForeignKeyDescriptor.Side
public String
public Long
public FetchOptions
public MappingType
getMappedType()

Implements org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Descriptor for the type of this mapping
public NavigableRole
public MappingType
public Integer
public Integer
public SelectableMapping
public String
public JdbcMapping
public FetchStyle
public BasicValuedModelPart
public ForeignKeyDescriptor.Side
public String
public FetchTiming
private static TableGroup
public boolean
public boolean
public boolean
isFormula()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isFormula.

Is the mapping a formula instead of a physical column?
public boolean
public boolean
public boolean
isNullable()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isNullable.

Is the mapping considered nullable?
public boolean
public boolean
private boolean
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public int
public int
public ForeignKeyDescriptor
withKeySelectionMapping(ManagedMappingType declaringType, TableGroupProducer declaringTableGroupProducer, IntFunction<SelectableMapping> selectableMappingAccess, MappingModelCreationProcess creationProcess)

Implements org.hibernate.metamodel.mapping.ForeignKeyDescriptor.withKeySelectionMapping.

Return a copy of this foreign key descriptor with the selectable mappings as provided by the given accessor.
public ForeignKeyDescriptor
withTargetPart(ValuedModelPart targetPart)

Implements org.hibernate.metamodel.mapping.ForeignKeyDescriptor.withTargetPart.

Return a copy of this foreign key descriptor with the target part as given by the argument.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait