|
Partly right, I agree that the provided stack trace is not very helpful here, sorry.
The trim-function is built using the following methods: public static String buildTrimStringExpression(final Connection connection, final String varName) throws SQLException { final SQLFunction sqlFunction = getSqlFunction(connection, "trim"); return sqlFunction.render(StandardBasicTypes.STRING, Arrays.asList(varName), null); }
private static SQLFunction getSqlFunction(final Connection connection, final String functionName) throws SQLException { final Dialect dialect = resolveDialect(connection); final SQLFunction sqlFunction = dialect.getFunctions().get(functionName); if (sqlFunction == null) { throw new SQLException("Failed to find '" + functionName + "' function for dialect " + dialect); }
return sqlFunction; }
I hope now that you believe me, that the resolveDialect-method correctly returns the HSQLDialect. In fact within this resolveDialect method I'm extending the dialect with the different template: final Dialect dialect = standardDialectResolver.resolveDialect(metaData); if (dialect instanceof HSQLDialect) { // TODO (mah 14.07.2011): patch for issue https://hibernate.onjira.com/browse/HHH-6122 // HSQLDB needs the "both from" keywords in trim function dialect.getFunctions().put("trim", HSQLDB_TRIM_TEMPLATE); }
Was I able to explain the problem now?
Best regards, Mattin
|