Package org.hibernate.metamodel.mapping
Interface DiscriminatorMapping
-
- All Superinterfaces:
BasicValuedMapping
,BasicValuedModelPart
,Bindable
,Fetchable
,JavaTypedExpressible
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,SelectableMapping
,SelectableMappings
,SqlExpressible
,SqlTypedMapping
,ValuedModelPart
,ValueMapping
,VirtualModelPart
- All Known Subinterfaces:
EmbeddableDiscriminatorMapping
,EntityDiscriminatorMapping
- All Known Implementing Classes:
AbstractDiscriminatorMapping
,AnyDiscriminatorPart
,CaseStatementDiscriminatorMappingImpl
,ExplicitColumnDiscriminatorMappingImpl
public interface DiscriminatorMapping extends VirtualModelPart, BasicValuedModelPart, Fetchable
Mapping of a discriminator, for either entity or association (ANY) discrimination. Represents a composition of- a converter between the domain and relational form
- a JDBC mapping to read and write the relational values
-
-
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
-
-
Method Summary
All 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 JavaType<?>
getDomainJavaType()
The domain Java form, which is eitherJavaType<Class>
(entity class) orJavaType<String>
(entity name).default JavaType<?>
getRelationalJavaType()
The relational Java form.JdbcMapping
getUnderlyingJdbcMapping()
DiscriminatorConverter<?,?>
getValueConverter()
Information about the value mappingsdefault DiscriminatorValueDetails
resolveDiscriminatorValue(Object discriminatorValue)
Retrieve the details for a particular discriminator value.Expression
resolveSqlExpression(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, 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.sql.results.graph.Fetchable
asAttributeMapping, getFetchableKey, getFetchableName, getMappedFetchOptions, 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, getPartName, 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, getTemporalPrecision, isLob, toSize
-
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
-
-
-
-
Method Detail
-
getValueConverter
DiscriminatorConverter<?,?> getValueConverter()
Information about the value mappings
-
resolveDiscriminatorValue
default DiscriminatorValueDetails resolveDiscriminatorValue(Object discriminatorValue)
Retrieve the details for a particular discriminator value.- Throws:
HibernateException
- if there is value matching the provided one
-
getUnderlyingJdbcMapping
JdbcMapping getUnderlyingJdbcMapping()
-
getDomainJavaType
default JavaType<?> getDomainJavaType()
The domain Java form, which is eitherJavaType<Class>
(entity class) orJavaType<String>
(entity name).
-
getRelationalJavaType
default JavaType<?> getRelationalJavaType()
The relational Java form. This will typically be some form of integer or character value.
-
resolveSqlExpression
Expression resolveSqlExpression(NavigablePath navigablePath, JdbcMapping jdbcMappingToUse, TableGroup tableGroup, SqlAstCreationState creationState)
Create the appropriate SQL expression for this discriminator- 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:Fetchable
Generates a Fetch of this fetchable- Specified by:
generateFetch
in interfaceFetchable
- Parameters:
fetchParent
- The parent of the Fetch we are generatingfetchablePath
- The overall path within the graphfetchTiming
- The requested fetch timing
-
-