Class AbstractDiscriminatorMapping
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractDiscriminatorMapping
-
- All Implemented Interfaces:
BasicValuedMapping
,BasicValuedModelPart
,Bindable
,EntityDiscriminatorMapping
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,SelectableMapping
,SqlExpressible
,SqlTypedMapping
,ValueMapping
,VirtualModelPart
,Fetchable
,FetchOptions
,FetchStyleAccess
,FetchTimingAccess
,JavaTypedExpressible
- Direct Known Subclasses:
CaseStatementDiscriminatorMappingImpl
,ExplicitColumnDiscriminatorMappingImpl
public abstract class AbstractDiscriminatorMapping extends Object implements EntityDiscriminatorMapping
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueConsumer
-
-
Field Summary
-
Fields inherited from interface org.hibernate.metamodel.mapping.EntityDiscriminatorMapping
LEGACY_HQL_ROLE_NAME, ROLE_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractDiscriminatorMapping(EntityPersister entityDescriptor, DiscriminatorType<?> discriminatorType, MappingModelCreationProcess creationProcess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.void
breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
<T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Create a DomainResult for a specific reference to this ModelPart.Object
disassemble(Object value, SharedSessionContractImplementor session)
EntityMappingType
findContainingEntityMapping()
int
forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Visit each JdbcMapping starting from the given offsetint
forEachSelectable(int offset, SelectableConsumer consumer)
BasicFetch
generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Generates a Fetch of this fetchableString
getConcreteEntityNameForDiscriminatorValue(Object value)
EntityPersister
getEntityDescriptor()
JavaType<?>
getJavaType()
JdbcMapping
getJdbcMapping()
Anything that is expressible at the SQL AST level would be of basic type.MappingType
getMappedType()
Descriptor for the type of this mappingNavigableRole
getNavigableRole()
SessionFactoryImplementor
getSessionFactory()
BasicType<?>
getUnderlyingJdbcMappingType()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.BasicValuedMapping
getJdbcMappings, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.metamodel.mapping.BasicValuedModelPart
getPartMappingType
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityDiscriminatorMapping
getFetchableName, getMappedFetchOptions, getPartName, getStyle, getTiming, isPhysical, resolveSqlExpression
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, incrementFetchDepth, resolveCircularFetch
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, forEachSelectable
-
Methods inherited from interface org.hibernate.metamodel.mapping.SelectableMapping
getContainingTableExpression, getCustomReadExpression, getCustomWriteExpression, getSelectionExpression, isFormula
-
Methods inherited from interface org.hibernate.metamodel.mapping.SqlTypedMapping
getColumnDefinition, getLength, getPrecision, getScale
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Constructor Detail
-
AbstractDiscriminatorMapping
public AbstractDiscriminatorMapping(EntityPersister entityDescriptor, DiscriminatorType<?> discriminatorType, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
getEntityDescriptor
public EntityPersister getEntityDescriptor()
-
getUnderlyingJdbcMappingType
public BasicType<?> getUnderlyingJdbcMappingType()
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRole
in interfaceModelPart
- See Also:
ModelPart.getPartName()
-
getJdbcMapping
public JdbcMapping getJdbcMapping()
Description copied from interface:SqlExpressible
Anything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMapping
in interfaceBasicValuedMapping
- Specified by:
getJdbcMapping
in interfaceSqlExpressible
- Specified by:
getJdbcMapping
in interfaceSqlTypedMapping
-
getConcreteEntityNameForDiscriminatorValue
public String getConcreteEntityNameForDiscriminatorValue(Object value)
- Specified by:
getConcreteEntityNameForDiscriminatorValue
in interfaceEntityDiscriminatorMapping
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
getMappedType
public MappingType getMappedType()
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
getJavaType
public JavaType<?> getJavaType()
- Specified by:
getJavaType
in interfaceModelPart
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Create a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResult
in interfaceModelPart
-
generateFetch
public 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 interfaceEntityDiscriminatorMapping
- 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
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValue
in interfaceBindable
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemble
in interfaceBindable
- See Also:
As an example, consider the following domain model: ````
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)
- Specified by:
forEachSelectable
in interfaceModelPart
-
-