Class ImmutableUserType<T>
java.lang.Object
ch.tocco.nice2.persist.core.api.hibernate.usertype.ImmutableUserType<T>
- All Implemented Interfaces:
org.hibernate.usertype.UserType
- Direct Known Subclasses:
BinaryUserType
,CompressedTextUserType
,EncodedPasswordUserType
,HtmlUserType
,LoginUserType
,PhoneUserType
,UuidToStringUserType
public abstract class ImmutableUserType<T>
extends Object
implements org.hibernate.usertype.UserType
Base class for immutable user types.
Based on https://vladmihalcea.com/2016/09/22/how-to-implement-a-custom-basic-type-using-hibernate-usertype/
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassemble
(Serializable cached, Object owner) boolean
protected abstract T
get
(ResultSet rs, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) int
boolean
nullSafeGet
(ResultSet rs, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) void
nullSafeSet
(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) protected abstract void
set
(PreparedStatement st, T 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, wait
Methods inherited from interface org.hibernate.usertype.UserType
sqlTypes
-
Constructor Details
-
ImmutableUserType
-
-
Method Details
-
returnedClass
- Specified by:
returnedClass
in interfaceorg.hibernate.usertype.UserType
-
equals
- Specified by:
equals
in interfaceorg.hibernate.usertype.UserType
-
hashCode
- Specified by:
hashCode
in interfaceorg.hibernate.usertype.UserType
-
deepCopy
- Specified by:
deepCopy
in interfaceorg.hibernate.usertype.UserType
-
isMutable
public boolean isMutable()- Specified by:
isMutable
in interfaceorg.hibernate.usertype.UserType
-
disassemble
- Specified by:
disassemble
in interfaceorg.hibernate.usertype.UserType
-
assemble
- Specified by:
assemble
in interfaceorg.hibernate.usertype.UserType
-
replace
- Specified by:
replace
in interfaceorg.hibernate.usertype.UserType