-->
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: Collection loads in test case, but not web app
PostPosted: Fri Mar 18, 2005 11:36 am 
Newbie

Joined: Mon Aug 30, 2004 5:15 pm
Posts: 13
Hibernate version: 3rc1

Mapping documents:

<class name="Issue" table="issue" discriminator-value="I">
...
<set name="inserts" cascade="none">
<key column="parent_issue"/>
<one-to-many class="com.pga.matrix.issue.InsertIssue"/>
</set>


<subclass name="InsertIssue" discriminator-value="N">
<many-to-one name="parentIssue" class="com.pga.matrix.issue.Issue" column="parent_issue"/>
<property name="inlinePageNumber" type="boolean" column="inlinePageNumber" />
</subclass>
</class>


I recently upgraded my web application from Hibernate 2 to 3. Before the upgrade, things were working fine. Now I am running into some problems. I've read over the migration guide but couldn't find an answer.

I have a test case that runs some code that calls Issue.getInserts(). It works correctly and loads the contents of the inserts collection. When I try to run the same piece of code through my web app (tested on both Tomcat and Jetty), Issue.getInserts() gives me a null value.

My webapp is based on Webwork using a Hibernate interceptor, but my test case uses the same Hibernate factory/session classes as the webapp.

Any ideas on why the collection would not load through my webapp but work in my test case?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 12:59 pm 
Newbie

Joined: Mon Aug 30, 2004 5:15 pm
Posts: 13
I found a work around. In the code that was not working correctly, I was trying to get my collection through the getIssues() method. I have changed the code to now execute an HQL query to get the collection and that seems to work.


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.