mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-13 22:54:51 +00:00
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;
|
||||
}
|
||||
|
||||
@ -139,9 +142,10 @@ public final void setJavaTypeDescriptor( JavaTypeDescriptor<T> javaTypeDescripto
|
||||
public final SqlTypeDescriptor getSqlTypeDescriptor() {
|
||||
return sqlTypeDescriptor;
|
||||
}
|
||||
|
||||
|
||||
public final void setSqlTypeDescriptor( SqlTypeDescriptor sqlTypeDescriptor ) {
|
||||
this.sqlTypeDescriptor = sqlTypeDescriptor;
|
||||
this.sqlTypes = new int[] { sqlTypeDescriptor.getSqlType() };
|
||||
}
|
||||
|
||||
public final Class getReturnedClass() {
|
||||
@ -153,7 +157,7 @@ public final int getColumnSpan(Mapping mapping) throws MappingException {
|
||||
}
|
||||
|
||||
public final int[] sqlTypes(Mapping mapping) throws MappingException {
|
||||
return new int[] { sqlTypeDescriptor.getSqlType() };
|
||||
return sqlTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user