-->
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.  [ 4 posts ] 
Author Message
 Post subject: need to make an instance of object Set
PostPosted: Fri Jul 28, 2006 5:13 am 
Newbie

Joined: Fri Jul 28, 2006 4:32 am
Posts: 9
Hello I've got POCO object with two variables of ISet data type and
I need to inicialize this variables to add some data into them (variable1.Add(dataObject)) before I load it to DB.

I thought that I can realize this by NHibernateUtil.Initialize(name of variable/property), but it didn't work.

Thank you very much for you answers. Have a nice day.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 8:55 am 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
I think your problem is that you should be creating the instance of the ISet somewhere in your code, like in the definition of the ISet variable or in the new procedure.

This is what I do:

Code:
private ISet someCollection = new Iesi.Collections.HashedSet();


This works fine with me.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 10:45 am 
Newbie

Joined: Fri Jul 28, 2006 4:32 am
Posts: 9
Thank you, but problem is that the hibernate set this property (my ISet property) to NHibernate.Collection.Set type when load it from DB and then when I want to convert this into HashSet type there is Exception "isn't possible to convert NHibernate.Collection.Set to Iesi.Collection.HashSet"


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 12:38 pm 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
lc wrote:
Thank you, but problem is that the hibernate set this property (my ISet property) to NHibernate.Collection.Set type when load it from DB and then when I want to convert this into HashSet type there is Exception "isn't possible to convert NHibernate.Collection.Set to Iesi.Collection.HashSet"


Why do You need to convert it into Iesi.Collection.HashSet?

_________________
If a reply helps You, rate it!


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