From: Kevin W. <kev...@us...> - 2004-12-31 19:53:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12969 Modified Files: ScheduledCollectionUpdate.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: ScheduledCollectionUpdate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionUpdate.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ScheduledCollectionUpdate.cs 29 Nov 2004 15:31:07 -0000 1.6 --- ScheduledCollectionUpdate.cs 31 Dec 2004 19:53:23 -0000 1.7 *************** *** 1,7 **** - using System; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Impl { /// <summary> --- 1,6 ---- using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Impl { /// <summary> *************** *** 12,20 **** /// and the database should be updated accordingly. /// </remarks> ! internal sealed class ScheduledCollectionUpdate : ScheduledCollectionAction { private readonly PersistentCollection _collection; private readonly bool _emptySnapshot; ! /// <summary> /// Initializes a new instance of <see cref="ScheduledCollectionUpdate"/>. --- 11,19 ---- /// and the database should be updated accordingly. /// </remarks> ! internal sealed class ScheduledCollectionUpdate : ScheduledCollectionAction { private readonly PersistentCollection _collection; private readonly bool _emptySnapshot; ! /// <summary> /// Initializes a new instance of <see cref="ScheduledCollectionUpdate"/>. *************** *** 25,30 **** /// <param name="emptySnapshot">Indicates if the Collection was empty when it was loaded.</param> /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledCollectionUpdate(PersistentCollection collection, CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) ! : base(persister, id, session) { _collection = collection; --- 24,29 ---- /// <param name="emptySnapshot">Indicates if the Collection was empty when it was loaded.</param> /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledCollectionUpdate( PersistentCollection collection, CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session ) ! : base( persister, id, session ) { _collection = collection; *************** *** 32,64 **** } ! public override void Execute() { Persister.Softlock( Id ); ! if( !_collection.WasInitialized ) { ! if ( !_collection.HasQueuedAdds ) { ! throw new AssertionFailure("bug processing queued adds"); } ! // do nothing - collection was not initialized // we only need to notify the cache... } ! else if( _collection.Empty ) { // the collection had all elements removed - check to see if it // was empty when it was loaded or if the contents were actually // deleted ! if( !_emptySnapshot ) { Persister.Remove( Id, Session ); } } ! else if( _collection.NeedsRecreate( Persister ) ) { // certain collections (Bag) have to be recreated in the db each // time - if the snapshot was not empty then there are some existing // rows that need to be removed. ! if( !_emptySnapshot ) { Persister.Remove( Id, Session ); --- 31,64 ---- } ! /// <summary></summary> ! public override void Execute() { Persister.Softlock( Id ); ! if( !_collection.WasInitialized ) { ! if( !_collection.HasQueuedAdds ) { ! throw new AssertionFailure( "bug processing queued adds" ); } ! // do nothing - collection was not initialized // we only need to notify the cache... } ! else if( _collection.Empty ) { // the collection had all elements removed - check to see if it // was empty when it was loaded or if the contents were actually // deleted ! if( !_emptySnapshot ) { Persister.Remove( Id, Session ); } } ! else if( _collection.NeedsRecreate( Persister ) ) { // certain collections (Bag) have to be recreated in the db each // time - if the snapshot was not empty then there are some existing // rows that need to be removed. ! if( !_emptySnapshot ) { Persister.Remove( Id, Session ); *************** *** 67,71 **** Persister.Recreate( _collection, Id, Session ); } ! else { // this is a normal collection that needs to have its state --- 67,71 ---- Persister.Recreate( _collection, Id, Session ); } ! else { // this is a normal collection that needs to have its state *************** *** 75,80 **** Persister.InsertRows( _collection, Id, Session ); } ! } } ! } --- 75,80 ---- Persister.InsertRows( _collection, Id, Session ); } ! } } ! } \ No newline at end of file |