Hi there,
I am currently migrating projects from Hibernate 5 to Hibernate 6 and I have to use FunctionContributors to provide some function descriptors for different databases. So far this is fine and I understand how to register them through the Java Service Loader.
Then I created some tests to verify behaviour before and after the migration. And these tests are required for PostgreSQL and Oracle databases. But I cannot register FunctionContributors for different databases though the Java Service Loader. At least I am not aware of it.
I checked the javadoc of FunctionContributor (FunctionContributor (Hibernate Javadocs)). It mentions org.hibernate.cfg.Configuration#registerFunctionContributor
or org.hibernate.boot.MetadataBuilder#applyFunctions
. But I am working with Spring and JPA projects and did not find any information on how to access an object of any of those.
So I switched to using a MetadataBuilderContributor
, but it is deprecated and marked for removal.
Does anybody have an idea, how to access Configuration
or MetadataBuilder
through a Spring configuration? I am only aware of DataSource
, JpaTransactionManager
, LocalContainerEntityManagerFactoryBean
and some Hibernate properties.
Or are there other alternatives to register FunctionContributors? Please let me know.
Kind regards,
Marko Skocibusic