/// <summary>
        /// Initializes a new instance of <see cref="CollectionEntry"/>.
        /// </summary>
        /// <remarks>
        /// For newly wrapped collections, or dereferenced collection wrappers
        /// </remarks>
        public CollectionEntry(ICollectionPersister persister, IPersistentCollection collection)
        {
            // new collections that get found + wrapped
            // during flush shouldn't be ignored
            ignore = false;

            collection.ClearDirty();             //a newly wrapped collection is NOT dirty (or we get unnecessary version updates)

            snapshot = persister.IsMutable ? collection.GetSnapshot(persister) : null;
            collection.SetSnapshot(loadedKey, role, snapshot);
        }
        public void AfterAction(IPersistentCollection collection)
        {
            loadedKey = CurrentKey;
            SetLoadedPersister(CurrentPersister);

            bool resnapshot = collection.WasInitialized && (IsDoremove || IsDorecreate || IsDoupdate);

            if (resnapshot)
            {
                //re-snapshot
                snapshot = loadedPersister == null || !loadedPersister.IsMutable ? null : collection.GetSnapshot(loadedPersister);
            }

            collection.PostAction();
        }
 /// <summary>
 /// Updates the CollectionEntry to reflect that the <see cref="IPersistentCollection"/>
 /// has been initialized.
 /// </summary>
 /// <param name="collection">The initialized <see cref="AbstractPersistentCollection"/> that this Entry is for.</param>
 public void PostInitialize(IPersistentCollection collection)
 {
     snapshot = LoadedPersister.IsMutable ? collection.GetSnapshot(LoadedPersister) : null;
     collection.SetSnapshot(loadedKey, role, snapshot);
 }
Beispiel #4
0
		public void AfterAction(IPersistentCollection collection)
		{
			loadedKey = CurrentKey;
			SetLoadedPersister(CurrentPersister);

			bool resnapshot = collection.WasInitialized && (IsDoremove || IsDorecreate || IsDoupdate);
			if (resnapshot)
			{
				//re-snapshot
				snapshot = loadedPersister == null || !loadedPersister.IsMutable ? null : collection.GetSnapshot(loadedPersister);
			}

			collection.PostAction();
		}
Beispiel #5
0
		/// <summary>
		/// Updates the CollectionEntry to reflect that the <see cref="IPersistentCollection"/>
		/// has been initialized.
		/// </summary>
		/// <param name="collection">The initialized <see cref="AbstractPersistentCollection"/> that this Entry is for.</param>
		public void PostInitialize(IPersistentCollection collection)
		{
			snapshot = LoadedPersister.IsMutable ? collection.GetSnapshot(LoadedPersister) : null;
			collection.SetSnapshot(loadedKey, role, snapshot);
		}
Beispiel #6
0
		/// <summary>
		/// Initializes a new instance of <see cref="CollectionEntry"/>.
		/// </summary>
		/// <remarks> 
		/// For newly wrapped collections, or dereferenced collection wrappers
		/// </remarks>
		public CollectionEntry(ICollectionPersister persister, IPersistentCollection collection)
		{
			// new collections that get found + wrapped
			// during flush shouldn't be ignored
			ignore = false;

			collection.ClearDirty(); //a newly wrapped collection is NOT dirty (or we get unnecessary version updates)

			snapshot = persister.IsMutable ? collection.GetSnapshot(persister) : null;
			collection.SetSnapshot(loadedKey, role, snapshot);
		}
		public void InitSnapshot(IPersistentCollection collection, ICollectionPersister persister)
		{
			snapshot = collection.GetSnapshot(persister);
		}
		/// <summary>
		/// Updates the CollectionEntry to reflect that the <see cref="IPersistentCollection"/>
		/// has been initialized.
		/// </summary>
		/// <param name="collection">The initialized <see cref="AbstractPersistentCollection"/> that this Entry is for.</param>
		public void PostInitialize(IPersistentCollection collection)
		{
			snapshot = collection.GetSnapshot(loadedPersister);
		}