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-04-27 15:49:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28813/NHibernate/Collection Modified Files: Map.cs Set.cs SortedMap.cs SortedSet.cs Log Message: Added support for the attributes "order-by" and "sort" attribute on <set> and <map> elements. Index: SortedSet.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/SortedSet.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SortedSet.cs 8 Apr 2004 21:11:33 -0000 1.3 --- SortedSet.cs 27 Apr 2004 15:49:21 -0000 1.4 *************** *** 6,11 **** using NHibernate.Type; ! namespace NHibernate.Collection { ! /// <summary> /// A Persistent wrapper for a <c>System.Collections.IDictionary</c> that has --- 6,11 ---- using NHibernate.Type; ! namespace NHibernate.Collection ! { /// <summary> /// A Persistent wrapper for a <c>System.Collections.IDictionary</c> that has *************** *** 19,29 **** /// element. /// </remarks> ! public class SortedSet : Set, IDictionary { ! private IComparer comparer; ! protected override object Snapshot(CollectionPersister persister) { SortedList clonedSet = new SortedList(comparer, map.Count); ! foreach(DictionaryEntry de in map) { object copy = persister.ElementType.DeepCopy(de.Key); clonedSet.Add(copy, copy); --- 19,31 ---- /// element. /// </remarks> ! public class SortedSet : Set, IDictionary ! { private IComparer comparer; ! protected override object Snapshot(CollectionPersister persister) ! { SortedList clonedSet = new SortedList(comparer, map.Count); ! foreach(DictionaryEntry de in map) ! { object copy = persister.ElementType.DeepCopy(de.Key); clonedSet.Add(copy, copy); *************** *** 33,57 **** } ! public IComparer Comparer { get { return comparer;} - //set { comparer = value;} } ! public override void BeforeInitialize(CollectionPersister persister) { ! this.map = new SortedList(comparer); // new Hashtable(null, comparer); } - // changed the Comparer to a readonly property because you can't change it on SortedList after - // it has been created - so there is no point in being able to change it on this class. - // public SortedSet(ISessionImplementor session) : base(session) - // { - // } - /// <summary> ! /// Constuct a new empty SortedSet /// </summary> /// <param name="session"></param> ! /// <param name="comparer"></param> public SortedSet(ISessionImplementor session, IComparer comparer) : base(session, new SortedList(comparer)) { --- 35,57 ---- } ! public IComparer Comparer ! { get { return comparer;} } ! public override void BeforeInitialize(CollectionPersister persister) ! { ! this.map = new SortedList(comparer); ! // an ArrayList of the identifiers is what Set uses because there is not ! // both a Key & Value to worry about - just the Key. ! this.tempIdentifierList = new ArrayList(); } /// <summary> ! /// Constuct a new empty SortedSet that uses a IComparer to perform the sorting. /// </summary> /// <param name="session"></param> ! /// <param name="comparer">The IComparer to user for Sorting.</param> public SortedSet(ISessionImplementor session, IComparer comparer) : base(session, new SortedList(comparer)) { Index: Map.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Map.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Map.cs 28 Mar 2004 06:01:29 -0000 1.7 --- Map.cs 27 Apr 2004 15:49:21 -0000 1.8 *************** *** 51,58 **** public override void BeforeInitialize(CollectionPersister persister) { ! //TODO: check this ! //this.map = persister.HasOrdering ? LinkedHashCollectionHelper.CreateLinkedHashMap() : new Hashtable(); ! this.map = new Hashtable(); ! this.mapIdentifiers = new Hashtable(); } --- 51,68 ---- public override void BeforeInitialize(CollectionPersister persister) { ! ! if(persister.HasOrdering) ! { ! // if this Persister has an Ordering then use the ListDictionary because ! // it maintains items in the Dictionary in the same order as they were ! // added. ! this.map = new System.Collections.Specialized.ListDictionary(); ! this.mapIdentifiers = new System.Collections.Specialized.ListDictionary(); ! } ! else ! { ! this.map = new Hashtable(); ! this.mapIdentifiers = new Hashtable(); ! } } Index: SortedMap.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/SortedMap.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SortedMap.cs 20 Feb 2003 21:42:06 -0000 1.1 --- SortedMap.cs 27 Apr 2004 15:49:21 -0000 1.2 *************** *** 1,17 **** using System; namespace NHibernate.Collection { /// <summary> ! /// Summary description for SortedMap. /// </summary> ! public class SortedMap { ! public SortedMap() { ! // ! // TODO: Add constructor logic here ! // } } } --- 1,97 ---- using System; + using System.Collections; + + using NHibernate.Engine; namespace NHibernate.Collection { /// <summary> ! /// A Persistent wrapper for a <c>System.Collections.IDictionary</c> that has ! /// sorting. /// </summary> ! /// <remarks> ! /// This class uses the SortedList as the underlying map for the SortedMap. The SortedList ! /// is not really an IList at all. It actually is a Hashtable that provides methods to get ! /// to a Key by its index. Since it is sorted the indexes can change based on what is added ! /// to the Dictionary. In my opinion, the index is not useful except to get the first or last ! /// element. ! /// </remarks> ! public class SortedMap : Map, IDictionary { ! ! private IComparer comparer; ! ! protected override object Snapshot(CollectionPersister persister) { ! SortedList clonedMap = new SortedList(comparer, map.Count); ! foreach(DictionaryEntry de in map) ! { ! object copy = persister.ElementType.DeepCopy(de.Value); ! clonedMap.Add(de.Key, copy); ! } ! ! return clonedMap; ! } ! ! public IComparer Comparer ! { ! get { return comparer; } ! } ! ! ! public SortedMap(ISessionImplementor session, CollectionPersister persister, IComparer comparer, object disassembled, object owner) : this(session, comparer) ! { ! BeforeInitialize(persister); ! object[] array = (object[])disassembled; ! ! for(int i=0; i<array.Length; i+=2) ! { ! object key = persister.IndexType.Assemble(array[i], session, owner); ! object val = persister.ElementType.Assemble(array[i+1], session, owner); ! ! map[key] = val; ! } ! ! initialized = true; ! ! } ! ! /// <summary> ! /// Constuct a new empty SortedMap that uses a IComparer to perform the sorting. ! /// </summary> ! /// <param name="session"></param> ! /// <param name="comparer">The IComparer to user for Sorting.</param> ! public SortedMap(ISessionImplementor session, IComparer comparer) : base(session, new SortedList(comparer)) ! { ! this.comparer = comparer; ! } ! ! /// <summary> ! /// Construct a new SortedMap initialized with the map values. ! /// </summary> ! /// <param name="session">The Session to be bound to.</param> ! /// <param name="map">The initial values.</param> ! /// <param name="comparer">The IComparer to use for Sorting.</param> ! public SortedMap(ISessionImplementor session, IDictionary map, IComparer comparer) : base(session, new SortedList(map, comparer)) ! { ! this.comparer = comparer; } + + + public override void BeforeInitialize(CollectionPersister persister) + { + this.map = new SortedList(comparer); + // it should be okay to use just a hashtable to store the MapIdentifier because + // when the Identifiers are converted to actual entries then the Comparer should + // take care of putting them in the correct order... + this.mapIdentifiers = new Hashtable(); + } + + + + + //TODO: H2.0.3 - there are many more methods - probably because Java has a much + // better set of interfaces for Collections than .NET does. + } } Index: Set.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Set.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Set.cs 28 Mar 2004 06:01:29 -0000 1.6 --- Set.cs 27 Apr 2004 15:49:21 -0000 1.7 *************** *** 28,32 **** protected IDictionary map; ! private IList tempIdentifierList; /// <summary> --- 28,32 ---- protected IDictionary map; ! protected IList tempIdentifierList; /// <summary> *************** *** 94,99 **** public override void BeforeInitialize(CollectionPersister persister) { ! //this.map = persister.HasOrdering ? LinkedHashCollectionHelper.CreateLinkedHashMap() : new Hashtable(); ! this.map = new Hashtable(); } --- 94,105 ---- public override void BeforeInitialize(CollectionPersister persister) { ! if(persister.HasOrdering) ! { ! this.map = new System.Collections.Specialized.ListDictionary(); ! } ! else ! { ! this.map = new Hashtable(); ! } } |
From: Michael D. <mik...@us...> - 2004-04-27 15:49:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28813/NHibernate/Mapping Modified Files: Map.cs Set.cs Log Message: Added support for the attributes "order-by" and "sort" attribute on <set> and <map> elements. Index: Map.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Map.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Map.cs 13 Apr 2004 02:06:54 -0000 1.4 --- Map.cs 27 Apr 2004 15:49:22 -0000 1.5 *************** *** 7,29 **** namespace NHibernate.Mapping { ! public class Map : IndexedCollection { ! public Map(PersistentClass owner) : base(owner) { } public override PersistentCollectionType Type { ! //TODO: H2.0.3 - fix up when SortedMap is implemented. ! //get { return IsSorted ? TypeFactory.SortedMap( Role, Comparator ) : TypeFactory.Map( Role ); ! get { return TypeFactory.Map( Role ); } //TODO: get sorted } public override System.Type WrapperClass { ! //TODO: H2.0.3 - fix up when SortedMap is implemented. ! //get { return IsSorted ? typeof(NHCollection.SortedMap) : typeof(NHCollection.Map); } ! get { return typeof(NHCollection.Map); } } - - } } --- 7,33 ---- namespace NHibernate.Mapping { ! public class Map : IndexedCollection ! { public Map(PersistentClass owner) : base(owner) { } public override PersistentCollectionType Type { ! get ! { ! return IsSorted ? ! TypeFactory.SortedMap( Role, Comparer ) : ! TypeFactory.Map( Role ); ! } } public override System.Type WrapperClass { ! get ! { ! return IsSorted ? ! typeof(NHCollection.SortedMap) : ! typeof(NHCollection.Map); ! } } } } Index: Set.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Set.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Set.cs 13 Apr 2004 02:06:54 -0000 1.4 --- Set.cs 27 Apr 2004 15:49:22 -0000 1.5 *************** *** 31,35 **** get { - //TODO: modify when added implementation of sorted set return IsSorted ? TypeFactory.SortedSet(Role, Comparer) : --- 31,34 ---- |
From: Michael D. <mik...@us...> - 2004-04-26 03:49:24
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2665/NHibernate.Test Modified Files: FooBarTest.cs Log Message: EmptyCollection and BagOneToMany now pass as currently written. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FooBarTest.cs 19 Apr 2004 14:02:58 -0000 1.13 --- FooBarTest.cs 26 Apr 2004 03:49:08 -0000 1.14 *************** *** 147,151 **** [Test] - [Ignore("unknown problem")] public void BagOneToMany() { --- 147,150 ---- |
From: Michael D. <mik...@us...> - 2004-04-26 03:48:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2435/NHibernate/Collection Modified Files: Bag.cs Log Message: Fixed bugs with NeedsInserting, NeedsDeleting, and GetEnumerator. Index: Bag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Bag.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Bag.cs 14 Apr 2004 18:10:55 -0000 1.3 --- Bag.cs 26 Apr 2004 03:48:02 -0000 1.4 *************** *** 180,184 **** { bool found = false; ! if(bag.Count>1 && elemType.Equals(oldObject, bag[i++])) { //a shortcut if its location didn't change! --- 180,184 ---- { bool found = false; ! if(bag.Count>i && elemType.Equals(oldObject, bag[i++])) { //a shortcut if its location didn't change! *************** *** 206,210 **** { IList sn = (IList)GetSnapshot(); ! if( sn.Count>1 && elemType.Equals(sn[i], entry) ) { // a shortcut if its location didn't change --- 206,210 ---- { IList sn = (IList)GetSnapshot(); ! if( sn.Count>i && elemType.Equals(sn[i], entry) ) { // a shortcut if its location didn't change *************** *** 338,341 **** --- 338,342 ---- public override IEnumerator GetEnumerator() { + Read(); //TODO: H2.0.3 has an IteratorProxy - do we need?? return bag.GetEnumerator(); |
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 { |
From: Michael D. <mik...@us...> - 2004-04-26 03:46:54
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2198/NHibernate.Test/SqlCommandTest Modified Files: TemplateFixture.cs Log Message: Fixed problem with quoting an order by as [colname desc] Index: TemplateFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/TemplateFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TemplateFixture.cs 15 Apr 2004 09:30:16 -0000 1.2 --- TemplateFixture.cs 26 Apr 2004 03:46:45 -0000 1.3 *************** *** 27,31 **** string whereFragment = "column_name = 'string value' and `backtick` = 1"; ! string expectedFragment = "$PlaceHolder.[column_name] = 'string value' and $PlaceHolder.[backtick] = 1"; Assert.AreEqual( expectedFragment, Template.RenderWhereStringTemplate(whereFragment, dialect) ); --- 27,31 ---- string whereFragment = "column_name = 'string value' and `backtick` = 1"; ! string expectedFragment = "$PlaceHolder.column_name = 'string value' and $PlaceHolder.[backtick] = 1"; Assert.AreEqual( expectedFragment, Template.RenderWhereStringTemplate(whereFragment, dialect) ); |
From: Michael D. <mik...@us...> - 2004-04-26 03:46:53
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2198/NHibernate/SqlCommand Modified Files: Template.cs Log Message: Fixed problem with quoting an order by as [colname desc] Index: Template.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/Template.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Template.cs 15 Apr 2004 09:30:16 -0000 1.3 --- Template.cs 26 Apr 2004 03:46:45 -0000 1.4 *************** *** 200,204 **** else { ! return dialect.QuoteForAliasName(column); } } --- 200,205 ---- else { ! return column; ! //return dialect.QuoteForAliasName(column); } } |
From: Michael D. <mik...@us...> - 2004-04-26 03:46:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2033/NHibernate/Persister Modified Files: EntityPersister.cs NormalizedEntityPersister.cs Log Message: Fixed bug with classes that had version columns. Index: NormalizedEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/NormalizedEntityPersister.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NormalizedEntityPersister.cs 15 Apr 2004 21:07:19 -0000 1.15 --- NormalizedEntityPersister.cs 26 Apr 2004 03:46:00 -0000 1.16 *************** *** 922,926 **** } ! if ( IsVersioned ) VersionType.NullSafeSet( statements[0], version, IdentifierColumnNames.Length + 1, session ); for (int i=tableNames.Length-1; i>=0; i-- ) { --- 922,927 ---- } ! if ( IsVersioned ) //VersionType.NullSafeSet( statements[0], version, IdentifierColumnNames.Length + 1, session ); ! VersionType.NullSafeSet( statements[0], version, IdentifierColumnNames.Length , session ); for (int i=tableNames.Length-1; i>=0; i-- ) { Index: EntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/EntityPersister.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** EntityPersister.cs 15 Apr 2004 11:36:36 -0000 1.15 --- EntityPersister.cs 26 Apr 2004 03:46:00 -0000 1.16 *************** *** 728,732 **** if(IsVersioned) { ! VersionType.NullSafeSet(deleteCmd, version, IdentifierColumnNames.Length + 1, session); } --- 728,733 ---- if(IsVersioned) { ! //VersionType.NullSafeSet(deleteCmd, version, IdentifierColumnNames.Length + 1, session); ! VersionType.NullSafeSet(deleteCmd, version, IdentifierColumnNames.Length, session); } |
From: Michael D. <mik...@us...> - 2004-04-26 03:45:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1793/NHibernate/Type Modified Files: ComponentType.cs PersistentCollectionType.cs Log Message: Fixes for the problem of a Component containing a Collection causing multi data readers to be open. Fixed minor java-.net port bug with getting a range from a collection. Index: PersistentCollectionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentCollectionType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PersistentCollectionType.cs 24 Mar 2004 19:54:02 -0000 1.8 --- PersistentCollectionType.cs 26 Apr 2004 03:45:09 -0000 1.9 *************** *** 11,15 **** /// <summary> ! /// PersistentCollectionType. /// </summary> public abstract class PersistentCollectionType : AbstractType, IAssociationType { --- 11,15 ---- /// <summary> ! /// A specific PersistentCollectionType for a Role. /// </summary> public abstract class PersistentCollectionType : AbstractType, IAssociationType { *************** *** 41,48 **** --- 41,108 ---- } + /// <summary> + /// Returns a fully initialized Collection - be careful when calling this because it might + /// open another DataReader!!! + /// </summary> + /// <param name="rs"></param> + /// <param name="name"></param> + /// <param name="session"></param> + /// <param name="owner"></param> + /// <returns></returns> public override object NullSafeGet(IDataReader rs, string[] name, ISessionImplementor session, object owner) { return ResolveIdentifier( Hydrate(rs, name, session, owner), session, owner ); } + /// <summary> + /// Gets a Collection without opening a DataReader. + /// </summary> + /// <param name="rs"></param> + /// <param name="name"></param> + /// <param name="session"></param> + /// <param name="owner"></param> + /// <param name="partOfComponent"></param> + /// <returns> + /// The Collection returned from here is a lazy-load Collection regardless of what the map says. To + /// load this Collection partOfComponent must be true and then ResolveIdentifier must be called. This + /// method is only intended to be used by ComponentType to solve the problem of Getting a Collection + /// opens a second DataReader. + /// </returns> + public object NullSafeGet(IDataReader rs, string[] name, ISessionImplementor session, object owner, bool partOfComponent) + { + object id = session.GetEntityIdentifier(owner); + PersistentCollection collection = session.GetLoadingCollection(role, id); + if(collection!=null) return collection.GetCachedValue(); //TODO: yuck... call another method - H2.0.3comment + + CollectionPersister persister = session.Factory.GetCollectionPersister(role); + collection = persister.GetCachedCollection(id, owner, session); + if(collection!=null) + { + session.AddInitializedCollection(collection, persister, id); + return collection.GetCachedValue(); + } + else + { + + collection = Instantiate(session, persister); + session.AddUninitializedCollection(collection, persister, id); + + // hard coding in lazy here because we don't want it to load during it's Get - just + // initialize the Collection class as if it is being lazy loaded - we'll get back to + // loading it during ResolveIdentifier... + collection.GetInitialValue(true); + + // if we get to here then we have just created a lazy loaded (ie - uninitialized )Collection that might + // be a part of a Component. If it is part of a component then we need to mark it as + // needing to be a part of the batch that gets ResolveIdentifier called where it will be Initialized + // according to the IsLazy property of the Persister + if(partOfComponent) + { + session.AddUnresolvedComponentCollection(id, role, collection); + } + + return collection; + } + } + public virtual object GetCollection(object id, object owner, ISessionImplementor session) { PersistentCollection collection = session.GetLoadingCollection(role, id); *************** *** 156,159 **** --- 216,228 ---- } + /// <summary> + /// + /// </summary> + /// <param name="value">The id of the owner.</param> + /// <param name="session"></param> + /// <param name="owner"></param> + /// <returns></returns> + /// <remarks> + /// </remarks> public override object ResolveIdentifier(object value, ISessionImplementor session, object owner) { if (value==null) { *************** *** 165,168 **** --- 234,278 ---- } + /// <summary> + /// Resolves Collection that might be part of a Component. + /// </summary> + /// <param name="value">The id of the owner.</param> + /// <param name="session">The current Session.</param> + /// <param name="owner">The owner of the collection.</param> + /// <param name="partOfComponent">Indicates if this Collection is a part of a Component.</param> + /// <returns>A fully initialized collection according to its Persister's IsLazy property.</returns> + public object ResolveIdentifier(object value, ISessionImplementor session, object owner, bool partOfComponent) + { + if(partOfComponent==false) return ResolveIdentifier(value, session, owner); + + // check to see if this Collection is part of a Component and it has already been Instantiated + // and just needs to GetInitialValue because it has already been Instantiated and Added to the + // Session in NullSafeGet + object id = value; + + PersistentCollection collection = session.GetUnresolvedComponentCollection(id, role); + + if(collection==null) + { + // when the collection is null that means it is not an UnresolvedComponentCollection + // so we can let ResolveIdentifier get it however it needs to. + return ResolveIdentifier(id, session, owner); + } + else + { + // we already have a collection + CollectionPersister persister = session.Factory.GetCollectionPersister(role); + collection.GetInitialValue(persister.IsLazy); + + // we have resolved the Collection in the Component so remove it from the unresolved + session.RemoveUnresolvedComponentCollection(id, role); + + return collection; + } + + + + } + public virtual bool IsArrayType { get { return false; } Index: ComponentType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ComponentType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ComponentType.cs 10 Feb 2004 18:41:42 -0000 1.6 --- ComponentType.cs 26 Apr 2004 03:45:09 -0000 1.7 *************** *** 112,116 **** } ! public override object NullSafeGet(IDataReader rs, string[] names, ISessionImplementor session, object owner) { int begin = 0; bool notNull=false; --- 112,164 ---- } ! /// <summary> ! /// Provides component specific implementation of ResolveIdentifier that is safe for Collections. ! /// </summary> ! /// <param name="value">The Component object.</param> ! /// <param name="session">The current Session.</param> ! /// <param name="owner">The Entity object the Component is contained in.</param> ! /// <returns>A fully resolved Component.</returns> ! public override object ResolveIdentifier(object value, ISessionImplementor session, object owner) ! { ! if(value==null) return null; ! ! for(int i=0; i < propertySpan; i++) ! { ! // the only types we need to resolve are PersistentCollectionTypes and ComponentTypes. ! // ComponentTypes only really need to be resolved when they contain other ComponentTypes ! // that contain Collections, I'm not sure how safe it is to call Set(target, val) during ! // ResolveIdentifier - commented out the Set because this is not creating new objects, just ! // modifying the existing ones so they don't need to be Set again. ! // Nor am I sure how safe it is to ignore ResolveIdentifer for everything ! // else. I know ManyToOneType and OneToOneType also override ResolveIdentifer and can potentially ! // connect to the db. ! ! if(types[i] is PersistentCollectionType) ! { ! object id = session.GetEntityIdentifier(owner); ! object val = ((PersistentCollectionType)types[i]).ResolveIdentifier(id, session, owner, true); ! //setters[i].Set(value, val); ! } ! else ! { ! object val = types[i].ResolveIdentifier(getters[i].Get(value), session, owner); ! //setters[i].Set(value, val); ! } ! } ! ! return value; ! ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="names"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet(IDataReader rs, string[] names, ISessionImplementor session, object owner) ! { int begin = 0; bool notNull=false; *************** *** 119,123 **** int length = types[i].GetColumnSpan( session.Factory ); string[] range = ArrayHelper.Slice(names, begin, length); ! object val = types[i].NullSafeGet(rs, range, session, owner); if (val!=null) notNull=true; values[i] = val; --- 167,187 ---- int length = types[i].GetColumnSpan( session.Factory ); string[] range = ArrayHelper.Slice(names, begin, length); ! object val = null; //types[i].NullSafeGet(rs, range, session, owner); ! ! // if the Component contains a collection type then use its special NullSafeGet ! // so that we don't create another IDataReader to Get the Collections values from ! // the Db. This breaks the nice OO'ness of being able to just call type.NullSafeGet ! // but it solves the problem of Collections inside of Components opening another ! // DataReader... ! if(types[i] is PersistentCollectionType) ! { ! val = ((PersistentCollectionType)types[i]).NullSafeGet(rs, range, session, owner, true); ! } ! else ! { ! val = types[i].NullSafeGet(rs, range, session, owner); ! } ! ! if (val!=null) notNull=true; values[i] = val; |
From: Michael D. <mik...@us...> - 2004-04-26 03:45:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1793/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: Fixes for the problem of a Component containing a Collection causing multi data readers to be open. Fixed minor java-.net port bug with getting a range from a collection. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** SessionImpl.cs 21 Apr 2004 14:31:24 -0000 1.22 --- SessionImpl.cs 26 Apr 2004 03:45:09 -0000 1.23 *************** *** 1118,1121 **** --- 1118,1122 ---- //BEGIN YUCKINESS: if ( persister.HasCascades ) { + int start = deletions.Count; *************** *** 1146,1152 **** //move them earlier. this is yucky code: ! ! IList middle = deletions.GetRange( oldDeletions.Count, start ); ! IList tail = deletions.GetRange( start, end); oldDeletions.AddRange(tail); --- 1147,1155 ---- //move them earlier. this is yucky code: ! ! // in h203 they used SubList where it takes the start and end indexes, in nh GetRange ! // takes the start index and quantity to get. ! IList middle = deletions.GetRange( oldDeletions.Count, (start - oldDeletions.Count) ); ! IList tail = deletions.GetRange( start, (end - start) ); oldDeletions.AddRange(tail); *************** *** 3044,3047 **** --- 3047,3147 ---- } + #region - Session Helpers for handling PersistentCollections inside of a Component + + // key = ComponentCollectionKey(id, role) + // value = PersistentCollection + // contains the PersistentCollections that need to be resolved by a Component through + // the use of ResolveIdentifier. + private IDictionary unresolvedComponentCollections = new Hashtable(); + + /// <summary> + /// Key for the IDictionary that is storing the PersistentCollections that need to be + /// Resolved for a Component + /// </summary> + private class ComponentCollectionKey + { + private object id; + private string role; + + public ComponentCollectionKey(object id, string role) + { + this.id = id; + this.role = role; + } + + public override int GetHashCode() + { + unchecked + { + return id.GetHashCode() + role.GetHashCode(); + } + } + + public object Id + { + get { return id;} + } + + public string Role + { + get { return role; } + } + + public override bool Equals(object obj) + { + ComponentCollectionKey rhs = obj as ComponentCollectionKey; + + if(rhs==null) return false; + + return this.Equals(rhs); + } + + public bool Equals(ComponentCollectionKey obj) + { + // check for ref equality + if(this==obj) return true; + + return (this.id.Equals(obj.Id)) && (this.role==obj.role); + } + + public override string ToString() + { + return "Id=" + id.ToString() + " ; role=" + role; + } + + + } + + public void AddUnresolvedComponentCollection(object id, string role, PersistentCollection collection) + { + ComponentCollectionKey key = new ComponentCollectionKey(id, role); + + // I can't think of any valid reason that the same unresolved collection for a Component would + // get in here twice... + if( unresolvedComponentCollections.Contains(key) ) + { + throw new HibernateException("There is a problem adding the collection identified by " + key.ToString()); + } + + unresolvedComponentCollections[key] = collection; + + } + + public PersistentCollection GetUnresolvedComponentCollection(object id, string role) + { + ComponentCollectionKey key = new ComponentCollectionKey(id, role); + object returnValue = unresolvedComponentCollections[key]; + return returnValue==null ? null : (PersistentCollection) returnValue; + + } + + public void RemoveUnresolvedComponentCollection(object id, string role) + { + ComponentCollectionKey key = new ComponentCollectionKey(id, role); + unresolvedComponentCollections.Remove(key); + } + + #endregion + /// <summary> /// add a collection we just loaded up (still needs initializing) *************** *** 3050,3054 **** /// <param name="persister"></param> /// <param name="id"></param> ! public void AddUninitializedCollection(PersistentCollection collection, CollectionPersister persister, object id) { CollectionEntry ce = new CollectionEntry(persister, id, false); collections[collection] = ce; --- 3150,3155 ---- /// <param name="persister"></param> /// <param name="id"></param> ! public void AddUninitializedCollection(PersistentCollection collection, CollectionPersister persister, object id) ! { CollectionEntry ce = new CollectionEntry(persister, id, false); collections[collection] = ce; *************** *** 3371,3375 **** if ( log.IsDebugEnabled ) { log.Debug( "search: " + persistentClass.Name ); ! log.Debug( "criteria: " + criteria.ToString() ); } --- 3472,3476 ---- if ( log.IsDebugEnabled ) { log.Debug( "search: " + persistentClass.Name ); ! log.Debug( "criteria: " + criteria ); } |
From: Michael D. <mik...@us...> - 2004-04-26 03:45:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1793/NHibernate/Engine Modified Files: ISessionImplementor.cs Log Message: Fixes for the problem of a Component containing a Collection causing multi data readers to be open. Fixed minor java-.net port bug with getting a range from a collection. Index: ISessionImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ISessionImplementor.cs 28 Mar 2004 06:02:55 -0000 1.17 --- ISessionImplementor.cs 26 Apr 2004 03:45:08 -0000 1.18 *************** *** 354,357 **** --- 354,382 ---- ICollection GetOrphans(PersistentCollection coll); + + /// <summary> + /// Adds a PersistentCollection to the Session that a Component needs to Resolve. + /// </summary> + /// <param name="id">The Id of the Entity that contains the Component.</param> + /// <param name="role">The role that Identifies the PersistentCollection.</param> + /// <param name="collection">The PersistentCollection to add to the Session.</param> + void AddUnresolvedComponentCollection(object id, string role, PersistentCollection collection); + + /// <summary> + /// Returns the PersistentCollection from the Session that a Component needs to Resolve. + /// </summary> + /// <param name="id">The Id of the Entity that contains the Component.</param> + /// <param name="role">The role that Identifies the PersistentCollection.</param> + /// <returns>The PersistentCollection that has not been resolved.</returns> + PersistentCollection GetUnresolvedComponentCollection(object id, string role); + + /// <summary> + /// Removes the PersistentCollection from the Session because the Component has + /// Resolved the Identifier for it. + /// </summary> + /// <param name="id">The Id of the Entity that contains the Component.</param> + /// <param name="role">The role that Identifiers the PersistentCollection.</param> + void RemoveUnresolvedComponentCollection(object id, string role); + } } |
From: Peter S. <sz...@us...> - 2004-04-22 11:59:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31444 Added Files: NHibernate.snk Log Message: Changing to binary. --- NEW FILE: NHibernate.snk --- (This appears to be a binary file; contents omitted.) |
From: Peter S. <sz...@us...> - 2004-04-22 11:58:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31333 Removed Files: NHibernate.snk Log Message: Changing to binary. --- NHibernate.snk DELETED --- |
From: Peter S. <sz...@us...> - 2004-04-22 11:53:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29739/NHibernate Modified Files: AssemblyInfo.cs Added Files: NHibernate.snk Log Message: Strong named assembly. --- NEW FILE: NHibernate.snk --- (This appears to be a binary file; contents omitted.) Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssemblyInfo.cs 31 Mar 2004 18:52:54 -0000 1.2 --- AssemblyInfo.cs 22 Apr 2004 11:52:54 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- [assembly: AssemblyDelaySignAttribute(false)] + [assembly: AssemblyKeyFile("..\\..\\NHibernate.snk")] |
From: Peter S. <sz...@us...> - 2004-04-21 14:35:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5925/NHibernate/Loader Modified Files: Loader.cs Log Message: Added timespan. Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Loader.cs 15 Apr 2004 11:36:36 -0000 1.17 --- Loader.cs 21 Apr 2004 14:32:03 -0000 1.18 *************** *** 232,236 **** results.Add(GetResultColumnOrRow(row, rs, session)); ! if(log.IsDebugEnabled) log.Debug("done processing result set(" + count + " rows"); } --- 232,236 ---- results.Add(GetResultColumnOrRow(row, rs, session)); ! if(log.IsDebugEnabled) log.Debug("done processing result set(" + count + " rows)"); } |
From: Peter S. <sz...@us...> - 2004-04-21 14:35:29
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5925/NHibernate/Type Modified Files: TypeFactory.cs Added Files: TimeSpanType.cs Log Message: Added timespan. --- NEW FILE: TimeSpanType.cs --- using System; using System.Data; using NHibernate.SqlTypes; namespace NHibernate.Type { /// <summary> /// Maps a System.Timespan Property to an Int64 column /// </summary> public class TimeSpanType : MutableType, IVersionType, ILiteralType { public TimeSpanType(Int64SqlType sqlType) : base(sqlType) { } public override object Get(IDataReader rs, int index) { return new DateTime(rs.GetInt64(index)); } public override object Get(IDataReader rs, string name) { return Get(rs, rs.GetOrdinal(name));// rs.[name]; } public override System.Type ReturnedClass { get { return typeof(TimeSpan); } } public override void Set(IDbCommand st, object value, int index) { IDataParameter parm = st.Parameters[index] as IDataParameter; parm.Value = ((TimeSpan)value).Ticks; } public override string Name { get { return "TimeSpan"; } } public override string ToXML(object val) { return ((TimeSpan)val).Ticks.ToString(); } public override object DeepCopyNotNull(object value) { return value; } public override bool Equals(object x, object y) { if (x==y) return true; if (x==null || y==null) return false; long xTime = ((TimeSpan)x).Ticks; long yTime = ((TimeSpan)y).Ticks; return xTime == yTime; } public override bool HasNiceEquals { get { return true; } } public object Next(object current) { return Seed; } public object Seed { get { return DateTime.Now.Ticks; } } public string ObjectToSQLString(object value) { return "'" + ((TimeSpan)value).Ticks.ToString() + "'"; } } } Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** TypeFactory.cs 20 Apr 2004 15:51:24 -0000 1.26 --- TypeFactory.cs 21 Apr 2004 14:33:07 -0000 1.27 *************** *** 107,110 **** --- 107,111 ---- TypeFactory.GetYesNoType(); TypeFactory.GetTicksType(); + TypeFactory.GetTimeSpanType(); getTypeDelegatesWithLength.Add(TypeFactory.GetBinaryType().Name, new GetNullableTypeWithLength(GetBinaryType)); *************** *** 883,886 **** --- 884,907 ---- /// </summary> /// <returns></returns> + public static NullableType GetTimeSpanType() + { + + string key = typeof(TimeSpanType).FullName; + + NullableType returnType = (NullableType)typeByTypeOfName[key]; + if(returnType==null) + { + returnType = new TimeSpanType(SqlTypeFactory.GetInt64()); + AddToTypeOfName(key, returnType); + } + + return returnType; + + } + + /// <summary> + /// + /// </summary> + /// <returns></returns> public static NullableType GetTimestampType() { |
From: Peter S. <sz...@us...> - 2004-04-21 14:34:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5925/NHibernate Modified Files: NHibernate.cs NHibernate-1.1.csproj Log Message: Added timespan. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NHibernate-1.1.csproj 14 Apr 2004 14:45:36 -0000 1.20 --- NHibernate-1.1.csproj 21 Apr 2004 14:31:12 -0000 1.21 *************** *** 1803,1806 **** --- 1803,1811 ---- /> <File + RelPath = "Type\TimeSpanType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Type\TimestampType.cs" SubType = "Code" Index: NHibernate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NHibernate.cs 14 Apr 2004 14:40:51 -0000 1.15 --- NHibernate.cs 21 Apr 2004 14:31:09 -0000 1.16 *************** *** 111,114 **** --- 111,119 ---- /// <summary> + /// NHibernate Ticks type + /// </summary> + public static readonly NullableType TimeSpan = TypeFactory.GetTimeSpanType(); + + /// <summary> /// NHibernate timestamp type /// </summary> |
From: Peter S. <sz...@us...> - 2004-04-21 14:34:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5925/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: Added timespan. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** SessionImpl.cs 29 Mar 2004 04:06:09 -0000 1.21 --- SessionImpl.cs 21 Apr 2004 14:31:24 -0000 1.22 *************** *** 3371,3375 **** if ( log.IsDebugEnabled ) { log.Debug( "search: " + persistentClass.Name ); ! log.Debug( "criteria: " + criteria ); } --- 3371,3375 ---- if ( log.IsDebugEnabled ) { log.Debug( "search: " + persistentClass.Name ); ! log.Debug( "criteria: " + criteria.ToString() ); } |
From: Peter S. <sz...@us...> - 2004-04-20 17:40:28
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14268/NHibernate Modified Files: IQuery.cs Log Message: To be able to insert enums in queries. Index: IQuery.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IQuery.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IQuery.cs 15 Mar 2004 16:05:53 -0000 1.6 --- IQuery.cs 20 Apr 2004 17:39:44 -0000 1.7 *************** *** 209,213 **** /// <param name="position">The position of the parameter in the query string, numbered from <c>0</c></param> /// <param name="val">A non-null instance of a persistent enumeration</param> ! IQuery SetEnum(int position, IPersistentEnum val); /// <summary> --- 209,213 ---- /// <param name="position">The position of the parameter in the query string, numbered from <c>0</c></param> /// <param name="val">A non-null instance of a persistent enumeration</param> ! IQuery SetEnum(int position, System.Enum val); /// <summary> *************** *** 223,227 **** /// <param name="name">The name of the parameter</param> /// <param name="val">A non-null instance of a persistent enumeration</param> ! IQuery SetEnum(string name, IPersistentEnum val); /// <summary> --- 223,227 ---- /// <param name="name">The name of the parameter</param> /// <param name="val">A non-null instance of a persistent enumeration</param> ! IQuery SetEnum(string name, System.Enum val); /// <summary> |
From: Peter S. <sz...@us...> - 2004-04-20 17:40:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14268/NHibernate/Impl Modified Files: QueryImpl.cs Log Message: To be able to insert enums in queries. Index: QueryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/QueryImpl.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** QueryImpl.cs 15 Mar 2004 16:05:57 -0000 1.7 --- QueryImpl.cs 20 Apr 2004 17:39:44 -0000 1.8 *************** *** 149,153 **** return this; } ! public IQuery SetEnum(int position, IPersistentEnum val) { SetParameter(position, val, NHibernate.Enum( val.GetType() ) ); return this; --- 149,153 ---- return this; } ! public IQuery SetEnum(int position, System.Enum val) { SetParameter(position, val, NHibernate.Enum( val.GetType() ) ); return this; *************** *** 216,220 **** return this; } ! public IQuery SetEnum(string name, IPersistentEnum val) { SetParameter(name, val, NHibernate.Enum( val.GetType() ) ); return this; --- 216,220 ---- return this; } ! public IQuery SetEnum(string name, System.Enum val) { SetParameter(name, val, NHibernate.Enum( val.GetType() ) ); return this; |
From: Peter S. <sz...@us...> - 2004-04-20 17:37:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13769/NHibernate/Type Modified Files: PersistentEnumType.cs Log Message: Fixed another bug in equaling enums. Index: PersistentEnumType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentEnumType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PersistentEnumType.cs 10 Feb 2004 18:41:42 -0000 1.4 --- PersistentEnumType.cs 20 Apr 2004 17:37:02 -0000 1.5 *************** *** 113,117 **** public override bool Equals(object x, object y) { ! return (x==y) || ( x!=null && y!=null && x.GetType()==y.GetType() && Enum.ToObject(enumClass, x)==Enum.ToObject(enumClass, y) ); } --- 113,117 ---- public override bool Equals(object x, object y) { ! return (x==y) || ( x!=null && y!=null && x.GetType()==y.GetType() && x.ToString()==y.ToString() ); } |
From: Peter S. <sz...@us...> - 2004-04-20 15:51:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24322/NHibernate/Type Modified Files: TypeFactory.cs Log Message: Fixed some mistype in the xsd, fixed enum error. Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** TypeFactory.cs 14 Apr 2004 14:40:51 -0000 1.25 --- TypeFactory.cs 20 Apr 2004 15:51:24 -0000 1.26 *************** *** 364,368 **** type = NHibernate.Association(typeClass); } ! else if ( typeof(IPersistentEnum).IsAssignableFrom(typeClass) ) { type = NHibernate.Enum(typeClass); --- 364,368 ---- type = NHibernate.Association(typeClass); } ! else if ( typeClass.IsEnum ) { type = NHibernate.Enum(typeClass); |
From: Peter S. <sz...@us...> - 2004-04-20 15:51:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24322/NHibernate Modified Files: nhibernate-mapping-2.0.xsd Log Message: Fixed some mistype in the xsd, fixed enum error. Index: nhibernate-mapping-2.0.xsd =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate-mapping-2.0.xsd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nhibernate-mapping-2.0.xsd 8 Apr 2004 15:55:46 -0000 1.3 --- nhibernate-mapping-2.0.xsd 20 Apr 2004 15:51:24 -0000 1.4 *************** *** 215,219 **** </xs:sequence> <xs:attribute name='column' /> ! <xs:attribute name='type' default='string' /> <xs:attribute name='not-null' default='true'> <xs:simpleType> --- 215,219 ---- </xs:sequence> <xs:attribute name='column' /> ! <xs:attribute name='type' default='String' /> <xs:attribute name='not-null' default='true'> <xs:simpleType> |
From: Michael D. <mik...@us...> - 2004-04-19 20:04:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28450/NHibernate/Collection Modified Files: CollectionPersister.cs Log Message: Added initialization of sqlWhereStringTemplate and sqlOrderByStringTemplate fields Index: CollectionPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/CollectionPersister.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CollectionPersister.cs 15 Apr 2004 21:07:18 -0000 1.18 --- CollectionPersister.cs 19 Apr 2004 20:04:08 -0000 1.19 *************** *** 80,87 **** sqlOrderByString = collection.OrderBy; - hasOrder = sqlOrderByString!=null; sqlWhereString = collection.Where; hasWhere = sqlWhereString!=null; cache = collection.Cache; --- 80,89 ---- sqlOrderByString = collection.OrderBy; hasOrder = sqlOrderByString!=null; + sqlOrderByStringTemplate = hasOrder ? Template.RenderOrderByStringTemplate(sqlOrderByString, dialect) : null; + sqlWhereString = collection.Where; hasWhere = sqlWhereString!=null; + sqlWhereStringTemplate = hasWhere ? Template.RenderWhereStringTemplate(sqlWhereString, dialect) : null; cache = collection.Cache; |
From: Peter S. <sz...@us...> - 2004-04-19 14:03:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17455/NHibernate.Test Modified Files: FooBarTest.cs NHibernate.Test-1.1.csproj Log Message: Added emptycollection test Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FooBarTest.cs 15 Apr 2004 15:53:41 -0000 1.12 --- FooBarTest.cs 19 Apr 2004 14:02:58 -0000 1.13 *************** *** 94,97 **** --- 94,119 ---- t.Commit(); s.Close(); + + s = sessions.OpenSession(); + result = s.CreateQuery("from Baz baz left join fetch baz.sortablez order by baz.name asc") + .List(); + b = (Baz) result[0]; + Assert.IsTrue( b.sortablez.Count==3 ); + Assert.AreEqual( ( (Sortable) b.sortablez[0] ).name, "bar" ); + s.Flush(); + t.Commit(); + s.Close(); + + s = sessions.OpenSession(); + result = s.CreateQuery("from Baz baz order by baz.name asc") + .List(); + b = (Baz) result[0]; + Assert.IsTrue( b.sortablez.Count==3 ); + Assert.AreEqual( ( (Sortable) b.sortablez[0] ).name, "bar" ); + s.Delete(b); + s.Flush(); + t.Commit(); + s.Close(); + } *************** *** 163,166 **** --- 185,209 ---- s.Close(); } + + [Test] + public void EmptyCollection() + { + ISession s = sessions.OpenSession(); + object id = s.Save( new Baz() ); + s.Flush(); + s.Close(); + s = sessions.OpenSession(); + Baz baz = (Baz) s.Load(typeof(Baz), id); + IDictionary foos = baz.fooSet; + Assert.IsTrue( foos.Count==0 ); + Foo foo = new Foo(); + foos.Add(foo, null); + s.Save(foo); + s.Flush(); + s.Delete(foo); + s.Delete(baz); + s.Flush(); + s.Close(); + } } } Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NHibernate.Test-1.1.csproj 16 Apr 2004 14:08:35 -0000 1.15 --- NHibernate.Test-1.1.csproj 19 Apr 2004 14:02:58 -0000 1.16 *************** *** 127,131 **** <File RelPath = "App.config" ! BuildAction = "None" /> <File --- 127,131 ---- <File RelPath = "App.config" ! BuildAction = "Content" /> <File |