Skip to content

Commit adacca0

Browse files
committed
Fix MySQL convertion to JDBC type code for validation
1 parent 33f1cfb commit adacca0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/provider/service/MySqlReactiveInformationExtractorImpl.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.hibernate.reactive.provider.service;
77

88
import java.sql.SQLException;
9+
import java.sql.Types;
910
import java.util.ArrayList;
1011
import java.util.List;
1112

@@ -31,6 +32,20 @@ public MySqlReactiveInformationExtractorImpl(ExtractionContext extractionContext
3132
super( extractionContext );
3233
}
3334

35+
@Override
36+
protected int dataTypeCode(String typeName) {
37+
switch ( typeName ) {
38+
case "int":
39+
return Types.INTEGER;
40+
case "enum":
41+
return Types.CHAR;
42+
case "double":
43+
return Types.FLOAT;
44+
default:
45+
return 0;
46+
}
47+
}
48+
3449
@Override
3550
protected String getResultSetTableTypesPhysicalTableConstant() {
3651
return "BASE TABLE";

0 commit comments

Comments
 (0)