You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael D. <mik...@us...> - 2004-11-29 18:44:03
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24621/NHibernate Modified Files: IQuery.cs ISession.cs Log Message: Added more comments around Enumerable implementation. Index: IQuery.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IQuery.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IQuery.cs 4 Nov 2004 04:46:13 -0000 1.10 --- IQuery.cs 29 Nov 2004 18:43:16 -0000 1.11 *************** *** 61,77 **** /// <summary> ! /// Return the query results as an <c>ICollection</c>. If the query contains multiple results /// per row, the results are returned in an instance of <c>object[]</c>. /// </summary> /// <remarks> /// Entities returned as results are initialized on demand. The first SQL query returns ! /// identifiers only. /// </remarks> IEnumerable Enumerable(); /// <summary> ! /// Return the query results as a <c>IList</c>. If the query contains multiple results per row, /// the results are returned in an instance of <c>object[]</c>. /// </summary> IList List(); --- 61,87 ---- /// <summary> ! /// Return the query results as an <see cref="IEnumerable"/>. If the query contains multiple results /// per row, the results are returned in an instance of <c>object[]</c>. /// </summary> /// <remarks> + /// <p> /// Entities returned as results are initialized on demand. The first SQL query returns ! /// identifiers only. ! /// </p> ! /// <p> ! /// This is a good strategy to use if you expect a high number of the objects ! /// returned to be already loaded in the <see cref="ISession"/> or in the 2nd level cache. ! /// </p> /// </remarks> IEnumerable Enumerable(); /// <summary> ! /// Return the query results as an <see cref="IList"/>. If the query contains multiple results per row, /// the results are returned in an instance of <c>object[]</c>. /// </summary> + /// <remarks> + /// This is a good strategy to use if you expect few of the objects being returned are already loaded + /// or if you want to fill the 2nd level cache. + /// </remarks> IList List(); Index: ISession.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ISession.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ISession.cs 14 Oct 2004 04:33:13 -0000 1.11 --- ISession.cs 29 Nov 2004 18:43:17 -0000 1.12 *************** *** 258,261 **** --- 258,262 ---- /// <param name="query">A query expressed in Hibernate's query language</param> /// <returns>A distinct list of instances</returns> + /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> IList Find(string query); *************** *** 267,270 **** --- 268,272 ---- /// <param name="type">The Hibernate type of the value</param> /// <returns>A distinct list of instances</returns> + /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> IList Find(string query, object value, IType type); *************** *** 276,279 **** --- 278,282 ---- /// <param name="types">An array of Hibernate types of the values</param> /// <returns>A distinct list of instances</returns> + /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> IList Find(string query, object[] values, IType[] types); |
From: Michael D. <mik...@us...> - 2004-11-29 18:44:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24621/NHibernate/Engine Modified Files: ISessionImplementor.cs Log Message: Added more comments around Enumerable implementation. Index: ISessionImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ISessionImplementor.cs 28 Nov 2004 21:47:46 -0000 1.24 --- ISessionImplementor.cs 29 Nov 2004 18:43:20 -0000 1.25 *************** *** 112,118 **** /// This method may create a new proxy or return an existing proxy. /// </summary> ! /// <param name="persistentClass"></param> ! /// <param name="id"></param> ! /// <returns></returns> object InternalLoad(System.Type persistentClass, object id); --- 112,121 ---- /// This method may create a new proxy or return an existing proxy. /// </summary> ! /// <param name="persistentClass">The <see cref="System.Type"/> to load.</param> ! /// <param name="id">The identifier of the object in the database.</param> ! /// <returns> ! /// A proxy of the object or an instance of the object if the <c>persistentClass</c> does not have a proxy. ! /// </returns> ! /// <exception cref="ObjectNotFoundException">No object could be found with that <c>id</c>.</exception> object InternalLoad(System.Type persistentClass, object id); |
From: Michael D. <mik...@us...> - 2004-11-29 15:31:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6702/NHibernate/Impl Modified Files: ScheduledCollectionAction.cs ScheduledCollectionRecreate.cs ScheduledCollectionRemove.cs ScheduledCollectionUpdate.cs ScheduledEntityAction.cs SessionImpl.cs Log Message: Added more comments for scheduling of collection actions. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** SessionImpl.cs 29 Nov 2004 04:45:51 -0000 1.50 --- SessionImpl.cs 29 Nov 2004 15:31:07 -0000 1.51 *************** *** 97,116 **** /// this session. These statuses are for internal /// book-keeping only and are not intended to represent ! /// any notion that is visible to the _application_. /// </summary> [Serializable] internal enum Status { Loaded, Deleted, Gone, Loading, Saving } internal interface IExecutable { void Execute(); void AfterTransactionCompletion(); object[] PropertySpaces { get; } } --- 97,159 ---- /// this session. These statuses are for internal /// book-keeping only and are not intended to represent ! /// any notion that is visible to the <b>application</b>. /// </summary> [Serializable] internal enum Status { + /// <summary> + /// The Entity is snapshotted in the Session with the same state as the database. + /// </summary> Loaded, + + /// <summary> + /// The Entity is in the Session and has been marked for deletion but not + /// deleted from the database yet. + /// </summary> Deleted, + + /// <summary> + /// The Entity has been deleted from database. + /// </summary> Gone, + + /// <summary> + /// The Entity is in the process of being loaded. + /// </summary> Loading, + + /// <summary> + /// The Entity is in the process of being saved. + /// </summary> Saving } + /// <summary> + /// An action that <see cref="ISession"/> can Execute during a + /// <c>Flush</c>. + /// </summary> internal interface IExecutable { + /// <summary> + /// Execute the action required to write changes to the database. + /// </summary> void Execute(); + + /// <summary> + /// Called after the Transaction has been completed. + /// </summary> + /// <remarks> + /// Actions should make sure that the Cache is notified about + /// what just happened. + /// </remarks> void AfterTransactionCompletion(); + + /// <summary> + /// The spaces (tables) that are affectd by this Executable action. + /// </summary> + /// <remarks> + /// This is used to determine if the ISession needs to be flushed before + /// a query is executed so stale data is not returned. + /// </remarks> object[] PropertySpaces { get; } } *************** *** 267,275 **** --- 310,360 ---- { internal bool dirty; + + /// <summary> + /// Indicates that the Collection can still be reached by an Entity + /// that exist in the <see cref="ISession"/>. + /// </summary> + /// <remarks> + /// It is also used to ensure that the Collection is not shared between + /// two Entities. + /// </remarks> [NonSerialized] internal bool reached; + + /// <summary> + /// Indicates that the Collection has been processed and is ready + /// to have its state synchronized with the database. + /// </summary> [NonSerialized] internal bool processed; + + /// <summary> + /// Indicates that a Collection needs to be updated. + /// </summary> + /// <remarks> + /// A Collection needs to be updated whenever the contents of the Collection + /// have been changed. + /// </remarks> [NonSerialized] internal bool doupdate; + + /// <summary> + /// Indicates that a Collection has old elements that need to be removed. + /// </summary> + /// <remarks> + /// A Collection needs to have removals performed whenever its role changes or + /// the key changes and it has a loadedPersister - ie - it was loaded by NHibernate. + /// </remarks> [NonSerialized] internal bool doremove; + + /// <summary> + /// Indicates that a Collection needs to be recreated. + /// </summary> + /// <remarks> + /// A Collection needs to be recreated whenever its role changes + /// or the owner changes. + /// </remarks> [NonSerialized] internal bool dorecreate; + + /// <summary> + /// Indicates that the Collection has been fully initialized. + /// </summary> internal bool initialized; Index: ScheduledCollectionAction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionAction.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ScheduledCollectionAction.cs 28 Nov 2004 03:13:44 -0000 1.6 --- ScheduledCollectionAction.cs 29 Nov 2004 15:31:07 -0000 1.7 *************** *** 6,10 **** namespace NHibernate.Impl { ! internal abstract class ScheduledCollectionAction : SessionImpl.IExecutable { --- 6,13 ---- namespace NHibernate.Impl { ! /// <summary> ! /// The base class for a scheduled action to perform on a Collection during a ! /// flush. ! /// </summary> internal abstract class ScheduledCollectionAction : SessionImpl.IExecutable { *************** *** 13,16 **** --- 16,25 ---- private ISessionImplementor _session; + /// <summary> + /// Initializes a new instance of <see cref="ScheduledCollectionAction"/>. + /// </summary> + /// <param name="persister">The <see cref="CollectionPersister"/> that is responsible for the persisting the Collection.</param> + /// <param name="id">The identifier of the Collection owner.</param> + /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> public ScheduledCollectionAction(CollectionPersister persister, object id, ISessionImplementor session) { *************** *** 20,33 **** } ! public void AfterTransactionCompletion() ! { ! _persister.ReleaseSoftlock( _id ); ! } ! ! public object[] PropertySpaces ! { ! get { return new string[] { _persister.QualifiedTableName }; } //TODO: cache the array on the persister ! } ! public CollectionPersister Persister { --- 29,35 ---- } ! /// <summary> ! /// Gets the <see cref="CollectionPersister"/> that is responsible for persisting the Collection. ! /// </summary> public CollectionPersister Persister { *************** *** 35,38 **** --- 37,43 ---- } + /// <summary> + /// Gets the identifier of the Collection owner. + /// </summary> public object Id { *************** *** 40,43 **** --- 45,51 ---- } + /// <summary> + /// Gets the <see cref="ISessionImplementor"/> the action is executing in. + /// </summary> public ISessionImplementor Session { *************** *** 45,49 **** --- 53,72 ---- } + #region SessionImpl.IExecutable Members + + public void AfterTransactionCompletion() + { + _persister.ReleaseSoftlock( _id ); + } + public abstract void Execute(); + + public object[] PropertySpaces + { + get { return new string[] { _persister.QualifiedTableName }; } //TODO: cache the array on the persister + } + + #endregion + } } Index: ScheduledEntityAction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledEntityAction.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ScheduledEntityAction.cs 28 Nov 2004 21:47:46 -0000 1.5 --- ScheduledEntityAction.cs 29 Nov 2004 15:31:07 -0000 1.6 *************** *** 34,42 **** - public object[] PropertySpaces - { - get { return _persister.PropertySpaces; } - } - /// <summary> /// Gets the <see cref="ISessionImplementor"/> the action is executing in. --- 34,37 ---- *************** *** 70,74 **** --- 65,72 ---- get { return _instance; } } + + #region SessionImpl.IExecutable Members + /// <summary> /// Called when the Transaction this action occurred in has completed. *************** *** 81,84 **** --- 79,89 ---- public abstract void Execute(); + public object[] PropertySpaces + { + get { return _persister.PropertySpaces; } + } + + #endregion + } } Index: ScheduledCollectionRecreate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionRecreate.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledCollectionRecreate.cs 28 Nov 2004 03:13:44 -0000 1.3 --- ScheduledCollectionRecreate.cs 29 Nov 2004 15:31:07 -0000 1.4 *************** *** 5,14 **** namespace NHibernate.Impl { ! internal sealed class ScheduledCollectionRecreate : ScheduledCollectionAction { private PersistentCollection _collection; ! public ScheduledCollectionRecreate(PersistentCollection collection, CollectionPersister persister, object id, ISessionImplementor session) : base(persister, id, session) { _collection = collection; --- 5,24 ---- namespace NHibernate.Impl { ! /// <summary> ! /// A scheduled recreation of the Collection in the database. ! /// </summary> internal sealed class ScheduledCollectionRecreate : ScheduledCollectionAction { private PersistentCollection _collection; ! /// <summary> ! /// Initializes a new instance of <see cref="ScheduledCollectionRecreate"/>. ! /// </summary> ! /// <param name="collection">The <see cref="PersistentCollection"/> to recreate.</param> ! /// <param name="persister">The <see cref="CollectionPersister"/> that is responsible for the persisting the Collection.</param> ! /// <param name="id">The identifier of the Collection owner.</param> ! /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledCollectionRecreate(PersistentCollection collection, CollectionPersister persister, object id, ISessionImplementor session) ! : base(persister, id, session) { _collection = collection; Index: ScheduledCollectionUpdate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionUpdate.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ScheduledCollectionUpdate.cs 28 Nov 2004 03:13:44 -0000 1.5 --- ScheduledCollectionUpdate.cs 29 Nov 2004 15:31:07 -0000 1.6 *************** *** 5,16 **** namespace NHibernate.Impl { ! internal sealed class ScheduledCollectionUpdate : ScheduledCollectionAction { - private readonly PersistentCollection _collection; private readonly bool _emptySnapshot; ! public ScheduledCollectionUpdate(PersistentCollection collection, CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) : base(persister, id, session) { _collection = collection; --- 5,30 ---- namespace NHibernate.Impl { ! /// <summary> ! /// A scheduled update of the Collection in the database. ! /// </summary> ! /// <remarks> ! /// Entities in the Collection or the contents of the Collection have been modified ! /// 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"/>. ! /// </summary> ! /// <param name="collection">The <see cref="PersistentCollection"/> to update.</param> ! /// <param name="persister">The <see cref="CollectionPersister"/> that is responsible for the persisting the Collection.</param> ! /// <param name="id">The identifier of the Collection owner.</param> ! /// <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; *************** *** 23,44 **** if( !_collection.WasInitialized ) { ! if ( !_collection.HasQueuedAdds ) throw new AssertionFailure("bug processing queued adds"); ! //do nothing - we only need to notify the cache... } else if( _collection.Empty ) { ! if( !_emptySnapshot ) Persister.Remove( Id, Session ); } else if( _collection.NeedsRecreate( Persister ) ) { ! if( !_emptySnapshot ) Persister.Remove( Id, Session ); Persister.Recreate( _collection, Id, Session ); } else { Persister.DeleteRows( _collection, Id, Session ); Persister.UpdateRows( _collection, Id, Session ); Persister.InsertRows( _collection, Id, Session ); - } --- 37,77 ---- 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 ); ! } ! Persister.Recreate( _collection, Id, Session ); } else { + // this is a normal collection that needs to have its state + // synched with the database. Persister.DeleteRows( _collection, Id, Session ); Persister.UpdateRows( _collection, Id, Session ); Persister.InsertRows( _collection, Id, Session ); } Index: ScheduledCollectionRemove.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionRemove.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScheduledCollectionRemove.cs 28 Nov 2004 03:13:44 -0000 1.4 --- ScheduledCollectionRemove.cs 29 Nov 2004 15:31:07 -0000 1.5 *************** *** 3,14 **** using NHibernate.Engine; ! namespace NHibernate.Impl { ! internal sealed class ScheduledCollectionRemove : ScheduledCollectionAction { - private bool _emptySnapshot; ! public ScheduledCollectionRemove(CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) : base(persister, id, session) { _emptySnapshot = emptySnapshot; --- 3,27 ---- using NHibernate.Engine; ! namespace NHibernate.Impl ! { ! /// <summary> ! /// A scheduled removal of the Collection from the database. ! /// </summary> ! /// <remarks> ! /// This Collection is not represented in the database anymore. ! /// </remarks> internal sealed class ScheduledCollectionRemove : ScheduledCollectionAction { private bool _emptySnapshot; ! /// <summary> ! /// Initializes a new instance of <see cref="ScheduledCollectionRemove"/>. ! /// </summary> ! /// <param name="persister">The <see cref="CollectionPersister"/> that is responsible for the persisting the Collection.</param> ! /// <param name="id">The identifier of the Collection owner.</param> ! /// <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 ScheduledCollectionRemove(CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) ! : base(persister, id, session) { _emptySnapshot = emptySnapshot; *************** *** 18,22 **** { Persister.Softlock( Id ); ! if( !_emptySnapshot ) Persister.Remove( Id, Session ); } } --- 31,41 ---- { Persister.Softlock( Id ); ! ! // if there were no entries in the snapshot of the collection then there ! // is nothing to remove so verify that the snapshot was not empty. ! if( !_emptySnapshot ) ! { ! Persister.Remove( Id, Session ); ! } } } |
From: Michael D. <mik...@us...> - 2004-11-29 04:46:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31197/src/NHibernate/Impl Modified Files: ScheduledInsertion.cs SessionImpl.cs Log Message: Added some comments about how the CollectionEntry is working and some more comments to individual collection classes. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** SessionImpl.cs 28 Nov 2004 21:47:46 -0000 1.49 --- SessionImpl.cs 29 Nov 2004 04:45:51 -0000 1.50 *************** *** 134,137 **** --- 134,147 ---- private string _className; + /// <summary> + /// Initializes a new instance of EntityEntry. + /// </summary> + /// <param name="status">The current <see cref="Status"/> of the Entity.</param> + /// <param name="loadedState">The snapshot of the Entity's state when it was loaded.</param> + /// <param name="id">The identifier of the Entity in the database.</param> + /// <param name="version">The version of the Entity.</param> + /// <param name="lockMode">The <see cref="LockMode"/> for the Entity.</param> + /// <param name="existsInDatabase">A boolean indicating if the Entity exists in the database.</param> + /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for this Entity.</param> public EntityEntry(Status status, object[] loadedState, object id, object version, LockMode lockMode, bool existsInDatabase, IClassPersister persister) { *************** *** 146,150 **** } ! public LockMode LockMode { --- 156,163 ---- } ! /// <summary> ! /// Gets or sets the current <see cref="LockMode"/> of the Entity. ! /// </summary> ! /// <value>The <see cref="LockMode"/> of the Entity.</value> public LockMode LockMode { *************** *** 153,156 **** --- 166,174 ---- } + /// <summary> + /// Gets or sets the <see cref="Status"/> of this Entity with respect to its + /// persistence in the database. + /// </summary> + /// <value>The <see cref="Status"/> of this Entity.</value> public Status Status { *************** *** 159,162 **** --- 177,186 ---- } + /// <summary> + /// Gets or sets the identifier of the Entity in the database. + /// </summary> + /// <value>The identifier of the Entity in the database if one has been assigned.</value> + /// <remarks>This might be <c>null</c> when the <see cref="EntityEntry.Status"/> is + /// <see cref="Status.Saving"/> and the database generates the id.</remarks> public object Id { *************** *** 165,168 **** --- 189,199 ---- } + /// <summary> + /// Gets or sets the snapshot of the Entity when it was loaded from the database. + /// </summary> + /// <value>The snapshot of the Entity.</value> + /// <remarks> + /// There will only be a value when the Entity was loaded in the current Session. + /// </remarks> public object[] LoadedState { *************** *** 171,174 **** --- 202,210 ---- } + /// <summary> + /// Gets or sets the snapshot of the Entity when it was marked as being ready for deletion. + /// </summary> + /// <value>The snapshot of the Entity.</value> + /// <remarks>This will be <c>null</c> if the Entity is not being deleted.</remarks> public object[] DeletedState { *************** *** 177,180 **** --- 213,224 ---- } + /// <summary> + /// Gets or sets a <see cref="Boolean"/> indicating if this Entity exists in the database. + /// </summary> + /// <value><c>true</c> if it is already in the database.</value> + /// <remarks> + /// It can also be <c>true</c> if it does not exists in the database yet and the + /// <see cref="IClassPersister.IsIdentifierAssignedByInsert"/> is <c>true</c>. + /// </remarks> public bool ExistsInDatabase { *************** *** 183,186 **** --- 227,234 ---- } + /// <summary> + /// Gets or sets the version of the Entity. + /// </summary> + /// <value>The version of the Entity.</value> public object Version { *************** *** 189,192 **** --- 237,244 ---- } + /// <summary> + /// Gets or sets the <see cref="IClassPersister"/> that is responsible for this Entity. + /// </summary> + /// <value>The <see cref="IClassPersister"/> that is reponsible for this Entity.</value> public IClassPersister Persister { *************** *** 195,202 **** } public string ClassName { get { return _className; } - set { _className = value; } } --- 247,257 ---- } + /// <summary> + /// Gets the Fully Qualified Name of the class this Entity is an instance of. + /// </summary> + /// <value>The Fully Qualified Name of the class this Entity is an instance of.</value> public string ClassName { get { return _className; } } *************** *** 218,222 **** --- 273,294 ---- [NonSerialized] internal bool dorecreate; internal bool initialized; + + /// <summary> + /// The <see cref="CollectionPersister"/> that is currently responsible + /// for the Collection. + /// </summary> + /// <remarks> + /// This is set when NHibernate is updating a reachable or an + /// unreachable collection. + /// </remarks> [NonSerialized] internal CollectionPersister currentPersister; + + /// <summary> + /// The <see cref="CollectionPersister"/> when the Collection was loaded. + /// </summary> + /// <remarks> + /// This can be <c>null</c> if the Collection was not loaded by NHibernate and + /// was passed in along with a transient object. + /// </remarks> [NonSerialized] internal CollectionPersister loadedPersister; [NonSerialized] internal object currentKey; *************** *** 225,228 **** --- 297,307 ---- internal string role; + /// <summary> + /// Initializes a new instance of <see cref="CollectionEntry"/>. + /// </summary> + /// <remarks> + /// The CollectionEntry is for a Collection that is not dirty and + /// has already been initialized. + /// </remarks> public CollectionEntry() { *************** *** 231,234 **** --- 310,319 ---- } + /// <summary> + /// Initializes a new instance of <see cref="CollectionEntry"/>. + /// </summary> + /// <param name="loadedPersister">The <see cref="CollectionPersister"/> that persists this Collection type.</param> + /// <param name="loadedID">The identifier of the Entity that is the owner of this Collection.</param> + /// <param name="initialized">A boolean indicating if the collection has been initialized.</param> public CollectionEntry(CollectionPersister loadedPersister, object loadedID, bool initialized) { *************** *** 239,242 **** --- 324,337 ---- } + /// <summary> + /// Initializes a new instance of <see cref="CollectionEntry"/>. + /// </summary> + /// <param name="cs">The <see cref="ICollectionSnapshot"/> from another <see cref="ISession"/>.</param> + /// <param name="factory">The <see cref="ISessionFactoryImplementor"/> that created this <see cref="ISession"/>.</param> + /// <remarks> + /// This takes an <see cref="ICollectionSnapshot"/> from another <see cref="ISession"/> and + /// creates an entry for it in this <see cref="ISession"/> by copying the values from the + /// <c>cs</c> parameter. + /// </remarks> public CollectionEntry(ICollectionSnapshot cs, ISessionFactoryImplementor factory) { *************** *** 248,254 **** } ! //default behavior; will be overridden in deep lazy collections public virtual bool IsDirty(PersistentCollection coll) { if ( dirty || ( !coll.IsDirectlyAccessible && !loadedPersister.ElementType.IsMutable --- 343,361 ---- } ! /// <summary> ! /// Checks to see if the <see cref="PersistentCollection"/> has had any changes to the ! /// collections contents or if any of the elements in the collection have been modified. ! /// </summary> ! /// <param name="coll"></param> ! /// <returns><c>true</c> if the <see cref="PersistentCollection"/> is dirty.</returns> ! /// <remarks> ! /// default behavior; will be overridden in deep lazy collections ! /// </remarks> public virtual bool IsDirty(PersistentCollection coll) { + // if this has already been marked as dirty or the collection can not + // be directly accessed (ie- we can guarantee that the NHibernate collection + // wrappers are used) and the elements in the collection are not mutable + // then return the dirty flag. if ( dirty || ( !coll.IsDirectlyAccessible && !loadedPersister.ElementType.IsMutable *************** *** 259,266 **** --- 366,379 ---- else { + // need to have the coll determine if it is the same as the snapshot + // that was last taken. return !coll.EqualsSnapshot( loadedPersister.ElementType ); } } + /// <summary> + /// Prepares this CollectionEntry for the Flush process. + /// </summary> + /// <param name="collection">The <see cref="PersistentCollection"/> that this CollectionEntry will be responsible for flushing.</param> public void PreFlush(PersistentCollection collection) { *************** *** 275,278 **** --- 388,393 ---- } + // reset all of these values so any previous flush status + // information is cleared from this CollectionEntry doupdate = false; doremove = false; *************** *** 282,285 **** --- 397,405 ---- } + /// <summary> + /// Updates the CollectionEntry to reflect that the <see cref="PersistentCollection"/> + /// has been initialized. + /// </summary> + /// <param name="collection">The initialized <see cref="PersistentCollection"/> that this Entry is for.</param> public void PostInitialize(PersistentCollection collection) { *************** *** 288,298 **** } ! // called after a *successful* flush public void PostFlush(PersistentCollection collection) { if( !processed ) { throw new AssertionFailure("Hibernate has a bug processing collections"); } loadedKey = currentKey; SetLoadedPersister( currentPersister ); --- 408,426 ---- } ! /// <summary> ! /// Updates the CollectionEntry to reflect that it is has been successfully flushed to the database. ! /// </summary> ! /// <param name="collection">The <see cref="PersistentCollection"/> that was flushed.</param> public void PostFlush(PersistentCollection collection) { + // the CollectionEntry should be processed if we are in the PostFlush() if( !processed ) { throw new AssertionFailure("Hibernate has a bug processing collections"); } + + // now that the flush has gone through move everything that is the current + // over to the loaded fields and set dirty to false since the db & collection + // are in synch. loadedKey = currentKey; SetLoadedPersister( currentPersister ); *************** *** 304,307 **** --- 432,437 ---- collection.PostFlush(); + // if it was initialized or any of the scheduled actions were performed then + // need to resnpashot the contents of the collection. if ( initialized && ( doremove || dorecreate || doupdate ) ) { *************** *** 310,325 **** } ! public bool Dirty ! { ! get { return dirty; } ! } public object Key { get { return loadedKey; } } public string Role { get { return role; } } public object Snapshot { --- 440,455 ---- } ! #region Engine.ICollectionSnapshot Members ! public object Key { get { return loadedKey; } } + public string Role { get { return role; } } + public object Snapshot { *************** *** 327,340 **** } public bool SnapshotIsEmpty { ! get { //TODO: implementation here is non-extensible ... //should use polymorphism ! // return initialized && snapshot!=null && ( ! // ( snapshot is IList && ( (IList) snapshot ).Count==0 ) || // if snapshot is a collection ! // ( snapshot is Map && ( (Map) snapshot ).Count==0 ) || // if snapshot is a map ! // (snapshot.GetType().IsArray && ( (Array) snapshot).Length==0 )// if snapshot is an array ! // ); // TODO: in .NET an IList, IDictionary, and Array are all collections so we might be able --- 457,505 ---- } + public bool Dirty + { + get { return dirty; } + } + + public void SetDirty() + { + dirty = true; + } + public bool IsInitialized + { + get { return initialized;} + } + + + #endregion + + /// <summary> + /// Sets the information in this CollectionEntry that is specific to the + /// <see cref="CollectionPersister"/>. + /// </summary> + /// <param name="persister"> + /// The <see cref="CollectionPersister"/> that is + /// responsible for the Collection. + /// </param> + private void SetLoadedPersister(CollectionPersister persister) + { + loadedPersister = persister; + if (persister!=null) + { + role=persister.Role; + } + } + public bool SnapshotIsEmpty { ! get ! { //TODO: implementation here is non-extensible ... //should use polymorphism ! // return initialized && snapshot!=null && ( ! // ( snapshot is IList && ( (IList) snapshot ).Count==0 ) || // if snapshot is a collection ! // ( snapshot is Map && ( (Map) snapshot ).Count==0 ) || // if snapshot is a map ! // (snapshot.GetType().IsArray && ( (Array) snapshot).Length==0 )// if snapshot is an array ! // ); // TODO: in .NET an IList, IDictionary, and Array are all collections so we might be able *************** *** 347,370 **** } } - - public void SetDirty() - { - dirty = true; - } - - private void SetLoadedPersister(CollectionPersister persister) - { - loadedPersister = persister; - if (persister!=null) role=persister.Role; - } - - public bool IsInitialized - { - get { return initialized;} - } - public bool IsNew { ! // TODO: is this correct implementation get { return initialized && (snapshot==null); } } --- 512,518 ---- } } public bool IsNew { ! // TODO: is this correct implementation - h2.0.3 get { return initialized && (snapshot==null); } } Index: ScheduledInsertion.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledInsertion.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledInsertion.cs 28 Nov 2004 03:13:44 -0000 1.3 --- ScheduledInsertion.cs 29 Nov 2004 04:45:51 -0000 1.4 *************** *** 6,10 **** namespace NHibernate.Impl { ! internal class ScheduledInsertion : ScheduledEntityAction { --- 6,12 ---- namespace NHibernate.Impl { ! /// <summary> ! /// A scheduled insertion of an object. ! /// </summary> internal class ScheduledInsertion : ScheduledEntityAction { |
From: Michael D. <mik...@us...> - 2004-11-29 04:46:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31197/src/NHibernate/Collection Modified Files: Bag.cs PersistentCollection.cs Set.cs Log Message: Added some comments about how the CollectionEntry is working and some more comments to individual collection classes. Index: Bag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Bag.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Bag.cs 14 Oct 2004 04:33:13 -0000 1.9 --- Bag.cs 29 Nov 2004 04:45:50 -0000 1.10 *************** *** 157,160 **** --- 157,171 ---- } + /// <summary> + /// Gets a <see cref="Boolean"/> indicating if this Bag needs to be recreated + /// in the database. + /// </summary> + /// <param name="persister"></param> + /// <returns> + /// <c>false</c> if this is a <c>one-to-many</c> Bag, <c>true</c> if this is not + /// a <c>one-to-many</c> Bag. Since a Bag is an unordered, unindexed collection + /// that permits duplicates it is not possible to determine what has changed in a + /// <c>many-to-many</c> so it is just recreated. + /// </returns> public override bool NeedsRecreate(CollectionPersister persister) { Index: PersistentCollection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/PersistentCollection.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PersistentCollection.cs 22 Sep 2004 04:46:43 -0000 1.16 --- PersistentCollection.cs 29 Nov 2004 04:45:50 -0000 1.17 *************** *** 267,270 **** --- 267,284 ---- } + /// <summary> + /// Gets a <see cref="Boolean"/> indicating if the underlying collection is directly + /// accessable through code. + /// </summary> + /// <value> + /// <c>true</c> if we are not guaranteed that the NHibernate collection wrapper + /// is being used. + /// </value> + /// <remarks> + /// This is typically <c>false</c> whenever a transient object that contains a collection is being + /// associated with an ISession through <c>Save</c> or <c>SaveOrUpdate</c>. NHibernate can't guarantee + /// that it will know about all operations that would call cause NHibernate's collections to call + /// <c>Read()</c> or <c>Write()</c>. + /// </remarks> public virtual bool IsDirectlyAccessible { *************** *** 296,299 **** --- 310,323 ---- public abstract object Disassemble(CollectionPersister persister); + /// <summary> + /// Gets a <see cref="Boolean"/> indicating if the rows for this collection + /// need to be recreated in the table. + /// </summary> + /// <param name="persister">The <see cref="CollectionPersister"/> for this Collection.</param> + /// <returns> + /// <c>false</c> by default since most collections can determine which rows need to be + /// individually updated/inserted/deleted. Currently only <see cref="Bag"/>'s for <c>many-to-many</c> + /// need to be recreated. + /// </returns> public virtual bool NeedsRecreate(CollectionPersister persister) { *************** *** 347,351 **** --- 371,386 ---- // looks like it is used by IdentifierBag + /// <summary> + /// By default, no operation is performed. This provides a hook to get an identifer of the + /// collection row for <see cref="IdentifierBag"/>. + /// </summary> + /// <param name="persister">The <see cref="CollectionPersister"/> for this Collection.</param> + /// <param name="entry"> + /// The entry to preInsert. If this is a Map this will be a DictionaryEntry. If this is + /// a List then it will be the object at that index. + /// </param> + /// <param name="i">The index of the Entry while enumerating through the Collection.</param> public virtual void PreInsert(CollectionPersister persister, object entry, int i) {} + public abstract ICollection GetOrphans(object snapshot); public static void IdentityRemoveAll(IList list, ICollection collection, ISessionImplementor session) Index: Set.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Set.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Set.cs 21 Nov 2004 22:56:27 -0000 1.19 --- Set.cs 29 Nov 2004 04:45:50 -0000 1.20 *************** *** 424,428 **** public override bool EntryExists(object entry, int i) { - //TODO: find out where this is used... return true; } --- 424,427 ---- |
From: Michael D. <mik...@us...> - 2004-11-29 04:46:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31197/src/NHibernate/Engine Modified Files: ICollectionSnapshot.cs Log Message: Added some comments about how the CollectionEntry is working and some more comments to individual collection classes. Index: ICollectionSnapshot.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ICollectionSnapshot.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ICollectionSnapshot.cs 24 Mar 2004 19:54:02 -0000 1.3 --- ICollectionSnapshot.cs 29 Nov 2004 04:45:51 -0000 1.4 *************** *** 1,13 **** using System; ! namespace NHibernate.Engine { ! ! public interface ICollectionSnapshot { object Key { get; } string Role { get; } object Snapshot { get; } bool Dirty { get; } void SetDirty(); ! bool IsInitialized{get;} } } --- 1,46 ---- using System; ! namespace NHibernate.Engine ! { ! /// <summary> ! /// Defines a complete "snapshot" of a particular collection. ! /// </summary> ! public interface ICollectionSnapshot ! { ! /// <summary> ! /// Gets the identifier of the Entity that owns this Collection. ! /// </summary> object Key { get; } + + /// <summary> + /// Gets the role that identifies this Collection. + /// </summary> string Role { get; } + + /// <summary> + /// Gets the snapshot copy of the Collection's elements. + /// </summary> + /// <remarks> + /// In most cases this is the same collection type as the one being snapshotted. + /// ie - the snapshot of an IList will return an IList. + /// </remarks> object Snapshot { get; } + + /// <summary> + /// Gets a <see cref="Boolean"/> indicating if some action has been performed on the + /// actual collection instance that has modified it. + /// </summary> bool Dirty { get; } + + /// <summary> + /// Marks the <see cref="ICollectionSnapshot"/> as being dirty. + /// </summary> void SetDirty(); ! ! /// <summary> ! /// Gets a <see cref="Boolean"/> indicating if the underlying collection has been ! /// initialized yet. ! /// </summary> ! bool IsInitialized{ get; } } } |
From: Michael D. <mik...@us...> - 2004-11-28 21:47:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3188/src/NHibernate/Impl Modified Files: ScheduledDeletion.cs ScheduledEntityAction.cs ScheduledUpdate.cs SessionImpl.cs Log Message: Added some comments about how the ScheduledActions and Versioning are working. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** SessionImpl.cs 28 Nov 2004 03:13:44 -0000 1.48 --- SessionImpl.cs 28 Nov 2004 21:47:46 -0000 1.49 *************** *** 48,52 **** //IdentityMaps are serializable in NH ! private IdentityMap entries;//key=Object, value=Entry private IdentityMap arrayHolders; //key=array, value=ArrayHolder private IdentityMap collections; //key=PersistentCollection, value=CollectionEntry --- 48,52 ---- //IdentityMaps are serializable in NH ! private IdentityMap entries;//key=Object, value=EntityEntry private IdentityMap arrayHolders; //key=array, value=ArrayHolder private IdentityMap collections; //key=PersistentCollection, value=CollectionEntry Index: ScheduledDeletion.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledDeletion.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledDeletion.cs 28 Nov 2004 03:13:44 -0000 1.3 --- ScheduledDeletion.cs 28 Nov 2004 21:47:46 -0000 1.4 *************** *** 6,9 **** --- 6,12 ---- namespace NHibernate.Impl { + /// <summary> + /// A scheduled deletion of an object. + /// </summary> internal class ScheduledDeletion : ScheduledEntityAction { *************** *** 26,30 **** public override void Execute() { ! if( Persister.HasCache ) Persister.Cache.Lock( Id ); Persister.Delete( Id, _version, Instance, Session ); Session.PostDelete( Instance ); --- 29,36 ---- public override void Execute() { ! if( Persister.HasCache ) ! { ! Persister.Cache.Lock( Id ); ! } Persister.Delete( Id, _version, Instance, Session ); Session.PostDelete( Instance ); *************** *** 33,37 **** public override void AfterTransactionCompletion() { ! if ( Persister.HasCache ) Persister.Cache.Release( Id ); } } --- 39,46 ---- public override void AfterTransactionCompletion() { ! if ( Persister.HasCache ) ! { ! Persister.Cache.Release( Id ); ! } } } Index: ScheduledEntityAction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledEntityAction.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScheduledEntityAction.cs 28 Nov 2004 03:13:44 -0000 1.4 --- ScheduledEntityAction.cs 28 Nov 2004 21:47:46 -0000 1.5 *************** *** 6,10 **** namespace NHibernate.Impl { ! internal abstract class ScheduledEntityAction : SessionImpl.IExecutable { --- 6,13 ---- namespace NHibernate.Impl { ! /// <summary> ! /// The base class for a scheduled action to perform on an entity during a ! /// flush. ! /// </summary> internal abstract class ScheduledEntityAction : SessionImpl.IExecutable { *************** *** 36,39 **** --- 39,45 ---- } + /// <summary> + /// Gets the <see cref="ISessionImplementor"/> the action is executing in. + /// </summary> protected ISessionImplementor Session { *************** *** 41,44 **** --- 47,53 ---- } + /// <summary> + /// Gets the identifier of the object. + /// </summary> protected object Id { *************** *** 46,49 **** --- 55,61 ---- } + /// <summary> + /// Gets the <see cref="IClassPersister"/> that is responsible for persisting the object. + /// </summary> protected IClassPersister Persister { *************** *** 51,55 **** } ! protected object Instance { --- 63,69 ---- } ! /// <summary> ! /// Gets the object that is having the scheduled action performed against it. ! /// </summary> protected object Instance { Index: ScheduledUpdate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledUpdate.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ScheduledUpdate.cs 28 Nov 2004 03:13:44 -0000 1.6 --- ScheduledUpdate.cs 28 Nov 2004 21:47:46 -0000 1.7 *************** *** 6,9 **** --- 6,12 ---- namespace NHibernate.Impl { + /// <summary> + /// A scheduled update of an object. + /// </summary> internal class ScheduledUpdate : ScheduledEntityAction { *************** *** 18,30 **** /// </summary> /// <param name="id">The identifier of the object.</param> ! /// <param name="fields">An object array that contains the value of each Property.</param> /// <param name="dirtyProperties">An array that contains the indexes of the dirty Properties.</param> /// <param name="lastVersion">The current version of the object.</param> /// <param name="nextVersion">The version the object should be after update.</param> /// <param name="instance">The actual object instance.</param> ! /// <param name="updatedState"></param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object nextVersion, object instance, object[] updatedState, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) { _fields = fields; --- 21,34 ---- /// </summary> /// <param name="id">The identifier of the object.</param> ! /// <param name="fields">An array of objects that contains the value of each Property.</param> /// <param name="dirtyProperties">An array that contains the indexes of the dirty Properties.</param> /// <param name="lastVersion">The current version of the object.</param> /// <param name="nextVersion">The version the object should be after update.</param> /// <param name="instance">The actual object instance.</param> ! /// <param name="updatedState">A deep copy of the <c>fields</c> object array.</param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object nextVersion, object instance, object[] updatedState, IClassPersister persister, ISessionImplementor session) ! : base(session, id, instance, persister) { _fields = fields; *************** *** 37,41 **** public override void Execute() { ! if ( Persister.HasCache ) Persister.Cache.Lock(Id); Persister.Update( Id, _fields, _dirtyFields, _lastVersion, Instance, Session ); Session.PostUpdate( Instance, _updatedState, _nextVersion ); --- 41,48 ---- public override void Execute() { ! if ( Persister.HasCache ) ! { ! Persister.Cache.Lock(Id); ! } Persister.Update( Id, _fields, _dirtyFields, _lastVersion, Instance, Session ); Session.PostUpdate( Instance, _updatedState, _nextVersion ); *************** *** 44,48 **** public override void AfterTransactionCompletion() { ! if( Persister.HasCache ) Persister.Cache.Release( Id) ; } } --- 51,58 ---- public override void AfterTransactionCompletion() { ! if( Persister.HasCache ) ! { ! Persister.Cache.Release( Id) ; ! } } } |
From: Michael D. <mik...@us...> - 2004-11-28 21:47:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3188/src/NHibernate/Engine Modified Files: ISessionImplementor.cs RowSelection.cs Versioning.cs Log Message: Added some comments about how the ScheduledActions and Versioning are working. Index: Versioning.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Versioning.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Versioning.cs 19 Oct 2004 02:24:08 -0000 1.4 --- Versioning.cs 28 Nov 2004 21:47:46 -0000 1.5 *************** *** 16,22 **** /// Increment the given version number /// </summary> ! /// <param name="version"></param> ! /// <param name="versionType"></param> ! /// <returns></returns> public static object Increment(object version, IVersionType versionType) { --- 16,22 ---- /// Increment the given version number /// </summary> ! /// <param name="version">The value of the current version.</param> ! /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> ! /// <returns>Returns the next value for the version.</returns> public static object Increment(object version, IVersionType versionType) { *************** *** 29,34 **** /// Create an initial version number /// </summary> ! /// <param name="versionType"></param> ! /// <returns></returns> public static object Seed(IVersionType versionType) { --- 29,34 ---- /// Create an initial version number /// </summary> ! /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> ! /// <returns>A seed value to initialize the versioned property with.</returns> public static object Seed(IVersionType versionType) { *************** *** 41,48 **** /// Seed the given instance state snapshot with an initial version number /// </summary> ! /// <param name="fields"></param> ! /// <param name="versionProperty"></param> ! /// <param name="versionType"></param> ! /// <returns></returns> public static bool SeedVersion(object[] fields, int versionProperty, IVersionType versionType) { --- 41,48 ---- /// Seed the given instance state snapshot with an initial version number /// </summary> ! /// <param name="fields">An array of objects that contains a snapshot of a persistent object.</param> ! /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> ! /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> ! /// <returns><c>true</c> if the version property needs to be seeded with an initial value.</returns> public static bool SeedVersion(object[] fields, int versionProperty, IVersionType versionType) { *************** *** 58,61 **** --- 58,68 ---- } + /// <summary> + /// Gets the value of the version. + /// </summary> + /// <param name="fields">An array of objects that contains a snapshot of a persistent object.</param> + /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> + /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> + /// <returns>The value of the version.</returns> private static object GetVersion(object[] fields, int versionProperty, IVersionType versionType) { *************** *** 63,66 **** --- 70,80 ---- } + /// <summary> + /// Sets the value of the version. + /// </summary> + /// <param name="fields">An array of objects that contains a snapshot of a persistent object.</param> + /// <param name="version">The value the version should be set to in the <c>fields</c> parameter.</param> + /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> + /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> private static void SetVersion(object[] fields, object version, int versionProperty, IVersionType versionType) { *************** *** 71,77 **** /// Set the version number of the given instance state snapshot /// </summary> ! /// <param name="fields"></param> ! /// <param name="version"></param> ! /// <param name="persister"></param> public static void SetVersion(object[] fields, object version, IClassPersister persister) { --- 85,91 ---- /// Set the version number of the given instance state snapshot /// </summary> ! /// <param name="fields">An array of objects that contains a snapshot of a persistent object.</param> ! /// <param name="version">The value the version should be set to in the <c>fields</c> parameter.</param> ! /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for persisting the values of the <c>fields</c> parameter.</param> public static void SetVersion(object[] fields, object version, IClassPersister persister) { *************** *** 82,88 **** /// Get the version number of the given instance state snapshot /// </summary> ! /// <param name="fields"></param> ! /// <param name="persister"></param> ! /// <returns></returns> public static object GetVersion(object[] fields, IClassPersister persister) { --- 96,105 ---- /// Get the version number of the given instance state snapshot /// </summary> ! /// <param name="fields">An array of objects that contains a snapshot of a persistent object.</param> ! /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for persisting the values of the <c>fields</c> parameter.</param> ! /// <returns> ! /// The value of the version contained in the <c>fields</c> parameter or null if the ! /// Entity is not versioned. ! /// </returns> public static object GetVersion(object[] fields, IClassPersister persister) { Index: ISessionImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ISessionImplementor.cs 31 Oct 2004 04:30:59 -0000 1.23 --- ISessionImplementor.cs 28 Nov 2004 21:47:46 -0000 1.24 *************** *** 175,181 **** /// After actually updating a row, record the fact that the database state has been update. /// </summary> ! /// <param name="obj"></param> ! /// <param name="updatedState"></param> ! /// <param name="nextVersion"></param> void PostUpdate(object obj, object[] updatedState, object nextVersion); --- 175,181 ---- /// After actually updating a row, record the fact that the database state has been update. /// </summary> ! /// <param name="obj">The <see cref="object"/> instance that was saved.</param> ! /// <param name="updatedState">A updated snapshot of the values in the object.</param> ! /// <param name="nextVersion">The new version to assign to the <c>obj</c>.</param> void PostUpdate(object obj, object[] updatedState, object nextVersion); Index: RowSelection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/RowSelection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RowSelection.cs 2 Sep 2004 04:00:42 -0000 1.2 --- RowSelection.cs 28 Nov 2004 21:47:46 -0000 1.3 *************** *** 12,16 **** /// Indicates that the no value has been set on the Property. /// </summary> ! public static int NoValue = -1; private int firstRow = 0; --- 12,16 ---- /// Indicates that the no value has been set on the Property. /// </summary> ! public static readonly int NoValue = -1; private int firstRow = 0; |
From: Michael D. <mik...@us...> - 2004-11-28 03:29:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7017/src/NHibernate/Impl Modified Files: ScheduledCollectionAction.cs ScheduledCollectionRecreate.cs ScheduledCollectionRemove.cs ScheduledCollectionUpdate.cs ScheduledDeletion.cs ScheduledEntityAction.cs ScheduledInsertion.cs ScheduledUpdate.cs SessionImpl.cs Log Message: fix for NH-158 Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** SessionImpl.cs 8 Nov 2004 02:53:58 -0000 1.47 --- SessionImpl.cs 28 Nov 2004 03:13:44 -0000 1.48 *************** *** 2522,2526 **** // wrap up any new collections directly referenced by the object ! // or its compoents // NOTE: we need to do the wrap here even if its not "dirty", --- 2522,2526 ---- // wrap up any new collections directly referenced by the object ! // or its components // NOTE: we need to do the wrap here even if its not "dirty", Index: ScheduledInsertion.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledInsertion.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledInsertion.cs 28 Mar 2004 06:08:10 -0000 1.2 --- ScheduledInsertion.cs 28 Nov 2004 03:13:44 -0000 1.3 *************** *** 10,24 **** { ! private readonly object[] state; ! public ScheduledInsertion(object id, object[] state, object instance, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) { ! this.state = state; } public override void Execute() { ! Persister.Insert( Id, state, Instance, Session); ! Session.PostInsert(Instance); } --- 10,33 ---- { ! private readonly object[] _state; ! /// <summary> ! /// Initializes a new instance of <see cref="ScheduledInsertion"/>. ! /// </summary> ! /// <param name="id">The identifier of the object.</param> ! /// <param name="state">An object array that contains the state of the object being inserted.</param> ! /// <param name="instance">The actual object instance.</param> ! /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> ! /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledInsertion(object id, object[] state, object instance, IClassPersister persister, ISessionImplementor session) ! : base(session, id, instance, persister) { ! _state = state; } public override void Execute() { ! Persister.Insert( Id, _state, Instance, Session); ! Session.PostInsert( Instance ); } Index: ScheduledCollectionAction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionAction.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ScheduledCollectionAction.cs 28 Mar 2004 06:08:10 -0000 1.5 --- ScheduledCollectionAction.cs 28 Nov 2004 03:13:44 -0000 1.6 *************** *** 9,46 **** internal abstract class ScheduledCollectionAction : SessionImpl.IExecutable { ! private CollectionPersister persister; ! private object id; ! private ISessionImplementor session; public ScheduledCollectionAction(CollectionPersister persister, object id, ISessionImplementor session) { ! this.persister = persister; ! this.session = session; ! this.id = id; } public void AfterTransactionCompletion() { ! persister.ReleaseSoftlock(id); } public object[] PropertySpaces { ! get { return new string[] { persister.QualifiedTableName }; } //TODO: cache the array on the persister } public CollectionPersister Persister { ! get { return persister;} } public object Id { ! get { return id;} } public ISessionImplementor Session { ! get { return session;} } --- 9,46 ---- internal abstract class ScheduledCollectionAction : SessionImpl.IExecutable { ! private CollectionPersister _persister; ! private object _id; ! private ISessionImplementor _session; public ScheduledCollectionAction(CollectionPersister persister, object id, ISessionImplementor session) { ! _persister = persister; ! _session = session; ! _id = id; } public void AfterTransactionCompletion() { ! _persister.ReleaseSoftlock( _id ); } public object[] PropertySpaces { ! get { return new string[] { _persister.QualifiedTableName }; } //TODO: cache the array on the persister } public CollectionPersister Persister { ! get { return _persister;} } public object Id { ! get { return _id;} } public ISessionImplementor Session { ! get { return _session;} } Index: ScheduledDeletion.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledDeletion.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledDeletion.cs 28 Mar 2004 06:08:10 -0000 1.2 --- ScheduledDeletion.cs 28 Nov 2004 03:13:44 -0000 1.3 *************** *** 8,28 **** internal class ScheduledDeletion : ScheduledEntityAction { ! private object version; ! public ScheduledDeletion(object id, object version, object instance, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) { ! this.version = version; } public override void Execute() { ! if ( Persister.HasCache ) Persister.Cache.Lock(Id); ! Persister.Delete(Id, version, Instance, Session); ! Session.PostDelete(Instance); } public override void AfterTransactionCompletion() { ! if ( Persister.HasCache ) Persister.Cache.Release(Id); } } --- 8,37 ---- internal class ScheduledDeletion : ScheduledEntityAction { ! private object _version; ! /// <summary> ! /// Initializes a new instance of <see cref="ScheduledDeletion"/>. ! /// </summary> ! /// <param name="id">The identifier of the object.</param> ! /// <param name="version">The version of the object being deleted.</param> ! /// <param name="instance">The actual object instance.</param> ! /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> ! /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledDeletion(object id, object version, object instance, IClassPersister persister, ISessionImplementor session) ! : base(session, id, instance, persister) { ! _version = version; } public override void Execute() { ! if( Persister.HasCache ) Persister.Cache.Lock( Id ); ! Persister.Delete( Id, _version, Instance, Session ); ! Session.PostDelete( Instance ); } public override void AfterTransactionCompletion() { ! if ( Persister.HasCache ) Persister.Cache.Release( Id ); } } Index: ScheduledCollectionRecreate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionRecreate.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledCollectionRecreate.cs 28 Mar 2004 06:08:10 -0000 1.2 --- ScheduledCollectionRecreate.cs 28 Nov 2004 03:13:44 -0000 1.3 *************** *** 8,22 **** internal sealed class ScheduledCollectionRecreate : ScheduledCollectionAction { ! private PersistentCollection collection; public ScheduledCollectionRecreate(PersistentCollection collection, CollectionPersister persister, object id, ISessionImplementor session) : base(persister, id, session) { ! this.collection = collection; } public override void Execute() { ! Persister.Softlock(Id); ! Persister.Recreate(collection, Id, Session); } } --- 8,22 ---- internal sealed class ScheduledCollectionRecreate : ScheduledCollectionAction { ! private PersistentCollection _collection; public ScheduledCollectionRecreate(PersistentCollection collection, CollectionPersister persister, object id, ISessionImplementor session) : base(persister, id, session) { ! _collection = collection; } public override void Execute() { ! Persister.Softlock( Id ); ! Persister.Recreate( _collection, Id, Session ); } } Index: ScheduledEntityAction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledEntityAction.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledEntityAction.cs 28 Mar 2004 06:08:10 -0000 1.3 --- ScheduledEntityAction.cs 28 Nov 2004 03:13:44 -0000 1.4 *************** *** 10,44 **** { ! private readonly ISessionImplementor session; ! private readonly object id; ! private readonly IClassPersister persister; ! private readonly object instance; protected ScheduledEntityAction(ISessionImplementor session, object id, object instance, IClassPersister persister) { ! this.session = session; ! this.id = id; ! this.persister = persister; ! this.instance = instance; } ! public object[] PropertySpaces { ! get { return persister.PropertySpaces; } } protected ISessionImplementor Session { ! get { return session;} } protected object Id { ! get { return id; } } protected IClassPersister Persister { ! get { return persister;} } --- 10,52 ---- { ! private readonly ISessionImplementor _session; ! private readonly object _id; ! private readonly IClassPersister _persister; ! private readonly object _instance; + /// <summary> + /// Initializes a new instance of <see cref="ScheduledEntityAction"/>. + /// </summary> + /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> + /// <param name="id">The identifier of the object.</param> + /// <param name="instance">The actual object instance.</param> + /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> protected ScheduledEntityAction(ISessionImplementor session, object id, object instance, IClassPersister persister) { ! _session = session; ! _id = id; ! _persister = persister; ! _instance = instance; } ! public object[] PropertySpaces ! { ! get { return _persister.PropertySpaces; } } protected ISessionImplementor Session { ! get { return _session;} } protected object Id { ! get { return _id; } } protected IClassPersister Persister { ! get { return _persister;} } *************** *** 46,54 **** protected object Instance { ! get { return instance; } } public abstract void AfterTransactionCompletion(); public abstract void Execute(); --- 54,68 ---- protected object Instance { ! get { return _instance; } } + /// <summary> + /// Called when the Transaction this action occurred in has completed. + /// </summary> public abstract void AfterTransactionCompletion(); + /// <summary> + /// Execute the action using the <see cref="IClassPersister"/>. + /// </summary> public abstract void Execute(); Index: ScheduledUpdate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledUpdate.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ScheduledUpdate.cs 27 Nov 2004 01:03:39 -0000 1.5 --- ScheduledUpdate.cs 28 Nov 2004 03:13:44 -0000 1.6 *************** *** 8,24 **** internal class ScheduledUpdate : ScheduledEntityAction { ! private object[] fields; ! private object lastVersion; ! private object nextVersion; ! private int[] dirtyFields; ! private object[] updatedState; public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object nextVersion, object instance, object[] updatedState, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) { ! this.fields = fields; ! this.lastVersion = lastVersion; ! this.nextVersion = nextVersion; ! this.dirtyFields = dirtyFields; ! this.updatedState = updatedState; } --- 8,36 ---- internal class ScheduledUpdate : ScheduledEntityAction { ! private object[] _fields; ! private object _lastVersion; ! private object _nextVersion; ! private int[] _dirtyFields; ! private object[] _updatedState; + /// <summary> + /// Initializes a new instance of <see cref="ScheduledUpdate"/>. + /// </summary> + /// <param name="id">The identifier of the object.</param> + /// <param name="fields">An object array that contains the value of each Property.</param> + /// <param name="dirtyProperties">An array that contains the indexes of the dirty Properties.</param> + /// <param name="lastVersion">The current version of the object.</param> + /// <param name="nextVersion">The version the object should be after update.</param> + /// <param name="instance">The actual object instance.</param> + /// <param name="updatedState"></param> + /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> + /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object nextVersion, object instance, object[] updatedState, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) { ! _fields = fields; ! _lastVersion = lastVersion; ! _nextVersion = nextVersion; ! _dirtyFields = dirtyProperties; ! _updatedState = updatedState; } *************** *** 26,36 **** { if ( Persister.HasCache ) Persister.Cache.Lock(Id); ! Persister.Update(Id, fields, dirtyFields, lastVersion, Instance, Session); ! Session.PostUpdate(Instance, updatedState, nextVersion); } public override void AfterTransactionCompletion() { ! if ( Persister.HasCache ) Persister.Cache.Release(Id); } } --- 38,48 ---- { if ( Persister.HasCache ) Persister.Cache.Lock(Id); ! Persister.Update( Id, _fields, _dirtyFields, _lastVersion, Instance, Session ); ! Session.PostUpdate( Instance, _updatedState, _nextVersion ); } public override void AfterTransactionCompletion() { ! if( Persister.HasCache ) Persister.Cache.Release( Id) ; } } Index: ScheduledCollectionUpdate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionUpdate.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScheduledCollectionUpdate.cs 28 Mar 2004 06:08:10 -0000 1.4 --- ScheduledCollectionUpdate.cs 28 Nov 2004 03:13:44 -0000 1.5 *************** *** 9,43 **** { ! private readonly PersistentCollection collection; ! private readonly bool emptySnapshot; public ScheduledCollectionUpdate(PersistentCollection collection, CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) : base(persister, id, session) { ! this.collection = collection; ! this.emptySnapshot = emptySnapshot; } public override void Execute() { ! Persister.Softlock(Id); ! if ( !collection.WasInitialized ) { ! if ( !collection.HasQueuedAdds ) throw new AssertionFailure("bug processing queued adds"); //do nothing - we only need to notify the cache... } ! else if ( collection.Empty ) { ! if( !emptySnapshot ) Persister.Remove(Id, Session); } ! else if ( collection.NeedsRecreate(Persister) ) { ! if( !emptySnapshot ) Persister.Remove(Id, Session); ! Persister.Recreate(collection, Id, Session); } else { ! Persister.DeleteRows(collection, Id, Session); ! Persister.UpdateRows(collection, Id, Session); ! Persister.InsertRows(collection, Id, Session); } --- 9,43 ---- { ! private readonly PersistentCollection _collection; ! private readonly bool _emptySnapshot; public ScheduledCollectionUpdate(PersistentCollection collection, CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) : base(persister, id, session) { ! _collection = collection; ! _emptySnapshot = emptySnapshot; } public override void Execute() { ! Persister.Softlock( Id ); ! if( !_collection.WasInitialized ) { ! if ( !_collection.HasQueuedAdds ) throw new AssertionFailure("bug processing queued adds"); //do nothing - we only need to notify the cache... } ! else if( _collection.Empty ) { ! if( !_emptySnapshot ) Persister.Remove( Id, Session ); } ! else if( _collection.NeedsRecreate( Persister ) ) { ! if( !_emptySnapshot ) Persister.Remove( Id, Session ); ! Persister.Recreate( _collection, Id, Session ); } else { ! Persister.DeleteRows( _collection, Id, Session ); ! Persister.UpdateRows( _collection, Id, Session ); ! Persister.InsertRows( _collection, Id, Session ); } Index: ScheduledCollectionRemove.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledCollectionRemove.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledCollectionRemove.cs 28 Mar 2004 06:08:10 -0000 1.3 --- ScheduledCollectionRemove.cs 28 Nov 2004 03:13:44 -0000 1.4 *************** *** 8,22 **** { ! private bool emptySnapshot; public ScheduledCollectionRemove(CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) : base(persister, id, session) { ! this.emptySnapshot = emptySnapshot; } public override void Execute() { ! Persister.Softlock(Id); ! if(!emptySnapshot) Persister.Remove(Id, Session); } } --- 8,22 ---- { ! private bool _emptySnapshot; public ScheduledCollectionRemove(CollectionPersister persister, object id, bool emptySnapshot, ISessionImplementor session) : base(persister, id, session) { ! _emptySnapshot = emptySnapshot; } public override void Execute() { ! Persister.Softlock( Id ); ! if( !_emptySnapshot ) Persister.Remove( Id, Session ); } } |
From: Michael D. <mik...@us...> - 2004-11-28 03:27:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7017/src/NHibernate.Test Modified Files: MultiTableTest.cs Log Message: fix for NH-158 Index: MultiTableTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MultiTableTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MultiTableTest.cs 18 Nov 2004 02:46:59 -0000 1.6 --- MultiTableTest.cs 28 Nov 2004 03:13:43 -0000 1.7 *************** *** 650,653 **** --- 650,673 ---- } + [Test] + public void DynamicUpdate() + { + ISession s = sessions.OpenSession(); + Simple simple = new Simple(); + + simple.Name = "saved"; + object id = s.Save( simple ); + s.Flush(); + + simple.Name = "updated"; + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + simple = (Simple)s.Load( typeof(Simple), id ); + Assert.AreEqual( "updated", simple.Name, "name should have been updated" ); + s.Close(); + } + } } |
From: Michael D. <mik...@us...> - 2004-11-27 19:00:49
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3840/src/NHibernate Modified Files: nhibernate-mapping-2.0.xsd Log Message: explicitly stated that minOccurs="1" for id or composite-id, not really needed since that is the default, but did it while testing a jira. Index: nhibernate-mapping-2.0.xsd =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate-mapping-2.0.xsd,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nhibernate-mapping-2.0.xsd 22 Aug 2004 06:20:50 -0000 1.6 --- nhibernate-mapping-2.0.xsd 27 Nov 2004 19:00:27 -0000 1.7 *************** *** 63,67 **** <xs:element ref='meta' minOccurs='0' maxOccurs='unbounded' /> <xs:element ref='jcs-cache' minOccurs='0' /> ! <xs:choice> <xs:element ref='id' /> <xs:element ref='composite-id' /> --- 63,67 ---- <xs:element ref='meta' minOccurs='0' maxOccurs='unbounded' /> <xs:element ref='jcs-cache' minOccurs='0' /> ! <xs:choice minOccurs='1'> <xs:element ref='id' /> <xs:element ref='composite-id' /> |
From: Michael D. <mik...@us...> - 2004-11-27 18:59:27
|
Update of /cvsroot/nhibernate/nhibernate/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3507/src Modified Files: .cvsignore Log Message: Added Clover.NET to build files for code coverage analysis. Index: .cvsignore =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 18 Nov 2004 02:50:12 -0000 1.2 --- .cvsignore 27 Nov 2004 18:59:12 -0000 1.3 *************** *** 1,2 **** --- 1,3 ---- *.suo *.snk + CloverBuild |
From: Michael D. <mik...@us...> - 2004-11-27 18:58:53
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3318/src/NHibernate.Test Modified Files: NHibernate.Test.build Log Message: Added Clover.NET to build files for code coverage analysis. Index: NHibernate.Test.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test.build,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NHibernate.Test.build 18 Nov 2004 02:46:59 -0000 1.10 --- NHibernate.Test.build 27 Nov 2004 18:58:43 -0000 1.11 *************** *** 15,18 **** --- 15,19 ---- * project.version.minor - the minor number of the build * project.version.build - the build number + * nunit2report.installed- (true|false) if nunit2report has been installed to generate html reports --> *************** *** 96,99 **** --- 97,110 ---- /> </nunit2> + + <if propertytrue="nunit2report.installed"> + <mkdir dir="${build.dir}/testresults" /> + <nunit2report out="${build.dir}/testresults/index.html" format="Frames" todir="${build.dir}/testresults"> + <fileset> + <includes name="${build.dir}\bin\*results.xml" /> + </fileset> + </nunit2report> + </if> + </target> </project> \ No newline at end of file |
From: Michael D. <mik...@us...> - 2004-11-27 18:58:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3318/src/NHibernate Modified Files: NHibernate.build Log Message: Added Clover.NET to build files for code coverage analysis. Index: NHibernate.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.build,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NHibernate.build 21 Nov 2004 22:56:27 -0000 1.5 --- NHibernate.build 27 Nov 2004 18:58:42 -0000 1.6 *************** *** 6,10 **** xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" > ! <!-- Required properties: --- 6,10 ---- xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" > ! <!-- Required properties: *************** *** 16,25 **** * project.version.minor - the minor number of the build * project.version.build - the build number ! * sign - (true|false)indicates if the Assembly should be signed. --> ! <property name="keyFile" value="..\NHibernate.snk" /> <target name="build" description="Build NHibernate"> <!-- ensure the AssemblyInfo is writable --> <attrib file="AssemblyInfo.cs" readonly="false" /> --- 16,41 ---- * project.version.minor - the minor number of the build * project.version.build - the build number ! * sign - (true|false) indicates if the Assembly should be signed. ! * clover.enabled - (true|false) indicates if Clover.NET should handle the build --> ! ! <if propertytrue="clover.enabled"> ! <loadtasks assembly="${clover.home}/CloverNAnt-0.84.dll" /> ! </if> ! <property name="keyFile" value="..\NHibernate.snk" /> <target name="build" description="Build NHibernate"> + + <if propertytrue="clover.enabled"> + <mkdir dir="..\CloverBuild" /> + <clover-setup + initstring="..\CloverBuild\clover.cdb" + builddir="..\CloverBuild" + enabled="${clover.enabled}" + flushinterval="1000" + /> + </if> + <!-- ensure the AssemblyInfo is writable --> <attrib file="AssemblyInfo.cs" readonly="false" /> *************** *** 55,62 **** <sources failonempty="true"> <includes name="**/*.cs" /> - <excludes name="Eg/**" /> - <excludes name="InternalTest/**/*.cs" /> - <excludes name="Test/**/*.cs" /> - <excludes name="Util/*Test.cs" /> <excludes name="Dialect/HSQLDialect.cs" /> <excludes name="Dialect/InterbaseDialect.cs" /> --- 71,74 ---- *************** *** 84,86 **** --- 96,119 ---- </target> + <target name="coverage-report"> + + <if propertytrue="clover.enabled"> + + <mkdir dir="${build.dir}/clover" /> + <clover-setup + initstring="..\CloverBuild\clover.cdb" + builddir="..\CloverBuild" + enabled="${clover.enabled}" + flushinterval="1000" + /> + <clover-report> + <current title="NHibernate Clover Report" output="${build.dir}/clover" > + <format type="html" orderBy="Alpha" /> + </current> + </clover-report> + + </if> + + </target> + </project> \ No newline at end of file |
From: Michael D. <mik...@us...> - 2004-11-27 18:58:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tasks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3318/src/NHibernate.Tasks Modified Files: NHibernate.Tasks.build Log Message: Added Clover.NET to build files for code coverage analysis. Index: NHibernate.Tasks.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tasks/NHibernate.Tasks.build,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NHibernate.Tasks.build 13 Oct 2004 04:18:08 -0000 1.3 --- NHibernate.Tasks.build 27 Nov 2004 18:58:42 -0000 1.4 *************** *** 45,49 **** doc="${build.dir}/bin/${nant.project.name}.xml" nowarn="1591" - verbose="true" > <sources failonempty="true"> --- 45,48 ---- |
From: Michael D. <mik...@us...> - 2004-11-27 18:58:51
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3318 Modified Files: NHibernateSolution.build Added Files: debug.bat release-package.bat Log Message: Added Clover.NET to build files for code coverage analysis. Index: NHibernateSolution.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/NHibernateSolution.build,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NHibernateSolution.build 21 Nov 2004 22:50:33 -0000 1.16 --- NHibernateSolution.build 27 Nov 2004 18:58:41 -0000 1.17 *************** *** 7,10 **** --- 7,22 ---- > <!-- + if nunit2report tasks from http://nunit2report.sourceforge.net/ has been installed + then change this to true. It generates a nice looking html report for the test files + --> + <property name="nunit2report.installed" value="false" /> + + <!-- + Cenqua provided a license of Clover.NET for the NHibernate project to use. + --> + <property name="clover.enabled" value="false" /> + <property name="clover.home" value="C:/Program Files/Cenqua/Clover.NET" /> + + <!-- Use this to determine if the key file NHibernate.key should be used to sign the Assemblies. This defaults to false since users doing their own *************** *** 62,65 **** --- 74,81 ---- </target> + <target name="clean-bin" depends="init" description="Deletes the current bin folder"> + <delete dir="${build.dir}/bin" failonerror="false" /> + </target> + <target name="cleanall" description="Deletes every build configuration"> <echo message="Deleting all builds from all configurations" /> *************** *** 77,80 **** --- 93,114 ---- </target> + <target name="build-with-clover" depends="init" description="Builds current config with Clover coverage"> + <!-- + mark this as being a clover enabled build and then just let the normal build + process take place + --> + <property name="clover.enabled" value="true" /> + </target> + + <target name="build-without-clover" depends="init" description="Ensures the build is done without Clover coverage"> + <!-- + This does not really need to be called unless the clover.enabled property has been explicitly + set to true by some other means since clover.enabled defaults to false. It is my intention + to first do a clover build to get the coverage then to do a non-clover build to get the + clover-free dlls. + --> + <property name="clover.enabled" value="false" /> + </target> + <target name="build" depends="init" description="Builds current configuration"> <echo message="Current Directory is ${nant.project.basedir}" /> *************** *** 147,151 **** value="conn string here" /> ! </target> --- 181,187 ---- value="conn string here" /> ! ! <!-- the NHibernate.build takes care of determining if this is a clover build or not --> ! <nant target="coverage-report" buildfile="src/NHibernate/NHibernate.build" /> </target> *************** *** 155,159 **** <includes name="NHibernate.dll" /> </assemblies> ! <documenters> <documenter name="MSDN"> --- 191,197 ---- <includes name="NHibernate.dll" /> </assemblies> ! <summaries> ! <includes name="src/NHibernate/NamespaceSummary.xml" /> ! </summaries> <documenters> <documenter name="MSDN"> *************** *** 191,197 **** <property name="AutoPropertyBackerSummaries" value="False" /> <property name="AutoDocumentConstructors" value="True" /> ! <property name="DocumentAttributes" value="False" /> <property name="ShowTypeIdInAttributes" value="False" /> ! <property name="DocumentedAttributes" value="" /> <property name="GetExternalSummaries" value="True" /> <property name="EditorBrowsableFilter" value="Off" /> --- 229,235 ---- <property name="AutoPropertyBackerSummaries" value="False" /> <property name="AutoDocumentConstructors" value="True" /> ! <property name="DocumentAttributes" value="True" /> <property name="ShowTypeIdInAttributes" value="False" /> ! <property name="DocumentedAttributes" value="True" /> <property name="GetExternalSummaries" value="True" /> <property name="EditorBrowsableFilter" value="Off" /> *************** *** 218,223 **** <includes name="${lib.dir}/**" /> ! <!-- exclude the UnitTesting project that is no longer used --> <excludes name="src/UnitTesting/**" /> <includes name="src/**" /> --- 256,266 ---- <includes name="${lib.dir}/**" /> ! <!-- ! exclude the UnitTesting project that is no longer used and the ! Clover modified source files. ! --> <excludes name="src/UnitTesting/**" /> + <excludes name="src/CloverBuild/**" /> + <includes name="src/**" /> --- NEW FILE: release-package.bat --- NAnt -D:project.config=release -D:sign=true clean build-with-clover test >release-with-clover.log NAnt -D:project.config=release -D:sign=true -D:nunit2report.installed=true clean-bin package >release-package.log --- NEW FILE: debug.bat --- NAnt clean build-with-clover test >debug-with-clover.log NAnt clean-bin test >debug.log |
From: Michael D. <mik...@us...> - 2004-11-27 03:45:52
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28476 Modified Files: releasenotes.txt Log Message: some more updates. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** releasenotes.txt 18 Nov 2004 03:18:25 -0000 1.19 --- releasenotes.txt 27 Nov 2004 03:45:42 -0000 1.20 *************** *** 9,12 **** --- 9,14 ---- - Isolated test and classes that use DbType.Time into their own fixtures. Data Drivers don't implement this consistently. - Fixed problem where HQL was not parsing Fully Qualified Enums correctly. (Peter Smulovics) + - Fixed Int16 not working as a <version> Property. + - Modified NHibernate and Iesi.Collections to have the attribute CLSCompliantAttribute(true). Alpha Build 0.4.0.0 |
From: Michael D. <mik...@us...> - 2004-11-27 03:42:27
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27970/doc/reference/en/modules Modified Files: basic_mapping.xml Log Message: Added namespace summary to ndoc. Fixed typo in docs for property accessor. Index: basic_mapping.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/basic_mapping.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** basic_mapping.xml 25 Oct 2004 05:20:25 -0000 1.5 --- basic_mapping.xml 27 Nov 2004 03:42:15 -0000 1.6 *************** *** 490,498 **** <entry> <para> ! NHibernate will access the Field directly. NHibernate uses the <literal><name></literal> ! as the name of the field. This can be used when a Property's get and set have extra ! actions in them that you don't want to occur when NHibernate is populating or reading the object. ! If you want the name of the Property and not the Field to be what the consumers of your API ! use with HQL, then a Naming Strategy is needed. </para> </entry> --- 490,496 ---- <entry> <para> ! The default implementation. NHibernate uses the get/set of your Property. No ! Naming Strategy should be used with this Access Strategy because the ! <literal>name</literal> attribute is the name of the Property. </para> </entry> |
From: Michael D. <mik...@us...> - 2004-11-27 03:42:26
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27970/src/NHibernate Modified Files: NHibernate-1.1.csproj Added Files: NamespaceSummary.xml Log Message: Added namespace summary to ndoc. Fixed typo in docs for property accessor. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** NHibernate-1.1.csproj 18 Nov 2004 02:48:38 -0000 1.60 --- NHibernate-1.1.csproj 27 Nov 2004 03:42:16 -0000 1.61 *************** *** 210,213 **** --- 210,217 ---- /> <File + RelPath = "NamespaceSummary.xml" + BuildAction = "Content" + /> + <File RelPath = "NHibernate.build" BuildAction = "None" --- NEW FILE: NamespaceSummary.xml --- <?xml version="1.0" ?> <namespaces> <namespace name="NHibernate">The core classes and interfaces for working with NHibernate.</namespace> <namespace name="NHibernate.Cache">The classes and interfaces that make up the second-level cache.</namespace> <namespace name="NHibernate.Cfg">The classes used to configure an NHibernate ISession and ISessionFactory.</namespace> <namespace name="NHibernate.Collection">The classes that implement IList, IDictionary, and Iesi.Collections.ISet and the Persister to read/write to the database.</namespace> <namespace name="NHibernate.Connection">The classes and interfaces that NHibernate uses to get connections to the database.</namespace> <namespace name="NHibernate.Dialect">The classes and interfaces that NHibernate uses to create SQL Statements that conform to the particular database.</namespace> <namespace name="NHibernate.Driver">The classes and interfaces that NHibernate uses to interface with the various .NET Data Providers.</namespace> <namespace name="NHibernate.Engine">The classes and interfaces that NHibernate uses internally.</namespace> <namespace name="NHibernate.Expression">The classes and interfaces to use for building Queries in an OO style.</namespace> <namespace name="NHibernate.Hql">The classes and interfaces that are used to parse Queries in the form of HQL.</namespace> <namespace name="NHibernate.Id">The classes and interfaces that define how NHibernate generates or retreives generated ids.</namespace> <namespace name="NHibernate.Impl">The classes that implement many of the internal NHibernate interfaces.</namespace> <namespace name="NHibernate.Loader">The classes and interfaces that define how NHibernate loads data from the database.</namespace> <namespace name="NHibernate.Mapping">The classes that the hbm.xml files are converted to during Configuration.</namespace> <namespace name="NHibernate.Metadata">The interfaces to use to retrieve information about Classes and Collections that NHibernate is managing.</namespace> <namespace name="NHibernate.Persister">The classes and interfaces that NHibernate uses to persist objects.</namespace> <namespace name="NHibernate.Property">The classes and interfaces that NHibernate uses to get/set values in the objects.</namespace> <namespace name="NHibernate.Proxy"></namespace> <namespace name="NHibernate.SqlCommand">The classes that NHibernate uses to build Sql Statements for the Drivers & Dialects to convert to SQL.</namespace> <namespace name="NHibernate.SqlTypes">The classes that NHibernate uses to add extra information to DbTypes.</namespace> <namespace name="NHibernate.Tool.hbm2ddl">The classes that NHibernate uses to build ddl from the mapped classes.</namespace> <namespace name="NHibernate.Transaction">The classes and interfaces that NHibernate uses to manage transactions.</namespace> <namespace name="NHibernate.Type">The classes and interfaces that NHibernate uses to convert .NET objects to database values.</namespace> <namespace name="NHibernate.Util">Utility classes that NHibernate uses through out.</namespace> </namespaces> |
From: Michael D. <mik...@us...> - 2004-11-27 01:04:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv522/Engine Modified Files: Key.cs Log Message: Removed some [Obsolete] methods. Index: Key.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Key.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Key.cs 24 May 2004 05:51:03 -0000 1.5 --- Key.cs 27 Nov 2004 01:03:39 -0000 1.6 *************** *** 31,43 **** /// <summary> - /// Construct a unique identifier for a collection instance - /// </summary> - /// <param name="id"></param> - /// <param name="p"></param> - //TODO:not in H2.0.3 - [Obsolete("This ctor is not in H2.0.3")] - public Key(object id, CollectionPersister p) : this ( id, p.QualifiedTableName ) { } - - /// <summary> /// The user-visible identifier /// </summary> --- 31,34 ---- |
From: Michael D. <mik...@us...> - 2004-11-27 01:03:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv522/Impl Modified Files: ScheduledUpdate.cs Log Message: Removed some [Obsolete] methods. Index: ScheduledUpdate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledUpdate.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScheduledUpdate.cs 24 May 2004 20:52:47 -0000 1.4 --- ScheduledUpdate.cs 27 Nov 2004 01:03:39 -0000 1.5 *************** *** 14,25 **** private object[] updatedState; - [Obsolete("The ctor with more params should be used")] - public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object instance, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) - { - this.fields = fields; - this.lastVersion = lastVersion; - this.dirtyFields = dirtyProperties; - } - public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object nextVersion, object instance, object[] updatedState, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) { --- 14,17 ---- |
From: Michael D. <mik...@us...> - 2004-11-27 01:01:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32302/Id Modified Files: TableGenerator.cs Log Message: NH-125: default to 1 instead of 0 Index: TableGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/TableGenerator.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TableGenerator.cs 19 Jul 2004 03:23:13 -0000 1.9 --- TableGenerator.cs 27 Nov 2004 01:00:09 -0000 1.10 *************** *** 159,165 **** public string[] SqlCreateStrings(Dialect.Dialect dialect) { return new string[] { "create table " + tableName + " ( " + columnName + " " + dialect.GetTypeName( SqlTypeFactory.GetInt32() ) + " )", ! "insert into " + tableName + " values ( 0 )" }; } --- 159,168 ---- public string[] SqlCreateStrings(Dialect.Dialect dialect) { + // changed the first value to be "1" by default since an uninitialized Int32 is 0 - leaving + // it at 0 would cause problems with an unsaved-value="0" which is what most people are + // defaulting <id>'s with Int32 types at. return new string[] { "create table " + tableName + " ( " + columnName + " " + dialect.GetTypeName( SqlTypeFactory.GetInt32() ) + " )", ! "insert into " + tableName + " values ( 1 )" }; } |
From: Michael D. <mik...@us...> - 2004-11-24 14:35:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24376/src/NHibernate.Test Modified Files: MasterDetailTest.cs Log Message: trying to duplicate collection refresh problem. Index: MasterDetailTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MasterDetailTest.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MasterDetailTest.cs 18 Nov 2004 02:46:59 -0000 1.16 --- MasterDetailTest.cs 24 Nov 2004 14:34:45 -0000 1.17 *************** *** 703,706 **** --- 703,719 ---- c = (Category) s.Load( typeof(Category), id ); Assert.AreEqual( 1, c.Subcategories.Count ); + + // modify the collection in another session + ISession s2 = sessions.OpenSession(); + Category c2 = (Category)s2.Load( typeof(Category), id ); + c2.Subcategories.Add( new Category() ); + s2.Flush(); + s2.Close(); + + // now lets refresh the collection and see if it picks up + // the new objects + s.Refresh( c ); + Assert.AreEqual( 2, c.Subcategories.Count, "should have gotten the addition from s2" ); + s.Delete(c); s.Flush(); |
From: Michael D. <mik...@us...> - 2004-11-24 14:34:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24376/src/NHibernate.Test/NHSpecificTest Modified Files: BasicClassFixture.cs Log Message: trying to duplicate collection refresh problem. Index: BasicClassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** BasicClassFixture.cs 18 Nov 2004 02:47:00 -0000 1.9 --- BasicClassFixture.cs 24 Nov 2004 14:34:44 -0000 1.10 *************** *** 690,693 **** --- 690,717 ---- [Test] + public void BagRefresh() + { + int id = 1; + int originalCount; + + BasicClass basicClass = InsertBasicClass(id); + originalCount = basicClass.StringBag.Count; + + ISession s = sessions.OpenSession(); + ISession s2 = sessions.OpenSession(); + + BasicClass bc = (BasicClass)s.Load( typeof(BasicClass), id ); + BasicClass bc2 = (BasicClass)s2.Load( typeof(BasicClass), id ); + + bc2.StringBag.Add( "refresh value" ); + s2.Flush(); + s2.Close(); + + s.Refresh( bc ); + Assert.AreEqual( originalCount + 1, bc.StringBag.Count, "was refreshed correctly" ); + s.Close(); + } + + [Test] public void TestListCRUD() { |
From: Michael D. <mik...@us...> - 2004-11-22 03:56:46
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29295/Property Modified Files: FieldAccessor.cs Log Message: minor fixes for FxCop rules Index: FieldAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/FieldAccessor.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FieldAccessor.cs 10 Sep 2004 21:23:15 -0000 1.4 --- FieldAccessor.cs 22 Nov 2004 03:56:00 -0000 1.5 *************** *** 15,19 **** public class FieldAccessor : IPropertyAccessor { ! protected IFieldNamingStrategy namingStragety; public FieldAccessor() --- 15,19 ---- public class FieldAccessor : IPropertyAccessor { ! private IFieldNamingStrategy namingStrategy; public FieldAccessor() *************** *** 21,27 **** } ! public FieldAccessor(IFieldNamingStrategy namingStragety) { ! this.namingStragety = namingStragety; } --- 21,37 ---- } ! public FieldAccessor(IFieldNamingStrategy namingStrategy) { ! this.namingStrategy = namingStrategy; ! } ! ! /// <summary> ! /// Gets the <see cref="IFieldNamingStrategy"/> used to convert the name of the ! /// Property in the hbm.xml file to the name of the field in the class. ! /// </summary> ! /// <value>The <see cref="IFieldNamingStrategy"/> or <c>null</c>.</value> ! public IFieldNamingStrategy NamingStrategy ! { ! get { return namingStrategy; } } *************** *** 71,75 **** private string GetFieldName(string propertyName) { ! if(namingStragety==null) { return propertyName; --- 81,85 ---- private string GetFieldName(string propertyName) { ! if( namingStrategy==null ) { return propertyName; *************** *** 77,81 **** else { ! return namingStragety.GetFieldName(propertyName); } } --- 87,91 ---- else { ! return namingStrategy.GetFieldName(propertyName); } } |