-->
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.  [ 5 posts ] 
Author Message
 Post subject: facing problem when use <SET> returns only one row
PostPosted: Fri Jan 27, 2006 3:27 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 7:38 pm
Posts: 25
Hi All,

When i use <set> it return only one row.

but when i executes hibernate generated query it returns 2 rows.

but my log statment shows the size is 1.

what to do??

how to get 2 rows??

thanks in advance

Gopal


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 28, 2006 4:42 am 
Regular
Regular

Joined: Wed Jun 29, 2005 11:14 pm
Posts: 119
Location: København
If the generated SQL returns more than one, you have a problem in your code. Post it here, and we will be able to help you.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 30, 2006 3:25 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 7:38 pm
Posts: 25
thsi is my hbm for parent class

Code:
<set name="profileLog" inverse="false" lazy="false" cascade="all" table="PROFILE_LOG">
   <key column="TRIGGER_ID"/>
   <one-to-many class="com.project.test.model.ProfileLog"/>
   </set>



this is my child hbm


Code:
<many-to-one name="profileEvent" column="TRIGGER_ID" insert="false"   update="false"  class="ProfileEvent"/>   


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 30, 2006 5:24 pm 
Regular
Regular

Joined: Thu May 26, 2005 12:20 am
Posts: 72
what is the java code that fetches and then finds only 1 object?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 31, 2006 2:10 am 
Newbie

Joined: Fri Nov 25, 2005 10:01 pm
Posts: 7
check that the underlying class, the class that
the set is composed of, has the equals set up correctly
(and hashcode). The set will run equals() and if the equals()
is true (between the two entries) it will throw one out, and
you will only see one entry in the set.


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