Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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);
 }
Ejemplo n.º 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();
		}
Ejemplo n.º 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);
		}
Ejemplo n.º 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);
		}