Registering a SQL function with JPA and Hibernate
You might read articles telling you to register the SQL function by extending the Hibernate Dialect, but that’s a naive solution. Since Hibernate ORM 5.2.18 and 5.3.1, the best way to register a SQL function is to supply a MetadataBuilderContributor like this: public class SqlFunctionsMetadataBuilderContributor implements MetadataBuilderContributor { @Override public void contribute(MetadataBuilder metadataBuilder) { metadataBuilder.applySqlFunction( … Read more