-->
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: additional conditions in join clauses
PostPosted: Thu Jul 15, 2004 5:26 am 
Regular
Regular

Joined: Wed May 05, 2004 8:01 am
Posts: 53
I have a query that I found needs an additional condition in join clause. Is this kind of feature planned in Hibernate?

Example:

Code:
select dr.id, dr.dueDate, c.name, sd.name, d.id, d.name
from Survey s right outer join s.dueReport dr *** with s.merchandiser = ? ***
join dr.surveyDefinition sd join sd.contractor c,
Merchandiser m
join m.tasks t join t.depot d
where s is null
and t.surveyDefinition = sd
and m = ?


Briefly saying the query searches for all surveys that have not been done by particular user. There might be another same surveys made by other users so I need to introduce addional condition in right outer join.

I might also use subselect - the problem is my database is MySQL and this feature is also not available.

Without the solution I will end up with making one master query and thousands details query (list all "tasks" and check if they have been done by particular user by querying survey existence). The number of queries will also grow in time making the function call last longer and longer.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 15, 2004 5:47 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
please don't crosspost

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 15, 2004 5:47 am 
Regular
Regular

Joined: Wed May 05, 2004 8:01 am
Posts: 53
Sorry, It was meant for appliation architecture topic and not miscellaneous. Please post replies there.


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.