-->
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.  [ 3 posts ] 
Author Message
 Post subject: Is it possible to use string functions like LEFT(name,1)
PostPosted: Thu Oct 30, 2003 3:55 am 
Newbie

Joined: Tue Sep 23, 2003 3:58 am
Posts: 2
Hello

I have been trying to find any information in the hibernate documentation regarding the possibility of using string functions like LEFT(name,1)
but I have not been succesful.

Does anybody know if this is possible.

Regards
/Erik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 4:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 4:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Note that there are no restrictions upon use of SQL functions in the WHERE clause.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.