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:
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.query.BindableType<T>,org.hibernate.query.sqm.SqmExpressible<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.query.BindableType<T>, org.hibernate.query.sqm.SqmExpressible<T>, org.hibernate.metamodel.mapping.BasicValuedMapping
Very convenient base class for implementing immutable 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.JdbcValuesConsumer -
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) booleanintforEachDisassembledJdbcValue(Object value, org.hibernate.sql.ast.Clause clause, int offset, org.hibernate.metamodel.mapping.Bindable.JdbcValuesConsumer valuesConsumer, org.hibernate.engine.spi.SharedSessionContractImplementor session) intforEachJdbcType(int offset, org.hibernate.mapping.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) 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
getJdbcMappings, getJdbcTypeCountMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValueMethods inherited from interface org.hibernate.query.sqm.SqmExpressible
isInstance, resolveExpressibleMethods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getJdbcType, getValueConverterMethods 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>
-
getBindableJavaType
- Specified by:
getBindableJavaTypein interfaceorg.hibernate.query.BindableType<T>
-
getExpressibleJavaType
-
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.mapping.IndexedConsumer<org.hibernate.metamodel.mapping.JdbcMapping> action) - Specified by:
forEachJdbcTypein interfaceorg.hibernate.metamodel.mapping.JdbcMappingContainer
-