You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael D. <mik...@us...> - 2005-01-17 03:41:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.Test/ProxyTest Modified Files: NHibernateProxyHelperFixture.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: NHibernateProxyHelperFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyTest/NHibernateProxyHelperFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHibernateProxyHelperFixture.cs 5 Jan 2005 02:44:19 -0000 1.1 --- NHibernateProxyHelperFixture.cs 17 Jan 2005 03:40:52 -0000 1.2 *************** *** 69,73 **** AProxy aProxied = (AProxy)s.Load( typeof(AProxy), a.Id ); ! Assert.IsFalse( NHibernate.IsInitialized( aProxied ), "should be a proxy" ); type = NHibernateProxyHelper.GetClass( aProxied ); --- 69,73 ---- AProxy aProxied = (AProxy)s.Load( typeof(AProxy), a.Id ); ! Assert.IsFalse( NHibernateUtil.IsInitialized( aProxied ), "should be a proxy" ); type = NHibernateProxyHelper.GetClass( aProxied ); |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.Test/SqlCommandTest Modified Files: SqlDeleteBuilderFixture.cs SqlInsertBuilderFixture.cs SqlSelectBuilderFixture.cs SqlSimpleSelectBuilderFixture.cs SqlUpdateBuilderFixture.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: SqlSimpleSelectBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlSimpleSelectBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlSimpleSelectBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 --- SqlSimpleSelectBuilderFixture.cs 17 Jan 2005 03:40:53 -0000 1.4 *************** *** 36,43 **** select.AddColumns(new string[]{"column1_with_alias", "column2_with_alias"}, new string[] {"c1_alias", "c2_alias"}); ! select.SetIdentityColumn(new string[]{"identity_column"}, NHibernate.Int64); ! select.SetVersionColumn(new string[]{"version_column"}, (IVersionType)NHibernate.Int32); ! select.AddWhereFragment(new string[]{"where_frag_column"}, NHibernate.Int32, " = "); SqlString sqlString = select.ToSqlString(); --- 36,43 ---- select.AddColumns(new string[]{"column1_with_alias", "column2_with_alias"}, new string[] {"c1_alias", "c2_alias"}); ! select.SetIdentityColumn(new string[]{"identity_column"}, NHibernateUtil.Int64); ! select.SetVersionColumn(new string[]{"version_column"}, (IVersionType)NHibernateUtil.Int32); ! select.AddWhereFragment(new string[]{"where_frag_column"}, NHibernateUtil.Int32, " = "); SqlString sqlString = select.ToSqlString(); Index: SqlUpdateBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlUpdateBuilderFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SqlUpdateBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 --- SqlUpdateBuilderFixture.cs 17 Jan 2005 03:40:53 -0000 1.5 *************** *** 30,40 **** update.SetTableName("test_update_builder"); ! update.AddColumns(new string[] {"intColumn"}, NHibernate.Int32); ! update.AddColumns(new string[] {"longColumn"}, NHibernate.Int64); ! update.AddColumn("literalColumn", false, (Type.ILiteralType) NHibernate.Boolean); update.AddColumn("stringColumn", 5.ToString()); ! update.SetIdentityColumn(new string[] {"decimalColumn"}, NHibernate.Decimal); ! update.SetVersionColumn(new string[] {"versionColumn"}, (IVersionType)NHibernate.Int32); update.AddWhereFragment("a=b"); --- 30,40 ---- update.SetTableName("test_update_builder"); ! update.AddColumns(new string[] {"intColumn"}, NHibernateUtil.Int32); ! update.AddColumns(new string[] {"longColumn"}, NHibernateUtil.Int64); ! update.AddColumn("literalColumn", false, (Type.ILiteralType) NHibernateUtil.Boolean); update.AddColumn("stringColumn", 5.ToString()); ! update.SetIdentityColumn(new string[] {"decimalColumn"}, NHibernateUtil.Decimal); ! update.SetVersionColumn(new string[] {"versionColumn"}, (IVersionType)NHibernateUtil.Int32); update.AddWhereFragment("a=b"); Index: SqlDeleteBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlDeleteBuilderFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SqlDeleteBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 --- SqlDeleteBuilderFixture.cs 17 Jan 2005 03:40:53 -0000 1.5 *************** *** 30,35 **** ! delete.SetIdentityColumn(new string[] {"decimalColumn"}, NHibernate.Decimal); ! delete.SetVersionColumn(new string[] {"versionColumn"}, (IVersionType)NHibernate.Int32); delete.AddWhereFragment("a=b"); --- 30,35 ---- ! delete.SetIdentityColumn(new string[] {"decimalColumn"}, NHibernateUtil.Decimal); ! delete.SetVersionColumn(new string[] {"versionColumn"}, (IVersionType)NHibernateUtil.Int32); delete.AddWhereFragment("a=b"); Index: SqlSelectBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlSelectBuilderFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SqlSelectBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 --- SqlSelectBuilderFixture.cs 17 Jan 2005 03:40:53 -0000 1.5 *************** *** 36,40 **** select.SetOrderByClause("column1 DESC"); ! select.SetWhereClause("select_test_alias", new string[] {"identity_column"}, NHibernate.Int64); SqlString sqlString = select.ToSqlString(); --- 36,40 ---- select.SetOrderByClause("column1 DESC"); ! select.SetWhereClause("select_test_alias", new string[] {"identity_column"}, NHibernateUtil.Int64); SqlString sqlString = select.ToSqlString(); Index: SqlInsertBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlInsertBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlInsertBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 --- SqlInsertBuilderFixture.cs 17 Jan 2005 03:40:53 -0000 1.4 *************** *** 29,35 **** insert.SetTableName("test_insert_builder"); ! insert.AddColumn(new string[] {"intColumn"}, NHibernate.Int32); ! insert.AddColumn(new string[] {"longColumn"}, NHibernate.Int64); ! insert.AddColumn("literalColumn", false, (Type.ILiteralType) NHibernate.Boolean); insert.AddColumn("stringColumn", 5.ToString()); --- 29,35 ---- insert.SetTableName("test_insert_builder"); ! insert.AddColumn(new string[] {"intColumn"}, NHibernateUtil.Int32); ! insert.AddColumn(new string[] {"longColumn"}, NHibernateUtil.Int64); ! insert.AddColumn("literalColumn", false, (Type.ILiteralType) NHibernateUtil.Boolean); insert.AddColumn("stringColumn", 5.ToString()); |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyInterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.Test/ProxyInterface Modified Files: CastleProxyFixture.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: CastleProxyFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyInterface/CastleProxyFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CastleProxyFixture.cs 16 Dec 2004 21:51:47 -0000 1.1 --- CastleProxyFixture.cs 17 Jan 2005 03:40:52 -0000 1.2 *************** *** 31,39 **** s = sessions.OpenSession(); ap = (CastleProxy)s.Load( typeof(CastleProxyImpl), ap.Id ); ! Assert.IsFalse( NHibernate.IsInitialized( ap ) ); int id = ap.Id; ! Assert.IsFalse( NHibernate.IsInitialized( ap ), "get id should not have initialized it." ); string name = ap.Name; ! Assert.IsTrue( NHibernate.IsInitialized( ap ), "get name should have initialized it." ); s.Delete( ap ); s.Flush(); --- 31,39 ---- s = sessions.OpenSession(); ap = (CastleProxy)s.Load( typeof(CastleProxyImpl), ap.Id ); ! Assert.IsFalse( NHibernateUtil.IsInitialized( ap ) ); int id = ap.Id; ! Assert.IsFalse( NHibernateUtil.IsInitialized( ap ), "get id should not have initialized it." ); string name = ap.Name; ! Assert.IsTrue( NHibernateUtil.IsInitialized( ap ), "get name should have initialized it." ); s.Delete( ap ); s.Flush(); |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.Test Modified Files: ABCProxyTest.cs FooBarTest.cs FumTest.cs MasterDetailTest.cs ParentChildTest.cs SimpleTest.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** FooBarTest.cs 13 Jan 2005 20:54:02 -0000 1.80 --- FooBarTest.cs 17 Jan 2005 03:40:51 -0000 1.81 *************** *** 57,61 **** fooBag = baz.FooBag; s.Find("from Baz baz left join fetch baz.FooBag"); ! Assert.IsTrue( NHibernate.IsInitialized(fooBag) ); Assert.IsTrue( fooBag==baz.FooBag ); Assert.IsTrue( baz.FooBag.Count==2 ); --- 57,61 ---- fooBag = baz.FooBag; s.Find("from Baz baz left join fetch baz.FooBag"); ! Assert.IsTrue( NHibernateUtil.IsInitialized(fooBag) ); Assert.IsTrue( fooBag==baz.FooBag ); Assert.IsTrue( baz.FooBag.Count==2 ); *************** *** 65,71 **** baz = (Baz) s.Load( typeof(Baz), baz.Code ); Object bag = baz.FooBag; ! Assert.IsFalse( NHibernate.IsInitialized(bag) ); s.Find("from Baz baz left join fetch fooBag"); ! Assert.IsFalse( NHibernate.IsInitialized(bag) ); Assert.IsTrue( bag==baz.FooBag ); Assert.IsTrue( baz.FooBag.Count==2 ); --- 65,71 ---- baz = (Baz) s.Load( typeof(Baz), baz.Code ); Object bag = baz.FooBag; ! Assert.IsFalse( NHibernateUtil.IsInitialized(bag) ); s.Find("from Baz baz left join fetch fooBag"); ! Assert.IsFalse( NHibernateUtil.IsInitialized(bag) ); Assert.IsTrue( bag==baz.FooBag ); Assert.IsTrue( baz.FooBag.Count==2 ); *************** *** 167,171 **** baz.Fees = list; list = s.Find("from Foo foo, Baz baz left join fetch baz.Fees"); ! Assert.IsTrue( NHibernate.IsInitialized( ( (Baz) ( (object[]) list[0] )[1] ).Fees ) ); s.Delete(foo); s.Delete(foo2); --- 167,171 ---- baz.Fees = list; list = s.Find("from Foo foo, Baz baz left join fetch baz.Fees"); ! Assert.IsTrue( NHibernateUtil.IsInitialized( ( (Baz) ( (object[]) list[0] )[1] ).Fees ) ); s.Delete(foo); s.Delete(foo2); *************** *** 275,282 **** s = sessions.OpenSession(); baz = (Baz)s.Load( typeof(Baz), id ); ! Assert.IsFalse( NHibernate.IsInitialized( baz.FooBag ) ); Assert.AreEqual( 1, baz.FooBag.Count ); ! Assert.IsTrue( NHibernate.IsInitialized( baz.FooBag[0] ) ); s.Delete(baz); s.Flush(); --- 275,282 ---- s = sessions.OpenSession(); baz = (Baz)s.Load( typeof(Baz), id ); ! Assert.IsFalse( NHibernateUtil.IsInitialized( baz.FooBag ) ); Assert.AreEqual( 1, baz.FooBag.Count ); ! Assert.IsTrue( NHibernateUtil.IsInitialized( baz.FooBag[0] ) ); s.Delete(baz); s.Flush(); *************** *** 372,378 **** s = sessions.OpenSession(); f = (FooProxy)s.Load( typeof(Foo), id ); ! Assert.IsFalse( NHibernate.IsInitialized( f ) ); ! Assert.IsTrue( NHibernate.IsInitialized( f.Component.Glarch ) ); //outer-join="true" ! Assert.IsFalse( NHibernate.IsInitialized( f.TheFoo ) ); //outer-join="auto" Assert.AreEqual( gid, s.GetIdentifier( f.Component.Glarch ) ); s.Delete( f ); --- 372,378 ---- s = sessions.OpenSession(); f = (FooProxy)s.Load( typeof(Foo), id ); ! Assert.IsFalse( NHibernateUtil.IsInitialized( f ) ); ! Assert.IsTrue( NHibernateUtil.IsInitialized( f.Component.Glarch ) ); //outer-join="true" ! Assert.IsFalse( NHibernateUtil.IsInitialized( f.TheFoo ) ); //outer-join="auto" Assert.AreEqual( gid, s.GetIdentifier( f.Component.Glarch ) ); s.Delete( f ); *************** *** 696,700 **** f = (Foo) list[0]; ! Assert.IsTrue(NHibernate.IsInitialized(f.TheFoo)); //TODO: this is initialized because Proxies are not implemented yet. --- 696,700 ---- f = (Foo) list[0]; ! Assert.IsTrue(NHibernateUtil.IsInitialized(f.TheFoo)); //TODO: this is initialized because Proxies are not implemented yet. *************** *** 847,854 **** Type.IType[] types = new Type.IType[] { ! NHibernate.Entity(typeof(Foo)), ! NHibernate.Int64, ! NHibernate.Int32, ! NHibernate.String }; --- 847,854 ---- Type.IType[] types = new Type.IType[] { ! NHibernateUtil.Entity(typeof(Foo)), ! NHibernateUtil.Int64, ! NHibernateUtil.Int32, ! NHibernateUtil.String }; *************** *** 861,867 **** types = new Type.IType[] { ! NHibernate.Entity(typeof(Foo)), ! NHibernate.Int64, ! NHibernate.String }; --- 861,867 ---- types = new Type.IType[] { ! NHibernateUtil.Entity(typeof(Foo)), ! NHibernateUtil.Int64, ! NHibernateUtil.String }; *************** *** 1543,1549 **** b = (BarProxy)s.Load( typeof(Foo), b.Key ); string tempKey = b.Key; ! Assert.IsFalse( NHibernate.IsInitialized(b), "b should have been an unitialized Proxy" ); string tempString = b.BarString; ! Assert.IsTrue( NHibernate.IsInitialized(b), "b should have been an initialized Proxy" ); BarProxy b2 = (BarProxy)s.Load( typeof(Bar), tempKey ); Qux q2 = (Qux)s.Load( typeof(Qux), q.Key ); --- 1543,1549 ---- b = (BarProxy)s.Load( typeof(Foo), b.Key ); string tempKey = b.Key; ! Assert.IsFalse( NHibernateUtil.IsInitialized(b), "b should have been an unitialized Proxy" ); string tempString = b.BarString; ! Assert.IsTrue( NHibernateUtil.IsInitialized(b), "b should have been an initialized Proxy" ); BarProxy b2 = (BarProxy)s.Load( typeof(Bar), tempKey ); Qux q2 = (Qux)s.Load( typeof(Qux), q.Key ); *************** *** 1741,1745 **** s.Delete( "from t in class NHibernate.DomainModel.Trivial" ); ! list2 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.Date = ?", new DateTime(2123,2,3), NHibernate.Date ); Assert.AreEqual( 4, list2.Count, "find by date" ); IEnumerator enumer = list2.GetEnumerator(); --- 1741,1745 ---- s.Delete( "from t in class NHibernate.DomainModel.Trivial" ); ! list2 = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.Date = ?", new DateTime(1970, 01, 01), NHibernateUtil.Date ); Assert.AreEqual( 4, list2.Count, "find by date" ); IEnumerator enumer = list2.GetEnumerator(); *************** *** 1768,1772 **** IList list = s.Find( "from Foo foo inner join fetch foo.TheFoo" ); Foo foof = (Foo)list[0]; ! Assert.IsTrue( NHibernate.IsInitialized( foof.TheFoo ) ); list = s.Find( "from Baz baz left outer join fetch baz.FooToGlarch" ); --- 1768,1772 ---- IList list = s.Find( "from Foo foo inner join fetch foo.TheFoo" ); Foo foof = (Foo)list[0]; ! Assert.IsTrue( NHibernateUtil.IsInitialized( foof.TheFoo ) ); list = s.Find( "from Baz baz left outer join fetch baz.FooToGlarch" ); *************** *** 1774,1778 **** list = s.Find( "select foo, bar from Foo foo left outer join foo.TheFoo bar where foo = ?", foo, ! NHibernate.Entity( typeof(Foo) ) ); --- 1774,1778 ---- list = s.Find( "select foo, bar from Foo foo left outer join foo.TheFoo bar where foo = ?", foo, ! NHibernateUtil.Entity( typeof(Foo) ) ); *************** *** 1838,1842 **** { // add an !InterbaseDialect wrapper around list and assert ! list = s.Find( "from foo in class NHibernate.DomainModel.Foo where ? = some foo.Component.ImportantDates.elements", new DateTime( DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ), NHibernate.DateTime ); Assert.AreEqual( 2, list.Count, "componenet query" ); } --- 1838,1842 ---- { // add an !InterbaseDialect wrapper around list and assert ! list = s.Find( "from foo in class NHibernate.DomainModel.Foo where ? = some foo.Component.ImportantDates.elements", new DateTime( DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ), NHibernateUtil.DateTime ); Assert.AreEqual( 2, list.Count, "componenet query" ); } *************** *** 2062,2066 **** Assert.AreEqual(8, ! s.Delete("from q in class NHibernate.DomainModel.Qux where q.Stuff=?", "foo", NHibernate.String), "delete by query"); --- 2062,2066 ---- Assert.AreEqual(8, ! s.Delete("from q in class NHibernate.DomainModel.Qux where q.Stuff=?", "foo", NHibernateUtil.String), "delete by query"); *************** *** 2077,2080 **** --- 2077,2140 ---- } + /// <summary> + /// Adding a test to verify that a database action can occur in the + /// middle of an Enumeration. Under certain conditions an open + /// DataReader can be kept open and cause anyother action to fail. + /// </summary> + [Test] + public void EnumerableDisposable() + { + // this test used to be called Iterators() + + ISession s = sessions.OpenSession(); + for( int i=0; i<10; i++ ) + { + Simple simple = new Simple(); + simple.Count = i; + s.Save(simple, i); + Assert.IsNotNull(simple, "simple is not null"); + } + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + ITransaction t = s.BeginTransaction(); + Simple simp = (Simple)s.Load( typeof(Simple), 8 ); + + // the reader under the enum has to still be a SqlDataReader (subst db name here) and + // can't be a NDataReader - the best way to get this result is to query on just a property + // of an object. If the query is "from Simple as s" then it will be converted to a NDataReader + // on the MoveNext so it can get the object from the id - thus needing another open DataReader so + // it must convert to an NDataReader. + IEnumerable enumer = s.Enumerable("select s.Count from Simple as s"); + //int count = 0; + foreach( object obj in enumer ) + { + if( (int)obj==7 ) + { + break; + } + } + + // if Enumerable doesn't implement Dispose() then the test fails on this line + t.Commit(); + s.Close(); + + s = sessions.OpenSession(); + Assert.AreEqual( 10, + s.Delete( "from Simple" ), + "delete by query" ); + + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + enumer = s.Enumerable("from Simple"); + Assert.IsFalse( enumer.GetEnumerator().MoveNext() , "no items in enumerator" ); + s.Flush(); + s.Close(); + + } + [Test] public void Versioning() *************** *** 2096,2101 **** GlarchProxy gOld = (GlarchProxy)sOld.Load( typeof(Glarch), gid ); // want gOld to be initialized so later I can change a property ! NHibernate.Initialize( gOld ); ! Assert.IsTrue( NHibernate.IsInitialized( gOld ), "should be initialized" ); sOld.Close(); --- 2156,2161 ---- GlarchProxy gOld = (GlarchProxy)sOld.Load( typeof(Glarch), gid ); // want gOld to be initialized so later I can change a property ! NHibernateUtil.Initialize( gOld ); ! Assert.IsTrue( NHibernateUtil.IsInitialized( gOld ), "should be initialized" ); sOld.Close(); *************** *** 3002,3006 **** s.Load( im, im.Id); ! Immutable imFromFind = (Immutable)s.Find("from im in class Immutable where im = ?", im, NHibernate.Entity(typeof(Immutable)))[0]; Immutable imFromLoad = (Immutable)s.Load(typeof(Immutable), im.Id); --- 3062,3066 ---- s.Load( im, im.Id); ! Immutable imFromFind = (Immutable)s.Find("from im in class Immutable where im = ?", im, NHibernateUtil.Entity(typeof(Immutable)))[0]; Immutable imFromLoad = (Immutable)s.Load(typeof(Immutable), im.Id); *************** *** 3188,3192 **** e = s.Enumerable("from baz in class NHibernate.DomainModel.Baz where ? in baz.FooArray.elements", foo, ! NHibernate.Entity( typeof(Foo) ) ).GetEnumerator(); Assert.IsFalse( e.MoveNext() ); --- 3248,3252 ---- e = s.Enumerable("from baz in class NHibernate.DomainModel.Baz where ? in baz.FooArray.elements", foo, ! NHibernateUtil.Entity( typeof(Foo) ) ).GetEnumerator(); Assert.IsFalse( e.MoveNext() ); *************** *** 3341,3345 **** "from Bar bar where bar.Object.id = ? and bar.Object.class = ?", new object[] { oid, typeof(One) }, ! new Type.IType[] { NHibernate.Int64, NHibernate.Class } ); Assert.AreEqual(1, list.Count); --- 3401,3405 ---- "from Bar bar where bar.Object.id = ? and bar.Object.class = ?", new object[] { oid, typeof(One) }, ! new Type.IType[] { NHibernateUtil.Int64, NHibernateUtil.Class } ); Assert.AreEqual(1, list.Count); *************** *** 3612,3616 **** s = sessions.OpenSession(); ! foo = (Foo)s.Find( "from Foo as f where f.id = ?", id, NHibernate.String)[0]; Assert.AreEqual( 4, foo.Formula, "should be 2x 'Int' property that is defaulted to 2" ); --- 3672,3676 ---- s = sessions.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" ); Index: SimpleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SimpleTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SimpleTest.cs 1 Jan 2005 20:39:38 -0000 1.7 --- SimpleTest.cs 17 Jan 2005 03:40:51 -0000 1.8 *************** *** 101,105 **** // Simple simple3 = (Simple)s3.Load(typeof(Simple), key); ! Simple simple3 = (Simple)s3.Find( "from Simple as s where s.id = ? and '?'='?'", key, NHibernate.Int64 )[0]; Simple otherSimple3; --- 101,105 ---- // Simple simple3 = (Simple)s3.Load(typeof(Simple), key); ! Simple simple3 = (Simple)s3.Find( "from Simple as s where s.id = ? and '?'='?'", key, NHibernateUtil.Int64 )[0]; Simple otherSimple3; Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** FumTest.cs 1 Jan 2005 20:39:38 -0000 1.17 --- FumTest.cs 17 Jan 2005 03:40:51 -0000 1.18 *************** *** 242,246 **** // Try to fnd the Fum object "fi" that we inserted by searching the date in the id ! vList = s.Find("from fum in class NHibernate.DomainModel.Fum where fum.Id.Short = ?", fiShort, NHibernate.Int16 ); Assert.AreEqual( 1, vList.Count, "find by composite key query (find fi object)" ); fi = (Fum)vList[0]; --- 242,246 ---- // Try to fnd the Fum object "fi" that we inserted by searching the date in the id ! vList = s.Find("from fum in class NHibernate.DomainModel.Fum where fum.Id.Short = ?", fiShort, NHibernateUtil.Int16 ); Assert.AreEqual( 1, vList.Count, "find by composite key query (find fi object)" ); fi = (Fum)vList[0]; *************** *** 248,252 **** // make sure we can return all of the objects by searching by the date id ! vList = s.Find("from fum in class NHibernate.DomainModel.Fum where fum.Id.Date <= ? and not fum.FumString='FRIEND'", DateTime.Now, NHibernate.Date); Assert.AreEqual( 4, vList.Count, "find by composite key query with arguments" ); s.Flush(); --- 248,252 ---- // make sure we can return all of the objects by searching by the date id ! vList = s.Find("from fum in class NHibernate.DomainModel.Fum where fum.Id.Date <= ? and not fum.FumString='FRIEND'", DateTime.Now, NHibernateUtil.Date); Assert.AreEqual( 4, vList.Count, "find by composite key query with arguments" ); s.Flush(); *************** *** 279,283 **** fum = (Fum)s.Load( typeof(Fum), fum.Id ); s.Filter( fum.QuxArray, "where this.Foo is null" ); ! s.Filter( fum.QuxArray, "where this.Foo.id = ?", "fooid", NHibernate.String ); IQuery f = s.CreateFilter( fum.QuxArray, "where this.Foo.id = :fooId" ); f.SetString("fooId", "abc"); --- 279,283 ---- fum = (Fum)s.Load( typeof(Fum), fum.Id ); s.Filter( fum.QuxArray, "where this.Foo is null" ); ! s.Filter( fum.QuxArray, "where this.Foo.id = ?", "fooid", NHibernateUtil.String ); IQuery f = s.CreateFilter( fum.QuxArray, "where this.Foo.id = :fooId" ); f.SetString("fooId", "abc"); *************** *** 463,467 **** s = sessions.OpenSession(); ! d = (Outer)s.Find("from Outer o where o.id.DetailId=?", d.Id.DetailId, NHibernate.String)[0]; s.Find("from Outer o where o.Id.Master.Id.Sup.Dudu is not null"); s.Find("from Outer o where o.Id.Master.Bla = ''"); --- 463,467 ---- 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"); s.Find("from Outer o where o.Id.Master.Bla = ''"); Index: ParentChildTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ParentChildTest.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ParentChildTest.cs 1 Jan 2005 20:39:38 -0000 1.11 --- ParentChildTest.cs 17 Jan 2005 03:40:51 -0000 1.12 *************** *** 153,157 **** s.Find("select c, c.Parent from c in class NHibernate.DomainModel.Child where c.Parent.Count=66 order by c.Parent.Count"); s.Enumerable("select c, c.Parent, c.Parent.Count from c in class NHibernate.DomainModel.Child order by c.Parent.Count"); ! Assert.AreEqual( 1, s.Find("FROM p in CLASS NHibernate.DomainModel.Parent WHERE p.Count=?", (int)66, NHibernate.Int32).Count, "1-1 query" ); s.Delete(c); s.Delete(p); --- 153,157 ---- s.Find("select c, c.Parent from c in class NHibernate.DomainModel.Child where c.Parent.Count=66 order by c.Parent.Count"); s.Enumerable("select c, c.Parent, c.Parent.Count from c in class NHibernate.DomainModel.Child order by c.Parent.Count"); ! Assert.AreEqual( 1, s.Find("FROM p in CLASS NHibernate.DomainModel.Parent WHERE p.Count=?", (int)66, NHibernateUtil.Int32).Count, "1-1 query" ); s.Delete(c); s.Delete(p); Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ABCProxyTest.cs 1 Jan 2005 20:39:37 -0000 1.11 --- ABCProxyTest.cs 17 Jan 2005 03:40:51 -0000 1.12 *************** *** 65,69 **** // Test won't run after this line because of proxy initalization problems A c1a = (A) s.Load(typeof(A), c1.Id ); ! Assert.IsFalse( NHibernate.IsInitialized(c1a) ); Assert.IsTrue( c1a.Name.Equals("c1") ); t.Commit(); --- 65,69 ---- // Test won't run after this line because of proxy initalization problems A c1a = (A) s.Load(typeof(A), c1.Id ); ! Assert.IsFalse( NHibernateUtil.IsInitialized(c1a) ); Assert.IsTrue( c1a.Name.Equals("c1") ); t.Commit(); Index: MasterDetailTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MasterDetailTest.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MasterDetailTest.cs 24 Nov 2004 14:34:45 -0000 1.17 --- MasterDetailTest.cs 17 Jan 2005 03:40:51 -0000 1.18 *************** *** 171,175 **** IList list = s.Find("from Master m left join fetch m.Details"); Master m = (Master)list[0]; ! Assert.IsTrue( NHibernate.IsInitialized( m.Details ), "joined fetch should initialize collection" ); Assert.AreEqual( 2, m.Details.Count ); list = s.Find("from Detail d inner join fetch d.Master"); --- 171,175 ---- IList list = s.Find("from Master m left join fetch m.Details"); Master m = (Master)list[0]; ! Assert.IsTrue( NHibernateUtil.IsInitialized( m.Details ), "joined fetch should initialize collection" ); Assert.AreEqual( 2, m.Details.Count ); list = s.Find("from Detail d inner join fetch d.Master"); *************** *** 183,187 **** t = s.BeginTransaction(); list = s.Find("select m from Master m1, Master m left join fetch m.Details where m.Name=m1.Name"); ! Assert.IsTrue( NHibernate.IsInitialized( ((Master)list[0]).Details ) ); dt = (Detail)s.Load( typeof(Detail), dtid ); Assert.IsTrue( ((Master)list[0]).Details.Contains(dt) ); --- 183,187 ---- t = s.BeginTransaction(); list = s.Find("select m from Master m1, Master m left join fetch m.Details where m.Name=m1.Name"); ! Assert.IsTrue( NHibernateUtil.IsInitialized( ((Master)list[0]).Details ) ); dt = (Detail)s.Load( typeof(Detail), dtid ); Assert.IsTrue( ((Master)list[0]).Details.Contains(dt) ); *************** *** 193,197 **** list = s.Find("select m, m1.Name from Master m1, Master m left join fetch m.Details where m.Name=m1.Name"); Master masterFromHql = (Master)((object[])list[0])[0]; ! Assert.IsTrue( NHibernate.IsInitialized( masterFromHql.Details ) ); dt = (Detail)s.Load( typeof(Detail), dtid ); Assert.IsTrue( masterFromHql.Details.Contains(dt) ); --- 193,197 ---- list = s.Find("select m, m1.Name from Master m1, Master m left join fetch m.Details where m.Name=m1.Name"); Master masterFromHql = (Master)((object[])list[0])[0]; ! Assert.IsTrue( NHibernateUtil.IsInitialized( masterFromHql.Details ) ); dt = (Detail)s.Load( typeof(Detail), dtid ); Assert.IsTrue( masterFromHql.Details.Contains(dt) ); *************** *** 633,637 **** s.Close(); ! Assert.IsFalse( NHibernate.IsInitialized( c.Subcategories ) ); s = sessions.OpenSession(); --- 633,637 ---- s.Close(); ! Assert.IsFalse( NHibernateUtil.IsInitialized( c.Subcategories ) ); s = sessions.OpenSession(); |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.Test/NHSpecificTest Modified Files: BasicObjectFixture.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: BasicObjectFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicObjectFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicObjectFixture.cs 31 Aug 2004 21:24:38 -0000 1.2 --- BasicObjectFixture.cs 17 Jan 2005 03:40:52 -0000 1.3 *************** *** 14,18 **** /// <remarks> /// Moved that mapping out of ParentChildTest because MySql has a bug with writing ! /// binary types to the database. So any TestFixture that used <see cref="NHibernate.DomainModel.Parent"/> /// would fail. /// </remarks> --- 14,18 ---- /// <remarks> /// Moved that mapping out of ParentChildTest because MySql has a bug with writing ! /// binary types to the database. So any TestFixture that used <see cref="NHibernateUtil.DomainModel.Parent"/> /// would fail. /// </remarks> |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:30
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.Test/JoinedSubclass Modified Files: JoinedSubclassFixture.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: JoinedSubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclassFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JoinedSubclassFixture.cs 5 Jan 2005 02:44:18 -0000 1.2 --- JoinedSubclassFixture.cs 17 Jan 2005 03:40:51 -0000 1.3 *************** *** 70,74 **** { // when proxies is working this is important ! Assert.IsTrue( NHibernate.IsInitialized( c.Salesperson ) ); Assert.AreEqual( "Mark", c.Salesperson.Name ); } --- 70,74 ---- { // when proxies is working this is important ! Assert.IsTrue( NHibernateUtil.IsInitialized( c.Salesperson ) ); Assert.AreEqual( "Mark", c.Salesperson.Name ); } *************** *** 81,85 **** { //TODO: proxies make this work ! Assert.IsFalse( NHibernate.IsInitialized( c.Salesperson ) ); Assert.AreEqual( "Mark", c.Salesperson.Name ); } --- 81,85 ---- { //TODO: proxies make this work ! Assert.IsFalse( NHibernateUtil.IsInitialized( c.Salesperson ) ); Assert.AreEqual( "Mark", c.Salesperson.Name ); } *************** *** 134,138 **** s = sessions.OpenSession(); pointyhair = (Employee) s.Load( typeof(Employee), pointyhair.Id ); ! NHibernate.Initialize( pointyhair ); s.Close(); --- 134,138 ---- s = sessions.OpenSession(); pointyhair = (Employee) s.Load( typeof(Employee), pointyhair.Id ); ! NHibernateUtil.Initialize( pointyhair ); s.Close(); *************** *** 185,189 **** // perform a load based on the base class ! Person empAsPerson = (Person)s.Find( "from Person as p where p.id = ?", empId, NHibernate.Int32 )[0]; person = (Person)s.Load( typeof(Person), personId ); --- 185,189 ---- // perform a load based on the base class ! Person empAsPerson = (Person)s.Find( "from Person as p where p.id = ?", empId, NHibernateUtil.Int32 )[0]; person = (Person)s.Load( typeof(Person), personId ); |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:30
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.Test/ExpressionTest Modified Files: JunctionFixture.cs SQLExpressionFixture.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: SQLExpressionFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest/SQLExpressionFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SQLExpressionFixture.cs 26 Aug 2004 14:28:44 -0000 1.1 --- SQLExpressionFixture.cs 17 Jan 2005 03:40:51 -0000 1.2 *************** *** 65,69 **** builder.Add( firstAndParam ); ! NExpression.Expression sqlExpression = NExpression.Expression.Sql(builder.ToSqlString(), "some address", NHibernate.String ); SqlString sqlString = sqlExpression.ToSqlString(factoryImpl, typeof(Simple), "simple_alias"); --- 65,69 ---- builder.Add( firstAndParam ); ! NExpression.Expression sqlExpression = NExpression.Expression.Sql(builder.ToSqlString(), "some address", NHibernateUtil.String ); SqlString sqlString = sqlExpression.ToSqlString(factoryImpl, typeof(Simple), "simple_alias"); Index: JunctionFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest/JunctionFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JunctionFixture.cs 21 Aug 2004 16:39:01 -0000 1.3 --- JunctionFixture.cs 17 Jan 2005 03:40:51 -0000 1.4 *************** *** 51,56 **** TypedValue[] expectedTV = new TypedValue[2]; ! expectedTV[0] = new TypedValue(NHibernate.Int32, 5); ! expectedTV[1] = new TypedValue(NHibernate.Int32, 10); Assert.AreEqual(2, typedValues.Length); --- 51,56 ---- TypedValue[] expectedTV = new TypedValue[2]; ! expectedTV[0] = new TypedValue(NHibernateUtil.Int32, 5); ! expectedTV[1] = new TypedValue(NHibernateUtil.Int32, 10); Assert.AreEqual(2, typedValues.Length); |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:30
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate.DomainModel/NHSpecific Modified Files: NullInt32UserType.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: NullInt32UserType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/NullInt32UserType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullInt32UserType.cs 6 Dec 2004 03:01:27 -0000 1.2 --- NullInt32UserType.cs 17 Jan 2005 03:40:50 -0000 1.3 *************** *** 13,17 **** public class NullInt32UserType : IUserType { ! private static NullableType _int32Type = NHibernate.Int32; public NullInt32UserType() --- 13,17 ---- public class NullInt32UserType : IUserType { ! private static NullableType _int32Type = NHibernateUtil.Int32; public NullInt32UserType() |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate/Type Modified Files: CultureInfoType.cs ObjectType.cs SerializableType.cs TypeFactory.cs TypeType.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: CultureInfoType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/CultureInfoType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CultureInfoType.cs 31 Dec 2004 23:51:32 -0000 1.5 --- CultureInfoType.cs 17 Jan 2005 03:40:58 -0000 1.6 *************** *** 28,32 **** public override object Get( IDataReader rs, int index ) { ! string str = ( string ) NHibernate.String.Get( rs, index ); if( str == null ) { --- 28,32 ---- public override object Get( IDataReader rs, int index ) { ! string str = ( string ) NHibernateUtil.String.Get( rs, index ); if( str == null ) { *************** *** 58,62 **** public override void Set( IDbCommand cmd, object value, int index ) { ! NHibernate.String.Set( cmd, ( ( CultureInfo ) value ).Name, index ); } --- 58,62 ---- public override void Set( IDbCommand cmd, object value, int index ) { ! NHibernateUtil.String.Set( cmd, ( ( CultureInfo ) value ).Name, index ); } *************** *** 101,105 **** public string ObjectToSQLString( object value ) { ! return ( ( ILiteralType ) NHibernate.String ).ObjectToSQLString( value.ToString() ); } } --- 101,105 ---- public string ObjectToSQLString( object value ) { ! return ( ( ILiteralType ) NHibernateUtil.String ).ObjectToSQLString( value.ToString() ); } } Index: SerializableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SerializableType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SerializableType.cs 31 Dec 2004 23:55:34 -0000 1.7 --- SerializableType.cs 17 Jan 2005 03:40:58 -0000 1.8 *************** *** 41,45 **** { this.serializableClass = serializableClass; ! this.binaryType = ( BinaryType ) NHibernate.Binary; } --- 41,45 ---- { this.serializableClass = serializableClass; ! this.binaryType = ( BinaryType ) NHibernateUtil.Binary; } Index: TypeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TypeType.cs 1 Jan 2005 03:37:34 -0000 1.6 --- TypeType.cs 17 Jan 2005 03:40:58 -0000 1.7 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Data; + using NHibernate; using NHibernate.SqlTypes; using NHibernate.Util; *************** *** 37,41 **** public override object Get( IDataReader rs, int index ) { ! string str = ( string ) NHibernate.String.Get( rs, index ); if( str == null ) { --- 38,42 ---- public override object Get( IDataReader rs, int index ) { ! string str = ( string ) NHibernateUtil.String.Get( rs, index ); if( str == null ) { *************** *** 85,93 **** /// <remarks> /// This uses the <see cref="NullableType.Set(IDbCommand, Object,Int32)"/> method of the ! /// <see cref="NHibernate.String"/> object to do the work. /// </remarks> public override void Set( IDbCommand cmd, object value, int index ) { ! NHibernate.String.Set( cmd, ( ( System.Type ) value ).AssemblyQualifiedName, index ); } --- 86,94 ---- /// <remarks> /// This uses the <see cref="NullableType.Set(IDbCommand, Object,Int32)"/> method of the ! /// <see cref="NHibernateUtil.String"/> object to do the work. /// </remarks> public override void Set( IDbCommand cmd, object value, int index ) { ! NHibernateUtil.String.Set( cmd, ( ( System.Type ) value ).AssemblyQualifiedName, index ); } Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** TypeFactory.cs 31 Dec 2004 23:56:09 -0000 1.41 --- TypeFactory.cs 17 Jan 2005 03:40:58 -0000 1.42 *************** *** 74,183 **** // set up the mappings of .NET Classes/Structs to their NHibernate types. ! typeByTypeOfName[ typeof( Byte[ ] ).Name ] = NHibernate.Binary; ! typeByTypeOfName[ typeof( Byte[ ] ).AssemblyQualifiedName ] = NHibernate.Binary; ! typeByTypeOfName[ typeof( Boolean ).FullName ] = NHibernate.Boolean; ! typeByTypeOfName[ typeof( Boolean ).AssemblyQualifiedName ] = NHibernate.Boolean; ! typeByTypeOfName[ typeof( Byte ).FullName ] = NHibernate.Byte; ! typeByTypeOfName[ typeof( Byte ).AssemblyQualifiedName ] = NHibernate.Byte; ! typeByTypeOfName[ typeof( Char ).FullName ] = NHibernate.Character; ! typeByTypeOfName[ typeof( Char ).AssemblyQualifiedName ] = NHibernate.Character; ! typeByTypeOfName[ typeof( CultureInfo ).FullName ] = NHibernate.CultureInfo; ! typeByTypeOfName[ typeof( CultureInfo ).AssemblyQualifiedName ] = NHibernate.CultureInfo; ! typeByTypeOfName[ typeof( DateTime ).FullName ] = NHibernate.DateTime; ! typeByTypeOfName[ typeof( DateTime ).AssemblyQualifiedName ] = NHibernate.DateTime; ! typeByTypeOfName[ typeof( Decimal ).FullName ] = NHibernate.Decimal; ! typeByTypeOfName[ typeof( Decimal ).AssemblyQualifiedName ] = NHibernate.Decimal; ! typeByTypeOfName[ typeof( Double ).FullName ] = NHibernate.Double; ! typeByTypeOfName[ typeof( Double ).AssemblyQualifiedName ] = NHibernate.Double; ! typeByTypeOfName[ typeof( Guid ).FullName ] = NHibernate.Guid; ! typeByTypeOfName[ typeof( Guid ).AssemblyQualifiedName ] = NHibernate.Guid; ! typeByTypeOfName[ typeof( Int16 ).FullName ] = NHibernate.Int16; ! typeByTypeOfName[ typeof( Int16 ).AssemblyQualifiedName ] = NHibernate.Int16; ! typeByTypeOfName[ typeof( Int32 ).FullName ] = NHibernate.Int32; ! typeByTypeOfName[ typeof( Int32 ).AssemblyQualifiedName ] = NHibernate.Int32; ! typeByTypeOfName[ typeof( Int64 ).FullName ] = NHibernate.Int64; ! typeByTypeOfName[ typeof( Int64 ).AssemblyQualifiedName ] = NHibernate.Int64; ! typeByTypeOfName[ typeof( SByte ).FullName ] = NHibernate.SByte; ! typeByTypeOfName[ typeof( SByte ).AssemblyQualifiedName ] = NHibernate.SByte; ! typeByTypeOfName[ typeof( Single ).FullName ] = NHibernate.Single; ! typeByTypeOfName[ typeof( Single ).AssemblyQualifiedName ] = NHibernate.Single; ! typeByTypeOfName[ typeof( String ).FullName ] = NHibernate.String; ! typeByTypeOfName[ typeof( String ).AssemblyQualifiedName ] = NHibernate.String; ! typeByTypeOfName[ typeof( TimeSpan ).FullName ] = NHibernate.TimeSpan; ! typeByTypeOfName[ typeof( TimeSpan ).AssemblyQualifiedName ] = NHibernate.TimeSpan; // add the mappings of the NHibernate specific names that are used in type="" ! typeByTypeOfName[ NHibernate.AnsiString.Name ] = NHibernate.AnsiString; ! typeByTypeOfName[ NHibernate.Binary.Name ] = NHibernate.Binary; ! typeByTypeOfName[ NHibernate.BinaryBlob.Name ] = NHibernate.BinaryBlob; ! typeByTypeOfName[ NHibernate.Boolean.Name ] = NHibernate.Boolean; ! typeByTypeOfName[ NHibernate.Byte.Name ] = NHibernate.Byte; ! typeByTypeOfName[ NHibernate.Character.Name ] = NHibernate.Character; ! typeByTypeOfName[ NHibernate.StringClob.Name ] = NHibernate.StringClob; ! typeByTypeOfName[ NHibernate.CultureInfo.Name ] = NHibernate.CultureInfo; ! typeByTypeOfName[ NHibernate.DateTime.Name ] = NHibernate.DateTime; ! typeByTypeOfName[ NHibernate.Date.Name ] = NHibernate.Date; ! typeByTypeOfName[ NHibernate.Decimal.Name ] = NHibernate.Decimal; ! typeByTypeOfName[ NHibernate.Double.Name ] = NHibernate.Double; ! typeByTypeOfName[ NHibernate.Guid.Name ] = NHibernate.Guid; ! typeByTypeOfName[ NHibernate.Int16.Name ] = NHibernate.Int16; ! typeByTypeOfName[ NHibernate.Int32.Name ] = NHibernate.Int32; ! typeByTypeOfName[ NHibernate.Int64.Name ] = NHibernate.Int64; ! typeByTypeOfName[ NHibernate.SByte.Name ] = NHibernate.SByte; ! typeByTypeOfName[ NHibernate.String.Name ] = NHibernate.String; ! typeByTypeOfName[ NHibernate.Single.Name ] = NHibernate.Single; ! typeByTypeOfName[ NHibernate.Timestamp.Name ] = NHibernate.Timestamp; ! typeByTypeOfName[ NHibernate.Time.Name ] = NHibernate.Time; ! typeByTypeOfName[ NHibernate.TrueFalse.Name ] = NHibernate.TrueFalse; ! typeByTypeOfName[ NHibernate.YesNo.Name ] = NHibernate.YesNo; ! typeByTypeOfName[ NHibernate.Ticks.Name ] = NHibernate.Ticks; ! typeByTypeOfName[ NHibernate.TimeSpan.Name ] = NHibernate.TimeSpan; ! typeByTypeOfName[ NHibernate.Class.Name ] = NHibernate.Class; ! typeByTypeOfName[ typeof( System.Type ).FullName ] = NHibernate.Class; ! typeByTypeOfName[ typeof( System.Type ).AssemblyQualifiedName ] = NHibernate.Class; // need to do add the key "Serializable" because the hbm files will have a // type="Serializable", but the SerializableType returns the Name as // "serializable - System.Object for the default SerializableType. ! typeByTypeOfName[ "Serializable" ] = NHibernate.Serializable; ! typeByTypeOfName[ NHibernate.Serializable.Name ] = NHibernate.Serializable; // object needs to have both class and serializable setup before it can // be created. ! typeByTypeOfName[ typeof( Object ).FullName ] = NHibernate.Object; ! typeByTypeOfName[ typeof( Object ).AssemblyQualifiedName ] = NHibernate.Object; ! typeByTypeOfName[ NHibernate.Object.Name ] = NHibernate.Object; // These are in here for Hibernate mapping compatibility ! typeByTypeOfName[ "binary" ] = NHibernate.Binary; ! typeByTypeOfName[ "boolean" ] = NHibernate.Boolean; ! typeByTypeOfName[ "byte" ] = NHibernate.Byte; ! typeByTypeOfName[ "character" ] = NHibernate.Character; ! typeByTypeOfName[ "class" ] = NHibernate.Class; ! typeByTypeOfName[ "locale" ] = NHibernate.CultureInfo; ! typeByTypeOfName[ "date" ] = NHibernate.DateTime; ! typeByTypeOfName[ "big_decimal" ] = NHibernate.Decimal; ! typeByTypeOfName[ "double" ] = NHibernate.Double; ! typeByTypeOfName[ "short" ] = NHibernate.Int16; ! typeByTypeOfName[ "integer" ] = NHibernate.Int32; ! typeByTypeOfName[ "long" ] = NHibernate.Int64; ! typeByTypeOfName[ "float" ] = NHibernate.Single; ! typeByTypeOfName[ "serializable" ] = NHibernate.Serializable; ! typeByTypeOfName[ "string" ] = NHibernate.String; ! typeByTypeOfName[ "timestamp" ] = NHibernate.Timestamp; ! typeByTypeOfName[ "time" ] = NHibernate.Time; ! typeByTypeOfName[ "true_false" ] = NHibernate.TrueFalse; ! typeByTypeOfName[ "yes_no" ] = NHibernate.YesNo; ! typeByTypeOfName[ "object" ] = NHibernate.Object; ! getTypeDelegatesWithLength.Add( NHibernate.AnsiString.Name, new GetNullableTypeWithLength( GetAnsiStringType ) ); ! getTypeDelegatesWithLength.Add( NHibernate.Binary.Name, new GetNullableTypeWithLength( GetBinaryType ) ); ! getTypeDelegatesWithLength.Add( NHibernate.Serializable.Name, new GetNullableTypeWithLength( GetSerializableType ) ); ! getTypeDelegatesWithLength.Add( NHibernate.String.Name, new GetNullableTypeWithLength( GetStringType ) ); ! getTypeDelegatesWithLength.Add( NHibernate.Class.Name, new GetNullableTypeWithLength( GetTypeType ) ); ! getTypeDelegatesWithPrecision.Add( NHibernate.Decimal.Name, new GetNullableTypeWithPrecision( GetDecimalType ) ); } --- 74,183 ---- // set up the mappings of .NET Classes/Structs to their NHibernate types. ! typeByTypeOfName[ typeof( Byte[ ] ).Name ] = NHibernateUtil.Binary; ! typeByTypeOfName[ typeof( Byte[ ] ).AssemblyQualifiedName ] = NHibernateUtil.Binary; ! typeByTypeOfName[ typeof( Boolean ).FullName ] = NHibernateUtil.Boolean; ! typeByTypeOfName[ typeof( Boolean ).AssemblyQualifiedName ] = NHibernateUtil.Boolean; ! typeByTypeOfName[ typeof( Byte ).FullName ] = NHibernateUtil.Byte; ! typeByTypeOfName[ typeof( Byte ).AssemblyQualifiedName ] = NHibernateUtil.Byte; ! typeByTypeOfName[ typeof( Char ).FullName ] = NHibernateUtil.Character; ! typeByTypeOfName[ typeof( Char ).AssemblyQualifiedName ] = NHibernateUtil.Character; ! typeByTypeOfName[ typeof( CultureInfo ).FullName ] = NHibernateUtil.CultureInfo; ! typeByTypeOfName[ typeof( CultureInfo ).AssemblyQualifiedName ] = NHibernateUtil.CultureInfo; ! typeByTypeOfName[ typeof( DateTime ).FullName ] = NHibernateUtil.DateTime; ! typeByTypeOfName[ typeof( DateTime ).AssemblyQualifiedName ] = NHibernateUtil.DateTime; ! typeByTypeOfName[ typeof( Decimal ).FullName ] = NHibernateUtil.Decimal; ! typeByTypeOfName[ typeof( Decimal ).AssemblyQualifiedName ] = NHibernateUtil.Decimal; ! typeByTypeOfName[ typeof( Double ).FullName ] = NHibernateUtil.Double; ! typeByTypeOfName[ typeof( Double ).AssemblyQualifiedName ] = NHibernateUtil.Double; ! typeByTypeOfName[ typeof( Guid ).FullName ] = NHibernateUtil.Guid; ! typeByTypeOfName[ typeof( Guid ).AssemblyQualifiedName ] = NHibernateUtil.Guid; ! typeByTypeOfName[ typeof( Int16 ).FullName ] = NHibernateUtil.Int16; ! typeByTypeOfName[ typeof( Int16 ).AssemblyQualifiedName ] = NHibernateUtil.Int16; ! typeByTypeOfName[ typeof( Int32 ).FullName ] = NHibernateUtil.Int32; ! typeByTypeOfName[ typeof( Int32 ).AssemblyQualifiedName ] = NHibernateUtil.Int32; ! typeByTypeOfName[ typeof( Int64 ).FullName ] = NHibernateUtil.Int64; ! typeByTypeOfName[ typeof( Int64 ).AssemblyQualifiedName ] = NHibernateUtil.Int64; ! typeByTypeOfName[ typeof( SByte ).FullName ] = NHibernateUtil.SByte; ! typeByTypeOfName[ typeof( SByte ).AssemblyQualifiedName ] = NHibernateUtil.SByte; ! typeByTypeOfName[ typeof( Single ).FullName ] = NHibernateUtil.Single; ! typeByTypeOfName[ typeof( Single ).AssemblyQualifiedName ] = NHibernateUtil.Single; ! typeByTypeOfName[ typeof( String ).FullName ] = NHibernateUtil.String; ! typeByTypeOfName[ typeof( String ).AssemblyQualifiedName ] = NHibernateUtil.String; ! typeByTypeOfName[ typeof( TimeSpan ).FullName ] = NHibernateUtil.TimeSpan; ! typeByTypeOfName[ typeof( TimeSpan ).AssemblyQualifiedName ] = NHibernateUtil.TimeSpan; // add the mappings of the NHibernate specific names that are used in type="" ! typeByTypeOfName[ NHibernateUtil.AnsiString.Name ] = NHibernateUtil.AnsiString; ! typeByTypeOfName[ NHibernateUtil.Binary.Name ] = NHibernateUtil.Binary; ! typeByTypeOfName[ NHibernateUtil.BinaryBlob.Name ] = NHibernateUtil.BinaryBlob; ! typeByTypeOfName[ NHibernateUtil.Boolean.Name ] = NHibernateUtil.Boolean; ! typeByTypeOfName[ NHibernateUtil.Byte.Name ] = NHibernateUtil.Byte; ! typeByTypeOfName[ NHibernateUtil.Character.Name ] = NHibernateUtil.Character; ! typeByTypeOfName[ NHibernateUtil.StringClob.Name ] = NHibernateUtil.StringClob; ! typeByTypeOfName[ NHibernateUtil.CultureInfo.Name ] = NHibernateUtil.CultureInfo; ! typeByTypeOfName[ NHibernateUtil.DateTime.Name ] = NHibernateUtil.DateTime; ! typeByTypeOfName[ NHibernateUtil.Date.Name ] = NHibernateUtil.Date; ! typeByTypeOfName[ NHibernateUtil.Decimal.Name ] = NHibernateUtil.Decimal; ! typeByTypeOfName[ NHibernateUtil.Double.Name ] = NHibernateUtil.Double; ! typeByTypeOfName[ NHibernateUtil.Guid.Name ] = NHibernateUtil.Guid; ! typeByTypeOfName[ NHibernateUtil.Int16.Name ] = NHibernateUtil.Int16; ! typeByTypeOfName[ NHibernateUtil.Int32.Name ] = NHibernateUtil.Int32; ! typeByTypeOfName[ NHibernateUtil.Int64.Name ] = NHibernateUtil.Int64; ! typeByTypeOfName[ NHibernateUtil.SByte.Name ] = NHibernateUtil.SByte; ! typeByTypeOfName[ NHibernateUtil.String.Name ] = NHibernateUtil.String; ! typeByTypeOfName[ NHibernateUtil.Single.Name ] = NHibernateUtil.Single; ! typeByTypeOfName[ NHibernateUtil.Timestamp.Name ] = NHibernateUtil.Timestamp; ! typeByTypeOfName[ NHibernateUtil.Time.Name ] = NHibernateUtil.Time; ! typeByTypeOfName[ NHibernateUtil.TrueFalse.Name ] = NHibernateUtil.TrueFalse; ! typeByTypeOfName[ NHibernateUtil.YesNo.Name ] = NHibernateUtil.YesNo; ! typeByTypeOfName[ NHibernateUtil.Ticks.Name ] = NHibernateUtil.Ticks; ! typeByTypeOfName[ NHibernateUtil.TimeSpan.Name ] = NHibernateUtil.TimeSpan; ! typeByTypeOfName[ NHibernateUtil.Class.Name ] = NHibernateUtil.Class; ! typeByTypeOfName[ typeof( System.Type ).FullName ] = NHibernateUtil.Class; ! typeByTypeOfName[ typeof( System.Type ).AssemblyQualifiedName ] = NHibernateUtil.Class; // need to do add the key "Serializable" because the hbm files will have a // type="Serializable", but the SerializableType returns the Name as // "serializable - System.Object for the default SerializableType. ! typeByTypeOfName[ "Serializable" ] = NHibernateUtil.Serializable; ! typeByTypeOfName[ NHibernateUtil.Serializable.Name ] = NHibernateUtil.Serializable; // object needs to have both class and serializable setup before it can // be created. ! typeByTypeOfName[ typeof( Object ).FullName ] = NHibernateUtil.Object; ! typeByTypeOfName[ typeof( Object ).AssemblyQualifiedName ] = NHibernateUtil.Object; ! typeByTypeOfName[ NHibernateUtil.Object.Name ] = NHibernateUtil.Object; // These are in here for Hibernate mapping compatibility ! typeByTypeOfName[ "binary" ] = NHibernateUtil.Binary; ! typeByTypeOfName[ "boolean" ] = NHibernateUtil.Boolean; ! typeByTypeOfName[ "byte" ] = NHibernateUtil.Byte; ! typeByTypeOfName[ "character" ] = NHibernateUtil.Character; ! typeByTypeOfName[ "class" ] = NHibernateUtil.Class; ! typeByTypeOfName[ "locale" ] = NHibernateUtil.CultureInfo; ! typeByTypeOfName[ "date" ] = NHibernateUtil.DateTime; ! typeByTypeOfName[ "big_decimal" ] = NHibernateUtil.Decimal; ! typeByTypeOfName[ "double" ] = NHibernateUtil.Double; ! typeByTypeOfName[ "short" ] = NHibernateUtil.Int16; ! typeByTypeOfName[ "integer" ] = NHibernateUtil.Int32; ! typeByTypeOfName[ "long" ] = NHibernateUtil.Int64; ! typeByTypeOfName[ "float" ] = NHibernateUtil.Single; ! typeByTypeOfName[ "serializable" ] = NHibernateUtil.Serializable; ! typeByTypeOfName[ "string" ] = NHibernateUtil.String; ! typeByTypeOfName[ "timestamp" ] = NHibernateUtil.Timestamp; ! typeByTypeOfName[ "time" ] = NHibernateUtil.Time; ! typeByTypeOfName[ "true_false" ] = NHibernateUtil.TrueFalse; ! typeByTypeOfName[ "yes_no" ] = NHibernateUtil.YesNo; ! typeByTypeOfName[ "object" ] = NHibernateUtil.Object; ! getTypeDelegatesWithLength.Add( NHibernateUtil.AnsiString.Name, new GetNullableTypeWithLength( GetAnsiStringType ) ); ! getTypeDelegatesWithLength.Add( NHibernateUtil.Binary.Name, new GetNullableTypeWithLength( GetBinaryType ) ); ! getTypeDelegatesWithLength.Add( NHibernateUtil.Serializable.Name, new GetNullableTypeWithLength( GetSerializableType ) ); ! getTypeDelegatesWithLength.Add( NHibernateUtil.String.Name, new GetNullableTypeWithLength( GetStringType ) ); ! getTypeDelegatesWithLength.Add( NHibernateUtil.Class.Name, new GetNullableTypeWithLength( GetTypeType ) ); ! getTypeDelegatesWithPrecision.Add( NHibernateUtil.Decimal.Name, new GetNullableTypeWithPrecision( GetDecimalType ) ); } *************** *** 456,464 **** else if( typeof( ILifecycle ).IsAssignableFrom( typeClass ) ) { ! type = NHibernate.Entity( typeClass ); } else if( typeClass.IsEnum ) { ! type = NHibernate.Enum( typeClass ); } else if( typeClass.IsSerializable ) --- 456,464 ---- else if( typeof( ILifecycle ).IsAssignableFrom( typeClass ) ) { ! type = NHibernateUtil.Entity( typeClass ); } else if( typeClass.IsEnum ) { ! type = NHibernateUtil.Enum( typeClass ); } else if( typeClass.IsSerializable ) *************** *** 481,485 **** public static NullableType GetAnsiStringType() { ! return NHibernate.AnsiString; } --- 481,485 ---- public static NullableType GetAnsiStringType() { ! return NHibernateUtil.AnsiString; } *************** *** 491,495 **** public static NullableType GetAnsiStringType( int length ) { ! string key = GetKeyForLengthBased( NHibernate.AnsiString.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; --- 491,495 ---- public static NullableType GetAnsiStringType( int length ) { ! string key = GetKeyForLengthBased( NHibernateUtil.AnsiString.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; *************** *** 520,524 **** public static NullableType GetBinaryType() { ! return NHibernate.Binary; } --- 520,524 ---- public static NullableType GetBinaryType() { ! return NHibernateUtil.Binary; } *************** *** 538,545 **** if( length == 0 ) { ! return NHibernate.Binary; } ! string key = GetKeyForLengthBased( NHibernate.Binary.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; if( returnType == null ) --- 538,545 ---- if( length == 0 ) { ! return NHibernateUtil.Binary; } ! string key = GetKeyForLengthBased( NHibernateUtil.Binary.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; if( returnType == null ) *************** *** 559,563 **** public static NullableType GetBooleanType() { ! return NHibernate.Boolean; } --- 559,563 ---- public static NullableType GetBooleanType() { ! return NHibernateUtil.Boolean; } *************** *** 568,572 **** public static NullableType GetByteType() { ! return NHibernate.Byte; } --- 568,572 ---- public static NullableType GetByteType() { ! return NHibernateUtil.Byte; } *************** *** 577,581 **** public static NullableType GetCharType() { ! return NHibernate.Character; } --- 577,581 ---- public static NullableType GetCharType() { ! return NHibernateUtil.Character; } *************** *** 586,590 **** public static NullableType GetCultureInfoType() { ! return NHibernate.CultureInfo; } --- 586,590 ---- public static NullableType GetCultureInfoType() { ! return NHibernateUtil.CultureInfo; } *************** *** 595,599 **** public static NullableType GetDateTimeType() { ! return NHibernate.DateTime; } --- 595,599 ---- public static NullableType GetDateTimeType() { ! return NHibernateUtil.DateTime; } *************** *** 604,608 **** public static NullableType GetDateType() { ! return NHibernate.Date; } --- 604,608 ---- public static NullableType GetDateType() { ! return NHibernateUtil.Date; } *************** *** 614,618 **** public static NullableType GetDecimalType() { ! return NHibernate.Decimal; } --- 614,618 ---- public static NullableType GetDecimalType() { ! return NHibernateUtil.Decimal; } *************** *** 625,629 **** public static NullableType GetDecimalType( byte precision, byte scale ) { ! string key = GetKeyForPrecisionScaleBased( NHibernate.Decimal.Name, precision, scale ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; if( returnType == null ) --- 625,629 ---- public static NullableType GetDecimalType( byte precision, byte scale ) { ! string key = GetKeyForPrecisionScaleBased( NHibernateUtil.Decimal.Name, precision, scale ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; if( returnType == null ) *************** *** 643,647 **** public static NullableType GetDoubleType() { ! return NHibernate.Double; } --- 643,647 ---- public static NullableType GetDoubleType() { ! return NHibernateUtil.Double; } *************** *** 652,656 **** public static NullableType GetGuidType() { ! return NHibernate.Guid; } --- 652,656 ---- public static NullableType GetGuidType() { ! return NHibernateUtil.Guid; } *************** *** 661,665 **** public static NullableType GetInt16Type() { ! return NHibernate.Int16; } --- 661,665 ---- public static NullableType GetInt16Type() { ! return NHibernateUtil.Int16; } *************** *** 670,674 **** public static NullableType GetInt32Type() { ! return NHibernate.Int32; } --- 670,674 ---- public static NullableType GetInt32Type() { ! return NHibernateUtil.Int32; } *************** *** 679,683 **** public static NullableType GetInt64Type() { ! return NHibernate.Int64; } --- 679,683 ---- public static NullableType GetInt64Type() { ! return NHibernateUtil.Int64; } *************** *** 688,692 **** public static IType GetObjectType() { ! return NHibernate.Object; } --- 688,692 ---- public static IType GetObjectType() { ! return NHibernateUtil.Object; } *************** *** 697,701 **** public static NullableType GetSingleType() { ! return NHibernate.Single; } --- 697,701 ---- public static NullableType GetSingleType() { ! return NHibernateUtil.Single; } *************** *** 706,710 **** public static NullableType GetSerializableType() { ! return NHibernate.Serializable; } --- 706,710 ---- public static NullableType GetSerializableType() { ! return NHibernateUtil.Serializable; } *************** *** 772,776 **** public static NullableType GetSerializableType( int length ) { ! string key = GetKeyForLengthBased( NHibernate.Serializable.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; --- 772,776 ---- public static NullableType GetSerializableType( int length ) { ! string key = GetKeyForLengthBased( NHibernateUtil.Serializable.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; *************** *** 791,795 **** public static NullableType GetStringType() { ! return NHibernate.String; } --- 791,795 ---- public static NullableType GetStringType() { ! return NHibernateUtil.String; } *************** *** 801,805 **** public static NullableType GetStringType( int length ) { ! string key = GetKeyForLengthBased( NHibernate.String.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; --- 801,805 ---- public static NullableType GetStringType( int length ) { ! string key = GetKeyForLengthBased( NHibernateUtil.String.Name, length ); NullableType returnType = ( NullableType ) typeByTypeOfName[ key ]; *************** *** 820,824 **** public static NullableType GetTicksType() { ! return NHibernate.Ticks; } --- 820,824 ---- public static NullableType GetTicksType() { ! return NHibernateUtil.Ticks; } *************** *** 829,833 **** public static NullableType GetTimeSpanType() { ! return NHibernate.TimeSpan; } --- 829,833 ---- public static NullableType GetTimeSpanType() { ! return NHibernateUtil.TimeSpan; } *************** *** 838,842 **** public static NullableType GetTimestampType() { ! return NHibernate.Timestamp; } --- 838,842 ---- public static NullableType GetTimestampType() { ! return NHibernateUtil.Timestamp; } *************** *** 847,851 **** public static NullableType GetTimeType() { ! return NHibernate.Time; } --- 847,851 ---- public static NullableType GetTimeType() { ! return NHibernateUtil.Time; } *************** *** 856,860 **** public static NullableType GetTrueFalseType() { ! return NHibernate.TrueFalse; } --- 856,860 ---- public static NullableType GetTrueFalseType() { ! return NHibernateUtil.TrueFalse; } *************** *** 865,869 **** public static NullableType GetTypeType() { ! return NHibernate.Class; } --- 865,869 ---- public static NullableType GetTypeType() { ! return NHibernateUtil.Class; } *************** *** 894,898 **** public static NullableType GetYesNoType() { ! return NHibernate.YesNo; } --- 894,898 ---- public static NullableType GetYesNoType() { ! return NHibernateUtil.YesNo; } Index: ObjectType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ObjectType.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ObjectType.cs 31 Dec 2004 23:54:56 -0000 1.9 --- ObjectType.cs 17 Jan 2005 03:40:58 -0000 1.10 *************** *** 53,57 **** /// <summary></summary> ! internal ObjectType() : this( NHibernate.Class, NHibernate.Serializable ) { } --- 53,57 ---- /// <summary></summary> ! internal ObjectType() : this( NHibernateUtil.Class, NHibernateUtil.Serializable ) { } *************** *** 200,204 **** public override string ToXML( object value, ISessionFactoryImplementor factory ) { ! return NHibernate.Entity( value.GetType() ).ToXML( value, factory ); } --- 200,204 ---- public override string ToXML( object value, ISessionFactoryImplementor factory ) { ! return NHibernateUtil.Entity( value.GetType() ).ToXML( value, factory ); } |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate/Impl Modified Files: QueryImpl.cs SessionImpl.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** SessionImpl.cs 1 Jan 2005 03:36:43 -0000 1.59 --- SessionImpl.cs 17 Jan 2005 03:40:57 -0000 1.60 *************** *** 555,559 **** } ! if( !NHibernate.IsInitialized( obj ) ) { throw new PersistentObjectException( "uninitialized proxy passed to save()" ); --- 555,559 ---- } ! if( !NHibernateUtil.IsInitialized( obj ) ) { throw new PersistentObjectException( "uninitialized proxy passed to save()" ); *************** *** 609,613 **** } ! if( !NHibernate.IsInitialized( obj ) ) { throw new PersistentObjectException( "uninitialized proxy passed to save()" ); --- 609,613 ---- } ! if( !NHibernateUtil.IsInitialized( obj ) ) { throw new PersistentObjectException( "uninitialized proxy passed to save()" ); *************** *** 1247,1251 **** { IClassPersister persister = GetPersister( ( ( EntityType ) type ).PersistentClass ); ! if( persister.HasProxy && !NHibernate.IsInitialized( value ) ) { ReassociateProxy( value ); --- 1247,1251 ---- { IClassPersister persister = GetPersister( ( ( EntityType ) type ).PersistentClass ); ! if( persister.HasProxy && !NHibernateUtil.IsInitialized( value ) ) { ReassociateProxy( value ); *************** *** 1278,1282 **** } ! if( !NHibernate.IsInitialized( obj ) ) { ReassociateProxy( obj ); --- 1278,1282 ---- } ! if( !NHibernateUtil.IsInitialized( obj ) ) { ReassociateProxy( obj ); *************** *** 1321,1325 **** } ! if( !NHibernate.IsInitialized( obj ) ) { ReassociateProxy( obj ); --- 1321,1325 ---- } ! if( !NHibernateUtil.IsInitialized( obj ) ) { ReassociateProxy( obj ); *************** *** 1417,1421 **** } ! if( !NHibernate.IsInitialized( obj ) ) { ReassociateProxy( obj ); --- 1417,1421 ---- } ! if( !NHibernateUtil.IsInitialized( obj ) ) { ReassociateProxy( obj ); *************** *** 2383,2387 **** } ! if( !NHibernate.IsInitialized( obj ) ) { ReassociateProxy( obj ); --- 2383,2387 ---- } ! if( !NHibernateUtil.IsInitialized( obj ) ) { ReassociateProxy( obj ); Index: QueryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/QueryImpl.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** QueryImpl.cs 5 Jan 2005 02:47:05 -0000 1.19 --- QueryImpl.cs 17 Jan 2005 03:40:57 -0000 1.20 *************** *** 162,166 **** public IQuery SetAnsiString( int position, string val ) { ! SetParameter( position, val, NHibernate.AnsiString ); return this; } --- 162,166 ---- public IQuery SetAnsiString( int position, string val ) { ! SetParameter( position, val, NHibernateUtil.AnsiString ); return this; } *************** *** 174,178 **** public IQuery SetString( int position, string val ) { ! SetParameter( position, val, NHibernate.String ); return this; } --- 174,178 ---- public IQuery SetString( int position, string val ) { ! SetParameter( position, val, NHibernateUtil.String ); return this; } *************** *** 186,190 **** public IQuery SetCharacter( int position, char val ) { ! SetParameter( position, val, NHibernate.Character ); // ); return this; } --- 186,190 ---- public IQuery SetCharacter( int position, char val ) { ! SetParameter( position, val, NHibernateUtil.Character ); // ); return this; } *************** *** 198,202 **** public IQuery SetBoolean( int position, bool val ) { ! SetParameter( position, val, NHibernate.Boolean ); // ); return this; } --- 198,202 ---- public IQuery SetBoolean( int position, bool val ) { ! SetParameter( position, val, NHibernateUtil.Boolean ); // ); return this; } *************** *** 210,214 **** public IQuery SetByte( int position, byte val ) { ! SetParameter( position, val, NHibernate.Byte ); return this; } --- 210,214 ---- public IQuery SetByte( int position, byte val ) { ! SetParameter( position, val, NHibernateUtil.Byte ); return this; } *************** *** 222,226 **** public IQuery SetInt16( int position, short val ) { ! SetParameter( position, val, NHibernate.Int16 ); return this; } --- 222,226 ---- public IQuery SetInt16( int position, short val ) { ! SetParameter( position, val, NHibernateUtil.Int16 ); return this; } *************** *** 234,238 **** public IQuery SetInt32( int position, int val ) { ! SetParameter( position, val, NHibernate.Int32 ); return this; } --- 234,238 ---- public IQuery SetInt32( int position, int val ) { ! SetParameter( position, val, NHibernateUtil.Int32 ); return this; } *************** *** 246,250 **** public IQuery SetInt64( int position, long val ) { ! SetParameter( position, val, NHibernate.Int64 ); return this; } --- 246,250 ---- public IQuery SetInt64( int position, long val ) { ! SetParameter( position, val, NHibernateUtil.Int64 ); return this; } *************** *** 258,262 **** public IQuery SetSingle( int position, float val ) { ! SetParameter( position, val, NHibernate.Single ); return this; } --- 258,262 ---- public IQuery SetSingle( int position, float val ) { ! SetParameter( position, val, NHibernateUtil.Single ); return this; } *************** *** 270,274 **** public IQuery SetDouble( int position, double val ) { ! SetParameter( position, val, NHibernate.Double ); return this; } --- 270,274 ---- public IQuery SetDouble( int position, double val ) { ! SetParameter( position, val, NHibernateUtil.Double ); return this; } *************** *** 282,286 **** public IQuery SetBinary( int position, byte[ ] val ) { ! SetParameter( position, val, NHibernate.Binary ); return this; } --- 282,286 ---- public IQuery SetBinary( int position, byte[ ] val ) { ! SetParameter( position, val, NHibernateUtil.Binary ); return this; } *************** *** 294,298 **** public IQuery SetDecimal( int position, decimal val ) { ! SetParameter( position, val, NHibernate.Decimal ); return this; } --- 294,298 ---- public IQuery SetDecimal( int position, decimal val ) { ! SetParameter( position, val, NHibernateUtil.Decimal ); return this; } *************** *** 306,310 **** public IQuery SetDateTime( int position, DateTime val ) { ! SetParameter( position, val, NHibernate.DateTime ); return this; } --- 306,310 ---- public IQuery SetDateTime( int position, DateTime val ) { ! SetParameter( position, val, NHibernateUtil.DateTime ); return this; } *************** *** 318,322 **** public IQuery SetTime( int position, DateTime val ) { ! SetParameter( position, val, NHibernate.DateTime ); //TODO: change to time return this; } --- 318,322 ---- public IQuery SetTime( int position, DateTime val ) { ! SetParameter( position, val, NHibernateUtil.DateTime ); //TODO: change to time return this; } *************** *** 330,334 **** public IQuery SetTimestamp( int position, DateTime val ) { ! SetParameter( position, val, NHibernate.Timestamp ); return this; } --- 330,334 ---- public IQuery SetTimestamp( int position, DateTime val ) { ! SetParameter( position, val, NHibernateUtil.Timestamp ); return this; } *************** *** 342,346 **** public IQuery SetEntity( int position, object val ) { ! SetParameter( position, val, NHibernate.Entity( NHibernateProxyHelper.GetClass( val ) ) ); return this; } --- 342,346 ---- public IQuery SetEntity( int position, object val ) { ! SetParameter( position, val, NHibernateUtil.Entity( NHibernateProxyHelper.GetClass( val ) ) ); return this; } *************** *** 354,358 **** public IQuery SetEnum( int position, Enum val ) { ! SetParameter( position, val, NHibernate.Enum( val.GetType() ) ); return this; } --- 354,358 ---- public IQuery SetEnum( int position, Enum val ) { ! SetParameter( position, val, NHibernateUtil.Enum( val.GetType() ) ); return this; } *************** *** 366,370 **** public IQuery SetAnsiString( string name, string val ) { ! SetParameter( name, val, NHibernate.AnsiString ); return this; } --- 366,370 ---- public IQuery SetAnsiString( string name, string val ) { ! SetParameter( name, val, NHibernateUtil.AnsiString ); return this; } *************** *** 378,382 **** public IQuery SetString( string name, string val ) { ! SetParameter( name, val, NHibernate.String ); return this; } --- 378,382 ---- public IQuery SetString( string name, string val ) { ! SetParameter( name, val, NHibernateUtil.String ); return this; } *************** *** 390,394 **** public IQuery SetCharacter( string name, char val ) { ! SetParameter( name, val, NHibernate.Character ); return this; } --- 390,394 ---- public IQuery SetCharacter( string name, char val ) { ! SetParameter( name, val, NHibernateUtil.Character ); return this; } *************** *** 402,406 **** public IQuery SetBoolean( string name, bool val ) { ! SetParameter( name, val, NHibernate.Boolean ); return this; } --- 402,406 ---- public IQuery SetBoolean( string name, bool val ) { ! SetParameter( name, val, NHibernateUtil.Boolean ); return this; } *************** *** 414,418 **** public IQuery SetByte( string name, byte val ) { ! SetParameter( name, val, NHibernate.Byte ); return this; } --- 414,418 ---- public IQuery SetByte( string name, byte val ) { ! SetParameter( name, val, NHibernateUtil.Byte ); return this; } *************** *** 426,430 **** public IQuery SetInt16( string name, short val ) { ! SetParameter( name, val, NHibernate.Int16 ); return this; } --- 426,430 ---- public IQuery SetInt16( string name, short val ) { ! SetParameter( name, val, NHibernateUtil.Int16 ); return this; } *************** *** 438,442 **** public IQuery SetInt32( string name, int val ) { ! SetParameter( name, val, NHibernate.Int32 ); return this; } --- 438,442 ---- public IQuery SetInt32( string name, int val ) { ! SetParameter( name, val, NHibernateUtil.Int32 ); return this; } *************** *** 450,454 **** public IQuery SetInt64( string name, long val ) { ! SetParameter( name, val, NHibernate.Int64 ); return this; } --- 450,454 ---- public IQuery SetInt64( string name, long val ) { ! SetParameter( name, val, NHibernateUtil.Int64 ); return this; } *************** *** 462,466 **** public IQuery SetSingle( string name, float val ) { ! SetParameter( name, val, NHibernate.Single ); return this; } --- 462,466 ---- public IQuery SetSingle( string name, float val ) { ! SetParameter( name, val, NHibernateUtil.Single ); return this; } *************** *** 474,478 **** public IQuery SetDouble( string name, double val ) { ! SetParameter( name, val, NHibernate.Double ); return this; } --- 474,478 ---- public IQuery SetDouble( string name, double val ) { ! SetParameter( name, val, NHibernateUtil.Double ); return this; } *************** *** 486,490 **** public IQuery SetBinary( string name, byte[ ] val ) { ! SetParameter( name, val, NHibernate.Binary ); return this; } --- 486,490 ---- public IQuery SetBinary( string name, byte[ ] val ) { ! SetParameter( name, val, NHibernateUtil.Binary ); return this; } *************** *** 498,502 **** public IQuery SetDecimal( string name, decimal val ) { ! SetParameter( name, val, NHibernate.Decimal ); return this; } --- 498,502 ---- public IQuery SetDecimal( string name, decimal val ) { ! SetParameter( name, val, NHibernateUtil.Decimal ); return this; } *************** *** 510,514 **** public IQuery SetDateTime( string name, DateTime val ) { ! SetParameter( name, val, NHibernate.DateTime ); return this; } --- 510,514 ---- public IQuery SetDateTime( string name, DateTime val ) { ! SetParameter( name, val, NHibernateUtil.DateTime ); return this; } *************** *** 522,526 **** public IQuery SetTime( string name, DateTime val ) { ! SetParameter( name, val, NHibernate.DateTime ); //TODO: change to time return this; } --- 522,526 ---- public IQuery SetTime( string name, DateTime val ) { ! SetParameter( name, val, NHibernateUtil.DateTime ); //TODO: change to time return this; } *************** *** 534,538 **** public IQuery SetTimestamp( string name, DateTime val ) { ! SetParameter( name, val, NHibernate.Timestamp ); return this; } --- 534,538 ---- public IQuery SetTimestamp( string name, DateTime val ) { ! SetParameter( name, val, NHibernateUtil.Timestamp ); return this; } *************** *** 546,550 **** public IQuery SetEntity( string name, object val ) { ! SetParameter( name, val, NHibernate.Entity( NHibernateProxyHelper.GetClass( val ) ) ); return this; } --- 546,550 ---- public IQuery SetEntity( string name, object val ) { ! SetParameter( name, val, NHibernateUtil.Entity( NHibernateProxyHelper.GetClass( val ) ) ); return this; } *************** *** 558,562 **** public IQuery SetEnum( string name, Enum val ) { ! SetParameter( name, val, NHibernate.Enum( val.GetType() ) ); return this; } --- 558,562 ---- public IQuery SetEnum( string name, Enum val ) { ! SetParameter( name, val, NHibernateUtil.Enum( val.GetType() ) ); return this; } *************** *** 614,618 **** } } ! return NHibernate.Entity( clazz ); } else --- 614,618 ---- } } ! return NHibernateUtil.Entity( clazz ); } else |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate/Persister Modified Files: NormalizedEntityPersister.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: NormalizedEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/NormalizedEntityPersister.cs,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** NormalizedEntityPersister.cs 31 Dec 2004 21:49:46 -0000 1.37 --- NormalizedEntityPersister.cs 17 Jan 2005 03:40:58 -0000 1.38 *************** *** 176,180 **** try { ! this.discriminatorType = ( IDiscriminatorType ) NHibernate.Int32; discriminatorValue = 0; this.discriminatorSQLString = "0"; --- 176,180 ---- try { ! this.discriminatorType = ( IDiscriminatorType ) NHibernateUtil.Int32; discriminatorValue = 0; this.discriminatorSQLString = "0"; |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate/Mapping Modified Files: IntegerValue.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: IntegerValue.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/IntegerValue.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IntegerValue.cs 31 Dec 2004 21:27:02 -0000 1.5 --- IntegerValue.cs 17 Jan 2005 03:40:58 -0000 1.6 *************** *** 17,21 **** public override IType Type { ! get { return NHibernate.Int32; } } } --- 17,21 ---- public override IType Type { ! get { return NHibernateUtil.Int32; } } } |
From: Michael D. <mik...@us...> - 2005-01-17 03:41:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11286/NHibernate/Hql Modified Files: PathExpressionParser.cs QueryTranslator.cs SelectParser.cs Log Message: Renamed NHibernate.NHibernate to NHibernate.NHibernateUtil. Index: QueryTranslator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** QueryTranslator.cs 31 Dec 2004 18:21:59 -0000 1.52 --- QueryTranslator.cs 17 Jan 2005 03:40:57 -0000 1.53 *************** *** 877,881 **** for( int k = 0; k < size; k++ ) { ! scalarTypes.Add( NHibernate.Entity( persisters[ k ].MappedClass ) ); string[ ] names = persisters[ k ].IdentifierColumnNames; --- 877,881 ---- for( int k = 0; k < size; k++ ) { ! scalarTypes.Add( NHibernateUtil.Entity( persisters[ k ].MappedClass ) ); string[ ] names = persisters[ k ].IdentifierColumnNames; Index: SelectParser.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/SelectParser.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SelectParser.cs 31 Dec 2004 18:22:14 -0000 1.10 --- SelectParser.cs 17 Jan 2005 03:40:57 -0000 1.11 *************** *** 142,146 **** if( "*".Equals( token ) ) { ! q.AddSelectScalar( NHibernate.Int32 ); } //special case } --- 142,146 ---- if( "*".Equals( token ) ) { ! q.AddSelectScalar( NHibernateUtil.Int32 ); } //special case } Index: PathExpressionParser.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/PathExpressionParser.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PathExpressionParser.cs 31 Dec 2004 18:41:47 -0000 1.19 --- PathExpressionParser.cs 17 Jan 2005 03:40:56 -0000 1.20 *************** *** 299,303 **** { IClassPersister p = q.GetPersisterForName( currentName ); ! type = NHibernate.Entity( p.MappedClass ); } else --- 299,303 ---- { IClassPersister p = q.GetPersisterForName( currentName ); ! type = NHibernateUtil.Entity( p.MappedClass ); } else *************** *** 671,675 **** { collectionElementColumns = new string[ ] {"count(*)"}; ! collectionElementType = NHibernate.Int32; } else if( token.Equals( CollectionMaxIndex ) ) --- 671,675 ---- { collectionElementColumns = new string[ ] {"count(*)"}; ! collectionElementType = NHibernateUtil.Int32; } else if( token.Equals( CollectionMaxIndex ) ) |
From: Michael D. <mik...@us...> - 2005-01-17 03:35:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10283/NHibernate/Type Modified Files: DateTimeType.cs Log Message: NH164 - Fixed DateTimeType to allow dates before 1753. If your db does not support it then don't pass a date before then - instead use the Nullables library. Index: DateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateTimeType.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DateTimeType.cs 31 Dec 2004 23:52:20 -0000 1.13 --- DateTimeType.cs 17 Jan 2005 03:35:24 -0000 1.14 *************** *** 59,73 **** { IDataParameter parm = st.Parameters[ index ] as IDataParameter; ! parm.DbType = DbType.DateTime; ! //TODO: figure out if this is a good solution for NULL DATES ! if( ( DateTime ) value < new DateTime( 1753, 1, 1 ) ) ! { ! parm.Value = DBNull.Value; ! } ! else ! { ! DateTime dateValue = ( DateTime ) value; ! parm.Value = new DateTime( dateValue.Year, dateValue.Month, dateValue.Day, dateValue.Hour, dateValue.Minute, dateValue.Second ); ! } } --- 59,64 ---- { IDataParameter parm = st.Parameters[ index ] as IDataParameter; ! DateTime dateValue = ( DateTime ) value; ! parm.Value = new DateTime( dateValue.Year, dateValue.Month, dateValue.Day, dateValue.Hour, dateValue.Minute, dateValue.Second ); } *************** *** 80,95 **** public override bool Equals( object x, object y ) { ! if( x == y ) { return true; } ! // DateTime can't be null because it is a struct - so comparing ! // them this way is useless - instead use the magic number... ! //if (x==null || y==null) return false; ! DateTime date1 = ( x == null ) ? DateTime.MinValue : ( DateTime ) x; ! DateTime date2 = ( y == null ) ? DateTime.MinValue : ( DateTime ) y; - //return date1.Equals(date2); return ( date1.Year == date2.Year && date1.Month == date2.Month && --- 71,87 ---- public override bool Equals( object x, object y ) { ! if( x==y ) { return true; } ! ! if( x==null || y==null ) ! { ! return false; ! } ! DateTime date1 = ( DateTime ) x; ! DateTime date2 = ( DateTime ) y; return ( date1.Year == date2.Year && date1.Month == date2.Month && |
From: Michael D. <mik...@us...> - 2005-01-17 03:32:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9553/NHibernate.DomainModel Modified Files: Abstract.cs Foo.cs FooBar.hbm.xml Simple.cs Log Message: DateTime values always have a default value now. This is needed because of the change to DateTimeType so it no longer changes anything less than 1753 to null. Index: Abstract.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Abstract.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Abstract.cs 18 Nov 2004 02:45:43 -0000 1.5 --- Abstract.cs 17 Jan 2005 03:31:52 -0000 1.6 *************** *** 7,11 **** public abstract class Abstract : Foo, AbstractProxy { ! private DateTime _time; private Iesi.Collections.ISet _abstracts; --- 7,13 ---- public abstract class Abstract : Foo, AbstractProxy { ! // added an initialization because MsSql errors out when inserting ! // dates outside of the range - TODO: fix this to be a DATE type ! private DateTime _time = new DateTime( 2001, 12, 1, 1, 1, 1 ); private Iesi.Collections.ISet _abstracts; Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** FooBar.hbm.xml 5 Jan 2005 03:26:35 -0000 1.21 --- FooBar.hbm.xml 17 Jan 2005 03:31:52 -0000 1.22 *************** *** 147,150 **** --- 147,154 ---- <key column="foo_id"/> <index column="i"/> + <!-- + in h2.0.3 this was type="date", but with ADO.NET there is no DbType that + is equivalent to the JDBC type DATE and java.sql.Date + --> <element column="date_" type="DateTime"/> </array> Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Foo.cs 5 Jan 2005 03:26:35 -0000 1.16 --- Foo.cs 17 Jan 2005 03:31:52 -0000 1.17 *************** *** 331,335 **** { _string = "a string"; ! _date = new DateTime(2123,2,3); _timestamp = DateTime.Now; _integer = -666; --- 331,335 ---- { _string = "a string"; ! _date = new DateTime( 1970, 01, 01 ); _timestamp = DateTime.Now; _integer = -666; *************** *** 349,353 **** "foo", "bar" }; ! _component = new FooComponent("foo", 12, new DateTime[] { _date, _timestamp, DateTime.MinValue, new DateTime( DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ) }, new FooComponent("bar", 666, new DateTime[] { new DateTime(1999,12,3), DateTime.MinValue }, null ) ); _component.Glarch = new Glarch(); _dependent = new Fee(); --- 349,354 ---- "foo", "bar" }; ! //_component = new FooComponent("foo", 12, new DateTime[] { _date, _timestamp, DateTime.MinValue, new DateTime( DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ) }, new FooComponent("bar", 666, new DateTime[] { new DateTime(1999,12,3), DateTime.MinValue }, null ) ); ! _component = new FooComponent("foo", 12, new DateTime[] { _date, _timestamp, new DateTime( DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ) }, new FooComponent("bar", 666, new DateTime[] { new DateTime(1999,12,3) }, null ) ); _component.Glarch = new Glarch(); _dependent = new Fee(); Index: Simple.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Simple.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Simple.cs 8 Jun 2004 11:44:47 -0000 1.3 --- Simple.cs 17 Jan 2005 03:31:52 -0000 1.4 *************** *** 8,12 **** private string address; private int count; ! private DateTime date; private Simple other; --- 8,14 ---- private string address; private int count; ! // initializing to a value that is ms independent because of MsSql millisecond ! // accurracy issues ! private DateTime date = new DateTime( 2004, 01, 01, 12, 00, 00, 00 ); private Simple other; |
From: Michael D. <mik...@us...> - 2005-01-17 03:32:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9553/NHibernate.DomainModel/NHSpecific Modified Files: BasicClass.cs Child.cs Log Message: DateTime values always have a default value now. This is needed because of the change to DateTimeType so it no longer changes anything less than 1753 to null. Index: Child.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/Child.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Child.cs 9 Jun 2004 01:04:35 -0000 1.1 --- Child.cs 17 Jan 2005 03:31:53 -0000 1.2 *************** *** 18,22 **** private Child[] _friends; ! private System.DateTime _favoriteDate; public Child() --- 18,23 ---- private Child[] _friends; ! // default it to today - ms sql has problems with null datetimes ! private System.DateTime _favoriteDate = DateTime.Today; public Child() Index: BasicClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicClass.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BasicClass.cs 30 Dec 2004 16:25:12 -0000 1.8 --- BasicClass.cs 17 Jan 2005 03:31:53 -0000 1.9 *************** *** 15,19 **** private System.Type _classProperty; private System.Globalization.CultureInfo _cultureInfoProperty; ! private DateTime _dateTimeProperty; private short _int16Property; private int _int32Property; --- 15,19 ---- private System.Type _classProperty; private System.Globalization.CultureInfo _cultureInfoProperty; ! private DateTime _dateTimeProperty = DateTime.Today; private short _int16Property; private int _int32Property; *************** *** 33,37 **** private IDictionary _stringMap; private Iesi.Collections.ISet _stringSet; - private object _dummyObject = new object(); public BasicClass() --- 33,36 ---- |
From: Michael D. <mik...@us...> - 2005-01-16 19:55:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13816/NHibernate/Impl Modified Files: EnumerableImpl.cs Log Message: NH-183: EnumerableImpl now implements IDisposable. Index: EnumerableImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/EnumerableImpl.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EnumerableImpl.cs 31 Dec 2004 19:51:20 -0000 1.8 --- EnumerableImpl.cs 16 Jan 2005 19:55:42 -0000 1.9 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Collections; using System.Data; *************** *** 13,17 **** /// This is the IteratorImpl in H2.0.3 /// </remarks> ! internal class EnumerableImpl : IEnumerable, IEnumerator { private static readonly ILog log = LogManager.GetLogger( typeof( EnumerableImpl ) ); --- 14,18 ---- /// This is the IteratorImpl in H2.0.3 /// </remarks> ! internal class EnumerableImpl : IEnumerable, IEnumerator, IDisposable { private static readonly ILog log = LogManager.GetLogger( typeof( EnumerableImpl ) ); *************** *** 148,152 **** } } ! } \ No newline at end of file --- 149,175 ---- } + #region IDisposable Members + /// <summary> + /// Releases resources that the EnumerableImpl acquired. + /// </summary> + /// <remarks> + /// The command is closed and the reader is disposed. This allows other ADO.NET + /// related actions to occur without needing to move all the way through the + /// EnumerableImpl. + /// </remarks> + public void Dispose() + { + log.Debug( "disposing of enumerator" ); + // if there is still a possibility of moving next then we need to clean up + // the resources - otherwise the cleanup has already been done. + if( _hasNext ) + { + _currentResults = null; + _sess.Batcher.CloseQueryCommand( _cmd, _reader ); + } + } + + #endregion } ! } |
From: Michael D. <mik...@us...> - 2005-01-16 15:10:13
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23746 Modified Files: basic_mapping.xml Log Message: replaced reference to Aspect# with Castle.DynamicProxy in proxy documentation. Index: basic_mapping.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/basic_mapping.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** basic_mapping.xml 15 Jan 2005 18:07:44 -0000 1.7 --- basic_mapping.xml 16 Jan 2005 15:10:03 -0000 1.8 *************** *** 250,256 **** <para> The optional <literal>proxy</literal> attribute enables lazy initialization of persistent ! instances of the class. NHibernate will initially return Aspect# proxies which implement ! the named interface. The actual persistent object will be loaded when a method of the ! proxy is invoked. See "Proxies for Lazy Initialization" below. </para> --- 250,256 ---- <para> The optional <literal>proxy</literal> attribute enables lazy initialization of persistent ! instances of the class. NHibernate will initially return proxies generated by Castle.DynamicProxy ! which implement the named interface or extend the class. The actual persistent object will be ! loaded when a method of the proxy is invoked. See "Proxies for Lazy Initialization" below. </para> |
From: Michael D. <mik...@us...> - 2005-01-16 14:43:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18961/NHibernate/Id Modified Files: IPersistentIdentifierGenerator.cs SequenceGenerator.cs TableGenerator.cs Log Message: updated the xml comments. Index: TableGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/TableGenerator.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TableGenerator.cs 15 Jan 2005 21:16:13 -0000 1.13 --- TableGenerator.cs 16 Jan 2005 14:43:00 -0000 1.14 *************** *** 198,206 **** #endregion /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string[ ] SqlCreateStrings( Dialect.Dialect dialect ) { --- 198,212 ---- #endregion + #region IPersistentIdentifierGenerator Members + /// <summary> ! /// The SQL required to create the database objects for a TableGenerator. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param> ! /// <returns> ! /// An array of <see cref="String"/> objects that contain the Dialect specific sql to ! /// create the necessary database objects and to create the first value as <c>1</c> ! /// for the TableGenerator. ! /// </returns> public string[ ] SqlCreateStrings( Dialect.Dialect dialect ) { *************** *** 216,223 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string SqlDropString( Dialect.Dialect dialect ) { --- 222,231 ---- /// <summary> ! /// The SQL required to remove the underlying database objects for a TableGenerator. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param> ! /// <returns> ! /// A <see cref="String"/> that will drop the database objects for the TableGenerator. ! /// </returns> public string SqlDropString( Dialect.Dialect dialect ) { *************** *** 225,233 **** } ! /// <summary></summary> public object GeneratorKey() { return tableName; } } --- 233,248 ---- } ! /// <summary> ! /// Return a key unique to the underlying database objects for a TableGenerator. ! /// </summary> ! /// <returns> ! /// The configured table name. ! /// </returns> public object GeneratorKey() { return tableName; } + + #endregion } Index: SequenceGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/SequenceGenerator.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SequenceGenerator.cs 15 Jan 2005 21:16:13 -0000 1.8 --- SequenceGenerator.cs 16 Jan 2005 14:43:00 -0000 1.9 *************** *** 108,116 **** #endregion /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string[ ] SqlCreateStrings( Dialect.Dialect dialect ) { --- 108,121 ---- #endregion + #region IPersistentIdentifierGenerator Members + /// <summary> ! /// The SQL required to create the database objects for a SequenceGenerator. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param> ! /// <returns> ! /// An array of <see cref="String"/> objects that contain the Dialect specific sql to ! /// create the necessary database objects for the SequenceGenerator. ! /// </returns> public string[ ] SqlCreateStrings( Dialect.Dialect dialect ) { *************** *** 122,129 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string SqlDropString( Dialect.Dialect dialect ) { --- 127,136 ---- /// <summary> ! /// The SQL required to remove the underlying database objects for a SequenceGenerator. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param> ! /// <returns> ! /// A <see cref="String"/> that will drop the database objects for the SequenceGenerator. ! /// </returns> public string SqlDropString( Dialect.Dialect dialect ) { *************** *** 131,139 **** } ! /// <summary></summary> public object GeneratorKey() { return sequenceName; } } } \ No newline at end of file --- 138,154 ---- } ! /// <summary> ! /// Return a key unique to the underlying database objects for a SequenceGenerator. ! /// </summary> ! /// <returns> ! /// The configured sequence name. ! /// </returns> public object GeneratorKey() { return sequenceName; } + + #endregion + } } \ No newline at end of file Index: IPersistentIdentifierGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IPersistentIdentifierGenerator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IPersistentIdentifierGenerator.cs 15 Jan 2005 21:16:13 -0000 1.4 --- IPersistentIdentifierGenerator.cs 16 Jan 2005 14:43:00 -0000 1.5 *************** *** 1,2 **** --- 1,4 ---- + using System; + namespace NHibernate.Id { *************** *** 11,15 **** /// The SQL required to create the underlying database objects /// </summary> ! /// <param name="dialect"></param> string[ ] SqlCreateStrings( Dialect.Dialect dialect ); --- 13,21 ---- /// The SQL required to create the underlying database objects /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param> ! /// <returns> ! /// An array of <see cref="String"/> objects that contain the sql to create the ! /// necessary database objects. ! /// </returns> string[ ] SqlCreateStrings( Dialect.Dialect dialect ); *************** *** 17,21 **** /// The SQL required to remove the underlying database objects /// </summary> ! /// <param name="dialect"></param> string SqlDropString( Dialect.Dialect dialect ); --- 23,30 ---- /// The SQL required to remove the underlying database objects /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param> ! /// <returns> ! /// A <see cref="String"/> that will drop the database objects. ! /// </returns> string SqlDropString( Dialect.Dialect dialect ); *************** *** 23,26 **** --- 32,38 ---- /// Return a key unique to the underlying database objects. /// </summary> + /// <returns> + /// A key unique to the underlying database objects. + /// </returns> /// <remarks> /// Prevents us from trying to create/remove them multiple times |
From: Michael D. <mik...@us...> - 2005-01-15 21:18:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18653/NHibernate Modified Files: NHibernate-1.1.csproj Log Message: configured documentation file so if bad xml comments get in there we'll know when its compiled for NUnit Test. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** NHibernate-1.1.csproj 16 Dec 2004 21:52:56 -0000 1.66 --- NHibernate-1.1.csproj 15 Jan 2005 21:17:55 -0000 1.67 *************** *** 30,34 **** ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" ! DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" --- 30,34 ---- ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" ! DocumentationFile = "bin\Debug\NHibernate.xml" DebugSymbols = "true" FileAlignment = "4096" |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18367 Modified Files: Assigned.cs CounterGenerator.cs ForeignGenerator.cs GuidCombGenerator.cs GuidGenerator.cs IConfigurable.cs IdentifierGeneratorFactory.cs IdentityGenerator.cs IIdentifierGenerator.cs IPersistentIdentifierGenerator.cs SequenceGenerator.cs SequenceHiLoGenerator.cs TableGenerator.cs TableHiLoGenerator.cs UUIDHexGenerator.cs UUIDStringGenerator.cs Log Message: updated alot of the documentation. Index: TableGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/TableGenerator.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TableGenerator.cs 31 Dec 2004 18:57:22 -0000 1.12 --- TableGenerator.cs 15 Jan 2005 21:16:13 -0000 1.13 *************** *** 13,33 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that uses a database table to store the last /// generated value. /// </summary> /// <remarks> ! /// <para> /// It is not intended that applications use this strategy directly. However, /// it may be used to build other (efficient) strategies. The return type is /// <c>System.Int32</c> ! /// </para> ! /// <para> /// The hi value MUST be fetched in a seperate transaction to the <c>ISession</c> /// transaction so the generator must be able to obtain a new connection and commit it. /// Hence this implementation may not be used when the user is supplying connections. ! /// </para> ! /// <para> ! /// Mapping parameters supported are: <c>table</c>, <c>column</c> ! /// </para> /// </remarks> public class TableGenerator : IPersistentIdentifierGenerator, IConfigurable --- 13,33 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that uses a database table to store the last /// generated value. /// </summary> /// <remarks> ! /// <p> /// It is not intended that applications use this strategy directly. However, /// it may be used to build other (efficient) strategies. The return type is /// <c>System.Int32</c> ! /// </p> ! /// <p> /// The hi value MUST be fetched in a seperate transaction to the <c>ISession</c> /// transaction so the generator must be able to obtain a new connection and commit it. /// Hence this implementation may not be used when the user is supplying connections. ! /// </p> ! /// <p> ! /// The mapping parameters <c>table</c> and <c>column</c> are required. ! /// </p> /// </remarks> public class TableGenerator : IPersistentIdentifierGenerator, IConfigurable *************** *** 35,45 **** private static readonly ILog log = LogManager.GetLogger( typeof( TableGenerator ) ); ! /// <summary></summary> public const string Column = "column"; ! /// <summary></summary> public const string Table = "table"; ! /// <summary></summary> public const string Schema = "schema"; --- 35,51 ---- private static readonly ILog log = LogManager.GetLogger( typeof( TableGenerator ) ); ! /// <summary> ! /// The name of the column parameter. ! /// </summary> public const string Column = "column"; ! /// <summary> ! /// The name of the table parameter. ! /// </summary> public const string Table = "table"; ! /// <summary> ! /// The name of the schema parameter. ! /// </summary> public const string Schema = "schema"; *************** *** 50,59 **** private SqlString updateSql; /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="parms"></param> ! /// <param name="dialect"></param> public virtual void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { --- 56,68 ---- private SqlString updateSql; + #region IConfigurable Members + /// <summary> ! /// Configures the TableGenerator by reading the value of <c>table</c>, ! /// <c>column</c>, and <c>schema</c> from the <c>parms</c> parameter. /// </summary> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> public virtual void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { *************** *** 94,104 **** } /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> [MethodImpl( MethodImplOptions.Synchronized )] public virtual object Generate( ISessionImplementor session, object obj ) --- 103,118 ---- } + + #endregion + + #region IIdentifierGenerator Members /// <summary> ! /// Generate a <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/> ! /// for the identifier by selecting and updating a value in a table. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/>.</returns> [MethodImpl( MethodImplOptions.Synchronized )] public virtual object Generate( ISessionImplementor session, object obj ) *************** *** 182,185 **** --- 196,201 ---- } + #endregion + /// <summary> /// Index: UUIDStringGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/UUIDStringGenerator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UUIDStringGenerator.cs 31 Dec 2004 18:58:24 -0000 1.4 --- UUIDStringGenerator.cs 15 Jan 2005 21:16:13 -0000 1.5 *************** *** 6,15 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that returns a string of length /// 16. /// </summary> /// <remarks> /// <para> ! /// This string will NOT consist of only alphanumeric characters. Use /// this only if you don't mind unreadable identifiers. /// </para> --- 6,19 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that returns a string of length /// 16. /// </summary> /// <remarks> + /// <p> + /// This id generation strategy is specified in the mapping file as + /// <code><generator class="uuid.string" /></code> + /// </p> /// <para> ! /// The identifier string will NOT consist of only alphanumeric characters. Use /// this only if you don't mind unreadable identifiers. /// </para> *************** *** 20,30 **** public class UUIDStringGenerator : IIdentifierGenerator { /// <summary> ! /// /// </summary> ! /// <param name="cache"></param> ! /// <param name="obj"></param> ! /// <returns></returns> ! public object Generate( ISessionImplementor cache, object obj ) { byte[ ] guidInBytes = new byte[16]; --- 24,36 ---- public class UUIDStringGenerator : IIdentifierGenerator { + #region IIdentifierGenerator Members + /// <summary> ! /// Generate a new <see cref="String"/> for the identifier using the "uuid.string" algorithm. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="String"/>.</returns> ! public object Generate( ISessionImplementor session, object obj ) { byte[ ] guidInBytes = new byte[16]; *************** *** 41,44 **** --- 47,52 ---- return guidBuilder.ToString(); } + + #endregion } } \ No newline at end of file Index: IConfigurable.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IConfigurable.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IConfigurable.cs 31 Dec 2004 18:56:22 -0000 1.3 --- IConfigurable.cs 15 Jan 2005 21:16:13 -0000 1.4 *************** *** 14,20 **** /// This method is called just once, followed by instantiation. /// </summary> ! /// <param name="type"></param> ! /// <param name="parms">Param values that are keyed by parameter name.</param> ! /// <param name="d"></param> void Configure( IType type, IDictionary parms, Dialect.Dialect d ); } --- 14,20 ---- /// This method is called just once, followed by instantiation. /// </summary> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> void Configure( IType type, IDictionary parms, Dialect.Dialect d ); } Index: SequenceHiLoGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/SequenceHiLoGenerator.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SequenceHiLoGenerator.cs 31 Dec 2004 18:57:22 -0000 1.6 --- SequenceHiLoGenerator.cs 15 Jan 2005 21:16:13 -0000 1.7 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Collections; using System.Runtime.CompilerServices; *************** *** 13,24 **** /// </summary> /// <remarks> ! /// <para> ! /// The user may specify a maximum lo value to determine how often new hi values are /// fetched. If sequences are not avaliable, <c>TableHiLoGenerator</c> might be an /// alternative. ! /// </para> ! /// <para> ! /// The mapping parameters supported are: <c>sequence</c>, <c>max_lo</c> ! /// </para> /// </remarks> public class SequenceHiLoGenerator : SequenceGenerator --- 14,35 ---- /// </summary> /// <remarks> ! /// <p> ! /// This id generation strategy is specified in the mapping file as ! /// <code> ! /// <generator class="seqhilo"> ! /// <param name="sequence">uid_sequence</param> ! /// <param name="max_lo">max_lo_value</param> ! /// <param name="schema">db_schema</param> ! /// </generator> ! /// </code> ! /// </p> ! /// <p> ! /// The <c>sequence</c> parameter is required, the <c>max_lo</c> and <c>schema</c> are optional. ! /// </p> ! /// <p> ! /// The user may specify a <c>max_lo</c> value to determine how often new hi values are /// fetched. If sequences are not avaliable, <c>TableHiLoGenerator</c> might be an /// alternative. ! /// </p> /// </remarks> public class SequenceHiLoGenerator : SequenceGenerator *************** *** 26,30 **** private static readonly ILog log = LogManager.GetLogger( typeof( SequenceHiLoGenerator ) ); ! /// <summary></summary> public const string MaxLo = "max_lo"; --- 37,43 ---- private static readonly ILog log = LogManager.GetLogger( typeof( SequenceHiLoGenerator ) ); ! /// <summary> ! /// The name of the maximum low value parameter. ! /// </summary> public const string MaxLo = "max_lo"; *************** *** 34,46 **** private System.Type returnClass; /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="parms"></param> ! /// <param name="d"></param> ! public override void Configure( IType type, IDictionary parms, Dialect.Dialect d ) { ! base.Configure( type, parms, d ); maxLo = PropertiesHelper.GetInt32( MaxLo, parms, 9 ); lo = maxLo + 1; // so we "clock over" on the first invocation --- 47,62 ---- private System.Type returnClass; + #region IConfigurable Members + /// <summary> ! /// Configures the SequenceHiLoGenerator by reading the value of <c>sequence</c>, <c>max_lo</c>, ! /// and <c>schema</c> from the <c>parms</c> parameter. /// </summary> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> ! public override void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { ! base.Configure( type, parms, dialect ); maxLo = PropertiesHelper.GetInt32( MaxLo, parms, 9 ); lo = maxLo + 1; // so we "clock over" on the first invocation *************** *** 48,57 **** } /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> [MethodImpl( MethodImplOptions.Synchronized )] public override object Generate( ISessionImplementor session, object obj ) --- 64,78 ---- } + #endregion + + #region IIdentifierGenerator Members + /// <summary> ! /// Generate an <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/> ! /// for the identifier by using a database sequence. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/>.</returns> [MethodImpl( MethodImplOptions.Synchronized )] public override object Generate( ISessionImplementor session, object obj ) *************** *** 66,69 **** --- 87,92 ---- return IdentifierGeneratorFactory.CreateNumber( hi + lo++, returnClass ); } + #endregion + } } \ No newline at end of file Index: IdentityGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IdentityGenerator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IdentityGenerator.cs 31 Dec 2004 18:56:49 -0000 1.4 --- IdentityGenerator.cs 15 Jan 2005 21:16:13 -0000 1.5 *************** *** 4,22 **** { /// <summary> ! /// Indicates to the <see cref="ISession"/> that identity /// (ie. identity/autoincrement column) key generation should be used. /// </summary> /// <remarks> ! /// <para> /// This id generation strategy is specified in the mapping file as ! /// <c><generator class="identity"></c> ! /// </para> ! /// <para> /// This indicates to NHibernate that the database generates the id when /// the entity is inserted. ! /// </para> /// </remarks> public class IdentityGenerator : IIdentifierGenerator { /// <summary> /// This class can not generate the <c>id</c>. It has to get the --- 4,26 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that indicates to the <see cref="ISession"/> that identity /// (ie. identity/autoincrement column) key generation should be used. /// </summary> /// <remarks> ! /// <p> /// This id generation strategy is specified in the mapping file as ! /// <code><generator class="identity" /></code> ! /// or if the database natively supports identity columns ! /// <code><generator class="native" /></code> ! /// </p> ! /// <p> /// This indicates to NHibernate that the database generates the id when /// the entity is inserted. ! /// </p> /// </remarks> public class IdentityGenerator : IIdentifierGenerator { + #region IIdentifierGenerator Members + /// <summary> /// This class can not generate the <c>id</c>. It has to get the *************** *** 34,37 **** --- 38,43 ---- return null; } + + #endregion } } \ No newline at end of file Index: UUIDHexGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/UUIDHexGenerator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UUIDHexGenerator.cs 31 Dec 2004 18:58:24 -0000 1.2 --- UUIDHexGenerator.cs 15 Jan 2005 21:16:13 -0000 1.3 *************** *** 9,39 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that returns a string of length /// 32, 36, or 38 depending on the configuration. /// </summary> /// <remarks> ! /// <para> ! /// This string will consist of only hex digits. Optionally, the string /// may be generated with enclosing characters and seperators between each component /// of the UUID. If there are seperators then the string length will be 36. If a format /// that has enclosing brackets is used, then the string length will be 38. ! /// </para> ! /// <para> ! /// The mapping parameters supported are: <c>format</c> and <c>seperator</c>. ! /// </para> ! /// <para> ! /// <c>format</c> is either "N", "D", "B", or "P". These formats are described in /// the <see cref="System.Guid.ToString(string)">Guid.ToString(String)</see> method. /// If no <c>format</c> is specified the default is "N". ! /// </para> ! /// <para> /// <c>seperator</c> is the char that will replace the "-" if specified. If no value is /// configured then the default seperator for the format will be used. If the format "D", "B", or /// "P" is specified, then the seperator will replace the "-". If the format is "N" then this /// parameter will be ignored. ! /// </para> ! /// <para> /// This class is based on <see cref="System.Guid"/> ! /// </para> /// </remarks> public class UUIDHexGenerator : IIdentifierGenerator, IConfigurable --- 9,52 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that returns a string of length /// 32, 36, or 38 depending on the configuration. /// </summary> /// <remarks> ! /// <p> ! /// This id generation strategy is specified in the mapping file as ! /// <code> ! /// <generator class="uuid.hex"> ! /// <param name="format">format_string</param> ! /// <param name="seperator">seperator_string</param> ! /// </generator> ! /// </code> ! /// </p> ! /// <p> ! /// The <c>format</c> and <c>seperator</c> parameters are optional. ! /// </p> ! /// <p> ! /// The identifier string will consist of only hex digits. Optionally, the identifier string /// may be generated with enclosing characters and seperators between each component /// of the UUID. If there are seperators then the string length will be 36. If a format /// that has enclosing brackets is used, then the string length will be 38. ! /// </p> ! /// <p> ! /// <c>format</c> is either ! /// "N" (<c>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</c>), ! /// "D" (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>), ! /// "B" (<c>{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}</c>), ! /// or "P" (<c>(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)</c>). These formats are described in /// the <see cref="System.Guid.ToString(string)">Guid.ToString(String)</see> method. /// If no <c>format</c> is specified the default is "N". ! /// </p> ! /// <p> /// <c>seperator</c> is the char that will replace the "-" if specified. If no value is /// configured then the default seperator for the format will be used. If the format "D", "B", or /// "P" is specified, then the seperator will replace the "-". If the format is "N" then this /// parameter will be ignored. ! /// </p> ! /// <p> /// This class is based on <see cref="System.Guid"/> ! /// </p> /// </remarks> public class UUIDHexGenerator : IIdentifierGenerator, IConfigurable *************** *** 46,63 **** //"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" private const string FormatWithDigitsOnly = "N"; ! //xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ! private const string FormatWithHyphens = "D"; ! //{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} ! private const string FormatWithEnclosingBrackets = "B"; ! //(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) ! private const string FormatWithEnclosingParens = "P"; /// <summary> ! /// /// </summary> ! /// <param name="cache"></param> ! /// <param name="obj"></param> ! /// <returns></returns> ! public object Generate( ISessionImplementor cache, object obj ) { string guidString = Guid.NewGuid().ToString( format ); --- 59,72 ---- //"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" private const string FormatWithDigitsOnly = "N"; ! ! #region IIdentifierGenerator Members /// <summary> ! /// Generate a new <see cref="String"/> for the identifier using the "uuid.hex" algorithm. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="String"/>.</returns> ! public object Generate( ISessionImplementor session, object obj ) { string guidString = Guid.NewGuid().ToString( format ); *************** *** 71,82 **** } #region IConfigurable Members /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="parms"></param> ! /// <param name="dialect"></param> public void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { --- 80,94 ---- } + #endregion + #region IConfigurable Members /// <summary> ! /// Configures the UUIDHexGenerator by reading the value of <c>format</c> and ! /// <c>seperator</c> from the <c>parms</c> parameter. /// </summary> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> public void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { Index: Assigned.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/Assigned.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Assigned.cs 31 Dec 2004 18:55:56 -0000 1.3 --- Assigned.cs 15 Jan 2005 21:16:12 -0000 1.4 *************** *** 5,11 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that returns the current identifier ! /// assigned to an instance /// </summary> public class Assigned : IIdentifierGenerator { --- 5,17 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that returns the current identifier ! /// assigned to an instance. /// </summary> + /// <remarks> + /// <p> + /// This id generation strategy is specified in the mapping file as + /// <code><generator class="assigned" /></code> + /// </p> + /// </remarks> public class Assigned : IIdentifierGenerator { *************** *** 13,22 **** public static readonly Assigned Instance = new Assigned(); /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> public object Generate( ISessionImplementor session, object obj ) { --- 19,35 ---- public static readonly Assigned Instance = new Assigned(); + #region IIdentifierGenerator Members + /// <summary> ! /// Generates a new identifier by getting the value of the identifier ! /// for the <c>obj</c> parameter. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The value that was assigned to the mapped <c>id</c>'s property.</returns> ! /// <exception cref="IdentifierGenerationException"> ! /// Thrown when a <see cref="PersistentCollection"/> is passed in as the <c>obj</c> or ! /// if the identifier of <c>obj</c> is null. ! /// </exception> public object Generate( ISessionImplementor session, object obj ) { *************** *** 24,28 **** { throw new IdentifierGenerationException( ! "Illegal use of assigned id generation fro a toplevel collection" ); } --- 37,41 ---- { throw new IdentifierGenerationException( ! "Illegal use of assigned id generation for a toplevel collection" ); } *************** *** 37,40 **** --- 50,56 ---- return id; } + + #endregion + } } \ No newline at end of file Index: GuidCombGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/GuidCombGenerator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GuidCombGenerator.cs 31 Dec 2004 18:56:22 -0000 1.2 --- GuidCombGenerator.cs 15 Jan 2005 21:16:13 -0000 1.3 *************** *** 5,14 **** { /// <summary> ! /// Generates <see cref="System.Guid"/> values using a strategy suggested Jimmy Nilsson's /// <a href="http://www.informit.com/articles/article.asp?p=25862">article</a> /// on <a href="http://www.informit.com">informit.com</a>. /// </summary> /// <remarks> /// This code was contributed by Donald Mull. /// </remarks> public class GuidCombGenerator : IIdentifierGenerator --- 5,25 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that generates <see cref="System.Guid"/> values ! /// using a strategy suggested Jimmy Nilsson's /// <a href="http://www.informit.com/articles/article.asp?p=25862">article</a> /// on <a href="http://www.informit.com">informit.com</a>. /// </summary> /// <remarks> + /// <p> + /// This id generation strategy is specified in the mapping file as + /// <code><generator class="guid.comb" /></code> + /// </p> + /// <p> + /// The <c>comb</c> algorithm is designed to make the use of GUIDs as Primary Keys, Foreign Keys, + /// and Indexes nearly as efficient as ints. + /// </p> + /// <p> /// This code was contributed by Donald Mull. + /// </p> /// </remarks> public class GuidCombGenerator : IIdentifierGenerator *************** *** 17,25 **** /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> public object Generate( ISessionImplementor session, object obj ) { --- 28,36 ---- /// <summary> ! /// Generate a new <see cref="Guid"/> using the comb algorithm. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="Guid"/>.</returns> public object Generate( ISessionImplementor session, object obj ) { *************** *** 27,31 **** } ! /// <summary></summary> private Guid GenerateComb() { --- 38,44 ---- } ! /// <summary> ! /// Generate a new <see cref="Guid"/> using the comb algorithm. ! /// </summary> private Guid GenerateComb() { Index: GuidGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/GuidGenerator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GuidGenerator.cs 31 Dec 2004 18:56:22 -0000 1.2 --- GuidGenerator.cs 15 Jan 2005 21:16:13 -0000 1.3 *************** *** 5,10 **** { /// <summary> ! /// Generates <c>Guid</c> values using <see cref="System.Guid.NewGuid()"/>. /// </summary> public class GuidGenerator : IIdentifierGenerator { --- 5,17 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that generates <see cref="Guid"/> values ! /// using <see cref="System.Guid.NewGuid()">Guid.NewGuid()</see>. /// </summary> + /// <remarks> + /// <p> + /// This id generation strategy is specified in the mapping file as + /// <code><generator class="guid" /></code> + /// </p> + /// </remarks> public class GuidGenerator : IIdentifierGenerator { *************** *** 12,20 **** /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> public object Generate( ISessionImplementor session, object obj ) { --- 19,27 ---- /// <summary> ! /// Generate a new <see cref="Guid"/> for the identifier. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="Guid"/>.</returns> public object Generate( ISessionImplementor session, object obj ) { Index: CounterGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/CounterGenerator.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CounterGenerator.cs 31 Dec 2004 18:55:56 -0000 1.3 --- CounterGenerator.cs 15 Jan 2005 21:16:12 -0000 1.4 *************** *** 5,9 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that returns a <c>Int64</c> constructed from the system /// time and a counter value. Not safe for use in a clustser! /// </summary> --- 5,9 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that returns a <c>Int64</c> constructed from the system /// time and a counter value. Not safe for use in a clustser! /// </summary> Index: ForeignGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/ForeignGenerator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ForeignGenerator.cs 31 Dec 2004 18:55:56 -0000 1.4 --- ForeignGenerator.cs 15 Jan 2005 21:16:13 -0000 1.5 *************** *** 6,23 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that uses the value of the id property of an associated object ! /// ! /// One mapping parameter is required: property. /// </summary> public class ForeignGenerator : IIdentifierGenerator, IConfigurable { private string propertyName; /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> public object Generate( ISessionImplementor session, object obj ) { --- 6,39 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that uses the value of ! /// the id property of an associated object /// </summary> + /// <remarks> + /// <para> + /// This id generation strategy is specified in the mapping file as + /// <code> + /// <generator class="foreign"> + /// <param name="sequence">uid_sequence</param> + /// </generator> + /// </code> + /// </para> + /// The mapping parameter <c>property</c> is required. + /// </remarks> public class ForeignGenerator : IIdentifierGenerator, IConfigurable { private string propertyName; + #region IIdentifierGenerator Members + /// <summary> ! /// Generates an identifer from the value of a Property. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns> ! /// The identifier value from the associated object or ! /// <see cref="IdentifierGeneratorFactory.ShortCircuitIndicator"/> if the <c>session</c> ! /// already contains <c>obj</c>. ! /// </returns> public object Generate( ISessionImplementor session, object obj ) { *************** *** 25,29 **** .GetClassMetadata( obj.GetType() ) .GetPropertyValue( obj, propertyName ); ! //return session.getEntityIdentifierIfNotUnsaved(associatedObject); object id = session.Save( associatedObject ); if( session.Contains( obj ) ) --- 41,45 ---- .GetClassMetadata( obj.GetType() ) .GetPropertyValue( obj, propertyName ); ! object id = session.Save( associatedObject ); if( session.Contains( obj ) ) *************** *** 31,45 **** //abort the save (the object is already saved by a circular cascade) return IdentifierGeneratorFactory.ShortCircuitIndicator; - //throw new IdentifierGenerationException("save associated object first, or disable cascade for inverse association"); } return id; } /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="parms"></param> ! /// <param name="d"></param> public void Configure( IType type, IDictionary parms, Dialect.Dialect d ) { --- 47,69 ---- //abort the save (the object is already saved by a circular cascade) return IdentifierGeneratorFactory.ShortCircuitIndicator; } + return id; } + #endregion + + #region IConfigurable Members + /// <summary> ! /// Configures the ForeignGenerator by reading the value of <c>property</c> ! /// from the <c>parms</c> parameter. /// </summary> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> ! /// <exception cref="MappingException"> ! /// Thrown if the key <c>property</c> is not found in the <c>parms</c> parameter. ! /// </exception> public void Configure( IType type, IDictionary parms, Dialect.Dialect d ) { *************** *** 50,53 **** --- 74,79 ---- } } + + #endregion } } \ No newline at end of file Index: IPersistentIdentifierGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IPersistentIdentifierGenerator.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IPersistentIdentifierGenerator.cs 31 Dec 2004 18:57:03 -0000 1.3 --- IPersistentIdentifierGenerator.cs 15 Jan 2005 21:16:13 -0000 1.4 *************** *** 2,8 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that requires creation of database objects ! /// All <c>IPersistentIdentifierGenerator</c>s that also implement ! /// <c>IConfigurable</c> have access to a special mapping parameter: schema /// </summary> public interface IPersistentIdentifierGenerator : IIdentifierGenerator --- 2,8 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that requires creation of database objects ! /// All <see cref="IPersistentIdentifierGenerator"/>s that also implement ! /// An <see cref="IConfigurable" /> have access to a special mapping parameter: schema /// </summary> public interface IPersistentIdentifierGenerator : IIdentifierGenerator Index: SequenceGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/SequenceGenerator.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SequenceGenerator.cs 31 Dec 2004 18:57:03 -0000 1.7 --- SequenceGenerator.cs 15 Jan 2005 21:16:13 -0000 1.8 *************** *** 11,17 **** { /// <summary> ! /// Generates <c>Int64</c> values using an oracle-style sequence. A higher performance ! /// algorithm is <see cref="SequenceHiLoGenerator"/> /// </summary> public class SequenceGenerator : IPersistentIdentifierGenerator, IConfigurable { --- 11,32 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that generates <c>Int64</c> values using an ! /// oracle-style sequence. A higher performance algorithm is ! /// <see cref="SequenceHiLoGenerator"/>. /// </summary> + /// <remarks> + /// <p> + /// This id generation strategy is specified in the mapping file as + /// <code> + /// <generator class="sequence"> + /// <param name="sequence">uid_sequence</param> + /// <param name="schema">db_schema</param> + /// </generator> + /// </code> + /// </p> + /// <p> + /// The <c>sequence</c> parameter is required while the <c>schema</c> is optional. + /// </p> + /// </remarks> public class SequenceGenerator : IPersistentIdentifierGenerator, IConfigurable { *************** *** 19,27 **** /// <summary> ! /// The sequence parameter /// </summary> public const string Sequence = "sequence"; ! /// <summary></summary> public const string Schema = "schema"; --- 34,44 ---- /// <summary> ! /// The name of the sequence parameter. /// </summary> public const string Sequence = "sequence"; ! /// <summary> ! /// The name of the schema parameter. ! /// </summary> public const string Schema = "schema"; *************** *** 30,39 **** private string sql; /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="parms"></param> ! /// <param name="dialect"></param> public virtual void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { --- 47,59 ---- private string sql; + #region IConfigurable Members + /// <summary> ! /// Configures the SequenceGenerator by reading the value of <c>sequence</c> and ! /// <c>schema</c> from the <c>parms</c> parameter. /// </summary> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> public virtual void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { *************** *** 48,57 **** } /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> public virtual object Generate( ISessionImplementor session, object obj ) { --- 68,82 ---- } + #endregion + + #region IIdentifierGenerator Members + /// <summary> ! /// Generate an <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/> ! /// for the identifier by using a database sequence. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/>.</returns> public virtual object Generate( ISessionImplementor session, object obj ) { *************** *** 81,84 **** --- 106,111 ---- } + #endregion + /// <summary> /// Index: IIdentifierGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IIdentifierGenerator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IIdentifierGenerator.cs 31 Dec 2004 18:57:03 -0000 1.4 --- IIdentifierGenerator.cs 15 Jan 2005 21:16:13 -0000 1.5 *************** *** 30,34 **** /// </summary> /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generate</param> /// <returns>The new identifier</returns> object Generate( ISessionImplementor session, object obj ); --- 30,34 ---- /// </summary> /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> /// <returns>The new identifier</returns> object Generate( ISessionImplementor session, object obj ); Index: TableHiLoGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/TableHiLoGenerator.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TableHiLoGenerator.cs 31 Dec 2004 18:57:22 -0000 1.6 --- TableHiLoGenerator.cs 15 Jan 2005 21:16:13 -0000 1.7 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Collections; using System.Runtime.CompilerServices; *************** *** 9,26 **** { /// <summary> ! /// An <c>IIdentifierGenerator</c> that returns an <c>Int64</c>, constructed using /// a hi/lo algorithm. /// </summary> /// <remarks> ! /// <para> ! /// The hi value MUST be fecthed in a seperate transaction to the <c>Session</c> /// transaction so the generator must be able to obtain a new connection and /// commit it. Hence this implmentation may not be used when the user is supplying /// connections. In that case a <see cref="SequenceHiLoGenerator"/> would be a /// better choice (where supported). ! /// </para> ! /// <para> ! /// Mapping parameters supported are: <c>table</c>, <c>column</c>, and <c>max_lo</c> ! /// </para> /// </remarks> public class TableHiLoGenerator : TableGenerator --- 10,39 ---- { /// <summary> ! /// An <see cref="IIdentifierGenerator" /> that returns an <c>Int64</c>, constructed using /// a hi/lo algorithm. /// </summary> /// <remarks> ! /// <p> ! /// This id generation strategy is specified in the mapping file as ! /// <code> ! /// <generator class="hilo"> ! /// <param name="table">table</param> ! /// <param name="column">id_column</param> ! /// <param name="max_lo">max_lo_value</param> ! /// <param name="schema">db_schema</param> ! /// </generator> ! /// </code> ! /// </p> ! /// <p> ! /// The <c>table</c> and <c>column</c> parameters are required, the <c>max_lo</c> and ! /// <c>schema</c> are optional. ! /// </p> ! /// <p> ! /// The hi value MUST be fecthed in a seperate transaction to the <c>ISession</c> /// transaction so the generator must be able to obtain a new connection and /// commit it. Hence this implmentation may not be used when the user is supplying /// connections. In that case a <see cref="SequenceHiLoGenerator"/> would be a /// better choice (where supported). ! /// </p> /// </remarks> public class TableHiLoGenerator : TableGenerator *************** *** 28,32 **** private static readonly ILog log = LogManager.GetLogger( typeof( TableHiLoGenerator ) ); ! /// <summary></summary> public const string MaxLo = "max_lo"; --- 41,47 ---- private static readonly ILog log = LogManager.GetLogger( typeof( TableHiLoGenerator ) ); ! /// <summary> ! /// The name of the max lo parameter. ! /// </summary> public const string MaxLo = "max_lo"; *************** *** 36,48 **** private System.Type returnClass; /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="parms"></param> ! /// <param name="d"></param> ! public override void Configure( IType type, IDictionary parms, Dialect.Dialect d ) { ! base.Configure( type, parms, d ); maxLo = PropertiesHelper.GetInt32( MaxLo, parms, short.MaxValue ); lo = maxLo + 1; // so we "clock over" on the first invocation --- 51,66 ---- private System.Type returnClass; + #region IConfigurable Members + /// <summary> ! /// Configures the TableHiLoGenerator by reading the value of <c>table</c>, ! /// <c>column</c>, <c>max_lo</c>, and <c>schema</c> from the <c>parms</c> parameter. /// </summary> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> ! public override void Configure( IType type, IDictionary parms, Dialect.Dialect dialect ) { ! base.Configure( type, parms, dialect ); maxLo = PropertiesHelper.GetInt32( MaxLo, parms, short.MaxValue ); lo = maxLo + 1; // so we "clock over" on the first invocation *************** *** 50,59 **** } /// <summary> ! /// /// </summary> ! /// <param name="session"></param> ! /// <param name="obj"></param> ! /// <returns></returns> [MethodImpl( MethodImplOptions.Synchronized )] public override object Generate( ISessionImplementor session, object obj ) --- 68,82 ---- } + #endregion + + #region IIdentifierGenerator Members + /// <summary> ! /// Generate a <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/> ! /// for the identifier by selecting and updating a value in a table. /// </summary> ! /// <param name="session">The <see cref="ISessionImplementor"/> this id is being generated in.</param> ! /// <param name="obj">The entity for which the id is being generated.</param> ! /// <returns>The new identifier as a <see cref="Int16"/>, <see cref="Int32"/>, or <see cref="Int64"/>.</returns> [MethodImpl( MethodImplOptions.Synchronized )] public override object Generate( ISessionImplementor session, object obj ) *************** *** 69,72 **** --- 92,98 ---- return IdentifierGeneratorFactory.CreateNumber( hi + lo++, returnClass ); } + + #endregion + } } \ No newline at end of file Index: IdentifierGeneratorFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IdentifierGeneratorFactory.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** IdentifierGeneratorFactory.cs 31 Dec 2004 18:56:49 -0000 1.13 --- IdentifierGeneratorFactory.cs 15 Jan 2005 21:16:13 -0000 1.14 *************** *** 2,5 **** --- 2,6 ---- using System.Collections; using System.Data; + using NHibernate.Type; *************** *** 9,24 **** /// Factory methods for <c>IdentifierGenerator</c> framework. /// </summary> public sealed class IdentifierGeneratorFactory { /// <summary> ! /// /// </summary> ! /// <param name="rs"></param> ! /// <param name="clazz"></param> ! /// <returns></returns> public static object Get( IDataReader rs, System.Type clazz ) { // here is an interesting one: ! // - MsSql's @@identity returns a numeric - which translates to a C# decimal type. // - MySql LAST_IDENITY() returns an Int64 try --- 10,89 ---- /// Factory methods for <c>IdentifierGenerator</c> framework. /// </summary> + /// <remarks> + /// <p>The built in strategies for identifier generation in NHibernate are:</p> + /// <list type="table"> + /// <listheader> + /// <term>strategy</term> + /// <description>Implementation of strategy</description> + /// </listheader> + /// <item> + /// <term>assigned</term> + /// <description><see cref="Assigned"/></description> + /// </item> + /// <item> + /// <term>foreign</term> + /// <description><see cref="ForeignGenerator"/></description> + /// </item> + /// <item> + /// <term>guid</term> + /// <description><see cref="GuidGenerator"/></description> + /// </item> + /// <item> + /// <term>guid.comb</term> + /// <description><see cref="GuidCombGenerator"/></description> + /// </item> + /// <item> + /// <term>hilo</term> + /// <description><see cref="TableHiLoGenerator"/></description> + /// </item> + /// <item> + /// <term>identity</term> + /// <description><see cref="IdentityGenerator"/></description> + /// </item> + /// <item> + /// <term>native</term> + /// <description> + /// Chooses between <see cref="IdentityGenerator"/>, <see cref="SequenceGenerator"/> + /// , and <see cref="TableHiLoGenerator"/> based on the + /// <see cref="Dialect.Dialect"/>'s capabilities. + /// </description> + /// </item> + /// <item> + /// <term>seqhilo</term> + /// <description><see cref="SequenceHiLoGenerator"/></description> + /// </item> + /// <item> + /// <term>sequence</term> + /// <description><see cref="SequenceGenerator"/></description> + /// </item> + /// <item> + /// <term>uuid.hex</term> + /// <description><see cref="UUIDHexGenerator"/></description> + /// </item> + /// <item> + /// <term>uuid.string</term> + /// <description><see cref="UUIDStringGenerator"/></description> + /// </item> + /// </list> + /// </remarks> public sealed class IdentifierGeneratorFactory { /// <summary> ! /// Gets the value of the identifier from the <see cref="IDataReader"/> and ! /// ensures it is the correct <see cref="System.Type"/>. /// </summary> ! /// <param name="rs">The <see cref="IDataReader"/> to read the identifier value from.</param> ! /// <param name="clazz">The <see cref="System.Type"/> the value should be converted to.</param> ! /// <returns> ! /// The value for the identifier. ! /// </returns> ! /// <exception cref="IdentifierGenerationException"> ! /// Thrown if there is any problem getting the value from the <see cref="IDataReader"/> ! /// or with converting it to the <see cref="System.Type"/>. ! /// </exception> public static object Get( IDataReader rs, System.Type clazz ) { // here is an interesting one: ! // - MsSql's @@identity returns a Decimal // - MySql LAST_IDENITY() returns an Int64 try *************** *** 33,42 **** } private static readonly Hashtable idgenerators = new Hashtable(); ! /// <summary></summary> public static readonly string ShortCircuitIndicator = String.Empty; ! /// <summary></summary> static IdentifierGeneratorFactory() { --- 98,119 ---- } + /// <summary> + /// An <see cref="Hashtable"/> where the <c>key</c> is the strategy and + /// the <c>value</c> is the <see cref="System.Type"/> for the strategy. + /// </summary> private static readonly Hashtable idgenerators = new Hashtable(); ! /// <summary> ! /// When this is returned by <c>Generate()</c> it indicates that the object ! /// has already been saved. ! /// </summary> ! /// <value> ! /// <see cref="String.Empty">String.Empty</see> ! /// </value> public static readonly string ShortCircuitIndicator = String.Empty; ! /// <summary> ! /// Initializes the static fields in <see cref="IdentifierGeneratorFactory"/>. ! /// </summary> static IdentifierGeneratorFactory() { *************** *** 56,69 **** private IdentifierGeneratorFactory() { ! } //cannot be instantiated /// <summary> ! /// /// </summary> ! /// <param name="strategy"></param> ! /// <param name="type"></param> ! /// <param name="parms"></param> ! /// <param name="dialect"></param> ! /// <returns></returns> public static IIdentifierGenerator Create( string strategy, IType type, IDictionary parms, Dialect.Dialect dialect ) { --- 133,156 ---- private IdentifierGeneratorFactory() { ! //cannot be instantiated ! } /// <summary> ! /// Creates an <see cref="IIdentifierGenerator"/> from the named strategy. /// </summary> ! /// <param name="strategy"> ! /// The name of the generator to create. This can be one of the NHibernate abbreviations (ie - <c>native</c>, ! /// <c>sequence</c>, <c>guid.comb</c>, etc...), a full class name if the Type is in the NHibernate assembly, or ! /// a full type name if the strategy is in an external assembly. ! /// </param> ! /// <param name="type">The <see cref="IType"/> that the retured identifier should be.</param> ! /// <param name="parms">An <see cref="IDictionary"/> of <c><param></c> values from the mapping.</param> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with Configuration.</param> ! /// <returns> ! /// An instantiated and configured <see cref="IIdentifierGenerator"/>. ! /// </returns> ! /// <exception cref="MappingException"> ! /// Thrown if there are any exceptions while creating the <see cref="IIdentifierGenerator"/>. ! /// </exception> public static IIdentifierGenerator Create( string strategy, IType type, IDictionary parms, Dialect.Dialect dialect ) { *************** *** 90,98 **** clazz = System.Type.GetType( strategy ); } IIdentifierGenerator idgen = ( IIdentifierGenerator ) Activator.CreateInstance( clazz ); ! if( idgen is IConfigurable ) { ! ( ( IConfigurable ) idgen ).Configure( type, parms, dialect ); } return idgen; } --- 177,190 ---- clazz = System.Type.GetType( strategy ); } + IIdentifierGenerator idgen = ( IIdentifierGenerator ) Activator.CreateInstance( clazz ); ! ! // configure if the generator supports it. ! IConfigurable configurable = idgen as IConfigurable; ! if( configurable!=null ) { ! configurable.Configure( type, parms, dialect ); } + return idgen; } *************** *** 104,112 **** /// <summary> ! /// /// </summary> ! /// <param name="value"></param> ! /// <param name="type"></param> ! /// <returns></returns> internal static object CreateNumber( long value, System.Type type ) { --- 196,210 ---- /// <summary> ! /// Create the correct boxed <see cref="System.Type"/> for the identifier. /// </summary> ! /// <param name="value">The value of the new identifier.</param> ! /// <param name="type">The <see cref="IType"/> the identifier should be.</param> ! /// <returns> ! /// The identifier value converted to the <see cref="System.Type"/>. ! /// </returns> ! /// <exception cref="IdentifierGenerationException"> ! /// The <c>type</c> parameter must be an <see cref="Int16"/>, <see cref="Int32"/>, ! /// or <see cref="Int64"/>. ! /// </exception> internal static object CreateNumber( long value, System.Type type ) { |
From: Michael D. <mik...@us...> - 2005-01-15 18:08:01
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10027 Modified Files: basic_mapping.xml Log Message: work on <id> section. Index: basic_mapping.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/basic_mapping.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** basic_mapping.xml 27 Nov 2004 03:42:15 -0000 1.6 --- basic_mapping.xml 15 Jan 2005 18:07:44 -0000 1.7 *************** *** 359,365 **** legacy data with composite keys. We strongly discourage its use for anything else. </para> ! </sect2> <sect2 id="mapping-declaration-property"> <title>property</title> --- 359,625 ---- legacy data with composite keys. We strongly discourage its use for anything else. </para> ! ! <sect3 id="mapping-declaration-id-generator"> ! <title>generator</title> ! ! <para> ! The required <literal><generator></literal> child element names a .NET type used ! to generate unique identifiers for instances of the persistent class. If any parameters ! are required to configure or initialize the generator instance, they are passed using the ! <literal><param></literal> element. ! </para> ! ! <programlisting><![CDATA[<id name="Id" type="Int64" column="uid" unsaved-value="0"> ! <generator class="NHibernate.Id.TableHiLoGenerator"> ! <param name="table">uid_table</param> ! <param name="column">next_hi_value_column</param> ! </generator> ! </id>]]></programlisting> ! ! <para> ! All generators implement the interface <literal>NHibernate.Id.IdentifierGenerator</literal>. ! This is a very simple interface; some applications may choose to provide their own specialized ! implementations. However, NHibernate provides a range of built-in implementations. There are shortcut ! names for the built-in generators: ! ! <variablelist> ! <varlistentry> ! <term><literal>identity</literal></term> ! <listitem> ! <para> ! supports identity columns in DB2, MySQL, MS SQL Server, Sybase and ! HypersonicSQL. The returned identifier is of type <literal>Int64</literal>, ! <literal>Int32</literal> or <literal>Int16</literal>. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>sequence</literal></term> ! <listitem> ! <para> ! uses a sequence in DB2, PostgreSQL, Oracle. The returned identifier ! is of type <literal>Int64</literal>, ! <literal>Int32</literal> or <literal>Int16</literal> ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>hilo</literal></term> ! <listitem> ! <para> ! uses a hi/lo algorithm to efficiently generate identifiers of ! type <literal>Int64</literal>, <literal>Int32</literal> or <literal>Int16</literal>, ! given a table and column (by default <literal>hibernate_unique_key</literal> and ! <literal>next</literal> respectively) as a source of hi values. The hi/lo algorithm ! generates identifiers that are unique only for a particular database. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>seqhilo</literal></term> ! <listitem> ! <para> ! uses a hi/lo algorithm to efficiently generate identifiers of type ! <literal>Int64</literal>, <literal>Int32</literal> or <literal>Int16</literal>, ! given a named database sequence. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>uuid.hex</literal></term> ! <listitem> ! <para> ! uses <literal>System.Guid</literal> and its <literal>ToString(string format)</literal> method ! to generate identifiers of type string. The length of the string returned depends on the ! configured <literal>format</literal>. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>uuid.string</literal></term> ! <listitem> ! <para> ! uses a new <literal>System.Guid</literal> to create a <literal>byte[]</literal> that is ! converted to a string. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>guid</literal></term> ! <listitem> ! <para> ! uses a new <literal>System.Guid</literal> as the identifier. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>guid.comb</literal></term> ! <listitem> ! <para> ! uses the algorithm to generate a new <literal>System.Guid</literal> ! described by Jimmy Nilsson in the article ! http://www.informit.com/articles/article.asp?p=25862. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>native</literal></term> ! <listitem> ! <para> ! picks <literal>identity</literal>, <literal>sequence</literal> or ! <literal>hilo</literal> depending upon the capabilities of the ! underlying database. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>assigned</literal></term> ! <listitem> ! <para> ! lets the application to assign an identifier to the object before ! <literal>save()</literal> is called. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term><literal>foreign</literal></term> ! <listitem> ! <para> ! uses the identifier of another associated object. Usually used in conjunction ! with a <literal><one-to-one></literal> primary key association. ! </para> ! </listitem> ! </varlistentry> ! </variablelist> ! ! </para> ! </sect3> ! ! ! <sect3 id="mapping-declaration-id-hilo"> ! <title>Hi/Lo Algorithm</title> ! <para> ! The <literal>hilo</literal> and <literal>seqhilo</literal> generators provide two alternate ! implementations of the hi/lo algorithm, a favorite approach to identifier generation. The ! first implementation requires a "special" database table to hold the next available "hi" value. ! The second uses an Oracle-style sequence (where supported). ! </para> ! ! <programlisting><![CDATA[<id name="Id" type="Int64" column="cat_id"> ! <generator class="hilo"> ! <param name="table">hi_value</param> ! <param name="column">next_value</param> ! <param name="max_lo">100</param> ! </generator> ! </id>]]></programlisting> ! ! <programlisting><![CDATA[<id name="Id" type="Int64" column="cat_id"> ! <generator class="seqhilo"> ! <param name="sequence">hi_value</param> ! <param name="max_lo">100</param> ! </generator> ! </id>]]></programlisting> ! ! <para> ! Unfortunately, you can't use <literal>hilo</literal> when supplying your own ! <literal>Connection</literal> to NHibernate. NHibernate must be able to ! fetch the "hi" value in a new transaction. ! </para> ! </sect3> ! ! <sect3 id="mapping-declaration-id-uuid-hex"> ! <title>UUID Hex Algorithm</title> ! ! <programlisting><![CDATA[<id name="Id" type="String" column="cat_id"> ! <generator class="uuid.hex"> ! <param name="format">format_value</param> ! <param name="seperator">seperator_value</param> ! </generator> ! </id>]]></programlisting> ! ! <para> ! The UUID is generated by calling <literal>Guid.NewGuid().ToString(format)</literal>. The ! valid values for format are described in the MSDN documentation. The default ! <literal>seperator</literal> is <literal>-</literal> and should rarely be modified. The ! <literal>format</literal> determines if the configured <literal>seperator</literal> can ! replace the default seperator used by the <literal>format</literal>. ! </para> ! </sect3> ! ! <sect3 id="mapping-declaration-id-uuid-string"> ! <title>UUID String Algorithm</title> ! <para> ! The UUID is generated by calling <literal>Guid.NewGuid().ToByteArray()</literal> and ! then converting the <literal>byte[]</literal> into a <literal>char[]</literal>. The ! <literal>char[]</literal> is returned as a <literal>String</literal> consisting of ! 16 characters. ! </para> ! </sect3> ! ! <sect3 id="mapping-declaration-id-guid"> ! <title>GUID Algorithms</title> ! <para> ! The <literal>guid</literal> identifier is generated by calling <literal>Guid.NewGuid()</literal>. ! To address some of the performance concerns with using Guids as primary keys, foreign keys, and ! as part of indexes with MS SQL the <literal>guid.comb</literal> can be used. The benefit of using ! the <literal>guid.comb</literal> with other databases that support GUIDs has not been measured. ! </para> ! </sect3> ! ! <sect3 id="mapping-declaration-id-sequences"> ! <title>Identity columns and Sequences</title> ! <para> ! For databases which support identity columns (DB2, MySQL, Sybase, MS SQL), you ! may use <literal>identity</literal> key generation. For databases that support ! sequences (DB2, Oracle, PostgreSQL) you may use ! <literal>sequence</literal> style key generation. Both these strategies usually require ! two SQL queries to insert a new object. When working with MS SQL and the ! <literal>identity</literal> key generator then <literal>select SCOPE_IDENTITY()</literal> ! will be appended to the <literal>insert</literal> sql thus avoiding the executions ! of a two distinct <literal>IDbCommand</literal>s. ! </para> ! ! <programlisting><![CDATA[<id name="Id" type="Int64" column="uid"> ! <generator class="sequence"> ! <param name="sequence">uid_sequence</param> ! </generator> ! </id>]]></programlisting> ! ! <programlisting><![CDATA[<id name="Id" type="Int64" column="uid" unsaved-value="0"> ! <generator class="identity"/> ! </id>]]></programlisting> ! ! <para> ! For cross-platform development, the <literal>native</literal> strategy will ! choose from the <literal>identity</literal>, <literal>sequence</literal> and ! <literal>hilo</literal> strategies, dependant upon the capabilities of the ! underlying database. ! </para> ! </sect3> ! ! <sect3 id="mapping-declaration-id-assigned"> ! <title>Assigned Identifiers</title> ! <para> ! If you want the application to assign identifiers (as opposed to having ! NHibernate generate them), you may use the <literal>assigned</literal> generator. ! This special generator will use the identifier value already assigned to the ! object's identifier property. Be very careful when using this feature to not assign ! keys with business meaning (almost always a terrible design decision). ! </para> ! <para> ! Due to its inherent nature, entities that use this generator cannot be saved ! via the ISession's <literal>SaveOrUpdate()</literal> method. Instead you have to ! explicitly specify to NHibernate if the object should be saved or updated ! by calling either the <literal>Save()</literal> or <literal>Update()</literal> ! method of the ISession. ! </para> ! </sect3> </sect2> + <!-- + TODO: resume here + <sect2 id="mapping-declaration-compositeid"> + --> + <sect2 id="mapping-declaration-property"> <title>property</title> *************** *** 635,638 **** --- 895,899 ---- </para> </sect2> + <sect2 id="mapping-types-basictypes"> <title>Basic value types</title> |
From: Michael D. <mik...@us...> - 2005-01-14 00:28:42
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13039/NHibernate/Property Modified Files: BasicPropertyAccessor.cs BasicSetter.cs CamelCaseStrategy.cs CamelCaseUnderscoreStrategy.cs FieldAccessor.cs IFieldNamingStrategy.cs IPropertyAccessor.cs LowerCaseUnderscoreStrategy.cs NoSetterAccessor.cs PascalCaseMUnderscoreStrategy.cs PropertyAccessorFactory.cs Log Message: Added some xml comments. Index: BasicPropertyAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/BasicPropertyAccessor.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicPropertyAccessor.cs 13 Jan 2005 20:55:16 -0000 1.4 --- BasicPropertyAccessor.cs 14 Jan 2005 00:28:25 -0000 1.5 *************** *** 18,22 **** /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> /// <returns> /// The <see cref="BasicGetter"/> to use to get the value of the Property from an --- 18,22 ---- /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to get.</param> /// <returns> /// The <see cref="BasicGetter"/> to use to get the value of the Property from an *************** *** 40,44 **** /// </summary> /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> /// <returns> /// The <see cref="BasicSetter"/> to use to set the value of the Property on an --- 40,44 ---- /// </summary> /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to get.</param> /// <returns> /// The <see cref="BasicSetter"/> to use to set the value of the Property on an *************** *** 65,69 **** /// </summary> /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> /// <returns> /// The <see cref="BasicGetter"/> for the Property <c>get</c> or <c>null</c> --- 65,69 ---- /// </summary> /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to get.</param> /// <returns> /// The <see cref="BasicGetter"/> for the Property <c>get</c> or <c>null</c> *************** *** 110,114 **** /// </summary> /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to set.</param> /// <returns> /// The <see cref="BasicSetter"/> for the Property <c>set</c> or <c>null</c> --- 110,114 ---- /// </summary> /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to set.</param> /// <returns> /// The <see cref="BasicSetter"/> for the Property <c>set</c> or <c>null</c> Index: CamelCaseUnderscoreStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/CamelCaseUnderscoreStrategy.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CamelCaseUnderscoreStrategy.cs 31 Dec 2004 21:55:49 -0000 1.2 --- CamelCaseUnderscoreStrategy.cs 14 Jan 2005 00:28:26 -0000 1.3 *************** *** 2,6 **** { /// <summary> ! /// Implementation of FieldNamingStrategy for fields that are prefixed with /// an underscore and the PropertyName is changed to camelCase. /// </summary> --- 2,6 ---- { /// <summary> ! /// Implementation of <see cref="IFieldNamingStrategy"/> for fields that are prefixed with /// an underscore and the PropertyName is changed to camelCase. /// </summary> *************** *** 10,17 **** /// <summary> ! /// /// </summary> ! /// <param name="propertyName"></param> ! /// <returns></returns> public string GetFieldName( string propertyName ) { --- 10,18 ---- /// <summary> ! /// Converts the Property's name into a Field name by making the first character ! /// of the <c>propertyName</c> lowercase and prefixing it with an underscore. /// </summary> ! /// <param name="propertyName">The name of the mapped property.</param> ! /// <returns>The name of the Field in CamelCase format prefixed with an underscore.</returns> public string GetFieldName( string propertyName ) { Index: IFieldNamingStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/IFieldNamingStrategy.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IFieldNamingStrategy.cs 31 Dec 2004 21:56:10 -0000 1.2 --- IFieldNamingStrategy.cs 14 Jan 2005 00:28:26 -0000 1.3 *************** *** 2,13 **** { /// <summary> ! /// Summary description for IFieldNamingStrategy. /// </summary> public interface IFieldNamingStrategy { /// <summary> ! /// Converts the Property's name into a Field name /// </summary> ! /// <param name="propertyName">The name of the Property.</param> /// <returns>The name of the Field.</returns> string GetFieldName( string propertyName ); --- 2,13 ---- { /// <summary> ! /// A Strategy for converting a mapped property name to a Field name. /// </summary> public interface IFieldNamingStrategy { /// <summary> ! /// When implemented by a class, converts the Property's name into a Field name /// </summary> ! /// <param name="propertyName">The name of the mapped property.</param> /// <returns>The name of the Field.</returns> string GetFieldName( string propertyName ); Index: NoSetterAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/NoSetterAccessor.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NoSetterAccessor.cs 13 Jan 2005 20:55:16 -0000 1.3 --- NoSetterAccessor.cs 14 Jan 2005 00:28:26 -0000 1.4 *************** *** 9,13 **** /// <remarks> /// This is most useful because Classes can provider a get for the Property ! /// that is the <id> but tell NHibernate there is no setter for the Property /// so the value should be written directly to the field. /// </remarks> --- 9,13 ---- /// <remarks> /// This is most useful because Classes can provider a get for the Property ! /// that is the <c><id></c> but tell NHibernate there is no setter for the Property /// so the value should be written directly to the field. /// </remarks> *************** *** 31,35 **** /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> /// <returns> /// The <see cref="BasicGetter"/> to use to get the value of the Property from an --- 31,35 ---- /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to get.</param> /// <returns> /// The <see cref="BasicGetter"/> to use to get the value of the Property from an *************** *** 50,58 **** /// <summary> ! /// Create a <see cref="FieldSetter"/> to <c>set</c> the value of the Property ! /// through a <c>field</c>. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to set.</param> /// <returns> /// The <see cref="FieldSetter"/> to use to set the value of the Property on an --- 50,58 ---- /// <summary> ! /// Create a <see cref="FieldSetter"/> to <c>set</c> the value of the mapped Property ! /// through a <c>Field</c>. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the mapped Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to set.</param> /// <returns> /// The <see cref="FieldSetter"/> to use to set the value of the Property on an *************** *** 60,64 **** /// </returns> /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a field for the Property specified by the <c>propertyName</c> using the /// <see cref="IFieldNamingStrategy"/> could not be found in the <see cref="System.Type"/>. /// </exception> --- 60,64 ---- /// </returns> /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a Field for the Property specified by the <c>propertyName</c> using the /// <see cref="IFieldNamingStrategy"/> could not be found in the <see cref="System.Type"/>. /// </exception> Index: PropertyAccessorFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/PropertyAccessorFactory.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PropertyAccessorFactory.cs 31 Dec 2004 21:56:35 -0000 1.8 --- PropertyAccessorFactory.cs 14 Jan 2005 00:28:26 -0000 1.9 *************** *** 12,16 **** private static IDictionary accessors; ! /// <summary></summary> static PropertyAccessorFactory() { --- 12,18 ---- private static IDictionary accessors; ! /// <summary> ! /// Initializes the static members in <see cref="PropertyAccessorFactory"/>. ! /// </summary> static PropertyAccessorFactory() { Index: IPropertyAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/IPropertyAccessor.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IPropertyAccessor.cs 13 Jan 2005 20:55:16 -0000 1.3 --- IPropertyAccessor.cs 14 Jan 2005 00:28:26 -0000 1.4 *************** *** 13,17 **** /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> /// <returns> /// The <see cref="IGetter"/> to use to get the value of the Property from an --- 13,17 ---- /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to get.</param> /// <returns> /// The <see cref="IGetter"/> to use to get the value of the Property from an *************** *** 27,31 **** /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to set.</param> /// <returns> /// The <see cref="ISetter"/> to use to set the value of the Property on an --- 27,31 ---- /// </summary> /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to set.</param> /// <returns> /// The <see cref="ISetter"/> to use to set the value of the Property on an Index: PascalCaseMUnderscoreStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/PascalCaseMUnderscoreStrategy.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PascalCaseMUnderscoreStrategy.cs 31 Dec 2004 21:56:35 -0000 1.3 --- PascalCaseMUnderscoreStrategy.cs 14 Jan 2005 00:28:26 -0000 1.4 *************** *** 2,7 **** { /// <summary> ! /// Implementation of FieldNamingStrategy for fields that are prefixed with ! /// an "m_" and the first character in PropertyName capitalized. /// </summary> public class PascalCaseMUnderscoreStrategy : IFieldNamingStrategy --- 2,7 ---- { /// <summary> ! /// Implementation of <see cref="IFieldNamingStrategy"/> for fields that are prefixed with ! /// an <c>m_</c> and the first character in PropertyName capitalized. /// </summary> public class PascalCaseMUnderscoreStrategy : IFieldNamingStrategy *************** *** 10,17 **** /// <summary> ! /// /// </summary> ! /// <param name="propertyName"></param> ! /// <returns></returns> public string GetFieldName( string propertyName ) { --- 10,19 ---- /// <summary> ! /// Converts the Property's name into a Field name by making the first character ! /// of the <c>propertyName</c> uppercase and prefixing it with the letter 'm' ! /// and an underscore. /// </summary> ! /// <param name="propertyName">The name of the mapped property.</param> ! /// <returns>The name of the Field in CamelCase format prefixed with an 'm' and an underscore.</returns> public string GetFieldName( string propertyName ) { Index: FieldAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/FieldAccessor.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FieldAccessor.cs 31 Dec 2004 21:55:49 -0000 1.6 --- FieldAccessor.cs 14 Jan 2005 00:28:26 -0000 1.7 *************** *** 4,14 **** { /// <summary> ! /// Access fields directly. /// </summary> /// <remarks> ! /// This accesses fields with the following naming convention unless a ! /// <see cref="IFieldNamingStrategy"/> is supplied. ! /// Property Name = "Id" ! /// Field Name = "Id" /// </remarks> public class FieldAccessor : IPropertyAccessor --- 4,13 ---- { /// <summary> ! /// Access the mapped property by using a Field to <c>get</c> and <c>set</c> the value. /// </summary> /// <remarks> ! /// The <see cref="FieldAccessor"/> is useful when you expose <c>getter</c> and <c>setters</c> ! /// for a Property, but they have extra code in them that shouldn't be executed when NHibernate ! /// is setting or getting the values for loads or saves. /// </remarks> public class FieldAccessor : IPropertyAccessor *************** *** 16,20 **** private IFieldNamingStrategy namingStrategy; ! /// <summary></summary> public FieldAccessor() { --- 15,21 ---- private IFieldNamingStrategy namingStrategy; ! /// <summary> ! /// Initializes a new instance of <see cref="FieldAccessor"/>. ! /// </summary> public FieldAccessor() { *************** *** 22,28 **** /// <summary> ! /// /// </summary> ! /// <param name="namingStrategy"></param> public FieldAccessor( IFieldNamingStrategy namingStrategy ) { --- 23,29 ---- /// <summary> ! /// Initializes a new instance of <see cref="FieldAccessor"/>. /// </summary> ! /// <param name="namingStrategy">The <see cref="IFieldNamingStrategy"/> to use.</param> public FieldAccessor( IFieldNamingStrategy namingStrategy ) { *************** *** 32,36 **** /// <summary> /// Gets the <see cref="IFieldNamingStrategy"/> used to convert the name of the ! /// Property in the hbm.xml file to the name of the field in the class. /// </summary> /// <value>The <see cref="IFieldNamingStrategy"/> or <c>null</c>.</value> --- 33,37 ---- /// <summary> /// Gets the <see cref="IFieldNamingStrategy"/> used to convert the name of the ! /// mapped Property in the hbm.xml file to the name of the field in the class. /// </summary> /// <value>The <see cref="IFieldNamingStrategy"/> or <c>null</c>.</value> *************** *** 43,51 **** /// <summary> ! /// /// </summary> ! /// <param name="theClass"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> public IGetter GetGetter( System.Type theClass, string propertyName ) { --- 44,59 ---- /// <summary> ! /// Create a <see cref="FieldGetter"/> to <c>get</c> the value of the mapped Property ! /// through a <c>Field</c>. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to get.</param> ! /// <returns> ! /// The <see cref="FieldGetter"/> to use to get the value of the Property from an ! /// instance of the <see cref="System.Type"/>.</returns> ! /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a Field specified by the <c>propertyName</c> could not ! /// be found in the <see cref="System.Type"/>. ! /// </exception> public IGetter GetGetter( System.Type theClass, string propertyName ) { *************** *** 55,63 **** /// <summary> ! /// /// </summary> ! /// <param name="theClass"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> public ISetter GetSetter( System.Type theClass, string propertyName ) { --- 63,79 ---- /// <summary> ! /// Create a <see cref="FieldSetter"/> to <c>set</c> the value of the mapped Property ! /// through a <c>Field</c>. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the mapped Property in.</param> ! /// <param name="propertyName">The name of the mapped Property to set.</param> ! /// <returns> ! /// The <see cref="FieldSetter"/> to use to set the value of the Property on an ! /// instance of the <see cref="System.Type"/>. ! /// </returns> ! /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a Field for the Property specified by the <c>propertyName</c> using the ! /// <see cref="IFieldNamingStrategy"/> could not be found in the <see cref="System.Type"/>. ! /// </exception> public ISetter GetSetter( System.Type theClass, string propertyName ) { *************** *** 69,81 **** /// <summary> ! /// /// </summary> ! /// <param name="clazz"></param> ! /// <param name="fieldName"></param> ! /// <returns></returns> internal static FieldInfo GetField( System.Type clazz, string fieldName ) { if( clazz == null || clazz == typeof( object ) ) { throw new PropertyNotFoundException( "field not found: " + fieldName ); } --- 85,104 ---- /// <summary> ! /// Helper method to find the Field. /// </summary> ! /// <param name="clazz">The <see cref="System.Type"/> to find the Field in.</param> ! /// <param name="fieldName">The name of the Field to find.</param> ! /// <returns> ! /// The <see cref="FieldInfo"/> for the field. ! /// </returns> ! /// <exception cref="PropertyNotFoundException"> ! /// Thrown when a field could not be found. ! /// </exception> internal static FieldInfo GetField( System.Type clazz, string fieldName ) { if( clazz == null || clazz == typeof( object ) ) { + // the full inheritance chain has been walked and we could + // not find the Field throw new PropertyNotFoundException( "field not found: " + fieldName ); } *************** *** 84,87 **** --- 107,111 ---- if( field == null ) { + // recursively call this method for the base Type field = GetField( clazz.BaseType, fieldName ); } *************** *** 94,104 **** /// <summary> ! /// Converts the Property's name into a Field using camel style casing. /// </summary> /// <param name="propertyName">The name of the Property.</param> /// <returns>The name of the Field.</returns> - /// <remarks> - /// This uses the convention that a Property named <c>Id</c> will have a field <c>id</c> - /// </remarks> private string GetFieldName( string propertyName ) { --- 118,126 ---- /// <summary> ! /// Converts the mapped property's name into a Field using ! /// the <see cref="IFieldNamingStrategy"/> if one exists. /// </summary> /// <param name="propertyName">The name of the Property.</param> /// <returns>The name of the Field.</returns> private string GetFieldName( string propertyName ) { Index: CamelCaseStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/CamelCaseStrategy.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CamelCaseStrategy.cs 31 Dec 2004 21:55:49 -0000 1.2 --- CamelCaseStrategy.cs 14 Jan 2005 00:28:26 -0000 1.3 *************** *** 2,7 **** { /// <summary> ! /// Implementation of FieldNamingStrategy for fields that are the ! /// Camel Case version of the PropertyName /// </summary> public class CamelCaseStrategy : IFieldNamingStrategy --- 2,7 ---- { /// <summary> ! /// Implementation of <see cref="IFieldNamingStrategy"/> for fields that are the ! /// camelCase version of the PropertyName /// </summary> public class CamelCaseStrategy : IFieldNamingStrategy *************** *** 10,17 **** /// <summary> ! /// /// </summary> ! /// <param name="propertyName"></param> ! /// <returns></returns> public string GetFieldName( string propertyName ) { --- 10,18 ---- /// <summary> ! /// Converts the Property's name into a Field name by making the first character ! /// lower case. /// </summary> ! /// <param name="propertyName">The name of the mapped property.</param> ! /// <returns>The name of the Field in CamelCase format.</returns> public string GetFieldName( string propertyName ) { Index: LowerCaseUnderscoreStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/LowerCaseUnderscoreStrategy.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LowerCaseUnderscoreStrategy.cs 31 Dec 2004 21:56:23 -0000 1.2 --- LowerCaseUnderscoreStrategy.cs 14 Jan 2005 00:28:26 -0000 1.3 *************** *** 2,6 **** { /// <summary> ! /// Implementation of FieldNamingStrategy for fields that are prefixed with /// an underscore and the PropertyName is changed to lower case. /// </summary> --- 2,6 ---- { /// <summary> ! /// Implementation of <see cref="IFieldNamingStrategy"/> for fields that are prefixed with /// an underscore and the PropertyName is changed to lower case. /// </summary> *************** *** 10,17 **** /// <summary> ! /// /// </summary> ! /// <param name="propertyName"></param> ! /// <returns></returns> public string GetFieldName( string propertyName ) { --- 10,18 ---- /// <summary> ! /// Converts the Property's name into a Field name by making the all characters ! /// of the <c>propertyName</c> lowercase and prefixing it with an underscore. /// </summary> ! /// <param name="propertyName">The name of the mapped property.</param> ! /// <returns>The name of the Field in lowercase prefixed with an underscore.</returns> public string GetFieldName( string propertyName ) { Index: BasicSetter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/BasicSetter.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicSetter.cs 13 Jan 2005 20:55:16 -0000 1.3 --- BasicSetter.cs 14 Jan 2005 00:28:26 -0000 1.4 *************** *** 18,22 **** /// <param name="clazz">The <see cref="System.Type"/> that contains the Property <c>set</c>.</param> /// <param name="property">The <see cref="PropertyInfo"/> for reflection.</param> ! /// <param name="propertyName">The name of the Property.</param> public BasicSetter( System.Type clazz, PropertyInfo property, string propertyName ) { --- 18,22 ---- /// <param name="clazz">The <see cref="System.Type"/> that contains the Property <c>set</c>.</param> /// <param name="property">The <see cref="PropertyInfo"/> for reflection.</param> ! /// <param name="propertyName">The name of the mapped Property.</param> public BasicSetter( System.Type clazz, PropertyInfo property, string propertyName ) { *************** *** 49,55 **** /// <summary> ! /// Gets the name of the Property. /// </summary> ! /// <value>The name of the Property or <c>null</c>.</value> public string PropertyName { --- 49,55 ---- /// <summary> ! /// Gets the name of the mapped Property. /// </summary> ! /// <value>The name of the mapped Property or <c>null</c>.</value> public string PropertyName { *************** *** 58,64 **** /// <summary> ! /// Gets the <see cref="PropertyInfo"/> for the Property. /// </summary> ! /// <value>The <see cref="PropertyInfo"/> for the Property.</value> public PropertyInfo Property { --- 58,64 ---- /// <summary> ! /// Gets the <see cref="PropertyInfo"/> for the mapped Property. /// </summary> ! /// <value>The <see cref="PropertyInfo"/> for the mapped Property.</value> public PropertyInfo Property { |
From: Kevin W. <kev...@us...> - 2005-01-13 23:13:22
|
Update of /cvsroot/nhibernate/NHibernateContrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29342 Modified Files: NHibernateContribSolution.build Log Message: adding pervalence cache provider Index: NHibernateContribSolution.build =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/NHibernateContribSolution.build,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NHibernateContribSolution.build 5 Jan 2005 21:09:50 -0000 1.8 --- NHibernateContribSolution.build 13 Jan 2005 23:13:12 -0000 1.9 *************** *** 118,121 **** --- 118,122 ---- <includes name="NAnt.Core.*" /> <includes name="NVelocity.*" /> + <includes name="Bamboo.*" /> </fileset> </copy> *************** *** 129,132 **** --- 130,134 ---- <includes name="NHibernate.*" /> <includes name="nunit.framework.*" /> + <includes name="Castle.*" /> </fileset> </copy> *************** *** 139,142 **** --- 141,145 ---- <nant target="build" buildfile="src/NHibernate.Tool.hbm2net/NHibernate.Tool.hbm2net.build" /> <nant target="build" buildfile="src/NHibernate.Tasks/NHibernate.Tasks.build" /> + <nant target="build" buildfile="src/NHibernate.Caches.Prevalence/prevalencecache.build" /> </target> *************** *** 176,179 **** --- 179,183 ---- <nant target="test" buildfile="src/BantamTech.SysCache/syscache.build" /> + <nant target="test" buildfile="src/NHibernate.Caches.Prevalence/prevalencecache.build" /> <!-- if this was a clover enabled build then generate the clover reports for it --> *************** *** 187,191 **** initstring="${clover.db}" flushinterval="1000" ! /> <clover-report> <current title="NHibernateContrib" output="${build.dir}/clover" > --- 191,200 ---- initstring="${clover.db}" flushinterval="1000" ! > ! <fileset basedir="src"> ! <excludes name="**/*Fixture.cs"/> ! <includes name="**/*.cs"/> ! </fileset> ! </clover-setup> <clover-report> <current title="NHibernateContrib" output="${build.dir}/clover" > *************** *** 206,209 **** --- 215,219 ---- <assemblies basedir="${build.dir}/bin"> <includes name="BantamTech.SysCache.dll" /> + <includes name="NHibernate.Caches.Prevalence.dll" /> <includes name="Nullables.dll" /> <includes name="Nullables.NHibernate.dll" /> |
From: Kevin W. <kev...@us...> - 2005-01-13 23:12:53
|
Update of /cvsroot/nhibernate/NHibernateContrib/lib/net/1.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29199 Modified Files: Iesi.Collections.dll Added Files: Castle.DynamicProxy.dll Castle.DynamicProxy.license.txt Log Message: updating dependencies Index: Iesi.Collections.dll =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/lib/net/1.1/Iesi.Collections.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsKI6t1P and /tmp/cvsntuUcz differ --- NEW FILE: Castle.DynamicProxy.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Castle.DynamicProxy.license.txt --- Copyright 2004 DigitalCraftsmen - http://www.digitalcraftsmen.com.br/ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |