-->
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: Table Joins Hibernate 3
PostPosted: Mon Apr 04, 2005 10:47 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

I am using Hibernate 3 latest release

I have 3 tables call them T1, T2 and T3 and they all bind on column bindColumn.

what would the HSQL statement be for binding t1 inner jion t2 and t1 left join t3

I thought it would be

select t1, t2, t3 FROM (T1 as t1 inner join T2 as t2
ON t1.bindColumn = t2.bindColumn)
left join T3 as t3
ON t1.bindColumn = t3.bindColumn

I know this is basic but i actually need to prove that hibernate can bind 7 tabes together with various inner and left joins to get it accepted.

your help would rock.

gavins talk at jboss world was good btw

_________________
LET IT BE :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 04, 2005 12:03 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
show mapping files

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 04, 2005 1:35 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 10:43 am
Posts: 38
Location: Chicago
<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1

http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->

<class
name="net.test.abbotguitester.hibernate.T1"
table="SKUL"
>

<id
name="bindColumn"
type="java.lang.String"
column="BIND_COLUMN"
>
<generator class="assigned" />
</id>

<property
name="itemNo"
type="java.lang.String"
column="ITEM_NO"
length="65"
/>
</class>
</hibernate-mapping>

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1

http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->

<class
name="net.test.abbotguitester.hibernate.T2"
table="SKUL"
>

<id
name="bindColumn"
type="java.lang.String"
column="BIND_COLUMN"
>
<generator class="assigned" />
</id>

<property
name="itemNo"
type="java.lang.String"
column="Sales_person"
length="300"
/>
</class>
</hibernate-mapping>

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1

http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->

<class
name="net.test.abbotguitester.hibernate.T3"
table="SKUL"
>

<id
name="bindColumn"
type="java.lang.String"
column="BIND_COLUMN"
>
<generator class="assigned" />
</id>

<property
name="itemNo"
type="java.lang.String"
column="customer"
length="300"
/>
</class>
</hibernate-mapping>

T1 -> T2 one to one
T1 -> T3 one to 0 or 1

should i be specifying the relationships in the maping?
thanks for the fast response

_________________
LET IT BE :)


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.