Class AttributeConverterMutabilityPlanImpl<T>
- java.lang.Object
-
- org.hibernate.type.descriptor.java.MutableMutabilityPlan<T>
-
- org.hibernate.type.descriptor.converter.AttributeConverterMutabilityPlanImpl<T>
-
- All Implemented Interfaces:
Serializable
,MutabilityPlan<T>
public class AttributeConverterMutabilityPlanImpl<T> extends MutableMutabilityPlan<T>
The standard approach for defining a MutabilityPlan for converted (AttributeConverter) values is to always assume that they are immutable to make sure that dirty checking, deep copying and second-level caching all work properly no matter what. That was work done under https://hibernate.atlassian.net/browse/HHH-10111 However a series of approaches to tell Hibernate that the values are immutable were documented as part of https://hibernate.atlassian.net/browse/HHH-10127- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.hibernate.type.descriptor.java.MutableMutabilityPlan
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description AttributeConverterMutabilityPlanImpl(JpaAttributeConverter converter, boolean mutable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
assemble(Serializable cached, SharedSessionContract session)
Assemble a previously disassembled value.protected T
deepCopyNotNull(T value)
Serializable
disassemble(T value, SharedSessionContract session)
Return a disassembled representation of the value.boolean
isMutable()
Can the internal state of instances ofT
be changed?-
Methods inherited from class org.hibernate.type.descriptor.java.MutableMutabilityPlan
deepCopy
-
-
-
-
Constructor Detail
-
AttributeConverterMutabilityPlanImpl
public AttributeConverterMutabilityPlanImpl(JpaAttributeConverter converter, boolean mutable)
-
-
Method Detail
-
isMutable
public boolean isMutable()
Description copied from interface:MutabilityPlan
Can the internal state of instances ofT
be changed?- Specified by:
isMutable
in interfaceMutabilityPlan<T>
- Overrides:
isMutable
in classMutableMutabilityPlan<T>
- Returns:
- True if the internal state can be changed; false otherwise.
-
deepCopyNotNull
protected T deepCopyNotNull(T value)
- Specified by:
deepCopyNotNull
in classMutableMutabilityPlan<T>
-
disassemble
public Serializable disassemble(T value, SharedSessionContract session)
Description copied from interface:MutabilityPlan
Return a disassembled representation of the value. Called before storing a value in the second-level cache. Complementary toMutabilityPlan.assemble(java.io.Serializable, org.hibernate.SharedSessionContract)
.- Specified by:
disassemble
in interfaceMutabilityPlan<T>
- Overrides:
disassemble
in classMutableMutabilityPlan<T>
- See Also:
MutabilityPlan.assemble(java.io.Serializable, org.hibernate.SharedSessionContract)
-
assemble
public T assemble(Serializable cached, SharedSessionContract session)
Description copied from interface:MutabilityPlan
Assemble a previously disassembled value. Called after reading a value from the second level cache. Complementary toMutabilityPlan.disassemble(T, org.hibernate.SharedSessionContract)
.- Specified by:
assemble
in interfaceMutabilityPlan<T>
- Overrides:
assemble
in classMutableMutabilityPlan<T>
- See Also:
MutabilityPlan.disassemble(T, org.hibernate.SharedSessionContract)
-
-