Migrate Hibernate 5 to 6 with Spring Boot 2.7.x to 3

Could somebody let me know how can I migrate below custom dialect to use st_distance_sphere mysql standard function(but it’s not standard for JPQL, dependent on MySQL or MariaDB)…?

Sorry for my short english, I’m not fluent in english because I’m not a native english speaker.
(I’m South Korean.)

@Configuration
public class MySQLCustomDialect extends MySQLDialect {
    public MySQLCustomDialect() {
        super();

        this.registerFunction("ST_Distance_Sphere", new StandardSQLFunction("ST_Distance_Sphere", StandardBasicTypes.DOUBLE));
    }
}

This is my Spring Boot JPA configurations (not migrated to 3.0 yet)

# JPA Configuration
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.database=mysql
spring.jpa.database-platform=com.dmtlabs.aidocentserver.global.base.MySQLCustomDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.default_batch_fetch_size=1000

Done by myself.

package com.dmtlabs.aidocentserver.global.base;

import org.hibernate.boot.model.FunctionContributions;
import org.hibernate.boot.model.FunctionContributor;
import org.hibernate.type.StandardBasicTypes;

public class MySQLDBFunction implements FunctionContributor {

    @Override
    public void contributeFunctions(FunctionContributions functionContributions) {
        functionContributions.getFunctionRegistry().registerNamed(
                "ST_Distance_Sphere", functionContributions.getTypeConfiguration().getBasicTypeRegistry().resolve(StandardBasicTypes.DOUBLE)
        );
    }
}

application.properties (Spring Boot 3.1.0)

# JPA Configuration
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.database=mysql
spring.jpa.properties.hibernate.function_contributor=com.dmtlabs.aidocentserver.global.base.MySQLDBFunction
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.default_batch_fetch_size=1000

(other configuration is irrelevant, setting spring.jpa.properties.hibernate.function_contributor is worked.)