diff --git a/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java b/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java index 86189c6b48..fed32e9aec 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java @@ -50,6 +50,7 @@ public abstract class AbstractStandardBasicType private final JdbcLiteralFormatter jdbcLiteralFormatter; private final AbstractClassJavaType javaTypeAsAbstractClassJavaType; private final Class javaTypeClass; + private final MutabilityPlan mutabilityPlan; public AbstractStandardBasicType(JdbcType jdbcType, JavaType javaType) { this.jdbcType = jdbcType; @@ -60,8 +61,9 @@ public abstract class AbstractStandardBasicType this.jdbcValueExtractor = jdbcType.getExtractor( javaType ); this.jdbcLiteralFormatter = jdbcType.getJdbcLiteralFormatter( javaType ); - //A very simple dispatch optimisation, make this a constant: + //A very simple dispatch optimisation, make these a constant: this.javaTypeClass = javaType.getJavaTypeClass(); + this.mutabilityPlan = javaType.getMutabilityPlan(); //This is a dispatch optimisation to avoid megamorphic invocations on the most common type: if ( javaType instanceof AbstractClassJavaType ) { this.javaTypeAsAbstractClassJavaType = (AbstractClassJavaType) javaType; @@ -96,7 +98,7 @@ public abstract class AbstractStandardBasicType } protected MutabilityPlan getMutabilityPlan() { - return javaType.getMutabilityPlan(); + return this.mutabilityPlan; } @Override