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
  • Method Details

    • 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 either JavaType<Class> (entity class) or JavaType<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 interface Fetchable
      Parameters:
      fetchParent - The parent of the Fetch we are generating
      fetchablePath - The overall path within the graph
      fetchTiming - The requested fetch timing