Top Description Fields Methods
org.hibernate.metamodel.mapping

public Interface EntityDiscriminatorMapping

extends DiscriminatorMapping, FetchOptions
Known Direct Implementers
org.hibernate.metamodel.mapping.internal.AbstractDiscriminatorMapping
Imports
org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.spi.SqlAstCreationState, org.hibernate.sql.ast.tree.expression.Expression, org.hibernate.sql.ast.tree.from.TableGroup, org.hibernate.sql.results.graph.DomainResultCreationState, .FetchOptions, .FetchParent, org.hibernate.sql.results.graph.basic.BasicFetch

Details about the discriminator for an entity hierarchy.

Implementation Note

All entity-mappings within the hierarchy share the same EntityDiscriminatorMapping instance.

Author
Steve Ebersole
See Also
jakarta.persistence.DiscriminatorColumn, jakarta.persistence.DiscriminatorValue

Field Summary

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

Method Summary

Modifier and TypeMethod and Description
public BasicFetch<?>
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)

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

Generates a Fetch of this fetchable
public default int
public default String
public default FetchOptions
public default String
getPartName()

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

The local part name, which is generally the unqualified role name
public default FetchStyle
public default FetchTiming
public boolean
hasPhysicalColumn()

Is the discriminator defined by a physical column?

public static boolean
public DiscriminatorValueDetails
resolveDiscriminatorValue(Object value)

Retrieve the details for a particular discriminator value.

public Expression
resolveSqlExpression(NavigablePath navigablePath, JdbcMapping
The JDBC mapping to use. This allows opting between the "domain result type" (aka Class) and the "underlying type" (Integer, String, etc)
jdbcMappingToUse
,
TableGroup tableGroup, SqlAstCreationState creationState)

Redeclares org.hibernate.metamodel.mapping.DiscriminatorMapping.resolveSqlExpression.

Create the appropriate SQL expression for this discriminator
Inherited from org.hibernate.metamodel.mapping.DiscriminatorMapping:
getDomainJavaTypegetRelationalJavaTypegetUnderlyingJdbcMappinggetValueConverter
Inherited from org.hibernate.sql.results.graph.FetchOptions:
valueOf

Field Detail

DISCRIMINATOR_ROLE_NAMEback to summary
public static final String DISCRIMINATOR_ROLE_NAME
LEGACY_DISCRIMINATOR_NAMEback to summary
public static final String LEGACY_DISCRIMINATOR_NAME

Method Detail

generateFetchback to summary
public BasicFetch<?> generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)

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

Doc from org.hibernate.sql.results.graph.Fetchable.generateFetch.

Generates a Fetch of this fetchable

Parameters
fetchParent:FetchParent

The parent of the Fetch we are generating

fetchablePath:NavigablePath

The overall path within the graph

fetchTiming:FetchTiming

The requested fetch timing

Annotations
@Override
getFetchableKeyback to summary
public default int getFetchableKey()

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

Doc from org.hibernate.sql.results.graph.Fetchable.getFetchableKey.

The key that identifies this Fetchable within a FetchableContainer. If this Fetchable is part of FetchableContainer#visitFetchables(IndexedConsumer, EntityMappingType), the values is guaranteed to be between 0 (inclusive) and FetchableContainer#getNumberOfFetchableKeys() (exclusive). Other Fetchable objects may have a special negative value.

The main intent of this key is to index e.g. Fetch objects in an array.

Annotations
@Override
getFetchableNameback to summary
public default String getFetchableName()

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

Doc from org.hibernate.sql.results.graph.Fetchable.getFetchableName.

The name of the fetchable. This is the part's "local name".

Annotations
@Override
getMappedFetchOptionsback to summary
public default FetchOptions getMappedFetchOptions()

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

Doc from org.hibernate.sql.results.graph.Fetchable.getMappedFetchOptions.

The configured fetch timing and style

Annotations
@Override
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
getStyleback to summary
public default FetchStyle getStyle()

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

Annotations
@Override
getTimingback to summary
public default FetchTiming getTiming()

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

Annotations
@Override
hasPhysicalColumnback to summary
public boolean hasPhysicalColumn()

Is the discriminator defined by a physical column?

matchesRoleNameback to summary
public static boolean matchesRoleName(String name)
resolveDiscriminatorValueback to summary
public DiscriminatorValueDetails resolveDiscriminatorValue(Object value)

Retrieve the details for a particular discriminator value. Returns null if there is no match.

resolveSqlExpressionback to summary
public Expression resolveSqlExpression(NavigablePath navigablePath, JdbcMapping jdbcMappingToUse, TableGroup tableGroup, SqlAstCreationState creationState)

Redeclares org.hibernate.metamodel.mapping.DiscriminatorMapping.resolveSqlExpression.

Create the appropriate SQL expression for this discriminator

Parameters
jdbcMappingToUse:JdbcMapping

The JDBC mapping to use. This allows opting between the "domain result type" (aka Class) and the "underlying type" (Integer, String, etc)