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

public Class DiscriminatedAssociationMapping

extends Object
implements MappingType, 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.MappingType
Imports
java.util.Iterator, .Locale, org.hibernate.dialect.Dialect, org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.engine.spi.SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.mapping.Any, .Column, .Selectable, org.hibernate.metamodel.mapping.BasicValuedModelPart, .DiscriminatedAssociationModelPart, .DiscriminatorMapping, .DiscriminatorValueDetails, .EntityIdentifierMapping, .EntityMappingType, .MappingType, .ModelPart, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.tree.from.TableGroup, org.hibernate.sql.results.graph.AssemblerCreationState, .DomainResult, .DomainResultAssembler, .DomainResultCreationState, .DomainResultGraphNode, .Fetch, .FetchOptions, .FetchParent, .FetchParentAccess, .Fetchable, org.hibernate.sql.results.graph.internal.ImmutableFetchList, org.hibernate.sql.results.jdbc.spi.JdbcValuesSourceProcessingOptions, .RowProcessingState, org.hibernate.type.AnyType, .BasicType, .MetaType, org.hibernate.type.descriptor.java.JavaType

Represents the "type" of an any-valued mapping
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private abstract static class

Field Summary

Modifier and TypeField and Description
private final JavaType<?>
private final AnyDiscriminatorPart
private final FetchTiming
private final BasicValuedModelPart
private final DiscriminatedAssociationModelPart
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Constructor Summary

