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: Sergey K. <jus...@us...> - 2005-05-05 19:28:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/Docs/Associations/BiM21 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test/NHSpecificTest/Docs/Associations/BiM21 Modified Files: Fixture.cs Log Message: * Better SQLite support - only about 20 test cases fail on SQLite, mostly due to bugs in SQLite ADO.NET provider * Modified TestCase to clean up unclosed sessions in TearDown - not completely bullet-proof, since some tests don't call TearDown, but covers a lot of the cases. * Changed sessions.OpenSession() to OpenSession() in all tests * Added Dialect.SupportsSubSelects property for use in tests instead of (dialect is SomeDialect) expressions. Index: Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/Docs/Associations/BiM21/Fixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Fixture.cs 12 Apr 2005 12:51:13 -0000 1.1 --- Fixture.cs 5 May 2005 19:27:55 -0000 1.2 *************** *** 45,49 **** { ! ISession session = sessions.OpenSession(); Person fred = new Person(); --- 45,49 ---- { ! ISession session = OpenSession(); Person fred = new Person(); *************** *** 67,71 **** public void TestErrorUsage() { ! using( ISession session = sessions.OpenSession() ) { Person fred = new Person(); --- 67,71 ---- public void TestErrorUsage() { ! using( ISession session = OpenSession() ) { Person fred = new Person(); |
From: Sergey K. <jus...@us...> - 2005-05-05 19:28:42
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test Modified Files: ABCProxyTest.cs ABCTest.cs AssemblyInfo.cs CriteriaTest.cs FooBarTest.cs FumTest.cs MasterDetailTest.cs MultiTableTest.cs ParentChildTest.cs PerformanceTest.cs SQLFunctionsTest.cs SQLLoaderTest.cs SimpleTest.cs TestCase.cs Log Message: * Better SQLite support - only about 20 test cases fail on SQLite, mostly due to bugs in SQLite ADO.NET provider * Modified TestCase to clean up unclosed sessions in TearDown - not completely bullet-proof, since some tests don't call TearDown, but covers a lot of the cases. * Changed sessions.OpenSession() to OpenSession() in all tests * Added Dialect.SupportsSubSelects property for use in tests instead of (dialect is SomeDialect) expressions. Index: CriteriaTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CriteriaTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CriteriaTest.cs 1 Jan 2005 20:39:38 -0000 1.8 --- CriteriaTest.cs 5 May 2005 19:27:52 -0000 1.9 *************** *** 46,50 **** { // create the objects to search on ! ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); --- 46,50 ---- { // create the objects to search on ! ISession s1 = OpenSession(); ITransaction t1 = s1.BeginTransaction(); *************** *** 69,73 **** s1.Close(); ! ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); --- 69,73 ---- s1.Close(); ! ISession s2 = OpenSession(); ITransaction t2 = s2.BeginTransaction(); *************** *** 105,109 **** s2.Date = new DateTime( 2006, 01, 01 ); ! ISession s = sessions.OpenSession(); s.Save( s1, 1 ); s.Save( s2, 2 ); --- 105,109 ---- s2.Date = new DateTime( 2006, 01, 01 ); ! ISession s = OpenSession(); s.Save( s1, 1 ); s.Save( s2, 2 ); *************** *** 111,115 **** s.Close(); ! s = sessions.OpenSession(); IList results = s.CreateCriteria( typeof(Simple) ) .Add( Expression.Expression.Gt( "Date", new DateTime( 2005, 01, 01 ) ) ) --- 111,115 ---- s.Close(); ! s = OpenSession(); IList results = s.CreateCriteria( typeof(Simple) ) .Add( Expression.Expression.Gt( "Date", new DateTime( 2005, 01, 01 ) ) ) Index: SimpleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SimpleTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SimpleTest.cs 17 Jan 2005 03:40:51 -0000 1.8 --- SimpleTest.cs 5 May 2005 19:27:53 -0000 1.9 *************** *** 48,78 **** long otherKey = 9; ! ISession s1 = sessions.OpenSession(); ! ITransaction t1 = s1.BeginTransaction(); ! ! // create a new ! Simple simple1 = new Simple(); ! Simple otherSimple1 = new Simple(); ! simple1.Name = "Simple 1"; ! simple1.Address = "Street 12"; ! simple1.Date = testDateTime; ! simple1.Count = 99; ! otherSimple1.Name = "Other Simple 1"; ! otherSimple1.Address = "Other Street 12"; ! otherSimple1.Date = testDateTime; ! otherSimple1.Count = 98; ! simple1.Other = otherSimple1; ! s1.Save(otherSimple1, otherKey); ! s1.Save(simple1, key); ! t1.Commit(); ! s1.Close(); // try to Load the object to make sure the save worked ! ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); --- 48,78 ---- long otherKey = 9; ! using( ISession s1 = OpenSession() ) ! using( ITransaction t1 = s1.BeginTransaction() ) ! { ! // create a new ! Simple simple1 = new Simple(); ! Simple otherSimple1 = new Simple(); ! simple1.Name = "Simple 1"; ! simple1.Address = "Street 12"; ! simple1.Date = testDateTime; ! simple1.Count = 99; ! otherSimple1.Name = "Other Simple 1"; ! otherSimple1.Address = "Other Street 12"; ! otherSimple1.Date = testDateTime; ! otherSimple1.Count = 98; ! simple1.Other = otherSimple1; ! s1.Save(otherSimple1, otherKey); ! s1.Save(simple1, key); ! t1.Commit(); ! } // try to Load the object to make sure the save worked ! ISession s2 = OpenSession(); ITransaction t2 = s2.BeginTransaction(); *************** *** 97,101 **** // lets verify that the update worked ! ISession s3 = sessions.OpenSession(); ITransaction t3 = s3.BeginTransaction(); --- 97,101 ---- // lets verify that the update worked ! ISession s3 = OpenSession(); ITransaction t3 = s3.BeginTransaction(); *************** *** 121,125 **** // verify there is no other Simple objects in the db ! ISession s4 = sessions.OpenSession(); Assert.AreEqual(0, s4.CreateCriteria(typeof(Simple)).List().Count); s4.Close(); --- 121,125 ---- // verify there is no other Simple objects in the db ! ISession s4 = OpenSession(); Assert.AreEqual(0, s4.CreateCriteria(typeof(Simple)).List().Count); s4.Close(); *************** *** 133,137 **** DateTime now = DateTime.Now; ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 133,137 ---- DateTime now = DateTime.Now; ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Index: SQLFunctionsTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SQLFunctionsTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SQLFunctionsTest.cs 9 Apr 2005 12:48:06 -0000 1.9 --- SQLFunctionsTest.cs 5 May 2005 19:27:52 -0000 1.10 *************** *** 53,57 **** public void SetProperties() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Simple simple = new Simple(); --- 53,57 ---- public void SetProperties() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Simple simple = new Simple(); *************** *** 76,80 **** public void NothingToUpdate() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Simple simple = new Simple(); --- 76,80 ---- public void NothingToUpdate() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Simple simple = new Simple(); *************** *** 84,88 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.Update( simple, (long)10 ); --- 84,88 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); s.Update( simple, (long)10 ); *************** *** 90,94 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.Update( simple, (long)10 ); --- 90,94 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); s.Update( simple, (long)10 ); *************** *** 126,130 **** public void SQLFunctions() { ! using( ISession s = sessions.OpenSession() ) { ITransaction t = s.BeginTransaction(); --- 126,130 ---- public void SQLFunctions() { ! using( ISession s = OpenSession() ) { ITransaction t = s.BeginTransaction(); *************** *** 186,192 **** s.Save( min, (long)30 ); ! // && !(dialect is Dialect.HSQLDialect) ! // MySql has no subqueries ! if( !(dialect is Dialect.MySQLDialect) ) { Assert.AreEqual( 2, s.Find("from s in class Simple where s.Count > ( select min(sim.Count) from sim in class NHibernate.DomainModel.Simple )").Count ); --- 186,190 ---- s.Save( min, (long)30 ); ! if( dialect.SupportsSubSelects ) { Assert.AreEqual( 2, s.Find("from s in class Simple where s.Count > ( select min(sim.Count) from sim in class NHibernate.DomainModel.Simple )").Count ); *************** *** 202,206 **** Assert.IsFalse( enumer.MoveNext() ); ! if( !(dialect is Dialect.MySQLDialect) ) { enumer = s.Enumerable("select s.Count from s in class Simple group by s.Count having s.Count = 12").GetEnumerator(); --- 200,204 ---- Assert.IsFalse( enumer.MoveNext() ); ! if( dialect.SupportsSubSelects ) { enumer = s.Enumerable("select s.Count from s in class Simple group by s.Count having s.Count = 12").GetEnumerator(); Index: MultiTableTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MultiTableTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MultiTableTest.cs 31 Mar 2005 12:42:39 -0000 1.9 --- MultiTableTest.cs 5 May 2005 19:27:52 -0000 1.10 *************** *** 31,35 **** public void Joins() { ! ISession s = sessions.OpenSession(); s.Find("from SubMulti sm join sm.Children smc where smc.Name > 'a'"); s.Find("select s, ya from LessSimple s join s.YetAnother ya"); --- 31,35 ---- public void Joins() { ! ISession s = OpenSession(); s.Find("from SubMulti sm join sm.Children smc where smc.Name > 'a'"); s.Find("select s, ya from LessSimple s join s.YetAnother ya"); *************** *** 52,59 **** { } [Test] public void SubclassCollection() { ! ISession s = sessions.OpenSession(); SubMulti sm = new SubMulti(); SubMulti sm1 = new SubMulti(); --- 52,60 ---- { } + [Test] public void SubclassCollection() { ! ISession s = OpenSession(); SubMulti sm = new SubMulti(); SubMulti sm1 = new SubMulti(); *************** *** 75,79 **** s.Close(); ! s = sessions.OpenSession(); // TODO: I don't understand why h2.0.3 issues a select statement here --- 76,80 ---- s.Close(); ! s = OpenSession(); // TODO: I don't understand why h2.0.3 issues a select statement here *************** *** 112,116 **** public void CollectionOnly() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Mono m = new Mono(); --- 113,117 ---- public void CollectionOnly() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Mono m = new Mono(); *************** *** 119,123 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.Update(m, id); --- 120,124 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); s.Update(m, id); *************** *** 133,137 **** public void Queries() { ! ISession s = sessions.OpenSession(); long id = 1L; --- 134,138 ---- public void Queries() { ! ISession s = OpenSession(); long id = 1L; *************** *** 148,152 **** s.Close(); ! s = sessions.OpenSession(); TrivialClass tc = (TrivialClass)s.Load( typeof(TrivialClass), id ); s.Find("from s in class TrivialClass where s.id = 2"); --- 149,153 ---- s.Close(); ! s = OpenSession(); TrivialClass tc = (TrivialClass)s.Load( typeof(TrivialClass), id ); s.Find("from s in class TrivialClass where s.id = 2"); *************** *** 169,173 **** public void Constraints() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); SubMulti sm = new SubMulti(); --- 170,174 ---- public void Constraints() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); SubMulti sm = new SubMulti(); *************** *** 184,188 **** s.Close(); ! s = sessions.OpenSession(); s.Delete( "from sm in class SubMulti" ); t = s.BeginTransaction(); --- 185,189 ---- s.Close(); ! s = OpenSession(); s.Delete( "from sm in class SubMulti" ); t = s.BeginTransaction(); *************** *** 194,198 **** public void MultiTable() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi = new Multi(); --- 195,199 ---- public void MultiTable() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi = new Multi(); *************** *** 231,235 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi.ExtraProp = multi.ExtraProp + "2"; --- 232,236 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi.ExtraProp = multi.ExtraProp + "2"; *************** *** 243,247 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Multi), mid ); --- 244,248 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Multi), mid ); *************** *** 256,260 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), mid ); --- 257,261 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), mid ); *************** *** 268,272 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); IEnumerator enumer = s.Enumerable("select\n\ns from s in class Simple where s.Count>0").GetEnumerator(); --- 269,273 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); IEnumerator enumer = s.Enumerable("select\n\ns from s in class Simple where s.Count>0").GetEnumerator(); *************** *** 310,314 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), mid, LockMode.Upgrade ); --- 311,315 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), mid, LockMode.Upgrade ); *************** *** 318,322 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.Update( multi, mid ); --- 319,323 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); s.Update( multi, mid ); *************** *** 332,336 **** public void MutliTableGeneratedId() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi = new Multi(); --- 333,337 ---- public void MutliTableGeneratedId() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi = new Multi(); *************** *** 348,352 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi.ExtraProp += "2"; --- 349,353 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi.ExtraProp += "2"; *************** *** 360,364 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Multi), multiId ); --- 361,365 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Multi), multiId ); *************** *** 373,377 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), multiId ); --- 374,378 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), multiId ); *************** *** 385,389 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); IEnumerable enumer = s.Enumerable("select\n\ns from s in class Simple where s.Count>0"); --- 386,390 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); IEnumerable enumer = s.Enumerable("select\n\ns from s in class Simple where s.Count>0"); *************** *** 419,423 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), multiId, LockMode.Upgrade ); --- 420,424 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); multi = (Multi)s.Load( typeof(Simple), multiId, LockMode.Upgrade ); *************** *** 427,431 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.Update( multi, multiId ); --- 428,432 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); s.Update( multi, multiId ); *************** *** 441,445 **** //if( dialect is Dialect.HSQLDialect) return; ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Assert.AreEqual( 0, s.Find("from s in class Simple").Count ); --- 442,446 ---- //if( dialect is Dialect.HSQLDialect) return; ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Assert.AreEqual( 0, s.Find("from s in class Simple").Count ); *************** *** 489,493 **** Assert.AreSame( ls, ls.YetAnother ); ! s = sessions.OpenSession(); t = s.BeginTransaction(); ls = (LessSimple)s.Load( typeof(LessSimple), id ); --- 490,494 ---- Assert.AreSame( ls, ls.YetAnother ); ! s = OpenSession(); t = s.BeginTransaction(); ls = (LessSimple)s.Load( typeof(LessSimple), id ); *************** *** 519,523 **** //if( dialect is Dialect.HSQLDialect) return; ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Assert.AreEqual( 0, s.Find("from s in class Simple").Count ); --- 520,524 ---- //if( dialect is Dialect.HSQLDialect) return; ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Assert.AreEqual( 0, s.Find("from s in class Simple").Count ); *************** *** 561,565 **** Assert.AreSame(ls, ls.YetAnother); ! s = sessions.OpenSession(); t = s.BeginTransaction(); ls = (LessSimple)s.Load( typeof(LessSimple), id ); --- 562,566 ---- Assert.AreSame(ls, ls.YetAnother); ! s = OpenSession(); t = s.BeginTransaction(); ls = (LessSimple)s.Load( typeof(LessSimple), id ); *************** *** 578,582 **** public void MultiTableNativeId() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi = new Multi(); --- 579,583 ---- public void MultiTableNativeId() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi = new Multi(); *************** *** 592,596 **** public void Collection() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi1 = new Multi(); --- 593,597 ---- public void Collection() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Multi multi1 = new Multi(); *************** *** 611,615 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); po = (Po)s.Load( typeof(Po), id ); --- 612,616 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); po = (Po)s.Load( typeof(Po), id ); *************** *** 626,630 **** public void OneToOne() { ! ISession s = sessions.OpenSession(); LessSimple ls = new LessSimple(); object id = s.Save(ls); --- 627,631 ---- public void OneToOne() { ! ISession s = OpenSession(); LessSimple ls = new LessSimple(); object id = s.Save(ls); *************** *** 632,640 **** s.Close(); ! s = sessions.OpenSession(); s.Load( typeof(LessSimple), id ); s.Close(); ! s = sessions.OpenSession(); s.Delete( s.Load( typeof(LessSimple), id ) ); s.Flush(); --- 633,641 ---- s.Close(); ! s = OpenSession(); s.Load( typeof(LessSimple), id ); s.Close(); ! s = OpenSession(); s.Delete( s.Load( typeof(LessSimple), id ) ); s.Flush(); *************** *** 645,649 **** public void CollectionPointer() { ! ISession s = sessions.OpenSession(); LessSimple ls = new LessSimple(); IList list = new ArrayList(); --- 646,650 ---- public void CollectionPointer() { ! ISession s = OpenSession(); LessSimple ls = new LessSimple(); IList list = new ArrayList(); *************** *** 657,661 **** s.Close(); ! s = sessions.OpenSession(); ls = (LessSimple)s.Load( typeof(LessSimple), id ); Assert.AreEqual( 1, ls.Bag.Count ); --- 658,662 ---- s.Close(); ! s = OpenSession(); ls = (LessSimple)s.Load( typeof(LessSimple), id ); Assert.AreEqual( 1, ls.Bag.Count ); *************** *** 668,672 **** public void DynamicUpdate() { ! ISession s = sessions.OpenSession(); Simple simple = new Simple(); --- 669,673 ---- public void DynamicUpdate() { ! ISession s = OpenSession(); Simple simple = new Simple(); *************** *** 679,683 **** s.Close(); ! s = sessions.OpenSession(); simple = (Simple)s.Load( typeof(Simple), id ); Assert.AreEqual( "updated", simple.Name, "name should have been updated" ); --- 680,684 ---- s.Close(); ! s = OpenSession(); simple = (Simple)s.Load( typeof(Simple), id ); Assert.AreEqual( "updated", simple.Name, "name should have been updated" ); Index: ParentChildTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ParentChildTest.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ParentChildTest.cs 31 Mar 2005 12:42:39 -0000 1.13 --- ParentChildTest.cs 5 May 2005 19:27:52 -0000 1.14 *************** *** 95,99 **** public void CollectionQuery() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 95,99 ---- public void CollectionQuery() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 129,133 **** Assert.AreEqual( 1, s.Find("select c from c in class ContainerX where 's' = c.OneToMany[2 - 2].Name").Count ); Assert.AreEqual( 1, s.Find("select c from c in class ContainerX where 's' = c.ManyToMany[(3+1)/4-1].Name").Count ); ! if( !(dialect is Dialect.MySQLDialect) ) { Assert.AreEqual( 1, s.Find("select c from c in class ContainerX where c.ManyToMany[ c.ManyToMany.maxIndex ].Count = 2").Count ); --- 129,133 ---- Assert.AreEqual( 1, s.Find("select c from c in class ContainerX where 's' = c.OneToMany[2 - 2].Name").Count ); Assert.AreEqual( 1, s.Find("select c from c in class ContainerX where 's' = c.ManyToMany[(3+1)/4-1].Name").Count ); ! if( dialect.SupportsSubSelects ) { Assert.AreEqual( 1, s.Find("select c from c in class ContainerX where c.ManyToMany[ c.ManyToMany.maxIndex ].Count = 2").Count ); *************** *** 150,154 **** public void ParentChild() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Parent p = new Parent(); --- 150,154 ---- public void ParentChild() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Parent p = new Parent(); *************** *** 161,165 **** s.Flush(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Child)s.Load( typeof(Child), c.Id ); --- 161,165 ---- s.Flush(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Child)s.Load( typeof(Child), c.Id ); *************** *** 171,175 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Child)s.Load( typeof(Child), c.Id ); --- 171,175 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Child)s.Load( typeof(Child), c.Id ); *************** *** 193,197 **** public void ParentNullChild() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Parent p = new Parent(); --- 193,197 ---- public void ParentNullChild() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Parent p = new Parent(); *************** *** 200,204 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); p = (Parent)s.Load( typeof(Parent), p.Id ); --- 200,204 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); p = (Parent)s.Load( typeof(Parent), p.Id ); *************** *** 208,212 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); p = (Parent)s.Load( typeof(Parent), p.Id ); --- 208,212 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); p = (Parent)s.Load( typeof(Parent), p.Id ); *************** *** 224,228 **** // if( dialect is Dialect.HSQLDialect) return; ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Container c = new Container(); --- 224,228 ---- // if( dialect is Dialect.HSQLDialect) return; ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Container c = new Container(); *************** *** 245,249 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container) s.Load( typeof(Container), cid ); --- 245,249 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container) s.Load( typeof(Container), cid ); *************** *** 262,266 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container) s.Load( typeof(Container), cid ); --- 262,266 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container) s.Load( typeof(Container), cid ); *************** *** 279,283 **** public void Container() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Container c = new Container(); --- 279,283 ---- public void Container() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Container c = new Container(); *************** *** 327,331 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); --- 327,331 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); *************** *** 355,359 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); --- 355,359 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); *************** *** 372,376 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); --- 372,376 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); *************** *** 399,403 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); --- 399,403 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Load( typeof(Container), c.Id ); *************** *** 424,433 **** cic.One = new One(); list.Add(cic); ! ISession s = sessions.OpenSession(); s.Save(c); s.Flush(); s.Close(); ! s = sessions.OpenSession(); foreach(Container obj in s.Enumerable("from c in class ContainerX")) { --- 424,433 ---- cic.One = new One(); list.Add(cic); ! ISession s = OpenSession(); s.Save(c); s.Flush(); s.Close(); ! s = OpenSession(); foreach(Container obj in s.Enumerable("from c in class ContainerX")) { *************** *** 448,452 **** c = new Container(); ! s = sessions.OpenSession(); s.Save(c); list = new ArrayList(); --- 448,452 ---- c = new Container(); ! s = OpenSession(); s.Save(c); list = new ArrayList(); *************** *** 459,463 **** s.Close(); ! s = sessions.OpenSession(); foreach( Container obj in s.Enumerable("from c in class ContainerX") ) { --- 459,463 ---- s.Close(); ! s = OpenSession(); foreach( Container obj in s.Enumerable("from c in class ContainerX") ) { *************** *** 482,486 **** //if( dialect is Dialect.HSQLDialect ) return; ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Container c = new Container(); --- 482,486 ---- //if( dialect is Dialect.HSQLDialect ) return; ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Container c = new Container(); *************** *** 500,504 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; --- 500,504 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; *************** *** 507,511 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; --- 507,511 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; *************** *** 519,523 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; --- 519,523 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; *************** *** 535,539 **** // twice and throw off the count by 1 (or by however many additions were // made before the flush ! s = sessions.OpenSession(); c = (Container)s.Find("from c in class ContainerX")[0]; Contained c5 = new Contained(); --- 535,539 ---- // twice and throw off the count by 1 (or by however many additions were // made before the flush ! s = OpenSession(); c = (Container)s.Find("from c in class ContainerX")[0]; Contained c5 = new Contained(); *************** *** 547,551 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; --- 547,551 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Container)s.Find("from c in class ContainerX")[0]; *************** *** 584,588 **** public void CircularCascade() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Circular c = new Circular(); --- 584,588 ---- public void CircularCascade() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Circular c = new Circular(); *************** *** 596,600 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Circular)s.Load( typeof(Circular), id ); --- 596,600 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Circular)s.Load( typeof(Circular), id ); *************** *** 604,608 **** c.Other.Clazz = typeof(Qux); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.SaveOrUpdate(c); --- 604,608 ---- c.Other.Clazz = typeof(Qux); ! s = OpenSession(); t = s.BeginTransaction(); s.SaveOrUpdate(c); *************** *** 611,615 **** c.Other.Other.Clazz = typeof(Bar); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.SaveOrUpdate(c); --- 611,615 ---- c.Other.Other.Clazz = typeof(Bar); ! s = OpenSession(); t = s.BeginTransaction(); s.SaveOrUpdate(c); *************** *** 617,621 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c = (Circular)s.Load( typeof(Circular), id ); --- 617,621 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c = (Circular)s.Load( typeof(Circular), id ); *************** *** 633,637 **** public void DeleteEmpty() { ! ISession s = sessions.OpenSession(); Assert.AreEqual( 0, s.Delete("from s in class Simple") ); Assert.AreEqual( 0, s.Delete("from o in class Universe") ); --- 633,637 ---- public void DeleteEmpty() { ! ISession s = OpenSession(); Assert.AreEqual( 0, s.Delete("from s in class Simple") ); Assert.AreEqual( 0, s.Delete("from o in class Universe") ); *************** *** 642,646 **** public void Locking() { ! ISession s = sessions.OpenSession(); ITransaction tx = s.BeginTransaction(); Simple s1 = new Simple(); --- 642,646 ---- public void Locking() { ! ISession s = OpenSession(); ITransaction tx = s.BeginTransaction(); Simple s1 = new Simple(); *************** *** 661,665 **** s.Close(); ! s = sessions.OpenSession(); tx = s.BeginTransaction(); s1 = (Simple)s.Load( typeof(Simple), (long)1, LockMode.None ); --- 661,665 ---- s.Close(); ! s = OpenSession(); tx = s.BeginTransaction(); s1 = (Simple)s.Load( typeof(Simple), (long)1, LockMode.None ); *************** *** 730,734 **** public void ObjectType() { ! ISession s = sessions.OpenSession(); Parent g = new Parent(); Foo foo = new Foo(); --- 730,734 ---- public void ObjectType() { ! ISession s = OpenSession(); Parent g = new Parent(); Foo foo = new Foo(); *************** *** 739,743 **** s.Close(); ! s = sessions.OpenSession(); g = (Parent)s.Load( typeof(Parent), g.Id ); Assert.IsNotNull( g.Any ); --- 739,743 ---- s.Close(); ! s = OpenSession(); g = (Parent)s.Load( typeof(Parent), g.Id ); Assert.IsNotNull( g.Any ); Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** FumTest.cs 25 Apr 2005 13:19:07 -0000 1.20 --- FumTest.cs 5 May 2005 19:27:52 -0000 1.21 *************** *** 73,77 **** if( dialect is Dialect.MsSql2000Dialect ) return; ! using( ISession s = sessions.OpenSession() ) { Fum fum = new Fum( FumTest.FumKey("fum") ); --- 73,77 ---- if( dialect is Dialect.MsSql2000Dialect ) return; ! using( ISession s = OpenSession() ) { Fum fum = new Fum( FumTest.FumKey("fum") ); *************** *** 85,89 **** } ! using( ISession s = sessions.OpenSession() ) { Fum b = (Fum) s.CreateCriteria( typeof( Fum ) ) --- 85,89 ---- } ! using( ISession s = OpenSession() ) { Fum b = (Fum) s.CreateCriteria( typeof( Fum ) ) *************** *** 112,116 **** /* ! using( ISession s = sessions.OpenSession() ) { Fum fum = new Fum( FumKey("fum") ); --- 112,116 ---- /* ! using( ISession s = OpenSession() ) { Fum fum = new Fum( FumKey("fum") ); *************** *** 182,186 **** } ! using( ISession s = sessions.OpenSession() ) { ICriteria baseCriteria = s.CreateCriteria( typeof(Fum) ) --- 182,186 ---- } ! using( ISession s = OpenSession() ) { ICriteria baseCriteria = s.CreateCriteria( typeof(Fum) ) *************** *** 207,211 **** public void ListIdentifiers() { ! ISession s = sessions.OpenSession(); Fum fum = new Fum( FumTest.FumKey("fum") ); fum.FumString = "fo fee fi"; --- 207,211 ---- public void ListIdentifiers() { ! ISession s = OpenSession(); Fum fum = new Fum( FumTest.FumKey("fum") ); fum.FumString = "fo fee fi"; *************** *** 278,282 **** public void CompositeID() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); Fum fum = new Fum( FumTest.FumKey("fum") ); --- 278,282 ---- public void CompositeID() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Fum fum = new Fum( FumTest.FumKey("fum") ); *************** *** 289,293 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); fum = (Fum) s.Load( typeof(Fum), FumTest.FumKey("fum"), LockMode.Upgrade ); --- 289,293 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); fum = (Fum) s.Load( typeof(Fum), FumTest.FumKey("fum"), LockMode.Upgrade ); *************** *** 310,314 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); IEnumerator enumerator = s.Enumerable("from fum in class NHibernate.DomainModel.Fum where not fum.FumString='FRIEND'").GetEnumerator(); --- 310,314 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); IEnumerator enumerator = s.Enumerable("from fum in class NHibernate.DomainModel.Fum where not fum.FumString='FRIEND'").GetEnumerator(); *************** *** 331,335 **** public void CompositeIDOneToOne() { ! ISession s = sessions.OpenSession(); Fum fum = new Fum( FumKey("fum") ); fum.FumString = "fee fi fo"; --- 331,335 ---- public void CompositeIDOneToOne() { ! ISession s = OpenSession(); Fum fum = new Fum( FumKey("fum") ); fum.FumString = "fee fi fo"; *************** *** 341,345 **** s.Close(); ! s = sessions.OpenSession(); fumm = (Fumm) s.Load( typeof(Fumm), FumKey("fum") ); //s.delete(fumm.Fum); commented out in h2.0.3 --- 341,345 ---- s.Close(); ! s = OpenSession(); fumm = (Fumm) s.Load( typeof(Fumm), FumKey("fum") ); //s.delete(fumm.Fum); commented out in h2.0.3 *************** *** 353,357 **** public void CompositeIDQuery() { ! ISession s = sessions.OpenSession(); Fum fee = new Fum( FumTest.FumKey("fee", true) ); fee.FumString = "fee"; --- 353,357 ---- public void CompositeIDQuery() { ! ISession s = OpenSession(); Fum fee = new Fum( FumTest.FumKey("fee", true) ); fee.FumString = "fee"; *************** *** 370,374 **** s.Close(); ! s = sessions.OpenSession(); // Try to find the Fum object "fo" that we inserted searching by the string in the id IList vList = s.Find("from fum in class NHibernate.DomainModel.Fum where fum.Id.String='fo'"); --- 370,374 ---- s.Close(); ! s = OpenSession(); // Try to find the Fum object "fo" that we inserted searching by the string in the id IList vList = s.Find("from fum in class NHibernate.DomainModel.Fum where fum.Id.String='fo'"); *************** *** 389,393 **** s.Close(); ! s = sessions.OpenSession(); Assert.IsTrue( s.Enumerable("select fum.Id.Short, fum.Id.Date, fum.Id.String from fum in class NHibernate.DomainModel.Fum").GetEnumerator().MoveNext() ); Assert.IsTrue( s.Enumerable("select fum.Id from fum in class NHibernate.DomainModel.Fum").GetEnumerator().MoveNext() ); --- 389,393 ---- s.Close(); ! s = OpenSession(); Assert.IsTrue( s.Enumerable("select fum.Id.Short, fum.Id.Date, fum.Id.String from fum in class NHibernate.DomainModel.Fum").GetEnumerator().MoveNext() ); Assert.IsTrue( s.Enumerable("select fum.Id from fum in class NHibernate.DomainModel.Fum").GetEnumerator().MoveNext() ); *************** *** 439,443 **** public void CompositeIDCollections() { ! ISession s = sessions.OpenSession(); Fum fum1 = new Fum( FumTest.FumKey("fum1") ); Fum fum2 = new Fum( FumTest.FumKey("fum2") ); --- 439,443 ---- public void CompositeIDCollections() { ! ISession s = OpenSession(); Fum fum1 = new Fum( FumTest.FumKey("fum1") ); Fum fum2 = new Fum( FumTest.FumKey("fum2") ); *************** *** 459,463 **** s.Close(); ! s = sessions.OpenSession(); q = (Qux)s.Load( typeof(Qux), q.Key ); Assert.AreEqual( 2, q.Fums.Count, "collection of fums" ); --- 459,463 ---- s.Close(); ! s = OpenSession(); q = (Qux)s.Load( typeof(Qux), q.Key ); Assert.AreEqual( 2, q.Fums.Count, "collection of fums" ); *************** *** 477,481 **** public void DeleteOwner() { ! ISession s = sessions.OpenSession(); Qux q = new Qux(); s.Save(q); --- 477,481 ---- public void DeleteOwner() { ! ISession s = OpenSession(); Qux q = new Qux(); s.Save(q); *************** *** 497,501 **** s.Close(); ! s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); q = (Qux)s.Load( typeof(Qux), q.Key, LockMode.Upgrade ); --- 497,501 ---- s.Close(); ! s = OpenSession(); ITransaction t = s.BeginTransaction(); q = (Qux)s.Load( typeof(Qux), q.Key, LockMode.Upgrade ); *************** *** 505,509 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); list = s.Find("from fum in class NHibernate.DomainModel.Fum where not fum.FumString='FRIEND'"); --- 505,509 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); list = s.Find("from fum in class NHibernate.DomainModel.Fum where not fum.FumString='FRIEND'"); *************** *** 524,528 **** public void CompositeIDs() { ! ISession s = sessions.OpenSession(); Fo fo = Fo.NewFo(); s.Save( fo, FumTest.FumKey("an instance of fo") ); --- 524,528 ---- public void CompositeIDs() { ! ISession s = OpenSession(); Fo fo = Fo.NewFo(); s.Save( fo, FumTest.FumKey("an instance of fo") ); *************** *** 530,534 **** s.Close(); ! s = sessions.OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); fo.X = 5; --- 530,534 ---- s.Close(); ! s = OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); fo.X = 5; *************** *** 536,540 **** s.Close(); ! s = sessions.OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); Assert.AreEqual( 5, fo.X ); --- 536,540 ---- s.Close(); ! s = OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); Assert.AreEqual( 5, fo.X ); *************** *** 560,564 **** public void KeyManyToOne() { ! ISession s = sessions.OpenSession(); Inner sup = new Inner(); InnerKey sid = new InnerKey(); --- 560,564 ---- public void KeyManyToOne() { ! ISession s = OpenSession(); Inner sup = new Inner(); InnerKey sid = new InnerKey(); *************** *** 586,590 **** s.Close(); ! s = sessions.OpenSession(); d = (Outer)s.Load( typeof(Outer), did ); Assert.AreEqual( "dudu", d.Id.Master.Id.Sup.Dudu ); --- 586,590 ---- s.Close(); ! s = OpenSession(); d = (Outer)s.Load( typeof(Outer), did ); Assert.AreEqual( "dudu", d.Id.Master.Id.Sup.Dudu ); *************** *** 596,600 **** s.Close(); ! s = sessions.OpenSession(); d = (Outer)s.Find("from Outer o where o.id.DetailId=?", d.Id.DetailId, NHibernateUtil.String)[0]; s.Find("from Outer o where o.Id.Master.Id.Sup.Dudu is not null"); --- 596,600 ---- s.Close(); ! s = OpenSession(); d = (Outer)s.Find("from Outer o where o.id.DetailId=?", d.Id.DetailId, NHibernateUtil.String)[0]; s.Find("from Outer o where o.Id.Master.Id.Sup.Dudu is not null"); *************** *** 612,624 **** public void CompositeKeyPathExpressions() { ! using( ISession s = sessions.OpenSession() ) { s.Find("select fum1.Fo from fum1 in class Fum where fum1.Fo.FumString is not null"); s.Find("from fum1 in class Fum where fum1.Fo.FumString is not null order by fum1.Fo.FumString"); ! if ( !(dialect is Dialect.MySQLDialect) ! //&& !(dialect is HSQLDialect) ! //&& !(dialect is MckoiDialect) ! //&& !(dialect is PointbaseDialect) ! ) { s.Find("from fum1 in class Fum where exists elements(fum1.Friends)"); --- 612,620 ---- public void CompositeKeyPathExpressions() { ! using( ISession s = OpenSession() ) { s.Find("select fum1.Fo from fum1 in class Fum where fum1.Fo.FumString is not null"); s.Find("from fum1 in class Fum where fum1.Fo.FumString is not null order by fum1.Fo.FumString"); ! if( dialect.SupportsSubSelects ) { s.Find("from fum1 in class Fum where exists elements(fum1.Friends)"); Index: TestCase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/TestCase.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TestCase.cs 24 Apr 2005 15:47:08 -0000 1.14 --- TestCase.cs 5 May 2005 19:27:53 -0000 1.15 *************** *** 14,24 **** namespace NHibernate.Test { ! ! public abstract class TestCase { ! private const bool OUTPUT_DDL = true; protected Configuration cfg; protected Dialect.Dialect dialect; protected ISessionFactory sessions; /// <summary> --- 14,24 ---- namespace NHibernate.Test { ! public abstract class TestCase { ! private const bool OUTPUT_DDL = false; protected Configuration cfg; protected Dialect.Dialect dialect; protected ISessionFactory sessions; + private ISession lastOpenedSession; /// <summary> *************** *** 34,38 **** --- 34,49 ---- public virtual void TearDown() { + bool wasUnclosedSession = false; + if( lastOpenedSession != null && lastOpenedSession.IsOpen ) + { + wasUnclosedSession = true; + lastOpenedSession.Close(); + } DropSchema(); + + if( wasUnclosedSession ) + { + Assert.Fail("Unclosed session"); + } } *************** *** 107,110 **** --- 118,126 ---- } + protected ISession OpenSession() + { + lastOpenedSession = sessions.OpenSession(); + return lastOpenedSession; + } } } Index: SQLLoaderTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SQLLoaderTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SQLLoaderTest.cs 31 Mar 2005 12:42:39 -0000 1.3 --- SQLLoaderTest.cs 5 May 2005 19:27:52 -0000 1.4 *************** *** 60,64 **** } ! ISession session = sessions.OpenSession(); Simple sim = new Simple(); --- 60,64 ---- } ! ISession session = OpenSession(); Simple sim = new Simple(); *************** *** 81,85 **** } ! ISession session = sessions.OpenSession(); Simple sim = new Simple(); --- 81,85 ---- } ! ISession session = OpenSession(); Simple sim = new Simple(); *************** *** 97,101 **** public void FindBySQLStar() { ! ISession session = sessions.OpenSession(); Category s = new Category(); --- 97,101 ---- public void FindBySQLStar() { ! ISession session = OpenSession(); Category s = new Category(); *************** *** 129,133 **** public void FindBySQLProperties() { ! ISession session = sessions.OpenSession(); Category s = new Category(); --- 129,133 ---- public void FindBySQLProperties() { ! ISession session = OpenSession(); Category s = new Category(); *************** *** 153,157 **** public void FindBySQLAssociatedObject() { ! ISession s = sessions.OpenSession(); Category c = new Category(); --- 153,157 ---- public void FindBySQLAssociatedObject() { ! ISession s = OpenSession(); Category c = new Category(); *************** *** 167,171 **** s.Close(); ! s = sessions.OpenSession(); IList list = s.CreateSQLQuery( "select {category.*} from Category {category}", "category", typeof( Category ) ).List(); Assert.AreEqual( 1, list.Count, "Count differs" ); --- 167,171 ---- s.Close(); ! s = OpenSession(); IList list = s.CreateSQLQuery( "select {category.*} from Category {category}", "category", typeof( Category ) ).List(); Assert.AreEqual( 1, list.Count, "Count differs" ); *************** *** 180,184 **** public void FindBySQLMultipleObject() { ! ISession s = sessions.OpenSession(); Category c = new Category(); --- 180,184 ---- public void FindBySQLMultipleObject() { ! ISession s = OpenSession(); Category c = new Category(); *************** *** 210,214 **** s.Close(); ! s = sessions.OpenSession(); if ( !(dialect is Dialect.MySQLDialect) ) --- 210,214 ---- s.Close(); ! s = OpenSession(); if ( !(dialect is Dialect.MySQLDialect) ) Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** FooBarTest.cs 5 May 2005 13:47:41 -0000 1.96 --- FooBarTest.cs 5 May 2005 19:27:52 -0000 1.97 *************** *** 49,53 **** public void CollectionVersioning() { ! using( ISession s = sessions.OpenSession() ) { One one = new One(); --- 49,53 ---- public void CollectionVersioning() { ! using( ISession s = OpenSession() ) { [...3840 lines suppressed...] object id = s.Save( foo ); s.Flush(); s.Close(); ! s = OpenSession(); foo = (Foo)s.Find( "from Foo as f where f.id = ?", id, NHibernateUtil.String)[0]; Assert.AreEqual( 4, foo.Formula, "should be 2x 'Int' property that is defaulted to 2" ); *************** *** 5081,5085 **** public void AddAll() { ! using (ISession s = sessions.OpenSession()) { Foo foo1 = new Foo(); --- 5079,5083 ---- public void AddAll() { ! using (ISession s = OpenSession()) { Foo foo1 = new Foo(); Index: PerformanceTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PerformanceTest.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PerformanceTest.cs 31 Jan 2005 03:29:34 -0000 1.11 --- PerformanceTest.cs 5 May 2005 19:27:52 -0000 1.12 *************** *** 91,95 **** // allow cache to settle ! ISession s = sessions.OpenSession(); Hibernate(s, simples, ids, n, "h0"); s.Close(); --- 91,95 ---- // allow cache to settle ! ISession s = OpenSession(); Hibernate(s, simples, ids, n, "h0"); s.Close(); *************** *** 99,103 **** cp.CloseConnection(c); ! s = sessions.OpenSession(); Hibernate(s, simples, ids, n, "h0"); s.Close(); --- 99,103 ---- cp.CloseConnection(c); ! s = OpenSession(); Hibernate(s, simples, ids, n, "h0"); s.Close(); *************** *** 117,121 **** for(int i = 0; i < loops; i++) { ! using( s = sessions.OpenSession() ) { Hibernate(s, simples, ids, n, "h" + runIndex.ToString()); --- 117,121 ---- for(int i = 0; i < loops; i++) { ! using( s = OpenSession() ) { Hibernate(s, simples, ids, n, "h" + runIndex.ToString()); Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ABCProxyTest.cs 24 Apr 2005 10:14:14 -0000 1.16 --- ABCProxyTest.cs 5 May 2005 19:27:52 -0000 1.17 *************** *** 47,51 **** C2 c2; ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 47,51 ---- C2 c2; ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 62,66 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 62,66 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 79,83 **** C2 c2; ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 79,83 ---- C2 c2; ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 91,95 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 91,95 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 99,103 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 99,103 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 111,115 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 111,115 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 123,127 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 123,127 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 135,139 **** public void Subclassing() { ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); C1 c1 = new C1(); --- 135,139 ---- public void Subclassing() { ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); C1 c1 = new C1(); *************** *** 150,154 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); // Test won't run after this line because of proxy initalization problems --- 150,154 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); // Test won't run after this line because of proxy initalization problems *************** *** 159,163 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); B c1b = (B) s.Load( typeof(B), c1.Id ); --- 159,163 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); B c1b = (B) s.Load( typeof(B), c1.Id ); *************** *** 169,173 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c1 = (C1) s.Load( typeof(C1), c1.Id ); --- 169,173 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c1 = (C1) s.Load( typeof(C1), c1.Id ); *************** *** 181,185 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c1a = (A) s.Load( typeof(A), c1.Id ); --- 181,185 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c1a = (A) s.Load( typeof(A), c1.Id ); *************** *** 201,205 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c1a = (A) s.Load( typeof(A), c1.Id ); --- 201,205 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c1a = (A) s.Load( typeof(A), c1.Id ); *************** *** 221,225 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); c1a = (A) s.Load( typeof(A), c1.Id ); --- 221,225 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); c1a = (A) s.Load( typeof(A), c1.Id ); *************** *** 241,245 **** s.Close(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); s.Save( new B() ); --- 241,245 ---- s.Close(); ! s = OpenSession(); t = s.BeginTransaction(); s.Save( new B() ); *************** *** 257,261 **** { //Test is converted, but the original didn't check anything ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); B b = new B(); --- 257,261 ---- { //Test is converted, but the original didn't check anything ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); B b = new B(); *************** *** 268,272 **** t.Commit(); ! s = sessions.OpenSession(); t = s.BeginTransaction(); map = new Hashtable(); --- 268,272 ---- t.Commit(); ! s = OpenSession(); t = s.BeginTransaction(); map = new Hashtable(); *************** *** 295,299 **** object d2id; ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 295,299 ---- object d2id; ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 303,307 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 303,307 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 313,317 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 313,317 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 325,329 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 325,329 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 339,343 **** } ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 339,343 ---- } ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/AssemblyInfo.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AssemblyInfo.cs 17 Apr 2005 17:16:04 -0000 1.13 --- AssemblyInfo.cs 5 May 2005 19:27:52 -0000 1.14 *************** *** 5,9 **** // <autogenerated> // This code was generated by a tool. ! // Runtime Version: 1.1.4322.573 // // Changes to this file may cause incorrect behavior and will be lost if --- 5,9 ---- // <autogenerated> // This code was generated by a tool. ! // Runtime Version: 1.1.4322.2032 // // Changes to this file may cause incorrect behavior and will be lost if Index: MasterDetailTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MasterDetailTest.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MasterDetailTest.cs 30 Mar 2005 16:28:11 -0000 1.21 --- MasterDetailTest.cs 5 May 2005 19:27:52 -0000 1.22 *************** *** 34,38 **** public void ParentChildren() { ! ISession s = sessions.OpenSession(); //M parent = new M --- 34,38 ---- public void ParentChildren() { ! ISession s = OpenSession(); //M parent = new M *************** *** 65,69 **** cat.Subcategories.Add( subCatBaz ); ! ISession s = sessions.OpenSession(); s.Save( catWA ); s.Save( cat ); --- 65,69 ---- cat.Subcategories.Add( subCatBaz ); ! ISession s = OpenSession(); s.Save( catWA ); s.Save( cat ); *************** *** 81,90 **** newCat.Subcategories.Add( newSubCat ); ! s = sessions.OpenSession(); s.SaveOrUpdateCopy( cat ); s.Flush(); s.Close(); ! s = sessions.OpenSession(); cat = (Category) s.CreateQuery( "from Category cat where cat.Name='new foo'").UniqueResult(); newSubCat = (Category) s.CreateQuery( "from Category cat where cat.Name='new sub'").UniqueResult(); --- 81,90 ---- newCat.Subcategories.Add( newSubCat ); ! s = OpenSession(); s.SaveOrUpdateCopy( cat ); s.Flush(); ... [truncated message content] |
From: Sergey K. <jus...@us...> - 2005-05-05 19:28:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/DriverTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test/DriverTest Modified Files: NullReferenceFixture.cs Log Message: * Better SQLite support - only about 20 test cases fail on SQLite, mostly due to bugs in SQLite ADO.NET provider * Modified TestCase to clean up unclosed sessions in TearDown - not completely bullet-proof, since some tests don't call TearDown, but covers a lot of the cases. * Changed sessions.OpenSession() to OpenSession() in all tests * Added Dialect.SupportsSubSelects property for use in tests instead of (dialect is SomeDialect) expressions. Index: NullReferenceFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/DriverTest/NullReferenceFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullReferenceFixture.cs 1 Mar 2005 16:24:42 -0000 1.2 --- NullReferenceFixture.cs 5 May 2005 19:27:54 -0000 1.3 *************** *** 32,36 **** try { ! s = sessions.OpenSession(); Console.WriteLine( "about to run query" ); IQuery q = s.CreateQuery( "from Simple s where s.Name = :missing" ); --- 32,36 ---- try { ! s = OpenSession(); Console.WriteLine( "about to run query" ); IQuery q = s.CreateQuery( "from Simple s where s.Name = :missing" ); *************** *** 63,67 **** try { ! s = sessions.OpenSession(); Console.WriteLine( "about to run query" ); IQuery q = s.CreateQuery( "from Simple s where s.Name = :missing" ); --- 63,67 ---- try { ! s = OpenSession(); Console.WriteLine( "about to run query" ); IQuery q = s.CreateQuery( "from Simple s where s.Name = :missing" ); |
From: Sergey K. <jus...@us...> - 2005-05-05 19:28:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CompositeId In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test/CompositeId Modified Files: ClassWithCompositeIdFixture.cs Log Message: * Better SQLite support - only about 20 test cases fail on SQLite, mostly due to bugs in SQLite ADO.NET provider * Modified TestCase to clean up unclosed sessions in TearDown - not completely bullet-proof, since some tests don't call TearDown, but covers a lot of the cases. * Changed sessions.OpenSession() to OpenSession() in all tests * Added Dialect.SupportsSubSelects property for use in tests instead of (dialect is SomeDialect) expressions. Index: ClassWithCompositeIdFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CompositeId/ClassWithCompositeIdFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassWithCompositeIdFixture.cs 11 Dec 2004 20:08:18 -0000 1.1 --- ClassWithCompositeIdFixture.cs 5 May 2005 19:27:53 -0000 1.2 *************** *** 59,63 **** // insert the new objects ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 59,63 ---- // insert the new objects ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 76,80 **** // verify they were inserted and test the SELECT ! ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); --- 76,80 ---- // verify they were inserted and test the SELECT ! ISession s2 = OpenSession(); ITransaction t2 = s2.BeginTransaction(); *************** *** 111,115 **** // lets verify the update went through ! ISession s3 = sessions.OpenSession(); ITransaction t3 = s3.BeginTransaction(); --- 111,115 ---- // lets verify the update went through ! ISession s3 = OpenSession(); ITransaction t3 = s3.BeginTransaction(); *************** *** 129,133 **** // lets verify the delete went through ! ISession s4 = sessions.OpenSession(); try --- 129,133 ---- // lets verify the delete went through ! ISession s4 = OpenSession(); try *************** *** 147,150 **** --- 147,151 ---- Assert.AreEqual(0, results.Count); + s4.Close(); } *************** *** 158,167 **** // add the new instance to the session so I have something to get results // back for ! ISession s = sessions.OpenSession(); s.Save(cId); s.Flush(); s.Close(); ! s = sessions.OpenSession(); ICriteria c = s.CreateCriteria(typeof(ClassWithCompositeId)); c.Add( Expression.Expression.Eq("Id", id) ); --- 159,168 ---- // add the new instance to the session so I have something to get results // back for ! ISession s = OpenSession(); s.Save(cId); s.Flush(); s.Close(); ! s = OpenSession(); ICriteria c = s.CreateCriteria(typeof(ClassWithCompositeId)); c.Add( Expression.Expression.Eq("Id", id) ); *************** *** 179,183 **** { // insert the new objects ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 180,184 ---- { // insert the new objects ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 194,198 **** s.Close(); ! ISession s2 = sessions.OpenSession(); IQuery hql = s2.CreateQuery("from ClassWithCompositeId as cwid where cwid.Id.KeyString = :keyString"); --- 195,199 ---- s.Close(); ! ISession s2 = OpenSession(); IQuery hql = s2.CreateQuery("from ClassWithCompositeId as cwid where cwid.Id.KeyString = :keyString"); *************** *** 204,207 **** --- 205,209 ---- Assert.AreEqual(1, results.Count); + s2.Close(); } |
From: Sergey K. <jus...@us...> - 2005-05-05 19:28:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test/JoinedSubclass Modified Files: JoinedSubclassFixture.cs Person.cs Log Message: * Better SQLite support - only about 20 test cases fail on SQLite, mostly due to bugs in SQLite ADO.NET provider * Modified TestCase to clean up unclosed sessions in TearDown - not completely bullet-proof, since some tests don't call TearDown, but covers a lot of the cases. * Changed sessions.OpenSession() to OpenSession() in all tests * Added Dialect.SupportsSubSelects property for use in tests instead of (dialect is SomeDialect) expressions. Index: JoinedSubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclassFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JoinedSubclassFixture.cs 17 Jan 2005 03:40:51 -0000 1.3 --- JoinedSubclassFixture.cs 5 May 2005 19:27:55 -0000 1.4 *************** *** 27,31 **** public void TestJoinedSubclass() { ! ISession s = sessions.OpenSession(); Employee mark = new Employee(); --- 27,31 ---- public void TestJoinedSubclass() { ! ISession s = OpenSession(); Employee mark = new Employee(); *************** *** 64,68 **** // in later versions of hibernate a Clear method was added to session s.Close(); ! s = sessions.OpenSession(); IList customers = s.CreateQuery( "from Customer c left join fetch c.Salesperson" ).List(); --- 64,68 ---- // in later versions of hibernate a Clear method was added to session s.Close(); ! s = OpenSession(); IList customers = s.CreateQuery( "from Customer c left join fetch c.Salesperson" ).List(); *************** *** 75,79 **** Assert.AreEqual( 1, customers.Count ); s.Close(); ! s = sessions.OpenSession(); customers = s.CreateQuery( "from Customer" ).List(); --- 75,79 ---- Assert.AreEqual( 1, customers.Count ); s.Close(); ! s = OpenSession(); customers = s.CreateQuery( "from Customer" ).List(); *************** *** 87,91 **** s.Close(); ! s = sessions.OpenSession(); mark = (Employee)s.Load( typeof(Employee), mark.Id ); --- 87,91 ---- s.Close(); ! s = OpenSession(); mark = (Employee)s.Load( typeof(Employee), mark.Id ); *************** *** 108,112 **** { // test the Save ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 108,112 ---- { // test the Save ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 132,141 **** // get a proxied - initialized version of manager ! s = sessions.OpenSession(); pointyhair = (Employee) s.Load( typeof(Employee), pointyhair.Id ); NHibernateUtil.Initialize( pointyhair ); s.Close(); ! s = sessions.OpenSession(); IQuery q = s.CreateQuery( "from Employee as e where e.Manager = :theMgr" ); q.SetParameter( "theMgr", pointyhair ); --- 132,141 ---- // get a proxied - initialized version of manager ! s = OpenSession(); pointyhair = (Employee) s.Load( typeof(Employee), pointyhair.Id ); NHibernateUtil.Initialize( pointyhair ); s.Close(); ! s = OpenSession(); IQuery q = s.CreateQuery( "from Employee as e where e.Manager = :theMgr" ); q.SetParameter( "theMgr", pointyhair ); *************** *** 160,164 **** // test the Save ! ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); --- 160,164 ---- // test the Save ! ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); *************** *** 181,185 **** // lets verify the correct classes were saved ! s = sessions.OpenSession(); t = s.BeginTransaction(); --- 181,185 ---- // lets verify the correct classes were saved ! s = OpenSession(); t = s.BeginTransaction(); *************** *** 213,217 **** // lets test the Criteria interface for subclassing ! s = sessions.OpenSession(); t = s.BeginTransaction(); --- 213,217 ---- // lets test the Criteria interface for subclassing ! s = OpenSession(); t = s.BeginTransaction(); Index: Person.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/Person.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Person.cs 5 Jan 2005 02:44:18 -0000 1.2 --- Person.cs 5 May 2005 19:27:55 -0000 1.3 *************** *** 10,14 **** private int _id = 0; private string _name; ! private char _sex; private Address _address = new Address(); --- 10,14 ---- private int _id = 0; private string _name; ! private char _sex = 'M'; private Address _address = new Address(); |
From: Sergey K. <jus...@us...> - 2005-05-05 19:28:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/src/NHibernate.Test/ExpressionTest Modified Files: QueryByExampleTest.cs Log Message: * Better SQLite support - only about 20 test cases fail on SQLite, mostly due to bugs in SQLite ADO.NET provider * Modified TestCase to clean up unclosed sessions in TearDown - not completely bullet-proof, since some tests don't call TearDown, but covers a lot of the cases. * Changed sessions.OpenSession() to OpenSession() in all tests * Added Dialect.SupportsSubSelects property for use in tests instead of (dialect is SomeDialect) expressions. Index: QueryByExampleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest/QueryByExampleTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** QueryByExampleTest.cs 18 Apr 2005 02:55:29 -0000 1.5 --- QueryByExampleTest.cs 5 May 2005 19:27:55 -0000 1.6 *************** *** 31,35 **** public void TestSimpleQBE() { ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 31,35 ---- public void TestSimpleQBE() { ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 48,52 **** public void TestJunctionNotExpressionQBE() { ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 48,52 ---- public void TestJunctionNotExpressionQBE() { ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 70,74 **** public void TestExcludingQBE() { ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 70,74 ---- public void TestExcludingQBE() { ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { *************** *** 96,100 **** private void InitData() { ! using( ISession s = sessions.OpenSession() ) { Componentizable master = GetMaster("hibernate", "ORM tool", "ORM tool1"); --- 96,100 ---- private void InitData() { ! using( ISession s = OpenSession() ) { Componentizable master = GetMaster("hibernate", "ORM tool", "ORM tool1"); *************** *** 103,107 **** } ! using( ISession s = sessions.OpenSession() ) { Componentizable master = GetMaster("hibernate", "open source", "open source1"); --- 103,107 ---- } ! using( ISession s = OpenSession() ) { Componentizable master = GetMaster("hibernate", "open source", "open source1"); *************** *** 110,114 **** } ! using( ISession s = sessions.OpenSession() ) { Componentizable master = GetMaster("hibernate", null, null); --- 110,114 ---- } ! using( ISession s = OpenSession() ) { Componentizable master = GetMaster("hibernate", null, null); *************** *** 120,124 **** private void DeleteData() { ! using( ISession s = sessions.OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { --- 120,124 ---- private void DeleteData() { ! using( ISession s = OpenSession() ) using( ITransaction t = s.BeginTransaction() ) { |
From: Michael D. <mik...@us...> - 2005-05-05 14:53:22
|
Update of /cvsroot/nhibernate/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13962 Modified Files: avail Log Message: added Bill Hawes as a commiter. Index: avail =================================================================== RCS file: /cvsroot/nhibernate/CVSROOT/avail,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** avail 2 Mar 2005 22:28:32 -0000 1.6 --- avail 5 May 2005 14:52:39 -0000 1.7 *************** *** 1,4 **** unavail ! avail|luggage, kevinwilliams, johntmorris, justme84, phatcher, mthird|NHibernateContrib ! avail|kevinwilliams, justme84, phatcher, mthird|nhibernate avail|mikedoerfler, szoke --- 1,4 ---- unavail ! avail|luggage, kevinwilliams, johntmorris, justme84, phatcher, mthird, billhawes|NHibernateContrib ! avail|kevinwilliams, justme84, phatcher, mthird, billhawes|nhibernate avail|mikedoerfler, szoke |
From: Sergey K. <jus...@us...> - 2005-05-05 13:49:02
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30572/src/NHibernate/Dialect Modified Files: PostgreSQLDialect.cs Log Message: Added PreferLimit to PostgreSQLDialect so that LIMIT is used when OFFSET is 0. Index: PostgreSQLDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PostgreSQLDialect.cs 6 Mar 2005 12:44:37 -0000 1.17 --- PostgreSQLDialect.cs 5 May 2005 13:48:53 -0000 1.18 *************** *** 151,154 **** --- 151,160 ---- get { return true; } } + + public override bool PreferLimit + { + get { return true; } + } + } } \ No newline at end of file |
From: Sergey K. <jus...@us...> - 2005-05-05 13:47:55
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30238/src/NHibernate.DomainModel Modified Files: Baz.cs Baz.hbm.xml Glarch.cs Glarch.hbm.xml GlarchProxy.cs Log Message: Ported all FooBarTests (except those for unimplemented features). Index: Glarch.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Glarch.cs 24 Apr 2005 19:37:56 -0000 1.10 --- Glarch.cs 5 May 2005 13:47:41 -0000 1.11 *************** *** 18,22 **** private string _immutable; private int _derivedVersion; ! // private object _any; private int _x; private Multiplicity _multiple; --- 18,22 ---- private string _immutable; private int _derivedVersion; ! private object _any; private int _x; private Multiplicity _multiple; *************** *** 150,153 **** --- 150,162 ---- /// <summary> + /// Gets or sets the _any + /// </summary> + public object Any + { + get { return _any; } + set { _any = value; } + } + + /// <summary> /// Gets or sets the _multiple /// </summary> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.hbm.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Glarch.hbm.xml 16 Dec 2004 21:57:39 -0000 1.10 --- Glarch.hbm.xml 5 May 2005 13:47:41 -0000 1.11 *************** *** 107,111 **** column="version" /> ! <property name="Multiple" --- 107,116 ---- column="version" /> ! ! <property name="Any" type="object"> ! <column name="`any_id of object`"/> ! <column name="`any_class of object`"/> ! </property> ! <property name="Multiple" Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.hbm.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Baz.hbm.xml 24 Apr 2005 19:37:56 -0000 1.18 --- Baz.hbm.xml 5 May 2005 13:47:41 -0000 1.19 *************** *** 112,116 **** </composite-element> </array> ! <bag name="Bag" --- 112,122 ---- </composite-element> </array> ! <array name="TimeArray"> ! <key> ! <column name="baz_id" length="16"/> ! </key> ! <index column="j"/> ! <element column="the_time" type="time"/> ! </array> <bag name="Bag" Index: Baz.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Baz.cs 24 Apr 2005 19:37:56 -0000 1.15 --- Baz.cs 5 May 2005 13:47:41 -0000 1.16 *************** *** 21,24 **** --- 21,25 ---- private String _code; private FooComponent[] _components; + private DateTime[] _timeArray; private string[] _stringArray; private int[] _intArray; *************** *** 362,365 **** --- 363,381 ---- /// <summary> + /// Gets or sets the timeArray + /// </summary> + public DateTime[] TimeArray + { + get + { + return _timeArray; + } + set + { + _timeArray = value; + } + } + + /// <summary> /// Gets or sets the stringArray /// </summary> *************** *** 591,594 **** --- 607,617 ---- new FooComponent("bar", 88, null, new FooComponent("sub", 69, null, null) ) }; + TimeArray = new DateTime[] { + new DateTime(), + new DateTime(), + new DateTime(), // H2.1 has null here, but it's illegal on .NET + new DateTime(0) + }; + Count = 667; Name="Bazza"; Index: GlarchProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/GlarchProxy.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GlarchProxy.cs 18 Nov 2004 02:45:43 -0000 1.5 --- GlarchProxy.cs 5 May 2005 13:47:41 -0000 1.6 *************** *** 64,68 **** get; set; ! } } } \ No newline at end of file --- 64,73 ---- get; set; ! } ! object Any ! { ! get; ! set; ! } } } \ No newline at end of file |
From: Sergey K. <jus...@us...> - 2005-05-05 13:47:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30238/src/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Ported all FooBarTests (except those for unimplemented features). Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** FooBarTest.cs 3 May 2005 14:56:06 -0000 1.95 --- FooBarTest.cs 5 May 2005 13:47:41 -0000 1.96 *************** *** 1820,1824 **** s.Save(bar2); - // TODO: at this point it fails because of SessionImpl.ProxyFor IList list = s.Find("from Bar bar left join bar.Baz baz left join baz.CascadingBars b where bar.Name like 'Bar %'"); object row = list[0]; --- 1820,1823 ---- *************** *** 1921,1925 **** [Test] ! [Ignore("Test not written yet.")] public void Dyna() { --- 1920,1924 ---- [Test] ! [Ignore("Dynamic components not implemented yet")] public void Dyna() { *************** *** 2010,2015 **** Assert.IsTrue(NHibernateUtil.IsInitialized(f.TheFoo)); ! //TODO: this is initialized because Proxies are not implemented yet. ! //Assert.IsFalse( NHibernate.IsInitialized(f.component.Glarch) ); s.Delete(f.TheFoo); --- 2009,2013 ---- Assert.IsTrue(NHibernateUtil.IsInitialized(f.TheFoo)); ! Assert.IsFalse( NHibernateUtil.IsInitialized(f.Component.Glarch) ); s.Delete(f.TheFoo); *************** *** 2253,2257 **** - /* [Test] public void CompositeKeyPathExpressions() --- 2251,2254 ---- *************** *** 2282,2286 **** s.Close(); } - */ [Test] --- 2279,2282 ---- *************** *** 2506,2512 **** baz.StringList[0] = "new value"; baz.StringSet = new Iesi.Collections.HashedSet(); ! ! // HACK: 2.1 - The java (and old NH) version has the result of this as 1, I can't see why it should be since we explicitly put 2 items into StringGlarchMap? ! //Assert.AreEqual( 2, baz.StringGlarchMap.Count, "baz.StringGlarchMap.Count" ); Assert.AreEqual( 1, baz.StringGlarchMap.Count, "baz.StringGlarchMap.Count" ); IList list; --- 2502,2508 ---- baz.StringList[0] = "new value"; baz.StringSet = new Iesi.Collections.HashedSet(); ! ! // NOTE: We put two items in the map, but expect only one to come back, because ! // of where="..." specified in the mapping for StringGlarchMap Assert.AreEqual( 1, baz.StringGlarchMap.Count, "baz.StringGlarchMap.Count" ); IList list; *************** *** 3701,3718 **** } - [Test] - [Ignore("Test not written yet.")] public void DeleteUpdatedTransient() { ! } [Test] - [Ignore("Test not written yet.")] public void UpdateOrder() { ! } [Test] --- 3697,3782 ---- } [Test] public void DeleteUpdatedTransient() { ! Fee fee = new Fee(); ! Fee fee2 = new Fee(); ! fee2.AnotherFee = fee; ! ! using( ISession s = sessions.OpenSession() ) ! using( ITransaction tx = s.BeginTransaction() ) ! { ! s.Save( fee ); ! s.Save( fee2 ); ! s.Flush(); ! fee.Count = 123; ! tx.Commit(); ! } + using( ISession s = sessions.OpenSession() ) + using( ITransaction tx = s.BeginTransaction() ) + { + s.Update( fee ); + //fee2.AnotherFee = null; + s.Update( fee2 ); + s.Delete( fee ); + s.Delete( fee2 ); + tx.Commit(); + } + + using( ISession s = sessions.OpenSession() ) + using( ITransaction tx = s.BeginTransaction() ) + { + Assert.AreEqual( 0, s.Find("from fee in class Fee").Count ); + tx.Commit(); + } + } [Test] public void UpdateOrder() { ! Fee fee1, fee2, fee3; ! ! using( ISession s = sessions.OpenSession() ) ! { ! fee1 = new Fee(); ! s.Save( fee1 ); ! ! fee2 = new Fee(); ! fee1.TheFee = fee2; ! fee2.TheFee = fee1; ! fee2.Fees = new Iesi.Collections.HashedSet(); + fee3 = new Fee(); + fee3.TheFee = fee1; + fee3.AnotherFee = fee2; + fee2.AnotherFee = fee3; + s.Save( fee3 ); + s.Save( fee2 ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + fee1.Count = 10; + fee2.Count = 20; + fee3.Count = 30; + s.Update( fee1 ); + s.Update( fee2 ); + s.Update( fee3 ); + s.Flush( ); + s.Delete( fee1 ); + s.Delete( fee2 ); + s.Delete( fee3 ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + using( ITransaction tx = s.BeginTransaction() ) + { + Assert.AreEqual( 0, s.Find("from fee in class Fee").Count ); + tx.Commit(); + } + } [Test] *************** *** 3742,3748 **** Qux q = new Qux("quxxy"); - //TODO: not sure the test will work with this because unsaved-value="0" - // and in h2.0.3 it is unsaved-value="null" - q.TheKey = 0; fee1.Qux = q; s = sessions.OpenSession(); --- 3806,3809 ---- *************** *** 3826,3834 **** [Test] ! [Ignore("Test not written yet.")] ! public void ArrayOfTimes() { ! } [Test] --- 3887,3917 ---- [Test] ! public void ArraysOfTimes() { ! Baz baz; ! ! using( ISession s = sessions.OpenSession() ) ! { ! baz = new Baz(); ! s.Save(baz); ! baz.SetDefaults(); ! s.Flush(); ! } ! ! using( ISession s = sessions.OpenSession() ) ! { ! baz.TimeArray[2] = new DateTime( 123 ); // H2.1: new Date(123) ! baz.TimeArray[3] = new DateTime( 1234 ); // H2.1: new java.sql.Time(1234) ! s.Update( baz ); // missing in H2.1 ! s.Flush(); ! } + using( ISession s = sessions.OpenSession() ) + { + baz = (Baz) s.Load( typeof( Baz ), baz.Code ); + s.Delete( baz ); + s.Flush(); + } + } [Test] *************** *** 4634,4640 **** [Test] - [Ignore("Test not written yet.")] public void ObjectType() { } --- 4717,4743 ---- [Test] public void ObjectType() { + object gid; + + using( ISession s = sessions.OpenSession() ) + { + GlarchProxy g = new Glarch(); + Foo foo = new Foo(); + g.Any = foo; + gid = s.Save( g ); + s.Save( foo ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + GlarchProxy g = (GlarchProxy) s.Load( typeof( Glarch ), gid ); + Assert.IsNotNull( g.Any ); + Assert.IsTrue( g.Any is FooProxy ); + s.Delete( g.Any ); + s.Delete( g ); + s.Flush(); + } } |
From: Michael D. <mik...@us...> - 2005-05-05 13:18:55
|
Update of /cvsroot/nhibernate/NHibernateContrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22396 Modified Files: releasenotes.txt Log Message: Finished updating release notes. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/releasenotes.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** releasenotes.txt 26 Feb 2005 15:13:03 -0000 1.4 --- releasenotes.txt 5 May 2005 13:18:45 -0000 1.5 *************** *** 1,2 **** --- 1,11 ---- + Build 0.8.0.0 + ======================== + - Added NullableChar + - Marked all assemblies except hbm2net as [CLSCompliant(true)]. + - Modified NHibernateContrib Assemblies Version to not be tied to NHibernate version. + - Renamed net2hbm to NHibernate.Mapping.Attributes + - Renamed BantamTech.SysCache to NHibernate.Caches.SysCache + - Upgraded to nant-0.85-rc3 and nunit-2.2.0. + Build 0.7.0.0 ======================== |
From: Michael D. <mik...@us...> - 2005-05-05 13:18:30
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22119 Modified Files: releasenotes.txt Log Message: Finished updating release notes. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** releasenotes.txt 5 May 2005 01:41:53 -0000 1.33 --- releasenotes.txt 5 May 2005 13:18:02 -0000 1.34 *************** *** 14,30 **** - Added IDriver and Dialect for Sybase (Steve Corbin). - Added UniqueResult() to ICriteria and IQuery. - Fixed <one-to-one> so that two queries are no longer issued when one side is null. - Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) - Fixed bug with <set> being initialized from Cache. ! - Fixed bug with select new ClassName where one parameter was an Enum. (Luca Altea) ! - Fixed bug in mapping that required type="full name of enum" to be required instead of NH correctly inferring type. (Luca Altea) - Fixed bug with a decimal <id> and unsaved-value. ! - Fixed problem with loading ADO.NET Data Providers from GAC - Improved memory consumption of Configuration, smaller footprint and releases objects faster. - Improved nhibernate-mapping schema to more schema constructs instead of direct dtd port. - Modified <discriminator> to use "null" or "not null" as the value. - Modified Dialect to use Hibernate 2.1 methods. ! - Modified Expression to return ICriterion instead of Expression class. ! - Upgraded to nant-0.85-rc3 and nunit-2.2.0 Build 0.7.0.0 --- 14,36 ---- - Added IDriver and Dialect for Sybase (Steve Corbin). - Added UniqueResult() to ICriteria and IQuery. + - Added default value of hibernate.connection.driver_class to Dialect so most of the time this configuration is not needed. + - Added SByteType to built in ITypes. - Fixed <one-to-one> so that two queries are no longer issued when one side is null. - Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) - Fixed bug with <set> being initialized from Cache. ! - Fixed bug with hql "select new ClassName(...) from ..." where one parameter was an Enum. (Luca Altea) ! - Fixed bug in mapping that required type="full.name.of.enum" to be required instead of NH correctly inferring type. (Luca Altea) - Fixed bug with a decimal <id> and unsaved-value. ! - Fixed problem with loading ADO.NET Data Providers from GAC. ! - Fixed issue with TableGenerator not disposing of IDbCommand. - Improved memory consumption of Configuration, smaller footprint and releases objects faster. - Improved nhibernate-mapping schema to more schema constructs instead of direct dtd port. + - Improved message from NullableType when DataProvider can't cast the database value to .net class. - Modified <discriminator> to use "null" or "not null" as the value. - Modified Dialect to use Hibernate 2.1 methods. ! - Modified Expression to return ICriterion instead of Expression class. This will break existing code. ! - Modified nhibernate-configuration-2.0.xsd to not require <mappings>. ! - Split QueryFunctionStandard into ISQLFunction interface and StandardSQLFunction. ! - Upgraded to nant-0.85-rc3 and nunit-2.2.0. Build 0.7.0.0 |
From: Michael D. <mik...@us...> - 2005-05-05 13:15:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21196 Modified Files: nhibernate-configuration-2.0.xsd Log Message: nh-92 - added minOccurs='0' to <mapping> Index: nhibernate-configuration-2.0.xsd =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate-configuration-2.0.xsd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nhibernate-configuration-2.0.xsd 26 Jul 2004 12:45:18 -0000 1.4 --- nhibernate-configuration-2.0.xsd 5 May 2005 13:15:40 -0000 1.5 *************** *** 69,73 **** <xs:sequence> <xs:element ref='property' minOccurs='0' maxOccurs='unbounded' /> ! <xs:element ref='mapping' maxOccurs='unbounded' /> <xs:choice minOccurs='0' maxOccurs='unbounded'> <xs:element ref='jcs-class-cache' /> --- 69,73 ---- <xs:sequence> <xs:element ref='property' minOccurs='0' maxOccurs='unbounded' /> ! <xs:element ref='mapping' minOccurs='0' maxOccurs='unbounded' /> <xs:choice minOccurs='0' maxOccurs='unbounded'> <xs:element ref='jcs-class-cache' /> |
From: Michael D. <mik...@us...> - 2005-05-05 01:42:02
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26773 Modified Files: releasenotes.txt Log Message: updating release notes - got to commit message of 185 of 269 for this build - need to resume tomm morning. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** releasenotes.txt 3 May 2005 14:53:31 -0000 1.32 --- releasenotes.txt 5 May 2005 01:41:53 -0000 1.33 *************** *** 1,21 **** Build 0.8.0.0 ======================== ! - Added "namespace" and "assembly" attributes to hibernate-mapping element. - Added lazy="true" as short hand for proxy="full type name" ! - Added insert attribute to discriminator element. - Added ability to set INamingStrategy on Configuration class. ! - Added property-ref attribute on many-to-one and one-to-one elements. ! - Added "foreign-key" attribute to many-to-one, one-to-one, many-to-many, key allowing a different column to be the foreign key target - Added check attribute to column element. ! - Added sql-query element. ! - Added "unsaved-value" to version/timestamp as DateTime can't support null, use 1/1/0001 to align with .NET default value for DateTime ! - Added SaveOrUpdateCopy which allows synchronisation for detached objects ! - Fixed one-to-one so that two queries are no longer issued when one side is null. - Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) - Fixed bug with select new ClassName where one parameter was an Enum. (Luca Altea) - Fixed bug in mapping that required type="full name of enum" to be required instead of NH correctly inferring type. (Luca Altea) - Improved memory consumption of Configuration, smaller footprint and releases objects faster. ! - Modified discriminator element to use "null" or "not null" as the value. - Modified Dialect to use Hibernate 2.1 methods. Build 0.7.0.0 --- 1,30 ---- Build 0.8.0.0 ======================== ! - Added "namespace" and "assembly" attributes to <hibernate-mapping>. - Added lazy="true" as short hand for proxy="full type name" ! - Added insert attribute to <discriminator>. - Added ability to set INamingStrategy on Configuration class. ! - Added property-ref attribute on <many-to-one> and <one-to-one>. ! - Added "foreign-key" attribute to <many-to-one>, <one-to-one>, <many-to-many>, key allowing a different column to be the foreign key target - Added check attribute to column element. ! - Added <sql-query> element. ! - Added "unsaved-value" to <version>/<timestamp> as DateTime can't support null, use 1/1/0001 to align with .NET default value for DateTime ! - Added SaveOrUpdateCopy() which allows synchronisation for detached objects ! - Added Expression.Example for Query By Example. ! - Added IDriver and Dialect for Sybase (Steve Corbin). ! - Added UniqueResult() to ICriteria and IQuery. ! - Fixed <one-to-one> so that two queries are no longer issued when one side is null. - Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) + - Fixed bug with <set> being initialized from Cache. - Fixed bug with select new ClassName where one parameter was an Enum. (Luca Altea) - Fixed bug in mapping that required type="full name of enum" to be required instead of NH correctly inferring type. (Luca Altea) + - Fixed bug with a decimal <id> and unsaved-value. + - Fixed problem with loading ADO.NET Data Providers from GAC - Improved memory consumption of Configuration, smaller footprint and releases objects faster. ! - Improved nhibernate-mapping schema to more schema constructs instead of direct dtd port. ! - Modified <discriminator> to use "null" or "not null" as the value. - Modified Dialect to use Hibernate 2.1 methods. + - Modified Expression to return ICriterion instead of Expression class. + - Upgraded to nant-0.85-rc3 and nunit-2.2.0 Build 0.7.0.0 |
From: Michael D. <mik...@us...> - 2005-05-04 14:49:09
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15453 Modified Files: basic_mapping.xml example_parentchild.xml Log Message: updated for next build Index: basic_mapping.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/basic_mapping.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** basic_mapping.xml 4 May 2005 03:13:17 -0000 1.13 --- basic_mapping.xml 4 May 2005 14:48:57 -0000 1.14 *************** *** 720,723 **** --- 720,724 ---- type="discriminator_type"<co id="discriminator2-co" linkends="discriminator2" /> force="true|false"<co id="discriminator3-co" linkends="discriminator3" /> + insert="true|false" <co id="discriminator4-co" linkends="discriminator4" /> /></programlisting> <calloutlist> *************** *** 740,743 **** --- 741,751 ---- all instances of the root class. </para> + </callout> + <callout arearefs="discriminator4-co" id="discriminator4"> + <para> + <literal>insert</literal> (optional - defaults to <literal>true</literal>) + set this to <literal>false</literal> if your discriminator column is also part + of a mapped composite identifier. + </para> </callout> </calloutlist> *************** *** 770,773 **** --- 778,782 ---- type="typename"<co id="version3-co" linkends="version3" /> access="field|property|nosetter|ClassName"<co id="version4-co" linkends="version4" /> + unsaved-value="null|negative|undefined|value"<co id="version5-co" linkends="version5" /> /></programlisting> <calloutlist> *************** *** 795,798 **** --- 804,816 ---- </para> </callout> + <callout arearefs="version5-co" id="version5"> + <para> + <literal>unsaved-value</literal> (optional - defaults to <literal>undefined</literal>): + A version property value that indicates that an instance is newly instantiated + (unsaved), distinguishing it from transient instances that were saved or loaded + in a previous session. (<literal>undefined</literal> specifies that the identifier + property value should be used.) + </para> + </callout> </calloutlist> *************** *** 819,822 **** --- 837,841 ---- name="propertyName"<co id="timestamp2-co" linkends="timestamp2" /> access="field|property|nosetter|ClassName"<co id="timestamp3-co" linkends="timestamp3" /> + unsaved-value="null|negative|undefined|value"<co id="timestamp4-co" linkends="timestamp4" /> /></programlisting> <calloutlist> *************** *** 838,841 **** --- 857,869 ---- </para> </callout> + <callout arearefs="timestamp4-co" id="timestamp4"> + <para> + <literal>unsaved-value</literal> (optional - defaults to <literal>undefined</literal>): + A timestamp property value that indicates that an instance is newly instantiated + (unsaved), distinguishing it from transient instances that were saved or loaded + in a previous session. (<literal>undefined</literal> specifies that the identifier + property value should be used.) + </para> + </callout> </calloutlist> *************** *** 1091,1095 **** update="true|false"<co id="manytoone6-co" /> insert="true|false"<co id="manytoone7-co" /> ! access="field|property|ClassName"<co id="manytoone8-co" /> /></programlisting> <calloutlist> --- 1119,1125 ---- update="true|false"<co id="manytoone6-co" /> insert="true|false"<co id="manytoone7-co" /> ! property-ref="propertyNameFromAssociatedClass" <co id="manytoone8-co" /> ! access="field|property|ClassName"<co id="manytoone9-co" /> ! unique="true|false" <co id="manytoone10-co" /> /></programlisting> <calloutlist> *************** *** 1134,1137 **** --- 1164,1174 ---- <callout arearefs="manytoone8-co" id="manytoone8"> <para> + <literal>property-ref</literal>: (optional) The name of a property of the associated + class that is joined to this foreign key. If not specified, the primary key of the + associated class is used. + </para> + </callout> + <callout arearefs="manytoone9-co" id="manytoone9"> + <para> <literal>access</literal> (optional - defaults to <literal>property</literal>): The strategy NHibernate should use for *************** *** 1139,1142 **** --- 1176,1185 ---- </para> </callout> + <callout arearefs="manytoone10-co" id="manytoone10"> + <para> + <literal>unique</literal> (optional): Enable the DDL generation of a unique + constraint for the foreign-key column. + </para> + </callout> </calloutlist> <para> *************** *** 1172,1175 **** --- 1215,1245 ---- </listitem> </itemizedlist> + + <para> + A typical <literal>many-to-one</literal> declaration looks as simple as + </para> + + <programlisting><![CDATA[<many-to-one name="Product" class="Product" column="PRODUCT_ID" />]]></programlisting> + + <para> + The <literal>property-ref</literal> attribute should only be used for mapping legacy + data where a foreign key refers to a unique key of the associated table other than + the primary key. This is an ugly relational model. For example, suppose the + <literal>Product</literal> class had a unique serial number, that is not the primary + key. (The <literal>unique</literal> attribute controls NHibernate's DDL generation with + the SchemaExport tool.) + </para> + + <programlisting><![CDATA[<property name="SerialNumber" unique="true" type="String" column="SERIAL_NUMBER" ]]></programlisting> + + <para> + Then the mapping for <literal>OrderItem</literal> might use: + </para> + + <programlisting><![CDATA[<many-to-one name="Product property-ref="SerialNumber" column="PRODUCT_SERIAL_NUMBER" />]]></programlisting> + + <para> + This is certainly not encouraged, however. + </para> </sect2> <sect2 id="mapping-declaration-onetoone"> *************** *** 1186,1190 **** constrained="true|false"<co id="onetoone4-co" /> outer-join="true|false|auto"<co id="onetoone5-co" /> ! access="field|property|ClassName"<co id="onetoone6-co" /> /></programlisting> <calloutlist> --- 1256,1261 ---- constrained="true|false"<co id="onetoone4-co" /> outer-join="true|false|auto"<co id="onetoone5-co" /> ! property-ref="propertyNameFromAssociatedClass" <co id="onetoone6-co" /> ! access="field|property|ClassName"<co id="onetoone7-co" /> /></programlisting> <calloutlist> *************** *** 1223,1226 **** --- 1294,1304 ---- <callout arearefs="onetoone6-co" id="onetoone6"> <para> + <literal>property-ref</literal>: (optional): The name of a property of the associated class + that is joined to the primary key of this class. If not specified, the primary key of + the associated class is used. + </para> + </callout> + <callout arearefs="onetoone7-co" id="onetoone7"> + <para> <literal>access</literal> (optional - defaults to <literal>property</literal>): The strategy NHibernate should use for accessing the property value. *************** *** 1228,1235 **** </callout> </calloutlist> ! <!-- TODO: add details about the new property-ref attribute that Paul added --> </sect2> <sect2 id="mapping-declaration-component"> ! <title>component, dynamic-component</title> <para> --- 1306,1377 ---- </callout> </calloutlist> ! <para> ! There are two varieties of one-to-one associations: ! </para> ! <itemizedlist> ! <listitem> ! <para>primary key associations</para> ! </listitem> ! <listitem> ! <para>unique foreign key associations</para> ! </listitem> ! </itemizedlist> ! ! <para> ! Primary key associations don't need an extra table column; if two rows are related by ! the association then the two table rows share the same primary key value. So if you want ! two objects to be related by a primary key association, you must make sure that they ! are assigned the same identifier value! ! </para> ! ! <para> ! For a primary key association, add the following mappings to <literal>Employee</literal> and ! <literal>Person</literal>, respectively. ! </para> ! ! <programlisting><![CDATA[<one-to-one name="Person" class="Person" />]]></programlisting> ! <programlisting><![CDATA[<one-to-one name="Employee" class="Employee" constrained="true" />]]></programlisting> ! ! <para> ! Now we must ensure that the primary keys of related rows in the PERSON and ! EMPLOYEE table are equal. We use a special identifier generation strategy ! call <literal>foreign</literal>: ! </para> ! ! <programlisting><![CDATA[<class name="Person" table="PERSON"> ! <id name="Id" column="PERSON_ID"> ! <generator class="foreign"> ! <param name="property">Employee</param> ! </generator> ! </id> ! ... ! <one-to-one name="Employee" ! class="Employee" ! constrained="true" /> ! </class>]]></programlisting> ! ! <para> ! A newly saved instance of <literal>Person</literal> is then assigned the same primary ! key value as the <literal>Employee</literal> instance refered with the <literal>Employee</literal> ! property of that <literal>Person</literal>. ! </para> ! ! <para> ! Alternatively, a foreign key with a unique constraint, from <literal>Employee</literal> to ! <literal>Person</literal>, may be expressed as: ! </para> ! ! <programlisting><![CDATA[<many-to-one name="Person" class="Person" column="PERSON_ID" unique="true" />]]></programlisting> ! ! <para> ! And this association may be made bidirectional by adding the following to the ! <literal>Person</literal> mapping: ! </para> ! ! <programlisting><![CDATA[<one-to-one name="Employee" class="Employee" property-ref="Person" />]]></programlisting> ! </sect2> <sect2 id="mapping-declaration-component"> ! <title>component<!--, dynamic-component--></title> <para> *************** *** 1245,1249 **** update="true|false"<co id="component4-co" /> access="field|property|ClassName"<co id="component5-co" /> ! /></programlisting> <calloutlist> <callout arearefs="component1-co" id="component1"> --- 1387,1396 ---- update="true|false"<co id="component4-co" /> access="field|property|ClassName"<co id="component5-co" /> ! > ! <parent ... /> ! <property ... /> ! <many-to-one ... /> ! ... ! <component/></programlisting> <calloutlist> <callout arearefs="component1-co" id="component1"> *************** *** 1277,1280 **** --- 1424,1438 ---- </callout> </calloutlist> + + <para> + The child <literal><property></literal> tags map properties of the + child class to table columns. + </para> + + <para> + The <literal><component></literal> element allows a <literal><parent></literal> + subelement that maps a property of the component class as a reference back to the + containig entity. + </para> </sect2> <sect2 id="mapping-declaration-subclass"> Index: example_parentchild.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/example_parentchild.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** example_parentchild.xml 12 Apr 2005 02:45:38 -0000 1.3 --- example_parentchild.xml 4 May 2005 14:48:57 -0000 1.4 *************** *** 277,282 **** that both <literal>Parent</literal> and <literal>Child</literal> have (synthetic) identifier properties of type <literal>System.Int32</literal>. NHibernate will use the identifier property value to determine which of the ! children are new. ! <!-- TODO: add comments about version/timestamp when the build is released --> </para> <para> --- 277,282 ---- that both <literal>Parent</literal> and <literal>Child</literal> have (synthetic) identifier properties of type <literal>System.Int32</literal>. NHibernate will use the identifier property value to determine which of the ! children are new. (You may also use the version or timestamp property ! <!-- TODO: add linkend to manipulatingdata-updating-detached) --> </para> <para> *************** *** 287,294 **** <programlisting><![CDATA[<id name="Id" type="Int64" unsaved-value="0" ]]></programlisting> <para> ! for the <literal>Child</literal> mapping. <!-- ! TODO: not implemented in production build yet ! (There is also an <literal>unsaved-value</literal> attribute ! for version and timestamp property mappings.)--> </para> <para> --- 287,292 ---- <programlisting><![CDATA[<id name="Id" type="Int64" unsaved-value="0" ]]></programlisting> <para> ! for the <literal>Child</literal> mapping. (There is also an <literal>unsaved-value</literal> attribute ! for version and timestamp property mappings.) </para> <para> *************** *** 305,309 **** <para> ! <!-- TODO: discuss use of unsaved-value with version and timestamp --> </para> </sect1> --- 303,337 ---- <para> ! Well, thats all very well for the case of generated identifier, but what about assigned identifiers ! and composite identifiers? This is more difficult, since <literal>unsaved-values</literal> can't ! distinguish between a newly instantiated object (with an identifier assigned by the user) and an object ! loaded in a previous session. In these cases, you will probably need to give NHibernate a hint; either ! </para> ! ! <itemizedlist> ! <listitem> ! <para> ! define <literal>unsaved-value="null"</literal> or <literal>unsaved-value="negative"</literal> or ! <literal>unsaved-value="parsablestring"</literal>on a <literal><version></literal> ! or <literal><timestamp></literal> property mapping for the class. ! </para> ! </listitem> ! <listitem> ! <para> ! set <literal>unsaved-value="none"</literal> and explicitly <literal>Save()</literal> ! newly instantiated children before calling <literal>Update( parent )</literal> ! </para> ! </listitem> ! <listitem> ! <para> ! set <literal>unsaved-value="any"</literal> and explicitly <literal>Update()</literal> ! previously persistent children before calling <literal>Update( parent )</literal> ! </para> ! </listitem> ! </itemizedlist> ! ! <para> ! <literal>none</literal> is the default <literal>unsaved-value</literal> for assigned and composite ! identifiers. </para> </sect1> *************** *** 316,320 **** </para> <para> ! <!-- TODO: describe composite-element --> </para> </sect1> --- 344,352 ---- </para> <para> ! We mentioned an alternative in the first paragraph. None of the above issues exist in the case of ! <literal><composite-element></literal> mappings, which have exactly the semantics of a parent / child ! relationship. Unfortunately, there are two big limitations to composite element classes: composite elements may ! not own collections, and they should not be the child of any entity other than the unique parent. (However, ! they <emphasis>may</emphasis> have a surrogate primary key, using an <literal><idbag></literal> mapping.) </para> </sect1> |
From: Michael D. <mik...@us...> - 2005-05-04 03:13:29
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12185 Modified Files: basic_mapping.xml Log Message: added some mods made in latest cvs commits. Index: basic_mapping.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/basic_mapping.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** basic_mapping.xml 6 Apr 2005 18:25:27 -0000 1.12 --- basic_mapping.xml 4 May 2005 03:13:17 -0000 1.13 *************** *** 32,38 **** <programlisting><![CDATA[ <?xml version="1.0" ?> ! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="Eg.Cat, Eg" table="CATS" discriminator-value="C"> <id name="Id" column="uid" type="Int64"> <generator class="hilo"/> --- 32,39 ---- <programlisting><![CDATA[ <?xml version="1.0" ?> ! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" ! namespace="Eg" assembly="Eg"> ! <class name="Cat" table="CATS" discriminator-value="C"> <id name="Id" column="uid" type="Int64"> <generator class="hilo"/> *************** *** 46,57 **** <set name="Kittens"> <key column="mother_id"/> ! <one-to-many class="Eg.Cat, Eg"/> </set> ! <subclass name="Eg.DomesticCat, Eg" discriminator-value="D"> <property name="Name" type="String"/> </subclass> </class> ! <class name="Eg.Dog, Eg"> <!-- mapping for Dog could go here --> </class> --- 47,58 ---- <set name="Kittens"> <key column="mother_id"/> ! <one-to-many class="Cat"/> </set> ! <subclass name="DomesticCat" discriminator-value="D"> <property name="Name" type="String"/> </subclass> </class> ! <class name="Dog"> <!-- mapping for Dog could go here --> </class> *************** *** 104,107 **** --- 105,110 ---- auto-import="true|false" <co id="hm3-co" linkends="hm3" /> default-access="property|field|nosetter|ClassName" <co id="hm4-co" linkends="hm4" /> + assembly="assembly.name" <co id="hm5-co" linkends="hm5" /> + namespace="namespace.name" <co id="hm6-co" linkends="hm6" /> > </programlisting> <calloutlist> *************** *** 111,115 **** </para> </callout> - <callout arearefs="hm2-co" id="hm2"> <para> --- 114,117 ---- *************** *** 118,122 **** </para> </callout> - <callout arearefs="hm3-co" id="hm3"> <para> --- 120,123 ---- *************** *** 132,136 **** </para> </callout> ! </calloutlist> --- 133,149 ---- </para> </callout> ! <callout arearefs="hm5-co" id="hm5"> ! <para> ! <literal>assembly</literal> (optional): ! Specifies an Assembly to assume for any class names that don't have the ! Assembly specified. ! </para> ! </callout> ! <callout arearefs="hm6-co" id="hm6"> ! <para> ! <literal>namespace</literal> (optional): Specifies a namespace prefix ! to assume for unqualified class names in the mapping document. ! </para> ! </callout> </calloutlist> *************** *** 163,166 **** --- 176,180 ---- where="arbitrary sql where condition"<co id="class10-co" linkends="class10" /> persister="PersisterClass"<co id="class11-co" linkends="class11" /> + lazy="true|false"<co id="class12-co" linkends="class12" /> /></programlisting> <calloutlist> *************** *** 231,235 **** <literal>persister</literal> (optional): Specifies a custom <literal>IClassPersister</literal>. </para> ! </callout> </calloutlist> --- 245,256 ---- <literal>persister</literal> (optional): Specifies a custom <literal>IClassPersister</literal>. </para> ! </callout> ! <callout arearefs="class12-co" id="class12"> ! <para> ! <literal>lazy</literal>(optional): Setting <literal>lazy="true"</literal> is a shortcut ! equalivalent to specifying the name of the class itself as the <literal>proxy</literal> ! interface. ! </para> ! </callout> </calloutlist> |
From: Michael D. <mik...@us...> - 2005-05-03 14:56:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23265/NHibernate/Type Modified Files: PersistentEnumType.cs Log Message: updated with fix of NH-239. NH now correctly infers PersistentEnumTypes and can use it in a ctor for a query result. Index: PersistentEnumType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentEnumType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PersistentEnumType.cs 30 Mar 2005 16:08:40 -0000 1.10 --- PersistentEnumType.cs 3 May 2005 14:56:06 -0000 1.11 *************** *** 140,144 **** public override System.Type ReturnedClass { ! get { return enumClass.GetType(); } } --- 140,144 ---- public override System.Type ReturnedClass { ! get { return enumClass; } } |
From: Michael D. <mik...@us...> - 2005-05-03 14:56:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23265/NHibernate.Test Modified Files: FooBarTest.cs Log Message: updated with fix of NH-239. NH now correctly infers PersistentEnumTypes and can use it in a ctor for a query result. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** FooBarTest.cs 30 Apr 2005 21:40:36 -0000 1.94 --- FooBarTest.cs 3 May 2005 14:56:06 -0000 1.95 *************** *** 3887,3890 **** --- 3887,3897 ---- s.Close(); + // verify an enum can be in the ctor + s = sessions.OpenSession(); + IList list = s.Find("select new Result(foo.String, foo.Long, foo.Integer, foo.Status) from foo in class Foo" ); + Assert.AreEqual( 1, list.Count, "Should have found foo" ); + Assert.AreEqual( FooStatus.ON, ((Result)list[0]).Status, "verifying enum set in ctor - should have been ON" ); + s.Close(); + s = sessions.OpenSession(); foo = (FooProxy)s.Load( typeof(Foo), id ); |
From: Michael D. <mik...@us...> - 2005-05-03 14:56:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23265/NHibernate.DomainModel Modified Files: FooBar.hbm.xml Result.cs Log Message: updated with fix of NH-239. NH now correctly infers PersistentEnumTypes and can use it in a ctor for a query result. Index: Result.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Result.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Result.cs 2 Jul 2004 19:39:29 -0000 1.2 --- Result.cs 3 May 2005 14:56:05 -0000 1.3 *************** *** 11,15 **** private long _amount; private int _count; ! public Result(string name, long amount, int count) { --- 11,17 ---- private long _amount; private int _count; ! ! private FooStatus _status; ! public Result(string name, long amount, int count) { *************** *** 18,21 **** --- 20,30 ---- _count = count; } + + // added this ctor to test Enums in ctor for query results + public Result(string name, long amount, int count, FooStatus status) + : this(name, amount, count) + { + _status = status; + } public string Name *************** *** 37,40 **** --- 46,57 ---- } + public FooStatus Status + { + get { return _status; } + set { _status = value; } + } + + + } } Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** FooBar.hbm.xml 24 Apr 2005 19:37:56 -0000 1.23 --- FooBar.hbm.xml 3 May 2005 14:56:05 -0000 1.24 *************** *** 66,70 **** <property name="YesNo" type="yes_no"/> ! <property name="Status" column="`status_@###`" type="NHibernate.DomainModel.FooStatus, NHibernate.DomainModel"/> <property name="Locale" column="`localeayzabc123!@#$`" access="field.camelcase-underscore" type="locale"/> --- 66,70 ---- <property name="YesNo" type="yes_no"/> ! <property name="Status" column="`status_@###`" /><!--type="NHibernate.DomainModel.FooStatus, NHibernate.DomainModel" --> <property name="Locale" column="`localeayzabc123!@#$`" access="field.camelcase-underscore" type="locale"/> |
From: Michael D. <mik...@us...> - 2005-05-03 14:53:43
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22429 Modified Files: releasenotes.txt Log Message: updated with fix of NH-239 Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** releasenotes.txt 15 Apr 2005 10:22:56 -0000 1.31 --- releasenotes.txt 3 May 2005 14:53:31 -0000 1.32 *************** *** 6,20 **** - Added ability to set INamingStrategy on Configuration class. - Added property-ref attribute on many-to-one and one-to-one elements. ! - Added foreign-key attribute on many-to-one and one-to-one elements. - Added check attribute to column element. - Added sql-query element. - Fixed one-to-one so that two queries are no longer issued when one side is null. - Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) - Modified discriminator element to use "null" or "not null" as the value. - Modified Dialect to use Hibernate 2.1 methods. - - Added "unsaved-value" to version/timestamp as DateTime can't support null, use 1/1/0001 to align with .NET default value for DateTime - - Added SaveOrUpdateCopy which allows synchronisation for detached objects - - Added "foreign-key" attribute to many-to-one, one-to-one, many-to-many, key allowing a different column to be the foreign key target - - Improved memory consumption of Configuration, smaller footprint and releases objects faster. Build 0.7.0.0 --- 6,21 ---- - Added ability to set INamingStrategy on Configuration class. - Added property-ref attribute on many-to-one and one-to-one elements. ! - Added "foreign-key" attribute to many-to-one, one-to-one, many-to-many, key allowing a different column to be the foreign key target - Added check attribute to column element. - Added sql-query element. + - Added "unsaved-value" to version/timestamp as DateTime can't support null, use 1/1/0001 to align with .NET default value for DateTime + - Added SaveOrUpdateCopy which allows synchronisation for detached objects - Fixed one-to-one so that two queries are no longer issued when one side is null. - Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) + - Fixed bug with select new ClassName where one parameter was an Enum. (Luca Altea) + - Fixed bug in mapping that required type="full name of enum" to be required instead of NH correctly inferring type. (Luca Altea) + - Improved memory consumption of Configuration, smaller footprint and releases objects faster. - Modified discriminator element to use "null" or "not null" as the value. - Modified Dialect to use Hibernate 2.1 methods. Build 0.7.0.0 |
From: Michael D. <mik...@us...> - 2005-05-03 14:33:55
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17909 Modified Files: doc.build Log Message: updated to use nant-0.85 features that help clean up the build. Index: doc.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/doc.build,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** doc.build 28 Mar 2005 05:08:04 -0000 1.6 --- doc.build 3 May 2005 14:33:45 -0000 1.7 *************** *** 3,7 **** name="doc" default="build" ! xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" > <!-- --- 3,7 ---- name="doc" default="build" ! xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" > <!-- *************** *** 13,16 **** --- 13,19 ---- I have not figured out a way to modify the Path through NAnt so you need to make sure that xsltproc is in the path. + + 2005-05-03: probably is doable with nant-0.85 but I'm not going to mess with + it since the easy solution is put xsltproc in the path. --> *************** *** 30,63 **** <property name="build.html.dir" value="${output.dir}/html" /> ! ! <mkdir dir="${build.html.dir}" failonerror="false" /> ! <mkdir dir="${build.html.dir}/single" failonerror="false" /> ! <mkdir dir="${build.html.dir}/chunk" failonerror="false" /> ! <mkdir dir="${build.html.dir}/styles" failonerror="false" /> ! <mkdir dir="${build.html.dir}/images" failonerror="false" /> ! <!-- ! When using property elements that contain paths to files they ! unfortunately can't just be passed to the command line. I haven't ! figured out how to get the nant path seperator of "/" to be translated ! windows path seperator of "\". So we just have to use the long form. ! --> ! <exec program="xsltproc"> <arg value="--output" /> ! <arg value="build\${lang}\html\single\reference.html" /> <!-- file to output transform results to --> ! <arg value="${lang}\styles\html.xsl" /> <!-- xsl to do the transforming --> ! <arg value="${lang}\master.xml" /> <!-- xml file to transform --> </exec> ! <exec program="xsltproc"> <arg value="--output" /> ! <arg value="build\${lang}\html\chunk\" /> <!-- dir to output transform results to --> ! <arg value="${lang}\styles\html_chunk.xsl" /> <!-- xsl to do the transforming --> ! <arg value="${lang}\master.xml" /> <!-- xml file to transform --> </exec> <copy todir="${build.html.dir}"> <fileset basedir="${lang}"> ! <includes name="styles/html.css" /> ! <includes name="images/**.*" /> </fileset> </copy> --- 33,65 ---- <property name="build.html.dir" value="${output.dir}/html" /> ! <property name="build.single.dir" value="${build.html.dir}/single" /> ! <property name="build.chunk.dir" value="${build.html.dir}/chunk" /> ! <property name="build.styles.dir" value="${build.html.dir}/styles" /> ! <property name="build.images.dir" value="${build.html.dir}/images" /> ! <mkdir dir="${build.html.dir}" failonerror="false" /> ! <mkdir dir="${build.single.dir}" failonerror="false" /> ! <mkdir dir="${build.chunk.dir}" failonerror="false" /> ! <mkdir dir="${build.styles.dir}" failonerror="false" /> ! <mkdir dir="${build.images.dir}" failonerror="false" /> ! ! <exec program="xsltproc" > <arg value="--output" /> ! <arg file="${build.single.dir}/reference.html" /><!-- file to output transform results to --> ! <arg file="${lang}/styles/html.xsl" /><!-- xsl to do the transforming --> ! <arg file="${lang}/master.xml" /><!-- xml file to transform --> </exec> ! ! <exec program="xsltproc" > <arg value="--output" /> ! <arg path="${build.chunk.dir}/" /><!-- dir to output transform results to (add the trailing '/' for xsltproc) --> ! <arg file="${lang}/styles/html_chunk.xsl" /><!-- xsl to do the transforming --> ! <arg file="${lang}/master.xml" /><!-- xml file to transform --> </exec> <copy todir="${build.html.dir}"> <fileset basedir="${lang}"> ! <include name="styles/html.css" /> ! <include name="images/**.*" /> </fileset> </copy> *************** *** 76,82 **** <exec program="xsltproc"> <arg value="--output" /> ! <arg value="build\${lang}\chm\" /> <!-- dir to output transform results to --> ! <arg value="${lang}\styles\htmlhelp.xsl" /> <!-- xsl to do the transforming --> ! <arg value="${lang}\master.xml" /> <!-- xml file to transform --> </exec> --- 78,84 ---- <exec program="xsltproc"> <arg value="--output" /> ! <arg path="${build.chm.dir}/" /><!-- dir to output transform results to (add the trailing '/' for xsltproc) --> ! <arg file="${lang}/styles/htmlhelp.xsl" /> <!-- xsl to do the transforming --> ! <arg file="${lang}/master.xml" /> <!-- xml file to transform --> </exec> *************** *** 87,103 **** <copy todir="${build.chm.dir}" flatten="true"> <fileset basedir="${lang}"> ! <includes name="styles/*.css" /> ! <includes name="images/**.*" /> </fileset> </copy> <exec program="${hhc.exe}"> ! <arg value="build\${lang}\chm\htmlhelp.hhp" /> </exec> <delete> <fileset basedir="${build.chm.dir}"> ! <includes name="*" /> ! <excludes name="*.chm" /> </fileset> </delete> --- 89,105 ---- <copy todir="${build.chm.dir}" flatten="true"> <fileset basedir="${lang}"> ! <include name="styles/*.css" /> ! <include name="images/**.*" /> </fileset> </copy> <exec program="${hhc.exe}"> ! <arg file="${build.chm.dir}/htmlhelp.hhp" /> </exec> <delete> <fileset basedir="${build.chm.dir}"> ! <include name="*" /> ! <exclude name="*.chm" /> </fileset> </delete> *************** *** 108,112 **** <move todir="${build.dir}/doc/help"> <fileset basedir="${output.dir}"> ! <includes name="**/*" /> </fileset> </move> --- 110,114 ---- <move todir="${build.dir}/doc/help"> <fileset basedir="${output.dir}"> ! <include name="**/*" /> </fileset> </move> |
From: Sergey K. <jus...@us...> - 2005-04-30 21:40:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14885/src/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Added a few more tests, corrected <version> in One and Many to fix failing tests. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** FooBarTest.cs 29 Apr 2005 15:33:53 -0000 1.93 --- FooBarTest.cs 30 Apr 2005 21:40:36 -0000 1.94 *************** *** 754,773 **** [Test] - [Ignore("Test not written")] public void CascadeDeleteDetached() { } [Test] - [Ignore("Test not written")] public void ForeignKeys() { } [Test] ! [Ignore("Test not written yet.")] public void Databinder() { } --- 754,899 ---- [Test] public void CascadeDeleteDetached() { + Baz baz; + + using( ISession s = sessions.OpenSession() ) + { + baz = new Baz(); + IList list = new ArrayList(); + list.Add( new Fee() ); + baz.Fees = list; + s.Save( baz ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + baz = (Baz) s.Get( typeof( Baz ), baz.Code ); + } + + Assert.IsFalse( NHibernateUtil.IsInitialized( baz.Fees ) ); + + using( ISession s = sessions.OpenSession() ) + { + s.Delete( baz ); + s.Flush(); + + Assert.IsFalse( s.Enumerable( "from Fee" ).GetEnumerator().MoveNext() ); + } + + using( ISession s = sessions.OpenSession() ) + { + baz = new Baz(); + IList list = new ArrayList(); + list.Add( new Fee() ); + list.Add( new Fee() ); + baz.Fees = list; + s.Save( baz ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + baz = (Baz) s.Get( typeof( Baz ), baz.Code ); + NHibernateUtil.Initialize( baz.Fees ); + } + + Assert.AreEqual( 2, baz.Fees.Count ); + + using( ISession s = sessions.OpenSession() ) + { + s.Delete( baz ); + s.Flush(); + Assert.IsFalse( s.Enumerable( "from Fee" ).GetEnumerator().MoveNext() ); + } } [Test] public void ForeignKeys() { + Baz baz; + using( ISession s = sessions.OpenSession() ) + { + baz = new Baz(); + Foo foo = new Foo(); + IList bag = new ArrayList(); + bag.Add( foo ); + baz.IdFooBag = bag; + baz.Foo = foo; + s.Save( baz ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + baz = (Baz) s.Load( typeof( Baz ), baz.Code ); + s.Delete( baz ); + s.Flush(); + } } [Test] ! [Ignore("IDatabinder not implemented yet")] public void Databinder() { + BarProxy bar; + FooProxy foo, foo2; + Baz baz; + + using( ISession s = sessions.OpenSession() ) + { + bar = new Bar(); + s.Save( bar ); + + foo = new Foo(); + s.Save( foo ); + + foo2 = new Foo(); + s.Save( foo2 ); + foo2.TheFoo = foo; + + baz = new Baz(); + s.Save( baz ); + baz.SetDefaults(); + baz.FooArray = new FooProxy[] { foo, foo2, bar, null }; + bar.TheFoo = foo; + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + bar = (BarProxy) s.Load( typeof( Foo ), bar.Key ); + foo = (FooProxy) s.Load( typeof( Foo ), foo.Key ); + foo2 = (FooProxy) s.Load( typeof( Foo ), foo2.Key ); + baz = (Baz) s.Load( typeof( Baz ), baz.Code ); + + IDatabinder binder = sessions.OpenDatabinder(); + binder.InitializeLazy = true; + binder + .Bind( foo2 ) + .Bind( baz ) + .Bind( foo ) + .Bind( bar ); + + Console.WriteLine( binder.ToGenericXml() ); + + binder + .Bind( foo2 ) + .Bind( baz ); + + Console.WriteLine( binder.ToXML() ); + + //assertTrue( "dom", binder.toDOM()!=null ); + //assertTrue( "generic dom", binder.toGenericDOM()!=null ); + + s.Delete( foo ); + s.Delete( baz ); + s.Delete( bar ); + s.Delete( foo2 ); + + s.Flush(); + } } *************** *** 805,811 **** [Test] - [Ignore("Test not written yet.")] public void ReuseDeletedCollection() { } --- 931,970 ---- [Test] public void ReuseDeletedCollection() { + Baz baz, baz2; + + using( ISession s = sessions.OpenSession() ) + { + baz = new Baz(); + baz.SetDefaults(); + s.Save( baz ); + s.Flush(); + s.Delete(baz); + + baz2 = new Baz(); + baz2.StringArray = new string[] { "x-y-z" }; + s.Save( baz2 ); + s.Flush(); + } + + baz2.StringSet = baz.StringSet; + baz2.StringArray = baz.StringArray; + baz2.FooArray = baz.FooArray; + + using( ISession s = sessions.OpenSession() ) + { + s.Update( baz2 ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + baz2 = (Baz) s.Load( typeof( Baz ), baz2.Code ); + Assert.AreEqual( 3, baz2.StringArray.Length ); + Assert.AreEqual( 3, baz2.StringSet.Count ); + s.Delete( baz2 ); + s.Flush(); + } } *************** *** 905,911 **** [Test] ! [Ignore("Test not written yet.")] public void BatchLoad() { } --- 1064,1156 ---- [Test] ! [Ignore("Batch loading not implemented")] public void BatchLoad() { + Baz baz, baz2, baz3; + + using( ISession s = sessions.OpenSession() ) + { + baz = new Baz(); + Iesi.Collections.SortedSet stringSet = new Iesi.Collections.SortedSet(); + stringSet.Add("foo"); + stringSet.Add("bar"); + Iesi.Collections.ISet fooSet = new Iesi.Collections.HashedSet(); + + for( int i = 0; i < 3; i++ ) + { + Foo foo = new Foo(); + s.Save( foo ); + fooSet.Add( foo ); + } + + baz.FooSet = fooSet; + baz.StringSet = stringSet; + s.Save( baz ); + + baz2 = new Baz(); + fooSet = new Iesi.Collections.HashedSet(); + for( int i = 0; i < 2; i++ ) + { + Foo foo = new Foo(); + s.Save( foo ); + fooSet.Add( foo ); + } + baz2.FooSet = fooSet; + s.Save( baz2 ); + + baz3 = new Baz(); + stringSet = new Iesi.Collections.SortedSet(); + stringSet.Add( "foo" ); + stringSet.Add( "baz" ); + baz3.StringSet = stringSet; + s.Save( baz3 ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + baz = (Baz) s.Load( typeof( Baz ), baz.Code ); + baz2 = (Baz) s.Load( typeof( Baz ), baz2.Code ); + baz3 = (Baz) s.Load( typeof( Baz ), baz3.Code ); + + Assert.IsFalse( NHibernateUtil.IsInitialized( baz.FooSet ) ); + Assert.IsFalse( NHibernateUtil.IsInitialized( baz2.FooSet ) ); + Assert.IsFalse( NHibernateUtil.IsInitialized( baz3.FooSet ) ); + + Assert.IsFalse( NHibernateUtil.IsInitialized( baz.StringSet ) ); + Assert.IsFalse( NHibernateUtil.IsInitialized( baz2.StringSet ) ); + Assert.IsFalse( NHibernateUtil.IsInitialized( baz3.StringSet ) ); + + Assert.AreEqual( 3, baz.FooSet.Count ); + + Assert.IsTrue( NHibernateUtil.IsInitialized( baz.FooSet ) ); + Assert.IsTrue( NHibernateUtil.IsInitialized( baz2.FooSet ) ); + Assert.IsTrue( NHibernateUtil.IsInitialized( baz3.FooSet ) ); + + Assert.AreEqual( 2, baz2.FooSet.Count ); + + Assert.IsTrue( baz3.StringSet.Contains( "baz" ) ); + + Assert.IsTrue( NHibernateUtil.IsInitialized( baz.StringSet ) ); + Assert.IsTrue( NHibernateUtil.IsInitialized( baz2.StringSet ) ); + Assert.IsTrue( NHibernateUtil.IsInitialized( baz3.StringSet ) ); + + Assert.AreEqual( 2, baz.StringSet.Count ); + Assert.AreEqual( 0, baz2.StringSet.Count ); + + s.Delete( baz ); + s.Delete( baz2 ); + s.Delete( baz3 ); + + IEnumerable en = new Util.JoinedEnumerable( + new IEnumerable[] { baz.FooSet, baz2.FooSet } ); + + foreach( object obj in en ) + { + s.Delete( obj ); + } + + s.Flush(); + } } *************** *** 943,949 **** [Test] - [Ignore("Test not written yet.")] public void LateCollectionAdd() { } --- 1188,1222 ---- [Test] public void LateCollectionAdd() { + object id; + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = new Baz(); + IList l = new ArrayList(); + baz.StringList = l; + + l.Add( "foo" ); + id = s.Save( baz ); + + l.Add( "bar" ); + s.Flush(); + + l.Add("baz"); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = (Baz) s.Load( typeof( Baz ), id ); + Assert.AreEqual( 3, baz.StringList.Count ); + Assert.IsTrue( baz.StringList.Contains( "foo" ) ); + Assert.IsTrue( baz.StringList.Contains( "bar" ) ); + Assert.IsTrue( baz.StringList.Contains( "baz" ) ); + + s.Delete( baz ); + s.Flush(); + } } *************** *** 978,990 **** [Test] - [Ignore("Test not written yet.")] public void ListRemove() { } [Test] - [Ignore("Test not written yet.")] public void FetchInitializedCollectionDupe() { } --- 1251,1327 ---- [Test] public void ListRemove() { + using( ISession s = sessions.OpenSession() ) + { + Baz b = new Baz(); + IList stringList = new ArrayList(); + IList feeList = new ArrayList(); + b.Fees = feeList; + b.StringList = stringList; + feeList.Add( new Fee() ); + feeList.Add( new Fee() ); + feeList.Add( new Fee() ); + feeList.Add( new Fee() ); + stringList.Add( "foo" ); + stringList.Add( "bar" ); + stringList.Add( "baz" ); + stringList.Add( "glarch" ); + s.Save( b ); + s.Flush(); + + stringList.RemoveAt( 1 ); + feeList.RemoveAt( 1 ); + s.Flush(); + + s.Evict( b ); + s.Refresh( b ); + Assert.AreEqual( 3, b.Fees.Count ); + stringList = b.StringList; + Assert.AreEqual( 3, stringList.Count ); + Assert.AreEqual( "baz", stringList[1] ); + Assert.AreEqual( "foo", stringList[0] ); + + s.Delete( b ); + s.Delete( "from Fee" ); + s.Flush(); + } } [Test] public void FetchInitializedCollectionDupe() { + string bazCode; + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = new Baz(); + IList fooBag = new ArrayList(); + fooBag.Add( new Foo() ); + fooBag.Add( new Foo() ); + baz.FooBag = fooBag; + s.Save( baz ); + s.Flush(); + fooBag = baz.FooBag; + s.Find("from Baz baz left join fetch baz.FooBag"); + Assert.IsTrue( NHibernateUtil.IsInitialized( fooBag ) ); + Assert.AreSame( fooBag, baz.FooBag ); + Assert.AreEqual( 2, baz.FooBag.Count ); + + bazCode = baz.Code; + } + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = (Baz) s.Load( typeof( Baz ), bazCode ); + object bag = baz.FooBag; + Assert.IsFalse( NHibernateUtil.IsInitialized( bag ) ); + s.Find("from Baz baz left join fetch baz.FooBag"); + Assert.IsTrue( NHibernateUtil.IsInitialized( bag ) ); + Assert.AreSame( bag, baz.FooBag ); + Assert.AreEqual( 2, baz.FooBag.Count ); + s.Delete( baz ); + s.Flush(); + } } *************** *** 1530,1538 **** } [Test] ! [Ignore("Test not written yet.")] ! public void VerifyParameter() { } --- 1867,1921 ---- } + [Test, ExpectedException( typeof( QueryException ) )] + public void VerifyParameterNamedMissing() + { + using( ISession s = sessions.OpenSession() ) + { + IQuery q = s.CreateQuery("select bar from Bar as bar where bar.X > :myX"); + q.List(); + } + } + + [Test, ExpectedException( typeof( QueryException ) )] + public void VerifyParameterPositionalMissing() + { + using( ISession s = sessions.OpenSession() ) + { + IQuery q = s.CreateQuery("select bar from Bar as bar where bar.X > ?"); + q.List(); + } + } [Test] ! public void VerifyParameterPositionalInQuotes() { + using( ISession s = sessions.OpenSession() ) + { + IQuery q = s.CreateQuery("select bar from Bar as bar where bar.X > ? or bar.Short = 1 or bar.String = 'ff ? bb'"); + q.SetInt32(0, 1); + q.List(); + } + } + + [Test] + public void VerifyParameterPositionalInQuotes2() + { + using( ISession s = sessions.OpenSession() ) + { + IQuery q = s.CreateQuery("select bar from Bar as bar where bar.String = ' ? ' or bar.String = '?'"); + q.List(); + } + } + + [Test, ExpectedException( typeof( QueryException ) )] + public void VerifyParameterPositionalMissing2() + { + using( ISession s = sessions.OpenSession() ) + { + IQuery q = s.CreateQuery("select bar from Bar as bar where bar.String = ? or bar.String = ? or bar.String = ?"); + q.SetParameter( 0, "bull" ); + q.SetParameter( 2, "shit" ); + q.List(); + } } *************** *** 2636,2644 **** IList list2 = s.Find( "from foo in class NHibernate.DomainModel.Foo order by foo.String, foo.Date" ); Assert.AreEqual( 4, list2.Count, "find size" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where typeof( Foo )='B'" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where typeof( Foo )=NHibernate.DomainModel.Bar" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where typeof( Foo )=Bar" ); list2 = s.Find( "select bar from bar in class NHibernate.DomainModel.Bar, foo in class NHibernate.DomainModel.Foo where bar.String = foo.String and not bar=foo" ); --- 3019,3027 ---- IList list2 = s.Find( "from foo in class NHibernate.DomainModel.Foo order by foo.String, foo.Date" ); Assert.AreEqual( 4, list2.Count, "find size" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.class='B'" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.class=NHibernate.DomainModel.Bar" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.class=Bar" ); list2 = s.Find( "select bar from bar in class NHibernate.DomainModel.Bar, foo in class NHibernate.DomainModel.Foo where bar.String = foo.String and not bar=foo" ); *************** *** 4516,4520 **** [Test] ! [Ignore("Test not written yet.")] public void Service() { --- 4899,4903 ---- [Test] ! [Ignore("Not applicable to NHibernate?")] public void Service() { *************** *** 4522,4528 **** [Test] - [Ignore("Test not written yet.")] public void PSCache() { } --- 4905,4945 ---- [Test] public void PSCache() { + using( ISession s = sessions.OpenSession() ) + { + for( int i = 0; i < 10; i++ ) s.Save( new Foo() ); + + IQuery q = s.CreateQuery( "from f in class Foo" ); + q.SetMaxResults( 2 ); + q.SetFirstResult( 5 ); + + Assert.AreEqual( 2, q.List().Count ); + + q = s.CreateQuery( "from f in class Foo" ); + + Assert.AreEqual( 10, q.List().Count ); + Assert.AreEqual( 10, q.List().Count ); + + q.SetMaxResults( 3 ); + q.SetFirstResult( 3 ); + + Assert.AreEqual( 3, q.List().Count ); + + q = s.CreateQuery( "from f in class Foo" ); + Assert.AreEqual( 10, q.List().Count ); + } + + using( ISession s = sessions.OpenSession() ) + { + IQuery q = s.CreateQuery( "from f in class Foo" ); + Assert.AreEqual( 10, q.List().Count ); + + q.SetMaxResults(5); + Assert.AreEqual( 5, q.List().Count ); + + s.Delete( "from f in class Foo" ); + s.Flush(); + } } |
From: Sergey K. <jus...@us...> - 2005-04-30 21:40:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14885/src/NHibernate.DomainModel Modified Files: Many.cs Many.hbm.xml One.cs One.hbm.xml Log Message: Added a few more tests, corrected <version> in One and Many to fix failing tests. Index: One.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/One.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** One.cs 29 Apr 2005 15:33:53 -0000 1.3 --- One.cs 30 Apr 2005 21:40:35 -0000 1.4 *************** *** 14,18 **** private Iesi.Collections.ISet _manies; private int _x; ! private int _v; public long Key --- 14,18 ---- private Iesi.Collections.ISet _manies; private int _x; ! private int _v = -1; public long Key Index: One.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/One.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** One.hbm.xml 29 Apr 2005 15:33:53 -0000 1.5 --- One.hbm.xml 30 Apr 2005 21:40:35 -0000 1.6 *************** *** 12,16 **** <generator class="native" /> </id> ! <version name="V" /> <property name="X" /> <property --- 12,16 ---- <generator class="native" /> </id> ! <version name="V" unsaved-value="-1" /> <property name="X" /> <property Index: Many.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Many.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Many.cs 29 Apr 2005 15:33:53 -0000 1.2 --- Many.cs 30 Apr 2005 21:40:35 -0000 1.3 *************** *** 11,15 **** private One _one; private int _x; ! private int _v; public long Key --- 11,15 ---- private One _one; private int _x; ! private int _v = -1; public long Key Index: Many.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Many.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Many.hbm.xml 29 Apr 2005 15:33:53 -0000 1.5 --- Many.hbm.xml 30 Apr 2005 21:40:35 -0000 1.6 *************** *** 12,16 **** <generator class="native" /> </id> ! <version name="V" /> <property name="X" /> <many-to-one --- 12,16 ---- <generator class="native" /> </id> ! <version name="V" unsaved-value="-1" /> <property name="X" /> <many-to-one |
From: Sergey K. <jus...@us...> - 2005-04-29 15:34:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10169/src/NHibernate.Test Modified Files: FooBarTest.cs Log Message: More tests ported Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** FooBarTest.cs 24 Apr 2005 19:37:56 -0000 1.92 --- FooBarTest.cs 29 Apr 2005 15:33:53 -0000 1.93 *************** *** 13,16 **** --- 13,22 ---- public class FooBarTest : TestCase { + // Equivalent of Java String.getBytes() + private static byte[] GetBytes( string str ) + { + return System.Text.Encoding.Unicode.GetBytes( str ); + } + [SetUp] public void SetUp() *************** *** 41,80 **** [Test] - [Ignore("Test not written")] public void CollectionVersioning() { } [Test] - [Ignore("Test not written")] public void ForCertain() { } [Test] - [Ignore("Test not written")] public void BagMultipleElements() { } [Test] - [Ignore("Test not written")] public void WierdSession() { } [Test] - [Ignore("Test not written")] public void DereferenceLazyCollection() { } [Test] - [Ignore("Test not written")] public void MoveLazyCollection() { } [Test] ! [Ignore("Test not written")] public void CriteriaCollection() { --- 47,332 ---- [Test] public void CollectionVersioning() { + using( ISession s = sessions.OpenSession() ) + { + One one = new One(); + one.Manies = new Iesi.Collections.HashedSet(); + s.Save(one); + s.Flush(); + + Many many = new Many(); + many.One = one; + one.Manies.Add( many ); + s.Save( many ); + s.Flush(); + + Assert.AreEqual( 0, many.V ); + Assert.AreEqual( 1, one.V ); + + s.Delete( many ); + s.Delete( one ); + s.Flush(); + } } [Test] public void ForCertain() { + Glarch g = new Glarch(); + Glarch g2 = new Glarch(); + IList strings = new ArrayList(); + strings.Add( "foo" ); + g2.Strings = strings; + + object gid, g2id; + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + gid = s.Save( g ); + g2id = s.Save( g2 ); + t.Commit(); + + Assert.AreEqual( 0, g.Version ); + Assert.AreEqual( 0, g2.Version ); + } + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + g = (Glarch) s.Get( typeof( Glarch ), gid ); + g2 = (Glarch) s.Get( typeof( Glarch ), g2id ); + Assert.AreEqual( 1, g2.Strings.Count ); + + s.Delete( g ); + s.Delete( g2 ); + t.Commit(); + } } [Test] public void BagMultipleElements() { + string bazCode; + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + Baz baz = new Baz(); + baz.Bag = new ArrayList(); + baz.ByteBag = new ArrayList(); + s.Save( baz ); + baz.Bag.Add( "foo" ); + baz.Bag.Add( "bar" ); + baz.ByteBag.Add( GetBytes( "foo" ) ); + baz.ByteBag.Add( GetBytes( "bar" ) ); + t.Commit(); + + bazCode = baz.Code; + } + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + //put in cache + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Assert.AreEqual( 2, baz.Bag.Count ); + Assert.AreEqual( 2, baz.ByteBag.Count ); + t.Commit(); + } + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Assert.AreEqual( 2, baz.Bag.Count ); + Assert.AreEqual( 2, baz.ByteBag.Count ); + + baz.Bag.Remove( "bar" ); + baz.Bag.Add( "foo" ); + baz.ByteBag.Add( GetBytes( "bar" ) ); + t.Commit(); + } + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Assert.AreEqual( 2, baz.Bag.Count ); + Assert.AreEqual( 3, baz.ByteBag.Count ); + s.Delete(baz); + t.Commit(); + } } + [Test] public void WierdSession() { + object id; + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + id = s.Save( new Foo() ); + t.Commit(); + } + + using( ISession s = sessions.OpenSession() ) + { + s.FlushMode = FlushMode.Never; + using( ITransaction t = s.BeginTransaction() ) + { + Foo foo = (Foo) s.Get(typeof( Foo ), id); + t.Commit(); + } + + s.Disconnect(); + s.Reconnect(); + + using( ITransaction t = s.BeginTransaction() ) + { + s.Flush(); + t.Commit(); + } + } + + using( ISession s = sessions.OpenSession() ) + using( ITransaction t = s.BeginTransaction() ) + { + Foo foo = (Foo) s.Get( typeof( Foo ), id ); + s.Delete( foo ); + t.Commit(); + } } [Test] public void DereferenceLazyCollection() { + string fooKey; + string bazCode; + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = new Baz(); + baz.FooSet = new Iesi.Collections.HashedSet(); + Foo foo = new Foo(); + baz.FooSet.Add( foo ); + s.Save( foo ); + s.Save( baz ); + foo.Bytes = GetBytes( "foobar" ); + s.Flush(); + + fooKey = foo.Key; + bazCode = baz.Code; + } + + using( ISession s = sessions.OpenSession() ) + { + Foo foo = (Foo) s.Get( typeof( Foo ), fooKey ); + Assert.IsTrue( NHibernateUtil.IsInitialized( foo.Bytes ) ); + + // H2.1 has 6 here, but we are using Unicode + Assert.AreEqual( 12, foo.Bytes.Length ); + + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Assert.AreEqual( 1, baz.FooSet.Count ); + s.Flush(); + } + + sessions.EvictCollection("NHibernate.DomainModel.Baz.FooSet"); + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Assert.IsFalse( NHibernateUtil.IsInitialized( baz.FooSet ) ); + baz.FooSet = null; + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + Foo foo = (Foo) s.Get( typeof( Foo ), fooKey ); + Assert.AreEqual( 12, foo.Bytes.Length ); + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + + Assert.IsFalse( NHibernateUtil.IsInitialized( baz.FooSet ) ); + Assert.AreEqual( 0, baz.FooSet.Count ); + s.Delete( baz ); + s.Delete( foo ); + s.Flush(); + } } [Test] public void MoveLazyCollection() { + string fooKey, bazCode, baz2Code; + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = new Baz(); + Baz baz2 = new Baz(); + baz.FooSet = new Iesi.Collections.HashedSet(); + Foo foo = new Foo(); + baz.FooSet.Add( foo ); + s.Save( foo ); + s.Save( baz ); + s.Save( baz2 ); + foo.Bytes = GetBytes( "foobar" ); + s.Flush(); + + fooKey = foo.Key; + bazCode = baz.Code; + baz2Code = baz2.Code; + } + + using( ISession s = sessions.OpenSession() ) + { + Foo foo = (Foo) s.Get( typeof( Foo ), fooKey ); + Assert.IsTrue( NHibernateUtil.IsInitialized( foo.Bytes ) ); + Assert.AreEqual( 12, foo.Bytes.Length ); + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Assert.AreEqual( 1, baz.FooSet.Count ); + s.Flush(); + } + + sessions.EvictCollection("NHibernate.DomainModel.Baz.FooSet"); + + using( ISession s = sessions.OpenSession() ) + { + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Assert.IsFalse( NHibernateUtil.IsInitialized( baz.FooSet ) ); + Baz baz2 = (Baz) s.Get( typeof( Baz ), baz2Code ); + baz2.FooSet = baz.FooSet; + baz.FooSet = null; + Assert.IsFalse( NHibernateUtil.IsInitialized( baz2.FooSet ) ); + s.Flush(); + } + + using( ISession s = sessions.OpenSession() ) + { + Foo foo = (Foo) s.Get( typeof( Foo ), fooKey ); + Assert.AreEqual( 12, foo.Bytes.Length ); + Baz baz = (Baz) s.Get( typeof( Baz ), bazCode ); + Baz baz2 = (Baz) s.Get( typeof( Baz ), baz2Code ); + + Assert.IsFalse( NHibernateUtil.IsInitialized( baz.FooSet ) ); + Assert.AreEqual( 0, baz.FooSet.Count ); + + // TODO: batching doesn't work in NH yet + //Assert.IsTrue( NHibernateUtil.IsInitialized( baz2.FooSet ) ); //fooSet has batching enabled + + Assert.AreEqual( 1, baz2.FooSet.Count ); + + s.Delete( baz ); + s.Delete( baz2 ); + s.Delete( foo ); + s.Flush(); + } } [Test] ! [Ignore("Requires ICriteria.CreateCriteria")] public void CriteriaCollection() { *************** *** 961,974 **** l.Add( new Bar() ); ! System.Text.Encoding encoding = new System.Text.UnicodeEncoding(); ! ! byte[] bytes = encoding.GetBytes("ffo"); l2.Add(bytes); ! l2.Add( encoding.GetBytes("foo") ); s.Flush(); l.Add( new Foo() ); l.Add( new Bar() ); ! l2.Add( encoding.GetBytes("bar") ); s.Flush(); --- 1213,1224 ---- l.Add( new Bar() ); ! byte[] bytes = GetBytes( "ffo" ); l2.Add(bytes); ! l2.Add( GetBytes( "foo" ) ); s.Flush(); l.Add( new Foo() ); l.Add( new Bar() ); ! l2.Add( GetBytes( "bar" ) ); s.Flush(); *************** *** 985,989 **** Assert.AreEqual( 3, baz.IdFooBag.Count ); Assert.AreEqual( 3, baz.ByteBag.Count ); ! bytes = encoding.GetBytes("foobar"); foreach(object obj in baz.IdFooBag) --- 1235,1239 ---- Assert.AreEqual( 3, baz.IdFooBag.Count ); Assert.AreEqual( 3, baz.ByteBag.Count ); ! bytes = GetBytes( "foobar" ); foreach(object obj in baz.IdFooBag) *************** *** 2386,2394 **** IList list2 = s.Find( "from foo in class NHibernate.DomainModel.Foo order by foo.String, foo.Date" ); Assert.AreEqual( 4, list2.Count, "find size" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.class='B'" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.class=NHibernate.DomainModel.Bar" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.class=Bar" ); list2 = s.Find( "select bar from bar in class NHibernate.DomainModel.Bar, foo in class NHibernate.DomainModel.Foo where bar.String = foo.String and not bar=foo" ); --- 2636,2644 ---- IList list2 = s.Find( "from foo in class NHibernate.DomainModel.Foo order by foo.String, foo.Date" ); Assert.AreEqual( 4, list2.Count, "find size" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where typeof( Foo )='B'" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where typeof( Foo )=NHibernate.DomainModel.Bar" ); Assert.AreEqual( 2, list1.Count, "class special property" ); ! list1 = s.Find( "from foo in class NHibernate.DomainModel.Foo where typeof( Foo )=Bar" ); list2 = s.Find( "select bar from bar in class NHibernate.DomainModel.Bar, foo in class NHibernate.DomainModel.Foo where bar.String = foo.String and not bar=foo" ); *************** *** 3742,3746 **** ) { ! foo.Bytes = System.Text.UnicodeEncoding.Unicode.GetBytes("osama"); Assert.AreEqual( 1, s.Find("from foo in class NHibernate.DomainModel.Foo where 111 in foo.Bytes.elements").Count, "autoflush collection update" ); foo.Bytes[0] = 69; --- 3992,3996 ---- ) { ! foo.Bytes = GetBytes( "osama" ); Assert.AreEqual( 1, s.Find("from foo in class NHibernate.DomainModel.Foo where 111 in foo.Bytes.elements").Count, "autoflush collection update" ); foo.Bytes[0] = 69; |
From: Sergey K. <jus...@us...> - 2005-04-29 15:34:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10169/src/NHibernate.DomainModel Modified Files: Many.cs Many.hbm.xml One.cs One.hbm.xml Log Message: More tests ported Index: One.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/One.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** One.cs 18 Nov 2004 02:45:43 -0000 1.2 --- One.cs 29 Apr 2005 15:33:53 -0000 1.3 *************** *** 14,17 **** --- 14,18 ---- private Iesi.Collections.ISet _manies; private int _x; + private int _v; public long Key *************** *** 39,42 **** --- 40,48 ---- } + public int V + { + get { return _v; } + set { _v = value; } + } } } Index: One.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/One.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** One.hbm.xml 9 Jul 2004 19:22:11 -0000 1.4 --- One.hbm.xml 29 Apr 2005 15:33:53 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- <generator class="native" /> </id> + <version name="V" /> <property name="X" /> <property Index: Many.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Many.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Many.cs 3 Jun 2004 14:29:00 -0000 1.1 --- Many.cs 29 Apr 2005 15:33:53 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- private One _one; private int _x; + private int _v; public long Key *************** *** 30,33 **** --- 31,39 ---- } + public int V + { + get { return _v; } + set { _v = value; } + } } } Index: Many.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Many.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Many.hbm.xml 9 Jul 2004 19:22:11 -0000 1.4 --- Many.hbm.xml 29 Apr 2005 15:33:53 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- <generator class="native" /> </id> + <version name="V" /> <property name="X" /> <many-to-one |