-->
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: Named Parameter Question
PostPosted: Fri Dec 05, 2003 10:01 am 
Regular
Regular

Joined: Thu Aug 28, 2003 6:30 am
Posts: 58
I have a query:
SELECT COUNT(*) FROM Organization as org, CompanyProperty as prop WHERE org.id != :orgId AND LOWER(prop.value) IN (:orgNames)

And i want invoke LOWER function on :orgNames list.
That sql query become like this:

select count(*) as x0_0_ from organization organizati0_, multilanguage_property companypro1_ where companypro1_.disc='comp' and ((organizati0_.org_id!=16 )and(LOWER(companypro1_.value)in(lower('bonas') , lower('maxim fr')))

Now i put in orgNames values : LOWER('maxim fr') and etc. but as i understand hibernate makes this as string parameter and i got
... LOWER(companypro1_.value) in ('lower('bonas')' , 'lower('maxim fr')' ...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 10:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Use java to do the force lower case on the agument list rather than the DB.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 12:08 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 6:30 am
Posts: 58
Thank's. But if i want to invoke special function not so simple as LOWER ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You will have to pass them in individually wrapped by the function rather than as a collection.


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.