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...> - 2008-11-07 04:49:47
|
Revision: 3891 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3891&view=rev Author: fabiomaulo Date: 2008-11-07 04:49:41 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Created NHibernate.ProxyGenerators.LinFuDynamicProxy Modified Paths: -------------- trunk/nhibernate/default.build trunk/nhibernate/src/NHibernate.sln Added Paths: ----------- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/Properties/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/Properties/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2008-11-07 04:47:41 UTC (rev 3890) +++ trunk/nhibernate/default.build 2008-11-07 04:49:41 UTC (rev 3891) @@ -26,6 +26,8 @@ <include name="Iesi.Collections/Iesi.Collections.build" /> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> <include name="NHibernate/NHibernate.build" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build" /> <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.DomainModel/NHibernate.DomainModel.build" /> @@ -37,6 +39,7 @@ <fileset id="buildfiles.tests" basedir="src"> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" @@ -86,6 +89,8 @@ --> <exclude name="Iesi.Collections.dll" /> <exclude name="Iesi.Collections.xml" /> + <exclude name="NHibernate.ProxyGenerators.LinFuDynamicProxy.dll" /> + <exclude name="NHibernate.ProxyGenerators.LinFuDynamicProxy.xml" /> <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.dll" /> <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.xml" /> <include name="*.dll" /> Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto *resharper* AssemblyInfo.cs Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,49 @@ +using System; +using System.Reflection; +using LinFu.DynamicProxy; +using NHibernate.Engine; +using NHibernate.Proxy.Poco; +using NHibernate.Type; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy +{ + [Serializable] + public class LazyInitializer : BasicLazyInitializer, LinFu.DynamicProxy.IInterceptor + { + private static readonly MethodInfo exceptionInternalPreserveStackTrace = + typeof (Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); + + public LazyInitializer(string entityName, System.Type persistentClass, object id, MethodInfo getIdentifierMethod, + MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType, + ISessionImplementor session) + : base(entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session) {} + + #region Implementation of IInterceptor + + public object Intercept(InvocationInfo info) + { + object returnValue; + try + { + returnValue = base.Invoke(info.TargetMethod, info.Arguments, info.Target); + + // Avoid invoking the actual implementation, if possible + if (returnValue != InvokeImplementation) + { + return returnValue; + } + + returnValue = info.TargetMethod.Invoke(GetImplementation(), info.Arguments); + } + catch (TargetInvocationException ex) + { + exceptionInternalPreserveStackTrace.Invoke(ex.InnerException, new Object[] {}); + throw ex.InnerException; + } + + return returnValue; + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{8289D6AD-9714-42D3-A94D-D4D9814D1281}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ProxyGenerators.LinFuDynamicProxy</RootNamespace> + <AssemblyName>NHibernate.ProxyGenerators.LinFuDynamicProxy</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="LinFu.DynamicProxy, Version=1.0.3232.29886, Culture=neutral, PublicKeyToken=62a6874124340d6e, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\LinFu.DynamicProxy.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\log4net.dll</HintPath> + </Reference> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="LazyInitializer.cs" /> + <Compile Include="ProxyFactory.cs" /> + <Compile Include="ProxyFactoryFactory.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + <None Include="ProxyGenerators.build" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,74 @@ +using System; +using System.Reflection; +using Iesi.Collections.Generic; +using log4net; +using NHibernate.Engine; +using NHibernate.Proxy; +using NHibernate.Type; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy +{ + public class ProxyFactory : IProxyFactory + { + private static readonly LinFu.DynamicProxy.ProxyFactory factory = new LinFu.DynamicProxy.ProxyFactory(); + protected static readonly ILog log = LogManager.GetLogger(typeof (ProxyFactory)); + + protected System.Type PersistentClass { get; private set; } + + protected System.Type[] Interfaces { get; private set; } + + protected MethodInfo GetIdentifierMethod { get; private set; } + + public MethodInfo SetIdentifierMethod { get; private set; } + + protected IAbstractComponentType ComponentIdType { get; private set; } + + protected string EntityName { get; private set; } + + protected bool IsClassProxy + { + get { return Interfaces.Length == 1; } + } + + #region IProxyFactory Members + + public void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces, + MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, + IAbstractComponentType componentIdType) + { + EntityName = entityName; + PersistentClass = persistentClass; + Interfaces = new System.Type[interfaces.Count]; + + if (interfaces.Count > 0) + { + interfaces.CopyTo(Interfaces, 0); + } + + GetIdentifierMethod = getIdentifierMethod; + SetIdentifierMethod = setIdentifierMethod; + ComponentIdType = componentIdType; + } + + public INHibernateProxy GetProxy(object id, ISessionImplementor session) + { + try + { + var initializer = new LazyInitializer(EntityName, PersistentClass, id, GetIdentifierMethod, SetIdentifierMethod, + ComponentIdType, session); + + object proxyInstance = IsClassProxy ? factory.CreateProxy(PersistentClass, initializer, Interfaces) + : factory.CreateProxy(Interfaces[0], initializer, Interfaces); + + return (INHibernateProxy) proxyInstance; + } + catch (Exception ex) + { + log.Error("Creating a proxy instance failed", ex); + throw new HibernateException("Creating a proxy instance failed", ex); + } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,23 @@ +using NHibernate.Bytecode; +using NHibernate.Proxy; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy +{ + public class ProxyFactoryFactory : IProxyFactoryFactory + { + #region IProxyFactoryFactory Members + + public IProxyFactory BuildProxyFactory() + { + return new ProxyFactory(); + } + + public IProxyValidator ProxyValidator + { + // TODO : LinFu need a specific proxy validator because need virtual methods even when we are using an interface as proxy + get { return new DynProxyTypeValidator(); } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,36 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.LinFuDynamicProxy" + default="build" + xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" +> + + <property name="root.dir" value="../.." /> + <include buildfile="${root.dir}/build-common/common-project.xml" /> + + <target name="init" depends="common.init"> + + <property name="assembly.is-cls-compliant" value="true" /> + <property name="assembly.description" + value="LinFu Dynamic proxy generator adapters for NHibernate." /> + <property name="assembly.copyright" + value="Licensed under LGPL." /> + <property name="assembly.allow-partially-trusted-callers" value="true" /> + + <property name="clover.instrument" value="true" /> + + <assemblyfileset basedir="${bin.dir}" id="project.references"> + <include name="System.dll" /> + <include name="Iesi.Collections.dll" /> + <include name="log4net.dll" /> + <include name="LinFu.DynamicProxy.dll" /> + <include name="NHibernate.dll" /> + </assemblyfileset> + + </target> + + <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> + <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build LinFu ProxyGenerators" /> + +</project> Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto *resharper* hibernate.cfg.xml AssemblyInfo.cs Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<configuration> + <configSections> + <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/> + <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> + </configSections> + + <!-- + hibernate-configuration section + + You don't need to change this section for your own use. + You can write your own hibernate.cfg.xml to override all session-factory configuration. + Templates are available in NHibernate.Config.Templates folder. + --> + <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> + <bytecode-provider type="lcg"/> + <reflection-optimizer use="true"/> + <session-factory name="NHibernate.Test"> + <property name="connection.provider">NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.DebugConnectionProvider, NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests</property> + <property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property> + <property name="cache.use_query_cache">true</property> + <property name="prepare_sql">false</property> + <property name="query.startup_check">false</property> + <property name="connection.isolation">ReadCommitted</property> + <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> + <property name="connection.connection_string"> + Server=(local);initial catalog=nhibernate;Integrated Security=SSPI + </property> + <property name="show_sql">false</property> + <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> + <property name="use_outer_join">true</property> + <property name="command_timeout">10</property> + <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + <property name="adonet.wrap_result_sets">false</property> + + <property name="proxyfactory.factory_class">NHibernate.ProxyGenerators.LinFuDynamicProxy.ProxyFactoryFactory, NHibernate.ProxyGenerators.LinFuDynamicProxy</property> + + </session-factory> + </hibernate-configuration> + + <!-- This section contains the log4net configuration settings --> + <log4net debug="false"> + + <!-- Define some output appenders --> + <appender name="trace" type="log4net.Appender.TraceAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> + </layout> + </appender> + + <appender name="console" type="log4net.Appender.ConsoleAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> + </layout> + </appender> + + <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net"> + + <param name="File" value="log.txt"/> + <param name="AppendToFile" value="false"/> + <param name="RollingStyle" value="Date"/> + <param name="DatePattern" value="yyyy.MM.dd"/> + <param name="StaticLogFileName" value="true"/> + + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/> + </layout> + </appender> + + <root> + <priority value="WARN"/> + <appender-ref ref="console"/> + </root> + <logger name="NHibernate.Proxy.Poco"> + <priority value="DEBUG"/> + </logger> + + <logger name="NHibernate.ProxyGenerators.LinFuDynamicProxy"> + <priority value="DEBUG"/> + </logger> + </log4net> + + +<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,68 @@ +using System.Collections; +using System.Data; +using Iesi.Collections; +using NHibernate.Connection; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests +{ + public class DebugConnectionProvider : DriverConnectionProvider + { + private readonly ISet connections = new ListSet(); + + public override IDbConnection GetConnection() + { + IDbConnection connection = base.GetConnection(); + connections.Add(connection); + return connection; + } + + public override void CloseConnection(IDbConnection conn) + { + base.CloseConnection(conn); + connections.Remove(conn); + } + + public bool HasOpenConnections + { + get + { + // check to see if all connections that were at one point opened + // have been closed through the CloseConnection + // method + if (connections.IsEmpty) + { + // there are no connections, either none were opened or + // all of the closings went through CloseConnection. + return false; + } + else + { + // Disposing of an ISession does not call CloseConnection (should it???) + // so a Diposed of ISession will leave an IDbConnection in the list but + // the IDbConnection will be closed (atleast with MsSql it works this way). + foreach (IDbConnection conn in connections) + { + if (conn.State != ConnectionState.Closed) + { + return true; + } + } + + // all of the connections have been Disposed and were closed that way + // or they were Closed through the CloseConnection method. + return false; + } + } + } + + public void CloseAllConnections() + { + while (!connections.IsEmpty) + { + IEnumerator en = connections.GetEnumerator(); + en.MoveNext(); + CloseConnection(en.Current as IDbConnection); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{94FDD99B-8275-4E51-8F43-958B2C632120}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests</RootNamespace> + <AssemblyName>NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="LinFu.DynamicProxy, Version=1.0.3232.29886, Culture=neutral, PublicKeyToken=62a6874124340d6e, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\LinFu.DynamicProxy.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\log4net.dll</HintPath> + </Reference> + <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.XML" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="DebugConnectionProvider.cs" /> + <Compile Include="ProxyInterface\IMyProxy.cs" /> + <Compile Include="ProxyInterface\MyProxyImpl.cs" /> + <Compile Include="ProxyInterface\ProxyFixture.cs" /> + <Compile Include="TestCase.cs" /> + <Compile Include="TestConfigurationHelper.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate.ProxyGenerators.LinFuDynamicProxy\NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj"> + <Project>{8289D6AD-9714-42D3-A94D-D4D9814D1281}</Project> + <Name>NHibernate.ProxyGenerators.LinFuDynamicProxy</Name> + </ProjectReference> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ProxyInterface\ProxyImpl.hbm.xml" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="ProxyGenerators.Test.build" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>if exist hibernate.cfg.xml (del hibernate.cfg.xml) +if exist "$(ProjectDir)hibernate.cfg.xml" (copy "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml")</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,44 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests" + default="build" + xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" +> + + <property name="root.dir" value="../.." /> + + <include buildfile="${root.dir}/build-common/common-project.xml" /> + + <target name="init" depends="common.init"> + + <property name="assembly.is-cls-compliant" value="false" /> + <property name="assembly.description" value="The Unit Tests for LinFu ProxyGenerators." /> + <property name="assembly.version" value="1.0.0.1" /> + <property name="assembly.version.informational" value="1.0" /> + + <property name="clover.instrument" value="false" /> + + <assemblyfileset id="project.references" basedir="${bin.dir}"> + <include name="System.dll" /> + <include name="System.XML.dll" /> + <include name="System.Data.dll" /> + <include name="Iesi.Collections.dll" /> + <include name="log4net.dll" /> + <include name="LinFu.DynamicProxy.dll" /> + <include name="NHibernate.dll" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.dll" /> + <include name="nunit.framework.dll"/> + </assemblyfileset> + + <resourcefileset id="project.resources" prefix="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests" dynamicprefix="true"> + <include name="**/*.xml" /> + <exclude name="bin/**/*.xml" /> + </resourcefileset> + </target> + + <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> + <target name="build" depends="init generate-assemblyinfo common.compile-tests" /> + <target name="test" depends="init build common.run-tests" /> + +</project> Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,11 @@ +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface +{ + public interface IMyProxy + { + int Id { get; set; } + + string Name { get; set; } + + void ThrowDeepException(); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,30 @@ +using System; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface +{ + public class MyProxyImpl: IMyProxy + { + private static void Level1() + { + Level2(); + } + + private static void Level2() + { + throw new ArgumentException("thrown from Level2"); + } + + #region CastleProxy Members + + public int Id { get; set; } + + public string Name { get; set; } + + public void ThrowDeepException() + { + Level1(); + } + + #endregion + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,137 @@ +using System; +using System.Collections; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using NUnit.Framework; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface +{ + [TestFixture] + public class ProxyFixture : TestCase + { + protected override IList Mappings + { + get { return new[] {"ProxyInterface.ProxyImpl.hbm.xml"}; } + } + + private void SerializeAndDeserialize(ref ISession s) + { + // Serialize the session + using (Stream stream = new MemoryStream()) + { + IFormatter formatter = new BinaryFormatter(); + formatter.Serialize(stream, s); + + // Close the original session + s.Close(); + + // Deserialize the session + stream.Position = 0; + s = (ISession) formatter.Deserialize(stream); + } + } + + [Test] + public void ExceptionStackTrace() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "check we have a proxy"); + + try + { + ap.ThrowDeepException(); + Assert.Fail("Exception not thrown"); + } + catch (ArgumentException ae) + { + Assert.AreEqual("thrown from Level2", ae.Message); + + string[] stackTraceLines = ae.StackTrace.Split('\n'); + Assert.IsTrue(stackTraceLines[0].Contains("Level2"), "top of exception stack is Level2()"); + Assert.IsTrue(stackTraceLines[1].Contains("Level1"), "next on exception stack is Level1()"); + } + finally + { + s.Delete(ap); + s.Flush(); + s.Close(); + } + } + + [Test] + public void Proxy() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap)); + int id = ap.Id; + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "get id should not have initialized it."); + string name = ap.Name; + Assert.IsTrue(NHibernateUtil.IsInitialized(ap), "get name should have initialized it."); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + [Test] + public void ProxySerialize() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.AreEqual(1, ap.Id); + s.Disconnect(); + + SerializeAndDeserialize(ref s); + + s.Reconnect(); + s.Disconnect(); + + // serialize and then deserialize the session again - make sure Castle.DynamicProxy + // has no problem with serializing two times - earlier versions of it did. + SerializeAndDeserialize(ref s); + + s.Close(); + + s = OpenSession(); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + [Test] + public void SerializeNotFoundProxy() + { + ISession s = OpenSession(); + // this does not actually exists in db + var notThere = (IMyProxy) s.Load(typeof (MyProxyImpl), 5); + Assert.AreEqual(5, notThere.Id); + s.Disconnect(); + + // serialize and then deserialize the session. + SerializeAndDeserialize(ref s); + + Assert.IsNotNull(s.Load(typeof (MyProxyImpl), 5), "should be proxy - even though it doesn't exists in db"); + s.Close(); + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests" + namespace="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface"> + <class name="MyProxyImpl" proxy="IMyProxy"> + <id name="Id"> + <generator class="assigned" /> + </id> + + <property name="Name" /> + </class> +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,323 @@ +using System; +using System.Collections; +using System.Data; +using System.Reflection; +using log4net; +using log4net.Config; +using NHibernate.Cfg; +using NHibernate.Connection; +using NHibernate.Engine; +using NHibernate.Mapping; +using NHibernate.Tool.hbm2ddl; +using NHibernate.Type; +using NUnit.Framework; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests +{ + public abstract class TestCase + { + private const bool OutputDdl = false; + protected Configuration cfg; + protected ISessionFactoryImplementor sessions; + + private static readonly ILog log = LogManager.GetLogger(typeof(TestCase)); + + protected Dialect.Dialect Dialect + { + get { return NHibernate.Dialect.Dialect.GetDialect(cfg.Properties); } + } + + protected ISession lastOpenedSession; + private DebugConnectionProvider connectionProvider; + + /// <summary> + /// Mapping files used in the TestCase + /// </summary> + protected abstract IList Mappings { get; } + + /// <summary> + /// Assembly to load mapping files from (default is NHibernate.DomainModel). + /// </summary> + protected virtual string MappingsAssembly + { + get { return "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests"; } + } + + static TestCase() + { + // Configure log4net here since configuration through an attribute doesn't always work. + XmlConfigurator.Configure(); + } + + /// <summary> + /// Creates the tables used in this TestCase + /// </summary> + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + try + { + Configure(); + if (!AppliesTo(Dialect)) + { + Assert.Ignore(GetType() + " does not apply to " + Dialect); + } + + CreateSchema(); + BuildSessionFactory(); + } + catch (Exception e) + { + log.Error("Error while setting up the test fixture", e); + throw; + } + } + + /// <summary> + /// Removes the tables used in this TestCase. + /// </summary> + /// <remarks> + /// If the tables are not cleaned up sometimes SchemaExport runs into + /// Sql errors because it can't drop tables because of the FKs. This + /// will occur if the TestCase does not have the same hbm.xml files + /// included as a previous one. + /// </remarks> + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + DropSchema(); + Cleanup(); + } + + protected virtual void OnSetUp() + { + } + + /// <summary> + /// Set up the test. This method is not overridable, but it calls + /// <see cref="OnSetUp" /> which is. + /// </summary> + [SetUp] + public void SetUp() + { + OnSetUp(); + } + + protected virtual void OnTearDown() + { + } + + /// <summary> + /// Checks that the test case cleans up after itself. This method + /// is not overridable, but it calls <see cref="OnTearDown" /> which is. + /// </summary> + [TearDown] + public void TearDown() + { + OnTearDown(); + + bool wasClosed = CheckSessionWasClosed(); + bool wasCleaned = CheckDatabaseWasCleaned(); + bool wereConnectionsClosed = CheckConnectionsWereClosed(); + bool fail = !wasClosed || !wasCleaned || !wereConnectionsClosed; + + if (fail) + { + Assert.Fail("Test didn't clean up after itself"); + } + } + + private bool CheckSessionWasClosed() + { + if (lastOpenedSession != null && lastOpenedSession.IsOpen) + { + log.Error("Test case didn't close a session, closing"); + lastOpenedSession.Close(); + return false; + } + + return true; + } + + private bool CheckDatabaseWasCleaned() + { + if (sessions.GetAllClassMetadata().Count == 0) + { + // Return early in the case of no mappings, also avoiding + // a warning when executing the HQL below. + return true; + } + + bool empty; + using (ISession s = sessions.OpenSession()) + { + IList objects = s.CreateQuery("from System.Object o").List(); + empty = objects.Count == 0; + } + + if (!empty) + { + log.Error("Test case didn't clean up the database after itself, re-creating the schema"); + DropSchema(); + CreateSchema(); + } + + return empty; + } + + private bool CheckConnectionsWereClosed() + { + if (connectionProvider == null || !connectionProvider.HasOpenConnections) + { + return true; + } + + log.Error("Test case didn't close all open connections, closing"); + connectionProvider.CloseAllConnections(); + return false; + } + + private void Configure() + { + cfg = new Configuration(); + if (TestConfigurationHelper.hibernateConfigFile != null) + cfg.Configure(TestConfigurationHelper.hibernateConfigFile); + + Assembly assembly = Assembly.Load(MappingsAssembly); + + foreach (string file in Mappings) + { + cfg.AddResource(MappingsAssembly + "." + file, assembly); + } + + Configure(cfg); + + ApplyCacheSettings(cfg); + } + + private void CreateSchema() + { + new SchemaExport(cfg).Create(OutputDdl, true); + } + + private void DropSchema() + { + new SchemaExport(cfg).Drop(OutputDdl, true); + } + + protected virtual void BuildSessionFactory() + { + sessions = (ISessionFactoryImplementor)cfg.BuildSessionFactory(); + connectionProvider = sessions.ConnectionProvider as DebugConnectionProvider; + } + + private void Cleanup() + { + sessions.Close(); + sessions = null; + connectionProvider = null; + lastOpenedSession = null; + cfg = null; + } + + public int ExecuteStatement(string sql) + { + if (cfg == null) + { + cfg = new Configuration(); + } + + using (IConnectionProvider prov = ConnectionProviderFactory.NewConnectionProvider(cfg.Properties)) + { + IDbConnection conn = prov.GetConnection(); + + try + { + using (IDbTransaction tran = conn.BeginTransaction()) + using (IDbCommand comm = conn.CreateCommand()) + { + comm.CommandText = sql; + comm.Transaction = tran; + comm.CommandType = CommandType.Text; + int result = comm.ExecuteNonQuery(); + tran.Commit(); + return result; + } + } + finally + { + prov.CloseConnection(conn); + } + } + } + + protected ISessionFactoryImplementor Sfi + { + get { return sessions; } + } + + protected virtual ISession OpenSession() + { + lastOpenedSession = sessions.OpenSession(); + return lastOpenedSession; + } + + protected virtual ISession OpenSession(IInterceptor sessionLocalInterceptor) + { + lastOpenedSession = sessions.OpenSession(sessionLocalInterceptor); + return lastOpenedSession; + } + + protected void ApplyCacheSettings(Configuration configuration) + { + if (CacheConcurrencyStrategy == null) + { + return; + } + + foreach (PersistentClass clazz in configuration.ClassMappings) + { + bool hasLob = false; + foreach (Property prop in clazz.PropertyClosureIterator) + { + if (prop.Value.IsSimpleValue) + { + IType type = ((SimpleValue)prop.Value).Type; + if (type == NHibernateUtil.BinaryBlob) + { + hasLob = true; + } + } + } + if (!hasLob && !clazz.IsInherited) + { + configuration.SetCacheConcurrencyStrategy(clazz.EntityName, CacheConcurrencyStrategy); + } + } + + foreach (Mapping.Collection coll in configuration.CollectionMappings) + { + configuration.SetCollectionCacheConcurrencyStrategy(coll.Role, CacheConcurrencyStrategy); + } + } + + #region Properties overridable by subclasses + + protected virtual bool AppliesTo(Dialect.Dialect dialect) + { + return true; + } + + protected virtual void Configure(Configuration configuration) + { + } + + protected virtual string CacheConcurrencyStrategy + { + get { return "nonstrict-read-write"; } + //get { return null; } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,40 @@ +using System; +using System.IO; +using NHibernate.Cfg; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests +{ + public static class TestConfigurationHelper + { + public static readonly string hibernateConfigFile; + + static TestConfigurationHelper() + { + // Verify if hibernate.cfg.xml exists + hibernateConfigFile = GetDefaultConfigurationFilePath(); + } + + public static string GetDefaultConfigurationFilePath() + { + string baseDir = AppDomain.CurrentDomain.BaseDirectory; + string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath; + string binPath = relativeSearchPath == null ? baseDir : Path.Combine(baseDir, relativeSearchPath); + string fullPath = Path.Combine(binPath, Configuration.DefaultHibernateCfgFileName); + return File.Exists(fullPath) ? fullPath : null; + } + + /// <summary> + /// Standar Configuration for tests. + /// </summary> + /// <returns>The configuration using merge between App.Config and hibernate.cfg.xml if present.</returns> + public static Configuration GetDefaultConfiguration() + { + var result = new Configuration(); + if (hibernateConfigFile != null) + { + result.Configure(hibernateConfigFile); + } + return result; + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.sln =================================================================== --- trunk/nhibernate/src/NHibernate.sln 2008-11-07 04:47:41 UTC (rev 3890) +++ trunk/nhibernate/src/NHibernate.sln 2008-11-07 04:49:41 UTC (rev 3891) @@ -16,6 +16,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests", "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests\NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj", "{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.LinFuDynamicProxy", "NHibernate.ProxyGenerators.LinFuDynamicProxy\NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj", "{8289D6AD-9714-42D3-A94D-D4D9814D1281}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests", "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests\NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj", "{94FDD99B-8275-4E51-8F43-958B2C632120}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -42,6 +46,14 @@ {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Any CPU.Build.0 = Debug|Any CPU {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.ActiveCfg = Release|Any CPU {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.Build.0 = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Any CPU.Build.0 = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-07 04:47:44
|
Revision: 3890 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3890&view=rev Author: fabiomaulo Date: 2008-11-07 04:47:41 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Changed LinFu.DynamicProxy.dll because no signed Modified Paths: -------------- trunk/nhibernate/lib/net/2.0/LinFu.DynamicProxy.dll trunk/nhibernate/lib/net/3.5/LinFu.DynamicProxy.dll Modified: trunk/nhibernate/lib/net/2.0/LinFu.DynamicProxy.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/LinFu.DynamicProxy.dll =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-07 01:40:54
|
Revision: 3889 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3889&view=rev Author: fabiomaulo Date: 2008-11-07 01:36:27 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Added LinFu.DynamicProxy.dll as a new dynProxy provider for lazyloading Added Paths: ----------- trunk/nhibernate/lib/net/2.0/LinFu.DynamicProxy.dll trunk/nhibernate/lib/net/2.0/LinFu.License.txt trunk/nhibernate/lib/net/3.5/LinFu.DynamicProxy.dll trunk/nhibernate/lib/net/3.5/LinFu.License.txt Added: trunk/nhibernate/lib/net/2.0/LinFu.DynamicProxy.dll =================================================================== (Binary files differ) Property changes on: trunk/nhibernate/lib/net/2.0/LinFu.DynamicProxy.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/nhibernate/lib/net/2.0/LinFu.License.txt =================================================================== --- trunk/nhibernate/lib/net/2.0/LinFu.License.txt (rev 0) +++ trunk/nhibernate/lib/net/2.0/LinFu.License.txt 2008-11-07 01:36:27 UTC (rev 3889) @@ -0,0 +1,167 @@ +The LinFu Library, (c) 2007 Philip Laureano, is subject to the terms of the following license: + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: trunk/nhibernate/lib/net/3.5/LinFu.DynamicProxy.dll =================================================================== (Binary files differ) Property changes on: trunk/nhibernate/lib/net/3.5/LinFu.DynamicProxy.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/nhibernate/lib/net/3.5/LinFu.License.txt =================================================================== --- trunk/nhibernate/lib/net/3.5/LinFu.License.txt (rev 0) +++ trunk/nhibernate/lib/net/3.5/LinFu.License.txt 2008-11-07 01:36:27 UTC (rev 3889) @@ -0,0 +1,167 @@ +The LinFu Library, (c) 2007 Philip Laureano, is subject to the terms of the following license: + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-04 12:08:39
|
Revision: 3888 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3888&view=rev Author: fabiomaulo Date: 2008-11-04 12:08:34 +0000 (Tue, 04 Nov 2008) Log Message: ----------- Fix NH-871 (new select generator) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Id/IdentifierGeneratorFactory.cs trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Id/SelectGenerator.cs trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/ trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.cs trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.hbm.xml trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/SelectGeneratorTest.cs Modified: trunk/nhibernate/src/NHibernate/Id/IdentifierGeneratorFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/IdentifierGeneratorFactory.cs 2008-11-02 22:55:51 UTC (rev 3887) +++ trunk/nhibernate/src/NHibernate/Id/IdentifierGeneratorFactory.cs 2008-11-04 12:08:34 UTC (rev 3888) @@ -165,6 +165,7 @@ idgenerators.Add("foreign", typeof(ForeignGenerator)); idgenerators.Add("guid", typeof(GuidGenerator)); idgenerators.Add("guid.comb", typeof(GuidCombGenerator)); + idgenerators.Add("select", typeof(SelectGenerator)); } private IdentifierGeneratorFactory() Modified: trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs 2008-11-02 22:55:51 UTC (rev 3887) +++ trunk/nhibernate/src/NHibernate/Id/Insert/AbstractSelectingDelegate.cs 2008-11-04 12:08:34 UTC (rev 3888) @@ -51,7 +51,7 @@ try { //fetch the generated id in a separate query - IDbCommand idSelect = session.Batcher.PrepareCommand(CommandType.Text, selectSQL, SqlTypeFactory.NoTypes); + IDbCommand idSelect = session.Batcher.PrepareCommand(CommandType.Text, selectSQL, ParametersTypes); try { BindParameters(session, idSelect, binder.Entity); @@ -91,10 +91,22 @@ /// <returns> The generated identifier </returns> protected internal abstract object GetResult(ISessionImplementor session, IDataReader rs, object entity); - /// <summary> Bind any required parameter values into the SQL command {@link #getSelectSQL}. </summary> + /// <summary> Bind any required parameter values into the SQL command <see cref="SelectSQL"/>. </summary> /// <param name="session">The session </param> - /// <param name="ps">The prepared {@link #getSelectSQL SQL} command </param> + /// <param name="ps">The prepared <see cref="SelectSQL"/> command </param> /// <param name="entity">The entity being saved. </param> - protected internal virtual void BindParameters(ISessionImplementor session, IDbCommand ps, object entity) {} + protected internal virtual void BindParameters(ISessionImplementor session, IDbCommand ps, object entity) { } + + #region NH Specific + + /// <summary> + /// Types of any required parameter values into the SQL command <see cref="SelectSQL"/>. + /// </summary> + protected internal virtual SqlType[] ParametersTypes + { + get { return SqlTypeFactory.NoTypes; } + } + + #endregion } } \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Id/SelectGenerator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/SelectGenerator.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Id/SelectGenerator.cs 2008-11-04 12:08:34 UTC (rev 3888) @@ -0,0 +1,126 @@ +using System.Collections.Generic; +using System.Data; +using NHibernate.Engine; +using NHibernate.Id.Insert; +using NHibernate.Persister.Entity; +using NHibernate.SqlCommand; +using NHibernate.SqlTypes; +using NHibernate.Type; + +namespace NHibernate.Id +{ + /// <summary> + /// A generator that selects the just inserted row to determine the identifier + /// value assigned by the database. The correct row is located using a unique key. + /// </summary> + /// <remarks>One mapping parameter is required: key (unless a natural-id is defined in the mapping).</remarks> + public class SelectGenerator : AbstractPostInsertGenerator, IConfigurable + { + private string uniqueKeyPropertyName; + + #region Overrides of AbstractPostInsertGenerator + + public override IInsertGeneratedIdentifierDelegate GetInsertGeneratedIdentifierDelegate( + IPostInsertIdentityPersister persister, ISessionFactoryImplementor factory, bool isGetGeneratedKeysEnabled) + { + return new SelectGeneratorDelegate(persister, factory, uniqueKeyPropertyName); + } + + #endregion + + #region Implementation of IConfigurable + + public void Configure(IType type, IDictionary<string, string> parms, Dialect.Dialect dialect) + { + parms.TryGetValue("key", out uniqueKeyPropertyName); + } + + #endregion + + private static string DetermineNameOfPropertyToUse(IEntityPersister persister, string supplied) + { + if (supplied != null) + { + return supplied; + } + int[] naturalIdPropertyIndices = persister.NaturalIdentifierProperties; + if (naturalIdPropertyIndices == null) + { + throw new IdentifierGenerationException("no natural-id property defined; need to specify [key] in " + + "generator parameters"); + } + if (naturalIdPropertyIndices.Length > 1) + { + throw new IdentifierGenerationException("select generator does not currently support composite " + + "natural-id properties; need to specify [key] in generator parameters"); + } + ValueInclusion inclusion = persister.PropertyInsertGenerationInclusions[naturalIdPropertyIndices[0]]; + if (inclusion != ValueInclusion.None) + { + throw new IdentifierGenerationException("natural-id also defined as insert-generated; need to specify [key] " + + "in generator parameters"); + } + return persister.PropertyNames[naturalIdPropertyIndices[0]]; + } + + #region Nested type: SelectGeneratorDelegate + + /// <summary> The delegate for the select generation strategy.</summary> + public class SelectGeneratorDelegate : AbstractSelectingDelegate + { + private readonly ISessionFactoryImplementor factory; + private readonly SqlString idSelectString; + private readonly IType idType; + private readonly IPostInsertIdentityPersister persister; + + private readonly string uniqueKeyPropertyName; + private readonly IType uniqueKeyType; + + internal SelectGeneratorDelegate(IPostInsertIdentityPersister persister, ISessionFactoryImplementor factory, + string suppliedUniqueKeyPropertyName) : base(persister) + { + this.persister = persister; + this.factory = factory; + uniqueKeyPropertyName = DetermineNameOfPropertyToUse((IEntityPersister) persister, suppliedUniqueKeyPropertyName); + + idSelectString = persister.GetSelectByUniqueKeyString(uniqueKeyPropertyName); + uniqueKeyType = ((IEntityPersister) persister).GetPropertyType(uniqueKeyPropertyName); + idType = persister.IdentifierType; + } + + protected internal override SqlString SelectSQL + { + get { return idSelectString; } + } + + protected internal override SqlType[] ParametersTypes + { + get { return uniqueKeyType.SqlTypes(factory); } + } + + public override IdentifierGeneratingInsert PrepareIdentifierGeneratingInsert() + { + return new IdentifierGeneratingInsert(factory); + } + + protected internal override void BindParameters(ISessionImplementor session, IDbCommand ps, object entity) + { + object uniqueKeyValue = ((IEntityPersister) persister).GetPropertyValue(entity, uniqueKeyPropertyName, + session.EntityMode); + uniqueKeyType.NullSafeSet(ps, uniqueKeyValue, 0, session); + } + + protected internal override object GetResult(ISessionImplementor session, IDataReader rs, object entity) + { + if (!rs.Read()) + { + throw new IdentifierGenerationException("the inserted row could not be located by the unique key: " + + uniqueKeyPropertyName); + } + return idType.NullSafeGet(rs, persister.RootTableKeyColumnNames, session, entity); + } + } + + #endregion + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-02 22:55:51 UTC (rev 3887) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-04 12:08:34 UTC (rev 3888) @@ -440,6 +440,7 @@ <Compile Include="AdoNet\ResultSetWrapper.cs" /> <Compile Include="AdoNet\SqlClientBatchingBatcherFactory.cs" /> <Compile Include="AdoNet\TooManyRowsAffectedException.cs" /> + <Compile Include="Id\SelectGenerator.cs" /> <Compile Include="Properties\BackFieldStrategy.cs" /> <Compile Include="Bytecode\CodeDom\BytecodeProviderImpl.cs" /> <Compile Include="Bytecode\IAccessOptimizer.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.cs 2008-11-04 12:08:34 UTC (rev 3888) @@ -0,0 +1,25 @@ +namespace NHibernate.Test.Generatedkeys.Select +{ + public class MyEntity + { + private int id; + private string name; + protected MyEntity() {} + + public MyEntity(string name) + { + this.name = name; + } + + public virtual int Id + { + get { return id; } + } + + public virtual string Name + { + get { return name; } + set { name = value; } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/MyEntity.hbm.xml 2008-11-04 12:08:34 UTC (rev 3888) @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.Generatedkeys.Select" + default-access="field"> + + <class name="MyEntity" table="my_entity"> + + <id name="id"> + <generator class="select"/> + </id> + <natural-id> + <property name="name"/> + </natural-id> + </class> + + <database-object> + <create> +CREATE GENERATOR MYGENERATOR; + </create> + <drop> +DROP GENERATOR MYGENERATOR; + </drop> + <dialect-scope name="NHibernate.Dialect.FirebirdDialect"/> + </database-object> + + <database-object> + <create> +CREATE TRIGGER my_entity_BI FOR my_entity +ACTIVE BEFORE INSERT +POSITION 0 +AS +BEGIN +NEW.ID = GEN_ID (MYGENERATOR, 1); +END + </create> + <drop> +DROP TRIGGER my_entity_BI; + </drop> + <dialect-scope name="NHibernate.Dialect.FirebirdDialect"/> + </database-object> + +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/SelectGeneratorTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/SelectGeneratorTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Generatedkeys/Select/SelectGeneratorTest.cs 2008-11-04 12:08:34 UTC (rev 3888) @@ -0,0 +1,42 @@ +using System.Collections; +using NUnit.Framework; + +namespace NHibernate.Test.Generatedkeys.Select +{ + [TestFixture] + public class SelectGeneratorTest: TestCase + { + protected override IList Mappings + { + get { return new[] { "Generatedkeys.Select.MyEntity.hbm.xml" }; } + } + + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override bool AppliesTo(Dialect.Dialect dialect) + { + return dialect is Dialect.FirebirdDialect; + } + + [Test] + public void GetGeneratedKeysSupport() + { + ISession session = OpenSession(); + session.BeginTransaction(); + + MyEntity e = new MyEntity("entity-1"); + session.Save(e); + + // this insert should happen immediately! + Assert.AreEqual(1, e.Id, "id not generated through forced insertion"); + + session.Delete(e); + session.Transaction.Commit(); + session.Close(); + } + + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-02 22:55:51 UTC (rev 3887) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-04 12:08:34 UTC (rev 3888) @@ -243,6 +243,8 @@ <Compile Include="Generatedkeys\Identity\MyChild.cs" /> <Compile Include="Generatedkeys\Identity\MyEntity.cs" /> <Compile Include="Generatedkeys\Identity\MySibling.cs" /> + <Compile Include="Generatedkeys\Select\MyEntity.cs" /> + <Compile Include="Generatedkeys\Select\SelectGeneratorTest.cs" /> <Compile Include="GeneratedTest\AbstractGeneratedPropertyTest.cs" /> <Compile Include="GeneratedTest\Component.cs" /> <Compile Include="GeneratedTest\ComponentOwner.cs" /> @@ -1515,6 +1517,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="Generatedkeys\Select\MyEntity.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1478\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1447\Mappings.hbm.xml" /> <EmbeddedResource Include="TypesTest\EnumCharClass.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-02 22:55:55
|
Revision: 3887 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3887&view=rev Author: tehlike Date: 2008-11-02 22:55:51 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Adding tests supporting NH-1478 is not an issue. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Person.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs 2008-11-02 22:39:13 UTC (rev 3886) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs 2008-11-02 22:55:51 UTC (rev 3887) @@ -12,10 +12,10 @@ } - public Person(string name, bool isPerfect) + public Person(string name, bool wantsNewsLetter) { this.Name = name; - this.WantsNewsletter = isPerfect; + this.WantsNewsletter = wantsNewsLetter; } public virtual int Id Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Fixture.cs 2008-11-02 22:55:51 UTC (rev 3887) @@ -0,0 +1,69 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1478 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void OnTearDown() + { + base.OnTearDown(); + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Delete("from Person"); + tx.Commit(); + } + } + } + + protected override void OnSetUp() + { + using (ISession s = OpenSession()) + { + using (ITransaction tx = s.BeginTransaction()) + { + Person e1 = new Person("Tuna Toksoz","Born in Istanbul :Turkey"); + Person e2 = new Person("Tuna Toksoz", "Born in Istanbul :Turkiye"); + s.Save(e1); + s.Save(e2); + tx.Commit(); + } + } + } + + [Test] + public void TestIfColonInStringIsNotInterpretedAsParameterInSQL() + { + using (ISession session=OpenSession()) + { + + + IList lst = session.CreateSQLQuery("select Biography from Person where Biography='Born in Istanbul :Turkey'") + .AddScalar("Biography", NHibernateUtil.String).List(); + Assert.AreEqual(1,lst.Count); + } + + } + + [Test] + public void TestIfColonInStringIsNotInterpretedAsParameterInHQL() + { + using (ISession session = OpenSession()) + { + + + IList lst = session.CreateSQLQuery("select p.Biography from Person p where p.Biography='Born in Istanbul :Turkey'") + .List(); + Assert.AreEqual(1, lst.Count); + } + + } + + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Mappings.hbm.xml 2008-11-02 22:55:51 UTC (rev 3887) @@ -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.NH1478"> + + <class name="Person" lazy="false"> + <id name="Id"> + <generator class="native" /> + </id> + <property name="Name"/> + <property name="Biography"/> + </class> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Person.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Person.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1478/Person.cs 2008-11-02 22:55:51 UTC (rev 3887) @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1478 +{ + public class Person + { + public Person() + { + + } + + public Person(string name, string bio) + { + this.Name = name; + this.Biography = bio; + } + + public virtual int Id + { + get; + set; + } + + public virtual string Name + { + get; + set; + } + public virtual string Biography + { + get; + set; + } + + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-02 22:39:13 UTC (rev 3886) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-02 22:55:51 UTC (rev 3887) @@ -496,6 +496,8 @@ <Compile Include="NHSpecificTest\NH1447\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1447\Person.cs" /> <Compile Include="NHSpecificTest\NH1464\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1478\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1478\Person.cs" /> <Compile Include="NHSpecificTest\NH1483\BaseClass.cs" /> <Compile Include="NHSpecificTest\NH1483\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1483\SubClass.cs" /> @@ -1513,6 +1515,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1478\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1447\Mappings.hbm.xml" /> <EmbeddedResource Include="TypesTest\EnumCharClass.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesWithColl.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-02 22:39:16
|
Revision: 3886 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3886&view=rev Author: tehlike Date: 2008-11-02 22:39:13 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Adding helpers for more transformers (Fix NH-1555 by Karron Qiu) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Transform/Transformers.cs Modified: trunk/nhibernate/src/NHibernate/Transform/Transformers.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Transform/Transformers.cs 2008-11-02 22:02:59 UTC (rev 3885) +++ trunk/nhibernate/src/NHibernate/Transform/Transformers.cs 2008-11-02 22:39:13 UTC (rev 3886) @@ -22,5 +22,16 @@ { return new AliasToBeanResultTransformer(target); } + + public static readonly IResultTransformer DistinctRootEntity = new DistinctRootEntityResultTransformer(); + + public static IResultTransformer AliasToBeanConstructor(System.Reflection.ConstructorInfo constructor) + { + return new AliasToBeanConstructorResultTransformer(constructor); + } + + public static readonly IResultTransformer PassThrough = new PassThroughResultTransformer(); + + public static readonly IResultTransformer RootEntity = new RootEntityResultTransformer(); } -} \ 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: <te...@us...> - 2008-11-02 22:03:07
|
Revision: 3885 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3885&view=rev Author: tehlike Date: 2008-11-02 22:02:59 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Adding overload for ConstantProjection(object,IType) (Fix NH-1447) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Criterion/ConstantProjection.cs trunk/nhibernate/src/NHibernate/Criterion/Projections.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs Modified: trunk/nhibernate/src/NHibernate/Criterion/ConstantProjection.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/ConstantProjection.cs 2008-11-02 18:28:25 UTC (rev 3884) +++ trunk/nhibernate/src/NHibernate/Criterion/ConstantProjection.cs 2008-11-02 22:02:59 UTC (rev 3885) @@ -13,12 +13,18 @@ public class ConstantProjection : SimpleProjection { private readonly object value; - - public ConstantProjection(object value) + private readonly IType type; + public ConstantProjection(object value):this(value,NHibernateUtil.GuessType(value.GetType())) { + + } + public ConstantProjection(object value,IType type) + { this.value = value; + this.type = type; } + public override bool IsAggregate { get { return false; } @@ -36,7 +42,7 @@ public override SqlString ToSqlString(ICriteria criteria, int position, ICriteriaQuery criteriaQuery, IDictionary<string, IFilter> enabledFilters) { - criteriaQuery.AddUsedTypedValues(new TypedValue[] { new TypedValue(NHibernateUtil.GuessType(value), value, EntityMode.Poco) }); + criteriaQuery.AddUsedTypedValues(new TypedValue[] { new TypedValue(type, value, EntityMode.Poco) }); return new SqlStringBuilder() .AddParameter() .Add(" as ") @@ -46,12 +52,12 @@ public override IType[] GetTypes(ICriteria criteria, ICriteriaQuery criteriaQuery) { - return new IType[] {NHibernateUtil.GuessType(value)}; + return new IType[] { type }; } public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery) { - return new TypedValue[] {new TypedValue(NHibernateUtil.GuessType(value), value, EntityMode.Poco)}; + return new TypedValue[] { new TypedValue(type, value, EntityMode.Poco) }; } } } Modified: trunk/nhibernate/src/NHibernate/Criterion/Projections.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/Projections.cs 2008-11-02 18:28:25 UTC (rev 3884) +++ trunk/nhibernate/src/NHibernate/Criterion/Projections.cs 2008-11-02 22:02:59 UTC (rev 3885) @@ -253,6 +253,15 @@ return new ConstantProjection(obj); } + /// <summary> + /// Return a constant value + /// </summary> + /// <param name="obj">The obj.</param> + /// <returns></returns> + public static IProjection Constant(object obj,IType type) + { + return new ConstantProjection(obj,type); + } /// <summary> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Fixture.cs 2008-11-02 22:02:59 UTC (rev 3885) @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using NHibernate.Criterion; +using NHibernate.Dialect.Function; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1447 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void OnTearDown() + { + base.OnTearDown(); + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Delete("from Person"); + tx.Commit(); + } + } + } + + protected override void OnSetUp() + { + using (ISession s = OpenSession()) + { + using (ITransaction tx = s.BeginTransaction()) + { + var e1 = new Person("Tuna Toksoz",false); + var e2 = new Person("Oguz Kurumlu", true); + s.Save(e1); + tx.Commit(); + } + } + } + + [Test] + public void CanQueryByConstantProjectionWithType() + { + using (ISession s = OpenSession()) + { + ICriteria c = s.CreateCriteria(typeof (Person)) + .Add(Restrictions.EqProperty("WantsNewsletter", Projections.Constant(false,NHibernateUtil.Boolean))); + IList<Person> list = c.List<Person>(); + Assert.AreEqual(1, list.Count); + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Mappings.hbm.xml 2008-11-02 22:02:59 UTC (rev 3885) @@ -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.NH1447"> + + <class name="Person" lazy="false"> + <id name="Id"> + <generator class="native" /> + </id> + <property name="Name"/> + <property name="WantsNewsletter" type="Boolean"/> + </class> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1447/Person.cs 2008-11-02 22:02:59 UTC (rev 3885) @@ -0,0 +1,39 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1447 +{ + public class Person + { + public Person() + { + + } + + public Person(string name, bool isPerfect) + { + this.Name = name; + this.WantsNewsletter = isPerfect; + } + + public virtual int Id + { get; + set; + } + + public virtual string Name + { + get; + set; + } + public virtual bool WantsNewsletter + { + get; + set; + } + + } + +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-02 18:28:25 UTC (rev 3884) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-02 22:02:59 UTC (rev 3885) @@ -493,6 +493,8 @@ <Compile Include="NHSpecificTest\NH1419\Blog.cs" /> <Compile Include="NHSpecificTest\NH1419\Entry.cs" /> <Compile Include="NHSpecificTest\NH1419\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1447\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1447\Person.cs" /> <Compile Include="NHSpecificTest\NH1464\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1483\BaseClass.cs" /> <Compile Include="NHSpecificTest\NH1483\Fixture.cs" /> @@ -1511,6 +1513,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1447\Mappings.hbm.xml" /> <EmbeddedResource Include="TypesTest\EnumCharClass.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesWithColl.hbm.xml" /> <EmbeddedResource Include="Extendshbm\entitynamesWithColl.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-02 18:28:35
|
Revision: 3884 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3884&view=rev Author: tehlike Date: 2008-11-02 18:28:25 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Applying patch from Michael Montgomery with modifications (fix NH-1233) Introducing Enums with Char DB backend. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Type/EnumCharType.cs trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.cs trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.hbm.xml trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharTypeFixture.cs Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-02 17:37:44 UTC (rev 3883) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-02 18:28:25 UTC (rev 3884) @@ -1053,6 +1053,7 @@ <Compile Include="Type\CollectionType.cs" /> <Compile Include="Type\CustomCollectionType.cs" /> <Compile Include="Type\EmbeddedComponentType.cs" /> + <Compile Include="Type\EnumCharType.cs" /> <Compile Include="Type\EnumStringType`1.cs" /> <Compile Include="Type\GenericOrderedSetType.cs" /> <Compile Include="Type\ICacheAssembler.cs" /> Added: trunk/nhibernate/src/NHibernate/Type/EnumCharType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/EnumCharType.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Type/EnumCharType.cs 2008-11-02 18:28:25 UTC (rev 3884) @@ -0,0 +1,184 @@ +using System; +using System.Data; +using NHibernate.Engine; +using NHibernate.SqlTypes; + +namespace NHibernate.Type +{ + [Serializable] + public class EnumCharType<T> : ImmutableType, IDiscriminatorType + { + + public EnumCharType() : base(new StringFixedLengthSqlType(1)) + { + if (typeof(T).IsEnum) + { + this.enumClass = typeof(T); + } + else + { + throw new MappingException(enumClass.Name + " did not inherit from System.Enum"); + } + } + private readonly System.Type enumClass; + + public virtual object GetInstance(object code) + { + if (code is String) + { + return GetInstanceFromString((String) code); + } + else if (code is Char) + { + return GetInstanceFromChar((Char) code); + } + else + { + throw new HibernateException(string.Format("Can't Parse {0} as {1}", code, enumClass.Name)); + } + } + + private object GetInstanceFromString(String s) + { + if (s.Length == 0) throw new HibernateException(string.Format("Can't Parse empty string as {0}", enumClass.Name)); + + if (s.Length == 1) + { + //String representation of underlying char value e.g. "R" + return GetInstanceFromChar(s[0]); + } + else + { + //Name of enum value e.g. "Red" + try + { + return Enum.Parse(enumClass, s, false); + } + catch (ArgumentException) + { + try + { + return Enum.Parse(enumClass, s, true); + } + catch (ArgumentException ae) + { + throw new HibernateException(string.Format("Can't Parse {0} as {1}", s, enumClass.Name), ae); + } + } + } + } + + private object GetInstanceFromChar(Char c) + { + Object instance; + + instance = Enum.ToObject(enumClass, c); + if (Enum.IsDefined(enumClass, instance)) return instance; + + instance = Enum.ToObject(enumClass, Alternate(c)); + if (Enum.IsDefined(enumClass, instance)) return instance; + + throw new HibernateException(string.Format("Can't Parse {0} as {1}", c, enumClass.Name)); + } + + private Char Alternate(Char c) + { + return Char.IsUpper(c) ? Char.ToLower(c) : Char.ToUpper(c); + } + + /// <summary> + /// Converts the given enum instance into a basic type. + /// </summary> + /// <param name="instance"></param> + /// <returns></returns> + public virtual object GetValue(object instance) + { + if (instance == null) + { + return null; + } + else + { + return (Char) (Int32) instance; + } + } + + public override System.Type ReturnedClass + { + get { return enumClass; } + } + + public override void Set(IDbCommand cmd, object value, int index) + { + IDataParameter par = (IDataParameter) cmd.Parameters[index]; + if (value == null) + { + par.Value = DBNull.Value; + } + else + { + par.Value = ((Char) (Int32) (value)).ToString(); + } + } + + public override object Get(IDataReader rs, int index) + { + object code = rs[index]; + if (code == DBNull.Value || code == null) + { + return null; + } + else + { + return GetInstance(code); + } + } + + public override object Get(IDataReader rs, string name) + { + return Get(rs, rs.GetOrdinal(name)); + } + + public override string Name + { + get { return "enumchar - " + enumClass.Name; } + } + + public override string ToString(object value) + { + return (value == null) ? null : GetValue(value).ToString(); + } + + public override object Assemble(object cached, ISessionImplementor session, object owner) + { + if (cached == null) + { + return null; + } + else + { + return GetInstance(cached); + } + } + + public override object Disassemble(object value, ISessionImplementor session, object owner) + { + return (value == null) ? null : GetValue(value); + } + + public virtual object StringToObject(string xml) + { + return (string.IsNullOrEmpty(xml)) ? null : FromStringValue(xml); + } + + public override object FromStringValue(string xml) + { + return GetInstance(xml); + } + + public virtual string ObjectToSQLString(object value, Dialect.Dialect dialect) + { + return '\'' + GetValue(value).ToString() + '\''; + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-02 17:37:44 UTC (rev 3883) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-02 18:28:25 UTC (rev 3884) @@ -885,6 +885,8 @@ <Compile Include="TypesTest\DoubleTypeFixture.cs" /> <Compile Include="TypesTest\EntityClass.cs" /> <Compile Include="TypesTest\EntityTypeFixture.cs" /> + <Compile Include="TypesTest\EnumCharClass.cs" /> + <Compile Include="TypesTest\EnumCharTypeFixture.cs" /> <Compile Include="TypesTest\EnumStringClass.cs" /> <Compile Include="TypesTest\EnumStringTypeFixture.cs" /> <Compile Include="TypesTest\GuidClass.cs" /> @@ -1509,6 +1511,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="TypesTest\EnumCharClass.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesWithColl.hbm.xml" /> <EmbeddedResource Include="Extendshbm\entitynamesWithColl.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesf1.hbm.xml" /> Added: trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.cs 2008-11-02 18:28:25 UTC (rev 3884) @@ -0,0 +1,62 @@ +using System; +using NHibernate.Type; + +namespace NHibernate.Test.TypesTest +{ + public class EnumCharClass + { + private int _id; + private SampleCharEnum _enumValue; + + public int Id + { + get { return _id; } + set { _id = value; } + } + + public SampleCharEnum EnumValue + { + get { return _enumValue; } + set { _enumValue = value; } + } + } + + public enum SampleCharEnum + { + On = 'N', + Off = 'F', + Dimmed = 'D' + } + + + public class EnumCharFoo + { + private Int32 id; + + public virtual Int32 Id + { + get { return id; } + set { id = value; } + } + } + + public class EnumCharBar : EnumCharFoo {} + + public class EnumCharBaz + { + private Int32 id; + private SampleCharEnum type; + + public virtual Int32 Id + { + get { return id; } + set { id = value; } + } + + public virtual SampleCharEnum Type + { + get { return type; } + set { type = value; } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharClass.hbm.xml 2008-11-02 18:28:25 UTC (rev 3884) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false" namespace="NHibernate.Test.TypesTest" assembly="NHibernate.Test"> + <class name="EnumCharClass" table="bc_echr"> + <id name="Id"> + <generator class="assigned" /> + </id> + <property name="EnumValue" type="NHibernate.Type.EnumCharType`1[[NHibernate.Test.TypesTest.SampleCharEnum, NHibernate.Test]], NHibernate" column="enumc"/> + </class> + <class name="EnumCharFoo" table="bc_ecfoobarbaz" discriminator-value="Dimmed"> + <id name="Id"> + <generator class="assigned"/> + </id> + <discriminator type="NHibernate.Type.EnumCharType`1[[NHibernate.Test.TypesTest.SampleCharEnum, NHibernate.Test]], NHibernate" column="type"/> + <subclass name="EnumCharBar" discriminator-value="Off"/> + </class> + + <class name="EnumCharBaz" table="bc_ecfoobarbaz"> + <id name="Id"> + <generator class="assigned"/> + </id> + <property name="Type" column="type" type="NHibernate.Type.EnumCharType`1[[NHibernate.Test.TypesTest.SampleCharEnum, NHibernate.Test]], NHibernate"/> + </class> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharTypeFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharTypeFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/TypesTest/EnumCharTypeFixture.cs 2008-11-02 18:28:25 UTC (rev 3884) @@ -0,0 +1,146 @@ +using System.Collections; +using NHibernate.Type; +using NUnit.Framework; + +namespace NHibernate.Test.TypesTest +{ + [TestFixture] + public class EnumCharTypeFixture : TypeFixtureBase + { + protected override string TypeName + { + get { return "EnumChar"; } + } + + protected override void OnSetUp() + { + + EnumCharClass basic = new EnumCharClass(); + basic.Id = 1; + basic.EnumValue = SampleCharEnum.Dimmed; + + EnumCharClass basic2 = new EnumCharClass(); + basic2.Id = 2; + basic2.EnumValue = SampleCharEnum.On; + + ISession s = OpenSession(); + s.Save(basic); + s.Save(basic2); + s.Flush(); + s.Close(); + } + + protected override void OnTearDown() + { + ISession s = OpenSession(); + s.Delete("from EnumCharClass"); + s.Delete("from EnumCharBaz"); + s.Flush(); + s.Close(); + } + + [Test] + public void ReadFromLoad() + { + using (ISession s = OpenSession()) + { + EnumCharClass basic = (EnumCharClass) s.Load(typeof (EnumCharClass), 1); + Assert.AreEqual(SampleCharEnum.Dimmed, basic.EnumValue); + + EnumCharClass basic2 = (EnumCharClass) s.Load(typeof (EnumCharClass), 2); + Assert.AreEqual(SampleCharEnum.On, basic2.EnumValue); + } + } + + [Test] + public void ReadFromQueryUsingValue() + { + using (ISession s = OpenSession()) + { + IList results; + IQuery q = s.CreateQuery("from EnumCharClass as ecc where ecc.EnumValue=:value"); + + q.SetParameter("value", SampleCharEnum.On,new EnumCharType<SampleCharEnum>()); + results = q.List(); + + Assert.AreEqual(1, results.Count, "only 1 was 'On'"); + + q.SetParameter("value", SampleCharEnum.Off, new EnumCharType<SampleCharEnum>()); + results = q.List(); + + Assert.AreEqual(0, results.Count, "should not be any in the 'Off' status"); + } + } + + [Test] + public void ReadFromQueryUsingString() + { + using (ISession s = OpenSession()) + { + IList results; + IQuery q = s.CreateQuery("from EnumCharClass as ecc where ecc.EnumValue=:value"); + + q.SetString("value", "N"); + results = q.List(); + + Assert.AreEqual(1, results.Count, "only 1 was \"N\" string"); + + q.SetString("value", "F"); + results = q.List(); + + Assert.AreEqual(0, results.Count, "should not be any in the \"F\" string"); + } + } + + [Test] + public void ReadFromQueryUsingChar() + { + using (ISession s = OpenSession()) + { + IList results; + IQuery q = s.CreateQuery("from EnumCharClass as ecc where ecc.EnumValue=:value"); + + q.SetCharacter("value", 'N'); + results = q.List(); + + Assert.AreEqual(1, results.Count, "only 1 was 'N' char"); + + q.SetCharacter("value", 'F'); + results = q.List(); + + Assert.AreEqual(0, results.Count, "should not be any in the 'F' char"); + } + } + + [Test] + public void CanBeUsedAsDiscriminator() + { + EnumCharFoo foo = new EnumCharFoo(); + EnumCharBar bar = new EnumCharBar(); + + foo.Id = 1; + bar.Id = 2; + + using (ISession s = OpenSession()) + { + s.Save(foo); + s.Save(bar); + s.Flush(); + } + + using (ISession s = OpenSession()) + { + s.Load<EnumCharFoo>(1); + s.Load<EnumCharBar>(2); + + EnumCharBaz baz; + + baz = s.Load<EnumCharBaz>(1); + Assert.AreEqual(SampleCharEnum.Dimmed, baz.Type); + + baz = s.Load<EnumCharBaz>(2); + Assert.AreEqual(SampleCharEnum.Off, baz.Type); + } + } + } +} \ 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: <te...@us...> - 2008-11-02 17:37:49
|
Revision: 3883 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3883&view=rev Author: tehlike Date: 2008-11-02 17:37:44 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Marking EnumStringType`1 as [Serializable] Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs Modified: trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs 2008-11-02 17:16:59 UTC (rev 3882) +++ trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs 2008-11-02 17:37:44 UTC (rev 3883) @@ -4,6 +4,7 @@ namespace NHibernate.Type { + [Serializable] public class EnumStringType<T> : EnumStringType { public EnumStringType():base(typeof(T)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-02 17:17:04
|
Revision: 3882 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3882&view=rev Author: tehlike Date: 2008-11-02 17:16:59 +0000 (Sun, 02 Nov 2008) Log Message: ----------- Adding EnumStringType with generic arguments in order developer not to write specific classes for enums. (Fix NH-1544) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-10-30 11:33:34 UTC (rev 3881) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-02 17:16:59 UTC (rev 3882) @@ -1053,6 +1053,7 @@ <Compile Include="Type\CollectionType.cs" /> <Compile Include="Type\CustomCollectionType.cs" /> <Compile Include="Type\EmbeddedComponentType.cs" /> + <Compile Include="Type\EnumStringType`1.cs" /> <Compile Include="Type\GenericOrderedSetType.cs" /> <Compile Include="Type\ICacheAssembler.cs" /> <Compile Include="Type\OrderedSetType.cs" /> Added: trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs 2008-11-02 17:16:59 UTC (rev 3882) @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Type +{ + public class EnumStringType<T> : EnumStringType + { + public EnumStringType():base(typeof(T)) + { + + } + } +} Property changes on: trunk/nhibernate/src/NHibernate/Type/EnumStringType`1.cs ___________________________________________________________________ Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-30 12:02:52
|
Revision: 3881 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3881&view=rev Author: fabiomaulo Date: 2008-10-30 11:33:34 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Create the folder to compile NH where only NET3.5 is available Added Paths: ----------- trunk/nhibernate/lib/net/3.5/ trunk/nhibernate/lib/net/3.5/Castle.Core.dll trunk/nhibernate/lib/net/3.5/Castle.Core.xml trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy.license.txt trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.dll trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.xml trunk/nhibernate/lib/net/3.5/Iesi.Collections.dll trunk/nhibernate/lib/net/3.5/Iesi.Collections.license.txt trunk/nhibernate/lib/net/3.5/Iesi.Collections.xml trunk/nhibernate/lib/net/3.5/log4net.dll trunk/nhibernate/lib/net/3.5/log4net.license.txt trunk/nhibernate/lib/net/3.5/log4net.xml trunk/nhibernate/lib/net/3.5/nunit.core.dll trunk/nhibernate/lib/net/3.5/nunit.framework.dll trunk/nhibernate/lib/net/3.5/nunit.framework.license.txt Property changes on: trunk/nhibernate/lib/net/3.5 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/lib/net/3.5/Castle.Core.dll =================================================================== (Binary files differ) Property changes on: trunk/nhibernate/lib/net/3.5/Castle.Core.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/nhibernate/lib/net/3.5/Castle.Core.xml =================================================================== --- trunk/nhibernate/lib/net/3.5/Castle.Core.xml (rev 0) +++ trunk/nhibernate/lib/net/3.5/Castle.Core.xml 2008-10-30 11:33:34 UTC (rev 3881) @@ -0,0 +1,3176 @@ +<?xml version="1.0"?> +<doc> + <assembly> + <name>Castle.Core</name> + </assembly> + <members> + <member name="T:Castle.Core.CastleComponentAttribute"> + <summary> + This attribute is usefull only when you want to register all components + on an assembly as a batch process. + By doing so, the batch register will look + for this attribute to distinguish components from other classes. + </summary> + </member> + <member name="T:Castle.Core.LifestyleAttribute"> + <summary> + Base for Attributes that want to express lifestyle + chosen by the component. + </summary> + </member> + <member name="M:Castle.Core.LifestyleAttribute.#ctor(Castle.Core.LifestyleType)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.LifestyleAttribute"/> class. + </summary> + <param name="type">The type.</param> + </member> + <member name="P:Castle.Core.LifestyleAttribute.Lifestyle"> + <summary> + Gets or sets the lifestyle. + </summary> + <value>The lifestyle.</value> + </member> + <member name="M:Castle.Core.CastleComponentAttribute.#ctor(System.String)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.CastleComponentAttribute"/> class. + </summary> + <param name="key">The key.</param> + </member> + <member name="M:Castle.Core.CastleComponentAttribute.#ctor(System.String,System.Type)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.CastleComponentAttribute"/> class. + </summary> + <param name="key">The key.</param> + <param name="service">The service.</param> + </member> + <member name="M:Castle.Core.CastleComponentAttribute.#ctor(System.String,System.Type,Castle.Core.LifestyleType)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.CastleComponentAttribute"/> class. + </summary> + <param name="key">The key.</param> + <param name="service">The service.</param> + <param name="lifestyle">The lifestyle.</param> + </member> + <member name="P:Castle.Core.CastleComponentAttribute.Service"> + <summary> + Gets the service. + </summary> + <value>The service.</value> + </member> + <member name="P:Castle.Core.CastleComponentAttribute.Key"> + <summary> + Gets the key. + </summary> + <value>The key.</value> + </member> + <member name="T:Castle.Core.ComponentActivatorAttribute"> + <summary> + Associates a custom component with a component + </summary> + </member> + <member name="M:Castle.Core.ComponentActivatorAttribute.#ctor(System.Type)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.ComponentActivatorAttribute"/> class. + </summary> + <param name="componentActivatorType">Type of the component activator.</param> + </member> + <member name="P:Castle.Core.ComponentActivatorAttribute.ComponentActivatorType"> + <summary> + Gets the type of the component activator. + </summary> + <value>The type of the component activator.</value> + </member> + <member name="T:Castle.Core.ComponentProxyBehaviorAttribute"> + <summary> + Specifies the proxying behavior for a component. + </summary> + </member> + <member name="M:Castle.Core.ComponentProxyBehaviorAttribute.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.ComponentProxyBehaviorAttribute"/> class. + </summary> + </member> + <member name="P:Castle.Core.ComponentProxyBehaviorAttribute.UseMarshalByRefProxy"> + <summary> + Gets or sets a value indicating whether the generated + interface proxy should inherit from <see cref="T:System.MarshalByRefObject"/>. + </summary> + </member> + <member name="P:Castle.Core.ComponentProxyBehaviorAttribute.UseSingleInterfaceProxy"> + <summary> + Determines if the component requires a single interface proxy. + </summary> + <value><c>true</c> if the component requires a single interface proxy.</value> + </member> + <member name="P:Castle.Core.ComponentProxyBehaviorAttribute.AdditionalInterfaces"> + <summary> + Gets or sets the additional interfaces used during proxy generation. + </summary> + </member> + <member name="T:Castle.Core.DoNotWireAttribute"> + <summary> + Marks as property to be skipped and not be wired + by the IoC container + </summary> + </member> + <member name="T:Castle.Core.InterceptorAttribute"> + <summary> + Used to declare that a component wants interceptors acting on it. + </summary> + </member> + <member name="M:Castle.Core.InterceptorAttribute.#ctor(System.String)"> + <summary> + Constructs the InterceptorAttribute pointing to + a key to a interceptor + </summary> + <param name="componentKey"></param> + </member> + <member name="M:Castle.Core.InterceptorAttribute.#ctor(System.Type)"> + <summary> + Constructs the InterceptorAttribute pointing to + a service + </summary> + <param name="interceptorType"></param> + </member> + <member name="T:Castle.Core.SingletonAttribute"> + <summary> + Indicates that the target components wants a + singleton lifestyle. + </summary> + </member> + <member name="M:Castle.Core.SingletonAttribute.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.SingletonAttribute"/> class. + </summary> + </member> + <member name="T:Castle.Core.TransientAttribute"> + <summary> + Indicates that the target components wants a + transient lifestyle. + </summary> + </member> + <member name="M:Castle.Core.TransientAttribute.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.TransientAttribute"/> class. + </summary> + </member> + <member name="T:Castle.Core.PerThreadAttribute"> + <summary> + Indicates that the target components wants a + per thread lifestyle. + </summary> + </member> + <member name="M:Castle.Core.PerThreadAttribute.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.PerThreadAttribute"/> class. + </summary> + </member> + <member name="T:Castle.Core.PerWebRequestAttribute"> + <summary> + Indicates that the target components wants a + per web request lifestyle. + </summary> + </member> + <member name="T:Castle.Core.PooledAttribute"> + <summary> + Indicates that the target components wants a + pooled lifestyle. + </summary> + </member> + <member name="M:Castle.Core.PooledAttribute.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.PooledAttribute"/> class + using the default initial pool size (5) and the max pool size (15). + </summary> + </member> + <member name="M:Castle.Core.PooledAttribute.#ctor(System.Int32,System.Int32)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.PooledAttribute"/> class. + </summary> + <param name="initialPoolSize">Initial size of the pool.</param> + <param name="maxPoolSize">Max pool size.</param> + </member> + <member name="P:Castle.Core.PooledAttribute.InitialPoolSize"> + <summary> + Gets the initial size of the pool. + </summary> + <value>The initial size of the pool.</value> + </member> + <member name="P:Castle.Core.PooledAttribute.MaxPoolSize"> + <summary> + Gets the maximum pool size. + </summary> + <value>The size of the max pool.</value> + </member> + <member name="T:Castle.Core.CustomLifestyleAttribute"> + <summary> + Indicates that the target components wants a + custom lifestyle. + </summary> + </member> + <member name="M:Castle.Core.CustomLifestyleAttribute.#ctor(System.Type)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.Core.CustomLifestyleAttribute"/> class. + </summary> + <param name="lifestyleHandlerType">The lifestyle handler.</param> + </member> + <member name="P:Castle.Core.CustomLifestyleAttribute.LifestyleHandlerType"> + <summary> + Gets the type of the lifestyle handler. + </summary> + <value>The type of the lifestyle handler.</value> + </member> + <member name="T:Castle.Core.Interceptor.IInterceptor"> + <summary> + New interface that is going to be used by DynamicProxy 2 + </summary> + </member> + <member name="T:Castle.Core.Interceptor.IInvocation"> + <summary> + New interface that is going to be used by DynamicProxy 2 + </summary> + </member> + <member name="M:Castle.Core.Interceptor.IInvocation.GetConcreteMethod"> + <summary> + Returns the concrete instantiation of <see cref="P:Castle.Core.Interceptor.IInvocation.Method"/>, with any generic parameters bound to real types. + </summary> + <returns>The concrete instantiation of <see cref="P:Castle.Core.Interceptor.IInvocation.Method"/>, or <see cref="P:Castle.Core.Interceptor.IInvocation.Method"/> if not a generic method.</returns> + <remarks>Can be slower than calling <see cref="P:Castle.Core.Interceptor.IInvocation.Method"/>.</remarks> + </member> + <member name="M:Castle.Core.Interceptor.IInvocation.GetConcreteMethodInvocationTarget"> + <summary> + Returns the concrete instantiation of <see cref="P:Castle.Core.Interceptor.IInvocation.MethodInvocationTarget"/>, with any generic parameters bound to real types. + </summary> + <returns>The concrete instantiation of <see cref="P:Castle.Core.Interceptor.IInvocation.MethodInvocationTarget"/>, or <see cref="P:Castle.Core.Interceptor.IInvocation.MethodInvocationTarget"/> if not a generic method.</returns> + <remarks>Can be slower than calling <see cref="P:Castle.Core.Interceptor.IInvocation.MethodInvocationTarget"/>.</remarks> + </member> + <member name="M:Castle.Core.Interceptor.IInvocation.Proceed"> + <summary> + + </summary> + <returns></returns> + </member> + <member name="P:Castle.Core.Interceptor.IInvocation.GenericArguments"> + <summary> + The generic arguments of the method, or null if not a generic method. + </summary> + </member> + <member name="P:Castle.Core.Interceptor.IInvocation.Method"> + <summary> + + </summary> + </member> + <member name="P:Castle.Core.Interceptor.IInvocation.MethodInvocationTarget"> + <summary> + For interface proxies, this will point to the + <see cref="T:System.Reflection.MethodInfo"/> on the target class + </summary> + </member> + <member name="T:Castle.Core.Interceptor.IOnBehalfAware"> + <summary> + Interceptors might implement this to receive the + ComponentModel on behalf of the component where the + interceptor is acting. + </summary> + </member> + <member name="M:Castle.Core.Interceptor.IProxyTargetAccessor.DynProxyGetTarget"> + <summary> + Get the proxy target (note that null is a valid target!) + </summary> + <returns></returns> + </member> + <member name="M:Castle.Core.Interceptor.IProxyTargetAccessor.GetInterceptors"> + <summary> + Gets the interceptors for the proxy + </summary> + <returns></returns> + </member> + <member name="T:Castle.Core.IVertex"> + <summary> + Abstract representation of a vertex. + </summary> + </member> + <member name="P:Castle.Core.GraphNode.Dependers"> + <summary> + The nodes that dependes on this node + </summary> + </member> + <member name="P:Castle.Core.GraphNode.Dependents"> + <summary> + The nodes that this node depends + </summary> + </member> + <member name="F:Castle.Core.Internal.VertexColor.White"> + <summary> + The node has not been visited yet + </summary> + </member> + <member name="F:Castle.Core.Internal.VertexColor.Gray"> + <summary> + This node is in the process of being visited + </summary> + </member> + <member name="F:Castle.Core.Internal.VertexColor.Black"> + <summary> + This now was visited + </summary> + </member> + <member name="T:Castle.Core.Internal.ColorsSet"> + <summary> + Represents a collection of objects + which are guaranted to be unique + and holds a color for them + </summary> + </member> + <member name="T:Castle.Core.Internal.TimestampSet"> + <summary> + Holds a timestamp (integer) + for a given item + </summary> + </member> + <member name="M:Castle.Core.Internal.LinkedList.GetNode(System.Int32)"> + <summary> + Returns the node at the specified index. + </summary> + <param name="index">The lookup index.</param> + <returns>The node at the specified index.</returns> + <exception cref="T:System.ArgumentOutOfRangeException"> + If the specified <paramref name="index"/> is greater than the + number of objects within the list. + </exception> + </member> + <member name="M:Castle.Core.Internal.LinkedList.ValidateIndex(System.Int32)"> + <summary> + Validates the specified index. + </summary> + <param name="index">The lookup index.</param> + <exception cref="T:System.ArgumentOutOfRangeException"> + If the index is invalid. + </exception> + </member> + <member name="T:Castle.Core.IInitializable"> + <summary> + Lifecycle interface. If implemented by a component, + the method Initialized will be invoked by the container + before making the component available to the external world. + </summary> + </member> + <member name="M:Castle.Core.IInitializable.Initialize"> + <summary> + Implementors should perform any initialization logic. + </summary> + </member> + <member name="T:Castle.Core.IRecyclable"> + <summary> + Only called for components that + belongs to a pool when the component + comes back to the pool. + </summary> + </member> + <member name="M:Castle.Core.IRecyclable.Recycle"> + <summary> + Implementors should perform any + initialization/clean up. + </summary> + </member> + <member name="T:Castle.Core.IStartable"> + <summary> + Interface for components that wish to be started by the container + </summary> + </member> + <member name="M:Castle.Core.IStartable.Start"> + <summary> + Starts this instance. + </summary> + </member> + <member name="M:Castle.Core.IStartable.Stop"> + <summary> + Stops this instance. + </summary> + </member> + <member name="T:Castle.Core.Logging.IExtendedLoggerFactory"> + <summary> + Provides a factory that can produce either <see cref="T:Castle.Core.Logging.ILogger"/> or + <see cref="T:Castle.Core.Logging.IExtendedLogger"/> classes. + </summary> + </member> + <member name="T:Castle.Core.Logging.ILoggerFactory"> + <summary> + Manages the instantiation of <see cref="T:Castle.Core.Logging.ILogger"/>s. + </summary> + </member> + <member name="M:Castle.Core.Logging.ILoggerFactory.Create(System.Type)"> + <summary> + Creates a new logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.ILoggerFactory.Create(System.String)"> + <summary> + Creates a new logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.ILoggerFactory.Create(System.Type,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.ILoggerFactory.Create(System.String,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.IExtendedLoggerFactory.Create(System.Type)"> + <summary> + Creates a new extended logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.IExtendedLoggerFactory.Create(System.String)"> + <summary> + Creates a new extended logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.IExtendedLoggerFactory.Create(System.Type,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new extended logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.IExtendedLoggerFactory.Create(System.String,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new extended logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Create(System.Type)"> + <summary> + Creates a new extended logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Create(System.String)"> + <summary> + Creates a new extended logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Create(System.Type,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new extended logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Create(System.String,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new extended logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Castle#Core#Logging#ILoggerFactory#Create(System.Type)"> + <summary> + Creates a new logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Castle#Core#Logging#ILoggerFactory#Create(System.String)"> + <summary> + Creates a new logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Castle#Core#Logging#ILoggerFactory#Create(System.Type,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new logger, getting the logger name from the specified type. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.Castle#Core#Logging#ILoggerFactory#Create(System.String,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates a new logger. + </summary> + </member> + <member name="M:Castle.Core.Logging.Factories.AbstractExtendedLoggerFactory.GetConfigFile(System.String)"> + <summary> + Gets the configuration file. + </summary> + <param name="fileName">i.e. log4net.config</param> + <returns></returns> + </member> + <member name="M:Castle.Core.Logging.AbstractLoggerFactory.GetConfigFile(System.String)"> + <summary> + Gets the configuration file. + </summary> + <param name="fileName">i.e. log4net.config</param> + <returns></returns> + </member> + <member name="T:Castle.Core.Logging.ConsoleFactory"> + <summary> + Summary description for ConsoleFactory. + </summary> + </member> + <member name="T:Castle.Core.Logging.NullLogFactory"> + <summary> + NullLogFactory used when logging is turned off. + </summary> + </member> + <member name="M:Castle.Core.Logging.NullLogFactory.Create(System.String)"> + <summary> + Creates an instance of ILogger with the specified name. + </summary> + <param name="name">Name.</param> + <returns></returns> + </member> + <member name="M:Castle.Core.Logging.NullLogFactory.Create(System.String,Castle.Core.Logging.LoggerLevel)"> + <summary> + Creates an instance of ILogger with the specified name and LoggerLevel. + </summary> + <param name="name">Name.</param> + <param name="level">Level.</param> + <returns></returns> + </member> + <member name="T:Castle.Core.Logging.StreamLoggerFactory"> + <summary> + Creates <see cref="T:Castle.Core.Logging.StreamLogger"/> outputing + to files. The name of the file is derived from the log name + plus the 'log' extension. + </summary> + </member> + <member name="T:Castle.Core.Logging.TraceLoggerFactory"> + <summary> + Used to create the TraceLogger implementation of ILogger interface. See <see cref="T:Castle.Core.Logging.TraceLogger"/>. + </summary> + </member> + <member name="T:Castle.Core.Logging.ConsoleLogger"> + <summary> + The Logger sending everything to the standard output streams. + This is mainly for the cases when you have a utility that + does not have a logger to supply. + </summary> + </member> + <member name="T:Castle.Core.Logging.LevelFilteredLogger"> + <summary> + The Level Filtered Logger class. This is a base clase which + provides a LogLevel attribute and reroutes all functions into + one Log method. + </summary> + </member> + <member name="T:Castle.Core.Logging.ILogger"> + <summary> + Manages logging. + </summary> + <remarks> + This is a facade for the different logging subsystems. + It offers a simplified interface that follows IOC patterns + and a simplified priority/level/severity abstraction. + </remarks> + </member> + <member name="M:Castle.Core.Logging.ILogger.Debug(System.String)"> + <summary> + Logs a debug message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Debug(System.String,System.Exception)"> + <summary> + Logs a debug message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Debug(System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.DebugFormat(System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.DebugFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.DebugFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.DebugFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Info(System.String)"> + <summary> + Logs an info message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Info(System.String,System.Exception)"> + <summary> + Logs an info message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Info(System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.InfoFormat(System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.InfoFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.InfoFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.InfoFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Warn(System.String)"> + <summary> + Logs a warn message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Warn(System.String,System.Exception)"> + <summary> + Logs a warn message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Warn(System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.WarnFormat(System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.WarnFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.WarnFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.WarnFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Error(System.String)"> + <summary> + Logs an error message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Error(System.String,System.Exception)"> + <summary> + Logs an error message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Error(System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.ErrorFormat(System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.ErrorFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.ErrorFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Fatal(System.String)"> + <summary> + Logs a fatal message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Fatal(System.String,System.Exception)"> + <summary> + Logs a fatal message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.Fatal(System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.FatalFormat(System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.FatalFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.FatalFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.FatalFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.FatalError(System.String)"> + <summary> + Logs a fatal error message. + </summary> + <param name="message">The Message</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.FatalError(System.String,System.Exception)"> + <summary> + Logs a fatal error message. + </summary> + <param name="message">The Message</param> + <param name="exception">The Exception</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.FatalError(System.String,System.Object[])"> + <summary> + Logs a fatal error message. + </summary> + <param name="format">Message format</param> + <param name="args">Array of objects to write using format</param> + </member> + <member name="M:Castle.Core.Logging.ILogger.CreateChildLogger(System.String)"> + <summary> + Create a new child logger. + The name of the child logger is [current-loggers-name].[passed-in-name] + </summary> + <param name="loggerName">The Subname of this logger.</param> + <returns>The New ILogger instance.</returns> + <exception cref="T:System.ArgumentException">If the name has an empty element name.</exception> + </member> + <member name="P:Castle.Core.Logging.ILogger.IsDebugEnabled"> + <summary> + Determines if messages of priority "debug" will be logged. + </summary> + <value>True if "debug" messages will be logged.</value> + </member> + <member name="P:Castle.Core.Logging.ILogger.IsInfoEnabled"> + <summary> + Determines if messages of priority "info" will be logged. + </summary> + <value>True if "info" messages will be logged.</value> + </member> + <member name="P:Castle.Core.Logging.ILogger.IsWarnEnabled"> + <summary> + Determines if messages of priority "warn" will be logged. + </summary> + <value>True if "warn" messages will be logged.</value> + </member> + <member name="P:Castle.Core.Logging.ILogger.IsErrorEnabled"> + <summary> + Determines if messages of priority "error" will be logged. + </summary> + <value>True if "error" messages will be logged.</value> + </member> + <member name="P:Castle.Core.Logging.ILogger.IsFatalEnabled"> + <summary> + Determines if messages of priority "fatal" will be logged. + </summary> + <value>True if "fatal" messages will be logged.</value> + </member> + <member name="P:Castle.Core.Logging.ILogger.IsFatalErrorEnabled"> + <summary> + Determines if messages of priority "fatalError" will be logged. + </summary> + <value>True if "fatalError" messages will be logged.</value> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.#ctor"> + <summary> + Creates a new <c>LevelFilteredLogger</c>. + </summary> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.InitializeLifetimeService"> + <summary> + Keep the instance alive in a remoting scenario + </summary> + <returns></returns> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Debug(System.String)"> + <summary> + Logs a debug message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Debug(System.String,System.Exception)"> + <summary> + Logs a debug message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.DebugFormat(System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.DebugFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.DebugFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.DebugFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Debug(System.String,System.Object[])"> + <summary> + Logs a debug message. + </summary> + <param name="format">Message format</param> + <param name="args">Array of objects to write using format</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Info(System.String)"> + <summary> + Logs an info message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Info(System.String,System.Exception)"> + <summary> + Logs an info message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.InfoFormat(System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.InfoFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.InfoFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.InfoFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Info(System.String,System.Object[])"> + <summary> + Logs an info message. + </summary> + <param name="format">Message format</param> + <param name="args">Array of objects to write using format</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Warn(System.String)"> + <summary> + Logs a warn message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Warn(System.String,System.Exception)"> + <summary> + Logs a warn message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.WarnFormat(System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.WarnFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.WarnFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.WarnFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Warn(System.String,System.Object[])"> + <summary> + Logs a warn message. + </summary> + <param name="format">Message format</param> + <param name="args">Array of objects to write using format</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Error(System.String)"> + <summary> + Logs an error message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Error(System.String,System.Exception)"> + <summary> + Logs an error message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.ErrorFormat(System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.ErrorFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.ErrorFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Error(System.String,System.Object[])"> + <summary> + Logs an error message. + </summary> + <param name="format">Message format</param> + <param name="args">Array of objects to write using format</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Fatal(System.String)"> + <summary> + Logs a fatal message. + </summary> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Fatal(System.String,System.Exception)"> + <summary> + Logs a fatal message. + </summary> + <param name="exception">The exception to log</param> + <param name="message">The message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.FatalFormat(System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.FatalFormat(System.Exception,System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="exception">The exception to log</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.FatalFormat(System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.FatalFormat(System.Exception,System.IFormatProvider,System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="exception">The exception to log</param> + <param name="formatProvider">The format provider to use</param> + <param name="format">Format string for the message to log</param> + <param name="args">Format arguments for the message to log</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Fatal(System.String,System.Object[])"> + <summary> + Logs a fatal message. + </summary> + <param name="format">Message format</param> + <param name="args">Array of objects to write using format</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.FatalError(System.String)"> + <summary> + Logs a fatal error message. + </summary> + <param name="message">The Message</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.FatalError(System.String,System.Exception)"> + <summary> + Logs a fatal error message. + </summary> + <param name="message">The Message</param> + <param name="exception">The Exception</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.FatalError(System.String,System.Object[])"> + <summary> + Logs a fatal error message. + </summary> + <param name="format">Message format</param> + <param name="args">Array of objects to write using format</param> + </member> + <member name="M:Castle.Core.Logging.LevelFilteredLogger.Log(Castle.Core.Logging.LoggerLevel,System.String,System.String,System.Exception)"> + <summary> + Implementors output the log content by implementing this method only. + Note that exception can be null + </summary> + <param name="loggerLevel"></param> + <param name="loggerName"></param> + <param name="message"></param> + <param name="exception"></param> + </member> + <member name="P:Castle.Core.Logging.LevelFilteredLogger.Level"> + <value> + The <c>LoggerLevel</c> that this logger + will be using. Defaults to <c>LoggerLevel.Off</c> + </value> + </member> + <member name="P:Castle.Core.Logging.LevelFilteredLogger.Name"> + <value> + The name that this logger will be using. + Defaults to <c>String.Empty</c> + </value> + </member> + <member name="P:Castle.Core.Logging.LevelFilteredLogger.IsDebugEnabled"> + <summary> + Determines if messages of priority "debug" will be logged. + </summary> + <value><c>true</c> if log level flags include the <see cref="F:Castle.Core.Logging.LoggerLevel.Debug"/> bit</value> + </member> + <member name="P:Castle.Core.Logging.LevelFilteredLogger.IsInfoEnabled"> + <summary> + Determines if messages of priority "info" will be logged. + </summary> + <value><c>true</c> if log level flags include the <see cref="F:Castle.Core.Logging.LoggerLevel.Info"/> bit</value> + </member> + <member name="P:Castle.Core.Logging.LevelFilteredLogger.IsWarnEnabled"> + <summary> + Determines if messages of priority "warn" will be logged. + </summary> + <value><c>true</c> if log level flags include the... [truncated message content] |
From: T. T. <te...@gm...> - 2008-10-28 22:01:24
|
Thank you very much Chad, I have to work on this issue more, and learn not to do hardcoding. On Tue, Oct 28, 2008 at 11:56 PM, <cha...@us...> wrote: > Revision: 3880 > > http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3880&view=rev > Author: chadly69 > Date: 2008-10-28 21:56:07 +0000 (Tue, 28 Oct 2008) > > Log Message: > ----------- > Temporarily reverting r3871 (fix for NH-1090) - was causing issues for > NHibernate.Linq in NH Contrib. > > Modified Paths: > -------------- > trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs > trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs > > trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs > trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj > trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs > > Removed Paths: > ------------- > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/ > > Property Changed: > ---------------- > trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj > trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj > trunk/nhibernate/src/NHibernate/NHibernate.csproj > trunk/nhibernate/src/NHibernate/Properties/BackFieldStrategy.cs > trunk/nhibernate/src/NHibernate/Properties/XmlAccessor.cs > trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs > > trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj > trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj > trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpression.cs > trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpressionType.cs > > trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToManyPropertyExpression.cs > > trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToOnePropertyExpression.cs > > trunk/nhibernate/src/NHibernate.Linq/Expressions/QueryParameterExpression.cs > > trunk/nhibernate/src/NHibernate.Linq/Expressions/QuerySourceExpression.cs > trunk/nhibernate/src/NHibernate.Linq/Query/ > > trunk/nhibernate/src/NHibernate.Linq/Visitors/AssociationRewriteVisitor.cs > > trunk/nhibernate/src/NHibernate.Linq/Visitors/NHExpressionToSqlExpressionTransformer.cs > trunk/nhibernate/src/NHibernate.Linq/Visitors/OrderByTransformer.cs > trunk/nhibernate/src/NHibernate.Linq/Visitors/Replacer.cs > trunk/nhibernate/src/NHibernate.Linq/Visitors/SqlExpressionTranslator.cs > trunk/nhibernate/src/NHibernate.Linq/Visitors/WhereExpressionCombiner.cs > trunk/nhibernate/src/NHibernate.Linq.Test/ExpressionEqualityChecker.cs > > trunk/nhibernate/src/NHibernate.Linq.Test/VisitorTests/WhereExpressionCombinerTests.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CustomProxyFixture.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Mappings.hbm.xml > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestCase.cs > > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestConfigurationHelper.cs > trunk/nhibernate/src/NHibernate.Test/Any/IPropertyValue.cs > > trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/DynamicClassFixture.cs > > trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/ProductLine.hbm.xml > trunk/nhibernate/src/NHibernate.Test/Events/Collections/IEntity.cs > > trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml > > trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml > trunk/nhibernate/src/NHibernate.Test/GenericTest/OrderedSetGeneric/B.cs > trunk/nhibernate/src/NHibernate.Test/HQL/ > trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Animal.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Reptile.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Domain.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Fixture.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Mappings.hbm.xml > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CategoryTD.hbm.xml > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CustomVersionType.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/UserTypeTimestamp.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1362/ > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1399/Fixture.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Female.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Fixture.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Hobby.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Male.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Mappings.hbm.xml > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Person.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Column.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Fixture.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Mappings.hbm.xml > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Foo.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Mappings.hbm.xml > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Blog.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Entry.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Fixture.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Mappings.hbm.xml > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Domain.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Mappings.hbm.xml > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/ChildEntity.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Entity.cs > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Fixture.cs > > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Mappings.hbm.xml > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Domain.cs > trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj > > trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj > > > Property changes on: > trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > Modified: trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs > =================================================================== > --- trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-10-25 > 20:06:57 UTC (rev 3879) > +++ trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-10-28 > 21:56:07 UTC (rev 3880) > @@ -151,16 +151,7 @@ > CriteriaImpl critImp = > criteriaQueries[i] as CriteriaImpl; > if(critImp==null || > critImp.ResultTransformer==null) > continue; > - ArrayList resultForOneCriteria = > ((ArrayList) results[i]); > - for (int j = 0; j < > resultForOneCriteria.Count; j++) > - { > - if > (!(critImp.ResultTransformer is RootEntityResultTransformer)) > - { > - object[] > itemsForOneRow = (object[]) resultForOneCriteria[j]; > - > resultForOneCriteria[j] = > critImp.ResultTransformer.TransformTuple(itemsForOneRow, new string[] {}); > - } > - } > - > critImp.ResultTransformer.TransformList(resultForOneCriteria); > + results[i] = > critImp.ResultTransformer.TransformList((IList)results[i]); > } > } > return results; > > Modified: trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs > =================================================================== > --- trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs > 2008-10-25 20:06:57 UTC (rev 3879) > +++ trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs > 2008-10-28 21:56:07 UTC (rev 3880) > @@ -1,4 +1,3 @@ > -using System; > using System.Collections; > using System.Collections.Generic; > using System.Data; > @@ -29,7 +28,7 @@ > private readonly string[] userAliases; > > public CriteriaLoader(IOuterJoinLoadable persister, > ISessionFactoryImplementor factory, CriteriaImpl rootCriteria, > - string > rootEntityName, IDictionary<string, IFilter> enabledFilters) > + string rootEntityName, > IDictionary<string, IFilter> enabledFilters) > : base(factory, enabledFilters) > { > translator = new CriteriaQueryTranslator(factory, > rootCriteria, rootEntityName, CriteriaQueryTranslator.RootSqlAlias); > @@ -75,9 +74,10 @@ > } > > protected override object GetResultColumnOrRow(object[] row, > IResultTransformer resultTransformer, IDataReader rs, > - > ISessionImplementor session) > + > ISessionImplementor session) > { > object[] result; > + string[] aliases; > > if (translator.HasProjection) > { > @@ -96,15 +96,11 @@ > result = row; > aliases = userAliases; > } > - if (translator.RootCriteria.ResultTransformer is > RootEntityResultTransformer) > - return row[row.Length-1]; > - else > - return result; > + return > translator.RootCriteria.ResultTransformer.TransformTuple(result, aliases); > } > > - private string[] aliases; > protected override SqlString ApplyLocks(SqlString > sqlSelectString, IDictionary<string, LockMode> lockModes, > - > Dialect.Dialect dialect) > + Dialect.Dialect > dialect) > { > if (lockModes == null || lockModes.Count == 0) > { > @@ -119,7 +115,7 @@ > LockMode lockMode; > if > (lockModes.TryGetValue(drivingSqlAliases[i], out lockMode)) > { > - ILockable drivingPersister = > (ILockable)EntityPersisters[i]; > + ILockable drivingPersister = > (ILockable) EntityPersisters[i]; > string rootSqlAlias = > drivingPersister.GetRootTableAlias(drivingSqlAliases[i]); > aliasedLockModes[rootSqlAlias] = > lockMode; > if (keyColumnNames != null) > @@ -155,15 +151,7 @@ > > protected override IList GetResultList(IList results, > IResultTransformer resultTransformer) > { > - if (!(resultTransformer is > RootEntityResultTransformer)) > - { > - for (int i = 0; i < results.Count; i++) > - { > - object[] row = (object[]) > results[i]; > - results[i] = > resultTransformer.TransformTuple(row, aliases); > - } > - } > - return resultTransformer.TransformList(results); > + return > translator.RootCriteria.ResultTransformer.TransformList(results); > } > } > } > \ No newline at end of file > > Modified: > trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs > =================================================================== > --- > trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs > 2008-10-25 20:06:57 UTC (rev 3879) > +++ > trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs > 2008-10-28 21:56:07 UTC (rev 3880) > @@ -62,7 +62,7 @@ > } > > [CLSCompliant(false)] // TODO: Why does this cause a problem > in 1.1 > - public string RootSQLAlias > + public string RootSQLAlias > { > get { return rootSQLAlias; } > } > > > Property changes on: trunk/nhibernate/src/NHibernate/NHibernate.csproj > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate/Properties/BackFieldStrategy.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate/Properties/XmlAccessor.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpression.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpressionType.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToManyPropertyExpression.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToOnePropertyExpression.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Expressions/QueryParameterExpression.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Expressions/QuerySourceExpression.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: trunk/nhibernate/src/NHibernate.Linq/Query > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Visitors/AssociationRewriteVisitor.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Visitors/NHExpressionToSqlExpressionTransformer.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Visitors/OrderByTransformer.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Visitors/Replacer.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Visitors/SqlExpressionTranslator.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq/Visitors/WhereExpressionCombiner.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq.Test/ExpressionEqualityChecker.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Linq.Test/VisitorTests/WhereExpressionCombinerTests.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CustomProxyFixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestCase.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestConfigurationHelper.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/Any/IPropertyValue.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/DynamicClassFixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/ProductLine.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/Events/Collections/IEntity.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/GenericTest/OrderedSetGeneric/B.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: trunk/nhibernate/src/NHibernate.Test/HQL > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Animal.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Reptile.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Domain.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Fixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CategoryTD.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CustomVersionType.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/UserTypeTimestamp.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1362 > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1399/Fixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Female.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Fixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Hobby.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Male.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Person.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Column.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Fixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Foo.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Blog.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Entry.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Fixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Domain.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/ChildEntity.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Entity.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Fixture.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Mappings.hbm.xml > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Domain.cs > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj > =================================================================== > --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-25 > 20:06:57 UTC (rev 3879) > +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-28 > 21:56:07 UTC (rev 3880) > @@ -380,10 +380,6 @@ > <Compile Include="NHSpecificTest\NH1033\Reptile.cs" /> > <Compile Include="NHSpecificTest\NH1077\A.cs" /> > <Compile Include="NHSpecificTest\NH1077\Fixture.cs" /> > - <Compile Include="NHSpecificTest\NH1090\Fixture.cs" /> > - <Compile Include="NHSpecificTest\NH1090\MainClass.cs" /> > - <Compile Include="NHSpecificTest\NH1090\MainClassDescriptionOnly.cs" > /> > - <Compile > Include="NHSpecificTest\NH1090\TuppleToPropertyResultTransformer.cs" /> > <Compile Include="NHSpecificTest\NH1098\FilterParameterOrderFixture.cs" > /> > <Compile Include="NHSpecificTest\NH1098\Model.cs" /> > <Compile Include="NHSpecificTest\NH1101\Domain.cs" /> > @@ -1517,7 +1513,6 @@ > <EmbeddedResource Include="Extendshbm\entitynamesWithColl.hbm.xml" /> > <EmbeddedResource Include="Extendshbm\packageentitynamesf1.hbm.xml" /> > <EmbeddedResource Include="Extendshbm\packageentitynamesf2.hbm.xml" /> > - <EmbeddedResource Include="NHSpecificTest\NH1090\Mappings.hbm.xml" /> > <EmbeddedResource Include="NHSpecificTest\NH662\Mappings.hbm.xml" /> > <EmbeddedResource Include="NHSpecificTest\NH1495\Mappings.hbm.xml" /> > <EmbeddedResource Include="ProjectionFixtures\Mapping.hbm.xml" /> > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > Modified: > trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs > =================================================================== > --- trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs > 2008-10-25 20:06:57 UTC (rev 3879) > +++ trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs > 2008-10-28 21:56:07 UTC (rev 3880) > @@ -146,7 +146,7 @@ > firstQueryResults.Add(4); > > IList secondQueryResults = (IList)cachedQuery[1]; > - secondQueryResults[0] = new object[]{2}; > + secondQueryResults[0] = 2; > > using (ISession s = sessions.OpenSession()) > { > > > Property changes on: > trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj > ___________________________________________________________________ > Deleted: svn:mergeinfo > - > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Nhibernate-commit mailing list > Nhi...@li... > https://lists.sourceforge.net/lists/listinfo/nhibernate-commit > -- Tuna Toksöz Typos included to enhance the readers attention! |
From: <cha...@us...> - 2008-10-28 21:56:13
|
Revision: 3880 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3880&view=rev Author: chadly69 Date: 2008-10-28 21:56:07 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Temporarily reverting r3871 (fix for NH-1090) - was causing issues for NHibernate.Linq in NH Contrib. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/ Property Changed: ---------------- trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Properties/BackFieldStrategy.cs trunk/nhibernate/src/NHibernate/Properties/XmlAccessor.cs trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpression.cs trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpressionType.cs trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToManyPropertyExpression.cs trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToOnePropertyExpression.cs trunk/nhibernate/src/NHibernate.Linq/Expressions/QueryParameterExpression.cs trunk/nhibernate/src/NHibernate.Linq/Expressions/QuerySourceExpression.cs trunk/nhibernate/src/NHibernate.Linq/Query/ trunk/nhibernate/src/NHibernate.Linq/Visitors/AssociationRewriteVisitor.cs trunk/nhibernate/src/NHibernate.Linq/Visitors/NHExpressionToSqlExpressionTransformer.cs trunk/nhibernate/src/NHibernate.Linq/Visitors/OrderByTransformer.cs trunk/nhibernate/src/NHibernate.Linq/Visitors/Replacer.cs trunk/nhibernate/src/NHibernate.Linq/Visitors/SqlExpressionTranslator.cs trunk/nhibernate/src/NHibernate.Linq/Visitors/WhereExpressionCombiner.cs trunk/nhibernate/src/NHibernate.Linq.Test/ExpressionEqualityChecker.cs trunk/nhibernate/src/NHibernate.Linq.Test/VisitorTests/WhereExpressionCombinerTests.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CustomProxyFixture.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestCase.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestConfigurationHelper.cs trunk/nhibernate/src/NHibernate.Test/Any/IPropertyValue.cs trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/DynamicClassFixture.cs trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/ProductLine.hbm.xml trunk/nhibernate/src/NHibernate.Test/Events/Collections/IEntity.cs trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml trunk/nhibernate/src/NHibernate.Test/GenericTest/OrderedSetGeneric/B.cs trunk/nhibernate/src/NHibernate.Test/HQL/ trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Animal.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Reptile.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Domain.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CategoryTD.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CustomVersionType.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/UserTypeTimestamp.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1362/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1399/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Female.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Hobby.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Male.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Person.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Column.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Foo.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Blog.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Entry.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Domain.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/ChildEntity.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Entity.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Domain.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj Property changes on: trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj ___________________________________________________________________ Deleted: svn:mergeinfo - Modified: trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-10-25 20:06:57 UTC (rev 3879) +++ trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-10-28 21:56:07 UTC (rev 3880) @@ -151,16 +151,7 @@ CriteriaImpl critImp = criteriaQueries[i] as CriteriaImpl; if(critImp==null || critImp.ResultTransformer==null) continue; - ArrayList resultForOneCriteria = ((ArrayList) results[i]); - for (int j = 0; j < resultForOneCriteria.Count; j++) - { - if (!(critImp.ResultTransformer is RootEntityResultTransformer)) - { - object[] itemsForOneRow = (object[]) resultForOneCriteria[j]; - resultForOneCriteria[j] = critImp.ResultTransformer.TransformTuple(itemsForOneRow, new string[] {}); - } - } - critImp.ResultTransformer.TransformList(resultForOneCriteria); + results[i] = critImp.ResultTransformer.TransformList((IList)results[i]); } } return results; Modified: trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs 2008-10-25 20:06:57 UTC (rev 3879) +++ trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs 2008-10-28 21:56:07 UTC (rev 3880) @@ -1,4 +1,3 @@ -using System; using System.Collections; using System.Collections.Generic; using System.Data; @@ -29,7 +28,7 @@ private readonly string[] userAliases; public CriteriaLoader(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl rootCriteria, - string rootEntityName, IDictionary<string, IFilter> enabledFilters) + string rootEntityName, IDictionary<string, IFilter> enabledFilters) : base(factory, enabledFilters) { translator = new CriteriaQueryTranslator(factory, rootCriteria, rootEntityName, CriteriaQueryTranslator.RootSqlAlias); @@ -75,9 +74,10 @@ } protected override object GetResultColumnOrRow(object[] row, IResultTransformer resultTransformer, IDataReader rs, - ISessionImplementor session) + ISessionImplementor session) { object[] result; + string[] aliases; if (translator.HasProjection) { @@ -96,15 +96,11 @@ result = row; aliases = userAliases; } - if (translator.RootCriteria.ResultTransformer is RootEntityResultTransformer) - return row[row.Length-1]; - else - return result; + return translator.RootCriteria.ResultTransformer.TransformTuple(result, aliases); } - private string[] aliases; protected override SqlString ApplyLocks(SqlString sqlSelectString, IDictionary<string, LockMode> lockModes, - Dialect.Dialect dialect) + Dialect.Dialect dialect) { if (lockModes == null || lockModes.Count == 0) { @@ -119,7 +115,7 @@ LockMode lockMode; if (lockModes.TryGetValue(drivingSqlAliases[i], out lockMode)) { - ILockable drivingPersister = (ILockable)EntityPersisters[i]; + ILockable drivingPersister = (ILockable) EntityPersisters[i]; string rootSqlAlias = drivingPersister.GetRootTableAlias(drivingSqlAliases[i]); aliasedLockModes[rootSqlAlias] = lockMode; if (keyColumnNames != null) @@ -155,15 +151,7 @@ protected override IList GetResultList(IList results, IResultTransformer resultTransformer) { - if (!(resultTransformer is RootEntityResultTransformer)) - { - for (int i = 0; i < results.Count; i++) - { - object[] row = (object[]) results[i]; - results[i] = resultTransformer.TransformTuple(row, aliases); - } - } - return resultTransformer.TransformList(results); + return translator.RootCriteria.ResultTransformer.TransformList(results); } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2008-10-25 20:06:57 UTC (rev 3879) +++ trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2008-10-28 21:56:07 UTC (rev 3880) @@ -62,7 +62,7 @@ } [CLSCompliant(false)] // TODO: Why does this cause a problem in 1.1 - public string RootSQLAlias + public string RootSQLAlias { get { return rootSQLAlias; } } Property changes on: trunk/nhibernate/src/NHibernate/NHibernate.csproj ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate/Properties/BackFieldStrategy.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate/Properties/XmlAccessor.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpression.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Expressions/NHExpressionType.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToManyPropertyExpression.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Expressions/OneToOnePropertyExpression.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Expressions/QueryParameterExpression.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Expressions/QuerySourceExpression.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Query ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Visitors/AssociationRewriteVisitor.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Visitors/NHExpressionToSqlExpressionTransformer.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Visitors/OrderByTransformer.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Visitors/Replacer.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Visitors/SqlExpressionTranslator.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq/Visitors/WhereExpressionCombiner.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq.Test/ExpressionEqualityChecker.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Linq.Test/VisitorTests/WhereExpressionCombinerTests.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CustomProxyFixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestCase.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestConfigurationHelper.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/Any/IPropertyValue.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/DynamicClassFixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Map/Basic/ProductLine.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/Events/Collections/IEntity.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/GenericTest/OrderedSetGeneric/B.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/HQL ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Animal.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1033/Reptile.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Domain.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Fixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1293/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CategoryTD.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/CustomVersionType.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1355/UserTypeTimestamp.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1362 ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1399/Fixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Female.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Fixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Hobby.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Male.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1403/Person.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Column.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Fixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1405/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Foo.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Blog.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Entry.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Fixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1419/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Domain.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/ChildEntity.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Entity.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Fixture.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1492/Mappings.hbm.xml ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Domain.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-25 20:06:57 UTC (rev 3879) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-28 21:56:07 UTC (rev 3880) @@ -380,10 +380,6 @@ <Compile Include="NHSpecificTest\NH1033\Reptile.cs" /> <Compile Include="NHSpecificTest\NH1077\A.cs" /> <Compile Include="NHSpecificTest\NH1077\Fixture.cs" /> - <Compile Include="NHSpecificTest\NH1090\Fixture.cs" /> - <Compile Include="NHSpecificTest\NH1090\MainClass.cs" /> - <Compile Include="NHSpecificTest\NH1090\MainClassDescriptionOnly.cs" /> - <Compile Include="NHSpecificTest\NH1090\TuppleToPropertyResultTransformer.cs" /> <Compile Include="NHSpecificTest\NH1098\FilterParameterOrderFixture.cs" /> <Compile Include="NHSpecificTest\NH1098\Model.cs" /> <Compile Include="NHSpecificTest\NH1101\Domain.cs" /> @@ -1517,7 +1513,6 @@ <EmbeddedResource Include="Extendshbm\entitynamesWithColl.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesf1.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesf2.hbm.xml" /> - <EmbeddedResource Include="NHSpecificTest\NH1090\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH662\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1495\Mappings.hbm.xml" /> <EmbeddedResource Include="ProjectionFixtures\Mapping.hbm.xml" /> Property changes on: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj ___________________________________________________________________ Deleted: svn:mergeinfo - Modified: trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs 2008-10-25 20:06:57 UTC (rev 3879) +++ trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs 2008-10-28 21:56:07 UTC (rev 3880) @@ -146,7 +146,7 @@ firstQueryResults.Add(4); IList secondQueryResults = (IList)cachedQuery[1]; - secondQueryResults[0] = new object[]{2}; + secondQueryResults[0] = 2; using (ISession s = sessions.OpenSession()) { Property changes on: trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj ___________________________________________________________________ Deleted: svn:mergeinfo - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-25 20:07:02
|
Revision: 3879 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3879&view=rev Author: fabiomaulo Date: 2008-10-25 20:06:57 +0000 (Sat, 25 Oct 2008) Log Message: ----------- Improvement of generic entity usage (it don't need to specify the entity-name in session API) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Engine/ISessionFactoryImplementor.cs trunk/nhibernate/src/NHibernate/Hql/Util/SessionFactoryHelper.cs trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs Modified: trunk/nhibernate/src/NHibernate/Engine/ISessionFactoryImplementor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/ISessionFactoryImplementor.cs 2008-10-25 17:23:21 UTC (rev 3878) +++ trunk/nhibernate/src/NHibernate/Engine/ISessionFactoryImplementor.cs 2008-10-25 20:06:57 UTC (rev 3879) @@ -177,6 +177,12 @@ /// </returns> IEntityPersister TryGetEntityPersister(string entityName); + /// <summary> + /// Get the entity-name for a given mapped class. + /// </summary> + /// <param name="implementor">the mapped class</param> + /// <returns>the enntity name where available or null</returns> + string TryGetGuessEntityName(System.Type implementor); #endregion } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Util/SessionFactoryHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Util/SessionFactoryHelper.cs 2008-10-25 17:23:21 UTC (rev 3878) +++ trunk/nhibernate/src/NHibernate/Hql/Util/SessionFactoryHelper.cs 2008-10-25 20:06:57 UTC (rev 3879) @@ -40,7 +40,6 @@ * to link an entityName with its AssemblyQualifiedName (strongly typed). * I would like to maitain <imports> like the holder of the association of an entityName (or a class Name) and * its Type (in the future: Dictionary<string, System.Type> imports;) - * Note : The same AssemblyQualifiedName should be associaded with more than one emtityName (in case of use generic). * ********************************************************************************************************* */ return TypeNameParser.Parse(assemblyQualifiedName).Type; Modified: trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs 2008-10-25 17:23:21 UTC (rev 3878) +++ trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs 2008-10-25 20:06:57 UTC (rev 3879) @@ -102,6 +102,13 @@ [NonSerialized] private readonly ICurrentSessionContext currentSessionContext; [NonSerialized] private readonly IEntityNotFoundDelegate entityNotFoundDelegate; [NonSerialized] private readonly IDictionary<string, IEntityPersister> entityPersisters; + + /// <summary> + /// NH specific : to avoid the use of entityName for generic implementation + /// </summary> + /// <remarks>this is a shortcut.</remarks> + [NonSerialized] private readonly IDictionary<System.Type, string> implementorToEntityName; + [NonSerialized] private readonly EventListeners eventListeners; [NonSerialized] private readonly Dictionary<string, FilterDefinition> filters; @@ -178,6 +185,8 @@ Dictionary<string, ICacheConcurrencyStrategy> caches = new Dictionary<string, ICacheConcurrencyStrategy>(); entityPersisters = new Dictionary<string, IEntityPersister>(); + implementorToEntityName = new Dictionary<System.Type, string>(); + Dictionary<string, IClassMetadata> classMeta = new Dictionary<string, IClassMetadata>(); foreach (PersistentClass model in cfg.ClassMappings) @@ -198,6 +207,11 @@ IEntityPersister cp = PersisterFactory.CreateClassPersister(model, cache, this, mapping); entityPersisters[model.EntityName] = cp; classMeta[model.EntityName] = cp.ClassMetadata; + + if (model.HasPocoRepresentation) + { + implementorToEntityName[model.MappedClass] = model.EntityName; + } } classMetadata = new UnmodifiableDictionary<string, IClassMetadata>(classMeta); @@ -1125,5 +1139,15 @@ return null; } } + + #region NHibernate specific + public string TryGetGuessEntityName(System.Type implementor) + { + string result; + implementorToEntityName.TryGetValue(implementor, out result); + return result; + } + + #endregion } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2008-10-25 17:23:21 UTC (rev 3878) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2008-10-25 20:06:57 UTC (rev 3879) @@ -870,7 +870,8 @@ string entityName = interceptor.GetEntityName(entity); if (entityName == null) { - entityName = entity.GetType().FullName; + System.Type t = entity.GetType(); + entityName = Factory.TryGetGuessEntityName(t) ?? t.FullName; } return entityName; } Modified: trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs 2008-10-25 17:23:21 UTC (rev 3878) +++ trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs 2008-10-25 20:06:57 UTC (rev 3879) @@ -27,14 +27,14 @@ using (ISession session = OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { - session.Save("AInt", entity); + session.Save(entity); transaction.Commit(); } using (ISession session = OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { - session.Delete("AInt", entity); + session.Delete(entity); transaction.Commit(); } } @@ -53,14 +53,14 @@ using (ISession session = OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { - session.Save("AB", entity); + session.Save(entity); transaction.Commit(); } using (ISession session = OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { - session.Delete("AB", entity); + session.Delete(entity); transaction.Commit(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-25 17:23:30
|
Revision: 3878 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3878&view=rev Author: fabiomaulo Date: 2008-10-25 17:23:21 +0000 (Sat, 25 Oct 2008) Log Message: ----------- Some other tests about entity-name usage Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesWithColl.hbm.xml Modified: trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs 2008-10-25 14:05:25 UTC (rev 3877) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs 2008-10-25 17:23:21 UTC (rev 3878) @@ -105,6 +105,18 @@ } [Test] + public void JoinedSubclassAndEntityNamesOnlyWithCollection() + { + Configuration cfg = new Configuration(); + + cfg.AddResource(BaseForMappings + "Extendshbm.entitynamesWithColl.hbm.xml", typeof(ExtendsFixture).Assembly); + + cfg.BuildMappings(); + Assert.That(cfg.GetClassMapping("EntityHasName"), Is.Not.Null); + Assert.That(cfg.GetClassMapping("EntityCompany"), Is.Not.Null); + } + + [Test] public void EntityNamesWithPackageFailureExpected() { Configuration cfg = new Configuration(); @@ -117,6 +129,18 @@ } [Test] + public void EntityNamesWithPackageWithCollection() + { + Configuration cfg = new Configuration(); + cfg.AddResource(BaseForMappings + "Extendshbm.packageentitynamesWithColl.hbm.xml", typeof(ExtendsFixture).Assembly); + + cfg.BuildMappings(); + + Assert.That(cfg.GetClassMapping("EntityHasName"), Is.Not.Null); + Assert.That(cfg.GetClassMapping("EntityCompany"), Is.Not.Null); + } + + [Test] public void EntityNamesWithPackageFailureExpectedDiffFiles() { Configuration cfg = new Configuration(); Added: trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml 2008-10-25 17:23:21 UTC (rev 3878) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> + + <class lazy="true" entity-name="EntityHasName" table="F5_ENTITY_HASNAME"> + <id name="id" column="ID" type="long"> + <generator class="native"/> + </id> + <property name="attrName" type="string"> + <column name="NAME"/> + </property> + </class> + <joined-subclass lazy="true" entity-name="EntityCompany" table="F5_ENTITY_COMPANY" extends="EntityHasName"> + <key column="REF_ID"/> + <many-to-one name="parent" entity-name="EntityHasName"/> + <set name="childs" > + <key column="familyId" /> + <one-to-many entity-name="EntityHasName"/> + </set> + </joined-subclass> +</hibernate-mapping> Property changes on: trunk/nhibernate/src/NHibernate.Test/Extendshbm/entitynamesWithColl.hbm.xml ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesWithColl.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesWithColl.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesWithColl.hbm.xml 2008-10-25 17:23:21 UTC (rev 3878) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.Extendshbm"> + + <class lazy="true" entity-name="EntityHasName" table="F5_ENTITY_HASNAME"> + <id name="id" column="ID" type="long"> + <generator class="native"/> + </id> + <property name="attrName" type="string"> + <column name="NAME"/> + </property> + </class> + <joined-subclass lazy="true" entity-name="EntityCompany" table="F5_ENTITY_COMPANY" extends="EntityHasName"> + <key column="REF_ID"/> + <many-to-one name="parent" entity-name="EntityHasName"/> + <set name="childs" > + <key column="familyId" /> + <one-to-many entity-name="EntityHasName"/> + </set> + </joined-subclass> +</hibernate-mapping> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml 2008-10-25 14:05:25 UTC (rev 3877) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml 2008-10-25 17:23:21 UTC (rev 3878) @@ -6,5 +6,9 @@ <joined-subclass lazy="true" entity-name="EntityCompany" table="F5_ENTITY_COMPANY" extends="EntityHasName"> <key column="REF_ID"/> <many-to-one name="parent" entity-name="EntityHasName"/> + <set name="childs" > + <key column="familyId" /> + <one-to-many entity-name="EntityHasName"/> + </set> </joined-subclass> </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 2008-10-25 14:05:25 UTC (rev 3877) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-25 17:23:21 UTC (rev 3878) @@ -1513,6 +1513,8 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="Extendshbm\packageentitynamesWithColl.hbm.xml" /> + <EmbeddedResource Include="Extendshbm\entitynamesWithColl.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesf1.hbm.xml" /> <EmbeddedResource Include="Extendshbm\packageentitynamesf2.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1090\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-25 14:05:29
|
Revision: 3877 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3877&view=rev Author: fabiomaulo Date: 2008-10-25 14:05:25 +0000 (Sat, 25 Oct 2008) Log Message: ----------- Fix unreported bug. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/MappingsQueue.cs trunk/nhibernate/src/NHibernate/Cfg/MappingsQueueEntry.cs trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingsQueue.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingsQueue.cs 2008-10-24 14:09:53 UTC (rev 3876) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingsQueue.cs 2008-10-25 14:05:25 UTC (rev 3877) @@ -98,7 +98,12 @@ private bool CanProcess(MappingsQueueEntry ce) { - return _processedClassNames.ContainsAll(ce.RequiredClassNames); + foreach (var c in ce.RequiredClassNames) + { + if (!(_processedClassNames.Contains(c.FullClassName) || _processedClassNames.Contains(c.EntityName))) + return false; + } + return true; } private static string FormatExceptionMessage(ICollection resourceEntries) @@ -108,10 +113,9 @@ foreach (MappingsQueueEntry resourceEntry in resourceEntries) { - foreach (string className in resourceEntry.RequiredClassNames) + foreach (var className in resourceEntry.RequiredClassNames) { - message.Append('\n') - .Append(className); + message.Append('\n').Append(className); } } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingsQueueEntry.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingsQueueEntry.cs 2008-10-24 14:09:53 UTC (rev 3876) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingsQueueEntry.cs 2008-10-25 14:05:25 UTC (rev 3877) @@ -10,7 +10,7 @@ { private readonly HashedSet<string> containedClassNames; private readonly NamedXmlDocument document; - private readonly HashedSet<string> requiredClassNames; + private readonly HashedSet<RequiredEntityName> requiredClassNames; public MappingsQueueEntry(NamedXmlDocument document, IEnumerable<ClassExtractor.ClassEntry> classEntries) { @@ -29,7 +29,7 @@ /// Gets the names of all entities outside this resource /// needed by the classes in this resource. /// </summary> - public ICollection<string> RequiredClassNames + public ICollection<RequiredEntityName> RequiredClassNames { get { return requiredClassNames; } } @@ -44,9 +44,9 @@ private static HashedSet<string> GetClassNames(IEnumerable<ClassExtractor.ClassEntry> classEntries) { - HashedSet<string> result = new HashedSet<string>(); + var result = new HashedSet<string>(); - foreach (ClassExtractor.ClassEntry ce in classEntries) + foreach (var ce in classEntries) { if (ce.EntityName != null) { @@ -61,20 +61,80 @@ return result; } - private static HashedSet<string> GetRequiredClassNames(IEnumerable<ClassExtractor.ClassEntry> classEntries, + private static HashedSet<RequiredEntityName> GetRequiredClassNames(IEnumerable<ClassExtractor.ClassEntry> classEntries, ICollection<string> containedNames) { - HashedSet<string> result = new HashedSet<string>(); + var result = new HashedSet<RequiredEntityName>(); - foreach (ClassExtractor.ClassEntry ce in classEntries) + foreach (var ce in classEntries) { - if (ce.ExtendsEntityName != null && !containedNames.Contains(ce.FullExtends.Type) && !containedNames.Contains(ce.ExtendsEntityName)) + if (ce.ExtendsEntityName != null && !containedNames.Contains(ce.FullExtends.Type) + && !containedNames.Contains(ce.ExtendsEntityName)) { - result.Add(ce.FullExtends.Type); + result.Add(new RequiredEntityName(ce.ExtendsEntityName, ce.FullExtends.Type)); } } return result; } + + public class RequiredEntityName + { + public RequiredEntityName(string entityName, string fullClassName) + { + EntityName = entityName; + FullClassName = fullClassName; + } + + public string EntityName { get; private set; } + + public string FullClassName { get; private set; } + + public bool Equals(RequiredEntityName obj) + { + if (obj == null) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + return Equals(obj.EntityName, EntityName) && Equals(obj.FullClassName, FullClassName); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + var thatSimple = obj as string; + if (thatSimple != null && (thatSimple.Equals(EntityName) || thatSimple.Equals(FullClassName))) + { + return true; + } + var that = obj as RequiredEntityName; + if (that != null) + { + return false; + } + return Equals(that); + } + + public override int GetHashCode() + { + unchecked + { + return ((EntityName != null ? EntityName.GetHashCode() : 0) * 397) + ^ (FullClassName != null ? FullClassName.GetHashCode() : 0); + } + } + + public override string ToString() + { + return string.Format("FullName:{0} - Name:{1}", FullClassName ?? "<null>", EntityName ?? "<null>"); + } + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs 2008-10-24 14:09:53 UTC (rev 3876) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs 2008-10-25 14:05:25 UTC (rev 3877) @@ -117,6 +117,19 @@ } [Test] + public void EntityNamesWithPackageFailureExpectedDiffFiles() + { + Configuration cfg = new Configuration(); + cfg.AddResource(BaseForMappings + "Extendshbm.packageentitynamesf1.hbm.xml", typeof(ExtendsFixture).Assembly); + cfg.AddResource(BaseForMappings + "Extendshbm.packageentitynamesf2.hbm.xml", typeof(ExtendsFixture).Assembly); + + cfg.BuildMappings(); + + Assert.That(cfg.GetClassMapping("EntityHasName"), Is.Not.Null); + Assert.That(cfg.GetClassMapping("EntityCompany"), Is.Not.Null); + } + + [Test] public void UnionSubclass() { Configuration cfg = new Configuration(); Added: trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml 2008-10-25 14:05:25 UTC (rev 3877) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.Extendshbm"> + + <class lazy="true" entity-name="EntityHasName" table="F5_ENTITY_HASNAME"> + <id name="id" column="ID" type="long"> + <generator class="native"/> + </id> + <property name="attrName" type="string"> + <column name="NAME"/> + </property> + </class> +</hibernate-mapping> \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf1.hbm.xml ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/packageentitynamesf2.hbm.xml 2008-10-25 14:05:25 UTC (rev 3877) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.Extendshbm"> + + <joined-subclass lazy="true" entity-name="EntityCompany" table="F5_ENTITY_COMPANY" extends="EntityHasName"> + <key column="REF_ID"/> + <many-to-one name="parent" entity-name="EntityHasName"/> + </joined-subclass> +</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 2008-10-24 14:09:53 UTC (rev 3876) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-25 14:05:25 UTC (rev 3877) @@ -1513,6 +1513,8 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="Extendshbm\packageentitynamesf1.hbm.xml" /> + <EmbeddedResource Include="Extendshbm\packageentitynamesf2.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1090\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH662\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1495\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-24 14:09:55
|
Revision: 3876 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3876&view=rev Author: fabiomaulo Date: 2008-10-24 14:09:53 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Minor Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/Schema/OracleMetaData.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/Schema/OracleMetaData.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Schema/OracleMetaData.cs 2008-10-24 13:45:59 UTC (rev 3875) +++ trunk/nhibernate/src/NHibernate/Dialect/Schema/OracleMetaData.cs 2008-10-24 14:09:53 UTC (rev 3876) @@ -10,7 +10,7 @@ public override ITableMetadata GetTableMetadata(DataRow rs, bool extras) { - return new MsSqlTableMetadata(rs, this, extras); + return new OracleTableMetadata(rs, this, extras); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-24 13:46:09
|
Revision: 3875 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3875&view=rev Author: fabiomaulo Date: 2008-10-24 13:45:59 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Fix NH-1539, NH-1540, NH-1541, NH-1542 (Improv ORACLE dialect by Jaroslav Mart?\195?\161sek) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2008-10-23 19:27:00 UTC (rev 3874) +++ trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2008-10-24 13:45:59 UTC (rev 3875) @@ -1,7 +1,8 @@ -using System; +using System.Collections; using System.Data; using NHibernate.Dialect.Function; using NHibernate.Dialect.Schema; +using NHibernate.Engine; using NHibernate.SqlCommand; using Environment=NHibernate.Cfg.Environment; using System.Data.Common; @@ -110,15 +111,19 @@ RegisterFunction("sysdate", new NoArgSQLFunction("sysdate", NHibernateUtil.Date, false)); RegisterFunction("uid", new NoArgSQLFunction("uid", NHibernateUtil.Int32, false)); RegisterFunction("user", new NoArgSQLFunction("user", NHibernateUtil.String, false)); + RegisterFunction("current_timestamp", new CurrentTimeStamp()); + RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as nvarchar2(2000))")); + // Multi-param string dialect functions... - RegisterFunction("concat", new StandardSQLFunction("concat", NHibernateUtil.String)); + RegisterFunction("concat", new VarArgsSQLFunction(NHibernateUtil.String, "(", "||", ")")); RegisterFunction("instr", new StandardSQLFunction("instr", NHibernateUtil.String)); RegisterFunction("instrb", new StandardSQLFunction("instrb", NHibernateUtil.String)); RegisterFunction("lpad", new StandardSQLFunction("lpad", NHibernateUtil.String)); RegisterFunction("replace", new StandardSQLFunction("replace", NHibernateUtil.String)); RegisterFunction("rpad", new StandardSQLFunction("rpad", NHibernateUtil.String)); RegisterFunction("substr", new StandardSQLFunction("substr", NHibernateUtil.String)); + RegisterFunction("substring", new StandardSQLFunction("substr", NHibernateUtil.String)); RegisterFunction("substrb", new StandardSQLFunction("substrb", NHibernateUtil.String)); RegisterFunction("translate", new StandardSQLFunction("translate", NHibernateUtil.String)); @@ -184,9 +189,12 @@ get { return true; } } - public override SqlString GetLimitString(SqlString querySqlString, bool hasOffset) + + public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit) { SqlStringBuilder pagingBuilder = new SqlStringBuilder(); + var hasOffset = offset > 0; + if (hasOffset) { pagingBuilder.Add("select * from ( select row_.*, rownum rownum_ from ( "); @@ -199,14 +207,14 @@ if (hasOffset) { pagingBuilder.Add(" ) row_ where rownum <= "); - pagingBuilder.Add(Parameter.Placeholder); + pagingBuilder.Add(offset.ToString()); pagingBuilder.Add(" ) where rownum_ > "); - pagingBuilder.Add(Parameter.Placeholder); + pagingBuilder.Add((limit + offset).ToString()); } else { pagingBuilder.Add(" ) where rownum <= "); - pagingBuilder.Add(Parameter.Placeholder); + pagingBuilder.Add(offset.ToString()); } return pagingBuilder.ToSqlString(); @@ -243,5 +251,17 @@ { return new OracleDataBaseSchema(connection); } + + private class CurrentTimeStamp : NoArgSQLFunction + { + public CurrentTimeStamp() + : base("current_timestamp", NHibernateUtil.DateTime, true) + { } + + public override SqlString Render(IList args, ISessionFactoryImplementor factory) + { + return new SqlString(name); + } + } } -} \ No newline at end of file +} Modified: trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs 2008-10-23 19:27:00 UTC (rev 3874) +++ trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs 2008-10-24 13:45:59 UTC (rev 3875) @@ -1445,7 +1445,7 @@ { KeyType.NullSafeSet(st, key, 0, session); rs = session.Batcher.ExecuteReader(st); - return rs.Read() ? rs.GetInt32(0) - baseIndex : 0; + return rs.Read() ? Convert.ToInt32(rs.GetValue(0)) - baseIndex : 0; } finally { @@ -2022,4 +2022,4 @@ #endregion } -} \ 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: <aye...@us...> - 2008-10-23 19:27:03
|
Revision: 3874 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3874&view=rev Author: ayenderahien Date: 2008-10-23 19:27:00 +0000 (Thu, 23 Oct 2008) Log Message: ----------- NH-1547 - SqLite Paqing does not page properly after the 2nd page Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs trunk/nhibernate/src/NHibernate.Test/DialectTest/SQLiteDialectFixture.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2008-10-23 18:44:32 UTC (rev 3873) +++ trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2008-10-23 19:27:00 UTC (rev 3874) @@ -183,7 +183,7 @@ if (offset > 0) { - pagingBuilder.Add(", "); + pagingBuilder.Add(" offset "); pagingBuilder.Add(offset.ToString()); } Modified: trunk/nhibernate/src/NHibernate.Test/DialectTest/SQLiteDialectFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/DialectTest/SQLiteDialectFixture.cs 2008-10-23 18:44:32 UTC (rev 3873) +++ trunk/nhibernate/src/NHibernate.Test/DialectTest/SQLiteDialectFixture.cs 2008-10-23 19:27:00 UTC (rev 3874) @@ -28,7 +28,7 @@ { SqlString sql = new SqlString("SELECT id, name, email FROM Users"); SqlString s = dialect.GetLimitString(sql, 5, 10); - Assert.AreEqual("SELECT id, name, email FROM Users limit 10, 5", s.ToString()); + Assert.AreEqual("SELECT id, name, email FROM Users limit 10 offset 5", s.ToString()); } [Test] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wo...@us...> - 2008-10-23 18:44:36
|
Revision: 3873 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3873&view=rev Author: woil Date: 2008-10-23 18:44:32 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Adds debugging information to the transient object exception Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Engine/ForeignKeys.cs Modified: trunk/nhibernate/src/NHibernate/Engine/ForeignKeys.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/ForeignKeys.cs 2008-10-23 18:37:18 UTC (rev 3872) +++ trunk/nhibernate/src/NHibernate/Engine/ForeignKeys.cs 2008-10-23 18:44:32 UTC (rev 3873) @@ -243,9 +243,10 @@ // the check was put here to have les possible impact /**********************************************/ + entityName = entityName ?? session.GuessEntityName(entity); + string entityString = entity.ToString(); throw new TransientObjectException( - "object references an unsaved transient instance - save the transient instance before flushing: " - + (entityName ?? session.GuessEntityName(entity))); + string.Format("object references an unsaved transient instance - save the transient instance before flushing. Type: {0}, Entity: {1}", entityName, entityString)); } id = session.GetEntityPersister(entityName, entity).GetIdentifier(entity, session.EntityMode); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wo...@us...> - 2008-10-23 18:37:29
|
Revision: 3872 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3872&view=rev Author: woil Date: 2008-10-23 18:37:18 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Fixes debug output of DateTimeType to display both date and time instead of just date. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Type/DateTimeType.cs Modified: trunk/nhibernate/src/NHibernate/Type/DateTimeType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/DateTimeType.cs 2008-10-21 18:49:38 UTC (rev 3871) +++ trunk/nhibernate/src/NHibernate/Type/DateTimeType.cs 2008-10-23 18:37:18 UTC (rev 3872) @@ -127,7 +127,7 @@ public override string ToString(object val) { - return ((DateTime) val).ToShortDateString(); + return ((DateTime) val).ToString(); } public object StringToObject(string xml) @@ -152,7 +152,7 @@ public override string ObjectToSQLString(object value, Dialect.Dialect dialect) { - return "'" + ((DateTime)value).ToShortDateString() + "'"; + return "'" + ((DateTime)value) + "'"; } } } \ 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: <te...@us...> - 2008-10-21 18:49:46
|
Revision: 3871 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3871&view=rev Author: tehlike Date: 2008-10-21 18:49:38 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Fixes the problem with Caching Criteria with ResultTransformer set(Fix NH-1090) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClass.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClassDescriptionOnly.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/TuppleToPropertyResultTransformer.cs Modified: trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-10-20 18:34:11 UTC (rev 3870) +++ trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -151,7 +151,16 @@ CriteriaImpl critImp = criteriaQueries[i] as CriteriaImpl; if(critImp==null || critImp.ResultTransformer==null) continue; - results[i] = critImp.ResultTransformer.TransformList((IList)results[i]); + ArrayList resultForOneCriteria = ((ArrayList) results[i]); + for (int j = 0; j < resultForOneCriteria.Count; j++) + { + if (!(critImp.ResultTransformer is RootEntityResultTransformer)) + { + object[] itemsForOneRow = (object[]) resultForOneCriteria[j]; + resultForOneCriteria[j] = critImp.ResultTransformer.TransformTuple(itemsForOneRow, new string[] {}); + } + } + critImp.ResultTransformer.TransformList(resultForOneCriteria); } } return results; Modified: trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs 2008-10-20 18:34:11 UTC (rev 3870) +++ trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Data; @@ -28,7 +29,7 @@ private readonly string[] userAliases; public CriteriaLoader(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl rootCriteria, - string rootEntityName, IDictionary<string, IFilter> enabledFilters) + string rootEntityName, IDictionary<string, IFilter> enabledFilters) : base(factory, enabledFilters) { translator = new CriteriaQueryTranslator(factory, rootCriteria, rootEntityName, CriteriaQueryTranslator.RootSqlAlias); @@ -74,10 +75,9 @@ } protected override object GetResultColumnOrRow(object[] row, IResultTransformer resultTransformer, IDataReader rs, - ISessionImplementor session) + ISessionImplementor session) { object[] result; - string[] aliases; if (translator.HasProjection) { @@ -96,11 +96,15 @@ result = row; aliases = userAliases; } - return translator.RootCriteria.ResultTransformer.TransformTuple(result, aliases); + if (translator.RootCriteria.ResultTransformer is RootEntityResultTransformer) + return row[row.Length-1]; + else + return result; } + private string[] aliases; protected override SqlString ApplyLocks(SqlString sqlSelectString, IDictionary<string, LockMode> lockModes, - Dialect.Dialect dialect) + Dialect.Dialect dialect) { if (lockModes == null || lockModes.Count == 0) { @@ -115,7 +119,7 @@ LockMode lockMode; if (lockModes.TryGetValue(drivingSqlAliases[i], out lockMode)) { - ILockable drivingPersister = (ILockable) EntityPersisters[i]; + ILockable drivingPersister = (ILockable)EntityPersisters[i]; string rootSqlAlias = drivingPersister.GetRootTableAlias(drivingSqlAliases[i]); aliasedLockModes[rootSqlAlias] = lockMode; if (keyColumnNames != null) @@ -151,7 +155,15 @@ protected override IList GetResultList(IList results, IResultTransformer resultTransformer) { - return translator.RootCriteria.ResultTransformer.TransformList(results); + if (!(resultTransformer is RootEntityResultTransformer)) + { + for (int i = 0; i < results.Count; i++) + { + object[] row = (object[]) results[i]; + results[i] = resultTransformer.TransformTuple(row, aliases); + } + } + return resultTransformer.TransformList(results); } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2008-10-20 18:34:11 UTC (rev 3870) +++ trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -62,7 +62,7 @@ } [CLSCompliant(false)] // TODO: Why does this cause a problem in 1.1 - public string RootSQLAlias + public string RootSQLAlias { get { return rootSQLAlias; } } Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090 ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Fixture.cs (from rev 3854, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1144/Fixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Fixture.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -0,0 +1,194 @@ +using System.Collections; +using log4net.Core; +using NHibernate.AdoNet; +using NHibernate.Cfg; +using NHibernate.Criterion; +using NHibernate.Driver; +using NHibernate.Stat; +using NUnit.Framework; +using System.Collections.Generic; + +namespace NHibernate.Test.NHSpecificTest.NH1090 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void OnSetUp() + { + using (ISession s = OpenSession()) + using (ITransaction tran = s.BeginTransaction()) + { + MainClass m = new MainClass(); + m.Description = "description1"; + m.Title = "title1"; + + MainClass m2 = new MainClass(); + m2.Description = "description2"; + m2.Title = "title2"; + s.Save(m); + s.Save(m2); + tran.Commit(); + } + } + protected override void OnTearDown() + { + using (ISession s = OpenSession()) + using (ITransaction tran = s.BeginTransaction()) + { + s.Delete("from MainClass"); + tran.Commit(); + } + + + } + [Test] + public void CriteriaCanCacheSingleResultSingleProperty() + { + IStatistics stats = sessions.Statistics; + stats.Clear(); + bool isStatsEnabled = stats.IsStatisticsEnabled; + stats.IsStatisticsEnabled = true; + using (ISession session = OpenSession()) + { + ICriteria criteria = session.CreateCriteria(typeof (MainClass)); + criteria.Add(Restrictions.Eq("Title", "title1")); + criteria.SetProjection(Projections.Property("Description")); + criteria.SetCacheable(true); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + string result = (string)criteria.UniqueResult(); + Assert.AreEqual("description1", result); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + string newResult = (string)criteria.UniqueResult(); + Assert.AreEqual("description1", newResult); + Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); + } + stats.IsStatisticsEnabled = isStatsEnabled; + } + + [Test] + public void CriteriaCanCacheSingleResulMultipleProperty() + { + IStatistics stats = sessions.Statistics; + stats.Clear(); + bool isStatsEnabled = stats.IsStatisticsEnabled; + stats.IsStatisticsEnabled = true; + using (ISession session = OpenSession()) + { + ICriteria criteria = session.CreateCriteria(typeof(MainClass)); + criteria.Add(Restrictions.Eq("Title", "title1")); + criteria.SetProjection(Projections.ProjectionList() + .Add(Projections.Property("Description")) + .Add(Projections.Property("Title"))); + criteria.SetCacheable(true); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + object[] result = (object[])criteria.UniqueResult(); + Assert.AreEqual("description1", result[0]); + Assert.AreEqual("title1", result[1]); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + object[] newResult = (object[])criteria.UniqueResult(); + Assert.AreEqual("description1", newResult[0]); + Assert.AreEqual("title1", newResult[1]); + Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); + } + stats.IsStatisticsEnabled = isStatsEnabled; + } + + + + [Test] + public void CriteriaCanCacheEntity() + { + IStatistics stats = sessions.Statistics; + stats.Clear(); + bool isStatsEnabled = stats.IsStatisticsEnabled; + stats.IsStatisticsEnabled = true; + using(ISession session=OpenSession()) + { + ICriteria criteria = session.CreateCriteria(typeof (MainClass)); + criteria.SetCacheable(true); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + IList results = criteria.List(); + Assert.AreEqual(2,results.Count); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + results = criteria.List(); + Assert.AreEqual(2, results.Count); + Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); + } + stats.IsStatisticsEnabled = isStatsEnabled; + } + + + [Test] + public void CriteriaCanCacheTransformedResult() + { + IStatistics stats = sessions.Statistics; + stats.Clear(); + bool isStatsEnabled = stats.IsStatisticsEnabled; + stats.IsStatisticsEnabled = true; + using (ISession session = OpenSession()) + { + ICriteria criteria = session.CreateCriteria(typeof(MainClass)) + .SetProjection( + Projections.ProjectionList() + .Add(Projections.Property("Title")) + .Add(Projections.Property("Description"))) + .SetResultTransformer(new TupleToPropertyResultTransformer(typeof(MainClassWithoutId),"Title","Description")) + .SetCacheable(true); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + IList<MainClassWithoutId> results=criteria.List<MainClassWithoutId>(); + Assert.AreEqual(2, results.Count); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + results = criteria.List<MainClassWithoutId>(); + Assert.AreEqual(2, results.Count); + Assert.AreEqual(2,results.Count); + Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); + } + stats.IsStatisticsEnabled = isStatsEnabled; + } + + [Test] + public void HqlCanCacheEntity() + { + IStatistics stats = sessions.Statistics; + stats.Clear(); + bool isStatsEnabled = stats.IsStatisticsEnabled; + stats.IsStatisticsEnabled = true; + using (ISession session = OpenSession()) + { + IQuery query = session.CreateQuery("from MainClass") + .SetCacheable(true); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + IList results=query.List(); + Assert.AreEqual(2, results.Count); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + results=query.List(); + Assert.AreEqual(2, results.Count); + Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); + } + stats.IsStatisticsEnabled = isStatsEnabled; + } + + [Test] + public void HqlCanCacheTransformedResult() + { + IStatistics stats = sessions.Statistics; + stats.Clear(); + bool isStatsEnabled = stats.IsStatisticsEnabled; + stats.IsStatisticsEnabled = true; + using (ISession session = OpenSession()) + { + IQuery query = session.CreateQuery("select m.Title,m.Description from MainClass m") + .SetResultTransformer(new TupleToPropertyResultTransformer(typeof (MainClassWithoutId), "Title", "Description")) + .SetCacheable(true); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + IList results=query.List(); + Assert.AreEqual(2, results.Count); + Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); + results=query.List(); + Assert.AreEqual(2, results.Count); + Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); + } + stats.IsStatisticsEnabled = isStatsEnabled; + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Fixture.cs ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClass.cs (from rev 3854, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1144/Classes.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClass.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClass.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1090 +{ + public class MainClass + { + private int id; + private string description; + private string title; + + public virtual int Id + { + get { return id; } + set { id = value; } + } + + public virtual string Description + { + get { return description; } + set { description = value; } + } + public virtual string Title + { + get { return title; } + set { title = value; } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClass.cs ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClassDescriptionOnly.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClassDescriptionOnly.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/MainClassDescriptionOnly.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1090 +{ + public class MainClassWithoutId + { + public string Title { get; set; } + public string Description { get; set; } + } +} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Mappings.hbm.xml (from rev 3854, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1144/Mappings.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Mappings.hbm.xml 2008-10-21 18:49:38 UTC (rev 3871) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1090"> + + <class name="MainClass"> + <id name="Id" type="int"> + <generator class="native" /> + </id> + <property name="Title" type="string" length="50"/> + <property name="Description" type="string" length="50"/> + </class> + +</hibernate-mapping> \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/Mappings.hbm.xml ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/TuppleToPropertyResultTransformer.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/TuppleToPropertyResultTransformer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1090/TuppleToPropertyResultTransformer.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -0,0 +1,52 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using NHibernate.Transform; + +namespace NHibernate.Test.NHSpecificTest.NH1090 +{ + public class TupleToPropertyResultTransformer : IResultTransformer + { + private System.Type result; + private PropertyInfo[] properties; + + public TupleToPropertyResultTransformer(System.Type result, params string[] names) + { + this.result = result; + List<PropertyInfo> props = new List<PropertyInfo>(); + foreach (string name in names) + { + props.Add(result.GetProperty(name)); + } + properties = props.ToArray(); + } + + public object TransformTuple(object[] tuple, string[] aliases) + { + object instance = Activator.CreateInstance(result); + for (int i = 0; i < tuple.Length; i++) + { + properties[i].SetValue(instance, tuple[i], null); + } + return instance; + } + + public System.Collections.IList TransformList(IList collection) + { + return collection; + } + + public override int GetHashCode() + { + return 1234; + } + + public override bool Equals(object obj) + { + return true; + } + } + +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-20 18:34:11 UTC (rev 3870) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-21 18:49:38 UTC (rev 3871) @@ -380,6 +380,10 @@ <Compile Include="NHSpecificTest\NH1033\Reptile.cs" /> <Compile Include="NHSpecificTest\NH1077\A.cs" /> <Compile Include="NHSpecificTest\NH1077\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1090\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1090\MainClass.cs" /> + <Compile Include="NHSpecificTest\NH1090\MainClassDescriptionOnly.cs" /> + <Compile Include="NHSpecificTest\NH1090\TuppleToPropertyResultTransformer.cs" /> <Compile Include="NHSpecificTest\NH1098\FilterParameterOrderFixture.cs" /> <Compile Include="NHSpecificTest\NH1098\Model.cs" /> <Compile Include="NHSpecificTest\NH1101\Domain.cs" /> @@ -1509,6 +1513,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1090\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH662\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1495\Mappings.hbm.xml" /> <EmbeddedResource Include="ProjectionFixtures\Mapping.hbm.xml" /> Modified: trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs 2008-10-20 18:34:11 UTC (rev 3870) +++ trunk/nhibernate/src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs 2008-10-21 18:49:38 UTC (rev 3871) @@ -146,7 +146,7 @@ firstQueryResults.Add(4); IList secondQueryResults = (IList)cachedQuery[1]; - secondQueryResults[0] = 2; + secondQueryResults[0] = new object[]{2}; using (ISession s = sessions.OpenSession()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-20 18:34:21
|
Revision: 3870 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3870&view=rev Author: fabiomaulo Date: 2008-10-20 18:34:11 +0000 (Mon, 20 Oct 2008) Log Message: ----------- Refactoring (simplified using auto-properties) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Settings.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/Settings.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Settings.cs 2008-10-20 16:48:06 UTC (rev 3869) +++ trunk/nhibernate/src/NHibernate/Cfg/Settings.cs 2008-10-20 18:34:11 UTC (rev 3870) @@ -14,73 +14,20 @@ /// </summary> public sealed class Settings { - private bool isShowSqlEnabled; - private bool isFormatSqlEnabled; private int maximumFetchDepth = -1; - private IDictionary<string, string> querySubstitutions; - private Dialect.Dialect dialect; - private int adoBatchSize; - private int defaultBatchFetchSize; - private bool isScrollableResultSetsEnabled; - private bool isGetGeneratedKeysEnabled; - private string defaultSchemaName; - private string defaultCatalogName; - private string sessionFactoryName; - private bool isAutoCreateSchema; - private bool isAutoDropSchema; - private bool isAutoUpdateSchema; - private bool isAutoValidateSchema; - private bool isQueryCacheEnabled; - private bool isStructuredCacheEntriesEnabled; - private bool isSecondLevelCacheEnabled; - private string cacheRegionPrefix; - private bool isMinimalPutsEnabled; - private bool isCommentsEnabled; - private bool isStatisticsEnabled; - private bool isIdentifierRollbackEnabled; - private bool isFlushBeforeCompletionEnabled; - private bool isAutoCloseSessionEnabled; - private ConnectionReleaseMode connectionReleaseMode; - private ICacheProvider cacheProvider; - private IQueryCacheFactory queryCacheFactory; - private IConnectionProvider connectionProvider; - private ITransactionFactory transactionFactory; // not ported - private TransactionManagerLookup transactionManagerLookup; - private IBatcherFactory batcherFactory; - private IQueryTranslatorFactory queryTranslatorFactory; - private ISQLExceptionConverter sqlExceptionConverter; - private bool isWrapResultSetsEnabled; - private bool isOrderUpdatesEnabled; - private bool isOrderInsertsEnabled; - private EntityMode defaultEntityMode; - private bool isDataDefinitionImplicitCommit; - private bool isDataDefinitionInTransactionSupported; // not ported - private bool strictJPAQLCompliance; - private bool isNamedQueryStartupCheckingEnabled; #region JDBC Specific (Not Ported) + //private int jdbcFetchSize; //private bool isJdbcBatchVersionedData; - #endregion - #region NH specific - - private IsolationLevel isolationLevel; - private bool isOuterJoinFetchEnabled; - #endregion - public bool IsShowSqlEnabled - { - get { return isShowSqlEnabled; } - internal set { isShowSqlEnabled = value; } - } + public bool IsShowSqlEnabled { get; internal set; } - public bool IsFormatSqlEnabled - { - get { return isFormatSqlEnabled; } - internal set { isFormatSqlEnabled = value; } - } + public bool IsFormatSqlEnabled { get; internal set; } public int MaximumFetchDepth { @@ -88,247 +35,87 @@ internal set { maximumFetchDepth = value; } } - public IDictionary<string,string> QuerySubstitutions - { - get { return querySubstitutions; } - internal set { querySubstitutions = value; } - } + public IDictionary<string, string> QuerySubstitutions { get; internal set; } - public Dialect.Dialect Dialect - { - get { return dialect; } - internal set { dialect = value; } - } + public Dialect.Dialect Dialect { get; internal set; } - public int AdoBatchSize - { - get { return adoBatchSize; } - internal set { adoBatchSize = value; } - } + public int AdoBatchSize { get; internal set; } - public int DefaultBatchFetchSize - { - get { return defaultBatchFetchSize; } - internal set { defaultBatchFetchSize = value; } - } + public int DefaultBatchFetchSize { get; internal set; } - public bool IsScrollableResultSetsEnabled - { - get { return isScrollableResultSetsEnabled; } - internal set { isScrollableResultSetsEnabled = value; } - } + public bool IsScrollableResultSetsEnabled { get; internal set; } - public bool IsGetGeneratedKeysEnabled - { - get { return isGetGeneratedKeysEnabled; } - internal set { isGetGeneratedKeysEnabled = value; } - } + public bool IsGetGeneratedKeysEnabled { get; internal set; } - public string DefaultSchemaName - { - get { return defaultSchemaName; } - set { defaultSchemaName = value; } - } + public string DefaultSchemaName { get; set; } - public string DefaultCatalogName - { - get { return defaultCatalogName; } - internal set { defaultCatalogName = value; } - } + public string DefaultCatalogName { get; internal set; } - public string SessionFactoryName - { - get { return sessionFactoryName; } - internal set { sessionFactoryName = value; } - } + public string SessionFactoryName { get; internal set; } - public bool IsAutoCreateSchema - { - get { return isAutoCreateSchema; } - internal set { isAutoCreateSchema = value; } - } + public bool IsAutoCreateSchema { get; internal set; } - public bool IsAutoDropSchema - { - get { return isAutoDropSchema; } - internal set { isAutoDropSchema = value; } - } + public bool IsAutoDropSchema { get; internal set; } - public bool IsAutoUpdateSchema - { - get { return isAutoUpdateSchema; } - internal set { isAutoUpdateSchema = value; } - } + public bool IsAutoUpdateSchema { get; internal set; } - public bool IsAutoValidateSchema - { - get { return isAutoValidateSchema; } - internal set { isAutoValidateSchema = value; } - } + public bool IsAutoValidateSchema { get; internal set; } - public bool IsQueryCacheEnabled - { - get { return isQueryCacheEnabled; } - internal set { isQueryCacheEnabled = value; } - } + public bool IsQueryCacheEnabled { get; internal set; } - public bool IsStructuredCacheEntriesEnabled - { - get { return isStructuredCacheEntriesEnabled; } - internal set { isStructuredCacheEntriesEnabled = value; } - } + public bool IsStructuredCacheEntriesEnabled { get; internal set; } - public bool IsSecondLevelCacheEnabled - { - get { return isSecondLevelCacheEnabled; } - internal set { isSecondLevelCacheEnabled = value; } - } + public bool IsSecondLevelCacheEnabled { get; internal set; } - public string CacheRegionPrefix - { - get { return cacheRegionPrefix; } - internal set { cacheRegionPrefix = value; } - } + public string CacheRegionPrefix { get; internal set; } - public bool IsMinimalPutsEnabled - { - get { return isMinimalPutsEnabled; } - internal set { isMinimalPutsEnabled = value; } - } + public bool IsMinimalPutsEnabled { get; internal set; } - public bool IsCommentsEnabled - { - get { return isCommentsEnabled; } - internal set { isCommentsEnabled = value; } - } + public bool IsCommentsEnabled { get; internal set; } - public bool IsStatisticsEnabled - { - get { return isStatisticsEnabled; } - internal set { isStatisticsEnabled = value; } - } + public bool IsStatisticsEnabled { get; internal set; } - public bool IsIdentifierRollbackEnabled - { - get { return isIdentifierRollbackEnabled; } - internal set { isIdentifierRollbackEnabled = value; } - } + public bool IsIdentifierRollbackEnabled { get; internal set; } - public bool IsFlushBeforeCompletionEnabled - { - get { return isFlushBeforeCompletionEnabled; } - internal set { isFlushBeforeCompletionEnabled = value; } - } + public bool IsFlushBeforeCompletionEnabled { get; internal set; } - public bool IsAutoCloseSessionEnabled - { - get { return isAutoCloseSessionEnabled; } - internal set { isAutoCloseSessionEnabled = value; } - } + public bool IsAutoCloseSessionEnabled { get; internal set; } - public ConnectionReleaseMode ConnectionReleaseMode - { - get { return connectionReleaseMode; } - internal set { connectionReleaseMode = value; } - } + public ConnectionReleaseMode ConnectionReleaseMode { get; internal set; } - public ICacheProvider CacheProvider - { - get { return cacheProvider; } - internal set { cacheProvider = value; } - } + public ICacheProvider CacheProvider { get; internal set; } - public IQueryCacheFactory QueryCacheFactory - { - get { return queryCacheFactory; } - internal set { queryCacheFactory = value; } - } + public IQueryCacheFactory QueryCacheFactory { get; internal set; } - public IConnectionProvider ConnectionProvider - { - get { return connectionProvider; } - internal set { connectionProvider = value; } - } + public IConnectionProvider ConnectionProvider { get; internal set; } - public ITransactionFactory TransactionFactory - { - get { return transactionFactory; } - internal set { transactionFactory = value; } - } + public ITransactionFactory TransactionFactory { get; internal set; } - public IBatcherFactory BatcherFactory - { - get { return batcherFactory; } - internal set { batcherFactory = value; } - } + public IBatcherFactory BatcherFactory { get; internal set; } - public IQueryTranslatorFactory QueryTranslatorFactory - { - get { return queryTranslatorFactory; } - internal set { queryTranslatorFactory = value; } - } + public IQueryTranslatorFactory QueryTranslatorFactory { get; internal set; } - public ISQLExceptionConverter SqlExceptionConverter - { - get { return sqlExceptionConverter; } - internal set { sqlExceptionConverter = value; } - } + public ISQLExceptionConverter SqlExceptionConverter { get; internal set; } - public bool IsWrapResultSetsEnabled - { - get { return isWrapResultSetsEnabled; } - internal set { isWrapResultSetsEnabled = value; } - } + public bool IsWrapResultSetsEnabled { get; internal set; } - public bool IsOrderUpdatesEnabled - { - get { return isOrderUpdatesEnabled; } - internal set { isOrderUpdatesEnabled = value; } - } + public bool IsOrderUpdatesEnabled { get; internal set; } - public bool IsOrderInsertsEnabled - { - get { return isOrderInsertsEnabled; } - internal set { isOrderInsertsEnabled = value; } - } + public bool IsOrderInsertsEnabled { get; internal set; } - public EntityMode DefaultEntityMode - { - get { return defaultEntityMode; } - internal set { defaultEntityMode = value; } - } + public EntityMode DefaultEntityMode { get; internal set; } - public bool IsDataDefinitionImplicitCommit - { - get { return isDataDefinitionImplicitCommit; } - internal set { isDataDefinitionImplicitCommit = value; } - } + public bool IsDataDefinitionImplicitCommit { get; internal set; } - public bool IsDataDefinitionInTransactionSupported - { - get { return isDataDefinitionInTransactionSupported; } - internal set { isDataDefinitionInTransactionSupported = value; } - } + public bool IsDataDefinitionInTransactionSupported { get; internal set; } - public bool IsNamedQueryStartupCheckingEnabled - { - get { return isNamedQueryStartupCheckingEnabled; } - internal set { isNamedQueryStartupCheckingEnabled = value; } - } + public bool IsNamedQueryStartupCheckingEnabled { get; internal set; } #region NH specific - public IsolationLevel IsolationLevel - { - get { return isolationLevel; } - internal set { isolationLevel = value; } - } + public IsolationLevel IsolationLevel { get; internal set; } - public bool IsOuterJoinFetchEnabled - { - get { return isOuterJoinFetchEnabled; } - internal set { isOuterJoinFetchEnabled = value; } - } + public bool IsOuterJoinFetchEnabled { get; internal set; } #endregion } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-20 16:48:13
|
Revision: 3869 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3869&view=rev Author: fabiomaulo Date: 2008-10-20 16:48:06 +0000 (Mon, 20 Oct 2008) Log Message: ----------- Test for NH-1535 (as another example of generic usage) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/A.cs trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Mappings.hbm.xml Modified: trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/A.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/A.cs 2008-10-20 15:43:09 UTC (rev 3868) +++ trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/A.cs 2008-10-20 16:48:06 UTC (rev 3869) @@ -14,4 +14,11 @@ public virtual IList<T> Collection { get; set; } } + + public class B + { + public virtual int? Id { get; set; } + + public virtual int Prop { get; set; } + } } Modified: trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs 2008-10-20 15:43:09 UTC (rev 3868) +++ trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Fixture.cs 2008-10-20 16:48:06 UTC (rev 3869) @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; @@ -21,21 +22,48 @@ [Test] public void CRUD() { - var entity = new A<int> {Property = 10, Collection = new List<int> {20}}; + var entity = new A<int> { Property = 10, Collection = new List<int> { 20 } }; - using( ISession session = OpenSession() ) - using( ITransaction transaction = session.BeginTransaction() ) + using (ISession session = OpenSession()) + using (ITransaction transaction = session.BeginTransaction()) { session.Save("AInt", entity); transaction.Commit(); } - using( ISession session = OpenSession() ) - using( ITransaction transaction = session.BeginTransaction() ) + using (ISession session = OpenSession()) + using (ITransaction transaction = session.BeginTransaction()) { session.Delete("AInt", entity); transaction.Commit(); } } + + [Test] + public void CRUDAB() + { + var entity = new A<B> + { + Property = new B { Prop = 2 }, + Collection = new List<B> { new B { Prop = 3 } } + }; + + Console.WriteLine(entity.GetType().FullName); + + using (ISession session = OpenSession()) + using (ITransaction transaction = session.BeginTransaction()) + { + session.Save("AB", entity); + transaction.Commit(); + } + + using (ISession session = OpenSession()) + using (ITransaction transaction = session.BeginTransaction()) + { + session.Delete("AB", entity); + transaction.Commit(); + } + } } + } Modified: trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Mappings.hbm.xml 2008-10-20 15:43:09 UTC (rev 3868) +++ trunk/nhibernate/src/NHibernate.Test/GenericTest/Overall/Mappings.hbm.xml 2008-10-20 16:48:06 UTC (rev 3869) @@ -20,4 +20,35 @@ </class> + <class name="A`1[[B]]" table="AB" entity-name="AB"> + + <id name="Id"> + <generator class="native" /> + + </id> + + <list name="Collection" table="CollectionList" lazy="false" cascade="all"> + <key column="CollectionId"/> + <index column="CollectionOrder"/> + + <many-to-any meta-type="string" id-type="int"> + <column name="CollectionType" /> + <column name="CollectionValue" /> + + </many-to-any> + + </list> + + </class> + + <class name="B" table="BTable"> + + <id name="Id"> + <generator class="native" /> + + </id> + + <property name="Prop" column="property" type="int"/> + </class> + </hibernate-mapping> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-20 15:43:17
|
Revision: 3868 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3868&view=rev Author: fabiomaulo Date: 2008-10-20 15:43:09 +0000 (Mon, 20 Oct 2008) Log Message: ----------- - Fix NH-1538, NH-1537 (new feature comments) - Refactoring in tests (to have only one namespace for various HQL tests) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Environment.cs trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs trunk/nhibernate/src/NHibernate/IQuery.cs trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs trunk/nhibernate/src/NHibernate/Impl/SqlQueryImpl.cs trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd trunk/nhibernate/src/NHibernate.Test/HQL/Animal.cs trunk/nhibernate/src/NHibernate.Test/HQL/Animal.hbm.xml trunk/nhibernate/src/NHibernate.Test/HQL/BaseFunctionFixture.cs trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs trunk/nhibernate/src/NHibernate.Test/HQL/Human.cs trunk/nhibernate/src/NHibernate.Test/HQL/MaterialResource.cs trunk/nhibernate/src/NHibernate.Test/HQL/MaterialResource.hbm.xml trunk/nhibernate/src/NHibernate.Test/HQL/Name.cs trunk/nhibernate/src/NHibernate.Test/HQL/SQLFunctionTemplateTest.cs trunk/nhibernate/src/NHibernate.Test/HQL/SimpleFunctionsTest.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/HQL/ trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/ Modified: trunk/nhibernate/src/NHibernate/Cfg/Environment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2008-10-19 21:16:44 UTC (rev 3867) +++ trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -93,6 +93,7 @@ public const string ShowSql = "show_sql"; public const string MaxFetchDepth = "max_fetch_depth"; public const string CurrentSessionContextClass = "current_session_context_class"; + public const string UseSqlComments = "use_sql_comments"; // Unused, Java-specific public const string UseGetGeneratedKeys = "jdbc.use_get_generated_keys"; Modified: trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs 2008-10-19 21:16:44 UTC (rev 3867) +++ trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -65,6 +65,10 @@ #endregion + bool comments = PropertiesHelper.GetBoolean(Environment.UseSqlComments, properties); + log.Info("Generate SQL with comments: " + EnabledDisabled(comments)); + settings.IsCommentsEnabled = comments; + int maxFetchDepth = PropertiesHelper.GetInt32(Environment.MaxFetchDepth, properties, -1); if (maxFetchDepth != -1) { Modified: trunk/nhibernate/src/NHibernate/IQuery.cs =================================================================== --- trunk/nhibernate/src/NHibernate/IQuery.cs 2008-10-19 21:16:44 UTC (rev 3867) +++ trunk/nhibernate/src/NHibernate/IQuery.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -62,6 +62,10 @@ /// </summary> IType[] ReturnTypes { get; } + /// <summary> Return the HQL select clause aliases (if any)</summary> + /// <returns> an array of aliases as strings </returns> + string[] ReturnAliases{get;} + /// <summary> /// The names of all named parameters of the query /// </summary> @@ -123,12 +127,17 @@ /// </exception> object UniqueResult(); - /// <summary> /// Strongly-typed version of <see cref="UniqueResult()"/>. /// </summary> T UniqueResult<T>(); + /// <summary> + /// Execute the update or delete statement. + /// </summary> + /// <returns> The number of entities updated or deleted. </returns> + int ExecuteUpdate(); + /// <summary> /// Set the maximum number of rows to retrieve. /// </summary> @@ -141,6 +150,13 @@ /// <param name="firstResult">The first row to retreive.</param> IQuery SetFirstResult(int firstResult); + /// <summary> + /// Entities retrieved by this query will be loaded in + /// a read-only mode where Hibernate will never dirty-check + /// them or make changes persistent. + /// </summary> + IQuery SetReadOnly(bool readOnly); + /// <summary> /// Enable caching of this query result set. /// </summary> @@ -152,19 +168,16 @@ /// for the default query cache</param> IQuery SetCacheRegion(string cacheRegion); - /// <summary> - /// Entities retrieved by this query will be loaded in - /// a read-only mode where Hibernate will never dirty-check - /// them or make changes persistent. - /// </summary> - IQuery SetReadOnly(bool readOnly); - /// <summary> /// The timeout for the underlying ADO query /// </summary> /// <param name="timeout"></param> IQuery SetTimeout(int timeout); + /// <summary> Set a fetch size for the underlying ADO query.</summary> + /// <param name="fetchSize">the fetch size </param> + IQuery SetFetchSize(int fetchSize); + /// <summary> /// Set the lockmode for the objects idententified by the /// given alias that appears in the <c>FROM</c> clause. @@ -173,7 +186,21 @@ /// <param name="lockMode"></param> IQuery SetLockMode(string alias, LockMode lockMode); + /// <summary> Add a comment to the generated SQL.</summary> + /// <param name="comment">a human-readable string </param> + IQuery SetComment(string comment); + /// <summary> + /// Override the current session flush mode, just for this query. + /// </summary> + IQuery SetFlushMode(FlushMode flushMode); + + /// <summary> Override the current session cache mode, just for this query. </summary> + /// <param name="cacheMode">The cache mode to use. </param> + /// <returns> this (for method chaining) </returns> + IQuery SetCacheMode(CacheMode cacheMode); + + /// <summary> /// Bind a value to an indexed parameter. /// </summary> /// <param name="position">Position of the parameter in the query, numbered from <c>0</c></param> @@ -395,20 +422,6 @@ IQuery SetDouble(string name, double val); /// <summary> - /// Bind an instance of a mapped persistent class to an indexed parameter. - /// </summary> - /// <param name="position">Position of the parameter in the query string, numbered from <c>0</c></param> - /// <param name="val">A non-null instance of a persistent class</param> - IQuery SetEntity(int position, object val); - - /// <summary> - /// Bind an instance of a mapped persistent class to a named parameter. - /// </summary> - /// <param name="name">The name of the parameter</param> - /// <param name="val">A non-null instance of a persistent class</param> - IQuery SetEntity(string name, object val); - - /// <summary> /// Bind an instance of a persistent enumeration class to an indexed parameter /// using an NHibernate <see cref="PersistentEnumType"/>. /// </summary> @@ -553,25 +566,23 @@ IQuery SetGuid(string name, Guid val); /// <summary> - /// Override the current session flush mode, just for this query. + /// Bind an instance of a mapped persistent class to an indexed parameter. /// </summary> - IQuery SetFlushMode(FlushMode flushMode); + /// <param name="position">Position of the parameter in the query string, numbered from <c>0</c></param> + /// <param name="val">A non-null instance of a persistent class</param> + IQuery SetEntity(int position, object val); /// <summary> + /// Bind an instance of a mapped persistent class to a named parameter. + /// </summary> + /// <param name="name">The name of the parameter</param> + /// <param name="val">A non-null instance of a persistent class</param> + IQuery SetEntity(string name, object val); + + /// <summary> /// Set a strategy for handling the query results. This can be used to change /// "shape" of the query result. /// </summary> IQuery SetResultTransformer(IResultTransformer resultTransformer); - - /// <summary> Override the current session cache mode, just for this query. </summary> - /// <param name="cacheMode">The cache mode to use. </param> - /// <returns> this (for method chaining) </returns> - IQuery SetCacheMode(CacheMode cacheMode); - - /// <summary> - /// Execute the update or delete statement. - /// </summary> - /// <returns> The number of entities updated or deleted. </returns> - int ExecuteUpdate(); } } Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs 2008-10-19 21:16:44 UTC (rev 3867) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -43,8 +43,9 @@ private bool shouldIgnoredUnknownNamedParameters; private CacheMode? cacheMode; private CacheMode? sessionCacheMode; + private string comment; - public AbstractQueryImpl(string queryString, FlushMode flushMode, ISessionImplementor session, + protected AbstractQueryImpl(string queryString, FlushMode flushMode, ISessionImplementor session, ParameterMetadata parameterMetadata) { this.session = session; @@ -76,7 +77,7 @@ { if (parameterMetadata.NamedParameterNames.Count != namedParameters.Count + namedParameterLists.Count) { - HashedSet<string> missingParams = new HashedSet<string>(parameterMetadata.NamedParameterNames); + var missingParams = new HashedSet<string>(parameterMetadata.NamedParameterNames); missingParams.RemoveAll(namedParameterLists.Keys); missingParams.RemoveAll(namedParameters.Keys); throw new QueryException("Not all named parameters have been set: " + CollectionPrinter.ToString(missingParams), QueryString); @@ -119,51 +120,31 @@ protected internal virtual IType DetermineType(int paramPosition, object paramValue, IType defaultType) { - IType type = parameterMetadata.GetOrdinalParameterExpectedType(paramPosition + 1); - if (type == null) - { - type = defaultType; - } + IType type = parameterMetadata.GetOrdinalParameterExpectedType(paramPosition + 1) ?? defaultType; return type; } protected internal virtual IType DetermineType(int paramPosition, object paramValue) { - IType type = parameterMetadata.GetOrdinalParameterExpectedType(paramPosition + 1); - if (type == null) - { - type = GuessType(paramValue); - } + IType type = parameterMetadata.GetOrdinalParameterExpectedType(paramPosition + 1) ?? GuessType(paramValue); return type; } protected internal virtual IType DetermineType(string paramName, object paramValue, IType defaultType) { - IType type = parameterMetadata.GetNamedParameterExpectedType(paramName); - if (type == null) - { - type = defaultType; - } + IType type = parameterMetadata.GetNamedParameterExpectedType(paramName) ?? defaultType; return type; } protected internal virtual IType DetermineType(string paramName, object paramValue) { - IType type = parameterMetadata.GetNamedParameterExpectedType(paramName); - if (type == null) - { - type = GuessType(paramValue); - } + IType type = parameterMetadata.GetNamedParameterExpectedType(paramName) ?? GuessType(paramValue); return type; } protected internal virtual IType DetermineType(string paramName, System.Type clazz) { - IType type = parameterMetadata.GetNamedParameterExpectedType(paramName); - if (type == null) - { - type = GuessType(clazz); - } + IType type = parameterMetadata.GetNamedParameterExpectedType(paramName) ?? GuessType(clazz); return type; } @@ -248,7 +229,7 @@ /// </summary> private string ExpandParameterList(string query, string name, TypedValue typedList, IDictionary<string, TypedValue> namedParamsCopy) { - ICollection vals = (ICollection)typedList.Value; + var vals = (ICollection)typedList.Value; IType type = typedList.Type; if (vals.Count == 1) { @@ -259,7 +240,7 @@ return query; } - StringBuilder list = new StringBuilder(16); + var list = new StringBuilder(16); int i = 0; bool isJpaPositionalParam = parameterMetadata.GetNamedParameterDescriptor(name).JpaStyle; foreach (object obj in vals) @@ -732,6 +713,11 @@ get { return session.Factory.GetReturnTypes(queryString); } } + public virtual string[] ReturnAliases + { + get { return session.Factory.GetReturnAliases(queryString); } + } + // TODO: maybe call it RowSelection ? public RowSelection Selection { @@ -772,6 +758,12 @@ public abstract IQuery SetLockMode(string alias, LockMode lockMode); + public IQuery SetComment(string comment) + { + this.comment = comment; + return this; + } + internal protected ISessionImplementor Session { get { return session; } @@ -921,14 +913,14 @@ ValueArray(), namedParams, LockModes, - selection, + Selection, readOnly, cacheable, cacheRegion, - string.Empty, - collectionKey == null ? null : new object[] { collectionKey }, + comment, + collectionKey == null ? null : new[] { collectionKey }, optionalObject, - optionalEntityName ?? null, + optionalEntityName, optionalId, resultTransformer); } Modified: trunk/nhibernate/src/NHibernate/Impl/SqlQueryImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SqlQueryImpl.cs 2008-10-19 21:16:44 UTC (rev 3867) +++ trunk/nhibernate/src/NHibernate/Impl/SqlQueryImpl.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -104,15 +104,15 @@ return result; } - //public string[] ReturnAliases - //{ - // get { throw new NotSupportedException( "SQL queries do not currently support returning aliases" ); } - //} + public override string[] ReturnAliases + { + get { throw new NotSupportedException("SQL queries do not currently support returning aliases"); } + } - //public override IType[] ReturnTypes - //{ - // get { throw new NotSupportedException( "not yet implemented for SQL queries" ); } - //} + public override IType[] ReturnTypes + { + get { throw new NotSupportedException("not yet implemented for SQL queries"); } + } public override IList List() { Modified: trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd =================================================================== --- trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd 2008-10-19 21:16:44 UTC (rev 3867) +++ trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd 2008-10-20 15:43:09 UTC (rev 3868) @@ -98,6 +98,7 @@ <xs:enumeration value="adonet.factory_class" /> <xs:enumeration value="default_batch_fetch_size" /> <xs:enumeration value="default_entity_mode" /> + <xs:enumeration value="use_sql_comments" /> </xs:restriction> </xs:simpleType> </xs:attribute> Property changes on: trunk/nhibernate/src/NHibernate.Test/HQL ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Animal.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/Animal.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/Animal.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { public class Animal { Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Animal.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/Animal.hbm.xml 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/Animal.hbm.xml 2008-10-20 15:43:09 UTC (rev 3868) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQLFunctionTest" + namespace="NHibernate.Test.Hql" default-access="field.camelcase-underscore" default-lazy="true"> Modified: trunk/nhibernate/src/NHibernate.Test/HQL/BaseFunctionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/BaseFunctionFixture.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/BaseFunctionFixture.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -3,7 +3,7 @@ using NHibernate.Engine; using NUnit.Framework; -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { public class BaseFunctionFixture { Modified: trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/HQLFunctions.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -4,7 +4,7 @@ using NHibernate.Dialect.Function; using NUnit.Framework; -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { /// <summary> /// This test run each HQL function separatelly so is easy to know wich function need @@ -42,7 +42,7 @@ protected override IList Mappings { - get { return new string[] { "HQLFunctionTest.Animal.hbm.xml", "HQLFunctionTest.MaterialResource.hbm.xml" }; } + get { return new string[] { "HQL.Animal.hbm.xml", "HQL.MaterialResource.hbm.xml" }; } } protected override void OnTearDown() Added: trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -0,0 +1,74 @@ +using System.Collections; +using NHibernate.Engine.Query; +using NHibernate.Util; +using NUnit.Framework; + +namespace NHibernate.Test.Hql +{ + [TestFixture, Ignore("Not supported yet.")] + public class HqlFixture : TestCase + { + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override IList Mappings + { + get { return new[] {"HQL.Animal.hbm.xml"}; } + } + + protected HQLQueryPlan CreateQueryPlan(string hql, bool scalar) + { + return new HQLQueryPlan(hql, scalar, new CollectionHelper.EmptyMapClass<string, IFilter>(), sessions); + } + + protected HQLQueryPlan CreateQueryPlan(string hql) + { + return CreateQueryPlan(hql, false); + } + + private static void Check(ReturnMetadata returnMetadata, bool expectingEmptyTypes, bool expectingEmptyAliases) + { + Assert.IsNotNull(returnMetadata, "null return metadata"); + Assert.IsNotNull(returnMetadata, "null return metadata - types"); + Assert.AreEqual(1, returnMetadata.ReturnTypes.Length, "unexpected return size"); + + if (expectingEmptyTypes) + { + Assert.IsNull(returnMetadata.ReturnTypes[0], "non-empty types"); + } + else + { + Assert.IsNotNull(returnMetadata.ReturnTypes[0], "empty types"); + } + + if (expectingEmptyAliases) + { + Assert.IsNull(returnMetadata.ReturnAliases, "non-empty aliases"); + } + else + { + Assert.IsNotNull(returnMetadata.ReturnAliases, "empty aliases"); + Assert.IsNotNull(returnMetadata.ReturnAliases[0], "empty aliases"); + } + } + + [Test] + public void ReturnMetadata() + { + HQLQueryPlan plan; + plan = CreateQueryPlan("from Animal a"); + Check(plan.ReturnMetadata, false, true); + + plan = CreateQueryPlan("select a as animal from Animal a"); + Check(plan.ReturnMetadata, false, false); + + plan = CreateQueryPlan("from java.lang.Object"); + Check(plan.ReturnMetadata, true, true); + + plan = CreateQueryPlan("select o as entity from java.lang.Object o"); + Check(plan.ReturnMetadata, true, false); + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Human.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/Human.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/Human.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -1,6 +1,6 @@ using System; -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { public class Human: Animal { Modified: trunk/nhibernate/src/NHibernate.Test/HQL/MaterialResource.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/MaterialResource.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/MaterialResource.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -1,6 +1,6 @@ using System; -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { public class MaterialResource { Modified: trunk/nhibernate/src/NHibernate.Test/HQL/MaterialResource.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/MaterialResource.hbm.xml 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/MaterialResource.hbm.xml 2008-10-20 15:43:09 UTC (rev 3868) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQLFunctionTest" + namespace="NHibernate.Test.Hql" default-access="field.camelcase-underscore" default-lazy="true"> Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Name.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/Name.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/Name.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -1,6 +1,6 @@ using System; -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { public class Name { Modified: trunk/nhibernate/src/NHibernate.Test/HQL/SQLFunctionTemplateTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/SQLFunctionTemplateTest.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/SQLFunctionTemplateTest.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -4,7 +4,7 @@ using NHibernate.Dialect.Function; using NUnit.Framework; -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { [TestFixture] public class SQLFunctionTemplateTest : BaseFunctionFixture Modified: trunk/nhibernate/src/NHibernate.Test/HQL/SimpleFunctionsTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/SimpleFunctionsTest.cs 2008-10-18 22:18:15 UTC (rev 3865) +++ trunk/nhibernate/src/NHibernate.Test/HQL/SimpleFunctionsTest.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -5,7 +5,7 @@ using NUnit.Framework; using NHibernate.SqlCommand; -namespace NHibernate.Test.HQLFunctionTest +namespace NHibernate.Test.Hql { [TestFixture] public class SimpleFunctionsTest : BaseFunctionFixture Added: trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs 2008-10-20 15:43:09 UTC (rev 3868) @@ -0,0 +1,40 @@ +using System.Collections; +using NHibernate.Cfg; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; + +namespace NHibernate.Test.HQL +{ + [TestFixture] + public class SqlCommentsFixture : TestCase + { + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override IList Mappings + { + get { return new[] { "HQL.Animal.hbm.xml" }; } + } + + protected override void Configure(Configuration configuration) + { + configuration.SetProperty(Environment.UseSqlComments, "true"); + } + + [Test] + public void CommentsInQuery() + { + using (ISession s = OpenSession()) + { + using (var sl = new SqlLogSpy()) + { + s.CreateQuery("from Animal").SetComment("This is my query").List(); + string sql = sl.Appender.GetEvents()[0].RenderedMessage; + Assert.That(sql.IndexOf("This is my query"), Is.GreaterThan(0)); + } + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-19 21:16:44 UTC (rev 3867) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-20 15:43:09 UTC (rev 3868) @@ -274,16 +274,18 @@ <Compile Include="GenericTest\SetGeneric\A.cs" /> <Compile Include="GenericTest\SetGeneric\B.cs" /> <Compile Include="GenericTest\SetGeneric\SetGenericFixture.cs" /> - <Compile Include="HQLFunctionTest\Animal.cs" /> - <Compile Include="HQLFunctionTest\BaseFunctionFixture.cs" /> - <Compile Include="HQLFunctionTest\HQLFunctions.cs" /> - <Compile Include="HQLFunctionTest\Human.cs" /> - <Compile Include="HQLFunctionTest\MaterialResource.cs" /> - <Compile Include="HQLFunctionTest\Name.cs" /> - <Compile Include="HQLFunctionTest\SimpleFunctionsTest.cs" /> - <Compile Include="HQLFunctionTest\SQLFunctionTemplateTest.cs" /> + <Compile Include="HQL\Animal.cs" /> + <Compile Include="HQL\BaseFunctionFixture.cs" /> + <Compile Include="HQL\HQLFunctions.cs" /> + <Compile Include="HQL\Human.cs" /> + <Compile Include="HQL\MaterialResource.cs" /> + <Compile Include="HQL\Name.cs" /> + <Compile Include="HQL\SimpleFunctionsTest.cs" /> + <Compile Include="HQL\SqlCommentsFixture.cs" /> + <Compile Include="HQL\SQLFunctionTemplateTest.cs" /> <Compile Include="BulkManipulation\NativeSQLBulkOperations.cs" /> <Compile Include="BulkManipulation\Vehicles.cs" /> + <Compile Include="HQL\HqlFixture.cs" /> <Compile Include="IdGen\Enhanced\SequenceStyleConfigUnitFixture.cs" /> <Compile Include="IdTest\Car.cs" /> <Compile Include="IdTest\HiLoInt16Class.cs" /> @@ -1184,7 +1186,7 @@ <EmbeddedResource Include="NHSpecificTest\NH712\Mappings.hbm.xml" /> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="HQLFunctionTest\Animal.hbm.xml" /> + <EmbeddedResource Include="HQL\Animal.hbm.xml" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="ExpressionTest\SubQueries\Mappings.hbm.xml" /> @@ -1294,7 +1296,7 @@ <EmbeddedResource Include="NHSpecificTest\NH980\Mappings.hbm.xml" /> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="HQLFunctionTest\MaterialResource.hbm.xml" /> + <EmbeddedResource Include="HQL\MaterialResource.hbm.xml" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Join\CompositeKey.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |