-->
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.  [ 1 post ] 
Author Message
 Post subject: more than one expression in IN cluase
PostPosted: Mon Aug 15, 2005 10:24 pm 
Newbie

Joined: Fri Jun 10, 2005 12:22 am
Posts: 6
Location: Melbourne/Sydney
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5

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: MySQL

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

The hibernate documentation at 15.11. Subqueries, refers to tuple constructor to perform the following query

from Cat as cat
where not ( cat.name, cat.color ) in (
select cat.name, cat.color from DomesticCat cat
)

My question is how do I perform this type of query binding a parameter list to the IN clause?

My best guess would be :

from Cat as cat
where not ( cat.name, cat.color ) in ( (:name, :color ) )

and

setParameterList("name", namesList);
setParameterList("color ", colorList );

remebering that we want the final SQL too look like this

.... in ( ('tim', 'white'),('peter','blue') )


Would very much appreciate a hint in the right direction as I really don't want to have to write some dynamic native SQL.

Thanks in advance.

Craig.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.