-->
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: use set childs inserted but while selecting indefinite loop
PostPosted: Fri Mar 12, 2004 4:56 am 
Newbie

Joined: Fri Mar 05, 2004 2:52 am
Posts: 15
hi,
I am using hibernate 2.1 and sybase.this is my scenario


MovieLibrary
=============
ProgramID int
clientID int


composite key is (clientID,ProgramID)


mapping snippet for MovieLibrary is ---

<composite-id
name="movieLibraryPK"
class="MovieLibraryPK" >
<key-property name="clientID" column="clientID"/>
<key-property name="id" column="ProgramID"/>
</composite-id>

<set name="movies" cascade="all" inverse="true">
<key>

<column name="clientID" not-null="true" />
<column name="ProgramID" not-null="true" />
</key>
<one-to-many class="Movie" />
</set>



Movie
========

episodeID int
effectiveStartDate datetime
ProgramID int
clientID int

composite key is (episodeID,effectiveStartDate,clientID,ProgramID)

mapping snippet for Movie is ---

<composite-id
name="moviePK"
class="MoviePK" unsaved-value="any">
<key-property name="id" column="episodeID"/>
<key-property name="effectiveStartDate" column="effectiveStartDate"/>

<key-many-to-one name="movieLibrary" class="MovieLibrary">
<column name="clientID" not-null="true"/>
<column name="ProgramID" not-null="true"/>

</key-many-to-one>
</composite-id>


when I save session.save(movielibray);
movielibrary object along with Movies is saved.when I try to select a record for movielibrary it is trying to fetch the childs,for which query is generated (which is natural).But the problem is after making a select to fetch the childs it is again trying to fetch the parent from them.so the select statements are recursively printed,some kind of strange behaviour.anybody has answer for this.



Any help is greatly appreciated..
Thanks and Regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 2:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
implement equals/hashcode

_________________
Emmanuel


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.