|
From: Michael D. <mik...@us...> - 2004-04-26 03:47:42
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2350/NHibernate.DomainModel Modified Files: Baz.cs Foo.cs Log Message: Fixed mismapping between nhibernate collection mapping elements and .net collection interfaces. Index: Baz.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Baz.cs 13 Apr 2004 15:32:58 -0000 1.3 --- Baz.cs 26 Apr 2004 03:47:32 -0000 1.4 *************** *** 11,14 **** --- 11,15 ---- using System; using System.Collections; + using System.Collections.Specialized; namespace NHibernate.DomainModel *************** *** 201,205 **** /// Holder for stringDateMap /// </summary> ! private System.Collections.SortedList _stringDateMap; /// <summary> --- 202,206 ---- /// Holder for stringDateMap /// </summary> ! private System.Collections.IDictionary _stringDateMap; /// <summary> *************** *** 211,215 **** /// Holder for cachedMap /// </summary> ! private System.Collections.SortedList _cachedMap; /// <summary> --- 212,216 ---- /// Holder for cachedMap /// </summary> ! private System.Collections.IDictionary _cachedMap; /// <summary> *************** *** 231,235 **** /// Holder for stringSet /// </summary> ! private System.Collections.IList _stringSet; /// <summary> --- 232,237 ---- /// Holder for stringSet /// </summary> ! //private System.Collections.IList _stringSet; ! private System.Collections.IDictionary _stringSet; /// <summary> *************** *** 246,250 **** /// Holder for cached /// </summary> ! private System.Collections.IList _cached; /// <summary> --- 248,252 ---- /// Holder for cached /// </summary> ! private System.Collections.IDictionary _cached; /// <summary> *************** *** 460,464 **** /// Get/set for stringDateMap /// </summary> ! public System.Collections.SortedList stringDateMap { get --- 462,466 ---- /// Get/set for stringDateMap /// </summary> ! public System.Collections.IDictionary stringDateMap { get *************** *** 490,494 **** /// Get/set for cachedMap /// </summary> ! public System.Collections.SortedList cachedMap { get --- 492,496 ---- /// Get/set for cachedMap /// </summary> ! public System.Collections.IDictionary cachedMap { get *************** *** 550,554 **** /// Get/set for stringSet /// </summary> ! public System.Collections.IList stringSet { get --- 552,557 ---- /// Get/set for stringSet /// </summary> ! //public System.Collections.IList stringSet ! public System.Collections.IDictionary stringSet { get *************** *** 595,599 **** /// Get/set for cached /// </summary> ! public System.Collections.IList cached { get --- 598,602 ---- /// Get/set for cached /// </summary> ! public System.Collections.IDictionary cached { get *************** *** 701,706 **** public void setDefaults() { ! stringSet = new ArrayList(); ! stringSet.Add("foo"); stringSet.Add("bar"); stringSet.Add("baz"); stringDateMap = new SortedList(); stringDateMap.Add( "now", DateTime.Now ); --- 704,714 ---- public void setDefaults() { ! // stringSet = new ArrayList(); ! // stringSet.Add("foo"); stringSet.Add("bar"); stringSet.Add("baz"); ! stringSet = new Hashtable(); ! stringSet.Add("foo", new object()); ! stringSet.Add("bar", new object()); ! stringSet.Add("baz", new object()); ! stringDateMap = new SortedList(); stringDateMap.Add( "now", DateTime.Now ); *************** *** 708,712 **** stringDateMap.Add( "big bang", new DateTime(0) ); ArrayList list = new ArrayList(); ! list.AddRange(stringSet); stringList = list; intArray = new int[] { 1,3,3,7 }; --- 716,720 ---- stringDateMap.Add( "big bang", new DateTime(0) ); ArrayList list = new ArrayList(); ! list.AddRange(stringSet.Keys); // stringSet); stringList = list; intArray = new int[] { 1,3,3,7 }; *************** *** 736,740 **** bag.Add("duplicate"); bag.Add("unique"); ! cached = new ArrayList(); CompositeElement ce = new CompositeElement(); ce.foo = "foo"; --- 744,750 ---- bag.Add("duplicate"); bag.Add("unique"); ! //cached = new ArrayList(); ! cached = new SortedList(); ! CompositeElement ce = new CompositeElement(); ce.foo = "foo"; *************** *** 743,748 **** ce2.foo = "fooxxx"; ce2.bar = "barxxx"; ! cached.Add(ce); ! cached.Add(ce2); cachedMap = new SortedList(); cachedMap.Add(this, ce); --- 753,758 ---- ce2.foo = "fooxxx"; ce2.bar = "barxxx"; ! cached.Add(ce, new object()); ! cached.Add(ce2, new object()); cachedMap = new SortedList(); cachedMap.Add(this, ce); Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Foo.cs 13 Apr 2004 15:32:59 -0000 1.6 --- Foo.cs 26 Apr 2004 03:47:32 -0000 1.7 *************** *** 706,710 **** } ! public override bool Equals(object obj) { Foo other = (Foo)obj; --- 706,710 ---- } ! public bool EqualsFoo(Foo obj) { Foo other = (Foo)obj; *************** *** 742,749 **** && ( ( this.custom == other.custom ) || ( this.custom[0].Equals(other.custom[0]) && this.custom[1].Equals(other.custom[1]) ) ); } ! public override int GetHashCode() ! { ! return key.GetHashCode() - _string.GetHashCode(); ! } public FooComponent nullComponent { --- 742,749 ---- && ( ( this.custom == other.custom ) || ( this.custom[0].Equals(other.custom[0]) && this.custom[1].Equals(other.custom[1]) ) ); } ! // public override int GetHashCode() ! // { ! // return key.GetHashCode() - _string.GetHashCode(); ! // } public FooComponent nullComponent { |