-->
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.  [ 4 posts ] 
Author Message
 Post subject: how to implement join , outer join in hibernate using hsql
PostPosted: Thu Aug 12, 2004 5:59 am 
hai
please let me know how to implement outer join using hibernate ( hsql)
i have two tables Person ( personid, name)
and Address ( addressno, addressdesc, personid)

how to implement outer join

personid - primary key
addressno - primary key
personid - foreign key


Top
  
 
 Post subject: Re: how to implement join , outer join in hibernate using hs
PostPosted: Thu Aug 12, 2004 8:13 am 
naveenhibernate wrote:
hai
please let me know how to implement outer join using hibernate ( hsql)
i have two tables Person ( personid, name)
and Address ( addressno, addressdesc, personid)

how to implement outer join

personid - primary key
addressno - primary key
personid - foreign key


mapping files:

Person.hbm.xml:


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="Person" table="person">
<id name="personid" column="personid" type="long" unsaved-value="0">
<generator class="native"/>
</id>

<property name="name" column="name"/>
<set name="adds" cascade="all" inverse="true" lazy="true">
<key column="personid"/>
<one-to-many class="Address"/>
</set>
</class>
</hibernate-mapping>





Address.hbm.xml



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="Address" table="address">
<id name="addressno" column="addressno" type="long" unsaved-value="0">

<generator class="native"/>
</id>
<property name="addressdesc" column="addressdesc"/>


<many-to-one name="friends" class="Person" column="personid"/>

</class>
</hibernate-mapping>


Top
  
 
 Post subject: Re: how to implement join , outer join in hibernate using hs
PostPosted: Thu Aug 12, 2004 8:18 am 
naveenhibernate wrote:
hai
please let me know how to implement outer join using hibernate ( hsql)
i have two tables Person ( personid, name)
and Address ( addressno, addressdesc, personid)

how to implement outer join

personid - primary key
addressno - primary key
personid - foreign key


Top
  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 8:39 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
i really don't appreciate you've send me directly a mail!

I'm here to help on the forum when i have time, not to receive many mails from users in a hurry.

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.