Package org.hibernate.metamodel.mapping
Interface EntityDiscriminatorMapping
-
- All Superinterfaces:
BasicValuedMapping,BasicValuedModelPart,Bindable,DiscriminatorMapping,Fetchable,FetchOptions,FetchStyleAccess,FetchTimingAccess,JavaTypedExpressible,JdbcMappingContainer,MappingModelExpressible,ModelPart,SelectableMapping,SelectableMappings,SqlExpressible,SqlTypedMapping,ValuedModelPart,ValueMapping,VirtualModelPart
- All Known Implementing Classes:
AbstractDiscriminatorMapping,CaseStatementDiscriminatorMappingImpl,ExplicitColumnDiscriminatorMappingImpl
public interface EntityDiscriminatorMapping extends DiscriminatorMapping, FetchOptions
Details about the discriminator for an entity hierarchy.- See Also:
DiscriminatorColumn,DiscriminatorValue- Implementation Note:
- All entity-mappings within the hierarchy share the same EntityDiscriminatorMapping instance.
-
-
Nested Class Summary
-
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 StringLEGACY_HQL_ROLE_NAMEstatic StringROLE_NAME
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description BasicFetch<?>generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)Generates a Fetch of this fetchabledefault intgetFetchableKey()The key that identifies this Fetchable within aFetchableContainer.default StringgetFetchableName()The name of the fetchable.default FetchOptionsgetMappedFetchOptions()The configured fetch timing and styledefault StringgetPartName()The local part name, which is generally the unqualified role namedefault FetchStylegetStyle()default FetchTiminggetTiming()booleanhasPhysicalColumn()Is the discriminator defined by a physical column?static booleanmatchesRoleName(String name)DiscriminatorValueDetailsresolveDiscriminatorValue(Object value)Retrieve the details for a particular discriminator value.ExpressionresolveSqlExpression(NavigablePath navigablePath, JdbcMapping jdbcMappingToUse, TableGroup tableGroup, SqlAstCreationState creationState)Create the appropriate SQL expression for this discriminator-
Methods inherited from interface org.hibernate.metamodel.mapping.BasicValuedMapping
addToCacheKey, disassemble, getJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.BasicValuedModelPart
asBasicValuedModelPart, forEachSelectable, forEachSelectable, getJdbcMapping, getJdbcMappings, getJdbcTypeCount, getPartMappingType, getSelectable, getSingleJdbcMapping, hasPartitionedSelectionMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.DiscriminatorMapping
getDomainJavaType, getRelationalJavaType, getUnderlyingJdbcMapping, getValueConverter
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, incrementFetchDepth, isSelectable, resolveCircularFetch
-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaTypedExpressible
addToCacheKey
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
forEachJdbcType
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
applySqlSelections, applySqlSelections, areEqual, asEntityMappingType, breakDownJdbcValues, breakDownJdbcValues, createDomainResult, decompose, decompose, findContainingEntityMapping, getJavaType, getNavigableRole, isEntityIdentifierMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.SelectableMapping
getContainingTableExpression, getCustomReadExpression, getCustomWriteExpression, getSelectableName, getSelectablePath, getSelectionExpression, getWriteExpression, isFormula, isInsertable, isNullable, isPartitioned, isUpdateable
-
Methods inherited from interface org.hibernate.metamodel.mapping.SqlTypedMapping
getColumnDefinition, getJdbcMapping, getLength, getPrecision, getScale, isLob
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachNonFormula, forEachUpdatable, getContainingTableExpression
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, getMappedType, treatAs
-
Methods inherited from interface org.hibernate.metamodel.mapping.VirtualModelPart
isVirtual
-
-
-
-
Field Detail
-
ROLE_NAME
static final String ROLE_NAME
- See Also:
- Constant Field Values
-
LEGACY_HQL_ROLE_NAME
static final String LEGACY_HQL_ROLE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
matchesRoleName
static boolean matchesRoleName(String name)
-
getPartName
default String getPartName()
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein interfaceModelPart
-
getFetchableName
default String getFetchableName()
Description copied from interface:FetchableThe name of the fetchable. This is the part's "local name".- Specified by:
getFetchableNamein interfaceFetchable- See Also:
ModelPart.getNavigableRole(),NavigableRole.getLocalName()
-
hasPhysicalColumn
boolean hasPhysicalColumn()
Is the discriminator defined by a physical column?
-
getFetchableKey
default int getFetchableKey()
Description copied from interface:FetchableThe key that identifies this Fetchable within aFetchableContainer. If this Fetchable is part ofFetchableContainer.visitFetchables(IndexedConsumer, EntityMappingType), the values is guaranteed to be between 0 (inclusive) andFetchableContainer.getNumberOfFetchableKeys()(exclusive). Other Fetchable objects may have a special negative value.The main intent of this key is to index e.g.
Fetchobjects in an array.- Specified by:
getFetchableKeyin interfaceFetchable
-
resolveDiscriminatorValue
DiscriminatorValueDetails resolveDiscriminatorValue(Object value)
Retrieve the details for a particular discriminator value. Returnsnullif there is no match.
-
resolveSqlExpression
Expression resolveSqlExpression(NavigablePath navigablePath, JdbcMapping jdbcMappingToUse, TableGroup tableGroup, SqlAstCreationState creationState)
Create the appropriate SQL expression for this discriminator- Specified by:
resolveSqlExpressionin interfaceDiscriminatorMapping- Parameters:
jdbcMappingToUse- The JDBC mapping to use. This allows opting between the "domain result type" (aka Class) and the "underlying type" (Integer, String, etc)
-
generateFetch
BasicFetch<?> generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:FetchableGenerates a Fetch of this fetchable- Specified by:
generateFetchin interfaceFetchable- Parameters:
fetchParent- The parent of the Fetch we are generatingfetchablePath- The overall path within the graphfetchTiming- The requested fetch timing
-
getMappedFetchOptions
default FetchOptions getMappedFetchOptions()
Description copied from interface:FetchableThe configured fetch timing and style- Specified by:
getMappedFetchOptionsin interfaceFetchable
-
getStyle
default FetchStyle getStyle()
- Specified by:
getStylein interfaceFetchStyleAccess
-
getTiming
default FetchTiming getTiming()
- Specified by:
getTimingin interfaceFetchTimingAccess
-
-