HHH-18869 Override Dialect.equivalentTypes in MariaDBDialect to return true for JSON vs LONGTEXT

See https://mariadb.com/kb/en/json-data-type/
This commit is contained in:
Čedomir Igaly 2024-12-04 11:35:26 +01:00 committed by Christian Beikov
parent de8a565293
commit c21568f77c

View File

@ -6,6 +6,7 @@
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.sql.Types;
import org.hibernate.boot.model.FunctionContributions;
import org.hibernate.boot.model.TypeContributions;
@ -313,4 +314,11 @@ public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, D
public String getDual() {
return "dual";
}
@Override
public boolean equivalentTypes(int typeCode1, int typeCode2) {
return typeCode1 == Types.LONGVARCHAR && typeCode2 == SqlTypes.JSON
|| typeCode1 == SqlTypes.JSON && typeCode2 == Types.LONGVARCHAR
|| super.equivalentTypes( typeCode1, typeCode2 );
}
}