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 voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplySqlSelections(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.voidbreakDownJdbcValues(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.Objectdisassemble(Object value, SharedSessionContractImplementor session)EntityMappingTypefindContainingEntityMapping()intforEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetintforEachSelectable(int offset, SelectableConsumer consumer)BasicFetchgenerateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)Generates a Fetch of this fetchableStringgetConcreteEntityNameForDiscriminatorValue(Object value)EntityPersistergetEntityDescriptor()JavaType<?>getJavaType()JdbcMappinggetJdbcMapping()Anything that is expressible at the SQL AST level would be of basic type.MappingTypegetMappedType()Descriptor for the type of this mappingNavigableRolegetNavigableRole()SessionFactoryImplementorgetSessionFactory()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:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
getJdbcMapping
public JdbcMapping getJdbcMapping()
Description copied from interface:SqlExpressibleAnything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMappingin interfaceBasicValuedMapping- Specified by:
getJdbcMappingin interfaceSqlExpressible- Specified by:
getJdbcMappingin interfaceSqlTypedMapping
-
getConcreteEntityNameForDiscriminatorValue
public String getConcreteEntityNameForDiscriminatorValue(Object value)
- Specified by:
getConcreteEntityNameForDiscriminatorValuein interfaceEntityDiscriminatorMapping
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
getMappedType
public MappingType getMappedType()
Description copied from interface:ValueMappingDescriptor for the type of this mapping- Specified by:
getMappedTypein interfaceValueMapping
-
getJavaType
public JavaType<?> getJavaType()
- Specified by:
getJavaTypein interfaceModelPart
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPartCreate a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResultin interfaceModelPart
-
generateFetch
public 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 interfaceEntityDiscriminatorMapping- Specified by:
generateFetchin 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:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValuein interfaceBindable
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValuesin interfaceModelPart
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemblein interfaceBindable- See Also:
As an example, consider the following domain model: ````
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)- Specified by:
forEachSelectablein interfaceModelPart
-
-