-->
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: HQL Join question
PostPosted: Wed Oct 13, 2004 2:35 pm 
Newbie

Joined: Tue Apr 20, 2004 8:20 pm
Posts: 7
Location: Lake Mary, FL
Hibernate version:

2.1.6

Name and version of the database you are using:

Oracle 9i


I have a question about HQL joins. The ANSI SQL join syntax allows one to specify multiple conditions for specifying a join, using the following syntax:

left outer join table1 table1 on table0_. id=table1_.id and table1_.active_flag = 'Y'

So far in Hibernate, I have seen that you can define a relationship between two objects/tables with a key field.

<set name="incidentContractRelationships"
lazy="true"
inverse="true">
<key column="contract_id"/>
</set>

I know that you can specify a where clause as part of this relationship:

<set name="incidentContractRelationships"
lazy="true"
inverse="true"
sort="unsorted"
where="active_flag = 'Y'">

<key column="contract_id"/>
</set>

However, if you do this, then the where clause will be applied in the where clause, not in the join clause. This will not give you the correct results.

Is there any way to have Hibernate specify multiple conditions for joining two tables?

Thanks!
Patrick


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2004 4:48 pm 
Newbie

Joined: Tue Apr 20, 2004 8:20 pm
Posts: 7
Location: Lake Mary, FL
OK after searching the forum, I found the following post:

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

It appears that Christian has already answered this question (although I did not find this in the FAQ anywhere....)

Will we have this capability in Hibernate 3?

Thanks!
Patrick


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2004 4:52 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Likely

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.