fix the SQL generator for hsql