Skip to content

Commit cfc6df2

Browse files
VladoKurucbeikov
authored andcommitted
HHH-18150 Considered change of ignoring precision while preserving float/smallfloat mapping
1 parent 0fd9edc commit cfc6df2

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
package org.hibernate.community.dialect;
88

99
import org.hibernate.boot.Metadata;
10-
import java.sql.Types;
1110

1211
import org.hibernate.boot.model.FunctionContributions;
1312
import org.hibernate.boot.model.TypeContributions;
@@ -29,7 +28,6 @@
2928
import org.hibernate.dialect.temptable.TemporaryTable;
3029
import org.hibernate.dialect.temptable.TemporaryTableKind;
3130
import org.hibernate.dialect.unique.UniqueDelegate;
32-
import org.hibernate.engine.jdbc.Size;
3331
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
3432
import org.hibernate.engine.spi.LoadQueryInfluencers;
3533
import org.hibernate.engine.spi.SessionFactoryImplementor;
@@ -65,8 +63,6 @@
6563
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
6664
import org.hibernate.tool.schema.internal.StandardForeignKeyExporter;
6765
import org.hibernate.tool.schema.spi.Exporter;
68-
import org.hibernate.type.descriptor.java.JavaType;
69-
import org.hibernate.type.descriptor.jdbc.JdbcType;
7066
import org.hibernate.type.descriptor.sql.internal.CapacityDependentDdlType;
7167
import org.hibernate.type.descriptor.sql.spi.DdlTypeRegistry;
7268
import org.hibernate.type.spi.TypeConfiguration;
@@ -119,24 +115,6 @@ public String[] getSqlCreateStrings(
119115
}
120116
};
121117

122-
private final SizeStrategy sizeStrategy = new SizeStrategyImpl() {
123-
@Override
124-
public Size resolveSize(
125-
JdbcType jdbcType,
126-
JavaType<?> javaType,
127-
Integer precision,
128-
Integer scale,
129-
Long length) {
130-
switch ( jdbcType.getDdlTypeCode() ) {
131-
case Types.FLOAT:
132-
// Informix allows FLOAT with a precision up to 16
133-
if ( precision != null ) {
134-
return Size.precision( Math.min( Math.max( precision, 1 ), 16 ) );
135-
}
136-
}
137-
return super.resolveSize( jdbcType, javaType, precision, scale, length );
138-
}
139-
};
140118
public InformixDialect(DialectResolutionInfo info) {
141119
this( info.makeCopyOrDefault( DEFAULT_VERSION ) );
142120
registerKeywords( info );
@@ -201,7 +179,7 @@ protected void registerColumnTypes(TypeContributions typeContributions, ServiceR
201179
//float(n) and just always defaults to
202180
//double precision.
203181
ddlTypeRegistry.addDescriptor(
204-
CapacityDependentDdlType.builder( FLOAT, "float($p)", this )
182+
CapacityDependentDdlType.builder( FLOAT, "float", this )
205183
.withTypeCapacity( 8, "smallfloat" )
206184
.build()
207185
);
@@ -259,11 +237,6 @@ public int getDoublePrecision() {
259237
return 16;
260238
}
261239

262-
@Override
263-
public SizeStrategy getSizeStrategy() {
264-
return sizeStrategy;
265-
}
266-
267240
@Override
268241
public void initializeFunctionRegistry(FunctionContributions functionContributions) {
269242
super.initializeFunctionRegistry(functionContributions);

0 commit comments

Comments
 (0)