Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22694/Type
Modified Files:
ArrayType.cs MapType.cs PersistentCollectionType.cs
Log Message:
Fixed method naming inconsitencies with ElementCollection and
GetElementCollection and added correct overrides to MapType class. Fixes
problem reported on forum about <map>s not cascading.
Index: MapType.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/MapType.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MapType.cs 10 Feb 2004 18:41:42 -0000 1.3
--- MapType.cs 1 Jun 2004 01:36:11 -0000 1.4
***************
*** 20,28 ****
}
! public ICollection ElementsCollection(object collection) {
return ((IDictionary) collection).Values;
}
! public override PersistentCollection Wrap(ISessionImplementor session, object collection) {
return new Map( session, (IDictionary) collection );
}
--- 20,30 ----
}
! public override ICollection GetElementsCollection(object collection)
! {
return ((IDictionary) collection).Values;
}
! public override PersistentCollection Wrap(ISessionImplementor session, object collection)
! {
return new Map( session, (IDictionary) collection );
}
Index: ArrayType.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ArrayType.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ArrayType.cs 24 Mar 2004 19:54:02 -0000 1.5
--- ArrayType.cs 1 Jun 2004 01:36:11 -0000 1.6
***************
*** 28,32 ****
}
! public ICollection ElementsCollection(object collection) {
return ((object[])collection);
}
--- 28,32 ----
}
! public override ICollection GetElementsCollection(object collection) {
return ((object[])collection);
}
Index: PersistentCollectionType.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentCollectionType.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PersistentCollectionType.cs 24 May 2004 05:49:19 -0000 1.11
--- PersistentCollectionType.cs 1 Jun 2004 01:36:11 -0000 1.12
***************
*** 88,101 ****
}
! //Is it correct?
! //Was:
! //public Iterator getElementsIterator(Object collection) {
! // return ( (java.util.Collection) collection ).iterator();
! //}
/// <summary>
! /// Returns a reference to the underlying ICollection
/// </summary>
/// <param name="collection">The object that holds the ICollection.</param>
! /// <returns>An ICollection.</returns>
public virtual ICollection GetElementsCollection(object collection) {
return ( (ICollection)collection );
--- 88,102 ----
}
!
/// <summary>
! /// Returns a reference to the elements in the collection.
/// </summary>
/// <param name="collection">The object that holds the ICollection.</param>
! /// <returns>An ICollection of the Elements(classes) in the Collection.</returns>
! /// <remarks>
! /// By default the parameter <c>collection</c> is just cast to an ICollection. Collections
! /// such as Maps and Sets should override this so that the Elements are returned - not a
! /// DictionaryEntry.
! /// </remarks>
public virtual ICollection GetElementsCollection(object collection) {
return ( (ICollection)collection );
|