Class MutableType<T,JDBC extends org.hibernate.type.descriptor.jdbc.JdbcType,JAVA extends org.hibernate.type.descriptor.java.JavaType<T>>
java.lang.Object
io.hypersistence.utils.hibernate.type.MutableType<T,JDBC,JAVA>
- All Implemented Interfaces:
jakarta.persistence.metamodel.Type<T>,org.hibernate.metamodel.mapping.BasicValuedMapping,org.hibernate.metamodel.mapping.Bindable,org.hibernate.metamodel.mapping.JdbcMappingContainer,org.hibernate.metamodel.mapping.MappingModelExpressible,org.hibernate.metamodel.mapping.SqlExpressible,org.hibernate.metamodel.mapping.ValueMapping,org.hibernate.metamodel.model.domain.DomainType<T>,org.hibernate.type.BindableType<T>,org.hibernate.type.descriptor.java.JavaTypedExpressible,org.hibernate.usertype.UserType<T>
- Direct Known Subclasses:
MutableDynamicParameterizedType
public abstract class MutableType<T,JDBC extends org.hibernate.type.descriptor.jdbc.JdbcType,JAVA extends org.hibernate.type.descriptor.java.JavaType<T>>
extends Object
implements org.hibernate.usertype.UserType<T>, org.hibernate.type.BindableType<T>, org.hibernate.metamodel.model.domain.DomainType<T>, org.hibernate.metamodel.mapping.BasicValuedMapping
Very convenient base class for implementing mutable object types using Hibernate
UserType.- Author:
- Vlad Mihalcea
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
org.hibernate.metamodel.mapping.Bindable.JdbcValuesBiConsumer<X extends Object,Y extends Object>, org.hibernate.metamodel.mapping.Bindable.JdbcValuesConsumer Nested classes/interfaces inherited from interface jakarta.persistence.metamodel.Type
jakarta.persistence.metamodel.Type.PersistenceType -
Constructor Summary
ConstructorsConstructorDescriptionMutableType(Class<T> clazz, JDBC jdbcTypeDescriptor, JAVA javaTypeDescriptor) Initialization constructor taking theClassand using the defaultConfigurationobject.MutableType(Class<T> clazz, JDBC jdbcTypeDescriptor, JAVA javaTypeDescriptor, Configuration configuration) Initialization constructor taking theClassand using the providedConfigurationobject. -
Method Summary
Modifier and TypeMethodDescriptionassemble(Serializable cached, Object owner) disassemble(Object value, org.hibernate.engine.spi.SharedSessionContractImplementor session) disassemble(T value) boolean<X,Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, org.hibernate.metamodel.mapping.Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, org.hibernate.engine.spi.SharedSessionContractImplementor session) intforEachJdbcType(int offset, org.hibernate.internal.util.IndexedConsumer<org.hibernate.metamodel.mapping.JdbcMapping> action) org.hibernate.type.descriptor.java.JavaType<T>org.hibernate.metamodel.mapping.JdbcMappingorg.hibernate.metamodel.mapping.MappingTypeintintbooleannullSafeGet(ResultSet rs, int position, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) voidnullSafeSet(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) org.hibernate.query.sqm.SqmBindableType<T>resolveExpressible(org.hibernate.type.BindingContext bindingContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.mapping.BasicValuedMapping
addToCacheKey, getJdbcMapping, getJdbcTypeCount, getSingleJdbcMappingMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValueMethods inherited from interface jakarta.persistence.metamodel.Type
getPersistenceTypeMethods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlPrecision, getDefaultSqlScale, getDefaultSqlScale, getValueConverter, isComparable, nullSafeGet, nullSafeSetMethods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
treatAs
-
Constructor Details
-
MutableType
Initialization constructor taking theClassand using the defaultConfigurationobject.- Parameters:
clazz- The class returned byUserType.nullSafeGet(ResultSet, int, SharedSessionContractImplementor, Object).jdbcTypeDescriptor- the JDBC type descriptorjavaTypeDescriptor- the Java type descriptor
-
MutableType
public MutableType(Class<T> clazz, JDBC jdbcTypeDescriptor, JAVA javaTypeDescriptor, Configuration configuration) Initialization constructor taking theClassand using the providedConfigurationobject.- Parameters:
clazz- The class returned byUserType.nullSafeGet(ResultSet, int, SharedSessionContractImplementor, Object).jdbcTypeDescriptor- the JDBC type descriptorjavaTypeDescriptor- the Java type descriptorconfiguration- the configuration
-
-
Method Details
-
getJdbcTypeDescriptor
-
getJavaTypeDescriptor
-
getConfiguration
-
equals
- Specified by:
equalsin interfaceorg.hibernate.usertype.UserType<T>
-
hashCode
- Specified by:
hashCodein interfaceorg.hibernate.usertype.UserType<T>
-
deepCopy
- Specified by:
deepCopyin interfaceorg.hibernate.usertype.UserType<T>
-
isMutable
public boolean isMutable()- Specified by:
isMutablein interfaceorg.hibernate.usertype.UserType<T>
-
disassemble
- Specified by:
disassemblein interfaceorg.hibernate.usertype.UserType<T>
-
assemble
- Specified by:
assemblein interfaceorg.hibernate.usertype.UserType<T>
-
replace
- Specified by:
replacein interfaceorg.hibernate.usertype.UserType<T>
-
getSqlType
public int getSqlType()- Specified by:
getSqlTypein interfaceorg.hibernate.usertype.UserType<T>
-
returnedClass
- Specified by:
returnedClassin interfaceorg.hibernate.usertype.UserType<T>
-
getJavaType
-
getTypeName
- Specified by:
getTypeNamein interfaceorg.hibernate.metamodel.model.domain.DomainType<T>
-
resolveExpressible
public org.hibernate.query.sqm.SqmBindableType<T> resolveExpressible(org.hibernate.type.BindingContext bindingContext) - Specified by:
resolveExpressiblein interfaceorg.hibernate.type.BindableType<T>
-
getExpressibleJavaType
- Specified by:
getExpressibleJavaTypein interfaceorg.hibernate.metamodel.model.domain.DomainType<T>- Specified by:
getExpressibleJavaTypein interfaceorg.hibernate.type.descriptor.java.JavaTypedExpressible<T>- Specified by:
getExpressibleJavaTypein interfaceorg.hibernate.metamodel.mapping.ValueMapping
-
getJdbcMapping
public org.hibernate.metamodel.mapping.JdbcMapping getJdbcMapping()- Specified by:
getJdbcMappingin interfaceorg.hibernate.metamodel.mapping.BasicValuedMapping- Specified by:
getJdbcMappingin interfaceorg.hibernate.metamodel.mapping.SqlExpressible
-
getMappedType
public org.hibernate.metamodel.mapping.MappingType getMappedType()- Specified by:
getMappedTypein interfaceorg.hibernate.metamodel.mapping.ValueMapping
-
forEachJdbcType
public int forEachJdbcType(int offset, org.hibernate.internal.util.IndexedConsumer<org.hibernate.metamodel.mapping.JdbcMapping> action) - Specified by:
forEachJdbcTypein interfaceorg.hibernate.metamodel.mapping.JdbcMappingContainer
-