Skip to content

Commit

Permalink
HHH-18869 Override Dialect.equivalentTypes in MariaDBDialect to retur…
Browse files Browse the repository at this point in the history
…n true for JSON vs LONGTEXT

          See https://mariadb.com/kb/en/json-data-type/
  • Loading branch information
cigaly authored and beikov committed Dec 9, 2024
1 parent de8a565 commit c21568f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
}

0 comments on commit c21568f

Please sign in to comment.