-->
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.  [ 3 posts ] 
Author Message
 Post subject: One to Many Set won't load
PostPosted: Mon Aug 23, 2004 10:44 am 
Newbie

Joined: Mon Aug 23, 2004 4:33 am
Posts: 4
I'm trying to access a set in a one to many relationship so that I can delete some child records from it. Unfortunately, no matter what I try I always get an empty set.

I can call the method on the class to return the set of child items

eg Set temp = investigation.getInvestigationQualityOutcomes();

and temp is populated but if I examine the investigation object the InvestigationQualityOutcomes set is empty.

The mappings are:

<hibernate-mapping>
<class
name="com.aniteps.ctms.om.Investigation"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
>
<id
name="investigationId"
column="investigationId"
type="java.lang.Integer"
>

<snip>

<set
name="investigationQualityOutcomes"
lazy="true"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="investigationId"
>
</key>

<one-to-many
class="com.aniteps.ctms.om.InvestigationQualityOutcome"
/>
</set>

and for the child:

<hibernate-mapping>
<class
name="com.aniteps.ctms.om.InvestigationQualityOutcome"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
>

<id
name="investQualityOutcomeId"
column="investQualityOutcomeId"
type="java.lang.Integer"
>

<snip>

<many-to-one
name="investigation"
class="com.aniteps.ctms.om.Investigation"
cascade="all"
outer-join="auto"
update="true"
insert="true"
access="property"
column="investigationId"
not-null="true"
/>

I'm new to Hibernate so don't know where to begin. Any ideas what could be going wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 10:54 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
but if I examine the investigation object the InvestigationQualityOutcomes set is empty.


try examining it again after Set temp = investigation.getInvestigationQualityOutcomes();

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 11:06 am 
Newbie

Joined: Mon Aug 23, 2004 4:33 am
Posts: 4
Still empty.

I was expecting the call to Set temp = investigation.getInvestigationQualityOutcomes(); to have populated the set for me but unless I'm going completely bonkers the set was still empty.


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