Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7576/src/NHibernate/Impl
Modified Files:
CollectionEntry.cs
Log Message:
Modified collection snapshots to be ICollections instead of objects (not so generic, but all of them are ICollections anyway).
Fixed a bug in Set.InitializeFromCache
Index: CollectionEntry.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/CollectionEntry.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CollectionEntry.cs 14 Mar 2005 18:52:52 -0000 1.8
--- CollectionEntry.cs 9 Apr 2005 12:51:06 -0000 1.9
***************
*** 114,118 ****
/// <summary>session-start/post-flush persistent state</summary>
! internal object snapshot;
/// <summary>allow the snapshot to be serialized</summary>
--- 114,118 ----
/// <summary>session-start/post-flush persistent state</summary>
! internal ICollection snapshot;
/// <summary>allow the snapshot to be serialized</summary>
***************
*** 306,310 ****
/// <summary></summary>
! public object Snapshot
{
get { return snapshot; }
--- 306,310 ----
/// <summary></summary>
! public ICollection Snapshot
{
get { return snapshot; }
***************
*** 354,372 ****
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
! // to just cast it to a ICollection instead of all the diff collections.
! return initialized && snapshot != null && (
! ( snapshot is IList && ( ( IList ) snapshot ).Count == 0 ) || // if snapshot is a collection
! ( snapshot is IDictionary && ( ( IDictionary ) snapshot ).Count == 0 ) || // if snapshot is a map
! ( snapshot.GetType().IsArray && ( ( Array ) snapshot ).Length == 0 ) // if snapshot is an array
! );
}
}
--- 354,358 ----
get
{
! return initialized && snapshot != null && snapshot.Count == 0;
}
}
|