-->
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: hibernate.query.substitutions for functions with parameters
PostPosted: Thu Jun 29, 2006 9:37 am 
Beginner
Beginner

Joined: Sat Jan 29, 2005 8:49 pm
Posts: 20
Hibernate version:
3.1.3

Is there a nice way to make a substitution of a function that needs extra parameters?

ORACLE
week(date) -> TO_CHAR(date, 'WW')

MSSQL
week(date) -> FORMAT(date, 'WW')

would be cool to have something like that
Code:
<property name="hibernate.query.substitutions">week TO_CHAR($1, 'WW')</property>


Top
 Profile  
 
 Post subject: works, but ...
PostPosted: Thu Jun 29, 2006 2:57 pm 
Beginner
Beginner

Joined: Sat Jan 29, 2005 8:49 pm
Posts: 20
ok it is possible to write a hql query like this

Code:
"select to_char(mc.date, 'ww') from mc"


and i found that all the functions are defined in the dialect implementation org.hibernate.dialect.Dialect.java but i still think it would be nice to have a way to make a call to a StandardSQLFunction using a substitution parameter.


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.