Skip to content

Commit 4c3e049

Browse files
maesenkambellade
authored andcommitted
HHH-19254 - fix Geometry (sub)type resolution for the MariaDB dialect
1 parent cadd675 commit 4c3e049

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.sql.DatabaseMetaData;
88
import java.sql.SQLException;
99
import java.sql.Types;
10+
import java.util.Set;
1011

1112
import org.hibernate.PessimisticLockException;
1213
import org.hibernate.boot.model.FunctionContributions;
@@ -59,6 +60,16 @@
5960
public class MariaDBDialect extends MySQLDialect {
6061
private static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 10, 5 );
6162
private static final DatabaseVersion MYSQL57 = DatabaseVersion.make( 5, 7 );
63+
private static final Set<String> GEOMETRY_TYPE_NAMES = Set.of(
64+
"POINT",
65+
"LINESTRING",
66+
"POLYGON",
67+
"MULTIPOINT",
68+
"MULTILINESTRING",
69+
"MULTIPOLYGON",
70+
"GEOMETRYCOLLECTION",
71+
"GEOMETRY"
72+
);
6273

6374
public MariaDBDialect() {
6475
this( MINIMUM_VERSION );
@@ -158,7 +169,7 @@ public JdbcType resolveSqlTypeDescriptor(
158169
}
159170
break;
160171
case VARBINARY:
161-
if ( "GEOMETRY".equals( columnTypeName ) ) {
172+
if( GEOMETRY_TYPE_NAMES.contains( columnTypeName ) ) {
162173
jdbcTypeCode = GEOMETRY;
163174
}
164175
break;

0 commit comments

Comments
 (0)