-->
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: using to_char function from hibernate
PostPosted: Sun Sep 05, 2004 1:23 am 
Newbie

Joined: Sun Apr 18, 2004 2:29 am
Posts: 18
hi guys

i need to use a function like oracle's to_char from hibernate. is there any equivalent function of to_char in hibernate.pls help

regards
Shamim

Hibernate version: 2.1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:oracle9

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 05, 2004 8:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
It is already a part of the Oracle dialect so just use it as would in SQL, eg, select to_char(c.field) ....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 18, 2004 5:48 pm 
Newbie

Joined: Thu Sep 16, 2004 1:10 pm
Posts: 5
like this ???

select to_char(userinfo.userdob,'DD/MON/YYYY') from userinfo userinfo


regards
James


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 19, 2004 8:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Constants are a problem for the parser in the select clause (HB3.x will address this). Having said that Steve made some changes in the area of functions for 2.1.6 and I have not had cause to try it to this point. Try it and see.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 20, 2004 4:06 am 
Newbie

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

Had my own work around, hope I still get to see 3.x when it is ready.


regards
James


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.