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: NHibernate Newbie... I need help with association collection
PostPosted: Thu Feb 07, 2008 8:01 pm 
Newbie

Joined: Tue Oct 16, 2007 4:45 pm
Posts: 6
Hello,

my answer will be quick, i have, suppose...

Class Survey
Class Topics
Class Questions

i want to be able to do.

Survey.Topics.Questions


what i do...

NHibernate.ICriteria iCri = NHibernateHelper.Instance.createCriteria(typeof(NH.Survey));
iCri.List<NH.Survey>()[0].Topics[0].Survey;

and that tell's me that "Failed to lazily initialize a collection".

in the xml i didnt specify anything about the fetch type... i cant get this working...


thanks for any help!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 08, 2008 3:58 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Have you specified lazy="false" in your collection mapping ? I think that defaults to true, which results in lazy loading.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 08, 2008 7:55 am 
Newbie

Joined: Tue Oct 16, 2007 4:45 pm
Posts: 6
thanks for your time!

it was a xml error configuration, it was mapping a column, and that column wasnt there any more...


THANKS!


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.