-->
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: Using IN condition for long types
PostPosted: Mon Mar 20, 2006 3:58 pm 
Newbie

Joined: Mon Mar 20, 2006 3:53 pm
Posts: 1
I have a where condition in my query checking long column

where long_type IN (4,5)

m creating "str = (4,5)" in my code and setting to positional parameter using

q.setString(0,str);

but the query fails ,it says

Invalid character string format for type INTEGER.

Any clue how to make it work?

Thanks in advance
Shail


Top
 Profile  
 
 Post subject: list
PostPosted: Mon Mar 20, 2006 6:40 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
/**
* Bind multiple values to a named query parameter. This is useful for binding
* a list of values to an expression such as <tt>foo.bar in (:value_list)</tt>.
* @param name the name of the parameter
* @param vals a collection of values to list
* @param type the Hibernate type of the values
*/
public Query setParameterList(String name, Object[] vals, Type type) throws HibernateException;

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.