AccessConstructor and Description
public
DiscriminatedAssociationMapping(DiscriminatedAssociationModelPart modelPart, AnyDiscriminatorPart discriminatorPart, BasicValuedModelPart keyPart, JavaType<?> baseAssociationJtd, FetchTiming fetchTiming, SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
public <X, Y> int
breakDownJdbcValues(int offset, X x, Y y, Object domainValue, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

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

public <X, Y> int
decompose(int offset, X x, Y y, Object domainValue, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

private EntityMappingType
private void
public ModelPart
public static DiscriminatedAssociationMapping
from(NavigableRole containerRole, JavaType<?> baseAssociationJtd, DiscriminatedAssociationModelPart declaringModelPart, AnyType anyType, Any bootValueMapping, MappingModelCreationProcess creationProcess)

public Fetch
generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)

public DiscriminatorMapping
public JavaType<?>
public BasicValuedModelPart
public JavaType<?>
public DiscriminatedAssociationModelPart
public MappingType
public FetchStyle
public FetchTiming
private ModelPart
public Object
public EntityMappingType
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseAssociationJtdback to summary
private final JavaType<?> baseAssociationJtd
discriminatorPartback to summary
private final AnyDiscriminatorPart discriminatorPart
fetchTimingback to summary
private final FetchTiming fetchTiming
keyPartback to summary
private final BasicValuedModelPart keyPart
modelPartback to summary
private final DiscriminatedAssociationModelPart modelPart
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Constructor Detail

DiscriminatedAssociationMappingback to summary
public DiscriminatedAssociationMapping(DiscriminatedAssociationModelPart modelPart, AnyDiscriminatorPart discriminatorPart, BasicValuedModelPart keyPart, JavaType<?> baseAssociationJtd, FetchTiming fetchTiming, SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Method Detail

breakDownJdbcValuesback to summary
public <X, Y> int breakDownJdbcValues(int offset, X x, Y y, Object domainValue, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)
createDomainResultback to summary
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
decomposeback to summary
public <X, Y> int decompose(int offset, X x, Y y, Object domainValue, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)
determineConcreteTypeback to summary
private EntityMappingType determineConcreteType(Object entity, SharedSessionContractImplementor session)
ensureMappedback to summary
private void ensureMapped(EntityMappingType treatTarget)
findSubPartback to summary
public ModelPart findSubPart(String name, EntityMappingType treatTarget)
fromback to summary
public static DiscriminatedAssociationMapping from(NavigableRole containerRole, JavaType<?> baseAssociationJtd, DiscriminatedAssociationModelPart declaringModelPart, AnyType anyType, Any bootValueMapping, MappingModelCreationProcess creationProcess)
generateFetchback to summary
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
getDiscriminatorPartback to summary
public DiscriminatorMapping getDiscriminatorPart()
getJavaTypeback to summary
public JavaType<?> getJavaType()
getKeyPartback to summary
public BasicValuedModelPart getKeyPart()
getMappedJavaTypeback to summary
public JavaType<?> getMappedJavaType()

Implements org.hibernate.metamodel.mapping.MappingType.getMappedJavaType.

Doc from org.hibernate.metamodel.mapping.MappingType.getMappedJavaType.

The descriptor descriptor for the mapped Java type

Annotations
@Override
getModelPartback to summary
public DiscriminatedAssociationModelPart getModelPart()
getPartMappingTypeback to summary
public MappingType getPartMappingType()
getStyleback to summary
public FetchStyle getStyle()

Implements org.hibernate.sql.results.graph.FetchStyleAccess.getStyle.

Annotations
@Override
getTimingback to summary
public FetchTiming getTiming()

Implements org.hibernate.sql.results.graph.FetchTimingAccess.getTiming.

Annotations
@Override
resolveAssociatedSubPartback to summary
private ModelPart resolveAssociatedSubPart(String name, EntityMappingType entityMapping)
resolveDiscriminatorValueToEntityMappingback to summary
public Object resolveDiscriminatorValueToEntityMapping(EntityMappingType entityMappingType)
resolveDiscriminatorValueToEntityMappingback to summary
public EntityMappingType resolveDiscriminatorValueToEntityMapping(Object discriminatorValue)
org.hibernate.metamodel.mapping.internal back to summary

private Class DiscriminatedAssociationMapping.AnyResultAssembler<T>

extends Object
implements DomainResultAssembler<T>
Class Inheritance
  • java.lang.Object
  • org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationMapping.AnyResultAssembler
All Implemented Interfaces
org.hibernate.sql.results.graph.DomainResultAssembler

Field Summary

Modifier and TypeField and Description
private final DomainResultAssembler<?>
private final boolean
private final DiscriminatedAssociationModelPart
private final NavigablePath
private final DomainResultAssembler<?>

Constructor Summary

AccessConstructor and Description
public
AnyResultAssembler(NavigablePath fetchedPath, DiscriminatedAssociationModelPart fetchedPart, boolean eager, DomainResultAssembler<?> discriminatorValueAssembler, DomainResultAssembler<?> keyValueAssembler)

Method Summary

Modifier and TypeMethod and Description
public T
public JavaType<T>
getAssembledJavaType()

Implements org.hibernate.sql.results.graph.DomainResultAssembler.getAssembledJavaType.

The JavaType describing the Java type that this assembler assembles.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

discriminatorValueAssemblerback to summary
private final DomainResultAssembler<?> discriminatorValueAssembler
eagerback to summary
private final boolean eager
fetchedPartback to summary
private final DiscriminatedAssociationModelPart fetchedPart
fetchedPathback to summary
private final NavigablePath fetchedPath
keyValueAssemblerback to summary
private final DomainResultAssembler<?> keyValueAssembler

Constructor Detail

AnyResultAssemblerback to summary
public AnyResultAssembler(NavigablePath fetchedPath, DiscriminatedAssociationModelPart fetchedPart, boolean eager, DomainResultAssembler<?> discriminatorValueAssembler, DomainResultAssembler<?> keyValueAssembler)

Method Detail

assembleback to summary
public T assemble(RowProcessingState rowProcessingState, JdbcValuesSourceProcessingOptions options)

Implements org.hibernate.sql.results.graph.DomainResultAssembler.assemble.

Doc from org.hibernate.sql.results.graph.DomainResultAssembler.assemble.

The main "assembly" contract. Assemble the result and return it.

Annotations
@Override
getAssembledJavaTypeback to summary
public JavaType<T> getAssembledJavaType()

Implements org.hibernate.sql.results.graph.DomainResultAssembler.getAssembledJavaType.

Doc from org.hibernate.sql.results.graph.DomainResultAssembler.getAssembledJavaType.

The JavaType describing the Java type that this assembler assembles.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.hibernate.metamodel.mapping.internal back to summary

private Class DiscriminatedAssociationMapping.AnyValuedFetch

extends AnyValuedResultGraphNode
implements Fetch
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.results.graph.Fetch, org.hibernate.sql.results.graph.DomainResultGraphNode

Field Summary

Modifier and TypeField and Description
private final FetchParent
private final FetchTiming

Constructor Summary

AccessConstructor and Description
public
AnyValuedFetch(NavigablePath navigablePath, JavaType<?> baseAssociationJtd, DiscriminatedAssociationModelPart fetchedPart, FetchTiming fetchTiming, FetchParent fetchParent, DomainResultCreationState creationState)

Method Summary

Modifier and TypeMethod and Description
public FetchParent
asFetchParent()

Overrides default org.hibernate.sql.results.graph.Fetch.asFetchParent.

Utility method to avoid instanceof checks.
public DomainResultAssembler<?>
createAssembler(FetchParentAccess parentAccess, AssemblerCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetch.createAssembler.

Create the assembler for this fetch
public DiscriminatedAssociationModelPart
public FetchParent
getFetchParent()

Implements org.hibernate.sql.results.graph.Fetch.getFetchParent.

Obtain the owner of this fetch.
public FetchTiming
public boolean
hasTableGroup()

Implements org.hibernate.sql.results.graph.Fetch.hasTableGroup.

Is the TableGroup associated with this Fetch defined?
Inherited from org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationMapping.AnyValuedResultGraphNode:
afterInitializecontainsAnyNonScalarResultscontainsCollectionFetchesfindFetchgetBaseAssociationJtdgetDiscriminatorValueFetchgetFetchesgetKeyValueFetchgetNavigablePathgetReferencedMappingContainergetReferencedMappingTypegetResultJavaTypehasJoinFetches

Field Detail

fetchParentback to summary
private final FetchParent fetchParent
fetchTimingback to summary
private final FetchTiming fetchTiming

Constructor Detail

AnyValuedFetchback to summary
public AnyValuedFetch(NavigablePath navigablePath, JavaType<?> baseAssociationJtd, DiscriminatedAssociationModelPart fetchedPart, FetchTiming fetchTiming, FetchParent fetchParent, DomainResultCreationState creationState)

Method Detail

asFetchParentback to summary
public FetchParent asFetchParent()

Overrides default org.hibernate.sql.results.graph.Fetch.asFetchParent.

Doc from org.hibernate.sql.results.graph.Fetch.asFetchParent.

Utility method to avoid instanceof checks. Returns this if it's an instance of FetchParent, null otherwise.

Annotations
@Override
createAssemblerback to summary
public DomainResultAssembler<?> createAssembler(FetchParentAccess parentAccess, AssemblerCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetch.createAssembler.

Doc from org.hibernate.sql.results.graph.Fetch.createAssembler.

Create the assembler for this fetch

Annotations
@Override
getFetchedMappingback to summary
public DiscriminatedAssociationModelPart getFetchedMapping()

Implements org.hibernate.sql.results.graph.Fetch.getFetchedMapping.

Doc from org.hibernate.sql.results.graph.Fetch.getFetchedMapping.

The value mapping being fetched

Annotations
@Override
getFetchParentback to summary
public FetchParent getFetchParent()

Implements org.hibernate.sql.results.graph.Fetch.getFetchParent.

Doc from org.hibernate.sql.results.graph.Fetch.getFetchParent.

Obtain the owner of this fetch. Ultimately used to identify the thing that "owns" this fetched navigable for the purpose of:

* identifying the associated owner reference as we process the fetch * inject the fetched instance into the parent and potentially inject the parent reference into the fetched instance if it defines such injection (e.g. org.hibernate.annotations.Parent)

Annotations
@Override
getTimingback to summary
public FetchTiming getTiming()

Implements org.hibernate.sql.results.graph.Fetch.getTiming.

Doc from org.hibernate.sql.results.graph.Fetch.getTiming.

immediate or delayed? todo (6.0) : should we also expose the fetch-style? Perhaps the fetch-options?

Annotations
@Override
hasTableGroupback to summary
public boolean hasTableGroup()

Implements org.hibernate.sql.results.graph.Fetch.hasTableGroup.

Doc from org.hibernate.sql.results.graph.Fetch.hasTableGroup.

Is the TableGroup associated with this Fetch defined?

Annotations
@Override
org.hibernate.metamodel.mapping.internal back to summary

private Class DiscriminatedAssociationMapping.AnyValuedResult<T>

extends AnyValuedResultGraphNode
implements DomainResult<T>
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.results.graph.DomainResult, org.hibernate.sql.results.graph.DomainResultGraphNode

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
AnyValuedResult(NavigablePath navigablePath, JavaType<?> baseAssociationJtd, DiscriminatedAssociationModelPart fetchedPart, String resultVariable, DomainResultCreationState creationState)

Method Summary

Modifier and TypeMethod and Description
public DomainResultAssembler<T>
createResultAssembler(FetchParentAccess parentAccess, AssemblerCreationState creationState)

Implements org.hibernate.sql.results.graph.DomainResult.createResultAssembler.

Create an assembler (and any initializers) for this result.
public String
getResultVariable()

Implements org.hibernate.sql.results.graph.DomainResult.getResultVariable.

The result-variable (alias) associated with this result.
Inherited from org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationMapping.AnyValuedResultGraphNode:
afterInitializecontainsAnyNonScalarResultscontainsCollectionFetchesfindFetchgetBaseAssociationJtdgetDiscriminatorValueFetchgetFetchesgetKeyValueFetchgetNavigablePathgetReferencedMappingContainergetReferencedMappingTypegetResultJavaTypehasJoinFetches

Field Detail

resultVariableback to summary
private final String resultVariable

Constructor Detail

AnyValuedResultback to summary
public AnyValuedResult(NavigablePath navigablePath, JavaType<?> baseAssociationJtd, DiscriminatedAssociationModelPart fetchedPart, String resultVariable, DomainResultCreationState creationState)

Method Detail

createResultAssemblerback to summary
public DomainResultAssembler<T> createResultAssembler(FetchParentAccess parentAccess, AssemblerCreationState creationState)

Implements org.hibernate.sql.results.graph.DomainResult.createResultAssembler.

Doc from org.hibernate.sql.results.graph.DomainResult.createResultAssembler.

Create an assembler (and any initializers) for this result.

Annotations
@Override
getResultVariableback to summary
public String getResultVariable()

Implements org.hibernate.sql.results.graph.DomainResult.getResultVariable.

Doc from org.hibernate.sql.results.graph.DomainResult.getResultVariable.

The result-variable (alias) associated with this result.

Annotations
@Override
org.hibernate.metamodel.mapping.internal back to summary

private abstract Class DiscriminatedAssociationMapping.AnyValuedResultGraphNode

extends Object
implements DomainResultGraphNode, FetchParent
Class Inheritance
  • java.lang.Object
  • org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationMapping.AnyValuedResultGraphNode
All Implemented Interfaces
org.hibernate.sql.results.graph.FetchParent, org.hibernate.sql.results.graph.DomainResultGraphNode
Known Direct Subclasses
org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationMapping.AnyValuedResult, org.hibernate.metamodel.mapping.internal.DiscriminatedAssociationMapping.AnyValuedFetch

Field Summary

Modifier and TypeField and Description
private final JavaType<?>
private Fetch
private ImmutableFetchList
private final DiscriminatedAssociationModelPart
private Fetch
private final NavigablePath

Constructor Summary

AccessConstructor and Description
public
AnyValuedResultGraphNode(NavigablePath navigablePath, DiscriminatedAssociationModelPart graphedPart, JavaType<?> baseAssociationJtd)

Method Summary

Modifier and TypeMethod and Description
protected void
public boolean
containsAnyNonScalarResults()

Overrides default org.hibernate.sql.results.graph.DomainResultGraphNode.containsAnyNonScalarResults.

Does this node contain any non-scalar (sub-)results?
public boolean
public Fetch
public JavaType<?>
public Fetch
public ImmutableFetchList
getFetches()

Implements org.hibernate.sql.results.graph.FetchParent.getFetches.

Retrieve the fetches owned by this fetch source.
public Fetch
public NavigablePath
public DiscriminatedAssociationModelPart
public DiscriminatedAssociationModelPart
public JavaType<?>
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseAssociationJtdback to summary
private final JavaType<?> baseAssociationJtd
discriminatorValueFetchback to summary
private Fetch discriminatorValueFetch
fetchesback to summary
private ImmutableFetchList fetches
graphedPartback to summary
private final DiscriminatedAssociationModelPart graphedPart
keyValueFetchback to summary
private Fetch keyValueFetch
navigablePathback to summary
private final NavigablePath navigablePath

Constructor Detail

AnyValuedResultGraphNodeback to summary
public AnyValuedResultGraphNode(NavigablePath navigablePath, DiscriminatedAssociationModelPart graphedPart, JavaType<?> baseAssociationJtd)

Method Detail

afterInitializeback to summary
protected void afterInitialize(DomainResultCreationState creationState)
containsAnyNonScalarResultsback to summary
public boolean containsAnyNonScalarResults()

Overrides default org.hibernate.sql.results.graph.DomainResultGraphNode.containsAnyNonScalarResults.

Doc from org.hibernate.sql.results.graph.DomainResultGraphNode.containsAnyNonScalarResults.

Does this node contain any non-scalar (sub-)results?

Annotations
@Override
containsCollectionFetchesback to summary
public boolean containsCollectionFetches()

Implements org.hibernate.sql.results.graph.FetchParent.containsCollectionFetches.

Annotations
@Override
findFetchback to summary
public Fetch findFetch(Fetchable fetchable)

Implements org.hibernate.sql.results.graph.FetchParent.findFetch.

Annotations
@Override
getBaseAssociationJtdback to summary
public JavaType<?> getBaseAssociationJtd()
getDiscriminatorValueFetchback to summary
public Fetch getDiscriminatorValueFetch()
getFetchesback to summary
public ImmutableFetchList getFetches()

Implements org.hibernate.sql.results.graph.FetchParent.getFetches.

Doc from org.hibernate.sql.results.graph.FetchParent.getFetches.

Retrieve the fetches owned by this fetch source.

Annotations
@Override
getKeyValueFetchback to summary
public Fetch getKeyValueFetch()
getNavigablePathback to summary
public NavigablePath getNavigablePath()

Overrides default org.hibernate.sql.results.graph.DomainResultGraphNode.getNavigablePath.

Implements org.hibernate.sql.results.graph.FetchParent.getNavigablePath.

Doc from org.hibernate.sql.results.graph.DomainResultGraphNode.getNavigablePath.

The NavigablePath for this node (if one!). Certain nodes will not have a NavigablePath, namely those not associated with a Navigable

Annotations
@Override
getReferencedMappingContainerback to summary
public DiscriminatedAssociationModelPart getReferencedMappingContainer()

Implements org.hibernate.sql.results.graph.FetchParent.getReferencedMappingContainer.

Doc from org.hibernate.sql.results.graph.FetchParent.getReferencedMappingContainer.

This parent's mapping type

Annotations
@Override
getReferencedMappingTypeback to summary
public DiscriminatedAssociationModelPart getReferencedMappingType()

Implements org.hibernate.sql.results.graph.FetchParent.getReferencedMappingType.

Doc from org.hibernate.sql.results.graph.FetchParent.getReferencedMappingType.

This parent's mapping type

Annotations
@Override
getResultJavaTypeback to summary
public JavaType<?> getResultJavaType()

Implements org.hibernate.sql.results.graph.DomainResultGraphNode.getResultJavaType.

Annotations
@Override
hasJoinFetchesback to summary
public boolean hasJoinFetches()

Implements org.hibernate.sql.results.graph.FetchParent.hasJoinFetches.

Annotations
@Override