Action Jackson
2011-08-31 04:52:05 UTC
Hi all,
I'm using Jose's Net4Collections classes to get NHibernate to work
with the collections built into the .NET framework. I'm getting an
error that I can't decipher. It appears to be blowing up in the
'GetDeletes' method of the PersisentGenericSet class. I'm not sure
why GetDeletes is even called since I'm not trying to delete anything.
Unable to cast object of type
'SetSnapShot`1[Content.Base.Category,System.Object]' to type
'ISetSnapshot`1[Content.Base.Category,Content.Base.Category]'.
Here's the Category class:
public class Category:DomainObject
{
public virtual Category ParentCategory { get; set; }
public virtual ISet<Category> ChildCategories { get; protected
set; }
public virtual void AddChildCategory(Category category)
{
category.ParentCategory = this;
ChildCategories.Add(category);
}
}
The error occurs when I try to persist like so:
using (new UnitOfWorkScope())
{
Category parentCategory = _categoryRepository.Get(x => x.Name ==
"Mathematics");
parentCategory.AddChildCategory(new Category("child"));
_categoryRepository.Add(parentCategory);
}
Here's a portion of the stack trace:
at
Infrastructure.Implementations.Data.PersistentGenericSet`1.GetDeletes(ICollectionPersister
persister, Boolean indexIsFormula) in Net4Collections.cs: line 619
at
NHibernate.Persister.Collection.AbstractCollectionPersister.DeleteRows(IPersistentCollection
collection, Object id, ISessionImplementor session)
at NHibernate.Action.CollectionUpdateAction.Execute()
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
at NHibernate.Engine.ActionQueue.ExecuteActions()
at
NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource
session)
at
NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent
event)
at NHibernate.Impl.SessionImpl.Flush()
Any ideas?? Thanks!
I'm using Jose's Net4Collections classes to get NHibernate to work
with the collections built into the .NET framework. I'm getting an
error that I can't decipher. It appears to be blowing up in the
'GetDeletes' method of the PersisentGenericSet class. I'm not sure
why GetDeletes is even called since I'm not trying to delete anything.
Unable to cast object of type
'SetSnapShot`1[Content.Base.Category,System.Object]' to type
'ISetSnapshot`1[Content.Base.Category,Content.Base.Category]'.
Here's the Category class:
public class Category:DomainObject
{
public virtual Category ParentCategory { get; set; }
public virtual ISet<Category> ChildCategories { get; protected
set; }
public virtual void AddChildCategory(Category category)
{
category.ParentCategory = this;
ChildCategories.Add(category);
}
}
The error occurs when I try to persist like so:
using (new UnitOfWorkScope())
{
Category parentCategory = _categoryRepository.Get(x => x.Name ==
"Mathematics");
parentCategory.AddChildCategory(new Category("child"));
_categoryRepository.Add(parentCategory);
}
Here's a portion of the stack trace:
at
Infrastructure.Implementations.Data.PersistentGenericSet`1.GetDeletes(ICollectionPersister
persister, Boolean indexIsFormula) in Net4Collections.cs: line 619
at
NHibernate.Persister.Collection.AbstractCollectionPersister.DeleteRows(IPersistentCollection
collection, Object id, ISessionImplementor session)
at NHibernate.Action.CollectionUpdateAction.Execute()
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
at NHibernate.Engine.ActionQueue.ExecuteActions()
at
NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource
session)
at
NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent
event)
at NHibernate.Impl.SessionImpl.Flush()
Any ideas?? Thanks!
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhusers-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to nhusers+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhusers-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to nhusers+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.