-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: DB functions within HQL parser
PostPosted: Thu Jun 17, 2004 7:03 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
I read somewhere that v2.2 will include an interface to the HQL parser. I am interested in whether this will allow me to use db specific functions by customising the dialects. Functions like isnull, dateadd etc from SQLServer.

For example dateadd().

In SQLServer:

dateadd( getdate(), dd, 5 ) // add 5 days

Oracle

sysdate + interval '5' day

MySQL

now() + interval 5 day

So would it be possible to define my own pseudo function ( say dateadd() )like SQLServer and write a plugin that will convert dateadd( x, y, z ) to the relevant syntax depending on the dialect, or alternatively write a new dialect for each db to do this?

Is this what the parser will be able to do or is there some other way of achieving the above, either now or in 2.2 with the new parser?

Any information or suggestions would be appreciated as would a rough guess as to when 2.2 might be available.

I have looked at the JDBC functions ( TIMESTAMPADD ) but no Oracle JDBC driver seems to support it.

Cheers.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 17, 2004 10:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Hibernate 3.0 will have a new parser for HQL which will make extending current DB function support feature set and adding arithmetic operations much easier. How much is completed above current support and when cannot currently be discussed since its not in stone as yet. The final is some time off but beta will start soon(ish).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.