> How about we get a list of ANSI-standard SQL functions and portably
> support those and those only (I don't think there are many of them).

This makes a lot of sense.  However, what if something so commonly used (like a
current_timestamp() function) is not part of the ANSI standard (assuming ANSI
SQL-92)?  Would you make exceptions for that?

I like the query substitution feature, but that requires effort on part of the
developer for even the most common tokens.  I certainly agree that feature is
valuable for the occasional weird tokens a user may need.  But highly common
substitutions that are supported by all rdmbs implementions should naturally be
part of the corresponding Dialect.

Thinking out loud here, but for aliases for commonly used SQL functions/tokens,
wouldn't it be good to define them as part of the dialect via an internal lookup
table?  These HQL standard aliases could also be prefixed with a hql identifier
to make it easy to signify when substitution should occur (and would be used as
the key in the Dialect's lookup table).

(stupid example...returns everything...but you get the idea):
from MyClass obj where obj.creationTime < hql:now

examples:
hql:current_date
hql:current_time
hql:current_timestamp or hql:now

or you could ignore this approach completely and just use a function signature
itself as the token for lookup:

current_date()
current_time()
current_timestamp() or now()

although it seems logical to me that the first approach would be easier for a
lexical analyzer to handle.

Just pondering...

Cheers,

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

Reply via email to