Starting from 2.1 beta 1 I added dialect functions where functions similar to this can be used by specific dialects. At this point the only dialect I have enhanced is the Oracle dialect. I was intending to do HSQL as well (when I get some time) it is easy to add the fucntions to the dialect. It allows:
o Database specific functions in the HQL select clause.
o The functions can be nested, eg, select round(trunc(n.num)) ....
o The functions can have no arguments, select currentDate() ....
o The no-argument fucntions may be defined to have no parentesis, eg, select sysdate, ..... (Note: this is an Oracle function).
Currently there is a limitation. Functions that have multiple arguments in HQL are currently not supported. This is as much to do with HQL not supporting literal types in the select clause and the fact that the parser is quite workable but not a lookhead design thus it complicates things like this. I have several Hibernate items to attend to before I intend to fill in the gaps but I intend to address both limitations.
|