-->
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
PostPosted: Tue Nov 09, 2004 6:44 am 
Beginner
Beginner

Joined: Tue Nov 09, 2004 6:26 am
Posts: 32
[b]Hibernate version: [/b] 2.1.4

[b]Mapping documents:[/b]

<class name="Member" table="MEMBER">
<id name="id" column="KMEMBER" type="integer">
<generator class="native"/>
</id>
<property name="memname" column="MEMNAME" type="string" not-null="true" />
<one-to-one name="memberAssociation" class="MemberAssociation" property-ref="child"/>
</class>

<class name="MemberAssociation" table="MEMBER_ASSOCIATION">
<id name="id" column="KMA" type="integer">
<generator class="native"/>
</id>
<property name="parent" column="FKPARENT" type="integer" not-null="true" />
<property name="child" column="FKCHILD" type="integer" not-null="true" />
</class>

<class name="MemberAddress" table="MEMBER_ADDRESS">
<id name="id" column="KMADDR" type="integer">
<generator class="native"/>
</id>
<property name="member" column="FKMEMBER" type="integer" not-null="true" />
<property name="address" column="ADDRESS" type="string" not-null="true" />
</class>

I wish to obtain the childs and their parents (but not every child has a parent).
I tryed something like this, but id doesn't work...

select
cmember.memname, pmember.memname, ma.address
from
Member as cmember,
Member as pmember,
MemberAddress as ma
left join fetch
cmember.memberAssociation memberAssociation
where
memberAssociation.parent = pmember.id and
pmember.id = ma.member


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 16, 2004 4:18 am 
Beginner
Beginner

Joined: Tue Nov 09, 2004 6:26 am
Posts: 32
I don't understand...
I'm just a beginner. I realy stumbled on a problem that big?


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.