-->
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: Outer join help
PostPosted: Mon Nov 28, 2005 6:24 pm 
Newbie

Joined: Mon Nov 28, 2005 5:50 pm
Posts: 2
Hi,

Is there a way to do a outer join between 2 objects using the mappings posted below?

An Investigation might not have an alarm, in oracle I would use the '(+)' operator, what I would like to do in HQL is something like this:

select i, a
from Investigation i,
Alarm a
where i.id = ?
and i.alarmId = a.id (+)

given the mappings below how can I create a HQL query to accomplish this?

Thanks,
Amir

Hibernate version: 3.0

Mapping documents:
<hibernate-mapping>

<class name="Investigation" table="investigation" lazy="false">

<id name="id" column="id" access="field">
<generator class="sequence">
<param name="sequence">investigation_serial</param>
</generator>
</id>

<property name="alarmId" column="alarm_id" access="field"/>

</class>

</hibernate-mapping>

<hibernate-mapping>

<class name="Alarm" table="alarm" lazy="false">

<id name="id" column="id" access="field">
<generator class="sequence">
<param name="sequence">alarm_serial</param>
</generator>
</id>

<property name="name" column="name" />

</class>

</hibernate-mapping>

Name and version of the database you are using: Oracle 9i


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 28, 2005 8:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You cannot. You need to map the many-to-one instead of the key property then you can do the out join in HQL.


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.