-->
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.  [ 1 post ] 
Author Message
 Post subject: Join relationships using a single table in hibernate..
PostPosted: Tue Aug 03, 2004 2:01 am 
Newbie

Joined: Tue Jul 20, 2004 12:27 am
Posts: 8
Hi,
Is it possible to use join relationships using single table in hibernate......
My query looks like this.....

"select i from com.vstl.hybernate.action.Item as i left outer join fetch com.vstl.hybernate.action.Item as j"

will this work with slight modifications in the Item.hbm.xml file....which looks like this.....Plz help me out.

<?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="com.vstl.hybernate.action.Item" table="item" >
<id name="id" column="id" type="java.lang.Long" >
<generator class="identity" />
</id>
<many-to-one name="noname" column="name" property-ref="name" class="com.vstl.hybernate.action.Item" update="false" insert="false" outer-join="true" />

<property name="name" column="name" type="java.lang.String" />
<property name="description" column="description" type="java.lang.String" />
</class>
</hibernate-mapping>

Thanks in advance...

_________________
Aru


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.