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: <fab...@us...> - 2009-06-26 14:15:36
|
Revision: 4533 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4533&view=rev Author: fabiomaulo Date: 2009-06-26 14:15:32 +0000 (Fri, 26 Jun 2009) Log Message: ----------- Fix NH-1853 (does not need test because it delegate the logic to an existing method) Modified Paths: -------------- branches/2.1.x/nhibernate/src/NHibernate/Cfg/Configuration.cs Modified: branches/2.1.x/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-06-25 15:24:23 UTC (rev 4532) +++ branches/2.1.x/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-06-26 14:15:32 UTC (rev 4533) @@ -649,7 +649,24 @@ } } - // Not ported - addResource(String path) - not applicable + /// <summary> + /// Adds the mappings from ebedded resources of the assembly. + /// </summary> + /// <param name="paths">Paths to the resource files in the assembly.</param> + /// <param name="assembly">The assembly that contains the resource files.</param> + /// <returns>This configuration object.</returns> + public Configuration AddResources(IEnumerable<string> paths, Assembly assembly) + { + if (paths == null) + { + throw new ArgumentNullException("paths"); + } + foreach (var path in paths) + { + AddResource(path, assembly); + } + return this; + } /// <summary> /// Read a mapping from an embedded resource, using a convention. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-25 15:24:25
|
Revision: 4532 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4532&view=rev Author: fabiomaulo Date: 2009-06-25 15:24:23 +0000 (Thu, 25 Jun 2009) Log Message: ----------- example of minimal configuration Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs 2009-06-25 04:59:34 UTC (rev 4531) +++ trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs 2009-06-25 15:24:23 UTC (rev 4532) @@ -1,4 +1,6 @@ using System.Data; +using System.Data.Common; +using System.Data.SqlClient; using NHibernate.AdoNet; using NHibernate.ByteCode.LinFu; using NHibernate.Cache; @@ -68,7 +70,15 @@ IFluentSessionFactoryConfiguration sfc = null; sfc .Proxy.Trough<ProxyFactoryFactory>() - .Integrate.Using<MsSql2005Dialect>(); + .Integrate + .Using<MsSql2005Dialect>() + .Connected + .Using(new SqlConnectionStringBuilder + { + DataSource = "(local)", + InitialCatalog = "nhibernate", + IntegratedSecurity = true + }); } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-25 04:59:35
|
Revision: 4531 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4531&view=rev Author: fabiomaulo Date: 2009-06-25 04:59:34 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Removed empty namespace Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj Removed Paths: ------------- trunk/nhibernate/src/NHibernate/Loader/Hql/ Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-25 04:19:42 UTC (rev 4530) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-25 04:59:34 UTC (rev 4531) @@ -1331,9 +1331,6 @@ <ItemGroup> <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> </ItemGroup> - <ItemGroup> - <Folder Include="Loader\Hql\" /> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-25 04:19:43
|
Revision: 4530 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4530&view=rev Author: fabiomaulo Date: 2009-06-25 04:19:42 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Fixed TYPO Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs 2009-06-25 04:13:07 UTC (rev 4529) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs 2009-06-25 04:19:42 UTC (rev 4530) @@ -5,7 +5,7 @@ { ICommandsConfiguration Preparing(); ICommandsConfiguration WithTimeout(int seconds); - ICommandsConfiguration ConvertingExpetionsTrough<TExceptionConverter>() where TExceptionConverter : ISQLExceptionConverter; + ICommandsConfiguration ConvertingExceptionsTrough<TExceptionConverter>() where TExceptionConverter : ISQLExceptionConverter; ICommandsConfiguration AutoCommentingSql(); IDbIntegrationConfiguration WithHqlToSqlSubstitutions(string csvQuerySubstitutions); IDbIntegrationConfiguration WithDefaultHqlToSqlSubstitutions(); Modified: trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs 2009-06-25 04:13:07 UTC (rev 4529) +++ trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs 2009-06-25 04:19:42 UTC (rev 4530) @@ -33,7 +33,7 @@ .Using("The connection string but it has some overload") .CreateCommands .AutoCommentingSql() - .ConvertingExpetionsTrough<SQLStateConverter>() + .ConvertingExceptionsTrough<SQLStateConverter>() .Preparing() .WithTimeout(10) .WithMaximumDepthOfOuterJoinFetching(10) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-25 04:13:08
|
Revision: 4529 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4529&view=rev Author: fabiomaulo Date: 2009-06-25 04:13:07 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Fixed the NAnt script for tests Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2009-06-25 03:50:31 UTC (rev 4528) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2009-06-25 04:13:07 UTC (rev 4529) @@ -9,18 +9,20 @@ <property name="clover.instrument" value="false" /> <assemblyfileset id="project.references" basedir="${bin.dir}"> <include name="System.dll" /> + <include name="System.Core.dll" /> <include name="System.Transactions.dll" /> <include name="System.Configuration.dll" /> <include name="System.Xml.dll" /> <include name="System.Data.dll" /> + <include name="System.Data.OracleClient.dll" /> <include name="Iesi.Collections.dll" /> <include name="log4net.dll" /> + <include name="NHibernate.ByteCode.LinFu.dll"/> <include name="NHibernate.DomainModel.dll" /> <include name="NHibernate.dll" /> <include name="LinFu.DynamicProxy.dll" /> <include name="nunit.framework.dll" /> <include name="Antlr3.Runtime.dll" /> - <include name="Rhino.Mocks.dll" /> </assemblyfileset> <resourcefileset id="project.resources" prefix="NHibernate.Test" dynamicprefix="true"> <include name="**/*.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-25 03:50:33
|
Revision: 4528 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4528&view=rev Author: fabiomaulo Date: 2009-06-25 03:50:31 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Proof of concept of Loquacious session-factory configuration. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IBatcherConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICacheConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICollectionFactoryConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IConnectionConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbIntegrationConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbSchemaIntegrationConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IFluentSessionFactoryConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IMappingsConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IProxyConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IQueryCacheConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ITransactionConfiguration.cs trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IBatcherConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IBatcherConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IBatcherConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,9 @@ +using NHibernate.AdoNet; +namespace NHibernate.Cfg.Loquacious +{ + public interface IBatcherConfiguration + { + IBatcherConfiguration Trough<TBatcher>() where TBatcher : IBatcherFactory; + IDbIntegrationConfiguration Each(short batchSize); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICacheConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICacheConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICacheConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,12 @@ +using NHibernate.Cache; +namespace NHibernate.Cfg.Loquacious +{ + public interface ICacheConfiguration + { + ICacheConfiguration Trough<TProvider>() where TProvider : ICacheProvider; + ICacheConfiguration PrefixingRegionsWith(string regionPrefix); + ICacheConfiguration UsingMinimalPuts(); + IFluentSessionFactoryConfiguration WithDefaultExpiration(byte seconds); + IQueryCacheConfiguration Queries { get; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICollectionFactoryConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICollectionFactoryConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICollectionFactoryConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,8 @@ +using NHibernate.Bytecode; +namespace NHibernate.Cfg.Loquacious +{ + public interface ICollectionFactoryConfiguration + { + IFluentSessionFactoryConfiguration Trough<TCollecionsFactory>() where TCollecionsFactory : ICollectionTypeFactory; + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ICommandsConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,21 @@ +using NHibernate.Exceptions; +namespace NHibernate.Cfg.Loquacious +{ + public interface ICommandsConfiguration + { + ICommandsConfiguration Preparing(); + ICommandsConfiguration WithTimeout(int seconds); + ICommandsConfiguration ConvertingExpetionsTrough<TExceptionConverter>() where TExceptionConverter : ISQLExceptionConverter; + ICommandsConfiguration AutoCommentingSql(); + IDbIntegrationConfiguration WithHqlToSqlSubstitutions(string csvQuerySubstitutions); + IDbIntegrationConfiguration WithDefaultHqlToSqlSubstitutions(); + + /// <summary> + /// Maximum depth of outer join fetching + /// </summary> + /// <remarks> + /// 0 (zero) disable the usage of OuterJoinFetching + /// </remarks> + ICommandsConfiguration WithMaximumDepthOfOuterJoinFetching(byte maxFetchDepth); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IConnectionConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IConnectionConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IConnectionConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,18 @@ +using System.Data; +using System.Data.Common; +using NHibernate.Driver; +using NHibernate.Connection; + +namespace NHibernate.Cfg.Loquacious +{ + public interface IConnectionConfiguration + { + IConnectionConfiguration Trough<TProvider>() where TProvider : IConnectionProvider; + IConnectionConfiguration Through<TDriver>() where TDriver : IDriver; + IConnectionConfiguration With(IsolationLevel level); + IConnectionConfiguration Releasing(ConnectionReleaseMode releaseMode); + IDbIntegrationConfiguration Using(string connectionString); + IDbIntegrationConfiguration Using(DbConnectionStringBuilder connectionStringBuilder); + IDbIntegrationConfiguration ByAppConfing(string connectionStringName); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbIntegrationConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbIntegrationConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbIntegrationConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,27 @@ +namespace NHibernate.Cfg.Loquacious +{ + public interface IDbIntegrationConfiguration + { + /// <summary> + /// Define the dialect to use. + /// </summary> + /// <typeparam name="TDialect">The dialect implementation inherited from <see cref="Dialect.Dialect"/>. </typeparam> + /// <returns>The fluent configuration itself.</returns> + IDbIntegrationConfiguration Using<TDialect>() where TDialect : Dialect.Dialect; + IDbIntegrationConfiguration DisableKeywordsAutoImport(); + IDbIntegrationConfiguration AutoQuoteKeywords(); + IDbIntegrationConfiguration LogSqlInConsole(); + IDbIntegrationConfiguration DisableLogFormatedSql(); + + IConnectionConfiguration Connected { get; } + + IBatcherConfiguration BatchingQueries { get; } + + ITransactionConfiguration Transactions { get; } + + ICommandsConfiguration CreateCommands { get; } + + IDbSchemaIntegrationConfiguration Schema { get; } + + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbSchemaIntegrationConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbSchemaIntegrationConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IDbSchemaIntegrationConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,10 @@ +namespace NHibernate.Cfg.Loquacious +{ + public interface IDbSchemaIntegrationConfiguration + { + IDbIntegrationConfiguration Recreating(); + IDbIntegrationConfiguration Creating(); + IDbIntegrationConfiguration Updating(); + IDbIntegrationConfiguration Validating(); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IFluentSessionFactoryConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IFluentSessionFactoryConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IFluentSessionFactoryConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,36 @@ +using NHibernate.Hql; +namespace NHibernate.Cfg.Loquacious +{ + public interface IFluentSessionFactoryConfiguration + { + /// <summary> + /// Set the SessionFactory mnemonic name. + /// </summary> + /// <param name="sessionFactoryName">The mnemonic name.</param> + /// <returns>The fluent configuration itself.</returns> + /// <remarks> + /// The SessionFactory mnemonic name can be used as a surrogate key in a multi-DB application. + /// </remarks> + IFluentSessionFactoryConfiguration Named(string sessionFactoryName); + + /// <summary> + /// DataBase integration configuration. + /// </summary> + IDbIntegrationConfiguration Integrate { get; } + + /// <summary> + /// Cache configuration. + /// </summary> + ICacheConfiguration Caching { get; } + + IFluentSessionFactoryConfiguration GenerateStatistics(); + IFluentSessionFactoryConfiguration Using(EntityMode entityMode); + IFluentSessionFactoryConfiguration ParsingHqlThrough<TQueryTranslator>() where TQueryTranslator : IQueryTranslatorFactory; + + IProxyConfiguration Proxy { get; } + + ICollectionFactoryConfiguration GeneratingCollections { get; } + + IMappingsConfiguration Mapping { get; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IMappingsConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IMappingsConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IMappingsConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,8 @@ +namespace NHibernate.Cfg.Loquacious +{ + public interface IMappingsConfiguration + { + IMappingsConfiguration UsingDefaultSchema(string defaultSchemaName); + IMappingsConfiguration UsingDefaultCatalog(string defaultCatalogName); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IProxyConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IProxyConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IProxyConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,9 @@ +using NHibernate.Bytecode; +namespace NHibernate.Cfg.Loquacious +{ + public interface IProxyConfiguration + { + IProxyConfiguration DisableValidation(); + IFluentSessionFactoryConfiguration Trough<TProxyFactoryFactory>() where TProxyFactoryFactory : IProxyFactoryFactory; + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IQueryCacheConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IQueryCacheConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/IQueryCacheConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,9 @@ +using NHibernate.Cache; + +namespace NHibernate.Cfg.Loquacious +{ + public interface IQueryCacheConfiguration + { + ICacheConfiguration Trough<TFactory>() where TFactory : IQueryCache; + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ITransactionConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ITransactionConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/Loquacious/ITransactionConfiguration.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,8 @@ +using NHibernate.Transaction; +namespace NHibernate.Cfg.Loquacious +{ + public interface ITransactionConfiguration + { + IDbIntegrationConfiguration Trough<TFactory>() where TFactory : ITransactionFactory; + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-24 20:48:32 UTC (rev 4527) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-25 03:50:31 UTC (rev 4528) @@ -459,6 +459,18 @@ <Compile Include="Bytecode\ProxyFactoryFactoryNotConfiguredException.cs" /> <Compile Include="Bytecode\UnableToLoadProxyFactoryFactoryException.cs" /> <Compile Include="Cache\FakeCache.cs" /> + <Compile Include="Cfg\Loquacious\IBatcherConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\ICacheConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\ICollectionFactoryConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\ICommandsConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\IConnectionConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\IDbIntegrationConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\IDbSchemaIntegrationConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\IFluentSessionFactoryConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\IMappingsConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\IProxyConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\IQueryCacheConfiguration.cs" /> + <Compile Include="Cfg\Loquacious\ITransactionConfiguration.cs" /> <Compile Include="Cfg\SessionFactoryConfigurationBase.cs" /> <Compile Include="Cfg\ISessionFactoryConfiguration.cs" /> <Compile Include="Cfg\MappingSchema\AbstractDecoratable.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs 2009-06-25 03:50:31 UTC (rev 4528) @@ -0,0 +1,74 @@ +using System.Data; +using NHibernate.AdoNet; +using NHibernate.ByteCode.LinFu; +using NHibernate.Cache; +using NHibernate.Cfg.Loquacious; +using NHibernate.Dialect; +using NHibernate.Driver; +using NHibernate.Exceptions; +using NHibernate.Hql.Classic; +using NHibernate.Type; + +namespace NHibernate.Test.CfgTest.Loquacious +{ + public class ConfigurationFixture + { + public void ProofOfConcept() + { + // Here I'm configuring near all properties outside the scope of Configuration class + // Using the Configuration class the user can add mappings and configure listeners + IFluentSessionFactoryConfiguration sfc= null; + sfc.Named("SomeName") + .Integrate + .Using<MsSql2000Dialect>() + .AutoQuoteKeywords() + .BatchingQueries + .Trough<SqlClientBatchingBatcherFactory>() + .Each(10) + .Connected + .Trough<DebugConnectionProvider>() + .Through<SqlClientDriver>() + .Releasing(ConnectionReleaseMode.AfterTransaction) + .With(IsolationLevel.ReadCommitted) + .Using("The connection string but it has some overload") + .CreateCommands + .AutoCommentingSql() + .ConvertingExpetionsTrough<SQLStateConverter>() + .Preparing() + .WithTimeout(10) + .WithMaximumDepthOfOuterJoinFetching(10) + .WithHqlToSqlSubstitutions("true 1, false 0, yes 'Y', no 'N'") + .Schema + .Validating() + ; + sfc.Caching + .Trough<HashtableCacheProvider>() + .PrefixingRegionsWith("xyz") + .Queries + .Trough<StandardQueryCache>() + .UsingMinimalPuts() + .WithDefaultExpiration(15) + .GeneratingCollections + .Trough<DefaultCollectionTypeFactory>() + .Proxy + .DisableValidation() + .Trough<ProxyFactoryFactory>() + .ParsingHqlThrough<ClassicQueryTranslatorFactory>() + .Mapping + .UsingDefaultCatalog("MyCatalog") + .UsingDefaultSchema("MySche") + ; + } + + public void ProofOfConceptMinimalConfiguration() + { + // This is a possible minimal configuration + // in this case we must define best default properties for each dialect + // The place where put default properties values is the Dialect itself. + IFluentSessionFactoryConfiguration sfc = null; + sfc + .Proxy.Trough<ProxyFactoryFactory>() + .Integrate.Using<MsSql2005Dialect>(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-24 20:48:32 UTC (rev 4527) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-25 03:50:31 UTC (rev 4528) @@ -107,6 +107,7 @@ <Compile Include="CfgTest\HbmBinderFixture.cs" /> <Compile Include="CfgTest\HbmOrderingFixture.cs" /> <Compile Include="CfgTest\LocatedInTestAssembly.cs" /> + <Compile Include="CfgTest\Loquacious\ConfigurationFixture.cs" /> <Compile Include="CfgTest\MappingDocumentAggregatorTests.cs" /> <Compile Include="CfgTest\MappingDocumentParserTests.cs" /> <Compile Include="CfgTest\SettingsFactoryFixture.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ric...@us...> - 2009-06-24 20:48:45
|
Revision: 4527 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4527&view=rev Author: RicBrown Date: 2009-06-24 20:48:32 +0000 (Wed, 24 Jun 2009) Log Message: ----------- Added ICriteria<T>.Where() to allow more natural queries. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs Modified: trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs 2009-06-24 19:58:07 UTC (rev 4526) +++ trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs 2009-06-24 20:48:32 UTC (rev 4527) @@ -29,6 +29,13 @@ ICriteria<T> And(Expression<Func<T, bool>> expression); /// <summary> + /// Identical semantics to Add() to allow more readable queries + /// </summary> + /// <param name="expression">Lambda expression</param> + /// <returns>criteria instance</returns> + ICriteria<T> Where(Expression<Func<T, bool>> expression); + + /// <summary> /// Get the results of the root type and fill the <see cref="IList<T>"/> /// </summary> /// <param name="results">The list filled with the results.</param> Modified: trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs 2009-06-24 19:58:07 UTC (rev 4526) +++ trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs 2009-06-24 20:48:32 UTC (rev 4527) @@ -31,6 +31,12 @@ return this; } + ICriteria<T> ICriteria<T>.Where(Expression<Func<T, bool>> expression) + { + _criteria.Add(expression); + return this; + } + IList<T> ICriteria<T>.List() { return _criteria.List<T>(); Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-06-24 19:58:07 UTC (rev 4526) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-06-24 20:48:32 UTC (rev 4527) @@ -72,9 +72,9 @@ using (ISession s = OpenSession()) using (ITransaction t = s.BeginTransaction()) { - s.Save(new Person() { Name = "test person 1" }); - s.Save(new Person() { Name = "test person 2" }); - s.Save(new Person() { Name = "test person 3" }); + s.Save(new Person() { Name = "test person 1", Age = 20 }); + s.Save(new Person() { Name = "test person 2", Age = 30 }); + s.Save(new Person() { Name = "test person 3", Age = 40 }); t.Commit(); } @@ -83,7 +83,8 @@ { IList<Person> actual = s.QueryOver<Person>() - .And(p => p.Name == "test person 2") + .Where(p => p.Name == "test person 2") + .And(p => p.Age == 30) .List(); Assert.That(actual.Count, Is.EqualTo(1)); Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml 2009-06-24 19:58:07 UTC (rev 4526) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml 2009-06-24 20:48:32 UTC (rev 4527) @@ -8,6 +8,7 @@ <generator class="native"/> </id> <property name="Name" /> + <property name="Age" /> </class> <class name="Child"> Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2009-06-24 19:58:07 UTC (rev 4526) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2009-06-24 20:48:32 UTC (rev 4527) @@ -9,6 +9,7 @@ { public virtual int Id { get; set; } public virtual string Name { get; set; } + public virtual int Age { get; set; } } public class Child This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ric...@us...> - 2009-06-24 19:58:09
|
Revision: 4526 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4526&view=rev Author: RicBrown Date: 2009-06-24 19:58:07 +0000 (Wed, 24 Jun 2009) Log Message: ----------- Renamed ICriteria<T>.Add to ICriteria<T>.And (.Where to come). Modified Paths: -------------- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs Modified: trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs 2009-06-24 19:22:41 UTC (rev 4525) +++ trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs 2009-06-24 19:58:07 UTC (rev 4526) @@ -26,7 +26,7 @@ /// </summary> /// <param name="expression">Lambda expression</param> /// <returns>criteria instance</returns> - ICriteria<T> Add(Expression<Func<T, bool>> expression); + ICriteria<T> And(Expression<Func<T, bool>> expression); /// <summary> /// Get the results of the root type and fill the <see cref="IList<T>"/> Modified: trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs 2009-06-24 19:22:41 UTC (rev 4525) +++ trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs 2009-06-24 19:58:07 UTC (rev 4526) @@ -25,7 +25,7 @@ get { return _criteria; } } - ICriteria<T> ICriteria<T>.Add(Expression<Func<T, bool>> expression) + ICriteria<T> ICriteria<T>.And(Expression<Func<T, bool>> expression) { _criteria.Add(expression); return this; Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs 2009-06-24 19:22:41 UTC (rev 4525) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs 2009-06-24 19:58:07 UTC (rev 4526) @@ -24,7 +24,7 @@ ICriteria<Person> actual = CreateTestCriteria<Person>() - .Add(p => p.Name == "test name"); + .And(p => p.Name == "test name"); AssertCriteriaAreEqual(expected, actual); } Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-06-24 19:22:41 UTC (rev 4525) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-06-24 19:58:07 UTC (rev 4526) @@ -83,7 +83,7 @@ { IList<Person> actual = s.QueryOver<Person>() - .Add(p => p.Name == "test person 2") + .And(p => p.Name == "test person 2") .List(); Assert.That(actual.Count, Is.EqualTo(1)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ric...@us...> - 2009-06-24 19:22:42
|
Revision: 4525 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4525&view=rev Author: RicBrown Date: 2009-06-24 19:22:41 +0000 (Wed, 24 Jun 2009) Log Message: ----------- Added integration test and implementation of Criteria<T> through to the DB. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs trunk/nhibernate/src/NHibernate/ISession.cs trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs Modified: trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs 2009-06-24 18:58:43 UTC (rev 4524) +++ trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs 2009-06-24 19:22:41 UTC (rev 4525) @@ -1,5 +1,6 @@ using System; +using System.Collections.Generic; using System.Linq.Expressions; namespace NHibernate @@ -27,6 +28,12 @@ /// <returns>criteria instance</returns> ICriteria<T> Add(Expression<Func<T, bool>> expression); + /// <summary> + /// Get the results of the root type and fill the <see cref="IList<T>"/> + /// </summary> + /// <param name="results">The list filled with the results.</param> + IList<T> List(); + } } Modified: trunk/nhibernate/src/NHibernate/ISession.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ISession.cs 2009-06-24 18:58:43 UTC (rev 4524) +++ trunk/nhibernate/src/NHibernate/ISession.cs 2009-06-24 19:22:41 UTC (rev 4525) @@ -783,6 +783,13 @@ ICriteria CreateCriteria(string entityName, string alias); /// <summary> + /// Creates a new <c>ICriteria<T></c> for the entity class. + /// </summary> + /// <typeparam name="T">The entity class</typeparam> + /// <returns>An ICriteria<T> object</returns> + ICriteria<T> QueryOver<T>() where T : class; + + /// <summary> /// Create a new instance of <c>Query</c> for the given query string /// </summary> /// <param name="queryString">A hibernate query string</param> Modified: trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs 2009-06-24 18:58:43 UTC (rev 4524) +++ trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs 2009-06-24 19:22:41 UTC (rev 4525) @@ -1,5 +1,6 @@ using System; +using System.Collections.Generic; using System.Linq.Expressions; namespace NHibernate.Impl @@ -30,6 +31,11 @@ return this; } + IList<T> ICriteria<T>.List() + { + return _criteria.List<T>(); + } + } } Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-06-24 18:58:43 UTC (rev 4524) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-06-24 19:22:41 UTC (rev 4525) @@ -1871,6 +1871,14 @@ } } + public ICriteria<T> QueryOver<T>() where T : class + { + using (new SessionIdLoggingContext(SessionId)) + { + return new CriteriaImpl<T>(CreateCriteria(typeof(T))); + } + } + public override IList List(CriteriaImpl criteria) { using (new SessionIdLoggingContext(SessionId)) Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-06-24 18:58:43 UTC (rev 4524) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-06-24 19:22:41 UTC (rev 4525) @@ -66,6 +66,30 @@ } } + [Test] + public void ICriteriaOfT_SimpleCriterion() + { + using (ISession s = OpenSession()) + using (ITransaction t = s.BeginTransaction()) + { + s.Save(new Person() { Name = "test person 1" }); + s.Save(new Person() { Name = "test person 2" }); + s.Save(new Person() { Name = "test person 3" }); + + t.Commit(); + } + + using (ISession s = OpenSession()) + { + IList<Person> actual = + s.QueryOver<Person>() + .Add(p => p.Name == "test person 2") + .List(); + + Assert.That(actual.Count, Is.EqualTo(1)); + } + } + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ric...@us...> - 2009-06-24 18:58:46
|
Revision: 4524 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4524&view=rev Author: RicBrown Date: 2009-06-24 18:58:43 +0000 (Wed, 24 Jun 2009) Log Message: ----------- Added first cut of ICriteria<T> interface. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs Added: trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/ICriteriaOfT.cs 2009-06-24 18:58:43 UTC (rev 4524) @@ -0,0 +1,32 @@ + +using System; +using System.Linq.Expressions; + +namespace NHibernate +{ + + /// <summary> + /// Criteria<T> is an API for retrieving entities by composing + /// <see cref="Criterion.Expression" /> objects expressed using Lambda expression syntax. + /// </summary> + /// <remarks> + /// <code> + /// IList<Cat> cats = session.QueryOver<Cat>() + /// .Add( c => c.Name == "Tigger" ) + /// .Add( c => c.Weight > minWeight ) ) + /// .List(); + /// </code> + /// </remarks> + public interface ICriteria<T> + { + + /// <summary> + /// Add criterion expressed as a lambda expression + /// </summary> + /// <param name="expression">Lambda expression</param> + /// <returns>criteria instance</returns> + ICriteria<T> Add(Expression<Func<T, bool>> expression); + + } + +} Added: trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Impl/CriteriaOfTImpl.cs 2009-06-24 18:58:43 UTC (rev 4524) @@ -0,0 +1,35 @@ + +using System; +using System.Linq.Expressions; + +namespace NHibernate.Impl +{ + + /// <summary> + /// Implementation of the <see cref="ICriteria<T>"/> interface + /// </summary> + [Serializable] + public class CriteriaImpl<T> : ICriteria<T> + { + + private ICriteria _criteria; + + public CriteriaImpl(ICriteria criteria) + { + _criteria = criteria; + } + + public ICriteria UnderlyingCriteria + { + get { return _criteria; } + } + + ICriteria<T> ICriteria<T>.Add(Expression<Func<T, bool>> expression) + { + _criteria.Add(expression); + return this; + } + + } + +} Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-24 03:57:43 UTC (rev 4523) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-24 18:58:43 UTC (rev 4524) @@ -515,6 +515,8 @@ <Compile Include="Hql\Ast\ANTLR\Tree\ASTErrorNode.cs" /> <Compile Include="Hql\Ast\ANTLR\Tree\InsertStatement.cs" /> <Compile Include="Hql\Ast\ANTLR\Tree\UpdateStatement.cs" /> + <Compile Include="ICriteriaOfT.cs" /> + <Compile Include="Impl\CriteriaOfTImpl.cs" /> <Compile Include="Impl\ExpressionProcessor.cs" /> <Compile Include="Impl\SessionIdLoggingContext.cs" /> <Compile Include="Param\AbstractExplicitParameterSpecification.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaOfTFixture.cs 2009-06-24 18:58:43 UTC (rev 4524) @@ -0,0 +1,34 @@ +using System; +using System.Collections; + +using NUnit.Framework; + +using NHibernate.Criterion; +using NHibernate.Transform; +using NHibernate.Type; +using NHibernate.Util; + +namespace NHibernate.Test.Criteria.Lambda +{ + + [TestFixture] + public class CriteriaOfTFixture : LambdaFixtureBase + { + + [Test] + public void Equality() + { + ICriteria expected = + CreateTestCriteria(typeof(Person)) + .Add(Restrictions.Eq("Name", "test name")); + + ICriteria<Person> actual = + CreateTestCriteria<Person>() + .Add(p => p.Name == "test name"); + + AssertCriteriaAreEqual(expected, actual); + } + + } + +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs 2009-06-24 03:57:43 UTC (rev 4523) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs 2009-06-24 18:58:43 UTC (rev 4524) @@ -29,6 +29,26 @@ return new CriteriaImpl(persistentClass, alias, null); } + protected ICriteria<T> CreateTestCriteria<T>() + { + return new CriteriaImpl<T>(new CriteriaImpl(typeof(T), null)); + } + + protected void AssertCriteriaAreEqual(ICriteria expected, ICriteria actual) + { + AssertObjectsAreEqual(expected, actual); + } + + protected void AssertCriteriaAreEqual(DetachedCriteria expected, DetachedCriteria actual) + { + AssertObjectsAreEqual(expected, actual); + } + + protected void AssertCriteriaAreEqual<T>(ICriteria expected, ICriteria<T> actual) + { + AssertObjectsAreEqual(expected, ((CriteriaImpl<T>)actual).UnderlyingCriteria); + } + private void AssertDictionariesAreEqual(IDictionary expected, IDictionary actual) { Assert.AreEqual(expected.Keys.Count, actual.Keys.Count, _fieldPath.Peek() + ".Count"); @@ -127,16 +147,6 @@ AssertObjectsAreEqual(expected, actual, expected.GetType().Name); } - protected void AssertCriteriaAreEqual(ICriteria expected, ICriteria actual) - { - AssertObjectsAreEqual(expected, actual); - } - - protected void AssertCriteriaAreEqual(DetachedCriteria expected, DetachedCriteria actual) - { - AssertObjectsAreEqual(expected, actual); - } - } } Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-24 03:57:43 UTC (rev 4523) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-24 18:58:43 UTC (rev 4524) @@ -145,6 +145,7 @@ <Compile Include="Criteria\Enrolment.cs" /> <Compile Include="Criteria\Lambda\CriteriaAssertFixture.cs" /> <Compile Include="Criteria\Lambda\CriteriaFixture.cs" /> + <Compile Include="Criteria\Lambda\CriteriaOfTFixture.cs" /> <Compile Include="Criteria\Lambda\IntegrationFixture.cs" /> <Compile Include="Criteria\Lambda\LambdaFixtureBase.cs" /> <Compile Include="Criteria\Lambda\Model.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Noren <man...@ci...> - 2009-06-24 09:15:06
|
How to Spice Upp Yxour sex Life www . shop41 . net |
From: <fab...@us...> - 2009-06-24 03:58:14
|
Revision: 4523 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4523&view=rev Author: fabiomaulo Date: 2009-06-24 03:57:43 +0000 (Wed, 24 Jun 2009) Log Message: ----------- Refactoring (extracted base class) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Cfg/SessionFactoryConfigurationBase.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs 2009-06-23 23:23:33 UTC (rev 4522) +++ trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs 2009-06-24 03:57:43 UTC (rev 4523) @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Xml.XPath; namespace NHibernate.Cfg.ConfigurationSchema @@ -7,7 +6,7 @@ /// <summary> /// Configuration parsed values for a session-factory XML node. /// </summary> - public class SessionFactoryConfiguration : ISessionFactoryConfiguration + public class SessionFactoryConfiguration : SessionFactoryConfigurationBase { //private static readonly ILog log = LogManager.GetLogger(typeof(SessionFactoryConfiguration)); @@ -24,7 +23,7 @@ /// <param name="name">The session factory name. Null or empty string are allowed.</param> public SessionFactoryConfiguration(string name) { - this.name = name; + Name = name; } private void Parse(XPathNavigator navigator) @@ -44,7 +43,7 @@ if (xpn != null) { if (xpn.MoveToFirstAttribute()) - name = xpn.Value; + Name = xpn.Value; } } @@ -53,21 +52,12 @@ XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryPropertiesExpression); while (xpni.MoveNext()) { - string propName; - string propValue; - if(xpni.Current.Value!=null) - { - propValue = xpni.Current.Value.Trim(); - } - else - { - propValue = string.Empty; - } + string propValue = xpni.Current.Value!=null ? xpni.Current.Value.Trim() : string.Empty; XPathNavigator pNav = xpni.Current.Clone(); pNav.MoveToFirstAttribute(); - propName= pNav.Value; + string propName = pNav.Value; if (!string.IsNullOrEmpty(propName)) - properties[propName] = propValue; + Properties[propName] = propValue; } } @@ -76,29 +66,10 @@ XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryMappingsExpression); while (xpni.MoveNext()) { - MappingConfiguration mc = new MappingConfiguration(xpni.Current); + var mc = new MappingConfiguration(xpni.Current); if (!mc.IsEmpty()) { - // Workaround add first an assembly&resource and then only the same assembly. - // the <mapping> of whole assembly is ignored (included only sigles resources) - // The "ignore" log, is enough ? - // Perhaps we can add some intelligence to remove single resource reference when a whole assembly is referenced - //if (!mappings.Contains(mc)) - //{ - // mappings.Add(mc); - //} - //else - //{ - // string logMessage = "Ignored mapping -> " + mc.ToString(); - // if (log.IsDebugEnabled) - // log.Debug(logMessage); - // if (log.IsWarnEnabled) - // log.Warn(logMessage); - //} - - // The control to prevent mappings duplication was removed since the engine do the right thing - // for this issue (simple is better) - mappings.Add(mc); + Mappings.Add(mc); } } } @@ -108,7 +79,7 @@ XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryClassesCacheExpression); while (xpni.MoveNext()) { - classesCache.Add(new ClassCacheConfiguration(xpni.Current)); + ClassesCache.Add(new ClassCacheConfiguration(xpni.Current)); } } @@ -118,7 +89,7 @@ XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryCollectionsCacheExpression); while (xpni.MoveNext()) { - collectionsCache.Add(new CollectionCacheConfiguration(xpni.Current)); + CollectionsCache.Add(new CollectionCacheConfiguration(xpni.Current)); } } @@ -128,7 +99,7 @@ XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryListenersExpression); while (xpni.MoveNext()) { - listeners.Add(new ListenerConfiguration(xpni.Current)); + Listeners.Add(new ListenerConfiguration(xpni.Current)); } } @@ -137,72 +108,8 @@ XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryEventsExpression); while (xpni.MoveNext()) { - events.Add(new EventConfiguration(xpni.Current)); + Events.Add(new EventConfiguration(xpni.Current)); } } - - private string name = string.Empty; - /// <summary> - /// The session factory name. - /// </summary> - public string Name - { - get { return name; } - } - - private IDictionary<string, string> properties = new Dictionary<string, string>(); - /// <summary> - /// Session factory propeties bag. - /// </summary> - public IDictionary<string,string> Properties - { - get { return properties; } - } - - private IList<MappingConfiguration> mappings = new List<MappingConfiguration>(); - /// <summary> - /// Session factory mapping configuration. - /// </summary> - public IList<MappingConfiguration> Mappings - { - get { return mappings; } - } - - private IList<ClassCacheConfiguration> classesCache= new List<ClassCacheConfiguration>(); - /// <summary> - /// Session factory class-cache configurations. - /// </summary> - public IList<ClassCacheConfiguration> ClassesCache - { - get { return classesCache; } - } - - private IList<CollectionCacheConfiguration> collectionsCache= new List<CollectionCacheConfiguration>(); - /// <summary> - /// Session factory collection-cache configurations. - /// </summary> - public IList<CollectionCacheConfiguration> CollectionsCache - { - get { return collectionsCache; } - } - - private IList<EventConfiguration> events= new List<EventConfiguration>(); - /// <summary> - /// Session factory event configurations. - /// </summary> - public IList<EventConfiguration> Events - { - get { return events; } - } - - private IList<ListenerConfiguration> listeners= new List<ListenerConfiguration>(); - /// <summary> - /// Session factory listener configurations. - /// </summary> - public IList<ListenerConfiguration> Listeners - { - get { return listeners; } - } - } } Added: trunk/nhibernate/src/NHibernate/Cfg/SessionFactoryConfigurationBase.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/SessionFactoryConfigurationBase.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/SessionFactoryConfigurationBase.cs 2009-06-24 03:57:43 UTC (rev 4523) @@ -0,0 +1,73 @@ +using System.Collections.Generic; +using NHibernate.Cfg.ConfigurationSchema; + +namespace NHibernate.Cfg +{ + public class SessionFactoryConfigurationBase : ISessionFactoryConfiguration + { + private string name = string.Empty; + private readonly IDictionary<string, string> properties = new Dictionary<string, string>(); + private readonly IList<MappingConfiguration> mappings = new List<MappingConfiguration>(); + private readonly IList<ClassCacheConfiguration> classesCache= new List<ClassCacheConfiguration>(); + private readonly IList<CollectionCacheConfiguration> collectionsCache= new List<CollectionCacheConfiguration>(); + private readonly IList<EventConfiguration> events= new List<EventConfiguration>(); + private readonly IList<ListenerConfiguration> listeners= new List<ListenerConfiguration>(); + + /// <summary> + /// The session factory name. + /// </summary> + public string Name + { + get { return name; } + protected set { name = value; } + } + + /// <summary> + /// Session factory propeties bag. + /// </summary> + public IDictionary<string,string> Properties + { + get { return properties; } + } + + /// <summary> + /// Session factory mapping configuration. + /// </summary> + public IList<MappingConfiguration> Mappings + { + get { return mappings; } + } + + /// <summary> + /// Session factory class-cache configurations. + /// </summary> + public IList<ClassCacheConfiguration> ClassesCache + { + get { return classesCache; } + } + + /// <summary> + /// Session factory collection-cache configurations. + /// </summary> + public IList<CollectionCacheConfiguration> CollectionsCache + { + get { return collectionsCache; } + } + + /// <summary> + /// Session factory event configurations. + /// </summary> + public IList<EventConfiguration> Events + { + get { return events; } + } + + /// <summary> + /// Session factory listener configurations. + /// </summary> + public IList<ListenerConfiguration> Listeners + { + get { return listeners; } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-23 23:23:33 UTC (rev 4522) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-24 03:57:43 UTC (rev 4523) @@ -459,6 +459,7 @@ <Compile Include="Bytecode\ProxyFactoryFactoryNotConfiguredException.cs" /> <Compile Include="Bytecode\UnableToLoadProxyFactoryFactoryException.cs" /> <Compile Include="Cache\FakeCache.cs" /> + <Compile Include="Cfg\SessionFactoryConfigurationBase.cs" /> <Compile Include="Cfg\ISessionFactoryConfiguration.cs" /> <Compile Include="Cfg\MappingSchema\AbstractDecoratable.cs" /> <Compile Include="Cfg\MappingSchema\HbmTimestamp.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-23 23:23:35
|
Revision: 4522 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4522&view=rev Author: fabiomaulo Date: 2009-06-23 23:23:33 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Refactoring in order to use minimal required interface Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-06-23 20:40:40 UTC (rev 4521) +++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-06-23 23:23:33 UTC (rev 4522) @@ -1229,9 +1229,9 @@ return PropertiesHelper.GetString(name, properties, null); } - private void AddProperties(IHibernateConfiguration hc) + private void AddProperties(ISessionFactoryConfiguration factoryConfiguration) { - foreach (var kvp in hc.SessionFactory.Properties) + foreach (var kvp in factoryConfiguration.Properties) { if (log.IsDebugEnabled) { @@ -1262,7 +1262,7 @@ var hc = ConfigurationManager.GetSection(CfgXmlHelper.CfgSectionName) as IHibernateConfiguration; if (hc != null && hc.SessionFactory != null) { - return DoConfigure(hc); + return DoConfigure(hc.SessionFactory); } else { @@ -1368,7 +1368,7 @@ try { IHibernateConfiguration hc = new HibernateConfiguration(textReader); - return DoConfigure(hc); + return DoConfigure(hc.SessionFactory); } catch (Exception e) { @@ -1379,17 +1379,17 @@ // Not ported - configure(org.w3c.dom.Document) - protected Configuration DoConfigure(IHibernateConfiguration hc) + protected Configuration DoConfigure(ISessionFactoryConfiguration factoryConfiguration) { - if (!string.IsNullOrEmpty(hc.SessionFactory.Name)) + if (!string.IsNullOrEmpty(factoryConfiguration.Name)) { - properties[Environment.SessionFactoryName] = hc.SessionFactory.Name; + properties[Environment.SessionFactoryName] = factoryConfiguration.Name; } - AddProperties(hc); + AddProperties(factoryConfiguration); // Load mappings - foreach (var mc in hc.SessionFactory.Mappings) + foreach (var mc in factoryConfiguration.Mappings) { if (mc.IsEmpty()) { @@ -1397,23 +1397,23 @@ } if (!string.IsNullOrEmpty(mc.Resource) && !string.IsNullOrEmpty(mc.Assembly)) { - log.Debug(hc.SessionFactory.Name + "<-" + mc.Resource + " in " + mc.Assembly); + log.Debug(factoryConfiguration.Name + "<-" + mc.Resource + " in " + mc.Assembly); AddResource(mc.Resource, Assembly.Load(mc.Assembly)); } else if (!string.IsNullOrEmpty(mc.Assembly)) { - log.Debug(hc.SessionFactory.Name + "<-" + mc.Assembly); + log.Debug(factoryConfiguration.Name + "<-" + mc.Assembly); AddAssembly(mc.Assembly); } else if (!string.IsNullOrEmpty(mc.File)) { - log.Debug(hc.SessionFactory.Name + "<-" + mc.File); + log.Debug(factoryConfiguration.Name + "<-" + mc.File); AddFile(mc.File); } } // Load class-cache - foreach (var ccc in hc.SessionFactory.ClassesCache) + foreach (var ccc in factoryConfiguration.ClassesCache) { string region = string.IsNullOrEmpty(ccc.Region) ? ccc.Class : ccc.Region; bool includeLazy = (ccc.Include != ClassCacheInclude.NonLazy); @@ -1421,7 +1421,7 @@ } // Load collection-cache - foreach (var ccc in hc.SessionFactory.CollectionsCache) + foreach (var ccc in factoryConfiguration.CollectionsCache) { string role = ccc.Collection; NHibernate.Mapping.Collection collection = GetCollectionMapping(role); @@ -1436,7 +1436,7 @@ } // Events - foreach (var ec in hc.SessionFactory.Events) + foreach (var ec in factoryConfiguration.Events) { var listenerClasses = new string[ec.Listeners.Count]; for (int i = 0; i < ec.Listeners.Count; i++) @@ -1447,15 +1447,15 @@ SetListeners(ec.Type, listenerClasses); } // Listeners - foreach (var lc in hc.SessionFactory.Listeners) + foreach (var lc in factoryConfiguration.Listeners) { log.Debug("Event listener: " + lc.Type + "=" + lc.Class); SetListeners(lc.Type, new[] {lc.Class}); } - if (!string.IsNullOrEmpty(hc.SessionFactory.Name)) + if (!string.IsNullOrEmpty(factoryConfiguration.Name)) { - log.Info("Configured SessionFactory: " + hc.SessionFactory.Name); + log.Info("Configured SessionFactory: " + factoryConfiguration.Name); } log.Debug("properties: " + properties); Modified: trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs 2009-06-23 20:40:40 UTC (rev 4521) +++ trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs 2009-06-23 23:23:33 UTC (rev 4522) @@ -3,7 +3,8 @@ namespace NHibernate.Cfg { - public interface ISessionFactoryConfiguration { + public interface ISessionFactoryConfiguration + { /// <summary> /// The session factory name. /// </summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ric...@us...> - 2009-06-23 20:40:42
|
Revision: 4521 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4521&view=rev Author: RicBrown Date: 2009-06-23 20:40:40 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Added integration test to check lambda expressions through to the DB and back. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml Added: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-06-23 20:40:40 UTC (rev 4521) @@ -0,0 +1,71 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +using NUnit.Framework; + +using NHibernate.Criterion; +using NHibernate.Transform; +using NHibernate.Type; +using NHibernate.Util; + +namespace NHibernate.Test.Criteria.Lambda +{ + + [TestFixture] + public class IntegrationFixture : TestCase + { + + protected override string MappingsAssembly { get { return "NHibernate.Test"; } } + + protected override IList Mappings + { + get + { + return new string[] + { + "Criteria.Lambda.Mappings.hbm.xml", + }; + } + } + + protected override void OnTearDown() + { + base.OnTearDown(); + + using (ISession s = OpenSession()) + using (ITransaction t = s.BeginTransaction()) + { + s.CreateQuery("delete from Person").ExecuteUpdate(); + s.CreateQuery("delete from Child").ExecuteUpdate(); + t.Commit(); + } + } + + [Test] + public void ICriteria_SimpleCriterion() + { + using (ISession s = OpenSession()) + using (ITransaction t = s.BeginTransaction()) + { + s.Save(new Person() { Name = "test person 1" }); + s.Save(new Person() { Name = "test person 2" }); + s.Save(new Person() { Name = "test person 3" }); + + t.Commit(); + } + + using (ISession s = OpenSession()) + { + IList<Person> actual = + s.CreateCriteria(typeof(Person)) + .Add<Person>(p => p.Name == "test person 2") + .List<Person>(); + + Assert.That(actual.Count, Is.EqualTo(1)); + } + } + + } + +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Mappings.hbm.xml 2009-06-23 20:40:40 UTC (rev 4521) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.Criteria.Lambda"> + + <class name="Person"> + <id name="Id"> + <generator class="native"/> + </id> + <property name="Name" /> + </class> + + <class name="Child"> + <id name="Id"> + <generator class="native"/> + </id> + </class> + +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2009-06-23 20:20:18 UTC (rev 4520) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2009-06-23 20:40:40 UTC (rev 4521) @@ -7,11 +7,13 @@ public class Person { - public string Name { get; set; } + public virtual int Id { get; set; } + public virtual string Name { get; set; } } public class Child { + public virtual int Id { get; set; } } } Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 20:20:18 UTC (rev 4520) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 20:40:40 UTC (rev 4521) @@ -145,6 +145,7 @@ <Compile Include="Criteria\Enrolment.cs" /> <Compile Include="Criteria\Lambda\CriteriaAssertFixture.cs" /> <Compile Include="Criteria\Lambda\CriteriaFixture.cs" /> + <Compile Include="Criteria\Lambda\IntegrationFixture.cs" /> <Compile Include="Criteria\Lambda\LambdaFixtureBase.cs" /> <Compile Include="Criteria\Lambda\Model.cs" /> <Compile Include="Criteria\MaterialResource.cs" /> @@ -1935,6 +1936,7 @@ <EmbeddedResource Include="Classic\EntityWithLifecycle.hbm.xml" /> <EmbeddedResource Include="Bytecode\Lightweight\ProductLine.hbm.xml" /> <EmbeddedResource Include="DriverTest\MultiTypeEntity.hbm.xml" /> + <EmbeddedResource Include="Criteria\Lambda\Mappings.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> <EmbeddedResource Include="NHSpecificTest\NH1850\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1192\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-23 20:20:19
|
Revision: 4520 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4520&view=rev Author: fabiomaulo Date: 2009-06-23 20:20:18 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Minor refactoring Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/HibernateConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs trunk/nhibernate/src/NHibernate/Cfg/IHibernateConfiguration.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/HibernateConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/HibernateConfiguration.cs 2009-06-23 20:09:53 UTC (rev 4519) +++ trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/HibernateConfiguration.cs 2009-06-23 20:20:18 UTC (rev 4520) @@ -153,7 +153,7 @@ /// The <see cref="SessionFactoryConfiguration"/> if the session-factory exists in hibernate-configuration; /// Otherwise null. /// </summary> - public SessionFactoryConfiguration SessionFactory + public ISessionFactoryConfiguration SessionFactory { get { return sessionFactory; } } Modified: trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs 2009-06-23 20:09:53 UTC (rev 4519) +++ trunk/nhibernate/src/NHibernate/Cfg/ConfigurationSchema/SessionFactoryConfiguration.cs 2009-06-23 20:20:18 UTC (rev 4520) @@ -7,7 +7,7 @@ /// <summary> /// Configuration parsed values for a session-factory XML node. /// </summary> - public class SessionFactoryConfiguration + public class SessionFactoryConfiguration : ISessionFactoryConfiguration { //private static readonly ILog log = LogManager.GetLogger(typeof(SessionFactoryConfiguration)); Modified: trunk/nhibernate/src/NHibernate/Cfg/IHibernateConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/IHibernateConfiguration.cs 2009-06-23 20:09:53 UTC (rev 4519) +++ trunk/nhibernate/src/NHibernate/Cfg/IHibernateConfiguration.cs 2009-06-23 20:20:18 UTC (rev 4520) @@ -1,5 +1,4 @@ -using System; -using NHibernate.Cfg.ConfigurationSchema; +using NHibernate.Cfg.ConfigurationSchema; namespace NHibernate.Cfg { @@ -7,6 +6,6 @@ { BytecodeProviderType ByteCodeProviderType { get; } bool UseReflectionOptimizer { get; } - SessionFactoryConfiguration SessionFactory { get; } + ISessionFactoryConfiguration SessionFactory { get; } } } Added: trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cfg/ISessionFactoryConfiguration.cs 2009-06-23 20:20:18 UTC (rev 4520) @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using NHibernate.Cfg.ConfigurationSchema; + +namespace NHibernate.Cfg +{ + public interface ISessionFactoryConfiguration { + /// <summary> + /// The session factory name. + /// </summary> + string Name { get; } + + /// <summary> + /// Session factory propeties bag. + /// </summary> + IDictionary<string, string> Properties { get; } + + /// <summary> + /// Session factory mapping configuration. + /// </summary> + IList<MappingConfiguration> Mappings { get; } + + /// <summary> + /// Session factory class-cache configurations. + /// </summary> + IList<ClassCacheConfiguration> ClassesCache { get; } + + /// <summary> + /// Session factory collection-cache configurations. + /// </summary> + IList<CollectionCacheConfiguration> CollectionsCache { get; } + + /// <summary> + /// Session factory event configurations. + /// </summary> + IList<EventConfiguration> Events { get; } + + /// <summary> + /// Session factory listener configurations. + /// </summary> + IList<ListenerConfiguration> Listeners { get; } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-23 20:09:53 UTC (rev 4519) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-06-23 20:20:18 UTC (rev 4520) @@ -459,6 +459,7 @@ <Compile Include="Bytecode\ProxyFactoryFactoryNotConfiguredException.cs" /> <Compile Include="Bytecode\UnableToLoadProxyFactoryFactoryException.cs" /> <Compile Include="Cache\FakeCache.cs" /> + <Compile Include="Cfg\ISessionFactoryConfiguration.cs" /> <Compile Include="Cfg\MappingSchema\AbstractDecoratable.cs" /> <Compile Include="Cfg\MappingSchema\HbmTimestamp.cs" /> <Compile Include="Cfg\MappingSchema\HbmVersion.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-06-23 20:09:54
|
Revision: 4519 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4519&view=rev Author: fabiomaulo Date: 2009-06-23 20:09:53 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Minor (only reformatted) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-06-23 17:51:48 UTC (rev 4518) +++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-06-23 20:09:53 UTC (rev 4519) @@ -83,80 +83,74 @@ #region ISerializable Members public Configuration(SerializationInfo info, StreamingContext context) { - this.Reset(); + Reset(); - this.EntityNotFoundDelegate = GetSerialedObject<IEntityNotFoundDelegate>(info, "entityNotFoundDelegate"); + EntityNotFoundDelegate = GetSerialedObject<IEntityNotFoundDelegate>(info, "entityNotFoundDelegate"); + auxiliaryDatabaseObjects = GetSerialedObject<IList<IAuxiliaryDatabaseObject>>(info, "auxiliaryDatabaseObjects"); + classes = GetSerialedObject<IDictionary<string, PersistentClass>>(info, "classes"); + collections = GetSerialedObject<IDictionary<string, NHibernate.Mapping.Collection>>(info, "collections"); - this.auxiliaryDatabaseObjects = GetSerialedObject<IList<IAuxiliaryDatabaseObject>>(info, "auxiliaryDatabaseObjects"); - this.classes = GetSerialedObject<IDictionary<string, PersistentClass>>(info, "classes"); - this.collections = GetSerialedObject<IDictionary<string, NHibernate.Mapping.Collection>>(info, "collections"); - - this.columnNameBindingPerTable = GetSerialedObject<IDictionary<Table, Mappings.ColumnNames>>(info, - "columnNameBindingPerTable"); - this.defaultAssembly = GetSerialedObject<string>(info, "defaultAssembly"); - this.defaultNamespace = GetSerialedObject<string>(info, "defaultNamespace"); - this.eventListeners = GetSerialedObject<EventListeners>(info, "eventListeners"); + columnNameBindingPerTable = GetSerialedObject<IDictionary<Table, Mappings.ColumnNames>>(info, + "columnNameBindingPerTable"); + defaultAssembly = GetSerialedObject<string>(info, "defaultAssembly"); + defaultNamespace = GetSerialedObject<string>(info, "defaultNamespace"); + eventListeners = GetSerialedObject<EventListeners>(info, "eventListeners"); //this.extendsQueue = GetSerialedObject<ISet<ExtendsQueueEntry>>(info, "extendsQueue"); - this.FilterDefinitions = GetSerialedObject<IDictionary<string, FilterDefinition>>(info, "filterDefinitions"); - this.Imports = GetSerialedObject<IDictionary<string, string>>(info, "imports"); - this.interceptor = GetSerialedObject<IInterceptor>(info, "interceptor"); - this.mapping = GetSerialedObject<IMapping>(info, "mapping"); - this.NamedQueries = GetSerialedObject<IDictionary<string, NamedQueryDefinition>>(info, "namedQueries"); - this.NamedSQLQueries = GetSerialedObject<IDictionary<string, NamedSQLQueryDefinition>>(info, "namedSqlQueries"); - this.namingStrategy = GetSerialedObject<INamingStrategy>(info, "namingStrategy"); - this.properties = GetSerialedObject<IDictionary<string, string>>(info, "properties"); - this.propertyReferences = GetSerialedObject<IList<Mappings.PropertyReference>>(info, "propertyReferences"); - this.settingsFactory = GetSerialedObject<SettingsFactory>(info, "settingsFactory"); - this.SqlFunctions = GetSerialedObject<IDictionary<string, ISQLFunction>>(info, "sqlFunctions"); - this.SqlResultSetMappings = GetSerialedObject<IDictionary<string, ResultSetMappingDefinition>>(info, "sqlResultSetMappings"); - this.tableNameBinding = GetSerialedObject<IDictionary<string, Mappings.TableDescription>>(info, "tableNameBinding"); - this.tables = GetSerialedObject<IDictionary<string, Table>>(info, "tables"); - this.typeDefs = GetSerialedObject<IDictionary<string, TypeDef>>(info, "typeDefs"); - - - - - - + FilterDefinitions = GetSerialedObject<IDictionary<string, FilterDefinition>>(info, "filterDefinitions"); + Imports = GetSerialedObject<IDictionary<string, string>>(info, "imports"); + interceptor = GetSerialedObject<IInterceptor>(info, "interceptor"); + mapping = GetSerialedObject<IMapping>(info, "mapping"); + NamedQueries = GetSerialedObject<IDictionary<string, NamedQueryDefinition>>(info, "namedQueries"); + NamedSQLQueries = GetSerialedObject<IDictionary<string, NamedSQLQueryDefinition>>(info, "namedSqlQueries"); + namingStrategy = GetSerialedObject<INamingStrategy>(info, "namingStrategy"); + properties = GetSerialedObject<IDictionary<string, string>>(info, "properties"); + propertyReferences = GetSerialedObject<IList<Mappings.PropertyReference>>(info, "propertyReferences"); + settingsFactory = GetSerialedObject<SettingsFactory>(info, "settingsFactory"); + SqlFunctions = GetSerialedObject<IDictionary<string, ISQLFunction>>(info, "sqlFunctions"); + SqlResultSetMappings = GetSerialedObject<IDictionary<string, ResultSetMappingDefinition>>(info, + "sqlResultSetMappings"); + tableNameBinding = GetSerialedObject<IDictionary<string, Mappings.TableDescription>>(info, "tableNameBinding"); + tables = GetSerialedObject<IDictionary<string, Table>>(info, "tables"); + typeDefs = GetSerialedObject<IDictionary<string, TypeDef>>(info, "typeDefs"); } + private T GetSerialedObject<T>(SerializationInfo info, string name) { return (T)info.GetValue(name, typeof(T)); } + public void GetObjectData(SerializationInfo info, StreamingContext context) { ConfigureProxyFactoryFactory(); SecondPassCompile(); Validate(); - - - info.AddValue("entityNotFoundDelegate", this.EntityNotFoundDelegate); + info.AddValue("entityNotFoundDelegate", EntityNotFoundDelegate); - info.AddValue("auxiliaryDatabaseObjects", this.auxiliaryDatabaseObjects); - info.AddValue("classes", this.classes); - info.AddValue("collections", this.collections); - info.AddValue("columnNameBindingPerTable", this.columnNameBindingPerTable); - info.AddValue("defaultAssembly", this.defaultAssembly); - info.AddValue("defaultNamespace", this.defaultNamespace); - info.AddValue("eventListeners", this.eventListeners); + info.AddValue("auxiliaryDatabaseObjects", auxiliaryDatabaseObjects); + info.AddValue("classes", classes); + info.AddValue("collections", collections); + info.AddValue("columnNameBindingPerTable", columnNameBindingPerTable); + info.AddValue("defaultAssembly", defaultAssembly); + info.AddValue("defaultNamespace", defaultNamespace); + info.AddValue("eventListeners", eventListeners); //info.AddValue("extendsQueue", this.extendsQueue); - info.AddValue("filterDefinitions", this.FilterDefinitions); - info.AddValue("imports", this.Imports); - info.AddValue("interceptor", this.interceptor); - info.AddValue("mapping", this.mapping); - info.AddValue("namedQueries", this.NamedQueries); - info.AddValue("namedSqlQueries", this.NamedSQLQueries); - info.AddValue("namingStrategy", this.namingStrategy); - info.AddValue("properties", this.properties); - info.AddValue("propertyReferences", this.propertyReferences); - info.AddValue("settingsFactory", this.settingsFactory); - info.AddValue("sqlFunctions", this.SqlFunctions); - info.AddValue("sqlResultSetMappings", this.SqlResultSetMappings); - info.AddValue("tableNameBinding", this.tableNameBinding); - info.AddValue("tables", this.tables); - info.AddValue("typeDefs", this.typeDefs); + info.AddValue("filterDefinitions", FilterDefinitions); + info.AddValue("imports", Imports); + info.AddValue("interceptor", interceptor); + info.AddValue("mapping", mapping); + info.AddValue("namedQueries", NamedQueries); + info.AddValue("namedSqlQueries", NamedSQLQueries); + info.AddValue("namingStrategy", namingStrategy); + info.AddValue("properties", properties); + info.AddValue("propertyReferences", propertyReferences); + info.AddValue("settingsFactory", settingsFactory); + info.AddValue("sqlFunctions", SqlFunctions); + info.AddValue("sqlResultSetMappings", SqlResultSetMappings); + info.AddValue("tableNameBinding", tableNameBinding); + info.AddValue("tables", tables); + info.AddValue("typeDefs", typeDefs); } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Ladabouche <je...@ne...> - 2009-06-23 19:19:57
|
Worrkplace Seduction Stories - Hoow to Find Love and Lust in the Office www . shop94 . net |
From: <Ric...@us...> - 2009-06-23 17:51:49
|
Revision: 4518 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4518&view=rev Author: RicBrown Date: 2009-06-23 17:51:48 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Ported tests to check ICriteria comparison working OK. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaAssertFixture.cs Added: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaAssertFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaAssertFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaAssertFixture.cs 2009-06-23 17:51:48 UTC (rev 4518) @@ -0,0 +1,242 @@ + +using System; + +using NUnit.Framework; + +using NHibernate.Criterion; +using NHibernate.SqlCommand; + +namespace NHibernate.Test.Criteria.Lambda +{ + + [TestFixture] + public class CriteriaAssertFixture : LambdaFixtureBase + { + + private void AssertCriteriaAreNotEqual(ICriteria expected, ICriteria actual) + { + try + { + AssertCriteriaAreEqual(expected, actual); + } + catch + { + return; + } + Assert.Fail("No exception thrown"); + } + + private void AssertCriteriaAreNotEqual(DetachedCriteria expected, DetachedCriteria actual) + { + try + { + AssertCriteriaAreEqual(expected, actual); + } + catch + { + return; + } + Assert.Fail("No exception thrown"); + } + + [Test] + public void DifferentTypes() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>(); + + DetachedCriteria actual = + DetachedCriteria.For<Child>(); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentAliases() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>("personAlias1"); + + DetachedCriteria actual = + DetachedCriteria.For<Person>("personAlias2"); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentOperators() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .Add(Expression.Eq("Property", "Value")); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .Add(Expression.Gt("Property", "Value")); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentPaths() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .Add(Expression.Eq("a.b.Property1", "Value")); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .Add(Expression.Eq("a.b.Property2", "Value")); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentValues() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .Add(Expression.Eq("Property", "Value1")); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .Add(Expression.Eq("Property", "Value2")); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentNestedCriterion() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .Add(Expression.Not(Expression.Eq("Property", "Value"))); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .Add(Expression.Not(Expression.Gt("Property", "Value"))); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentOrder() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .AddOrder(Order.Asc("name")); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .AddOrder(Order.Desc("name")); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentSubCriteria() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .CreateCriteria("Child") + .Add(Expression.Eq("Name", "test")); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .CreateCriteria("Child") + .Add(Expression.Gt("Name", "test")); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentJoinType() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .CreateCriteria("Child", JoinType.InnerJoin); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .CreateCriteria("Child", JoinType.LeftOuterJoin); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentFetchMode() + { + DetachedCriteria expected = + DetachedCriteria.For<Person>() + .SetFetchMode("Father", FetchMode.Eager); + + DetachedCriteria actual = + DetachedCriteria.For<Person>() + .SetFetchMode("Father", FetchMode.Lazy); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentLockMode() + { + ICriteria expected = + CreateTestCriteria(typeof(Person)) + .CreateAlias("Father", "fatherAlias") + .SetLockMode("fatherAlias", LockMode.Upgrade); + + ICriteria actual = + CreateTestCriteria(typeof(Person)) + .CreateAlias("Father", "fatherAlias") + .SetLockMode("fatherAlias", LockMode.Force); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentProjections() + { + ICriteria expected = + CreateTestCriteria(typeof(Person)) + .SetProjection(Projections.Avg("Age")); + + ICriteria actual = + CreateTestCriteria(typeof(Person)) + .SetProjection(Projections.Max("Age")); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentPropertyName() + { + ICriteria expected = + CreateTestCriteria(typeof(Person)) + .CreateAlias("Father", "fatherAlias") + .Add(Expression.GtProperty("Age1", "fatherAlias.Age")); + + ICriteria actual = + CreateTestCriteria(typeof(Person)) + .CreateAlias("Father", "fatherAlias") + .Add(Expression.GtProperty("Age2", "fatherAlias.Age")); + + AssertCriteriaAreNotEqual(expected, actual); + } + + [Test] + public void DifferentSubquery() + { + ICriteria expected = + CreateTestCriteria(typeof(Person)) + .Add(Subqueries.PropertyIn("Name", DetachedCriteria.For<Person>().Add(Expression.Eq("Name", "subquery test")))); + + ICriteria actual = + CreateTestCriteria(typeof(Person)) + .Add(Subqueries.PropertyIn("Name", DetachedCriteria.For<Person>().Add(Expression.Eq("Name", "subqueryx test")))); + + AssertCriteriaAreNotEqual(expected, actual); + } + + } + +} Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2009-06-23 17:33:55 UTC (rev 4517) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2009-06-23 17:51:48 UTC (rev 4518) @@ -10,5 +10,9 @@ public string Name { get; set; } } + public class Child + { + } + } Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 17:33:55 UTC (rev 4517) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 17:51:48 UTC (rev 4518) @@ -143,6 +143,7 @@ <Compile Include="Criteria\CriteriaQueryTest.cs" /> <Compile Include="Criteria\DetachedCriteriaSerializable.cs" /> <Compile Include="Criteria\Enrolment.cs" /> + <Compile Include="Criteria\Lambda\CriteriaAssertFixture.cs" /> <Compile Include="Criteria\Lambda\CriteriaFixture.cs" /> <Compile Include="Criteria\Lambda\LambdaFixtureBase.cs" /> <Compile Include="Criteria\Lambda\Model.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ric...@us...> - 2009-06-23 17:33:56
|
Revision: 4517 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4517&view=rev Author: RicBrown Date: 2009-06-23 17:33:55 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Replaced session stub with methods in fixture base. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/SessionStub.cs Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaFixture.cs 2009-06-23 17:25:23 UTC (rev 4516) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/CriteriaFixture.cs 2009-06-23 17:33:55 UTC (rev 4517) @@ -18,12 +18,12 @@ [Test] public void Equality() { - ICriteria expected = CreateSession() - .CreateCriteria(typeof(Person)) + ICriteria expected = + CreateTestCriteria(typeof(Person)) .Add(Restrictions.Eq("Name", "test name")); - ICriteria actual = CreateSession() - .CreateCriteria(typeof(Person)) + ICriteria actual = + CreateTestCriteria(typeof(Person)) .Add<Person>(p => p.Name == "test name"); AssertCriteriaAreEqual(expected, actual); Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs 2009-06-23 17:25:23 UTC (rev 4516) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs 2009-06-23 17:33:55 UTC (rev 4517) @@ -19,11 +19,16 @@ private Hashtable _visitedObjects = new Hashtable(); private Stack<string> _fieldPath = new Stack<string>(); - protected ISession CreateSession() + protected ICriteria CreateTestCriteria(System.Type persistentClass) { - return new SessionStub(); + return new CriteriaImpl(persistentClass, null); } + protected ICriteria CreateTestCriteria(System.Type persistentClass, string alias) + { + return new CriteriaImpl(persistentClass, alias, null); + } + private void AssertDictionariesAreEqual(IDictionary expected, IDictionary actual) { Assert.AreEqual(expected.Keys.Count, actual.Keys.Count, _fieldPath.Peek() + ".Count"); Deleted: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/SessionStub.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/SessionStub.cs 2009-06-23 17:25:23 UTC (rev 4516) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/SessionStub.cs 2009-06-23 17:33:55 UTC (rev 4517) @@ -1,489 +0,0 @@ - -using System; -using System.Collections.Generic; - -using NHibernate.Impl; - -namespace NHibernate.Test.Criteria.Lambda -{ - - public class SessionStub : ISession - { - - ICriteria ISession.CreateCriteria(System.Type persistentClass) - { - return new CriteriaImpl(persistentClass, null); - } - - ICriteria ISession.CreateCriteria(System.Type persistentClass, string alias) - { - return new CriteriaImpl(persistentClass, alias, null); - } - - #region non stubbed methods - - EntityMode ISession.ActiveEntityMode - { - get { throw new NotImplementedException(); } - } - - void ISession.Flush() - { - throw new NotImplementedException(); - } - - FlushMode ISession.FlushMode - { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } - } - - CacheMode ISession.CacheMode - { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } - } - - ISessionFactory ISession.SessionFactory - { - get { throw new NotImplementedException(); } - } - - System.Data.IDbConnection ISession.Connection - { - get { throw new NotImplementedException(); } - } - - System.Data.IDbConnection ISession.Disconnect() - { - throw new NotImplementedException(); - } - - void ISession.Reconnect() - { - throw new NotImplementedException(); - } - - void ISession.Reconnect(System.Data.IDbConnection connection) - { - throw new NotImplementedException(); - } - - System.Data.IDbConnection ISession.Close() - { - throw new NotImplementedException(); - } - - void ISession.CancelQuery() - { - throw new NotImplementedException(); - } - - bool ISession.IsOpen - { - get { throw new NotImplementedException(); } - } - - bool ISession.IsConnected - { - get { throw new NotImplementedException(); } - } - - bool ISession.IsDirty() - { - throw new NotImplementedException(); - } - - object ISession.GetIdentifier(object obj) - { - throw new NotImplementedException(); - } - - bool ISession.Contains(object obj) - { - throw new NotImplementedException(); - } - - void ISession.Evict(object obj) - { - throw new NotImplementedException(); - } - - object ISession.Load(System.Type theType, object id, LockMode lockMode) - { - throw new NotImplementedException(); - } - - object ISession.Load(string entityName, object id, LockMode lockMode) - { - throw new NotImplementedException(); - } - - object ISession.Load(System.Type theType, object id) - { - throw new NotImplementedException(); - } - - T ISession.Load<T>(object id, LockMode lockMode) - { - throw new NotImplementedException(); - } - - T ISession.Load<T>(object id) - { - throw new NotImplementedException(); - } - - object ISession.Load(string entityName, object id) - { - throw new NotImplementedException(); - } - - void ISession.Load(object obj, object id) - { - throw new NotImplementedException(); - } - - void ISession.Replicate(object obj, ReplicationMode replicationMode) - { - throw new NotImplementedException(); - } - - void ISession.Replicate(string entityName, object obj, ReplicationMode replicationMode) - { - throw new NotImplementedException(); - } - - object ISession.Save(object obj) - { - throw new NotImplementedException(); - } - - void ISession.Save(object obj, object id) - { - throw new NotImplementedException(); - } - - object ISession.Save(string entityName, object obj) - { - throw new NotImplementedException(); - } - - void ISession.SaveOrUpdate(object obj) - { - throw new NotImplementedException(); - } - - void ISession.SaveOrUpdate(string entityName, object obj) - { - throw new NotImplementedException(); - } - - void ISession.Update(object obj) - { - throw new NotImplementedException(); - } - - void ISession.Update(object obj, object id) - { - throw new NotImplementedException(); - } - - void ISession.Update(string entityName, object obj) - { - throw new NotImplementedException(); - } - - object ISession.Merge(object obj) - { - throw new NotImplementedException(); - } - - object ISession.Merge(string entityName, object obj) - { - throw new NotImplementedException(); - } - - void ISession.Persist(object obj) - { - throw new NotImplementedException(); - } - - void ISession.Persist(string entityName, object obj) - { - throw new NotImplementedException(); - } - - object ISession.SaveOrUpdateCopy(object obj) - { - throw new NotImplementedException(); - } - - object ISession.SaveOrUpdateCopy(object obj, object id) - { - throw new NotImplementedException(); - } - - void ISession.Delete(object obj) - { - throw new NotImplementedException(); - } - - void ISession.Delete(string entityName, object obj) - { - throw new NotImplementedException(); - } - - System.Collections.IList ISession.Find(string query) - { - throw new NotImplementedException(); - } - - System.Collections.IList ISession.Find(string query, object value, NHibernate.Type.IType type) - { - throw new NotImplementedException(); - } - - System.Collections.IList ISession.Find(string query, object[] values, NHibernate.Type.IType[] types) - { - throw new NotImplementedException(); - } - - System.Collections.IEnumerable ISession.Enumerable(string query) - { - throw new NotImplementedException(); - } - - System.Collections.IEnumerable ISession.Enumerable(string query, object value, NHibernate.Type.IType type) - { - throw new NotImplementedException(); - } - - System.Collections.IEnumerable ISession.Enumerable(string query, object[] values, NHibernate.Type.IType[] types) - { - throw new NotImplementedException(); - } - - System.Collections.ICollection ISession.Filter(object collection, string filter) - { - throw new NotImplementedException(); - } - - System.Collections.ICollection ISession.Filter(object collection, string filter, object value, NHibernate.Type.IType type) - { - throw new NotImplementedException(); - } - - System.Collections.ICollection ISession.Filter(object collection, string filter, object[] values, NHibernate.Type.IType[] types) - { - throw new NotImplementedException(); - } - - int ISession.Delete(string query) - { - throw new NotImplementedException(); - } - - int ISession.Delete(string query, object value, NHibernate.Type.IType type) - { - throw new NotImplementedException(); - } - - int ISession.Delete(string query, object[] values, NHibernate.Type.IType[] types) - { - throw new NotImplementedException(); - } - - void ISession.Lock(object obj, LockMode lockMode) - { - throw new NotImplementedException(); - } - - void ISession.Lock(string entityName, object obj, LockMode lockMode) - { - throw new NotImplementedException(); - } - - void ISession.Refresh(object obj) - { - throw new NotImplementedException(); - } - - void ISession.Refresh(object obj, LockMode lockMode) - { - throw new NotImplementedException(); - } - - LockMode ISession.GetCurrentLockMode(object obj) - { - throw new NotImplementedException(); - } - - ITransaction ISession.BeginTransaction() - { - throw new NotImplementedException(); - } - - ITransaction ISession.BeginTransaction(System.Data.IsolationLevel isolationLevel) - { - throw new NotImplementedException(); - } - - ITransaction ISession.Transaction - { - get { throw new NotImplementedException(); } - } - - ICriteria ISession.CreateCriteria<T>() - { - throw new NotImplementedException(); - } - - ICriteria ISession.CreateCriteria<T>(string alias) - { - throw new NotImplementedException(); - } - - ICriteria ISession.CreateCriteria(string entityName) - { - throw new NotImplementedException(); - } - - ICriteria ISession.CreateCriteria(string entityName, string alias) - { - throw new NotImplementedException(); - } - - IQuery ISession.CreateQuery(string queryString) - { - throw new NotImplementedException(); - } - - IQuery ISession.CreateFilter(object collection, string queryString) - { - throw new NotImplementedException(); - } - - IQuery ISession.GetNamedQuery(string queryName) - { - throw new NotImplementedException(); - } - - IQuery ISession.CreateSQLQuery(string sql, string returnAlias, System.Type returnClass) - { - throw new NotImplementedException(); - } - - IQuery ISession.CreateSQLQuery(string sql, string[] returnAliases, System.Type[] returnClasses) - { - throw new NotImplementedException(); - } - - ISQLQuery ISession.CreateSQLQuery(string queryString) - { - throw new NotImplementedException(); - } - - void ISession.Clear() - { - throw new NotImplementedException(); - } - - object ISession.Get(System.Type clazz, object id) - { - throw new NotImplementedException(); - } - - object ISession.Get(System.Type clazz, object id, LockMode lockMode) - { - throw new NotImplementedException(); - } - - object ISession.Get(string entityName, object id) - { - throw new NotImplementedException(); - } - - T ISession.Get<T>(object id) - { - throw new NotImplementedException(); - } - - T ISession.Get<T>(object id, LockMode lockMode) - { - throw new NotImplementedException(); - } - - string ISession.GetEntityName(object obj) - { - throw new NotImplementedException(); - } - - IFilter ISession.EnableFilter(string filterName) - { - throw new NotImplementedException(); - } - - IFilter ISession.GetEnabledFilter(string filterName) - { - throw new NotImplementedException(); - } - - void ISession.DisableFilter(string filterName) - { - throw new NotImplementedException(); - } - - IMultiQuery ISession.CreateMultiQuery() - { - throw new NotImplementedException(); - } - - ISession ISession.SetBatchSize(int batchSize) - { - throw new NotImplementedException(); - } - - NHibernate.Engine.ISessionImplementor ISession.GetSessionImplementation() - { - throw new NotImplementedException(); - } - - IMultiCriteria ISession.CreateMultiCriteria() - { - throw new NotImplementedException(); - } - - NHibernate.Stat.ISessionStatistics ISession.Statistics - { - get { throw new NotImplementedException(); } - } - - ISession ISession.GetSession(EntityMode entityMode) - { - throw new NotImplementedException(); - } - - void IDisposable.Dispose() - { - throw new NotImplementedException(); - } - - #endregion - - } - -} - Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 17:25:23 UTC (rev 4516) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 17:33:55 UTC (rev 4517) @@ -146,7 +146,6 @@ <Compile Include="Criteria\Lambda\CriteriaFixture.cs" /> <Compile Include="Criteria\Lambda\LambdaFixtureBase.cs" /> <Compile Include="Criteria\Lambda\Model.cs" /> - <Compile Include="Criteria\Lambda\SessionStub.cs" /> <Compile Include="Criteria\MaterialResource.cs" /> <Compile Include="Criteria\ProjectionsTest.cs" /> <Compile Include="Criteria\Reptile.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ric...@us...> - 2009-06-23 17:25:25
|
Revision: 4516 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4516&view=rev Author: RicBrown Date: 2009-06-23 17:25:23 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Removed reference to Rhino.Mocks. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/SessionStub.cs Removed Paths: ------------- trunk/nhibernate/lib/net/3.5/Rhino.Mocks.acknowledgements.txt trunk/nhibernate/lib/net/3.5/Rhino.Mocks.dll trunk/nhibernate/lib/net/3.5/Rhino.Mocks.license.txt trunk/nhibernate/lib/net/3.5/Rhino.Mocks.xml Deleted: trunk/nhibernate/lib/net/3.5/Rhino.Mocks.acknowledgements.txt =================================================================== --- trunk/nhibernate/lib/net/3.5/Rhino.Mocks.acknowledgements.txt 2009-06-23 11:20:23 UTC (rev 4515) +++ trunk/nhibernate/lib/net/3.5/Rhino.Mocks.acknowledgements.txt 2009-06-23 17:25:23 UTC (rev 4516) @@ -1,2 +0,0 @@ -Rhino Mocks is using Castle Dynamic Proxy (http://www.castleproject.org/dynamicproxy/index.html) to handle proxying the types it needs to mock. -The Dynamic Proxy project has been invaluable resource and made creating Rhino Mocks possible. \ No newline at end of file Deleted: trunk/nhibernate/lib/net/3.5/Rhino.Mocks.dll =================================================================== (Binary files differ) Deleted: trunk/nhibernate/lib/net/3.5/Rhino.Mocks.license.txt =================================================================== --- trunk/nhibernate/lib/net/3.5/Rhino.Mocks.license.txt 2009-06-23 11:20:23 UTC (rev 4515) +++ trunk/nhibernate/lib/net/3.5/Rhino.Mocks.license.txt 2009-06-23 17:25:23 UTC (rev 4516) @@ -1,25 +0,0 @@ -Copyright (c) 2005 - 2008 Ayende Rahien (ay...@ay...) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Ayende Rahien nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file Deleted: trunk/nhibernate/lib/net/3.5/Rhino.Mocks.xml =================================================================== --- trunk/nhibernate/lib/net/3.5/Rhino.Mocks.xml 2009-06-23 11:20:23 UTC (rev 4515) +++ trunk/nhibernate/lib/net/3.5/Rhino.Mocks.xml 2009-06-23 17:25:23 UTC (rev 4516) @@ -1,5206 +0,0 @@ -<?xml version="1.0"?> -<doc> - <assembly> - <name>Rhino.Mocks.Partial</name> - </assembly> - <members> - <member name="T:Rhino.Mocks.Constraints.AbstractConstraint"> - <summary> - Interface for constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_BitwiseAnd(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - And operator for constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_LogicalNot(Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Not operator for constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_BitwiseOr(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Or operator for constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_False(Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Allow overriding of || or && - </summary> - <param name="c"></param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_True(Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Allow overriding of || or && - </summary> - <param name="c"></param> - <returns></returns> - </member> - <member name="P:Rhino.Mocks.Constraints.AbstractConstraint.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.#ctor(System.Object)"> - <summary> - Initializes a new constraint object. - </summary> - <param name="expected">The expected object, The actual object is passed in as a parameter to the <see cref="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.Eval(System.Object)"/> method</param> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.Eval(System.Object)"> - <summary> - Evaluate this constraint. - </summary> - <param name="obj">The actual object that was passed in the method call to the mock.</param> - <returns>True when the constraint is met, else false.</returns> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.CheckReferenceType(System.Object,System.Object)"> - <summary> - Checks if the properties of the <paramref name="actual"/> object - are the same as the properies of the <paramref name="expected"/> object. - </summary> - <param name="expected">The expected object</param> - <param name="actual">The actual object</param> - <returns>True when both objects have the same values, else False.</returns> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.CheckValue(System.Object,System.Object)"> - <summary> - - </summary> - <param name="expected"></param> - <param name="actual"></param> - <returns></returns> - <remarks>This is the real heart of the beast.</remarks> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.CheckProperties(System.Object,System.Object)"> - <summary> - Used by CheckReferenceType to check all properties of the reference type. - </summary> - <param name="expected">The expected object</param> - <param name="actual">The actual object</param> - <returns>True when both objects have the same values, else False.</returns> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.CheckFields(System.Object,System.Object)"> - <summary> - Used by CheckReferenceType to check all fields of the reference type. - </summary> - <param name="expected">The expected object</param> - <param name="actual">The actual object</param> - <returns>True when both objects have the same values, else False.</returns> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.CheckCollection(System.Collections.IEnumerable,System.Collections.IEnumerable)"> - <summary> - Checks the items of both collections - </summary> - <param name="expectedCollection">The expected collection</param> - <param name="actualCollection"></param> - <returns>True if both collections contain the same items in the same order.</returns> - </member> - <member name="M:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.BuildPropertyName"> - <summary> - Builds a propertyname from the Stack _properties like 'Order.Product.Price' - to be used in the error message. - </summary> - <returns>A nested property name.</returns> - </member> - <member name="P:Rhino.Mocks.Constraints.AllPropertiesMatchConstraint.Message"> - <summary> - Rhino.Mocks uses this property to generate an error message. - </summary> - <value> - A message telling the tester why the constraint failed. - </value> - </member> - <member name="T:Rhino.Mocks.Constraints.PublicFieldIs"> - <summary> - Constrain that the public field has a specified value - </summary> - </member> - <member name="T:Rhino.Mocks.Constraints.PublicFieldConstraint"> - <summary> - Constrain that the public field matches another constraint. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicFieldConstraint.#ctor(System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PublicFieldConstraint"/> instance. - </summary> - <param name="publicFieldName">Name of the public field.</param> - <param name="constraint">Constraint to place on the public field value.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicFieldConstraint.#ctor(System.Type,System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PublicFieldConstraint"/> instance, specifying a disambiguating - <paramref name="declaringType"/> for the public field. - </summary> - <param name="declaringType">The type that declares the public field, used to disambiguate between public fields.</param> - <param name="publicFieldName">Name of the public field.</param> - <param name="constraint">Constraint to place on the public field value.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicFieldConstraint.Eval(System.Object)"> - <summary> - Determines if the object passes the constraint. - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.PublicFieldConstraint.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicFieldIs.#ctor(System.String,System.Object)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PublicFieldIs"/> instance. - </summary> - <param name="publicFieldName">Name of the public field.</param> - <param name="expectedValue">Expected value.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicFieldIs.#ctor(System.Type,System.String,System.Object)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PublicFieldIs"/> instance, specifying a disambiguating - <paramref name="declaringType"/> for the public field. - </summary> - <param name="declaringType">The type that declares the public field, used to disambiguate between public fields.</param> - <param name="publicFieldName">Name of the public field.</param> - <param name="expectedValue">Expected value.</param> - </member> - <member name="T:Rhino.Mocks.Constraints.PropertyIs"> - <summary> - Constrain that the property has a specified value - </summary> - </member> - <member name="T:Rhino.Mocks.Constraints.PropertyConstraint"> - <summary> - Constrain that the property matches another constraint. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.PropertyConstraint.#ctor(System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyConstraint"/> instance. - </summary> - <param name="propertyName">Name of the property.</param> - <param name="constraint">Constraint to place on the property value.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PropertyConstraint.#ctor(System.Type,System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyConstraint"/> instance, specifying a disambiguating - <paramref name="declaringType"/> for the property. - </summary> - <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param> - <param name="propertyName">Name of the property.</param> - <param name="constraint">Constraint to place on the property value.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PropertyConstraint.Eval(System.Object)"> - <summary> - Determines if the object passes the constraint. - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.PropertyConstraint.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="M:Rhino.Mocks.Constraints.PropertyIs.#ctor(System.String,System.Object)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyIs"/> instance. - </summary> - <param name="propertyName">Name of the property.</param> - <param name="expectedValue">Expected value.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PropertyIs.#ctor(System.Type,System.String,System.Object)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyIs"/> instance, specifying a disambiguating - <paramref name="declaringType"/> for the property. - </summary> - <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param> - <param name="propertyName">Name of the property.</param> - <param name="expectedValue">Expected value.</param> - </member> - <member name="T:Rhino.Mocks.Constraints.TypeOf"> - <summary> - Constrain that the parameter must be of the specified type - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.TypeOf.#ctor(System.Type)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.TypeOf"/> instance. - </summary> - <param name="type">Type.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.TypeOf.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.TypeOf.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Same"> - <summary> - Constraint that determines whether an object is the same object as another. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Same.#ctor(System.Object)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.Equal"/> instance. - </summary> - <param name="obj">Obj.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Same.Eval(System.Object)"> - <summary> - Determines if the object passes the constraints. - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.Same.Message"> - <summary> - Gets the message for this constraint. - </summary> - </member> - <member name="T:Rhino.Mocks.Constraints.PredicateConstraint`1"> - <summary> - Evaluate a parameter using constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.PredicateConstraint`1.#ctor(System.Predicate{`0})"> - <summary> - Create new instance - </summary> - <param name="predicate"></param> - </member> - <member name="M:Rhino.Mocks.Constraints.PredicateConstraint`1.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.PredicateConstraint`1.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.CollectionEqual"> - <summary> - Constrain that the list contains the same items as the parameter list - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.CollectionEqual.#ctor(System.Collections.IEnumerable)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.CollectionEqual"/> instance. - </summary> - <param name="collection">In list.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.CollectionEqual.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.CollectionEqual.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.OneOf"> - <summary> - Constrain that the parameter is one of the items in the list - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.OneOf.#ctor(System.Collections.IEnumerable)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.OneOf"/> instance. - </summary> - <param name="collection">In list.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.OneOf.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.OneOf.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.IsIn"> - <summary> - Constrain that the object is inside the parameter list - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.IsIn.#ctor(System.Object)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.IsIn"/> instance. - </summary> - <param name="inList">In list.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsIn.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.IsIn.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.CollectionCount"> - <summary> - Applies another AbstractConstraint to the collection count. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.CollectionCount.#ctor(Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.CollectionCount"/> instance. - </summary> - <param name="constraint">The constraint that should be applied to the collection count.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.CollectionCount.Eval(System.Object)"> - <summary> - Determines if the parameter conforms to this constraint. - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.CollectionCount.Message"> - <summary> - Gets the message for this constraint. - </summary> - </member> - <member name="T:Rhino.Mocks.Constraints.ListElement"> - <summary> - Applies another AbstractConstraint to a specific list element. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.ListElement.#ctor(System.Int32,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.ListElement"/> instance. - </summary> - <param name="index">The zero-based index of the list element.</param> - <param name="constraint">The constraint that should be applied to the list element.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.ListElement.Eval(System.Object)"> - <summary> - Determines if the parameter conforms to this constraint. - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.ListElement.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.KeyedListElement`1"> - <summary> - Applies another AbstractConstraint to a specific generic keyed list element. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.KeyedListElement`1.#ctor(`0,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:KeyedListElement"/> instance. - </summary> - <param name="key">The key of the list element.</param> - <param name="constraint">The constraint that should be applied to the list element.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.KeyedListElement`1.Eval(System.Object)"> - <summary> - Determines if the parameter conforms to this constraint. - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.KeyedListElement`1.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.ContainsAll"> - <summary> - Constrains that all elements are in the parameter list - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.ContainsAll.#ctor(System.Collections.IEnumerable)"> - <summary> - Initializes a new instance of the <see cref="T:Rhino.Mocks.Constraints.ContainsAll"/> class. - </summary> - <param name="these">The these.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.ContainsAll.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - <param name="obj"></param> - <returns></returns> - </member> - <member name="P:Rhino.Mocks.Constraints.ContainsAll.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Or"> - <summary> - Combines two constraints, constraint pass if either is fine. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Or.#ctor(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.And"/> instance. - </summary> - <param name="c1">C1.</param> - <param name="c2">C2.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Or.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.Or.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Not"> - <summary> - Negate a constraint - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Not.#ctor(Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.And"/> instance. - </summary> - <param name="c1">C1.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Not.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.Not.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.And"> - <summary> - Combines two constraints - </summary> - <remarks></remarks> - </member> - <member name="M:Rhino.Mocks.Constraints.And.#ctor(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.And"/> instance. - </summary> - <param name="c1">C1.</param> - <param name="c2">C2.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.And.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.And.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Like"> - <summary> - Constrain the argument to validate according to regex pattern - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Like.#ctor(System.String)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.Like"/> instance. - </summary> - <param name="pattern">Pattern.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Like.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.Like.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Contains"> - <summary> - Constraint that evaluate whatever an argument contains the specified string. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Contains.#ctor(System.String)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.Contains"/> instance. - </summary> - <param name="innerString">Inner string.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Contains.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.Contains.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.EndsWith"> - <summary> - Constraint that evaluate whatever an argument ends with the specified string - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.EndsWith.#ctor(System.String)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.EndsWith"/> instance. - </summary> - <param name="end">End.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.EndsWith.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.EndsWith.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.StartsWith"> - <summary> - Constraint that evaluate whatever an argument start with the specified string - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.StartsWith.#ctor(System.String)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.StartsWith"/> instance. - </summary> - <param name="start">Start.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.StartsWith.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.StartsWith.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Equal"> - <summary> - Constraint that evaluate whatever an object equals another - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Equal.#ctor(System.Object)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.Equal"/> instance. - </summary> - <param name="obj">Obj.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Equal.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.Equal.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Anything"> - <summary> - Constraint that always returns true - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Anything.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.Anything.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.ComparingConstraint"> - <summary> - Constraint that evaluate whatever a comparable is greater than another - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.ComparingConstraint.#ctor(System.IComparable,System.Boolean,System.Boolean)"> - <summary> - Creates a new <see cref="T:Rhino.Mocks.Constraints.ComparingConstraint"/> instance. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.ComparingConstraint.Eval(System.Object)"> - <summary> - determains if the object pass the constraints - </summary> - </member> - <member name="P:Rhino.Mocks.Constraints.ComparingConstraint.Message"> - <summary> - Gets the message for this constraint - </summary> - <value></value> - </member> - <member name="T:Rhino.Mocks.Constraints.Is"> - <summary> - Central location for constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.GreaterThan(System.IComparable)"> - <summary> - Evaluate a greater than constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be greater than</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.LessThan(System.IComparable)"> - <summary> - Evaluate a less than constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be less than</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.LessThanOrEqual(System.IComparable)"> - <summary> - Evaluate a less than or equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be less than or equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.GreaterThanOrEqual(System.IComparable)"> - <summary> - Evaluate a greater than or equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be greater than or equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.Equal(System.Object)"> - <summary> - Evaluate an equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="obj">The object the parameter should equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.NotEqual(System.Object)"> - <summary> - Evaluate a not equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="obj">The object the parameter should not equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.Same(System.Object)"> - <summary> - Evaluate a same as constraint. - </summary> - <param name="obj">The object the parameter should the same as.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.NotSame(System.Object)"> - <summary> - Evaluate a not same as constraint. - </summary> - <param name="obj">The object the parameter should not be the same as.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.Anything"> - <summary> - A constraints that accept anything - </summary> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.Null"> - <summary> - A constraint that accept only nulls - </summary> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.NotNull"> - <summary> - A constraint that accept only non null values - </summary> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.TypeOf(System.Type)"> - <summary> - A constraint that accept only value of the specified type - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.TypeOf``1"> - <summary> - A constraint that accept only value of the specified type - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Is.Matching``1(System.Predicate{``0})"> - <summary> - Evaluate a parameter using a predicate - </summary> - <param name="predicate">The predicate to use</param> - </member> - <member name="T:Rhino.Mocks.Constraints.IsArg`1"> - <summary> - Provides access to the constraintes defined in the class <see cref="T:Rhino.Mocks.Constraints.Is"/> to be used in context - with the <see cref="T:Rhino.Mocks.Arg`1"/> syntax. - </summary> - <typeparam name="T">The type of the argument</typeparam> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.GreaterThan(System.IComparable)"> - <summary> - Evaluate a greater than constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be greater than</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.LessThan(System.IComparable)"> - <summary> - Evaluate a less than constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be less than</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.LessThanOrEqual(System.IComparable)"> - <summary> - Evaluate a less than or equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be less than or equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.GreaterThanOrEqual(System.IComparable)"> - <summary> - Evaluate a greater than or equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="objToCompare">The object the parameter should be greater than or equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.Equal(System.Object)"> - <summary> - Evaluate an equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="obj">The object the parameter should equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.NotEqual(System.Object)"> - <summary> - Evaluate a not equal constraint for <see cref="T:System.IComparable"/>. - </summary> - <param name="obj">The object the parameter should not equal to</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.Same(System.Object)"> - <summary> - Evaluate a same as constraint. - </summary> - <param name="obj">The object the parameter should the same as.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.NotSame(System.Object)"> - <summary> - Evaluate a not same as constraint. - </summary> - <param name="obj">The object the parameter should not be the same as.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.Equals(System.Object)"> - <summary> - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - </summary> - <param name="obj"></param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.IsArg`1.GetHashCode"> - <summary> - Serves as a hash function for a particular type. - </summary> - <returns> - A hash code for the current <see cref="T:System.Object"/>. - </returns> - </member> - <member name="P:Rhino.Mocks.Constraints.IsArg`1.Anything"> - <summary> - A constraints that accept anything - </summary> - <returns></returns> - </member> - <member name="P:Rhino.Mocks.Constraints.IsArg`1.Null"> - <summary> - A constraint that accept only nulls - </summary> - <returns></returns> - </member> - <member name="P:Rhino.Mocks.Constraints.IsArg`1.NotNull"> - <summary> - A constraint that accept only non null values - </summary> - <returns></returns> - </member> - <member name="P:Rhino.Mocks.Constraints.IsArg`1.TypeOf"> - <summary> - A constraint that accept only value of the specified type. - The check is performed on the type that has been defined - as the argument type. - </summary> - </member> - <member name="T:Rhino.Mocks.Constraints.List"> - <summary> - Central location for constraints about lists and collections - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.List.IsIn(System.Object)"> - <summary> - Determines whether the specified obj is in the paramter. - The parameter must be IEnumerable. - </summary> - <param name="obj">Obj.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.List.OneOf(System.Collections.IEnumerable)"> - <summary> - Determains whatever the parameter is in the collection. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.List.Equal(System.Collections.IEnumerable)"> - <summary> - Determains that the parameter collection is identical to the specified collection - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.List.Count(Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Determines that the parameter collection has the specified number of elements. - </summary> - <param name="constraint">The constraint that should be applied to the collection count.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.List.Element(System.Int32,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Determines that an element of the parameter collections conforms to another AbstractConstraint. - </summary> - <param name="index">The zero-based index of the list element.</param> - <param name="constraint">The constraint which should be applied to the list element.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.List.Element``1(``0,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Determines that an element of the parameter collections conforms to another AbstractConstraint. - </summary> - <param name="key">The key of the element.</param> - <param name="constraint">The constraint which should be applied to the element.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.List.ContainsAll(System.Collections.IEnumerable)"> - <summary> - Determines that all elements of the specified collection are in the the parameter collection - </summary> - <param name="collection">The collection to compare against</param> - <returns>The constraint which should be applied to the list parameter.</returns> - </member> - <member name="T:Rhino.Mocks.Constraints.ListArg`1"> - <summary> - Provides access to the constraintes defined in the class <see cref="T:Rhino.Mocks.Constraints.Text"/> to be used in context - with the <see cref="T:Rhino.Mocks.Arg`1"/> syntax. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.IsIn(System.Object)"> - <summary> - Determines whether the specified object is in the paramter. - The parameter must be IEnumerable. - </summary> - <param name="obj">Obj.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.OneOf(System.Collections.IEnumerable)"> - <summary> - Determains whatever the parameter is in the collection. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.Equal(System.Collections.IEnumerable)"> - <summary> - Determains that the parameter collection is identical to the specified collection - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.Count(Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Determines that the parameter collection has the specified number of elements. - </summary> - <param name="constraint">The constraint that should be applied to the collection count.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.Element(System.Int32,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Determines that an element of the parameter collections conforms to another AbstractConstraint. - </summary> - <param name="index">The zero-based index of the list element.</param> - <param name="constraint">The constraint which should be applied to the list element.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.ContainsAll(System.Collections.IEnumerable)"> - <summary> - Determines that all elements of the specified collection are in the the parameter collection - </summary> - <param name="collection">The collection to compare against</param> - <returns>The constraint which should be applied to the list parameter.</returns> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.Equals(System.Object)"> - <summary> - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - </summary> - <param name="obj"></param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.ListArg`1.GetHashCode"> - <summary> - Serves as a hash function for a particular type. - </summary> - <returns> - A hash code for the current <see cref="T:System.Object"/>. - </returns> - </member> - <member name="T:Rhino.Mocks.Constraints.OutRefArgDummy`1"> - <summary> - Provides a dummy field to pass as out or ref argument. - </summary> - <typeparam name="T"></typeparam> - </member> - <member name="F:Rhino.Mocks.Constraints.OutRefArgDummy`1.Dummy"> - <summary> - Dummy field to satisfy the compiler. Used for out and ref arguments. - </summary> - </member> - <member name="T:Rhino.Mocks.Constraints.Property"> - <summary> - Central location for constraints for object's properties - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.Value(System.String,System.Object)"> - <summary> - Constrains the parameter to have property with the specified value - </summary> - <param name="propertyName">Name of the property.</param> - <param name="expectedValue">Expected value.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.Value(System.Type,System.String,System.Object)"> - <summary> - Constrains the parameter to have property with the specified value. - </summary> - <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param> - <param name="propertyName">Name of the property.</param> - <param name="expectedValue">Expected value.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.ValueConstraint(System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Constrains the parameter to have a property satisfying a specified constraint. - </summary> - <param name="propertyName">Name of the property.</param> - <param name="propertyConstraint">Constraint for the property.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.ValueConstraint(System.Type,System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Constrains the parameter to have a property satisfying a specified constraint. - </summary> - <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param> - <param name="propertyName">Name of the property.</param> - <param name="propertyConstraint">Constraint for the property.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.IsNull(System.String)"> - <summary> - Determines whether the parameter has the specified property and that it is null. - </summary> - <param name="propertyName">Name of the property.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.IsNull(System.Type,System.String)"> - <summary> - Determines whether the parameter has the specified property and that it is null. - </summary> - <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param> - <param name="propertyName">Name of the property.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.IsNotNull(System.String)"> - <summary> - Determines whether the parameter has the specified property and that it is not null. - </summary> - <param name="propertyName">Name of the property.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.IsNotNull(System.Type,System.String)"> - <summary> - Determines whether the parameter has the specified property and that it is not null. - </summary> - <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param> - <param name="propertyName">Name of the property.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.Property.AllPropertiesMatch(System.Object)"> - <summary> - constraints the parameter to have the exact same property values as the expected object. - </summary> - <param name="expected">An object, of the same type as the parameter, whose properties are set with the expected values.</param> - <returns>An instance of the constraint that will do the actual check.</returns> - <remarks> - The parameter's public property values and public field values will be matched against the expected object's - public property values and public field values. The first mismatch will be reported and no further matching is done. - The matching is recursive for any property or field that has properties or fields of it's own. - Collections are supported through IEnumerable, which means the constraint will check if the actual and expected - collection contain the same values in the same order, where the values contained by the collection can have properties - and fields of their own that will be checked as well because of the recursive nature of this constraint. - </remarks> - </member> - <member name="T:Rhino.Mocks.Constraints.PublicField"> - <summary> - Central location for constraints for object's public fields - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.Value(System.String,System.Object)"> - <summary> - Constrains the parameter to have a public field with the specified value - </summary> - <param name="publicFieldName">Name of the public field.</param> - <param name="expectedValue">Expected value.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.Value(System.Type,System.String,System.Object)"> - <summary> - Constrains the parameter to have a public field with the specified value. - </summary> - <param name="declaringType">The type that declares the public field, used to disambiguate between public fields.</param> - <param name="publicFieldName">Name of the public field.</param> - <param name="expectedValue">Expected value.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.ValueConstraint(System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Constrains the parameter to have a public field satisfying a specified constraint. - </summary> - <param name="publicFieldName">Name of the public field.</param> - <param name="publicFieldConstraint">Constraint for the public field.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.ValueConstraint(System.Type,System.String,Rhino.Mocks.Constraints.AbstractConstraint)"> - <summary> - Constrains the parameter to have a public field satisfying a specified constraint. - </summary> - <param name="declaringType">The type that declares the public field, used to disambiguate between public fields.</param> - <param name="publicFieldName">Name of the public field.</param> - <param name="publicFieldConstraint">Constraint for the public field.</param> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.IsNull(System.String)"> - <summary> - Determines whether the parameter has the specified public field and that it is null. - </summary> - <param name="publicFieldName">Name of the public field.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.IsNull(System.Type,System.String)"> - <summary> - Determines whether the parameter has the specified public field and that it is null. - </summary> - <param name="declaringType">The type that declares the public field, used to disambiguate between public fields.</param> - <param name="publicFieldName">Name of the public field.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.IsNotNull(System.String)"> - <summary> - Determines whether the parameter has the specified public field and that it is not null. - </summary> - <param name="publicFieldName">Name of the public field.</param> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.PublicField.IsNotNull(System.Type,System.String)"> - <summary> - Determines whether the parameter has the specified public field and that it is not null. - </summary> - <param name="declaringType">The type that declares the public field, used to disambiguate between public fields.</param> - <param name="publicFieldName">Name of the public field.</param> - <returns></returns> - </member> - <member name="T:Rhino.Mocks.Constraints.Text"> - <summary> - Central location for all text related constraints - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Text.StartsWith(System.String)"> - <summary> - Constrain the argument to starts with the specified string - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Text.EndsWith(System.String)"> - <summary> - Constrain the argument to end with the specified string - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Text.Contains(System.String)"> - <summary> - Constrain the argument to contain the specified string - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.Text.Like(System.String)"> - <summary> - Constrain the argument to validate according to regex pattern - </summary> - </member> - <member name="T:Rhino.Mocks.Constraints.TextArg"> - <summary> - Provides access to the constraintes defined in the class <see cref="T:Rhino.Mocks.Constraints.Text"/> to be used in context - with the <see cref="T:Rhino.Mocks.Arg"/> syntax. - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.TextArg.StartsWith(System.String)"> - <summary> - Constrain the argument to starts with the specified string - </summary> - <returns></returns> - </member> - <member name="M:Rhino.Mocks.Constraints.TextArg.EndsWith(System.String)"> - <summary> - Constrain the argument to end with the specified string - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.TextArg.Contains(System.String)"> - <summary> - Constrain the argument to contain the specified string - </summary> - </member> - <member name="M:Rhino.Mocks.Constraints.TextArg.Like(System.String)"> - ... [truncated message content] |
From: <te...@us...> - 2009-06-23 13:15:47
|
Revision: 4515 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4515&view=rev Author: tehlike Date: 2009-06-23 11:20:23 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Workarounding a bug that nant has. It cannot return 3.5 when the framework is net-3.5. Modified Paths: -------------- trunk/nhibernate/build-common/common.xml Modified: trunk/nhibernate/build-common/common.xml =================================================================== --- trunk/nhibernate/build-common/common.xml 2009-06-23 06:09:34 UTC (rev 4514) +++ trunk/nhibernate/build-common/common.xml 2009-06-23 11:20:23 UTC (rev 4515) @@ -48,15 +48,23 @@ <if test="${clover.enabled}"> <loadtasks assembly="${clover.home}/${clover.assembly}" /> </if> - + <property name="nant-version.current" value="${assemblyname::get-version(assembly::get-name(nant::get-assembly()))}" /> + <property name="nant-version.required" value="0.85.2478.0" /> <!-- Nant 0.85 release version --> + <property name="nant-version.beta1_086" value="0.86.2898.0" /> <!-- Nant 0.86 Beta 1 --> <!-- Path to the folder that contain the external assemblies. For net-2.0 the values will be lib, lib/net, and lib/net/2.0 respectively. --> <property name="lib.dir" value="lib" dynamic="true" /> <property name="lib.family.dir" value="${path::combine(lib.dir, framework::get-family(framework::get-target-framework()))}" dynamic="true" /> - <property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" /> - + <if test="${nant-version.current != nant-version.beta1_086 or framework::get-target-framework() != 'net-3.5'}"> + <property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" /> + </if> + <if test="${nant-version.current == nant-version.beta1_086 and framework::get-target-framework() == 'net-3.5'}"> + <echo>Detected NAnt 0.86 Beta 1, consider upgrading to a newer version (a nightly build) when building for .NET 3.5</echo> + <echo>The latest NAnt nightly can be downloaded from http://nant.sourceforge.net/nightly/latest/nant-bin.zip</echo> + <property name="lib.framework.dir" value="${path::combine(lib.family.dir, string::substring(framework::get-target-framework(), 4, 3))}" dynamic="true" /> + </if> <!-- These are used to set the correct attributes in AssemblyInfo.cs. --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-06-23 06:11:06
|
Revision: 4514 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4514&view=rev Author: ayenderahien Date: 2009-06-23 06:09:34 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Merging from 2.1.x branch: - Made openCommandCount and openReaderCount thread safe - Fixed NH-1850 NHibernate should log query duration - Made LogSpy output easier to read for humans - Avoiding sync overhead when it is not needed for WrapResultSet Modified Paths: -------------- trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs trunk/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs trunk/nhibernate/src/NHibernate/Loader/Loader.cs trunk/nhibernate/src/NHibernate.Test/LogSpy.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml Property Changed: ---------------- trunk/nhibernate/lib/net/3.5/ trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests/ Property changes on: trunk/nhibernate/lib/net/3.5 ___________________________________________________________________ Added: svn:ignore + NHibernate.dll Modified: trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -12,6 +12,10 @@ namespace NHibernate.AdoNet { + using System.Collections.Generic; + using System.Diagnostics; + using System.Threading; + /// <summary> /// Manages prepared statements and batching. Class exists to enforce separation of concerns /// </summary> @@ -34,6 +38,7 @@ private readonly ISet<IDbCommand> commandsToClose = new HashedSet<IDbCommand>(); private readonly ISet<IDataReader> readersToClose = new HashedSet<IDataReader>(); + private readonly IDictionary<IDataReader, Stopwatch> readersDuration = new Dictionary<IDataReader, Stopwatch>(); private IDbCommand lastQuery; private bool releasing; @@ -197,7 +202,10 @@ { CheckReaders(); Prepare(cmd); - try + Stopwatch duration = null; + if(log.IsDebugEnabled) + duration = Stopwatch.StartNew(); + try { return cmd.ExecuteNonQuery(); } @@ -207,14 +215,21 @@ log.Error("Could not execute command: " + cmd.CommandText, e); throw; } + finally + { + if (log.IsDebugEnabled && duration != null) + log.DebugFormat("ExecuteNonQuery took {0} ms", duration.ElapsedMilliseconds); + } } public IDataReader ExecuteReader(IDbCommand cmd) { CheckReaders(); Prepare(cmd); - - IDataReader reader; + Stopwatch duration = null; + if (log.IsDebugEnabled) + duration = Stopwatch.StartNew(); + IDataReader reader = null; try { reader = cmd.ExecuteReader(); @@ -225,6 +240,14 @@ log.Error("Could not execute query: " + cmd.CommandText, e); throw; } + finally + { + if(log.IsDebugEnabled && duration != null && reader != null) + { + log.DebugFormat("ExecuteReader took {0} ms", duration.ElapsedMilliseconds); + readersDuration[reader] = duration; + } + } if (!factory.ConnectionProvider.Driver.SupportsMultipleOpenReaders) { @@ -259,19 +282,17 @@ releasing = true; try { - foreach (IDataReader reader in readersToClose) + foreach (IDataReader reader in new HashedSet<IDataReader>(readersToClose)) { try { - LogCloseReader(); - reader.Dispose(); + CloseReader(reader); } catch (Exception e) { log.Warn("Could not close IDataReader", e); } } - readersToClose.Clear(); foreach (IDbCommand cmd in commandsToClose) { @@ -343,18 +364,26 @@ */ // TODO NH: Study a way to use directly IDbCommand.ExecuteReader() outsite the batcher // An example of it's use is the management of generated ID. - if (reader != null) - { - ResultSetWrapper rsw = reader as ResultSetWrapper; - readersToClose.Remove(rsw == null ? reader : rsw.Target); - CloseDataReader(reader); - } - } + if (reader == null) + return; - private void CloseDataReader(IDataReader reader) - { + ResultSetWrapper rsw = reader as ResultSetWrapper; + var actualReader = rsw == null ? reader : rsw.Target; + readersToClose.Remove(actualReader); reader.Dispose(); LogCloseReader(); + + if (!log.IsDebugEnabled) + return; + + var nhReader = actualReader as NHybridDataReader; + actualReader = nhReader == null ? actualReader : nhReader.Target; + + Stopwatch duration; + if (readersDuration.TryGetValue(actualReader, out duration)==false) + return; + readersDuration.Remove(actualReader); + log.DebugFormat("DataReader was closed after {0} ms", duration.ElapsedMilliseconds); } /// <summary></summary> @@ -434,8 +463,8 @@ { if (log.IsDebugEnabled) { - openCommandCount++; - log.Debug("Opened new IDbCommand, open IDbCommands: " + openCommandCount); + int currentOpenCommandCount = Interlocked.Increment(ref openCommandCount); + log.Debug("Opened new IDbCommand, open IDbCommands: " + currentOpenCommandCount); } if (factory.Statistics.IsStatisticsEnabled) @@ -448,8 +477,8 @@ { if (log.IsDebugEnabled) { - openCommandCount--; - log.Debug("Closed IDbCommand, open IDbCommands: " + openCommandCount); + int currentOpenCommandCount = Interlocked.Decrement(ref openCommandCount); + log.Debug("Closed IDbCommand, open IDbCommands: " + currentOpenCommandCount); } if (factory.Statistics.IsStatisticsEnabled) @@ -462,8 +491,8 @@ { if (log.IsDebugEnabled) { - openReaderCount++; - log.Debug("Opened IDataReader, open IDataReaders: " + openReaderCount); + int currentOpenReaderCount = Interlocked.Increment(ref openReaderCount); + log.Debug("Opened IDataReader, open IDataReaders: " + currentOpenReaderCount); } } @@ -471,8 +500,8 @@ { if (log.IsDebugEnabled) { - openReaderCount--; - log.Debug("Closed IDataReader, open IDataReaders :" + openReaderCount); + int currentOpenReaderCount = Interlocked.Decrement(ref openReaderCount); + log.Debug("Closed IDataReader, open IDataReaders :" + currentOpenReaderCount); } } Modified: trunk/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -27,6 +27,8 @@ private IDataReader _reader; private bool _isMidstream = false; + public IDataReader Target { get { return _reader; } } + /// <summary> /// Initializes a new instance of the <see cref="NHybridDataReader"/> class. /// </summary> Modified: trunk/nhibernate/src/NHibernate/Loader/Loader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Loader.cs 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate/Loader/Loader.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -1297,8 +1297,13 @@ log.Info(st.CommandText); // TODO NH: Callable rs = session.Batcher.ExecuteReader(st); - rs = WrapResultSetIfEnabled(rs, session); + //NH: this is checked outside the WrapResultSet because we + // want to avoid the syncronization overhead in the vast majority + // of cases where IsWrapResultSetsEnabled is set to false + if (session.Factory.Settings.IsWrapResultSetsEnabled) + rs = WrapResultSet(rs); + Dialect.Dialect dialect = session.Factory.Dialect; if (!dialect.SupportsLimitOffset || !UseLimit(selection, dialect)) { @@ -1325,25 +1330,18 @@ } [MethodImpl(MethodImplOptions.Synchronized)] - private IDataReader WrapResultSetIfEnabled(IDataReader rs, ISessionImplementor session) + private IDataReader WrapResultSet(IDataReader rs) { // synchronized to avoid multi-thread access issues; defined as method synch to avoid // potential deadlock issues due to nature of code. - if (session.Factory.Settings.IsWrapResultSetsEnabled) + try { - try - { - log.Debug("Wrapping result set [" + rs + "]"); - return new ResultSetWrapper(rs, RetreiveColumnNameToIndexCache(rs)); - } - catch (Exception e) - { - log.Info("Error wrapping result set", e); - return rs; - } + log.Debug("Wrapping result set [" + rs + "]"); + return new ResultSetWrapper(rs, RetreiveColumnNameToIndexCache(rs)); } - else + catch (Exception e) { + log.Info("Error wrapping result set", e); return rs; } } Modified: trunk/nhibernate/src/NHibernate.Test/LogSpy.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/LogSpy.cs 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate.Test/LogSpy.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -56,7 +56,8 @@ wholeMessage .Append(loggingEvent.LoggerName) .Append(" ") - .Append(loggingEvent.RenderedMessage); + .Append(loggingEvent.RenderedMessage) + .AppendLine(); } return wholeMessage.ToString(); } Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace NHibernate.Test.NHSpecificTest.NH1850 -{ - public class Customer - { - public virtual int Id { get; set; } - public virtual string Name { get; set; } - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs (from rev 4513, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1850 +{ + public class Customer + { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + } +} Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using NHibernate.Criterion; -using NUnit.Framework; - -namespace NHibernate.Test.NHSpecificTest.NH1850 -{ - using AdoNet; - - [TestFixture] - public class Fixture:BugTestCase - { - [Test] - public void CanGetQueryDurationForDelete() - { - using (LogSpy spy = new LogSpy(typeof(AbstractBatcher))) - using (ISession session = OpenSession()) - using (ITransaction tx = session.BeginTransaction()) - { - session.CreateQuery("delete Customer").ExecuteUpdate(); - - var wholeLog = spy.GetWholeLog(); - Assert.True( - wholeLog.Contains("ExecuteNonQuery took") - ); - - tx.Rollback(); - } - } - - [Test] - public void CanGetQueryDurationForSelect() - { - using (LogSpy spy = new LogSpy(typeof(AbstractBatcher))) - using (ISession session = OpenSession()) - using (ITransaction tx = session.BeginTransaction()) - { - session.CreateQuery("from Customer").List(); - - var wholeLog = spy.GetWholeLog(); - Assert.True( - wholeLog.Contains("ExecuteReader took") - ); - Assert.True( - wholeLog.Contains("DataReader was closed after") - ); - - tx.Rollback(); - } - } - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs (from rev 4513, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs 2009-06-23 06:09:34 UTC (rev 4514) @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Text; +using NHibernate.Criterion; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1850 +{ + using AdoNet; + + [TestFixture] + public class Fixture:BugTestCase + { + [Test] + public void CanGetQueryDurationForDelete() + { + using (LogSpy spy = new LogSpy(typeof(AbstractBatcher))) + using (ISession session = OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + session.CreateQuery("delete Customer").ExecuteUpdate(); + + var wholeLog = spy.GetWholeLog(); + Assert.True( + wholeLog.Contains("ExecuteNonQuery took") + ); + + tx.Rollback(); + } + } + + [Test] + public void CanGetQueryDurationForSelect() + { + using (LogSpy spy = new LogSpy(typeof(AbstractBatcher))) + using (ISession session = OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + session.CreateQuery("from Customer").List(); + + var wholeLog = spy.GetWholeLog(); + Assert.True( + wholeLog.Contains("ExecuteReader took") + ); + Assert.True( + wholeLog.Contains("DataReader was closed after") + ); + + tx.Rollback(); + } + } + } +} Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml 2009-06-23 06:09:34 UTC (rev 4514) @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.NHSpecificTest.NH1850" - default-lazy="false"> - - <class name="Customer"> - <id name="Id"> - <generator class="native"/> - </id> - <property name="Name"/> - - </class> -</hibernate-mapping> \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml (from rev 4513, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml 2009-06-23 06:09:34 UTC (rev 4514) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1850" + default-lazy="false"> + + <class name="Customer"> + <id name="Id"> + <generator class="native"/> + </id> + <property name="Name"/> + + </class> +</hibernate-mapping> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 05:57:17 UTC (rev 4513) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 06:09:34 UTC (rev 4514) @@ -527,6 +527,8 @@ <Compile Include="NHSpecificTest\NH1837\Customer.cs" /> <Compile Include="NHSpecificTest\NH1837\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1837\Order.cs" /> + <Compile Include="NHSpecificTest\NH1850\Customer.cs" /> + <Compile Include="NHSpecificTest\NH1850\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Child.cs" /> <Compile Include="NHSpecificTest\NH473\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Parent.cs" /> @@ -1937,6 +1939,7 @@ <EmbeddedResource Include="Bytecode\Lightweight\ProductLine.hbm.xml" /> <EmbeddedResource Include="DriverTest\MultiTypeEntity.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1850\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1192\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1734\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1097\Mappings.hbm.xml" /> Property changes on: trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests:4507-4508 + /branches/2.1.x/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests:4507-4508,4510-4513 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-06-23 05:57:26
|
Revision: 4513 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4513&view=rev Author: ayenderahien Date: 2009-06-23 05:57:17 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Made openCommandCount and openReaderCount thread safe Fixed NH-1850 NHibernate should log query duration Modified Paths: -------------- branches/2.1.x/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs branches/2.1.x/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs branches/2.1.x/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/ branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml Modified: branches/2.1.x/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2009-06-23 05:55:51 UTC (rev 4512) +++ branches/2.1.x/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2009-06-23 05:57:17 UTC (rev 4513) @@ -12,6 +12,10 @@ namespace NHibernate.AdoNet { + using System.Collections.Generic; + using System.Diagnostics; + using System.Threading; + /// <summary> /// Manages prepared statements and batching. Class exists to enforce separation of concerns /// </summary> @@ -34,6 +38,7 @@ private readonly ISet<IDbCommand> commandsToClose = new HashedSet<IDbCommand>(); private readonly ISet<IDataReader> readersToClose = new HashedSet<IDataReader>(); + private readonly IDictionary<IDataReader, Stopwatch> readersDuration = new Dictionary<IDataReader, Stopwatch>(); private IDbCommand lastQuery; private bool releasing; @@ -197,7 +202,10 @@ { CheckReaders(); Prepare(cmd); - try + Stopwatch duration = null; + if(log.IsDebugEnabled) + duration = Stopwatch.StartNew(); + try { return cmd.ExecuteNonQuery(); } @@ -207,14 +215,21 @@ log.Error("Could not execute command: " + cmd.CommandText, e); throw; } + finally + { + if (log.IsDebugEnabled && duration != null) + log.DebugFormat("ExecuteNonQuery took {0} ms", duration.ElapsedMilliseconds); + } } public IDataReader ExecuteReader(IDbCommand cmd) { CheckReaders(); Prepare(cmd); - - IDataReader reader; + Stopwatch duration = null; + if (log.IsDebugEnabled) + duration = Stopwatch.StartNew(); + IDataReader reader = null; try { reader = cmd.ExecuteReader(); @@ -225,6 +240,14 @@ log.Error("Could not execute query: " + cmd.CommandText, e); throw; } + finally + { + if(log.IsDebugEnabled && duration != null && reader != null) + { + log.DebugFormat("ExecuteReader took {0} ms", duration.ElapsedMilliseconds); + readersDuration[reader] = duration; + } + } if (!factory.ConnectionProvider.Driver.SupportsMultipleOpenReaders) { @@ -259,19 +282,17 @@ releasing = true; try { - foreach (IDataReader reader in readersToClose) + foreach (IDataReader reader in new HashedSet<IDataReader>(readersToClose)) { try { - LogCloseReader(); - reader.Dispose(); + CloseReader(reader); } catch (Exception e) { log.Warn("Could not close IDataReader", e); } } - readersToClose.Clear(); foreach (IDbCommand cmd in commandsToClose) { @@ -343,18 +364,26 @@ */ // TODO NH: Study a way to use directly IDbCommand.ExecuteReader() outsite the batcher // An example of it's use is the management of generated ID. - if (reader != null) - { - ResultSetWrapper rsw = reader as ResultSetWrapper; - readersToClose.Remove(rsw == null ? reader : rsw.Target); - CloseDataReader(reader); - } - } + if (reader == null) + return; - private void CloseDataReader(IDataReader reader) - { + ResultSetWrapper rsw = reader as ResultSetWrapper; + var actualReader = rsw == null ? reader : rsw.Target; + readersToClose.Remove(actualReader); reader.Dispose(); LogCloseReader(); + + if (!log.IsDebugEnabled) + return; + + var nhReader = actualReader as NHybridDataReader; + actualReader = nhReader == null ? actualReader : nhReader.Target; + + Stopwatch duration; + if (readersDuration.TryGetValue(actualReader, out duration)==false) + return; + readersDuration.Remove(actualReader); + log.DebugFormat("DataReader was closed after {0} ms", duration.ElapsedMilliseconds); } /// <summary></summary> @@ -434,8 +463,8 @@ { if (log.IsDebugEnabled) { - openCommandCount++; - log.Debug("Opened new IDbCommand, open IDbCommands: " + openCommandCount); + int currentOpenCommandCount = Interlocked.Increment(ref openCommandCount); + log.Debug("Opened new IDbCommand, open IDbCommands: " + currentOpenCommandCount); } if (factory.Statistics.IsStatisticsEnabled) @@ -448,8 +477,8 @@ { if (log.IsDebugEnabled) { - openCommandCount--; - log.Debug("Closed IDbCommand, open IDbCommands: " + openCommandCount); + int currentOpenCommandCount = Interlocked.Decrement(ref openCommandCount); + log.Debug("Closed IDbCommand, open IDbCommands: " + currentOpenCommandCount); } if (factory.Statistics.IsStatisticsEnabled) @@ -462,8 +491,8 @@ { if (log.IsDebugEnabled) { - openReaderCount++; - log.Debug("Opened IDataReader, open IDataReaders: " + openReaderCount); + int currentOpenReaderCount = Interlocked.Increment(ref openReaderCount); + log.Debug("Opened IDataReader, open IDataReaders: " + currentOpenReaderCount); } } @@ -471,8 +500,8 @@ { if (log.IsDebugEnabled) { - openReaderCount--; - log.Debug("Closed IDataReader, open IDataReaders :" + openReaderCount); + int currentOpenReaderCount = Interlocked.Decrement(ref openReaderCount); + log.Debug("Closed IDataReader, open IDataReaders :" + currentOpenReaderCount); } } Modified: branches/2.1.x/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs 2009-06-23 05:55:51 UTC (rev 4512) +++ branches/2.1.x/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs 2009-06-23 05:57:17 UTC (rev 4513) @@ -27,6 +27,8 @@ private IDataReader _reader; private bool _isMidstream = false; + public IDataReader Target { get { return _reader; } } + /// <summary> /// Initializes a new instance of the <see cref="NHybridDataReader"/> class. /// </summary> Copied: branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs (from rev 4508, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1837/Customer.cs) =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs (rev 0) +++ branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs 2009-06-23 05:57:17 UTC (rev 4513) @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1850 +{ + public class Customer + { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + } +} Property changes on: branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs (from rev 4508, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1837/Fixture.cs) =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs (rev 0) +++ branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs 2009-06-23 05:57:17 UTC (rev 4513) @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Text; +using NHibernate.Criterion; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1850 +{ + using AdoNet; + + [TestFixture] + public class Fixture:BugTestCase + { + [Test] + public void CanGetQueryDurationForDelete() + { + using (LogSpy spy = new LogSpy(typeof(AbstractBatcher))) + using (ISession session = OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + session.CreateQuery("delete Customer").ExecuteUpdate(); + + var wholeLog = spy.GetWholeLog(); + Assert.True( + wholeLog.Contains("ExecuteNonQuery took") + ); + + tx.Rollback(); + } + } + + [Test] + public void CanGetQueryDurationForSelect() + { + using (LogSpy spy = new LogSpy(typeof(AbstractBatcher))) + using (ISession session = OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + session.CreateQuery("from Customer").List(); + + var wholeLog = spy.GetWholeLog(); + Assert.True( + wholeLog.Contains("ExecuteReader took") + ); + Assert.True( + wholeLog.Contains("DataReader was closed after") + ); + + tx.Rollback(); + } + } + } +} Property changes on: branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml (from rev 4508, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1837/Mappings.hbm.xml) =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml (rev 0) +++ branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml 2009-06-23 05:57:17 UTC (rev 4513) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1850" + default-lazy="false"> + + <class name="Customer"> + <id name="Id"> + <generator class="native"/> + </id> + <property name="Name"/> + + </class> +</hibernate-mapping> \ No newline at end of file Property changes on: branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml ___________________________________________________________________ Added: svn:mergeinfo + Modified: branches/2.1.x/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 05:55:51 UTC (rev 4512) +++ branches/2.1.x/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-23 05:57:17 UTC (rev 4513) @@ -521,6 +521,8 @@ <Compile Include="NHSpecificTest\NH1837\Customer.cs" /> <Compile Include="NHSpecificTest\NH1837\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1837\Order.cs" /> + <Compile Include="NHSpecificTest\NH1850\Customer.cs" /> + <Compile Include="NHSpecificTest\NH1850\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Child.cs" /> <Compile Include="NHSpecificTest\NH473\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Parent.cs" /> @@ -1931,6 +1933,7 @@ <EmbeddedResource Include="Bytecode\Lightweight\ProductLine.hbm.xml" /> <EmbeddedResource Include="DriverTest\MultiTypeEntity.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1850\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1192\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1734\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1097\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-06-23 05:55:55
|
Revision: 4512 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4512&view=rev Author: ayenderahien Date: 2009-06-23 05:55:51 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Made LogSpy output easier to read for humans Modified Paths: -------------- branches/2.1.x/nhibernate/src/NHibernate.Test/LogSpy.cs Modified: branches/2.1.x/nhibernate/src/NHibernate.Test/LogSpy.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/LogSpy.cs 2009-06-23 05:55:09 UTC (rev 4511) +++ branches/2.1.x/nhibernate/src/NHibernate.Test/LogSpy.cs 2009-06-23 05:55:51 UTC (rev 4512) @@ -56,7 +56,8 @@ wholeMessage .Append(loggingEvent.LoggerName) .Append(" ") - .Append(loggingEvent.RenderedMessage); + .Append(loggingEvent.RenderedMessage) + .AppendLine(); } return wholeMessage.ToString(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-06-23 05:55:20
|
Revision: 4511 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4511&view=rev Author: ayenderahien Date: 2009-06-23 05:55:09 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Avoiding sync overhead when it is not needed for WrapResultSet Modified Paths: -------------- branches/2.1.x/nhibernate/src/NHibernate/Loader/Loader.cs Modified: branches/2.1.x/nhibernate/src/NHibernate/Loader/Loader.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate/Loader/Loader.cs 2009-06-22 22:00:03 UTC (rev 4510) +++ branches/2.1.x/nhibernate/src/NHibernate/Loader/Loader.cs 2009-06-23 05:55:09 UTC (rev 4511) @@ -1297,8 +1297,13 @@ log.Info(st.CommandText); // TODO NH: Callable rs = session.Batcher.ExecuteReader(st); - rs = WrapResultSetIfEnabled(rs, session); + //NH: this is checked outside the WrapResultSet because we + // want to avoid the syncronization overhead in the vast majority + // of cases where IsWrapResultSetsEnabled is set to false + if (session.Factory.Settings.IsWrapResultSetsEnabled) + rs = WrapResultSet(rs); + Dialect.Dialect dialect = session.Factory.Dialect; if (!dialect.SupportsLimitOffset || !UseLimit(selection, dialect)) { @@ -1325,25 +1330,18 @@ } [MethodImpl(MethodImplOptions.Synchronized)] - private IDataReader WrapResultSetIfEnabled(IDataReader rs, ISessionImplementor session) + private IDataReader WrapResultSet(IDataReader rs) { // synchronized to avoid multi-thread access issues; defined as method synch to avoid // potential deadlock issues due to nature of code. - if (session.Factory.Settings.IsWrapResultSetsEnabled) + try { - try - { - log.Debug("Wrapping result set [" + rs + "]"); - return new ResultSetWrapper(rs, RetreiveColumnNameToIndexCache(rs)); - } - catch (Exception e) - { - log.Info("Error wrapping result set", e); - return rs; - } + log.Debug("Wrapping result set [" + rs + "]"); + return new ResultSetWrapper(rs, RetreiveColumnNameToIndexCache(rs)); } - else + catch (Exception e) { + log.Info("Error wrapping result set", e); return rs; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |