Interface BasicValuedMapping

All Superinterfaces:
Bindable, JavaTypedExpressible, JdbcMappingContainer, MappingModelExpressible, SqlExpressible, ValueMapping
All Known Subinterfaces:
AdjustableBasicType<J>, BasicEntityIdentifierMapping, BasicPluralType<C,E>, BasicType<T>, BasicValuedModelPart, CollectionIdentifierDescriptor, ConvertedBasicType<J>, DiscriminatorMapping, DiscriminatorType<O>, EmbeddableDiscriminatorMapping, EntityDiscriminatorMapping, EntityRowIdMapping, EntityVersionMapping
All Known Implementing Classes:
AbstractDiscriminatorMapping, AbstractJdbcParameter, AbstractSingleColumnStandardBasicType, AbstractStandardBasicType, AnonymousTupleBasicEntityIdentifierMapping, AnonymousTupleBasicValuedModelPart, AnyDiscriminatorPart, AnyKeyPart, BasicArrayType, BasicAttributeMapping, BasicCollectionType, BasicEntityIdentifierMappingImpl, BasicTypeImpl, BasicValuedCollectionPart, BottomType, CaseStatementDiscriminatorMappingImpl, CollectionIdentifierDescriptorImpl, ColumnValueParameter, ConvertedBasicArrayType, ConvertedBasicCollectionType, ConvertedBasicTypeImpl, CustomMutabilityConvertedBasicTypeImpl, CustomMutabilityConvertedPrimitiveBasicTypeImpl, CustomType, DiscriminatorType, DiscriminatorTypeImpl, EmbeddableTypeLiteral, EntityRowIdMappingImpl, EntityTypeLiteral, EntityVersionMappingImpl, ExplicitColumnDiscriminatorMappingImpl, ImmutableNamedBasicTypeImpl, JavaObjectType, JdbcParameterImpl, NamedBasicTypeImpl, NullType, QueryParameterJavaObjectType, SerializableToBlobType, SerializableType, SimpleForeignKeyDescriptor, SimpleNaturalIdMapping, SqlTypedMappingJdbcParameter, StandardBasicTypeTemplate, VersionTypeSeedParameterSpecification

public interface BasicValuedMapping extends ValueMapping, SqlExpressible
Any basic-typed ValueMapping. Generally this would be one of
  • Method Details

    • getJdbcTypeCount

      default int getJdbcTypeCount()
      Description copied from interface: Bindable
      The number of JDBC mappings
      Specified by:
      getJdbcTypeCount in interface Bindable
      Specified by:
      getJdbcTypeCount in interface JdbcMappingContainer
    • getJdbcMapping

      default JdbcMapping getJdbcMapping(int index)
      Specified by:
      getJdbcMapping in interface JdbcMappingContainer
      Specified by:
      getJdbcMapping in interface SqlExpressible
    • getSingleJdbcMapping

      default JdbcMapping getSingleJdbcMapping()
      Specified by:
      getSingleJdbcMapping in interface JdbcMappingContainer
    • getJdbcMapping

      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 interface SqlExpressible
    • disassemble

      default Object disassemble(Object value, SharedSessionContractImplementor session)
      Description copied from interface: Bindable
      Breaks down a value of J into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.

      Generally speaking, this is the form in which entity state is kept relative to a Session via EntityEntry.

       @Entity class Person {
           @Id Integer id;
           @Embedded Name name;
           int age;
       }
      
       @Embeddable class Name {
           String familiarName;
           String familyName;
       }
       

      At the top level, we would want to disassemble a Person value, so we'd ask the Bindable for the Person entity to disassemble. Given a Person value:

       Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )
       

      this disassemble would result in a multidimensional array:

       [ ["Steve", "Ebersole"], 28 ]
       

      Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.

      Specified by:
      disassemble in interface Bindable
      See Also:
    • addToCacheKey

      default void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)
      Description copied from interface: Bindable
      Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.
      Specified by:
      addToCacheKey in interface Bindable
      Specified by:
      addToCacheKey in interface JavaTypedExpressible
      Parameters:
      cacheKey - the MutableCacheKey used to add the disassembled value and the hashCode
      value - the value to disassemble
      session - the SharedSessionContractImplementor