-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to using substring in Hibernate HQL?
PostPosted: Thu Dec 16, 2004 7:00 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Hi everyone:

Does someone use substring function in Hibernate? I know in MySQL the function is called "SUBSTRING" ,but in Oracle this function is written to "substr". I want to my application don't dependence any database. So Hibernate support any function like "substring" ? I mean how to cut substring in HQL?
Thks

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 9:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Currently, the funstions are defined in the dialect so there is no Hibernate alias where substitution occurs. We talked a little about it some time ago but it is not the focus. The new parser will make all of these type of features much easier to add going forward.


Top
 Profile  
 
 Post subject: :(
PostPosted: Wed Dec 22, 2004 4:33 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
david wrote:
Currently, the funstions are defined in the dialect so there is no Hibernate alias where substitution occurs. We talked a little about it some time ago but it is not the focus. The new parser will make all of these type of features much easier to add going forward.


Do you mean that Hibernate 3 will support it? Or other alternative method can do this? Expecting some idea. Thks

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2009 11:49 am 
Regular
Regular

Joined: Tue Feb 19, 2008 6:05 pm
Posts: 82
So cast(substring(someString,3),integer) works for both MySql and Oracle, but why do we have so many substr functions in Hibernate HQL and where can we know the usage of each one of these functions?


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