Thanks for the reply. I have created a custom dialect which extends the Dialect I'm using. It registers the NoArgSQLFunction, specifiying the name of the function. For a test, I wanted to see if the HQL parser would "ignore" the test SQL function "my_month_func"; however, it is still trying to parse it. I'd expect it to fail on the database end.
I'm making an assumption I don't have to create a custom SQLFunction?
Code:
package test;
import org.hibernate.Hibernate;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.SQLFunction;
public class CustomlDialect extends DB2390Dialect {
public CustomlDialect() {
SQLFunction sqlFunction = new NoArgSQLFunction("my_month_func",Hibernate.INTEGER, true);
registerFunction("my_month_func", sqlFunction);
System.out.println("Registered sql function: "+sqlFunction.getClass());
}
}