You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael D. <mik...@us...> - 2004-12-27 02:26:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3720/NHibernate/Driver Modified Files: FirebirdDriver.cs MySqlDataDriver.cs NpgsqlDriver.cs OracleClientDriver.cs Log Message: Added better error messages for situation where required assemblies to create the connection and command are not in the bin or gac. Index: FirebirdDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/FirebirdDriver.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FirebirdDriver.cs 18 May 2004 05:02:27 -0000 1.3 --- FirebirdDriver.cs 27 Dec 2004 02:26:13 -0000 1.4 *************** *** 1,5 **** using System; - using System.Data; - using System.Reflection; namespace NHibernate.Driver --- 1,3 ---- *************** *** 17,20 **** --- 15,28 ---- connectionType = System.Type.GetType("FirebirdSql.Data.Firebird.FbConnection, FirebirdSql.Data.Firebird"); commandType = System.Type.GetType("FirebirdSql.Data.Firebird.FbCommand, FirebirdSql.Data.Firebird"); + + if( connectionType==null || commandType==null ) + { + throw new HibernateException( + "The IDbCommand and IDbConnection implementation in the Assembly FirebirdSql.Data could not be found. " + + "Please ensure that the Assemblies needed to communicate with Firebird " + + "are in the Global Assembly Cache or in a location that NHibernate " + + "can use System.Type.GetType(string) to load the types from." + ); + } } Index: OracleClientDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OracleClientDriver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleClientDriver.cs 18 May 2004 05:02:27 -0000 1.1 --- OracleClientDriver.cs 27 Dec 2004 02:26:13 -0000 1.2 *************** *** 6,11 **** { /// <summary> ! /// A NHibernate Driver for using the Oracle DataProvider ! /// <see cref="System.Data.OracleClient.OracleConnection"/>. /// </summary> public class OracleClientDriver: DriverBase --- 6,10 ---- { /// <summary> ! /// A NHibernate Driver for using the Oracle DataProvider. /// </summary> public class OracleClientDriver: DriverBase Index: NpgsqlDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NpgsqlDriver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NpgsqlDriver.cs 19 Sep 2004 15:32:34 -0000 1.1 --- NpgsqlDriver.cs 27 Dec 2004 02:26:13 -0000 1.2 *************** *** 1,5 **** using System; - using System.Data; - using System.Reflection; namespace NHibernate.Driver --- 1,3 ---- *************** *** 17,21 **** /// </p> /// <p> ! /// Please check the products website <a href="http://www.postgresql.org/">http://www.postgresql.org/</a> /// for any updates and or documentation. /// </p> --- 15,20 ---- /// </p> /// <p> ! /// Please check the products website ! /// <a href="http://www.postgresql.org/">http://www.postgresql.org/</a> /// for any updates and or documentation. /// </p> *************** *** 34,37 **** --- 33,46 ---- connectionType = System.Type.GetType("Npgsql.NpgsqlConnection, Npgsql"); commandType = System.Type.GetType("Npgsql.NpgsqlCommand, Npgsql"); + + if( connectionType==null || commandType==null ) + { + throw new HibernateException( + "The IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. " + + "Please ensure that the Assemblies needed to communicate with PostgreSQL " + + "are in the Global Assembly Cache or in a location that NHibernate " + + "can use System.Type.GetType(string) to load the types from." + ); + } } Index: MySqlDataDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/MySqlDataDriver.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MySqlDataDriver.cs 6 Dec 2004 03:39:16 -0000 1.2 --- MySqlDataDriver.cs 27 Dec 2004 02:26:13 -0000 1.3 *************** *** 1,8 **** using System; - using System.Data; - using System.Reflection; - - using NHibernate.Dialect; - using NHibernate.SqlCommand; namespace NHibernate.Driver --- 1,3 ---- *************** *** 19,23 **** /// </p> /// <p> ! /// Please check the products website <a href="http://www.mysql.com/products/connector/net/">http://www.mysql.com/products/connector/net/</a> /// for any updates and or documentation. /// </p> --- 14,19 ---- /// </p> /// <p> ! /// Please check the products website ! /// <a href="http://www.mysql.com/products/connector/net/">http://www.mysql.com/products/connector/net/</a> /// for any updates and or documentation. /// </p> *************** *** 32,35 **** --- 28,41 ---- connectionType = System.Type.GetType("MySql.Data.MySqlClient.MySqlConnection, MySql.Data"); commandType = System.Type.GetType("MySql.Data.MySqlClient.MySqlCommand, MySql.Data"); + + if( connectionType==null || commandType==null ) + { + throw new HibernateException( + "The IDbCommand and IDbConnection implementation in the Assembly MySql.Data could not be found. " + + "Please ensure that the Assemblies MySql.Data.dll and ICSharpCode.SharpZipLib.dll " + + "are in the Global Assembly Cache or in a location that NHibernate " + + "can use System.Type.GetType(string) to load the types from." + ); + } } *************** *** 45,51 **** /// <summary> ! /// MySqlData does not use named parameters in the sql. /// </summary> ! /// <value><c>false</c> becuase MySql uses <c>?</c> in the sql.</value> public override bool UseNamedPrefixInSql { --- 51,57 ---- /// <summary> ! /// MySql.Data uses named parameters in the sql. /// </summary> ! /// <value><c>true</c> - MySql uses <c>?</c> in the sql.</value> public override bool UseNamedPrefixInSql { *************** *** 53,56 **** --- 59,65 ---- } + /// <summary> + /// + /// </summary> public override bool UseNamedPrefixInParameter { *************** *** 58,61 **** --- 67,74 ---- } + /// <summary> + /// MySql.Data use the <c>?</c> to locate parameters in sql. + /// </summary> + /// <value><c>?</c> is used to locate parameters in sql.</value> public override string NamedPrefix { *************** *** 64,68 **** /// <summary> ! /// The ByteFX driver does NOT support more than 1 open IDataReader /// with only 1 IDbConnection. /// </summary> --- 77,81 ---- /// <summary> ! /// The MySql.Data driver does NOT support more than 1 open IDataReader /// with only 1 IDbConnection. /// </summary> *************** *** 77,80 **** --- 90,94 ---- /// message "Expected End of data packet" when a select command is prepared. /// </summary> + /// <value><c>false</c> - it is not supported.</value> public override bool SupportsPreparingCommands { |
From: Michael D. <mik...@us...> - 2004-12-21 20:43:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10755/NHibernate/Engine Modified Files: ISessionFactoryImplementor.cs Log Message: Added a config parameter "hibernate.prepare_sql". This along with if the Driver supports preparing commands determines if .Prepare() gets called on the command. Index: ISessionFactoryImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionFactoryImplementor.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ISessionFactoryImplementor.cs 30 Oct 2004 14:41:54 -0000 1.11 --- ISessionFactoryImplementor.cs 21 Dec 2004 20:43:41 -0000 1.12 *************** *** 74,77 **** --- 74,83 ---- /// <summary> + /// Gets a boolean indicating if the sql statement should be prepared. The value + /// is read from <c>hibernate.prepare_sql</c>. + /// </summary> + bool PrepareSql { get; } + + /// <summary> /// Get the return types of a query /// </summary> |
From: Michael D. <mik...@us...> - 2004-12-21 20:43:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10755/NHibernate/Cfg Modified Files: Environment.cs Settings.cs SettingsFactory.cs Log Message: Added a config parameter "hibernate.prepare_sql". This along with if the Driver supports preparing commands determines if .Prepare() gets called on the command. Index: Environment.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Environment.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Environment.cs 29 Oct 2004 05:58:06 -0000 1.20 --- Environment.cs 21 Dec 2004 20:43:41 -0000 1.21 *************** *** 47,50 **** --- 47,51 ---- public const string QueryImports = "hibernate.query.imports"; public const string CacheProvider = "hibernate.cache.provider_class"; + public const string PrepareSql = "hibernate.prepare_sql"; static Environment() Index: Settings.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Settings.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Settings.cs 31 Oct 2004 04:25:57 -0000 1.2 --- Settings.cs 21 Dec 2004 20:43:41 -0000 1.3 *************** *** 25,29 **** private ICacheProvider _cacheProvider; private string _defaultSchemaName; ! public bool IsShowSqlEnabled --- 25,29 ---- private ICacheProvider _cacheProvider; private string _defaultSchemaName; ! private bool _prepareSql; public bool IsShowSqlEnabled *************** *** 87,90 **** --- 87,95 ---- } + public bool PrepareSql + { + get { return _prepareSql; } + set { _prepareSql = value; } + } } } Index: SettingsFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SettingsFactory.cs 29 Oct 2004 05:58:06 -0000 1.1 --- SettingsFactory.cs 21 Dec 2004 20:43:41 -0000 1.2 *************** *** 106,109 **** --- 106,111 ---- } + bool prepareSql = PropertiesHelper.GetBoolean( Environment.PrepareSql, properties, true ); + string sessionFactoryName = (string) properties[ Cfg.Environment.SessionFactoryName ]; *************** *** 118,121 **** --- 120,124 ---- settings.SessionFactoryName = sessionFactoryName; settings.IsOuterJoinFetchEnabled = useOuterJoin; + settings.PrepareSql = prepareSql; return settings; |
From: Michael D. <mik...@us...> - 2004-12-21 20:43:49
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10755/NHibernate/Impl Modified Files: BatcherImpl.cs SessionFactoryImpl.cs Log Message: Added a config parameter "hibernate.prepare_sql". This along with if the Driver supports preparing commands determines if .Prepare() gets called on the command. Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** SessionFactoryImpl.cs 8 Nov 2004 02:53:57 -0000 1.36 --- SessionFactoryImpl.cs 21 Dec 2004 20:43:40 -0000 1.37 *************** *** 312,315 **** --- 312,320 ---- } + public bool PrepareSql + { + get { return settings.PrepareSql; } + } + public QueryTranslator GetQuery(string query) { Index: BatcherImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/BatcherImpl.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BatcherImpl.cs 4 Dec 2004 22:41:20 -0000 1.12 --- BatcherImpl.cs 21 Dec 2004 20:43:40 -0000 1.13 *************** *** 33,40 **** --- 33,45 ---- private ISet readersToClose = new HashedSet(); + // key = SqlString + // value = IDbCommand + private IDictionary commands; + public BatcherImpl(ISessionImplementor session) { this.session = session; this.factory = session.Factory; + commands = new Hashtable(); } *************** *** 49,57 **** public IDbCommand Generate(SqlString sqlString) { ! IDbCommand cmd = factory.ConnectionProvider.Driver.GenerateCommand(factory.Dialect, sqlString); if(log.IsDebugEnabled) { log.Debug( "Building an IDbCommand object for the SqlString: " + sqlString.ToString() ); } return cmd; --- 54,77 ---- public IDbCommand Generate(SqlString sqlString) { ! IDbCommand cmd = commands[ sqlString ] as IDbCommand; ! ! if( cmd!=null ) ! { ! if( log.IsDebugEnabled ) ! { ! log.Debug( "Using prebuilt IDbCommand object for the SqlString: " + sqlString.ToString() ); ! } ! ! return cmd; ! } ! ! // need to build the IDbCommand from the sqlString bec ! cmd = factory.ConnectionProvider.Driver.GenerateCommand(factory.Dialect, sqlString); if(log.IsDebugEnabled) { log.Debug( "Building an IDbCommand object for the SqlString: " + sqlString.ToString() ); } + + commands[ sqlString ] = cmd; return cmd; *************** *** 78,85 **** if( command.Connection!=null ) { if( command.Connection!=session.Connection ) { ! throw new AssertionFailure("The IDbCommand for " + command.CommandText + " has a different connection " + ! "than the Connection the Session is providing."); } } --- 98,106 ---- if( command.Connection!=null ) { + // make sure the commands connection is the same as the Sessions connection + // these can be different when the session is disconnected and then reconnected if( command.Connection!=session.Connection ) { ! command.Connection = session.Connection; } } *************** *** 94,99 **** } ! ! if( factory.ConnectionProvider.Driver.SupportsPreparingCommands ) { command.Prepare(); --- 115,119 ---- } ! if( factory.PrepareSql && factory.ConnectionProvider.Driver.SupportsPreparingCommands ) { command.Prepare(); *************** *** 140,144 **** // another open one Command is doing something then an exception will be // thrown. ! IDbCommand command = Generate( sql ); // session.Preparer.BuildCommand(sql); commandsToClose.Add(command); --- 160,164 ---- // another open one Command is doing something then an exception will be // thrown. ! IDbCommand command = Generate( sql ); commandsToClose.Add(command); |
From: Michael D. <mik...@us...> - 2004-12-20 05:06:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16662/NHibernate.Test Modified Files: FooBarTest.cs Log Message: more work on test fixture. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** FooBarTest.cs 16 Dec 2004 21:56:06 -0000 1.76 --- FooBarTest.cs 20 Dec 2004 05:06:30 -0000 1.77 *************** *** 842,846 **** //The special property (lowercase) id may be used to reference the unique identifier of an object. (You may also use its property name.) string hqlString = "from s in class Stuff where s.Foo.id = ? and s.id.Id = ? and s.MoreStuff.id.IntId = ? and s.MoreStuff.id.StringId = ?"; ! object[] values = new object[] {bar, (long)1234, (int)12, "id" }; Type.IType[] types = new Type.IType[] { --- 842,846 ---- //The special property (lowercase) id may be used to reference the unique identifier of an object. (You may also use its property name.) string hqlString = "from s in class Stuff where s.Foo.id = ? and s.id.Id = ? and s.MoreStuff.id.IntId = ? and s.MoreStuff.id.StringId = ?"; ! object[] values = new object[] {bar, (long)1234, 12, "id" }; Type.IType[] types = new Type.IType[] { *************** *** 1819,1824 **** s.Find( "from Baz baz left join baz.FooToGlarch join fetch baz.FooSet foo left join fetch foo.TheFoo" ); ! //TODO: resume h2.0.3 - line 1613 } [Test] --- 1819,1861 ---- s.Find( "from Baz baz left join baz.FooToGlarch join fetch baz.FooSet foo left join fetch foo.TheFoo" ); ! // foo.Boolean = true ! list = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.String='osama bin laden' and foo.Boolean = 1 order by foo.String asc, foo.Component.Count desc" ); ! Assert.AreEqual( 0, list.Count, "empty query" ); ! IEnumerable enumer = s.Enumerable( "from foo in class NHibernate.DomainModel.Foo where foo.String='osama bin laden' order by foo.String asc, foo.Component.Count desc" ); ! Assert.IsFalse( enumer.GetEnumerator().MoveNext(), "empty enumerator" ); ! ! list = s.Find( "select foo.TheFoo from foo in class NHibernate.DomainModel.Foo" ); ! Assert.AreEqual( 1, list.Count, "query" ); ! Assert.AreEqual( foo.TheFoo, list[0], "returned object" ); ! foo.TheFoo.TheFoo = foo; ! foo.String = "fizard"; ! ! // the following test is disabled for databases with no subselects...also for Interbase (not sure why) - h2.0.3 ! // also HSQLDialect, MckoiDialect, SAPDBDialect, PointbaseDialect ! if( !(dialect is Dialect.MySQLDialect) ) ! { ! // 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" ); ! } ! ! // WAS: 3 in h2.0.3 - there's a null value at index 2 that is not in the db with hibernate - it is a missing index ! // in the db ! list = s.Find( "from foo in class NHibernate.DomainModel.Foo where size(foo.Component.ImportantDates) = 4" ); ! Assert.AreEqual( 2, list.Count, "component query" ); ! list = s.Find( "from foo in class Foo where 0 = size(foo.Component.ImportantDates)" ); ! Assert.AreEqual( 0, list.Count, "component query" ); ! list = s.Find( "from foo in class Foo where exists elements(foo.Component.ImportantDates)" ); ! Assert.AreEqual( 2, list.Count, "component query" ); ! s.Find( "from foo in class Foo where not exists (from bar in class Bar where bar.id = foo.id)" ); ! ! s.Find( "select foo.TheFoo from foo in class Foo where foo = some(select x from x in class Foo where x.Long > foo.TheFoo.Long)" ); ! s.Find( "from foo in class Foo where foo = some(select x from x in class Foo where x.Long > foo.TheFoo.Long) and foo.TheFoo.String='baz'" ); ! s.Find( "from foo in class Foo where foo.TheFoo.String='baz' and foo = some(select x from x in class Foo where x.Long>foo.TheFoo.Long)" ); ! s.Find( "from foo in class Foo where foo = some(select x from x in class Foo where x.Long > foo.TheFoo.Long)" ); ! ! s.Enumerable( "select foo.String, foo.Date, foo.TheFoo.String, foo.id from foo in class Foo, baz in class Baz where foo in elements(baz.FooArray) and foo.String like 'foo'" ); } + // line 1645 [Test] *************** *** 2908,2912 **** g2.ProxyArray = new GlarchProxy[] { null, g3, g }; - object emptyObject = new object(); Iesi.Collections.ISet hashset = new Iesi.Collections.HashedSet(); hashset.Add( g1 ); --- 2945,2948 ---- *************** *** 3502,3506 **** baz.FooArray = new Foo[] { bar, bar2 }; - object emptyObject = new object(); Iesi.Collections.ISet hashset = new Iesi.Collections.HashedSet(); bar = new Bar(); --- 3538,3541 ---- |
From: Michael D. <mik...@us...> - 2004-12-20 05:06:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16662/NHibernate.DomainModel Modified Files: Baz.cs Foo.cs Log Message: more work on test fixture. Index: Baz.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Baz.cs 9 Dec 2004 20:57:25 -0000 1.12 --- Baz.cs 20 Dec 2004 05:06:29 -0000 1.13 *************** *** 547,550 **** --- 547,552 ---- public void SetDefaults() { + DateTime today = new DateTime( DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ); + StringSet = new Iesi.Collections.HashedSet(); StringSet.Add( "foo" ); *************** *** 575,579 **** Name="Bazza"; TopComponents = new ArrayList(); ! TopComponents.Add( new FooComponent("foo", 11, new DateTime[] { new DateTime(), new DateTime(2123,1,1) }, null) ); TopComponents.Add( new FooComponent("bar", 22, new DateTime[] { new DateTime(2007,2,3), new DateTime(1945,6,1) }, null) ); TopComponents.Add( null ); --- 577,581 ---- Name="Bazza"; TopComponents = new ArrayList(); ! TopComponents.Add( new FooComponent("foo", 11, new DateTime[] { today, new DateTime(2123,1,1) }, null) ); TopComponents.Add( new FooComponent("bar", 22, new DateTime[] { new DateTime(2007,2,3), new DateTime(1945,6,1) }, null) ); TopComponents.Add( null ); Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Foo.cs 1 Sep 2004 00:10:11 -0000 1.14 --- Foo.cs 20 Dec 2004 05:06:29 -0000 1.15 *************** *** 348,352 **** "foo", "bar" }; ! _component = new FooComponent("foo", 12, new DateTime[] { _date, _timestamp, DateTime.MinValue, new DateTime() }, new FooComponent("bar", 666, new DateTime[] { new DateTime(1999,12,3), DateTime.MinValue }, null ) ); _component.Glarch = new Glarch(); _dependent = new Fee(); --- 348,352 ---- "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(); |
From: Michael D. <mik...@us...> - 2004-12-20 04:49:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13167/NHibernate/Type Modified Files: TimeSpanType.cs Log Message: fixed up a xml comment cref Index: TimeSpanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeSpanType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TimeSpanType.cs 25 Oct 2004 05:37:56 -0000 1.7 --- TimeSpanType.cs 20 Dec 2004 04:49:03 -0000 1.8 *************** *** 8,12 **** /// <summary> ! /// Maps a <see cref="System.Timespan" /> Property to an <see cref="DbType.Int64" /> column /// </summary> public class TimeSpanType : ValueTypeType, IVersionType, ILiteralType --- 8,12 ---- /// <summary> ! /// Maps a <see cref="System.TimeSpan" /> Property to an <see cref="DbType.Int64" /> column /// </summary> public class TimeSpanType : ValueTypeType, IVersionType, ILiteralType |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13098/NHibernate/Cache Modified Files: CachedItem.cs CacheException.cs CacheFactory.cs ICacheConcurrencyStrategy.cs ReadOnlyCache.cs ReadWriteCache.cs Timestamper.cs Log Message: minor code cleanup. Index: CacheFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CacheFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CacheFactory.cs 31 Oct 2004 04:25:56 -0000 1.2 --- CacheFactory.cs 20 Dec 2004 04:48:29 -0000 1.3 *************** *** 5,9 **** { /// <summary> ! /// Summary description for CacheFactory. /// </summary> public class CacheFactory --- 5,9 ---- { /// <summary> ! /// Factory class for creating an <see cref="ICacheConcurrencyStrategy"/>. /// </summary> public class CacheFactory *************** *** 20,23 **** --- 20,30 ---- public const string NonstrictReadWrite = "nonstrict-read-write"; + /// <summary> + /// Creates an <see cref="ICacheConcurrencyStrategy"/> from the parameters. + /// </summary> + /// <param name="node">The <see cref="XmlNode"/> that contains the attribute <c>usage</c>.</param> + /// <param name="name">The name of the class the strategy is being created for.</param> + /// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param> + /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> public static ICacheConcurrencyStrategy CreateCache(XmlNode node, string name, bool mutable) { *************** *** 25,28 **** --- 32,42 ---- } + /// <summary> + /// Creates an <see cref="ICacheConcurrencyStrategy"/> from the parameters. + /// </summary> + /// <param name="usage">The name of the strategy that <see cref="ICacheProvider"/> should use for the class.</param> + /// <param name="name">The name of the class the strategy is being created for.</param> + /// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param> + /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> // was private in h2.1 public static ICacheConcurrencyStrategy CreateCache(string usage, string name, bool mutable) Index: CachedItem.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CachedItem.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CachedItem.cs 6 May 2004 20:53:59 -0000 1.3 --- CachedItem.cs 20 Dec 2004 04:48:28 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate.Cache { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate.Cache { /// <summary> *************** *** 8,12 **** /// </summary> [Serializable] ! public class CachedItem { private long freshTimestamp; --- 8,12 ---- /// </summary> [Serializable] ! public class CachedItem { private long freshTimestamp; *************** *** 16,20 **** private object value; ! public CachedItem(object value) { this.value = value; --- 16,20 ---- private object value; ! public CachedItem(object value) { this.value = value; *************** *** 27,36 **** /// The timestamp on the Cached Data. /// </summary> ! public long FreshTimestamp { get { return freshTimestamp; } } ! public long UnlockTimestamp { get { return unlockTimestamp; } --- 27,36 ---- /// The timestamp on the Cached Data. /// </summary> ! public long FreshTimestamp { get { return freshTimestamp; } } ! public long UnlockTimestamp { get { return unlockTimestamp; } *************** *** 40,44 **** /// The actual cached Data. /// </summary> ! public object Value { get { return value; } --- 40,44 ---- /// The actual cached Data. /// </summary> ! public object Value { get { return value; } *************** *** 49,53 **** /// </summary> /// <value>true if the CachedItem has not ever been locked.</value> ! public bool IsFresh { get { return fresh; } --- 49,53 ---- /// </summary> /// <value>true if the CachedItem has not ever been locked.</value> ! public bool IsFresh { get { return fresh; } *************** *** 57,63 **** /// Lock the Item. /// </summary> ! public void Lock() { ! if ( 0 == theLock++ ) { fresh = false; --- 57,63 ---- /// Lock the Item. /// </summary> ! public void Lock() { ! if( 0 == theLock++ ) { fresh = false; *************** *** 65,74 **** } } /// <summary> /// Unlock the Item /// </summary> ! public void Unlock() { ! if ( --theLock == 0 ) { unlockTimestamp = Timestamper.Next(); --- 65,75 ---- } } + /// <summary> /// Unlock the Item /// </summary> ! public void Unlock() { ! if( --theLock == 0 ) { unlockTimestamp = Timestamper.Next(); *************** *** 80,84 **** /// </summary> /// <value>true if there are no locks on the CachedItem.</value> ! public bool IsUnlocked { get { return theLock == 0; } --- 81,85 ---- /// </summary> /// <value>true if there are no locks on the CachedItem.</value> ! public bool IsUnlocked { get { return theLock == 0; } *************** *** 86,88 **** } ! } --- 87,89 ---- } ! } \ No newline at end of file Index: Timestamper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/Timestamper.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Timestamper.cs 24 Oct 2004 21:42:40 -0000 1.7 --- Timestamper.cs 20 Dec 2004 04:48:29 -0000 1.8 *************** *** 1,4 **** using System; - using System.Runtime.CompilerServices; namespace NHibernate.Cache --- 1,3 ---- Index: ICacheConcurrencyStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICacheConcurrencyStrategy.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ICacheConcurrencyStrategy.cs 26 Oct 2004 21:15:09 -0000 1.3 --- ICacheConcurrencyStrategy.cs 20 Dec 2004 04:48:29 -0000 1.4 *************** *** 13,17 **** /// When used to Cache Entities and Collections the <c>key</c> is the <c>id</c> of the /// Entity/Collection and the <c>value</c> should be set to the <see cref="Impl.CacheEntry"/> ! /// for an Entity and the results of <see cref="PeristentCollection"/>.Disassemble for a Collection. /// </para> /// </remarks> --- 13,17 ---- /// When used to Cache Entities and Collections the <c>key</c> is the <c>id</c> of the /// Entity/Collection and the <c>value</c> should be set to the <see cref="Impl.CacheEntry"/> ! /// for an Entity and the results of <see cref="Collection.PersistentCollection"/>.Disassemble for a Collection. /// </para> /// </remarks> *************** *** 61,65 **** /// /// </summary> - /// <param name="key"></param> /// <exception cref="CacheException"></exception> void Clear(); --- 61,64 ---- *************** *** 68,72 **** /// /// </summary> - /// <param name="key"></param> /// <exception cref="CacheException"></exception> void Destroy(); --- 67,70 ---- Index: ReadWriteCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadWriteCache.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReadWriteCache.cs 29 Oct 2004 05:55:26 -0000 1.5 --- ReadWriteCache.cs 20 Dec 2004 04:48:29 -0000 1.6 *************** *** 1,4 **** using System; - using System.Runtime.CompilerServices; namespace NHibernate.Cache --- 1,3 ---- Index: ReadOnlyCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadOnlyCache.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReadOnlyCache.cs 29 Oct 2004 05:55:26 -0000 1.6 --- ReadOnlyCache.cs 20 Dec 2004 04:48:29 -0000 1.7 *************** *** 1,4 **** using System; - using System.Runtime.CompilerServices; namespace NHibernate.Cache --- 1,3 ---- Index: CacheException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CacheException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CacheException.cs 22 Nov 2004 03:50:04 -0000 1.3 --- CacheException.cs 20 Dec 2004 04:48:28 -0000 1.4 *************** *** 1,16 **** using System; ! namespace NHibernate.Cache { /// <summary> ! /// Represents any exception from an <c>ICache</c> /// </summary> [Serializable] ! public class CacheException : HibernateException { ! public CacheException(string message) : base(message) { } ! public CacheException(Exception e) : base(e) { } } ! } --- 1,20 ---- using System; ! namespace NHibernate.Cache { /// <summary> ! /// Represents any exception from an <see cref="ICache"/>. /// </summary> [Serializable] ! public class CacheException : HibernateException { ! public CacheException(string message) : base( message ) ! { ! } ! public CacheException(Exception e) : base( e ) ! { ! } } ! } \ No newline at end of file |
From: Michael D. <mik...@us...> - 2004-12-20 00:36:04
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv575/modules Added Files: configuration.xml Log Message: some work on docs. --- NEW FILE: configuration.xml --- <!-- before committing make sure to comment out the DOCTYPE It is in here to get intellisense with XMLSpy. The HomeEdition is a free download. <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../support/docbook-dtd/docbookx.dtd"> --> <chapter id="session-configuration"> <title>ISessionFactory Configuration</title> <para> Because NHibernate is designed to operate in many different environments, there are a large number of configuration parameters. Fortunately, most have sensible default values. The NHibernate.Test.dll contains an example of the hibernate properties in an <literal>app.config</literal> file that shows the various options. </para> <sect1 id="configuration-programmatic"> <title>Programmatic Configuration</title> <para> An instance of <literal>NHibernate.Cfg.Configuration</literal> represents an entire set of mappings of an application's .NET types to a SQL database. The <literal>Configuration</literal> is used to build a (immutable) <literal>ISessionFactory</literal>. The mappings are compiled from various XML mapping files. </para> <para> You may obtain a <literal>Configuration</literal> instance by instantiating it directly. Heres an example of setting up a datastore from mappings defined in two XML configuration files (in the same folder as the exe): </para> <programlisting><![CDATA[Configuration cfg = new Configuration() .AddXmlFile("Item.hbm.xml") .AddXmlFile("Bid.hbm.xml");]]></programlisting> <para> An alternative (usually better) way is to let NHibernate load a mapping file using <literal>GetManifestResourceStream()</literal>: </para> <programlisting><![CDATA[Configuration cfg = new Configuration() .AddClass( typeof(NHibernate.Auction.Item) ) .AddClass( typeof(NHibernate.Auction.Bid) );]]></programlisting> <para> Then NHibernate will look for mapping files named <literal>NHibernate.Auction.Item.hbm.xml</literal> and <literal>NHibernate.Auction.Bid.hbm.xml</literal> as an Embedded Resource in the Assembly those types are contained in. This approach eliminates any hardcoded filenames. </para> <para> Another alternative (probably best) way is to let NHibernate load all of the mapping files contained in an Assembly: </para> <programlisting><![CDATA[Configuration cfg = new Configuration() .AddAssembly( "NHibernate.Auction" );]]></programlisting> <para> Then NHibernate will look through the Assembly for any resources that end with <literal>hbm.xml</literal>. This approach eliminates any hardcoded filenames and ensures the mapping files in the Assembly get added. </para> <para> If VisualStudio.NET or NAnt is used to build the Assembly then make sure that the hbm.xml files are added as <literal>Embedded Resources</literal>. </para> <para> A <literal>Configuration</literal> also specifies various optional properties: </para> <programlisting><![CDATA[Hashtable props = new Hashtable(); ... Configuration cfg = new Configuration() .AddClass( typeof(NHibernate.Auction.Item) ) .AddClass( typeof(NHibernate.Auction.Bid) ) .Properties = props;]]></programlisting> <para> A <literal>Configuration</literal> is intended as a configuration-time object, to be discarded once a <literal>SessionFactory</literal> is built. </para> </sect1> <sect1 id="configuration-sessionfactory"> <title>Obtaining an ISessionFactory</title> <para> When all mappings have been parsed by the <literal>Configuration</literal>, the application must obtain a factory for <literal>ISession</literal> instances. This factory is intended to be shared by all application threads: </para> <programlisting><![CDATA[ISessionFactory sessions = cfg.BuildSessionFactory();]]></programlisting> <para> However, NHibernate does allow your application to instantiate more than one <literal>ISessionFactory</literal>. This is useful if you are using more than one database. </para> </sect1> <sect1 id="configuration-userado"> <title>User provided ADO.NET connection</title> <para> An <literal>ISessionFactory</literal> may open an <literal>ISession</literal> on a user-provided ADO.NET connection. This design choice frees the application to obtain ADO.NET connections wherever it pleases: </para> <programlisting><![CDATA[IDbConnection conn = myapp.GetOpenConnection(); ISession session = sessions.OpenSession(conn); // do some data access work]]></programlisting> <para> The application must be careful not to open two concurrent <literal>ISession</literal>s on the same ADO.NET connection! </para> </sect1> <sect1 id="configuration-nhibernateado"> <title>NHibernate provided ADO connection</title> <para> Alternatively, you can have the <literal>ISessionFactory</literal> open connections for you. The <literal>ISessionFactory</literal> must be provided with ADO connection properties in one of the following ways: </para> <orderedlist spacing="compact"> <listitem> <para> Pass an instance of <literal>IDictionary</literal> to <literal>Configuration.Properties</literal>. </para> </listitem> <listitem> <para> Add the properties to a configuration section that is a <literal>System.Configuration.NameValueSectionHandler</literal> named <literal>nhibernate</literal>. </para> </listitem> <listitem> <para> Include <literal><property></literal> elements in <literal>hibernate.cfg.xml</literal> (discussed later). </para> </listitem> </orderedlist> <para> If you take this approach, opening an <literal>ISession</literal> is as simple as: </para> <programlisting><![CDATA[ISession session = sessions.OpenSession(); // open a new Session // do some data access work, an ADO connection will be used on demand]]></programlisting> <para> All NHibernate property names and semantics are defined on the class <literal>NHibernate.Cfg.Environment</literal>. We will now describe the most important settings for ADO connection configuration. </para> <para> NHibernate will obtain connections using the ADO.NET Data Provider if you set the following properties: </para> <table frame="topbot"> <title>NHibernate ADO.NET Properties</title> <tgroup cols="2"> <colspec colname="c1" colwidth="1*"/> <colspec colname="c2" colwidth="1*"/> <thead> <row> <entry>Property name</entry> <entry>Purpose</entry> </row> </thead> <tbody> <row> <entry> <literal>hibernate.connection.driver_class</literal> </entry> <entry> Implementation of <literal>NHibernate.Driver.IDriver</literal> interface that NHibernate will use to get the implementation of IDbConnection , IDbCommand, and IDbDataParameter. </entry> </row> <row> <entry> <literal>hibernate.connection.connection_string</literal> </entry> <entry> Connection string to use to obtain the connection. </entry> </row> </tbody> </tgroup> </table> <para> This is an example of how to specify the database connection properties inside a <literal>web.config</literal>: </para> <programlisting id="we-config-configuration" revision="1"><![CDATA[<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> </configSections> <nhibernate> <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" /> <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" /> <add key="hibernate.connection.connection_string" value="Server=127.0.0.1;Initial Catalog=thedatabase;Integrated Security=SSPI" /> <add key="hibernate.connection.isolation" value="ReadCommitted" /> <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" /> </nhibernate> <!-- log4net and other app specific config follows --> </configuration> ]]></programlisting> <para> You may define your own plugin strategy for obtaining ADO.NET connections by implementing the interface <literal>NHibernate.Connection.IConnectionProvider</literal>. You may select a custom implementation by setting <literal>hibernate.connection.provider_class</literal>. </para> </sect1> <sect1 id="configuration-optional"> <title>Optional configuration properties</title> <para> There are a number of other properties that control the behavior of NHibernate at runtime. All are optional and have reasonable default values. </para> <table frame="topbot" id="configuration-optional-properties" revision="3"> <title>NHibernate Configuration Properties</title> <tgroup cols="2"> <colspec colname="c1" colwidth="1*"/> <colspec colname="c2" colwidth="1*"/> <thead> <row> <entry>Property name</entry> <entry>Purpose</entry> </row> </thead> <tbody> <row> <entry> <literal>hibernate.dialect</literal> </entry> <entry> The classname of a NHibernate <literal>Dialect</literal> - enables certain platform dependent features. <para> <emphasis role="strong">eg.</emphasis> <literal>full.classname.of.Dialect</literal> </para> </entry> </row> <row> <entry> <literal>hibernate.default_schema</literal> </entry> <entry> Qualify unqualified tablenames with the given schema/tablespace in generated SQL. <para> <emphasis role="strong">eg.</emphasis> <literal>SCHEMA_NAME</literal> </para> </entry> </row> <row> <entry> <literal>hibernate.session_factory_name</literal> </entry> <entry> The <literal>SessionFactory</literal> will be automatically bound to this name after it has been created. <para> <emphasis role="strong">eg.</emphasis> <literal>some.name</literal> </para> </entry> </row> <row> <entry> <literal>hibernate.use_outer_join</literal> </entry> <entry> Enables outer join fetching. <para> <emphasis role="strong">eg.</emphasis> <literal>true</literal> | <literal>false</literal> </para> </entry> </row> <row> <entry> <literal>hibernate.connection.isolation</literal> </entry> <entry> Set the ADO.NET transaction isolation level. Check <literal>System.Data.IsolationLevel</literal> for meaningful values but note that most databases do not support all isolation levels. <para> <emphasis role="strong">eg.</emphasis> <literal>Chaos, ReadCommitted, ReadUncommitted, RepeatableRead, Serializable, Unspecified </literal> </para> </entry> </row> <row> <entry> <literal>hibernate.connection.provider_class</literal> </entry> <entry> The type of a custom <literal>ConnectionProvider</literal>. <para> <emphasis role="strong">eg.</emphasis> <literal>typename.of.ConnectionProvider</literal> </para> </entry> </row> <row> <entry> <literal>hibernate.cache.provider_class</literal> </entry> <entry> The classname of a custom <literal>CacheProvider</literal>. <para> <emphasis role="strong">eg.</emphasis> <literal>typename.of.CacheProvider</literal> </para> </entry> </row> <row> <entry> <literal>hibernate.query.substitutions</literal> </entry> <entry> Mapping from tokens in NHibernate queries to SQL tokens (tokens might be function or literal names, for example). <para> <emphasis role="strong">eg.</emphasis> <literal>hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC</literal> </para> </entry> </row> <!--<row> <entry> <literal>hibernate.show_sql</literal> </entry> <entry> Write all SQL statements to console. <para> <emphasis role="strong">eg.</emphasis> <literal>true</literal> | <literal>false</literal> </para> </entry> </row>--> </tbody> </tgroup> </table> <!-- resume at <sect2 id="configuration-optional-dialects"> --> </sect1> </chapter> |
From: Michael D. <mik...@us...> - 2004-12-20 00:36:03
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv575 Modified Files: master.xml Log Message: some work on docs. Index: master.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/master.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** master.xml 25 Oct 2004 05:20:25 -0000 1.2 --- master.xml 20 Dec 2004 00:35:53 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- "../support/docbook-dtd/docbookx.dtd" [ <!ENTITY architecture SYSTEM "modules/architecture.xml"> + <!ENTITY configuration SYSTEM "modules/configuration.xml"> <!ENTITY basic-mapping SYSTEM "modules/basic_mapping.xml"> *************** *** 62,66 **** </para> </listitem> ! <listitem> <para> Have a look at the <literal>eg/</literal> directory in the Hibernate --- 63,67 ---- </para> </listitem> ! <!--<listitem> <para> Have a look at the <literal>eg/</literal> directory in the Hibernate *************** *** 72,76 **** <literal>build eg</literal>. </para> ! </listitem> <listitem> <para> --- 73,77 ---- <literal>build eg</literal>. </para> ! </listitem>--> <listitem> <para> *************** *** 92,95 **** --- 93,97 ---- &architecture; + &configuration; &basic-mapping; <index id="index"/> |
From: Michael D. <mik...@us...> - 2004-12-19 00:06:25
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1599 Added Files: readme.txt Log Message: added a small readme about how to setup machine to do doc builds. --- NEW FILE: readme.txt --- Required DLLs and EXEs ======================================= Download the files at ftp://ftp.zlatkovic.com/pub/libxml/ Create the folders: C:\Program Files\docbook C:\Program Files\docbook\tools Add these files to the "tools" folder: iconv.dll - from iconv-1.9.1.win32.zip libexslt.dll - from libxslt-1.1.12.win32 libxml2.dll - from libxml2-2.6.15.win32 libxslt.dll - from libxslt-1.1.12.win32 xmlcatalog.exe - from libxml2-2.6.15.win32 xmllint.exe - from libxml2-2.6.15.win32 xsltproc.exe - from libxslt-1.1.12.win32 zlib1.dll - from zlib-1.2.1.win32 Add the "tools" folder to your Path so the build files can build the docs. Docbook Manual ======================================= Can be downloaded at http://docbook.org/tdg/en/tdg-en-html-2.0.10.zip Can be viewed at http://www.oasis-open.org/docbook/documentation/reference/html/docbook.html Docbook Xsl Guide ======================================= Can be viewed at http://www.sagehill.net/docbookxsl/index.html |
From: Michael D. <mik...@us...> - 2004-12-16 21:57:49
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18557/NHibernate.DomainModel Modified Files: ABC.hbm.xml ABCProxy.hbm.xml Container.hbm.xml FooBar.hbm.xml Glarch.hbm.xml Qux.hbm.xml WZ.hbm.xml Log Message: proxy attribute has been added to classes that had them in hibernate test suite. Index: Container.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Container.hbm.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Container.hbm.xml 11 Jul 2004 21:07:24 -0000 1.8 --- Container.hbm.xml 16 Dec 2004 21:57:39 -0000 1.9 *************** *** 14,22 **** <class name="NHibernate.DomainModel.Container, NHibernate.DomainModel" > - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.Container, NHibernate.DomainModel" - --> <id name="Id" --- 14,19 ---- <class name="NHibernate.DomainModel.Container, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.Container, NHibernate.DomainModel" > <id name="Id" *************** *** 161,169 **** <class name="NHibernate.DomainModel.Contained, NHibernate.DomainModel" > - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.Contained, NHibernate.DomainModel" - --> <id name="Id" --- 158,163 ---- <class name="NHibernate.DomainModel.Contained, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.Contained, NHibernate.DomainModel" > <id name="Id" Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** FooBar.hbm.xml 20 Nov 2004 15:20:10 -0000 1.19 --- FooBar.hbm.xml 16 Dec 2004 21:57:39 -0000 1.20 *************** *** 7,10 **** --- 7,11 ---- <class name="NHibernate.DomainModel.Foo, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" table="`foos`" discriminator-value="F" *************** *** 12,20 **** dynamic-insert="true" > - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" - --> - <jcs-cache usage="nonstrict-read-write"/> --- 13,16 ---- *************** *** 158,175 **** <subclass name="NHibernate.DomainModel.Trivial, NHibernate.DomainModel" discriminator-value="T" /> - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" - --> <subclass name="NHibernate.DomainModel.Abstract, NHibernate.DomainModel" discriminator-value="null" > - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.AbstractProxy, NHibernate.DomainModel" - --> <set name="Abstracts"> <key column="abstract_id"/> --- 154,165 ---- <subclass name="NHibernate.DomainModel.Trivial, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" discriminator-value="T" /> <subclass name="NHibernate.DomainModel.Abstract, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.AbstractProxy, NHibernate.DomainModel" discriminator-value="null" > <set name="Abstracts"> <key column="abstract_id"/> *************** *** 179,188 **** <subclass name="NHibernate.DomainModel.Bar, NHibernate.DomainModel" discriminator-value="B" > - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.BarProxy, NHibernate.DomainModel" - --> <many-to-one name="Baz"/> <property name="BarString"> --- 169,175 ---- <subclass name="NHibernate.DomainModel.Bar, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.BarProxy, NHibernate.DomainModel" discriminator-value="B" > <many-to-one name="Baz"/> <property name="BarString"> Index: WZ.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/WZ.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WZ.hbm.xml 11 Jul 2004 21:07:24 -0000 1.2 --- WZ.hbm.xml 16 Dec 2004 21:57:39 -0000 1.3 *************** *** 21,31 **** <class name="NHibernate.DomainModel.W, NHibernate.DomainModel" discriminator-value="0" > - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.Z, NHibernate.DomainModel" - --> - <id name="Id" unsaved-value="0"> <generator class="hilo"/> --- 21,27 ---- <class name="NHibernate.DomainModel.W, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.Z, NHibernate.DomainModel" discriminator-value="0" > <id name="Id" unsaved-value="0"> <generator class="hilo"/> Index: ABC.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ABC.hbm.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ABC.hbm.xml 27 Aug 2004 13:29:57 -0000 1.8 --- ABC.hbm.xml 16 Dec 2004 21:57:39 -0000 1.9 *************** *** 57,67 **** </class> <class ! name="NHibernate.DomainModel.D, NHibernate.DomainModel" discriminator-value="0" > - <!-- - proxy does not work yet - proxy="NHibernate.DomainModel.D, NHibernate.DomainModel" - --> <id name="Id" --- 57,64 ---- </class> <class ! name="NHibernate.DomainModel.D, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.D, NHibernate.DomainModel" discriminator-value="0" > <id name="Id" Index: Qux.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Qux.hbm.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Qux.hbm.xml 9 Aug 2004 18:26:22 -0000 1.7 --- Qux.hbm.xml 16 Dec 2004 21:57:39 -0000 1.8 *************** *** 2,13 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class ! name="NHibernate.DomainModel.Qux, NHibernate.DomainModel" table="quux" > - <!-- - proxy doesn't work yet - once proxy is working remove the - [Serializable] attribute from the class. - proxy="NHibernate.DomainModel.Qux, NHibernate.DomainModel" - --> <id name="Key" column="qux_key" unsaved-value="0"> <generator class="hilo" /> --- 2,9 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class ! name="NHibernate.DomainModel.Qux, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.Qux, NHibernate.DomainModel" table="quux" > <id name="Key" column="qux_key" unsaved-value="0"> <generator class="hilo" /> Index: ABCProxy.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ABCProxy.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ABCProxy.hbm.xml 11 Jul 2004 21:07:24 -0000 1.6 --- ABCProxy.hbm.xml 16 Dec 2004 21:57:39 -0000 1.7 *************** *** 1,9 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.A, NHibernate.DomainModel" discriminator-value="0"> ! <!-- ! proxy doesn't work yet ! proxy="NHibernate.DomainModel.A, NHibernate.DomainModel" ! --> <id name="Id" unsaved-value="0" type="Int64"> <generator class="native" /> --- 1,9 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.A, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.A, NHibernate.DomainModel" ! discriminator-value="0" ! > <id name="Id" unsaved-value="0" type="Int64"> <generator class="native" /> *************** *** 11,19 **** <discriminator column="clazz" type="Int32" force="true" not-null="false" /> <property name="Name" /> ! <subclass name="NHibernate.DomainModel.B, NHibernate.DomainModel" discriminator-value="null"> ! <!-- ! proxy doesn't work yet proxy="NHibernate.DomainModel.B, NHibernate.DomainModel" ! --> <property name="Count" column="count_" type="Int32" /> <map name="Map"> --- 11,19 ---- <discriminator column="clazz" type="Int32" force="true" not-null="false" /> <property name="Name" /> ! <subclass ! name="NHibernate.DomainModel.B, NHibernate.DomainModel" proxy="NHibernate.DomainModel.B, NHibernate.DomainModel" ! discriminator-value="null" ! > <property name="Count" column="count_" type="Int32" /> <map name="Map"> *************** *** 22,44 **** <element column="MAPVAL" type="Int32" /> </map> ! <subclass name="NHibernate.DomainModel.C1, NHibernate.DomainModel" discriminator-value="1" ! proxy="NHibernate.DomainModel.C1, NHibernate.DomainModel"> <property name="Address" column="c1" /> <one-to-one name="D" class="NHibernate.DomainModel.D, NHibernate.DomainModel" /> </subclass> ! <subclass name="NHibernate.DomainModel.C2, NHibernate.DomainModel" discriminator-value="2"> ! <!-- ! proxy doesn't work yet ! proxy="NHibernate.DomainModel.C2, NHibernate.DomainModel" ! --> <property name="Address" column="c2" /> </subclass> </subclass> </class> ! <class name="NHibernate.DomainModel.D, NHibernate.DomainModel" discriminator-value="0" > ! <!-- ! proxy doesn't work yet ! proxy="NHibernate.DomainModel.D, NHibernate.DomainModel" ! --> <id name="Id" unsaved-value="0" type="Int64"> <generator class="assigned" /> --- 22,47 ---- <element column="MAPVAL" type="Int32" /> </map> ! <subclass ! name="NHibernate.DomainModel.C1, NHibernate.DomainModel" ! discriminator-value="1" ! proxy="NHibernate.DomainModel.C1, NHibernate.DomainModel" ! > <property name="Address" column="c1" /> <one-to-one name="D" class="NHibernate.DomainModel.D, NHibernate.DomainModel" /> </subclass> ! <subclass ! name="NHibernate.DomainModel.C2, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.C2, NHibernate.DomainModel" ! discriminator-value="2" ! > <property name="Address" column="c2" /> </subclass> </subclass> </class> ! <class ! name="NHibernate.DomainModel.D, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.D, NHibernate.DomainModel" ! discriminator-value="0" ! > <id name="Id" unsaved-value="0" type="Int64"> <generator class="assigned" /> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.hbm.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Glarch.hbm.xml 31 Aug 2004 21:22:58 -0000 1.9 --- Glarch.hbm.xml 16 Dec 2004 21:57:39 -0000 1.10 *************** *** 3,14 **** <class name="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" table="`glarchez`" dynamic-update="true" > - <!-- - proxy doesn't work yet - proxy="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel" - --> - <!-- <jcs-cache usage="read-write" /> --> <!-- commented out in h2.0.3 also --> --- 3,10 ---- <class name="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel" table="`glarchez`" dynamic-update="true" > <!-- <jcs-cache usage="read-write" /> --> <!-- commented out in h2.0.3 also --> |
From: Michael D. <mik...@us...> - 2004-12-16 21:57:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18557/NHibernate.DomainModel/NHSpecific Modified Files: BasicObject.hbm.xml Log Message: proxy attribute has been added to classes that had them in hibernate test suite. Index: BasicObject.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicObject.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicObject.hbm.xml 31 Aug 2004 21:22:58 -0000 1.2 --- BasicObject.hbm.xml 16 Dec 2004 21:57:39 -0000 1.3 *************** *** 35,45 **** <class name="NHibernate.DomainModel.NHSpecific.BasicObjectProxy, NHibernate.DomainModel" table="bc_ref_p" > - <!-- - uncomment once proxies are working - proxy="NHibernate.DomainModel.NHSpecific.IBasicObjectProxy, NHibernate.DomainModel" - --> <id name="Id"> <generator class="native" /> --- 35,42 ---- <class name="NHibernate.DomainModel.NHSpecific.BasicObjectProxy, NHibernate.DomainModel" + proxy="NHibernate.DomainModel.NHSpecific.IBasicObjectProxy, NHibernate.DomainModel" table="bc_ref_p" > <id name="Id"> <generator class="native" /> |
From: Michael D. <mik...@us...> - 2004-12-16 21:56:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18075/NHibernate.Test Modified Files: ABCProxyTest.cs FooBarTest.cs NHibernate.Test-1.1.csproj Log Message: Removed some ignore attributes. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** FooBarTest.cs 9 Dec 2004 20:57:26 -0000 1.75 --- FooBarTest.cs 16 Dec 2004 21:56:06 -0000 1.76 *************** *** 348,352 **** [Test] - [Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void ForceOuterJoin() { --- 348,351 ---- *************** *** 551,555 **** [Test] - [Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void NamedParams() { --- 550,553 ---- *************** *** 1351,1356 **** } - //TODO: once proxies is implemented get rid of the try-catch and notFound - bool notFound = false; try { --- 1349,1352 ---- *************** *** 1359,1370 **** catch(ObjectNotFoundException onfe) { - notFound = true; Assert.IsNotNull(onfe, "should not find a Qux with id of 666 when Proxies are not implemented."); } - Assert.IsTrue( - notFound, - "without proxies working - an ObjectNotFoundException should have been thrown. " + - "If Proxies are implemented then you need to change this code" - ); Assert.AreEqual( 1, s.Delete("from g in class Glarch") ); --- 1355,1360 ---- *************** *** 1379,1400 **** stream.Close(); ! //TODO: once proxies is implemented get rid of the try-catch and notFound ! notFound = false; ! try ! { ! s.Load( typeof(Qux), (long)666 ) ; //nonexistent ! } ! catch(HibernateException he) ! { ! notFound = true; ! Assert.IsNotNull( he, "should have a session disconnected error when finding a Qux with id of 666 and Proxies are not implemented."); ! } ! Assert.IsTrue( ! notFound, ! "without proxies working - an ADOException/HibernateException should have been thrown. " + ! "If Proxies are implemented then you need to change this code because the ISession does " + ! "not need to be connected to the db when building a Proxy." ! ); ! s.Close(); } --- 1369,1375 ---- stream.Close(); ! Qux nonexistentQux = (Qux)s.Load( typeof(Qux), (long)666 ) ; //nonexistent ! Assert.IsNotNull( nonexistentQux, "even though it doesn't exists should still get a proxy - no db hit." ); ! s.Close(); } *************** *** 1552,1556 **** [Test] - [Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void Load() { --- 1527,1530 ---- *************** *** 2082,2085 **** --- 2056,2062 ---- ISession sOld = sessions.OpenSession(); 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(); *************** *** 2920,2924 **** [Test] - [Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void ProxyArray() { --- 2897,2900 ---- *************** *** 3254,3258 **** [Test] - [Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void LoadAfterDelete() { --- 3230,3233 ---- *************** *** 3517,3521 **** [Test] - [Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void ProxiesInCollections() { --- 3492,3495 ---- Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ABCProxyTest.cs 6 Aug 2004 14:50:34 -0000 1.9 --- ABCProxyTest.cs 16 Dec 2004 21:56:05 -0000 1.10 *************** *** 19,23 **** [Test] ! [Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void Subclassing() { --- 19,23 ---- [Test] ! //[Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void Subclassing() { Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** NHibernate.Test-1.1.csproj 16 Dec 2004 04:55:42 -0000 1.55 --- NHibernate.Test-1.1.csproj 16 Dec 2004 21:56:06 -0000 1.56 *************** *** 519,522 **** --- 519,541 ---- /> <File + RelPath = "ProxyInterface\CastleProxy.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ProxyInterface\CastleProxyFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ProxyInterface\CastleProxyImpl.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ProxyInterface\CastleProxyImpl.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "SqlCommandTest\SqlDeleteBuilderFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-12-16 21:55:36
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17925/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: Minor mods for proxies. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** SessionImpl.cs 9 Dec 2004 22:08:54 -0000 1.56 --- SessionImpl.cs 16 Dec 2004 21:55:24 -0000 1.57 *************** *** 1682,1686 **** public object ProxyFor(IClassPersister persister, Key key, object impl) { ! if ( !persister.HasProxy ) return impl; object proxy = proxiesByKey[key]; if (proxy!=null) --- 1682,1690 ---- public object ProxyFor(IClassPersister persister, Key key, object impl) { ! if ( !persister.HasProxy || key==null ) ! { ! return impl; ! } ! object proxy = proxiesByKey[key]; if (proxy!=null) |
From: Michael D. <mik...@us...> - 2004-12-16 21:55:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17925/NHibernate/Engine Modified Files: Key.cs Log Message: Minor mods for proxies. Index: Key.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Key.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Key.cs 27 Nov 2004 01:03:39 -0000 1.6 --- Key.cs 16 Dec 2004 21:55:23 -0000 1.7 *************** *** 1,5 **** using System; - using NHibernate.Collection; using NHibernate.Persister; --- 1,4 ---- |
From: Michael D. <mik...@us...> - 2004-12-16 21:53:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17209/NHibernate Modified Files: NHibernate-1.1.csproj NHibernate.build Log Message: Added Castle.DynamicProxy to csproj and build file. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** NHibernate-1.1.csproj 11 Dec 2004 20:08:12 -0000 1.65 --- NHibernate-1.1.csproj 16 Dec 2004 21:52:56 -0000 1.66 *************** *** 95,98 **** --- 95,103 ---- HintPath = "..\..\lib\net\1.1\Iesi.Collections.dll" /> + <Reference + Name = "Castle.DynamicProxy" + AssemblyName = "Castle.DynamicProxy" + HintPath = "..\..\lib\net\1.1\Castle.DynamicProxy.dll" + /> </References> </Build> *************** *** 1385,1388 **** --- 1390,1408 ---- /> <File + RelPath = "Proxy\CastleCustomProxyGenerator.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Proxy\CastleLazyInitializer.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Proxy\CastleProxyGenerator.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Proxy\INHibernateProxy.cs" SubType = "Code" Index: NHibernate.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.build,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NHibernate.build 8 Dec 2004 15:30:54 -0000 1.7 --- NHibernate.build 16 Dec 2004 21:52:56 -0000 1.8 *************** *** 91,94 **** --- 91,95 ---- <includes name="log4net.dll" /> <includes name="HashCodeProvider.dll" /> + <includes name="Castle.DynamicProxy.dll" /> </references> |
From: Michael D. <mik...@us...> - 2004-12-16 21:51:57
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16936/NHibernate/Proxy Modified Files: INHibernateProxy.cs LazyInitializer.cs NHibernateProxyHelper.cs ProxyGeneratorFactory.cs Added Files: CastleCustomProxyGenerator.cs CastleLazyInitializer.cs CastleProxyGenerator.cs Log Message: Implementation and Test of proxies using Castle.DynamicProxy. Index: NHibernateProxyHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Proxy/NHibernateProxyHelper.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NHibernateProxyHelper.cs 9 Dec 2004 17:52:16 -0000 1.2 --- NHibernateProxyHelper.cs 16 Dec 2004 21:51:48 -0000 1.3 *************** *** 16,23 **** /// <summary> ! /// Gets the NLazyInitializer that is used by the Proxy. /// </summary> /// <param name="proxy">The Proxy object</param> ! /// <returns>A reference to NLazyInitializer that contains the details of the Proxied object.</returns> public static LazyInitializer GetLazyInitializer(INHibernateProxy proxy) { --- 16,26 ---- /// <summary> ! /// Gets the <see cref="LazyInitializer"/> that is used by the Proxy. /// </summary> /// <param name="proxy">The Proxy object</param> ! /// <returns> ! /// A reference to <see cref="LazyInitializer"/> that contains the details ! /// of the Proxied object. ! /// </returns> public static LazyInitializer GetLazyInitializer(INHibernateProxy proxy) { --- NEW FILE: CastleProxyGenerator.cs --- using System; using System.Collections; using System.Reflection; using System.Reflection.Emit; using Castle.DynamicProxy; using Castle.DynamicProxy.Builder; using Castle.DynamicProxy.Builder.CodeGenerators; using NHibernate.Engine; namespace NHibernate.Proxy { /// <summary> /// An <see cref="IProxyGenerator"/> that uses the Castle.DynamicProxy library. /// </summary> public class CastleProxyGenerator : IProxyGenerator { private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(CastleProxyGenerator) ); // key = mapped type // value = proxy type private IDictionary cachedProxyTypes; private GeneratorContext _context; private ModuleScope _scope; /// <summary> /// Initializes a new instance of the <see cref="CastleProxyGenerator"/> class. /// </summary> internal CastleProxyGenerator() { cachedProxyTypes = new Hashtable(); _scope = new ModuleScope(); // the EnhanceTypeDelegate will add custom code gen that DynamicProxy does not provide // by default. _context = new GeneratorContext( );// new EnhanceTypeDelegate( EnhanceInterfaceType ), null ); } #region IProxyGenerator Methods /// <summary> /// Build a proxy using the Castle.DynamicProxy library. /// </summary> /// <param name="persistentClass">.</param> /// <param name="interfaces">The extra interfaces the Proxy should implement.</param> /// <param name="identifierPropertyInfo">The PropertyInfo to get/set the Id.</param> /// <param name="id">The value for the Id.</param> /// <param name="session">The Session the proxy is in.</param> /// <returns>A fully built <c>INHibernateProxy</c>.</returns> public INHibernateProxy GetProxy(System.Type persistentClass, System.Type concreteProxy, System.Type[] interfaces, PropertyInfo identifierPropertyInfo, object id, ISessionImplementor session) { object generatedProxy = null; try { CastleLazyInitializer initializer = new CastleLazyInitializer( persistentClass, concreteProxy, interfaces, id, identifierPropertyInfo, session ); System.Type proxyType = null; // if I try to generate a proxy twice for the same type the Castle library will do the same // in one ModuleBuilder. The ModuleBuilder throws an exception (not suprisingly) when you try // to define the same type twice in it. So nh needs to keep a cache of the proxy types that have // already been generated. lock( cachedProxyTypes.SyncRoot ) { proxyType = cachedProxyTypes[ concreteProxy ] as System.Type; // if the pc is an interface then we need to add the interface to the // interfaces array that was passed in because it only includes the extra // interfaces for that persistent class. if( concreteProxy.IsInterface ) { if( proxyType==null ) { //TODO: figure out if this is necessary because the concreteProxy is // already included in the interfaces array... System.Type[] temp = new System.Type[ interfaces.Length + 1 ]; interfaces.CopyTo( temp, 0 ); temp[ interfaces.Length ] = concreteProxy; //persistentClass; interfaces = temp; InterfaceProxyGenerator _interfaceGenerator = new InterfaceProxyGenerator( _scope, _context ); proxyType = _interfaceGenerator.GenerateCode( interfaces ); cachedProxyTypes[ concreteProxy ] = proxyType; } // don't understand why a Interface proxy requires 2 arg constructor and a Class Interface // proxy only requires 1 - TODO: email Hammett about this. // hack with new object() because an interface proxy is expecting an actual target instance - we // don't have that yet and don't want to create it until it is actually needed. generatedProxy = Activator.CreateInstance( proxyType, new object[] { initializer, new object() } ); } else { if( proxyType==null ) { CastleCustomProxyGenerator _classGenerator = new CastleCustomProxyGenerator( _scope, _context ); proxyType = _classGenerator.GenerateCode( concreteProxy ); cachedProxyTypes[ concreteProxy ] = proxyType; } generatedProxy = Activator.CreateInstance( proxyType, new object[] { initializer } ); } } return (INHibernateProxy)generatedProxy; } catch(Exception e) { log.Error("Castle Dynamic Class Generator failed", e); throw new HibernateException( "Castle Dynamic Class Generator failed", e); } } /// <summary> /// Gets the <see cref="LazyInitializer"/> that is used by the Proxy. /// </summary> /// <param name="proxy">The Proxy object</param> /// <returns>The <see cref="LazyInitializer"/> that contains the details of the Proxied object.</returns> public LazyInitializer GetLazyInitializer(INHibernateProxy proxy) { // have to hard code in "__interceptor" - very dependant on them not changing their // implementation - TODO: email Hammet about this - or atleast to provide a static // field object fieldValue = proxy.GetType().GetField( "__interceptor" ).GetValue( proxy ); return (LazyInitializer)fieldValue; } /// <summary> /// Convenience method to figure out the underlying type for the object regardless of it /// is a Proxied object or the real object. /// </summary> /// <param name="obj">The object to get the type of.</param> /// <returns>The Underlying Type for the object regardless of if it is a Proxy.</returns> public System.Type GetClass(object obj) { if (obj is INHibernateProxy) { INHibernateProxy proxy = (INHibernateProxy) obj; LazyInitializer li = GetLazyInitializer( proxy ); return li.PersistentClass; } else { return obj.GetType(); } } #endregion } } Index: INHibernateProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Proxy/INHibernateProxy.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** INHibernateProxy.cs 9 Dec 2004 17:52:16 -0000 1.2 --- INHibernateProxy.cs 16 Dec 2004 21:51:48 -0000 1.3 *************** *** 1,4 **** using System; - using System.Runtime.Serialization; namespace NHibernate.Proxy --- 1,3 ---- *************** *** 9,15 **** /// </summary> /// <remarks> /// This interface should not be implemented by anything other than ! /// the Dynamically generated Proxy. It has to be public scope because /// the Proxies are created in a seperate DLL than NHibernate. /// </remarks> public interface INHibernateProxy --- 8,20 ---- /// </summary> /// <remarks> + /// <para> /// This interface should not be implemented by anything other than ! /// the Dynamically generated Proxy. If it is implemented by a class then ! /// NHibernate will think that class is a Proxy and will not work. ! /// </para> ! /// <para> ! /// It has to be public scope because /// the Proxies are created in a seperate DLL than NHibernate. + /// </para> /// </remarks> public interface INHibernateProxy --- NEW FILE: CastleCustomProxyGenerator.cs --- using System; using Castle.DynamicProxy; using Castle.DynamicProxy.Builder.CodeBuilder; using Castle.DynamicProxy.Builder.CodeGenerators; namespace NHibernate.Proxy { /// <summary> /// This will build a proxy for a <see cref="System.Type"/> that is /// a <c>Class</c> and then add the <see cref="INHibernateProxy"/> /// interface to it. /// </summary> [CLSCompliant(false)] public class CastleCustomProxyGenerator : ClassProxyGenerator { public CastleCustomProxyGenerator(ModuleScope scope) : base(scope) { } public CastleCustomProxyGenerator(ModuleScope scope, GeneratorContext context) : base(scope, context) { } /// <summary> /// Override of the <see cref="BaseCodeGenerator.CreateTypeBuilder(System.Type, System.Type[])"/> implementation. /// </summary> /// <param name="baseType">The base <see cref="System.Type"/> for the Proxy.</param> /// <param name="interfaces">The extra <see cref="System.Type"/> interfaces for the Proxy to implement.</param> /// <returns>An <see cref="EasyType"/> with the required interfaces added.</returns> protected override EasyType CreateTypeBuilder(System.Type baseType, System.Type[] interfaces) { bool isImplemented = false; // check to see if this implements INHibernateProxy - if not then make it // implement the interface for( int i=0; i<interfaces.Length; i++) { if( interfaces[i].Equals( typeof(INHibernateProxy) ) ) { isImplemented = true; } } if( isImplemented==false ) { int length = interfaces.Length; System.Type[] newInterfaces = new System.Type[ length + 1 ]; Array.Copy( interfaces, 0, newInterfaces, 0, length ); newInterfaces[ length ] = typeof(INHibernateProxy); interfaces = newInterfaces; } return base.CreateTypeBuilder(baseType, interfaces); } } } Index: LazyInitializer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Proxy/LazyInitializer.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LazyInitializer.cs 9 Dec 2004 17:52:16 -0000 1.3 --- LazyInitializer.cs 16 Dec 2004 21:51:48 -0000 1.4 *************** *** 106,109 **** --- 106,113 ---- /// </summary> /// <param name="info">The <see cref="SerializationInfo"/> to write the object to.</param> + /// <remarks> + /// This will only be called if the Dynamic Proxy generator does not handle serialization + /// itself or delegates calls to the method GetObjectData to the LazyInitializer. + /// </remarks> protected virtual void AddSerializationInfo(SerializationInfo info) { *************** *** 170,174 **** /// without the underlying proxied object being instantiated. /// </summary> ! /// <param name="methodName">The name of the method/property to Invoke.</param> /// <param name="args">The arguments to pass the method/property.</param> /// <returns> --- 174,178 ---- /// without the underlying proxied object being instantiated. /// </summary> ! /// <param name="method">The name of the method/property to Invoke.</param> /// <param name="args">The arguments to pass the method/property.</param> /// <returns> *************** *** 179,186 **** public virtual object Invoke(MethodBase method, params object[] args) { ! // all Proxies must implement INHibernateProxy which extends ISerializable ! // not true anymore - DynamicProxy now handles the serialization. All Proxy ! // Generators should make sure that ISerializable is implemented if their ! // Proxy doesn't do it by default. if( method.Name.Equals("GetObjectData") ) { --- 183,189 ---- public virtual object Invoke(MethodBase method, params object[] args) { ! // if the Proxy Engine delegates the call of GetObjectData to the Initializer ! // then we need to handle it. Castle.DynamicProxy takes care of serializing ! // proxies for us, but other providers might not. if( method.Name.Equals("GetObjectData") ) { Index: ProxyGeneratorFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Proxy/ProxyGeneratorFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProxyGeneratorFactory.cs 9 Dec 2004 17:52:16 -0000 1.2 --- ProxyGeneratorFactory.cs 16 Dec 2004 21:51:48 -0000 1.3 *************** *** 1,9 **** using System; - using System.Reflection; - - //TODO: build a version - //using Castle.DynamicProxy; - - using NHibernate.Engine; namespace NHibernate.Proxy --- 1,3 ---- *************** *** 16,21 **** private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(ProxyGeneratorFactory) ); ! //TODO: build a version ! private static IProxyGenerator _generator = null;// new CastleProxyGenerator(); public static IProxyGenerator GetProxyGenerator() --- 10,14 ---- private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(ProxyGeneratorFactory) ); ! private static IProxyGenerator _generator = new CastleProxyGenerator(); public static IProxyGenerator GetProxyGenerator() --- NEW FILE: CastleLazyInitializer.cs --- using System; using System.Reflection; using Castle.DynamicProxy; using NHibernate.Engine; namespace NHibernate.Proxy { /// <summary> /// A <see cref="LazyInitializer"/> for use with the Castle Dynamic Class Generator. /// </summary> [Serializable] [CLSCompliant(false)] public class CastleLazyInitializer : LazyInitializer, Castle.DynamicProxy.IInterceptor//, ISerializable { private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(CastleLazyInitializer) ); private System.Type _concreteProxy; private System.Type[] _interfaces; /// <summary> /// Initializes a new <see cref="CastleLazyInitializer"/> object. /// </summary> /// <param name="persistentClass">The Class to Proxy.</param> /// <param name="concreteProxy">The <see cref="System.Type"/> to use as the Proxy.</param> /// <param name="interfaces">An array of <see cref="System.Type"/> interfaces that the Proxy should implement.</param> /// <param name="id">The Id of the Object we are Proxying.</param> /// <param name="identifierPropertyInfo">The PropertyInfo for the <id> property.</param> /// <param name="session">The ISession this Proxy is in.</param> internal CastleLazyInitializer(System.Type persistentClass, System.Type concreteProxy, System.Type[] interfaces, object id, PropertyInfo identifierPropertyInfo, ISessionImplementor session) : base (persistentClass, id, identifierPropertyInfo, session) { _concreteProxy = concreteProxy; _interfaces = interfaces; } #region Castle.DynamicProxy.IInterceptor Members /// <summary> /// Invoke the actual Property/Method using the Proxy or instantiate the actual /// object and use it when the Proxy can't handle the method. /// </summary> /// <param name="invocation">The <see cref="IInvocation"/> from the generated Castle.DynamicProxy.</param> /// <param name="args">The parameters for the Method/Property</param> /// <returns>The result just like the actual object was called.</returns> public object Intercept(IInvocation invocation, params object[] args) { // let the generic LazyInitializer figure out if this can be handled // with the proxy or if the real class needs to be initialized object result = base.Invoke( invocation.Method, args); // the base LazyInitializer could not handle it so we need to Invoke // the method/property against the real class if( result==InvokeImplementation ) { invocation.InvocationTarget = GetImplementation(); return invocation.Proceed( args ); } else { return result; } } #endregion } } |
From: Michael D. <mik...@us...> - 2004-12-16 21:51:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyInterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16936/NHibernate.Test/ProxyInterface Added Files: CastleProxy.cs CastleProxyFixture.cs CastleProxyImpl.cs CastleProxyImpl.hbm.xml Log Message: Implementation and Test of proxies using Castle.DynamicProxy. --- NEW FILE: CastleProxyFixture.cs --- using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using NUnit.Framework; namespace NHibernate.Test.ProxyInterface { /// <summary> /// Summary description for CastleProxyFixture. /// </summary> [TestFixture] public class CastleProxyFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "ProxyInterface.CastleProxyImpl.hbm.xml"}, true, "NHibernate.Test" ); } [Test] public void Proxy() { ISession s = sessions.OpenSession(); CastleProxy ap = new CastleProxyImpl(); ap.Id = 1; ap.Name = "first proxy"; s.Save( ap ); s.Flush(); s.Close(); 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(); s.Close(); } [Test] public void ProxySerialize() { ISession s = sessions.OpenSession(); CastleProxy ap = new CastleProxyImpl(); ap.Id = 1; ap.Name = "first proxy"; s.Save( ap ); s.Flush(); s.Close(); s = sessions.OpenSession(); ap = (CastleProxy)s.Load( typeof(CastleProxyImpl), ap.Id ); Assert.AreEqual( 1, ap.Id ); s.Disconnect(); // serialize and then deserialize the session. Stream stream = new MemoryStream(); IFormatter formatter = new BinaryFormatter( ); formatter.Serialize(stream, s); stream.Position = 0; s = (ISession)formatter.Deserialize(stream); stream.Close(); s.Reconnect(); s.Disconnect(); // serialize and then deserialize the session again - make sure Castle.DynamicProxy // has no problem with serializing two times - earlier versions of it did. stream = new MemoryStream(); formatter = new BinaryFormatter( ); formatter.Serialize(stream, s); stream.Position = 0; s = (ISession)formatter.Deserialize(stream); stream.Close(); s.Close(); } [Test] public void SerializeNotFoundProxy() { ISession s = sessions.OpenSession(); // this does not actually exists in db CastleProxy notThere = (CastleProxy)s.Load( typeof(CastleProxyImpl), 5 ); Assert.AreEqual( 5, notThere.Id ); s.Disconnect(); // serialize and then deserialize the session. Stream stream = new MemoryStream(); IFormatter formatter = new BinaryFormatter( ); formatter.Serialize(stream, s); stream.Position = 0; s = (ISession)formatter.Deserialize(stream); stream.Close(); Assert.IsNotNull( s.Load( typeof(CastleProxyImpl), 5 ), "should be proxy - even though it doesn't exists in db" ); s.Close(); } } } --- NEW FILE: CastleProxyImpl.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.Test.ProxyInterface.CastleProxyImpl, NHibernate.Test" proxy="NHibernate.Test.ProxyInterface.CastleProxy, NHibernate.Test" table="avalon_p" > <id name="Id"> <generator class="assigned" /> </id> <property name="Name" /> </class> </hibernate-mapping> --- NEW FILE: CastleProxy.cs --- using System; namespace NHibernate.Test.ProxyInterface { /// <summary> /// Summary description for CastleProxy. /// </summary> public interface CastleProxy { int Id { get; set; } string Name { get; set; } } } --- NEW FILE: CastleProxyImpl.cs --- using System; using NHibernate.Test.ProxyInterface; namespace NHibernate.Test.ProxyInterface { /// <summary> /// Summary description for CastleProxyImpl. /// </summary> [Serializable] public class CastleProxyImpl : CastleProxy { private int _id; private string _name; #region CastleProxy Members public int Id { get { return _id; } set { _id = value; } } public string Name { get { return _name; } set { _name = value; } } #endregion } } |
From: Michael D. <mik...@us...> - 2004-12-16 21:51:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16804/NHibernate/SqlCommand Modified Files: InFragment.cs Log Message: Fixed bug with "null" being a discriminator and the sql string generated having an extra comma at the end of the in list. Index: InFragment.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/InFragment.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InFragment.cs 16 Aug 2004 05:18:52 -0000 1.1 --- InFragment.cs 16 Dec 2004 21:51:08 -0000 1.2 *************** *** 35,45 **** public SqlString ToFragmentString() { ! SqlStringBuilder buf = new SqlStringBuilder(values.Count + 5); ! buf.Add(columnName); ! if (values.Count > 1) { bool allowNull = false; ! buf.Add(" in ("); ! for(int i=0; i<values.Count; i++) { if("null".Equals(values[i])) --- 35,53 ---- public SqlString ToFragmentString() { ! SqlStringBuilder buf = new SqlStringBuilder( values.Count * 5 ); ! buf.Add( columnName ); ! ! if( values.Count > 1 ) { + // is a comma needed before the value that's about to be added - it + // defaults to false because we don't need a comma right away. + bool commaNeeded = false; + + // if a "null" is in the list of values then we need to manipulate + // the SqlString a little bit more at the end. bool allowNull = false; ! ! buf.Add( " in (" ); ! for( int i=0; i<values.Count; i++ ) { if("null".Equals(values[i])) *************** *** 47,62 **** allowNull = true; } - else { buf.Add( (string)values[i] ); ! if ( i<values.Count-1) buf.Add(StringHelper.CommaSpace); } } buf.Add(StringHelper.ClosedParen); ! if(allowNull) { - buf.Insert(0, " is null or ") .Insert(0, columnName) --- 55,78 ---- allowNull = true; } else { + if( commaNeeded ) + { + buf.Add( StringHelper.CommaSpace ); + } buf.Add( (string)values[i] ); ! ! // a value has been added into the IN clause so the next ! // one needs a comma before it ! commaNeeded = true; } } buf.Add(StringHelper.ClosedParen); ! ! // if "null" is in the list of values then add to the beginning of the ! // SqlString "is null or [column] (" + [rest of sqlstring here] + ")" ! if( allowNull ) { buf.Insert(0, " is null or ") .Insert(0, columnName) |
From: Michael D. <mik...@us...> - 2004-12-16 21:50:31
|
Update of /cvsroot/nhibernate/nhibernate/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16612 Modified Files: .cvsignore Log Message: Added some ignores for ReSharper Index: .cvsignore =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .cvsignore 8 Dec 2004 15:30:54 -0000 1.4 --- .cvsignore 16 Dec 2004 21:50:22 -0000 1.5 *************** *** 2,3 **** --- 2,6 ---- *.snk CloverSrc + _ReSharper* + *.resharperoptions + |
From: Michael D. <mik...@us...> - 2004-12-16 21:49:36
|
Update of /cvsroot/nhibernate/nhibernate/lib/net/1.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16310 Added Files: Castle.DynamicProxy.dll Castle.DynamicProxy.license.txt Log Message: Adding dll needed for proxies. --- 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. |
From: Michael D. <mik...@us...> - 2004-12-16 21:45:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyInterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15405/ProxyInterface Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyInterface added to the repository |
From: Michael D. <mik...@us...> - 2004-12-16 15:26:29
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23953/src/Nullables.Tests Modified Files: NullableBooleanFixture.cs NullableByteFixture.cs NullableDateTimeFixture.cs NullableDecimalFixture.cs NullableDoubleFixture.cs NullableGuidFixture.cs NullableInt16Fixture.cs NullableInt32Fixture.cs NullableInt64Fixture.cs Nullables.Tests-1.1.csproj NullableSByteFixture.cs NullableSingleFixture.cs Log Message: playing around with ReSharper. Did some formatting changes. Index: NullableBooleanFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableBooleanFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableBooleanFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableBooleanFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 13,23 **** public class NullableBooleanFixture { - public NullableBooleanFixture() - { - // - // TODO: Add constructor logic here - // - } - [Test] public void BooleanIComparableTest() --- 11,14 ---- *************** *** 28,47 **** //one null, one not x = NullableBoolean.Default; ! y = new NullableBoolean(true); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableBoolean.Default; y = NullableBoolean.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableBoolean(false); ! y = new NullableBoolean(true); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 19,38 ---- //one null, one not x = NullableBoolean.Default; ! y = new NullableBoolean( true ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableBoolean.Default; y = NullableBoolean.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableBoolean( false ); ! y = new NullableBoolean( true ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableDateTimeFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDateTimeFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDateTimeFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableDateTimeFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 16,45 **** public void BasicTestDateTime() { ! NullableDateTime v1 = new DateTime(1979, 11, 8); ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(new DateTime(1979, 11, 8))); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == new DateTime(1979, 11, 8)); ! Assert.IsFalse(v1.Equals(NullableDateTime.Default)); ! Assert.IsTrue(v1.Equals(new NullableDateTime(new DateTime(1979, 11, 8)))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == new DateTime(1979, 11, 8)); ! Assert.IsFalse(v1 == new DateTime(1980, 10, 9)); ! Assert.IsFalse(v1 == NullableDateTime.Default); ! Assert.IsTrue(v1 == new NullableDateTime(new DateTime(1979, 11, 8))); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableDateTime.Default); v1 = NullableDateTime.Default; ! Assert.IsTrue(v1 == NullableDateTime.Default); NullableDateTime v2 = NullableDateTime.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(new DateTime(2004, 12, 25))); ! Assert.IsTrue(v2.Equals(NullableDateTime.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 14,43 ---- public void BasicTestDateTime() { ! NullableDateTime v1 = new DateTime( 1979, 11, 8 ); ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( new DateTime( 1979, 11, 8 ) ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == new DateTime( 1979, 11, 8 ) ); ! Assert.IsFalse( v1.Equals( NullableDateTime.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableDateTime( new DateTime( 1979, 11, 8 ) ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == new DateTime( 1979, 11, 8 ) ); ! Assert.IsFalse( v1 == new DateTime( 1980, 10, 9 ) ); ! Assert.IsFalse( v1 == NullableDateTime.Default ); ! Assert.IsTrue( v1 == new NullableDateTime( new DateTime( 1979, 11, 8 ) ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableDateTime.Default ); v1 = NullableDateTime.Default; ! Assert.IsTrue( v1 == NullableDateTime.Default ); NullableDateTime v2 = NullableDateTime.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( new DateTime( 2004, 12, 25 ) ) ); ! Assert.IsTrue( v2.Equals( NullableDateTime.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableDateTime.Default; ! y = new NullableDateTime(new DateTime(2000, 12, 25)); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableDateTime.Default; y = NullableDateTime.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableDateTime(new DateTime(2000, 11, 1)); ! y = new NullableDateTime(new DateTime(2000, 12, 25)); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableDateTime.Default; ! y = new NullableDateTime( new DateTime( 2000, 12, 25 ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableDateTime.Default; y = NullableDateTime.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableDateTime( new DateTime( 2000, 11, 1 ) ); ! y = new NullableDateTime( new DateTime( 2000, 12, 25 ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableGuidFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableGuidFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableGuidFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableGuidFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 16,45 **** public void BasicTestGuid() { ! NullableGuid v1 = new Guid("00000000-0000-0000-0000-000000000005"); //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(new Guid("00000000-0000-0000-0000-000000000005"))); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == new Guid("00000000-0000-0000-0000-000000000005")); ! Assert.IsFalse(v1.Equals(NullableGuid.Default)); ! Assert.IsTrue(v1.Equals(new NullableGuid(new Guid("00000000-0000-0000-0000-000000000005")))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == new Guid("00000000-0000-0000-0000-000000000005")); ! Assert.IsFalse(v1 == new Guid("00000000-0000-0000-0000-000000000008")); ! Assert.IsFalse(v1 == NullableGuid.Default); ! Assert.IsTrue(v1 == new NullableGuid(new Guid("00000000-0000-0000-0000-000000000005"))); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableGuid.Default); v1 = NullableGuid.Default; ! Assert.IsTrue(v1 == NullableGuid.Default); NullableGuid v2 = NullableGuid.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(new Guid("00000000-0000-0000-0000-000000000002"))); ! Assert.IsTrue(v2.Equals(NullableGuid.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 14,43 ---- public void BasicTestGuid() { ! NullableGuid v1 = new Guid( "00000000-0000-0000-0000-000000000005" ); //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( new Guid( "00000000-0000-0000-0000-000000000005" ) ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == new Guid( "00000000-0000-0000-0000-000000000005" ) ); ! Assert.IsFalse( v1.Equals( NullableGuid.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableGuid( new Guid( "00000000-0000-0000-0000-000000000005" ) ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == new Guid( "00000000-0000-0000-0000-000000000005" ) ); ! Assert.IsFalse( v1 == new Guid( "00000000-0000-0000-0000-000000000008" ) ); ! Assert.IsFalse( v1 == NullableGuid.Default ); ! Assert.IsTrue( v1 == new NullableGuid( new Guid( "00000000-0000-0000-0000-000000000005" ) ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableGuid.Default ); v1 = NullableGuid.Default; ! Assert.IsTrue( v1 == NullableGuid.Default ); NullableGuid v2 = NullableGuid.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( new Guid( "00000000-0000-0000-0000-000000000002" ) ) ); ! Assert.IsTrue( v2.Equals( NullableGuid.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableGuid.Default; ! y = new NullableGuid(new Guid("12345678-1234-1234-1234-123456789012")); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableGuid.Default; y = NullableGuid.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableGuid(new Guid("12345678-1234-1234-1234-123456789001")); ! y = new NullableGuid(new Guid("12345678-1234-1234-1234-123456789099")); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableGuid.Default; ! y = new NullableGuid( new Guid( "12345678-1234-1234-1234-123456789012" ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableGuid.Default; y = NullableGuid.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableGuid( new Guid( "12345678-1234-1234-1234-123456789001" ) ); ! y = new NullableGuid( new Guid( "12345678-1234-1234-1234-123456789099" ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableInt16Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt16Fixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt16Fixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableInt16Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableInt16 v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableInt16.Default)); ! Assert.IsTrue(v1.Equals(new NullableInt16(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableInt16.Default); ! Assert.IsTrue(v1 == new NullableInt16(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableInt16.Default); v1 = NullableInt16.Default; ! Assert.IsTrue(v1 == NullableInt16.Default); NullableInt16 v2 = NullableInt16.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableInt16.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableInt16 v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableInt16.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableInt16( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableInt16.Default ); ! Assert.IsTrue( v1 == new NullableInt16( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableInt16.Default ); v1 = NullableInt16.Default; ! Assert.IsTrue( v1 == NullableInt16.Default ); NullableInt16 v2 = NullableInt16.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableInt16.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableInt16.Default; ! y = new NullableInt16(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableInt16.Default; y = NullableInt16.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableInt16(5); ! y = new NullableInt16(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableInt16.Default; ! y = new NullableInt16( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableInt16.Default; y = NullableInt16.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableInt16( 5 ); ! y = new NullableInt16( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableDoubleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDoubleFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDoubleFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableDoubleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableDouble v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableDouble.Default)); ! Assert.IsTrue(v1.Equals(new NullableDouble(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableDouble.Default); ! Assert.IsTrue(v1 == new NullableDouble(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableDouble.Default); v1 = NullableDouble.Default; ! Assert.IsTrue(v1 == NullableDouble.Default); NullableDouble v2 = NullableDouble.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableDouble.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableDouble v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableDouble.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableDouble( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableDouble.Default ); ! Assert.IsTrue( v1 == new NullableDouble( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableDouble.Default ); v1 = NullableDouble.Default; ! Assert.IsTrue( v1 == NullableDouble.Default ); NullableDouble v2 = NullableDouble.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableDouble.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableDouble.Default; ! y = new NullableDouble(0.5); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableDouble.Default; y = NullableDouble.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableDouble(0.6); ! y = new NullableDouble(0.67); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableDouble.Default; ! y = new NullableDouble( 0.5 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableDouble.Default; y = NullableDouble.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableDouble( 0.6 ); ! y = new NullableDouble( 0.67 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableInt64Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt64Fixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt64Fixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableInt64Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableInt64 v1 = 46816684; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(46816684)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 46816684); ! Assert.IsFalse(v1.Equals(NullableInt64.Default)); ! Assert.IsTrue(v1.Equals(new NullableInt64(46816684))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 46816684); ! Assert.IsFalse(v1 == 448494894); ! Assert.IsFalse(v1 == NullableInt64.Default); ! Assert.IsTrue(v1 == new NullableInt64(46816684)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableInt64.Default); v1 = NullableInt64.Default; ! Assert.IsTrue(v1 == NullableInt64.Default); NullableInt64 v2 = NullableInt64.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(4484)); ! Assert.IsTrue(v2.Equals(NullableInt64.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableInt64 v1 = 46816684; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 46816684 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 46816684 ); ! Assert.IsFalse( v1.Equals( NullableInt64.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableInt64( 46816684 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 46816684 ); ! Assert.IsFalse( v1 == 448494894 ); ! Assert.IsFalse( v1 == NullableInt64.Default ); ! Assert.IsTrue( v1 == new NullableInt64( 46816684 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableInt64.Default ); v1 = NullableInt64.Default; ! Assert.IsTrue( v1 == NullableInt64.Default ); NullableInt64 v2 = NullableInt64.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 4484 ) ); ! Assert.IsTrue( v2.Equals( NullableInt64.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,70 **** //one null, one not x = NullableInt64.Default; ! y = new NullableInt64(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableInt64.Default; y = NullableInt64.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableInt64(5); ! y = new NullableInt64(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } --- 50,68 ---- //one null, one not x = NullableInt64.Default; ! y = new NullableInt64( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableInt64.Default; y = NullableInt64.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableInt64( 5 ); ! y = new NullableInt64( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } Index: NullableDecimalFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDecimalFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDecimalFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableDecimalFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableDecimal v1 = 4.99m; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(4.99m)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 4.99m); ! Assert.IsFalse(v1.Equals(NullableDecimal.Default)); ! Assert.IsTrue(v1.Equals(new NullableDecimal(4.99m))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 4.99m); ! Assert.IsFalse(v1 == 5.01m); ! Assert.IsFalse(v1 == NullableDecimal.Default); ! Assert.IsTrue(v1 == new NullableDecimal(4.99m)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableDecimal.Default); v1 = NullableDecimal.Default; ! Assert.IsTrue(v1 == NullableDecimal.Default); NullableDecimal v2 = NullableDecimal.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(4.01m)); ! Assert.IsTrue(v2.Equals(NullableDecimal.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableDecimal v1 = 4.99m; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 4.99m ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 4.99m ); ! Assert.IsFalse( v1.Equals( NullableDecimal.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableDecimal( 4.99m ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 4.99m ); ! Assert.IsFalse( v1 == 5.01m ); ! Assert.IsFalse( v1 == NullableDecimal.Default ); ! Assert.IsTrue( v1 == new NullableDecimal( 4.99m ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableDecimal.Default ); v1 = NullableDecimal.Default; ! Assert.IsTrue( v1 == NullableDecimal.Default ); NullableDecimal v2 = NullableDecimal.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 4.01m ) ); ! Assert.IsTrue( v2.Equals( NullableDecimal.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableDecimal.Default; ! y = new NullableDecimal(10.03m); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableDecimal.Default; y = NullableDecimal.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableDecimal(15.3m); ! y = new NullableDecimal(18.02m); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableDecimal.Default; ! y = new NullableDecimal( 10.03m ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableDecimal.Default; y = NullableDecimal.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableDecimal( 15.3m ); ! y = new NullableDecimal( 18.02m ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableSByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSByteFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableSByteFixture.cs 10 Dec 2004 18:24:20 -0000 1.1 --- NullableSByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.2 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,49 **** [Test] ! public void BasicTestSByte() { NullableSByte v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableSByte.Default)); ! Assert.IsTrue(v1.Equals(new NullableSByte(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableSByte.Default); ! Assert.IsTrue(v1 == new NullableSByte(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableSByte.Default); v1 = NullableSByte.Default; ! Assert.IsTrue(v1 == NullableSByte.Default); NullableSByte v2 = NullableSByte.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableSByte.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,47 ---- [Test] ! public void BasicTestSByte() { NullableSByte v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableSByte.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableSByte( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableSByte.Default ); ! Assert.IsTrue( v1 == new NullableSByte( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableSByte.Default ); v1 = NullableSByte.Default; ! Assert.IsTrue( v1 == NullableSByte.Default ); NullableSByte v2 = NullableSByte.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableSByte.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 56,75 **** //one null, one not x = NullableSByte.Default; ! y = new NullableSByte(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableSByte.Default; y = NullableSByte.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableSByte(5); ! y = new NullableSByte(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 54,73 ---- //one null, one not x = NullableSByte.Default; ! y = new NullableSByte( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableSByte.Default; y = NullableSByte.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableSByte( 5 ); ! y = new NullableSByte( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableSingleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSingleFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableSingleFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableSingleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableSingle v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableSingle.Default)); ! Assert.IsTrue(v1.Equals(new NullableSingle(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableSingle.Default); ! Assert.IsTrue(v1 == new NullableSingle(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableSingle.Default); v1 = NullableSingle.Default; ! Assert.IsTrue(v1 == NullableSingle.Default); NullableSingle v2 = NullableSingle.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableSingle.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableSingle v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableSingle.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableSingle( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableSingle.Default ); ! Assert.IsTrue( v1 == new NullableSingle( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableSingle.Default ); v1 = NullableSingle.Default; ! Assert.IsTrue( v1 == NullableSingle.Default ); NullableSingle v2 = NullableSingle.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableSingle.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableSingle.Default; ! y = new NullableSingle(1.6f); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableSingle.Default; y = NullableSingle.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableSingle(5.1f); ! y = new NullableSingle(8.9f); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableSingle.Default; ! y = new NullableSingle( 1.6f ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableSingle.Default; y = NullableSingle.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableSingle( 5.1f ); ! y = new NullableSingle( 8.9f ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: Nullables.Tests-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/Nullables.Tests-1.1.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Nullables.Tests-1.1.csproj 6 Dec 2004 03:17:00 -0000 1.2 --- Nullables.Tests-1.1.csproj 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 172,175 **** --- 172,180 ---- /> <File + RelPath = "NullableSByteFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NullableSingleFixture.cs" SubType = "Code" Index: NullableByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableByteFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableByteFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableByte v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableByte.Default)); ! Assert.IsTrue(v1.Equals(new NullableByte(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableByte.Default); ! Assert.IsTrue(v1 == new NullableByte(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableByte.Default); v1 = NullableByte.Default; ! Assert.IsTrue(v1 == NullableByte.Default); NullableByte v2 = NullableByte.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableByte.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableByte v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableByte.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableByte( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableByte.Default ); ! Assert.IsTrue( v1 == new NullableByte( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableByte.Default ); v1 = NullableByte.Default; ! Assert.IsTrue( v1 == NullableByte.Default ); NullableByte v2 = NullableByte.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableByte.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableByte.Default; ! y = new NullableByte(12); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableByte.Default; y = NullableByte.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableByte(5); ! y = new NullableByte(101); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableByte.Default; ! y = new NullableByte( 12 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableByte.Default; y = NullableByte.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableByte( 5 ); ! y = new NullableByte( 101 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableInt32Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt32Fixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt32Fixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableInt32Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,46 **** NullableInt32 v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableInt32.Default)); ! Assert.IsTrue(v1.Equals(new NullableInt32(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableInt32.Default); ! Assert.IsTrue(v1 == new NullableInt32(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableInt32.Default); v1 = NullableInt32.Default; ! Assert.IsTrue(v1 == NullableInt32.Default); NullableInt32 v2 = NullableInt32.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableInt32.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); ! Assert.IsTrue( v2==null ); } --- 16,44 ---- NullableInt32 v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableInt32.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableInt32( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableInt32.Default ); ! Assert.IsTrue( v1 == new NullableInt32( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableInt32.Default ); v1 = NullableInt32.Default; ! Assert.IsTrue( v1 == NullableInt32.Default ); NullableInt32 v2 = NullableInt32.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableInt32.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); ! Assert.IsTrue( v2 == null ); } *************** *** 53,72 **** //one null, one not x = NullableInt32.Default; ! y = new NullableInt32(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableInt32.Default; y = NullableInt32.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableInt32(5); ! y = new NullableInt32(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 51,70 ---- //one null, one not x = NullableInt32.Default; ! y = new NullableInt32( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableInt32.Default; y = NullableInt32.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableInt32( 5 ); ! y = new NullableInt32( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file |
From: Michael D. <mik...@us...> - 2004-12-16 15:26:25
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23953/src/Nullables Modified Files: AssemblyInfo.cs Nullables-1.1.csproj Log Message: playing around with ReSharper. Did some formatting changes. Index: Nullables-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables/Nullables-1.1.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Nullables-1.1.csproj 12 Nov 2004 22:08:25 -0000 1.1 --- Nullables-1.1.csproj 16 Dec 2004 15:26:12 -0000 1.2 *************** *** 134,137 **** --- 134,142 ---- /> <File + RelPath = "NullableSByte.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NullableSingle.cs" SubType = "Code" *************** *** 184,187 **** --- 189,197 ---- /> <File + RelPath = "TypeConverters\NullableSByteConverter.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "TypeConverters\NullableSingleConverter.cs" SubType = "Code" Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables/AssemblyInfo.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AssemblyInfo.cs 16 Dec 2004 14:28:52 -0000 1.4 --- AssemblyInfo.cs 16 Dec 2004 15:26:12 -0000 1.5 *************** *** 20,23 **** [assembly: AssemblyInformationalVersionAttribute("0.5")] [assembly: AssemblyFileVersionAttribute("0.5.0.0")] - //[assembly: AssemblyKeyFileAttribute("..\\NHibernate.snk")] --- 20,22 ---- |