In my application I have a mechanism that allows third party code to extend the default behavior allowing to register custom SQL functions at runtime. But, it seems that since this changeset was introduced, I can't register SQL functions in that way anymore.
As far as I know, the current options to register a custom SQL function in Hibernate are the following ones:
Create a custom dialect and register the functions on the constructor.
Get the Configuration object when the app starts and register the SQL functions.
Use a MetadataBuilderInitializer
But none of this options allows to add SQL functions after Hibernate has been set up.