my friend... from where you come ? take it easy and review your mapping... probably you have a ICollection<T> property mapped using <bag> but you are instancing a Iesi.HashedSet<T>...
Perhaps I know who is the responsible... perhaps I know from where you come to NHibernate. On Fri, Jul 2, 2010 at 3:07 PM, Graham Bunce <[email protected]>wrote: > ok... an update to this. > > I have a new object. This object has a child collection which is an > intitialised empty iesi hashedset<T>. > > Perform a Save on this parent and NH crashes: > > Unable to cast object of type > > 'Iesi.Collections.Generic.HashedSet`1[iTrace.Domain.Entities.LocationOrderDay]' > to type > > 'System.Collections.Generic.IList`1[iTrace.Domain.Entities.LocationOrderDay]'. > > Of course, Hashed Set doesn't implement the IList<T> interface that > the NH Wrap method seems to need..... Any further advice? > > > at NHibernate.Type.GenericListType`1.Wrap(ISessionImplementor > session, Object collection) at > NHibernate.Event.Default.WrapVisitor.ProcessArrayOrNewCollection(Object > collection, CollectionType collectionType) at > NHibernate.Event.Default.WrapVisitor.ProcessCollection(Object > collection, CollectionType collectionType) at > NHibernate.Event.Default.AbstractVisitor.ProcessValue(Object value, > IType type) at > NHibernate.Event.Default.WrapVisitor.ProcessValue(Int32 i, Object[] > values, IType[] types) at > > NHibernate.Event.Default.AbstractVisitor.ProcessEntityPropertyValues(Object[] > values, IType[] types) at > > NHibernate.Event.Default.AbstractSaveEventListener.VisitCollectionsBeforeSave(Object > entity, Object id, Object[] values, IType[] types, IEventSource > source) at > > NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object > entity, EntityKey key, IEntityPersister persister, Boolean > useIdentityColumn, Object anything, IEventSource source, Boolean > requiresImmediateIdAccess) at > NHibernate.Event.Default.AbstractSaveEventListener.PerformSave(Object > entity, Object id, IEntityPersister persister, Boolean > useIdentityColumn, Object anything, IEventSource source, Boolean > requiresImmediateIdAccess) at > > NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object > entity, String entityName, Object anything, IEventSource source, > Boolean requiresImmediateIdAccess) at > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent > event) at > > NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent > event) at > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent > event) at > > NHibernate.Event.Default.DefaultSaveEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent > event) at > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent > event) at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent > event) at NHibernate.Impl.SessionImpl.Save(Object obj) at > MyApp.NHibernate.Repository.Save(Location item) in .... > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
