In Hibernate, I can register custom SQL fuctions through the Configuration object:
public void registerExtensions(Configuration config) {
config.addSqlFunction("s_sum", new StandardSQLFunction("sum"));
...
}
I wish to switch this configuration from "legacy" Hibernate to JPA.
I've read I can register SQL functions by specializing the dialect there : Registering a SQL function with JPA/Hibernate This is not what I would like to do.
Is there a way to register these functions when building the Entity Manager Factory ?
I'm running Hibernate 4.3 in a Spring 4.1 context.