-->
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: composite primary key where clause
PostPosted: Mon Mar 29, 2010 5:03 pm 
Newbie

Joined: Mon Mar 29, 2010 4:54 pm
Posts: 1
HQL:
Select distinct (sourceAlias) From A as sourceAlias join sourceAlias.refCollection as newAlias where newAlias.id is not null

Here in the above query newAlias.id returns a composite primary key, hence the sql is
select ...... where(pk1,pk2) is not null
ERROR util.JDBCExceptionReporter - Operand should contain 1 column(s)

how can we convert into HQL which is equivalent to SQL
select .... where(pk1 not null, pk2 not null)


Top
 Profile  
 
 Post subject: Re: composite primary key where clause
PostPosted: Thu Jul 08, 2010 5:58 am 
Newbie

Joined: Mon Feb 01, 2010 5:12 am
Posts: 4
Have you managed to solve this? I am curious about this too, tks!


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.