HHH-8950 Avoid repeated array allocation for sqlTypes
This commit is contained in:
parent
419633432a
commit
b12f2ecf44
|
@ -62,9 +62,12 @@ public abstract class AbstractStandardBasicType<T>
|
|||
// by DynamicParameterizedTypes.
|
||||
private SqlTypeDescriptor sqlTypeDescriptor;
|
||||
private JavaTypeDescriptor<T> javaTypeDescriptor;
|
||||
// sqlTypes need always to be in sync with sqlTypeDescriptor
|
||||
private int[] sqlTypes;
|
||||
|
||||
public AbstractStandardBasicType(SqlTypeDescriptor sqlTypeDescriptor, JavaTypeDescriptor<T> javaTypeDescriptor) {
|
||||
this.sqlTypeDescriptor = sqlTypeDescriptor;
|
||||
this.sqlTypes = new int[] { sqlTypeDescriptor.getSqlType() };
|
||||
this.javaTypeDescriptor = javaTypeDescriptor;
|
||||
}
|
||||
|
||||
|
@ -142,6 +145,7 @@ public abstract class AbstractStandardBasicType<T>
|
|||
|
||||
public final void setSqlTypeDescriptor( SqlTypeDescriptor sqlTypeDescriptor ) {
|
||||
this.sqlTypeDescriptor = sqlTypeDescriptor;
|
||||
this.sqlTypes = new int[] { sqlTypeDescriptor.getSqlType() };
|
||||
}
|
||||
|
||||
public final Class getReturnedClass() {
|
||||
|
@ -153,7 +157,7 @@ public abstract class AbstractStandardBasicType<T>
|
|||
}
|
||||
|
||||
public final int[] sqlTypes(Mapping mapping) throws MappingException {
|
||||
return new int[] { sqlTypeDescriptor.getSqlType() };
|
||||
return sqlTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue