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: No row with the given identifier exists.
PostPosted: Tue Mar 11, 2008 5:35 am 
Newbie

Joined: Fri Jan 05, 2007 5:36 am
Posts: 16
I get this error message "No row with the given identifier exists: 94".

This is how I try to do my mapping.

<many-to-one name="Group" class="RespondentGroup" cascade="none" column="RecipientGroupId" lazy="false" />

<bag name="Respondents" table="SurveyPublication_Recipient" cascade="all-delete-orphan" inverse="true">
<key column="RecipientGroupId" />
<one-to-many class="SpecializedRespondent" />
</bag>

If I use lazy="false" I get the error message and if I set lazy="true" then I just get null for everything. No objects at all is retrieved.

What I want to archive is load all Respondents and if they are associated with a Group (there is an existing key linked with the responder) they will be placed in that group. If they are not associated with a group the group property will be set to null.



Cheers,
Yagami


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 11, 2008 8:27 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
If you have a one-to-many relation and the other end is null, hibernate's default behaiour is throwing an exception. Try this:

Code:
<one-to-many class="SpecializedRespondent" not-found="ignore" />


If you use lazy loading, the items will be loaded as soon as you access them.

_________________
--Wolfgang


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.