-->
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: newbie question - looking for "Item" property
PostPosted: Thu May 19, 2005 10:43 am 
Newbie

Joined: Mon May 16, 2005 6:48 pm
Posts: 9
i'm trying to get an insert/retrieve/update/delete etc. test application up and running using nHibernate.
I'm using the parent/child example that comes with nHibernate as a starting point.
So, there's a parent and a child, and the nUnit test adds a couple children to the parent class. I now want to create a method/property on the Parent class that allows you to retrieve a single child. Like an Item property. The "Children" property of the Parent class is of type Iesi.Collections.ISet. I don't see any "Item" property on this class, nor do I see it on DictionarySet, Set, SynchonizedSet etc...
Can someone please tell me a standard way of implementing this kind of "basic" functionality on a parent class , allowing you to retrieve a single child object?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 2:26 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
An ISet doesn't allow random access (by index), that's why no Item property is available. You probably need a <bag> (mapped to IList).


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.