Class AttributeConverterMutabilityPlan<T,S>
java.lang.Object
org.hibernate.type.descriptor.java.MutableMutabilityPlan<T>
org.hibernate.type.descriptor.converter.internal.AttributeConverterMutabilityPlan<T,S>
- All Implemented Interfaces:
Serializable,MutabilityPlan<T>
The default
MutabilityPlan for a
converted value assumes,
in the absence of additional evidence, that the value is mutable, so
that dirty checking, deep copying, and second-level caching all work correctly
in the case where it really is mutable.
As an exception to this, Java primitive types and enums are inferred
to be immutable.
To explicitly mark a converted value is immutable and avoid the extra processing required for a mutable value, either:
- mark the Java type of the attribute, the type passed to the converter, as
@Immutable, - explicitly specify a
MutabilityPlanusing@Mutability, or - explicitly specify its
JavaTypeDescriptorusing@JavaType.
- See Also:
-
Field Summary
Fields inherited from class org.hibernate.type.descriptor.java.MutableMutabilityPlan
INSTANCE -
Constructor Summary
ConstructorsConstructorDescriptionAttributeConverterMutabilityPlan(JpaAttributeConverter<T, S> converter, boolean mutable) -
Method Summary
Modifier and TypeMethodDescriptionassemble(Serializable cached, SharedSessionContract session) Assemble a previously disassembled value.protected TdeepCopyNotNull(T value) disassemble(T value, SharedSessionContract session) Return a disassembled representation of the value.booleanCan the internal state of instances ofTbe changed?Methods inherited from class org.hibernate.type.descriptor.java.MutableMutabilityPlan
deepCopy
-
Constructor Details
-
AttributeConverterMutabilityPlan
-
-
Method Details
-
isMutable
public boolean isMutable()Description copied from interface:MutabilityPlanCan the internal state of instances ofTbe changed?- Specified by:
isMutablein interfaceMutabilityPlan<T>- Overrides:
isMutablein classMutableMutabilityPlan<T>- Returns:
- True if the internal state can be changed; false otherwise.
-
deepCopyNotNull
- Specified by:
deepCopyNotNullin classMutableMutabilityPlan<T>
-