Asher,

Have you tried Roger's lib with all-delete-orphans associations?

When I have one of these I get an exception like

MyNamespace.Tests.MyTest:
Method not found: 'System.Collections.ICollection 
NHibernate.Collection.AbstractPersistentCollection.GetOrphans(System.Collections.ICollection,
 
System.Collections.ICollection, System.String, 
NHibernate.Engine.ISessionImplementor)'.

at SetForNet4.PersistentGenericSet`1.GetOrphans(Object snapshot, String 
entityName)
at NHibernate.Engine.CollectionEntry.GetOrphans(String entityName, 
IPersistentCollection collection)
at NHibernate.Engine.Cascade.DeleteOrphans(String entityName, 
IPersistentCollection pc)
at NHibernate.Engine.Cascade.CascadeCollectionElements(Object parent, 
Object child, CollectionType collectionType, CascadeStyle style, IType 
elemType, Object anything, Boolean isCascadeDeleteEnabled)
at NHibernate.Engine.Cascade.CascadeCollection(Object parent, Object child, 
CascadeStyle style, Object anything, CollectionType type)
at NHibernate.Engine.Cascade.CascadeAssociation(Object parent, Object 
child, IType type, CascadeStyle style, Object anything, Boolean 
isCascadeDeleteEnabled)
at NHibernate.Engine.Cascade.CascadeProperty(Object parent, Object child, 
IType type, CascadeStyle style, Object anything, Boolean 
isCascadeDeleteEnabled)
at NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object 
parent, Object anything)
at 
NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(IEventSource
 
session, IEntityPersister persister, Object key, Object anything)
at 
NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(IEventSource
 
session)
at 
NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent
 
event)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent 
event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()

Regards,

Em quinta-feira, 28 de julho de 2011 15h47min04s UTC-3, SexualChocolate 
escreveu:
>
> Hi Roger,
>
> Thank you very much for this!  Most appreciated.
>
> Regards,
> Asher
>
> On Tue, Jul 26, 2011 at 8:38 PM, Roger Kratz 
> <[email protected]<javascript:>
> > wrote:
>
>> To you and other Envers users using Jose's Net4CollectionTypeFactory, 
>> I've created a small lib...
>> https://bitbucket.org/RogerKratz/nhibernate.envers.setfornet4
>>
>> You need the trunk of Envers
>> https://nhibernate.jira.com/browse/NHE-14
>>
>>
>>
>>
>> ________________________________________
>> Från: [email protected] <javascript:> 
>> [[email protected]<javascript:>] 
>> f&#246;r Roger Kratz [[email protected] <javascript:>]
>> Skickat: den 20 juli 2011 18:37
>> Till: [email protected] <javascript:>
>> Ämne: SV: [nhusers] Envers w/ CollectionTypeFactory
>>
>> <<So, the question is, are custom CollectionTypeFactories not supported 
>> in Envers, or is this a bug?>>
>>
>> Both :). It's not supported but NH Envers can probably be changed to have 
>> a similar way to create its collections as NH Core does (having some 
>> injectable factory).
>>
>> Please JIRA this here
>> https://nhibernate.jira.com/browse/NHE
>>
>>
>>
>> ________________________________
>> Från: [email protected] <javascript:> 
>> [[email protected]<javascript:>] 
>> för Asher Newcomer [[email protected] <javascript:>]
>> Skickat: den 20 juli 2011 17:39
>> Till: nhusers
>> Ämne: [nhusers] Envers w/ CollectionTypeFactory
>>
>> I'm trying to use Envers with a custom CollectionTypeFactory, 
>> specifically José's  Net4CollectionTypeFactory for native ISet<> support. 
>> But, when I query for a history of revisions:
>>
>> session.Auditer().CreateQuery().ForRevisionsOf<MyType>();
>>
>> It throws:
>>
>> The type 
>> NHibernate.Envers.Entities.Mapper.Relation.Lazy.Proxy.SetProxy`1[MyType] 
>> can not be assigned to a property of type 
>> System.Collections.Generic.ISet`1[MyType] setter of 
>> ParentType.MyTypeCollection
>>
>> It's trying to assign an Iesi set to my native ISet property and blowing 
>> up (AbstractCollectionMapper - Line 151).  So, the question is, are custom 
>> CollectionTypeFactories not supported in Envers, or is this a bug?
>>
>> Thanks,
>>
>> Asher
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "nhusers" group.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> 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 [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> 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 [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> 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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to