About the function contributor: I have a custom dialect class and want to add the “match” function to MariaDB, which is basically the same requirement as the initial post.
It seems it is possible without a “org.hibernate.boot.model.FunctionContributor” file. I could do it by overriding “initializeFunctionRegistry”:
public class MariaDBDialectCustom extends org.hibernate.dialect.MariaDBDialect
{
...
@Override
public void initializeFunctionRegistry(FunctionContributions functionContributions) {
super.initializeFunctionRegistry(functionContributions);
functionContributions.getFunctionRegistry().registerPattern("match", "match (?1) against (?2 in boolean mode)",
functionContributions.getTypeConfiguration().getBasicTypeRegistry().resolve(StandardBasicTypes.DOUBLE));
}
}
But according to this thread, custom dialects are discouraged?