Example #1
0
        public void OnPreRemoveCollection(PreCollectionRemoveEvent evt)
        {
            CollectionEntry collectionEntry = GetCollectionEntry(evt);

            if (collectionEntry != null && !collectionEntry.LoadedPersister.IsInverse)
            {
                OnCollectionAction(evt, null, collectionEntry.Snapshot, collectionEntry);
            }
        }
Example #2
0
 public Task OnPreRemoveCollectionAsync(PreCollectionRemoveEvent @event, CancellationToken cancellationToken)
 {
     try
     {
         AddEvent(@event, this);
         return(Task.CompletedTask);
     }
     catch (System.Exception ex)
     {
         return(Task.FromException <object>(ex));
     }
 }
 private void PreRemove()
 {
     IPreCollectionRemoveEventListener[] preListeners = Session.Listeners.PreCollectionRemoveEventListeners;
     if (preListeners.Length > 0)
     {
         PreCollectionRemoveEvent preEvent = new PreCollectionRemoveEvent(Persister, Collection, (IEventSource)Session,
                                                                          affectedOwner);
         for (int i = 0; i < preListeners.Length; i++)
         {
             preListeners[i].OnPreRemoveCollection(preEvent);
         }
     }
 }
Example #4
0
 private async Task PreRemoveAsync(CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     IPreCollectionRemoveEventListener[] preListeners = Session.Listeners.PreCollectionRemoveEventListeners;
     if (preListeners.Length > 0)
     {
         PreCollectionRemoveEvent preEvent = new PreCollectionRemoveEvent(Persister, Collection, (IEventSource)Session,
                                                                          affectedOwner);
         for (int i = 0; i < preListeners.Length; i++)
         {
             await(preListeners[i].OnPreRemoveCollectionAsync(preEvent, cancellationToken)).ConfigureAwait(false);
         }
     }
 }
Example #5
0
        public virtual void OnPreRemoveCollection(PreCollectionRemoveEvent evt)
        {
            var collectionEntry = getCollectionEntry(evt);

            if (collectionEntry == null)
            {
                return;
            }

            if (collectionEntry.LoadedPersister.IsInverse)
            {
                if (VerCfg.GlobalCfg.IsGlobalWithModifiedFlag)
                {
                    initializeCollection(evt);
                }
            }
            else
            {
                var oldColl = !evt.Collection.WasInitialized && shouldGenerateRevision(evt)
                                        ? initializeCollection(evt)
                                        : collectionEntry.Snapshot;
                onCollectionAction(evt, null, oldColl, collectionEntry);
            }
        }
 public void OnPreRemoveCollection(PreCollectionRemoveEvent @event)
 {
     AddEvent(@event, this);
 }
Example #7
0
 public Task OnPreRemoveCollectionAsync(PreCollectionRemoveEvent @event, CancellationToken cancellationToken)
 {
     OnPreRemoveCollection(@event);
     return(Task.CompletedTask);
 }
Example #8
0
 public void OnPreRemoveCollection(PreCollectionRemoveEvent e)
 {
     OnCollection(e);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="evt"></param>
 public override void OnPreRemoveCollection(PreCollectionRemoveEvent evt)
 {
 }
Example #10
0
 public void OnPreRemoveCollection(PreCollectionRemoveEvent @event)
 {
     log.Debug("OnPreRemoveCollection :" + @event);
 }