-->
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.  [ 3 posts ] 
Author Message
 Post subject: Multiple createCriteria in collection and only one join
PostPosted: Fri Jun 18, 2004 1:06 pm 
Beginner
Beginner

Joined: Thu Aug 28, 2003 3:09 pm
Posts: 39
Location: Brazil
Hi all,

I'm trying to create a query with Criteria API where I call multiple times createCriteria in the same collection property.

What I wanted to do is many inner joins in the same table but when hibernate send the sql query, it only does one inner join.


sql generated:

Code:
select this.iCodigo as iCodigo1_, this.sAssunto as sAssunto1_,

from PARENT this inner join CHILD i1 on this.iCodigo=i1.iProcesso where lower(i0.sNome) like ? and lower(i1.sNome) like ?



What I wanted:

Code:
select this.iCodigo as iCodigo1_, this.sAssunto as sAssunto1_,

from PARENT this inner join CHILD i1 on this.iCodigo=i1.iProcesso inner join CHILD i0 where lower(i0.sNome) like ? and lower(i1.sNome) like ?




Note that where clause is being correcly generated. But there is only one inner join.

Am I missing something?

What I want is to get all parents which have childs in commons. This commonality is given by the filed sNome of CHILD.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 18, 2004 2:15 pm 
Beginner
Beginner

Joined: Thu Aug 28, 2003 3:09 pm
Posts: 39
Location: Brazil
My problem is the same as:

http://forum.hibernate.org/viewtopic.php?t=931249


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 05, 2004 9:31 am 
Beginner
Beginner

Joined: Mon Jul 05, 2004 9:29 am
Posts: 38
exactly the same problem for me...

is it a bug (then when will it be fixed?) or a bad use of createCriteria (then what's the right way to do it?)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.