In the select clause there is the option to include the current date native function as a part of the dialect. As Joshua stated the parser looks these tokens up from the current dialect when its parsing this part of the query. Currently there is no alias. I had considered adding it but decided not to for the moment. Gavin has said you can use substitution as a workaround but I have not tried it.
I kind of prefer the idea of aliases so over time we can decide on an offical HQL name for these functions. Many of which are the same across database vendors but current date varies greatly. I should look at every supported database and see what is common and move it into the base dialect just as max(), min() etc are implemented. Now the where clause passes the items as is through to the SQL engine if it cannot determine its a table alias. Thus all native functions are available. There is currently no dialect mappings for this section of the parser. If we use aliasses and/or move them into official HQL token then, some functions that are valid in this clause of HQL, would require the mapping to be applicable in the where clause aswell. Cheers David. ----- Original Message ----- From: "Les A. Hazlewood" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 17, 2003 8:08 AM Subject: RE: [Hibernate] Re: AST parser for HQL > > I am not familiar with the 'current date' construct in this example: > > "from Calendar cal where cal.holidays.maxElement > current date" > > > > Is 'current' a function? If so, is 'date' the argument? Is this ORACLE > > specific? > > "current date" would need to be a Hibernate defined token. > > Oracle uses "sysdate" for the current date/time > Postgres uses "now" .... > etc, > etc, > > IMHO, I think the token "now" would be good to use, since its a little more > intuitive than sysdate or most other timestamp tokens out there. For example, > when looking at the tokens "sysdate" or "CURRENT_DATE" does that just mean an > SQL date and not a timestamp? In Oracle it doesn't. What about tokens like > "CURRENT_TIME"? Does that just mean an SQL time and not a timestamp? > > Maybe tokens like CURRENT_TIMESTAMP or "now" make more sense for the current > system timestamp.... > > Les > > > ------------------------------------------------------- > This SF. Net email is sponsored by: GoToMyPC > GoToMyPC is the fast, easy and secure way to access your computer from > any Web browser or wireless device. Click here to Try it Free! > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl > _______________________________________________ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel ------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel