-->
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.  [ 5 posts ] 
Author Message
 Post subject: HQL statement equivalent for to_char in PostgreSQL
PostPosted: Thu Sep 16, 2004 2:00 pm 
Newbie

Joined: Thu Sep 16, 2004 1:10 pm
Posts: 5
Hi,

Can someone tell me what is the HQL statement equivalent for the following
sql statement ?

select to_char(dob,'DD/MON/YYYY') from user


Regards


Hibernate version:2.1


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 8:24 am 
Beginner
Beginner

Joined: Wed Sep 03, 2003 9:31 am
Posts: 26
Hi. I need that too. I'm using Hibernate 3.0.5.

I saw something about it in this topic:
http://forum.hibernate.org/viewtopic.php?t=934198.

David was saying something about version 3.x address this problem, but doesn't seems to work.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 10:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I have now added these lines:

Code:
      registerFunction( "to_char", new StandardSQLFunction("to_char", Hibernate.STRING) );
      registerFunction( "to_date", new StandardSQLFunction("to_date", Hibernate.DATE) );
      registerFunction( "to_timestamp", new StandardSQLFunction("to_timestamp", Hibernate.TIMESTAMP) );
      registerFunction( "to_number", new StandardSQLFunction("to_number", Hibernate.BIG_DECIMAL) );


To PostgreSQLDialect.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 10:57 am 
Beginner
Beginner

Joined: Wed Sep 03, 2003 9:31 am
Posts: 26
Hi Gavin. Is this working for which version?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 1:02 pm 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
It probably meens it's working in CVS and you'll see it in the next release.

Best regards
Sven

_________________
Please don't forget to give credit, if this posting helped to solve your problem.


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