I have a problem in that the syntax for datediff in mysql is different from that in hsqldb:
mysql: datediff(date1,date2)
hsqldb: datediff(interval,date1,date
I would say that the easiest solution is to create your own custom HSQLDB dialect, extending the existing HSQLDB dialect. Then, in the constructor, register a function to handle datediff(date1, date2) to be translated into datediff(interval, date1, date2), provided that interval would be a static value. Something like this:
registerFunction( "datediff", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "datediff(interval, ?1, ?2)" ) );