From: <cha...@us...> - 2008-08-12 15:40:21
|
Revision: 3698 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3698&view=rev Author: chadly69 Date: 2008-08-12 15:40:30 +0000 (Tue, 12 Aug 2008) Log Message: ----------- Adding skeleton for NHibernate.Linq project to NHibernate-3.5.sln. Modified Paths: -------------- trunk/nhibernate/src/NHibernate-3.5.sln Added Paths: ----------- trunk/nhibernate/src/NHibernate.Linq/ trunk/nhibernate/src/NHibernate.Linq/ExpressionVisitor.cs trunk/nhibernate/src/NHibernate.Linq/NHibernate.Linq.csproj trunk/nhibernate/src/NHibernate.Linq/NHibernateExtensions.cs trunk/nhibernate/src/NHibernate.Linq.Test/ trunk/nhibernate/src/NHibernate.Linq.Test/NHibernate.Linq.Test.csproj Modified: trunk/nhibernate/src/NHibernate-3.5.sln =================================================================== --- trunk/nhibernate/src/NHibernate-3.5.sln 2008-08-10 13:33:01 UTC (rev 3697) +++ trunk/nhibernate/src/NHibernate-3.5.sln 2008-08-12 15:40:30 UTC (rev 3698) @@ -11,6 +11,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Test-3.5", "NHibernate.Test\NHibernate.Test-3.5.csproj", "{7AEE5B37-C552-4E59-9B6F-88755BCB5070}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Linq", "NHibernate.Linq\NHibernate.Linq.csproj", "{3073F5DA-5D57-4E12-9F95-8516ED346E67}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Linq.Test", "NHibernate.Linq.Test\NHibernate.Linq.Test.csproj", "{FEAC164E-DE15-418A-8A70-35085B33C548}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,6 +33,14 @@ {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Debug|Any CPU.Build.0 = Debug|Any CPU {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Any CPU.ActiveCfg = Release|Any CPU {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Any CPU.Build.0 = Release|Any CPU + {3073F5DA-5D57-4E12-9F95-8516ED346E67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3073F5DA-5D57-4E12-9F95-8516ED346E67}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3073F5DA-5D57-4E12-9F95-8516ED346E67}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3073F5DA-5D57-4E12-9F95-8516ED346E67}.Release|Any CPU.Build.0 = Release|Any CPU + {FEAC164E-DE15-418A-8A70-35085B33C548}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FEAC164E-DE15-418A-8A70-35085B33C548}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FEAC164E-DE15-418A-8A70-35085B33C548}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FEAC164E-DE15-418A-8A70-35085B33C548}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Property changes on: trunk/nhibernate/src/NHibernate.Linq ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Added: trunk/nhibernate/src/NHibernate.Linq/ExpressionVisitor.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Linq/ExpressionVisitor.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Linq/ExpressionVisitor.cs 2008-08-12 15:40:30 UTC (rev 3698) @@ -0,0 +1,393 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +namespace NHibernate.Linq.Visitors +{ + /// <summary> + /// Provides virtual methods that can be used by subclasses to parse an expression tree. + /// </summary> + /// <remarks> + /// Copied from internal class of same name in System.Core assembly. + /// </remarks> + [DebuggerStepThrough, DebuggerNonUserCode] + public abstract class ExpressionVisitor + { + public virtual Expression Visit(Expression exp) + { + if (exp == null) return exp; + + switch (exp.NodeType) + { + case ExpressionType.Negate: + case ExpressionType.NegateChecked: + case ExpressionType.Not: + case ExpressionType.Convert: + case ExpressionType.ConvertChecked: + case ExpressionType.ArrayLength: + case ExpressionType.Quote: + case ExpressionType.TypeAs: + return VisitUnary((UnaryExpression)exp); + case ExpressionType.Add: + case ExpressionType.AddChecked: + case ExpressionType.Subtract: + case ExpressionType.SubtractChecked: + case ExpressionType.Multiply: + case ExpressionType.MultiplyChecked: + case ExpressionType.Divide: + case ExpressionType.Modulo: + case ExpressionType.And: + case ExpressionType.AndAlso: + case ExpressionType.Or: + case ExpressionType.OrElse: + case ExpressionType.LessThan: + case ExpressionType.LessThanOrEqual: + case ExpressionType.GreaterThan: + case ExpressionType.GreaterThanOrEqual: + case ExpressionType.Equal: + case ExpressionType.NotEqual: + case ExpressionType.Coalesce: + case ExpressionType.ArrayIndex: + case ExpressionType.RightShift: + case ExpressionType.LeftShift: + case ExpressionType.ExclusiveOr: + return VisitBinary((BinaryExpression)exp); + case ExpressionType.TypeIs: + return VisitTypeIs((TypeBinaryExpression)exp); + case ExpressionType.Conditional: + return VisitConditional((ConditionalExpression)exp); + case ExpressionType.Constant: + return VisitConstant((ConstantExpression)exp); + case ExpressionType.Parameter: + return VisitParameter((ParameterExpression)exp); + case ExpressionType.MemberAccess: + return VisitMemberAccess((MemberExpression)exp); + case ExpressionType.Call: + return VisitMethodCall((MethodCallExpression)exp); + case ExpressionType.Lambda: + return VisitLambda((LambdaExpression)exp); + case ExpressionType.New: + return VisitNew((NewExpression)exp); + case ExpressionType.NewArrayInit: + case ExpressionType.NewArrayBounds: + return VisitNewArray((NewArrayExpression)exp); + case ExpressionType.Invoke: + return VisitInvocation((InvocationExpression)exp); + case ExpressionType.MemberInit: + return VisitMemberInit((MemberInitExpression)exp); + case ExpressionType.ListInit: + return VisitListInit((ListInitExpression)exp); + default: + throw new NotSupportedException(String.Format("Unhandled expression type: '{0}'", exp.NodeType)); + } + } + + protected virtual MemberBinding VisitBinding(MemberBinding binding) + { + switch (binding.BindingType) + { + case MemberBindingType.Assignment: + return VisitMemberAssignment((MemberAssignment)binding); + case MemberBindingType.MemberBinding: + return VisitMemberMemberBinding((MemberMemberBinding)binding); + case MemberBindingType.ListBinding: + return VisitMemberListBinding((MemberListBinding)binding); + default: + throw new NotSupportedException(string.Format("Unhandled binding type '{0}'", binding.BindingType)); + } + } + + protected virtual ElementInit VisitElementInitializer(ElementInit initializer) + { + ReadOnlyCollection<Expression> arguments = VisitList(initializer.Arguments); + if (arguments != initializer.Arguments) + { + return Expression.ElementInit(initializer.AddMethod, arguments); + } + return initializer; + } + + protected virtual Expression VisitUnary(UnaryExpression u) + { + Expression operand = Visit(u.Operand); + if (operand != u.Operand) + { + return Expression.MakeUnary(u.NodeType, operand, u.Type, u.Method); + } + return u; + } + + protected virtual Expression VisitBinary(BinaryExpression b) + { + Expression left = Visit(b.Left); + Expression right = Visit(b.Right); + Expression conversion = Visit(b.Conversion); + + if (left != b.Left || right != b.Right || conversion != b.Conversion) + { + if (b.NodeType == ExpressionType.Coalesce && b.Conversion != null) + return Expression.Coalesce(left, right, conversion as LambdaExpression); + else + return Expression.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method); + } + return b; + } + + protected virtual Expression VisitTypeIs(TypeBinaryExpression b) + { + Expression expr = Visit(b.Expression); + if (expr != b.Expression) + { + return Expression.TypeIs(expr, b.TypeOperand); + } + return b; + } + + protected virtual Expression VisitConstant(ConstantExpression c) + { + return c; + } + + protected virtual Expression VisitConditional(ConditionalExpression c) + { + Expression test = Visit(c.Test); + Expression ifTrue = Visit(c.IfTrue); + Expression ifFalse = Visit(c.IfFalse); + + if (test != c.Test || ifTrue != c.IfTrue || ifFalse != c.IfFalse) + { + return Expression.Condition(test, ifTrue, ifFalse); + } + + return c; + } + + protected virtual Expression VisitParameter(ParameterExpression p) + { + return p; + } + + protected virtual Expression VisitMemberAccess(MemberExpression m) + { + Expression exp = Visit(m.Expression); + if (exp != m.Expression) + { + return Expression.MakeMemberAccess(exp, m.Member); + } + return m; + } + + protected virtual Expression VisitMethodCall(MethodCallExpression m) + { + Expression obj = Visit(m.Object); + IEnumerable<Expression> args = VisitList(m.Arguments); + + if (obj != m.Object || args != m.Arguments) + { + return Expression.Call(obj, m.Method, args); + } + + return m; + } + + protected virtual ReadOnlyCollection<Expression> VisitList(ReadOnlyCollection<Expression> original) + { + List<Expression> list = null; + for (int i = 0, n = original.Count; i < n; i++) + { + Expression p = Visit(original[i]); + if (list != null) + { + list.Add(p); + } + else if (p != original[i]) + { + list = new List<Expression>(n); + for (int j = 0; j < i; j++) + { + list.Add(original[j]); + } + list.Add(p); + } + } + + if (list != null) + return list.AsReadOnly(); + + return original; + } + + protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignment) + { + Expression e = Visit(assignment.Expression); + + if (e != assignment.Expression) + { + return Expression.Bind(assignment.Member, e); + } + + return assignment; + } + + protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) + { + IEnumerable<MemberBinding> bindings = VisitBindingList(binding.Bindings); + + if (bindings != binding.Bindings) + { + return Expression.MemberBind(binding.Member, bindings); + } + + return binding; + } + + protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding) + { + IEnumerable<ElementInit> initializers = VisitElementInitializerList(binding.Initializers); + + if (initializers != binding.Initializers) + { + return Expression.ListBind(binding.Member, initializers); + } + return binding; + } + + protected virtual IEnumerable<MemberBinding> VisitBindingList(ReadOnlyCollection<MemberBinding> original) + { + List<MemberBinding> list = null; + for (int i = 0, n = original.Count; i < n; i++) + { + MemberBinding b = VisitBinding(original[i]); + if (list != null) + { + list.Add(b); + } + else if (b != original[i]) + { + list = new List<MemberBinding>(n); + for (int j = 0; j < i; j++) + { + list.Add(original[j]); + } + list.Add(b); + } + } + + if (list != null) + return list; + + return original; + } + + protected virtual IEnumerable<ElementInit> VisitElementInitializerList(ReadOnlyCollection<ElementInit> original) + { + List<ElementInit> list = null; + for (int i = 0, n = original.Count; i < n; i++) + { + ElementInit init = VisitElementInitializer(original[i]); + if (list != null) + { + list.Add(init); + } + else if (init != original[i]) + { + list = new List<ElementInit>(n); + for (int j = 0; j < i; j++) + { + list.Add(original[j]); + } + list.Add(init); + } + } + + if (list != null) + return list; + + return original; + } + + protected virtual Expression VisitLambda(LambdaExpression lambda) + { + Expression body = Visit(lambda.Body); + if (body != lambda.Body) + { + return Expression.Lambda(lambda.Type, body, lambda.Parameters); + } + return lambda; + } + + protected virtual NewExpression VisitNew(NewExpression nex) + { + IEnumerable<Expression> args = VisitList(nex.Arguments); + if (args != nex.Arguments) + { + if (nex.Members != null) + return Expression.New(nex.Constructor, args, nex.Members); + else + return Expression.New(nex.Constructor, args); + } + + return nex; + } + + protected virtual Expression VisitMemberInit(MemberInitExpression init) + { + NewExpression n = VisitNew(init.NewExpression); + IEnumerable<MemberBinding> bindings = VisitBindingList(init.Bindings); + + if (n != init.NewExpression || bindings != init.Bindings) + { + return Expression.MemberInit(n, bindings); + } + + return init; + } + + protected virtual Expression VisitListInit(ListInitExpression init) + { + NewExpression n = VisitNew(init.NewExpression); + IEnumerable<ElementInit> initializers = VisitElementInitializerList(init.Initializers); + + if (n != init.NewExpression || initializers != init.Initializers) + { + return Expression.ListInit(n, initializers); + } + + return init; + } + + protected virtual Expression VisitNewArray(NewArrayExpression na) + { + IEnumerable<Expression> exprs = VisitList(na.Expressions); + if (exprs != na.Expressions) + { + if (na.NodeType == ExpressionType.NewArrayInit) + { + return Expression.NewArrayInit(na.Type.GetElementType(), exprs); + } + else + { + return Expression.NewArrayBounds(na.Type.GetElementType(), exprs); + } + } + + return na; + } + + protected virtual Expression VisitInvocation(InvocationExpression iv) + { + IEnumerable<Expression> args = VisitList(iv.Arguments); + Expression expr = Visit(iv.Expression); + + if (args != iv.Arguments || expr != iv.Expression) + { + return Expression.Invoke(expr, args); + } + + return iv; + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Linq/NHibernate.Linq.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Linq/NHibernate.Linq.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.Linq/NHibernate.Linq.csproj 2008-08-12 15:40:30 UTC (rev 3698) @@ -0,0 +1,60 @@ +<?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.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{3073F5DA-5D57-4E12-9F95-8516ED346E67}</ProjectGuid> + <OutputType>Library</OutputType> + <RootNamespace>NHibernate.Linq</RootNamespace> + <AssemblyName>Linq2NHibernate</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate\NHibernate-3.5.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate-3.5</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Compile Include="ExpressionVisitor.cs" /> + <Compile Include="NHibernateExtensions.cs" /> + </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.Linq/NHibernateExtensions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Linq/NHibernateExtensions.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Linq/NHibernateExtensions.cs 2008-08-12 15:40:30 UTC (rev 3698) @@ -0,0 +1,22 @@ +using System; +using System.Linq; + +namespace NHibernate.Linq +{ + /// <summary> + /// Provides a static method that enables LINQ syntax for NHibernate Queries. + /// </summary> + public static class NHibernateExtensions + { + /// <summary> + /// Creates a new <see cref="T:NHibernate.Linq.NHibernateQueryProvider"/> object used to evaluate an expression tree. + /// </summary> + /// <typeparam name="T">An NHibernate entity type.</typeparam> + /// <param name="session">An initialized <see cref="T:NHibernate.ISession"/> object.</param> + /// <returns>An <see cref="T:NHibernate.Linq.NHibernateQueryProvider"/> used to evaluate an expression tree.</returns> + public static IQueryable<T> Linq<T>(this ISession session) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Linq.Test ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Added: trunk/nhibernate/src/NHibernate.Linq.Test/NHibernate.Linq.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Linq.Test/NHibernate.Linq.Test.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.Linq.Test/NHibernate.Linq.Test.csproj 2008-08-12 15:40:30 UTC (rev 3698) @@ -0,0 +1,68 @@ +<?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.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{FEAC164E-DE15-418A-8A70-35085B33C548}</ProjectGuid> + <OutputType>Library</OutputType> + <RootNamespace>NHibernate.Linq.Test</RootNamespace> + <AssemblyName>NHibernate.Linq.Test</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <ItemGroup> + <Reference Include="nunit.core, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\nunit.core.dll</HintPath> + </Reference> + <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate.Linq\NHibernate.Linq.csproj"> + <Project>{3073F5DA-5D57-4E12-9F95-8516ED346E67}</Project> + <Name>NHibernate.Linq</Name> + </ProjectReference> + <ProjectReference Include="..\NHibernate\NHibernate-3.5.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate-3.5</Name> + </ProjectReference> + </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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-09-28 14:38:22
|
Revision: 3792 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3792&view=rev Author: fabiomaulo Date: 2008-09-28 14:38:08 +0000 (Sun, 28 Sep 2008) Log Message: ----------- All project-solutions are now working with VS2008 (going to checkout a fresh svn-copy) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Tool.HbmXsd/NHibernate.Tool.HbmXsd.csproj Added Paths: ----------- trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj trunk/nhibernate/src/Iesi.Collections.sln trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj trunk/nhibernate/src/NHibernate.Everything.sln trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj trunk/nhibernate/src/NHibernate.sln Removed Paths: ------------- trunk/nhibernate/src/Iesi.Collections/Iesi.Collections-2.0.csproj trunk/nhibernate/src/Iesi.Collections-2.0.sln trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test-2.0.csproj trunk/nhibernate/src/NHibernate/NHibernate-2.0.csproj trunk/nhibernate/src/NHibernate/NHibernate-3.5.csproj trunk/nhibernate/src/NHibernate-2.0.sln trunk/nhibernate/src/NHibernate-3.5.sln trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-2.0.csproj trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-3.5.csproj trunk/nhibernate/src/NHibernate.Everything-2.0.sln trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples-2.0.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test-3.5.csproj trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance-2.0.csproj Deleted: trunk/nhibernate/src/Iesi.Collections/Iesi.Collections-2.0.csproj =================================================================== --- trunk/nhibernate/src/Iesi.Collections/Iesi.Collections-2.0.csproj 2008-09-28 13:49:40 UTC (rev 3791) +++ trunk/nhibernate/src/Iesi.Collections/Iesi.Collections-2.0.csproj 2008-09-28 14:38:08 UTC (rev 3792) @@ -1,66 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Iesi.Collections</RootNamespace> - <AssemblyName>Iesi.Collections</AssemblyName> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug-2.0\</OutputPath> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> - <IntermediateOutputPath>obj\Debug-2.0\</IntermediateOutputPath> - <DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release-2.0\</OutputPath> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> - <IntermediateOutputPath>obj\Release-2.0\</IntermediateOutputPath> - <DefineConstants>TRACE;NET_2_0</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="AssemblyInfo.cs" /> - <Compile Include="DictionarySet.cs" /> - <Compile Include="Generic\DictionarySet.cs" /> - <Compile Include="Generic\HashedSet.cs" /> - <Compile Include="Generic\ImmutableSet.cs" /> - <Compile Include="Generic\ISet.cs" /> - <Compile Include="Generic\Set.cs" /> - <Compile Include="Generic\SortedSet.cs" /> - <Compile Include="Generic\SynchronizedSet.cs" /> - <Compile Include="HashedSet.cs" /> - <Compile Include="HybridSet.cs" /> - <Compile Include="ImmutableSet.cs" /> - <Compile Include="ISet.cs" /> - <Compile Include="ListSet.cs" /> - <Compile Include="Set.cs" /> - <Compile Include="SortedSet.cs" /> - <Compile Include="SynchronizedSet.cs" /> - <None Include="Iesi.Collections.build" /> - </ItemGroup> - <ItemGroup> - <Content Include="NamespaceSummary.xml" /> - </ItemGroup> - <ItemGroup> - <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -</Project> \ No newline at end of file Copied: trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj (from rev 3791, trunk/nhibernate/src/Iesi.Collections/Iesi.Collections-2.0.csproj) =================================================================== --- trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj (rev 0) +++ trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj 2008-09-28 14:38:08 UTC (rev 3792) @@ -0,0 +1,71 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Iesi.Collections</RootNamespace> + <AssemblyName>Iesi.Collections</AssemblyName> + <FileUpgradeFlags> + </FileUpgradeFlags> + <OldToolsVersion>2.0</OldToolsVersion> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug-2.0\</OutputPath> + <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> + <IntermediateOutputPath>obj\Debug-2.0\</IntermediateOutputPath> + <DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release-2.0\</OutputPath> + <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> + <IntermediateOutputPath>obj\Release-2.0\</IntermediateOutputPath> + <DefineConstants>TRACE;NET_2_0</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="DictionarySet.cs" /> + <Compile Include="Generic\DictionarySet.cs" /> + <Compile Include="Generic\HashedSet.cs" /> + <Compile Include="Generic\ImmutableSet.cs" /> + <Compile Include="Generic\ISet.cs" /> + <Compile Include="Generic\Set.cs" /> + <Compile Include="Generic\SortedSet.cs" /> + <Compile Include="Generic\SynchronizedSet.cs" /> + <Compile Include="HashedSet.cs" /> + <Compile Include="HybridSet.cs" /> + <Compile Include="ImmutableSet.cs" /> + <Compile Include="ISet.cs" /> + <Compile Include="ListSet.cs" /> + <Compile Include="Set.cs" /> + <Compile Include="SortedSet.cs" /> + <Compile Include="SynchronizedSet.cs" /> + <None Include="Iesi.Collections.build" /> + </ItemGroup> + <ItemGroup> + <Content Include="NamespaceSummary.xml" /> + </ItemGroup> + <ItemGroup> + <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> +</Project> \ No newline at end of file Property changes on: trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.csproj ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: trunk/nhibernate/src/Iesi.Collections-2.0.sln =================================================================== --- trunk/nhibernate/src/Iesi.Collections-2.0.sln 2008-09-28 13:49:40 UTC (rev 3791) +++ trunk/nhibernate/src/Iesi.Collections-2.0.sln 2008-09-28 14:38:08 UTC (rev 3792) @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iesi.Collections-2.0", "Iesi.Collections\Iesi.Collections-2.0.csproj", "{4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iesi.Collections.Test-2.0", "Iesi.Collections.Test\Iesi.Collections.Test-2.0.csproj", "{58CE4584-31B9-4E74-A7FB-5D40BFAD0876}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Release|Any CPU.Build.0 = Release|Any CPU - {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Deleted: trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test-2.0.csproj =================================================================== --- trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test-2.0.csproj 2008-09-28 13:49:40 UTC (rev 3791) +++ trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test-2.0.csproj 2008-09-28 14:38:08 UTC (rev 3792) @@ -1,76 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{58CE4584-31B9-4E74-A7FB-5D40BFAD0876}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Iesi.Collections.Test</RootNamespace> - <AssemblyName>Iesi.Collections.Test</AssemblyName> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug-2.0\</OutputPath> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> - <IntermediateOutputPath>obj\Debug-2.0\</IntermediateOutputPath> - <DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release-2.0\</OutputPath> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> - <IntermediateOutputPath>obj\Release-2.0\</IntermediateOutputPath> - <DefineConstants>TRACE;NET_2_0</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\nunit.framework.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="AssemblyInfo.cs" /> - <Compile Include="Generic\HashedSetFixture.cs" /> - <Compile Include="Generic\ImmutableSetFixture.cs" /> - <Compile Include="Generic\SetFixture.cs" /> - <Compile Include="Generic\SortedSetFixture.cs" /> - <Compile Include="HashedSetFixture.cs" /> - <Compile Include="HybridSetFixture.cs" /> - <Compile Include="ListSetFixture.cs" /> - <Compile Include="SetFixture.cs" /> - <Compile Include="SortedSetFixture.cs" /> - </ItemGroup> - <ItemGroup> - <None Include="Iesi.Collections.Test.build" /> - <None Include="Iesi.Collections.Test.nunit" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\Iesi.Collections\Iesi.Collections-2.0.csproj"> - <Project>{4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}</Project> - <Name>Iesi.Collections-2.0</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file Copied: trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj (from rev 3791, trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test-2.0.csproj) =================================================================== --- trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj (rev 0) +++ trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj 2008-09-28 14:38:08 UTC (rev 3792) @@ -0,0 +1,81 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{58CE4584-31B9-4E74-A7FB-5D40BFAD0876}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Iesi.Collections.Test</RootNamespace> + <AssemblyName>Iesi.Collections.Test</AssemblyName> + <FileUpgradeFlags> + </FileUpgradeFlags> + <OldToolsVersion>2.0</OldToolsVersion> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug-2.0\</OutputPath> + <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> + <IntermediateOutputPath>obj\Debug-2.0\</IntermediateOutputPath> + <DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release-2.0\</OutputPath> + <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> + <IntermediateOutputPath>obj\Release-2.0\</IntermediateOutputPath> + <DefineConstants>TRACE;NET_2_0</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="Generic\HashedSetFixture.cs" /> + <Compile Include="Generic\ImmutableSetFixture.cs" /> + <Compile Include="Generic\SetFixture.cs" /> + <Compile Include="Generic\SortedSetFixture.cs" /> + <Compile Include="HashedSetFixture.cs" /> + <Compile Include="HybridSetFixture.cs" /> + <Compile Include="ListSetFixture.cs" /> + <Compile Include="SetFixture.cs" /> + <Compile Include="SortedSetFixture.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="Iesi.Collections.Test.build" /> + <None Include="Iesi.Collections.Test.nunit" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Iesi.Collections\Iesi.Collections.csproj"> + <Project>{4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}</Project> + <Name>Iesi.Collections</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Property changes on: trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Added: trunk/nhibernate/src/Iesi.Collections.sln =================================================================== --- trunk/nhibernate/src/Iesi.Collections.sln (rev 0) +++ trunk/nhibernate/src/Iesi.Collections.sln 2008-09-28 14:38:08 UTC (rev 3792) @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iesi.Collections", "Iesi.Collections\Iesi.Collections.csproj", "{4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iesi.Collections.Test", "Iesi.Collections.Test\Iesi.Collections.Test.csproj", "{58CE4584-31B9-4E74-A7FB-5D40BFAD0876}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Release|Any CPU.Build.0 = Release|Any CPU + {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58CE4584-31B9-4E74-A7FB-5D40BFAD0876}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Deleted: trunk/nhibernate/src/NHibernate/NHibernate-2.0.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate-2.0.csproj 2008-09-28 13:49:40 UTC (rev 3791) +++ trunk/nhibernate/src/NHibernate/NHibernate-2.0.csproj 2008-09-28 14:38:08 UTC (rev 3792) @@ -1,1136 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>NHibernate</RootNamespace> - <AssemblyName>NHibernate</AssemblyName> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug-2.0\</OutputPath> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> - <IntermediateOutputPath>obj\Debug-2.0\</IntermediateOutputPath> - <DefineConstants>TRACE;DEBUG</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <DocumentationFile>bin\Debug-2.0\NHibernate.XML</DocumentationFile> - <NoWarn>1591</NoWarn> - <WarningsAsErrors>1717;1574</WarningsAsErrors> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release-2.0\</OutputPath> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> - <IntermediateOutputPath>obj\Release-2.0\</IntermediateOutputPath> - <DefineConstants>TRACE;NET_2_0</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="Castle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\Castle.Core.dll</HintPath> - </Reference> - <Reference Include="Castle.DynamicProxy2, Version=2.0.0.1, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\Castle.DynamicProxy2.dll</HintPath> - </Reference> - <Reference Include="Iesi.Collections, Version=1.0.0.1, Culture=neutral, PublicKeyToken=154fdcb44c4484fc"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\Iesi.Collections.dll</HintPath> - </Reference> - <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\log4net.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.configuration" /> - <Reference Include="System.Data" /> - <Reference Include="System.Data.OracleClient" /> - <Reference Include="System.Transactions" /> - <Reference Include="System.Web" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="ADOException.cs" /> - <Compile Include="AssemblyInfo.cs" /> - <Compile Include="AssertionFailure.cs" /> - <Compile Include="Cache\CachedItem.cs" /> - <Compile Include="Cache\CacheException.cs" /> - <Compile Include="Cache\CacheFactory.cs" /> - <Compile Include="Cache\CacheLock.cs" /> - <Compile Include="Cache\HashtableCache.cs" /> - <Compile Include="Cache\HashtableCacheProvider.cs" /> - <Compile Include="Cache\ICache.cs" /> - <Compile Include="Cache\ICacheConcurrencyStrategy.cs" /> - <Compile Include="Cache\ICacheProvider.cs" /> - <Compile Include="Cache\IQueryCache.cs" /> - <Compile Include="Cache\IQueryCacheFactory.cs" /> - <Compile Include="Cache\ISoftLock.cs" /> - <Compile Include="Cache\NonstrictReadWriteCache.cs" /> - <Compile Include="Cache\QueryKey.cs" /> - <Compile Include="Cache\ReadOnlyCache.cs" /> - <Compile Include="Cache\ReadWriteCache.cs" /> - <Compile Include="Cache\StandardQueryCache.cs" /> - <Compile Include="Cache\StandardQueryCacheFactory.cs" /> - <Compile Include="Cache\Timestamper.cs" /> - <Compile Include="Cache\UpdateTimestampsCache.cs" /> - <Compile Include="CallbackException.cs" /> - <Compile Include="Cfg\MappingsQueue.cs" /> - <Compile Include="Cfg\Configuration.cs" /> - <Compile Include="Cfg\ConfigurationSectionHandler.cs" /> - <Compile Include="Cfg\DefaultNamingStrategy.cs" /> - <Compile Include="Cfg\Environment.cs" /> - <Compile Include="Cfg\ImprovedNamingStrategy.cs" /> - <Compile Include="Cfg\INamingStrategy.cs" /> - <Compile Include="Cfg\Mappings.cs" /> - <Compile Include="Cfg\Settings.cs" /> - <Compile Include="Cfg\SettingsFactory.cs" /> - <Compile Include="Collection\IPersistentCollection.cs" /> - <Compile Include="Connection\ConnectionProvider.cs" /> - <Compile Include="Connection\ConnectionProviderFactory.cs" /> - <Compile Include="Connection\DriverConnectionProvider.cs" /> - <Compile Include="Connection\IConnectionProvider.cs" /> - <Compile Include="Connection\UserSuppliedConnectionProvider.cs" /> - <Compile Include="Dialect\DB2Dialect.cs" /> - <Compile Include="Dialect\Dialect.cs" /> - <Compile Include="Dialect\FirebirdDialect.cs" /> - <Compile Include="Dialect\GenericDialect.cs" /> - <Compile Include="Dialect\MsSql2000Dialect.cs" /> - <Compile Include="Dialect\MsSql7Dialect.cs" /> - <Compile Include="Dialect\MySQLDialect.cs" /> - <Compile Include="Dialect\Oracle9Dialect.cs" /> - <Compile Include="Dialect\OracleDialect.cs" /> - <Compile Include="Dialect\PostgreSQLDialect.cs" /> - <Compile Include="Dialect\SQLiteDialect.cs" /> - <Compile Include="Dialect\SybaseDialect.cs" /> - <Compile Include="Dialect\TypeNames.cs" /> - <Compile Include="Driver\DB2Driver.cs" /> - <Compile Include="Driver\DriverBase.cs" /> - <Compile Include="Driver\FirebirdDriver.cs" /> - <Compile Include="Driver\IDriver.cs" /> - <Compile Include="Driver\MySqlDataDriver.cs" /> - <Compile Include="Driver\NDataReader.cs" /> - <Compile Include="Driver\NHybridDataReader.cs" /> - <Compile Include="Driver\NpgsqlDriver.cs" /> - <Compile Include="Driver\OdbcDriver.cs" /> - <Compile Include="Driver\OleDbDriver.cs" /> - <Compile Include="Driver\OracleClientDriver.cs" /> - <Compile Include="Driver\OracleDataClientDriver.cs" /> - <Compile Include="Driver\SqlClientDriver.cs" /> - <Compile Include="Driver\SQLiteDriver.cs" /> - <Compile Include="Driver\SybaseClientDriver.cs" /> - <Compile Include="Engine\Cascade.cs" /> - <Compile Include="Engine\IBatcher.cs" /> - <Compile Include="Engine\IMapping.cs" /> - <Compile Include="Engine\ISessionFactoryImplementor.cs" /> - <Compile Include="Engine\ISessionImplementor.cs" /> - <Compile Include="Engine\QueryParameters.cs" /> - <Compile Include="Engine\RowSelection.cs" /> - <Compile Include="Engine\TypedValue.cs" /> - <Compile Include="Engine\UnsavedValueFactory.cs" /> - <Compile Include="Engine\Versioning.cs" /> - <Compile Include="Exceptions\ADOExceptionHelper.cs" /> - <Compile Include="Criterion\AbstractCriterion.cs" /> - <Compile Include="Criterion\AndExpression.cs" /> - <Compile Include="Criterion\BetweenExpression.cs" /> - <Compile Include="Criterion\Conjunction.cs" /> - <Compile Include="Criterion\Disjunction.cs" /> - <Compile Include="Criterion\EqPropertyExpression.cs" /> - <Compile Include="Criterion\Example.cs" /> - <Compile Include="Criterion\Expression.cs" /> - <Compile Include="Criterion\ICriterion.cs" /> - <Compile Include="Criterion\InExpression.cs" /> - <Compile Include="Criterion\InsensitiveLikeExpression.cs" /> - <Compile Include="Criterion\Junction.cs" /> - <Compile Include="Criterion\LePropertyExpression.cs" /> - <Compile Include="Criterion\LikeExpression.cs" /> - <Compile Include="Criterion\LogicalExpression.cs" /> - <Compile Include="Criterion\LtPropertyExpression.cs" /> - <Compile Include="Criterion\MatchMode.cs" /> - <Compile Include="Criterion\NotExpression.cs" /> - <Compile Include="Criterion\NotNullExpression.cs" /> - <Compile Include="Criterion\NullExpression.cs" /> - <Compile Include="Criterion\Order.cs" /> - <Compile Include="Criterion\OrExpression.cs" /> - <Compile Include="Criterion\PropertyExpression.cs" /> - <Compile Include="Criterion\SimpleExpression.cs" /> - <Compile Include="Criterion\SQLCriterion.cs" /> - <Compile Include="FetchMode.cs" /> - <Compile Include="FlushMode.cs" /> - <Compile Include="HibernateException.cs" /> - <Compile Include="Hql\Classic\ClauseParser.cs" /> - <Compile Include="Hql\Classic\FromParser.cs" /> - <Compile Include="Hql\Classic\FromPathExpressionParser.cs" /> - <Compile Include="Hql\Classic\GroupByParser.cs" /> - <Compile Include="Hql\Classic\HavingParser.cs" /> - <Compile Include="Hql\Classic\IParser.cs" /> - <Compile Include="Hql\Classic\OrderByParser.cs" /> - <Compile Include="Hql\Classic\ParserHelper.cs" /> - <Compile Include="Hql\Classic\PathExpressionParser.cs" /> - <Compile Include="Hql\Classic\PreprocessingParser.cs" /> - <Compile Include="Hql\Classic\QueryTranslator.cs" /> - <Compile Include="Hql\Classic\SelectParser.cs" /> - <Compile Include="Hql\Classic\SelectPathExpressionParser.cs" /> - <Compile Include="Hql\Classic\WhereParser.cs" /> - <Compile Include="ICriteria.cs" /> - <Compile Include="IDatabinder.cs" /> - <Compile Include="Id\Assigned.cs" /> - <Compile Include="Id\CounterGenerator.cs" /> - <Compile Include="Id\ForeignGenerator.cs" /> - <Compile Include="Id\GuidCombGenerator.cs" /> - <Compile Include="Id\GuidGenerator.cs" /> - <Compile Include="Id\IConfigurable.cs" /> - <Compile Include="Id\IdentifierGenerationException.cs" /> - <Compile Include="Id\IdentifierGeneratorFactory.cs" /> - <Compile Include="Id\IdentityGenerator.cs" /> - <Compile Include="Id\IIdentifierGenerator.cs" /> - <Compile Include="Id\IncrementGenerator.cs" /> - <Compile Include="Id\IPersistentIdentifierGenerator.cs" /> - <Compile Include="Id\SequenceGenerator.cs" /> - <Compile Include="Id\SequenceHiLoGenerator.cs" /> - <Compile Include="Id\TableGenerator.cs" /> - <Compile Include="Id\TableHiLoGenerator.cs" /> - <Compile Include="Id\UUIDHexGenerator.cs" /> - <Compile Include="Id\UUIDStringGenerator.cs" /> - <Compile Include="IInterceptor.cs" /> - <Compile Include="Impl\AbstractQueryImpl.cs" /> - <Compile Include="AdoNet\AbstractBatcher.cs" /> - <Compile Include="AdoNet\OracleDataClientBatchingBatcher.cs" /> - <Compile Include="AdoNet\SqlClientBatchingBatcher.cs" /> - <Compile Include="Cache\Entry\CacheEntry.cs" /> - <Compile Include="Engine\CollectionEntry.cs" /> - <Compile Include="Engine\CollectionKey.cs" /> - <Compile Include="Impl\CriteriaImpl.cs" /> - <Compile Include="Engine\EntityEntry.cs" /> - <Compile Include="Impl\EnumerableImpl.cs" /> - <Compile Include="Impl\FilterImpl.cs" /> - <Compile Include="Impl\MessageHelper.cs" /> - <Compile Include="AdoNet\NonBatchingBatcher.cs" /> - <Compile Include="Impl\Printer.cs" /> - <Compile Include="Impl\QueryImpl.cs" /> - <Compile Include="Event\Default\ReattachVisitor.cs" /> - <Compile Include="Impl\SessionFactoryImpl.cs" /> - <Compile Include="Impl\SessionFactoryObjectFactory.cs" /> - <Compile Include="Impl\SessionImpl.cs" /> - <Compile Include="Impl\SqlQueryImpl.cs" /> - <Compile Include="Engine\Status.cs" /> - <Compile Include="InstantiationException.cs" /> - <Compile Include="IQuery.cs" /> - <Compile Include="ISession.cs" /> - <Compile Include="ISessionFactory.cs" /> - <Compile Include="ITransaction.cs" /> - <Compile Include="LazyInitializationException.cs" /> - <Compile Include="Loader\Loader.cs" /> - <Compile Include="Loader\OuterJoinLoader.cs" /> - <Compile Include="LockMode.cs" /> - <Compile Include="MappingException.cs" /> - <Compile Include="Mapping\Any.cs" /> - <Compile Include="Mapping\Array.cs" /> - <Compile Include="Mapping\Bag.cs" /> - <Compile Include="Mapping\Collection.cs" /> - <Compile Include="Mapping\Column.cs" /> - <Compile Include="Mapping\Component.cs" /> - <Compile Include="Mapping\Constraint.cs" /> - <Compile Include="Mapping\ForeignKey.cs" /> - <Compile Include="Mapping\Formula.cs" /> - <Compile Include="Mapping\IdentifierBag.cs" /> - <Compile Include="Mapping\IdentifierCollection.cs" /> - <Compile Include="Mapping\IFetchable.cs" /> - <Compile Include="Mapping\Index.cs" /> - <Compile Include="Mapping\IndexedCollection.cs" /> - <Compile Include="Mapping\IRelationalModel.cs" /> - <Compile Include="Mapping\IValue.cs" /> - <Compile Include="Mapping\List.cs" /> - <Compile Include="Mapping\ManyToOne.cs" /> - <Compile Include="Mapping\Map.cs" /> - <Compile Include="Mapping\MetaAttribute.cs" /> - <Compile Include="Mapping\OneToMany.cs" /> - <Compile Include="Mapping\OneToOne.cs" /> - <Compile Include="Mapping\PersistentClass.cs" /> - <Compile Include="Mapping\PrimaryKey.cs" /> - <Compile Include="Mapping\PrimitiveArray.cs" /> - <Compile Include="Mapping\Property.cs" /> - <Compile Include="Mapping\RootClass.cs" /> - <Compile Include="Mapping\Set.cs" /> - <Compile Include="Mapping\SimpleValue.cs" /> - <Compile Include="Mapping\Subclass.cs" /> - <Compile Include="Mapping\Table.cs" /> - <Compile Include="Mapping\ToOne.cs" /> - <Compile Include="Mapping\UniqueKey.cs" /> - <Compile Include="Metadata\IClassMetadata.cs" /> - <Compile Include="Metadata\ICollectionMetadata.cs" /> - <Compile Include="NHibernateUtil.cs" /> - <Compile Include="NonUniqueObjectException.cs" /> - <Compile Include="NonUniqueResultException.cs" /> - <Compile Include="ObjectDeletedException.cs" /> - <Compile Include="ObjectNotFoundException.cs" /> - <Compile Include="PersistentObjectException.cs" /> - <Compile Include="Persister\PersisterFactory.cs" /> - <Compile Include="PropertyAccessException.cs" /> - <Compile Include="PropertyNotFoundException.cs" /> - <Compile Include="PropertyValueException.cs" /> - <Compile Include="Properties\BasicPropertyAccessor.cs" /> - <Compile Include="Properties\CamelCaseStrategy.cs" /> - <Compile Include="Properties\CamelCaseUnderscoreStrategy.cs" /> - <Compile Include="Properties\FieldAccessor.cs" /> - <Compile Include="Properties\IFieldNamingStrategy.cs" /> - <Compile Include="Properties\IGetter.cs" /> - <Compile Include="Properties\IPropertyAccessor.cs" /> - <Compile Include="Properties\ISetter.cs" /> - <Compile Include="Properties\LowerCaseStrategy.cs" /> - <Compile Include="Properties\LowerCaseUnderscoreStrategy.cs" /> - <Compile Include="Properties\NoSetterAccessor.cs" /> - <Compile Include="Properties\PascalCaseMUnderscoreStrategy.cs" /> - <Compile Include="Properties\PascalCaseUnderscoreStrategy.cs" /> - <Compile Include="Properties\PropertyAccessorFactory.cs" /> - <Compile Include="Proxy\Poco\Castle\CastleLazyInitializer.cs" /> - <Compile Include="Proxy\Poco\Castle\CastleProxyFactory.cs" /> - <Compile Include="Proxy\INHibernateProxy.cs" /> - <Compile Include="Proxy\IProxyFactory.cs" /> - <Compile Include="Proxy\AbstractLazyInitializer.cs" /> - <Compile Include="Proxy\NHibernateProxyHelper.cs" /> - <Compile Include="Proxy\ProxyTypeValidator.cs" /> - <Compile Include="QueryException.cs" /> - <Compile Include="ReplicationMode.cs" /> - <Compile Include="SqlCommand\Alias.cs" /> - <Compile Include="SqlCommand\ANSICaseFragment.cs" /> - <Compile Include="SqlCommand\ANSIJoinFragment.cs" /> - <Compile Include="SqlCommand\CaseFragment.cs" /> - <Compile Include="SqlCommand\ConditionalFragment.cs" /> - <Compile Include="SqlCommand\DecodeCaseFragment.cs" /> - <Compile Include="SqlCommand\DisjunctionFragment.cs" /> - <Compile Include="SqlCommand\ForUpdateFragment.cs" /> - <Compile Include="SqlCommand\InFragment.cs" /> - <Compile Include="SqlCommand\ISqlStringBuilder.cs" /> - <Compile Include="SqlCommand\JoinFragment.cs" /> - <Compile Include="SqlCommand\OracleJoinFragment.cs" /> - <Compile Include="SqlCommand\Parameter.cs" /> - <Compile Include="SqlCommand\QueryJoinFragment.cs" /> - <Compile Include="SqlCommand\QuerySelect.cs" /> - <Compile Include="SqlCommand\SelectFragment.cs" /> - <Compile Include="SqlCommand\SqlBaseBuilder.cs" /> - <Compile Include="SqlCommand\SqlDeleteBuilder.cs" /> - <Compile Include="SqlCommand\SqlInsertBuilder.cs" /> - <Compile Include="SqlCommand\SqlSelectBuilder.cs" /> - <Compile Include="SqlCommand\SqlSimpleSelectBuilder.cs" /> - <Compile Include="SqlCommand\SqlString.cs" /> - <Compile Include="SqlCommand\SqlStringBuilder.cs" /> - <Compile Include="SqlCommand\SqlUpdateBuilder.cs" /> - <Compile Include="SqlCommand\Template.cs" /> - <Compile Include="SqlCommand\WhereBuilder.cs" /> - <Compile Include="SqlTypes\AnsiStringFixedLengthSqlType.cs" /> - <Compile Include="SqlTypes\AnsiStringSqlType.cs" /> - <Compile Include="SqlTypes\BinaryBlobSqlType.cs" /> - <Compile Include="SqlTypes\BinarySqlType.cs" /> - <Compile Include="SqlTypes\SqlType.cs" /> - <Compile Include="SqlTypes\SqlTypeFactory.cs" /> - <Compile Include="SqlTypes\StringClobSqlType.cs" /> - <Compile Include="SqlTypes\StringFixedLengthSqlType.cs" /> - <Compile Include="SqlTypes\StringSqlType.cs" /> - <Compile Include="StaleObjectStateException.cs" /> - <Compile Include="Tool\hbm2ddl\SchemaExport.cs" /> - <Compile Include="TransactionException.cs" /> - <Compile Include="Transaction\AdoTransaction.cs" /> - <Compile Include="Transaction\ITransactionFactory.cs" /> - <Compile Include="Transform\AliasToEntityMapResultTransformer.cs" /> - <Compile Include="Transform\DistinctRootEntityResultTransformer.cs" /> - <Compile Include="Transform\IResultTransformer.cs" /> - <Compile Include="Transform\RootEntityResultTransformer.cs" /> - <Compile Include="TransientObjectException.cs" /> - <Compile Include="Type\AbstractType.cs" /> - <Compile Include="Type\AnsiStringType.cs" /> - <Compile Include="Type\ArrayType.cs" /> - <Compile Include="Type\BagType.cs" /> - <Compile Include="Type\BinaryBlobType.cs" /> - <Compile Include="Type\BinaryType.cs" /> - <Compile Include="Type\BooleanType.cs" /> - <Compile Include="Type\ByteType.cs" /> - <Compile Include="Type\CharBooleanType.cs" /> - <Compile Include="Type\CharType.cs" /> - <Compile Include="Type\ComponentType.cs" /> - <Compile Include="Type\CompositeCustomType.cs" /> - <Compile Include="Type\CultureInfoType.cs" /> - <Compile Include="Type\CustomType.cs" /> - <Compile Include="Type\DateTimeType.cs" /> - <Compile Include="Type\DateType.cs" /> - <Compile Include="Type\DecimalType.cs" /> - <Compile Include="Type\DoubleType.cs" /> - <Compile Include="Type\EntityType.cs" /> - <Compile Include="Type\EnumStringType.cs" /> - <Compile Include="Type\GuidType.cs" /> - <Compile Include="Type\IAbstractComponentType.cs" /> - <Compile Include="Type\IAssociationType.cs" /> - <Compile Include="Type\IdentifierBagType.cs" /> - <Compile Include="Type\IDiscriminatorType.cs" /> - <Compile Include="Type\IIdentifierType.cs" /> - <Compile Include="Type\ILiteralType.cs" /> - <Compile Include="Type\ImmutableType.cs" /> - <Compile Include="Type\Int16Type.cs" /> - <Compile Include="Type\Int32Type.cs" /> - <Compile Include="Type\Int64Type.cs" /> - <Compile Include="Type\IType.cs" /> - <Compile Include="Type\IVersionType.cs" /> - <Compile Include="Type\ListType.cs" /> - <Compile Include="Type\ManyToOneType.cs" /> - <Compile Include="Type\MapType.cs" /> - <Compile Include="Type\MetaType.cs" /> - <Compile Include="Type\MutableType.cs" /> - <Compile Include="Type\NullableType.cs" /> - <Compile Include="Type\OneToOneType.cs" /> - <Compile Include="Type\PersistentEnumType.cs" /> - <Compile Include="Type\SByteType.cs" /> - <Compile Include="Type\SerializableType.cs" /> - <Compile Include="Type\SerializationException.cs" /> - <Compile Include="Type\SetType.cs" /> - <Compile Include="Type\SingleType.cs" /> - <Compile Include="Type\SortedMapType.cs" /> - <Compile Include="Type\SortedSetType.cs" /> - <Compile Include="Type\StringClobType.cs" /> - <Compile Include="Type\StringType.cs" /> - <Compile Include="Type\TicksType.cs" /> - <Compile Include="Type\TimeSpanType.cs" /> - <Compile Include="Type\TimestampType.cs" /> - <Compile Include="Type\TimeType.cs" /> - <Compile Include="Type\TrueFalseType.cs" /> - <Compile Include="Type\TypeFactory.cs" /> - <Compile Include="Type\TypeType.cs" /> - <Compile Include="Type\UInt16Type.cs" /> - <Compile Include="Type\UInt32Type.cs" /> - <Compile Include="Type\UInt64Type.cs" /> - <Compile Include="Type\PrimitiveType.cs" /> - <Compile Include="Type\YesNoType.cs" /> - <Compile Include="UnresolvableObjectException.cs" /> - <Compile Include="Util\ADOExceptionReporter.cs" /> - <Compile Include="Util\ArrayHelper.cs" /> - <Compile Include="Util\CollectionPrinter.cs" /> - <Compile Include="Util\IdentityMap.cs" /> - <Compile Include="Util\JoinedEnumerable.cs" /> - <Compile Include="Util\ObjectUtils.cs" /> - <Compile Include="Util\PropertiesHelper.cs" /> - <Compile Include="Util\ReflectHelper.cs" /> - <Compile Include="Util\SequencedHashMap.cs" /> - <Compile Include="Util\StringHelper.cs" /> - <Compile Include="Util\StringTokenizer.cs" /> - <Compile Include="WrongClassException.cs" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Action\BulkOperationCleanupAction.cs" /> - <Compile Include="Action\CollectionAction.cs" /> - <Compile Include="Action\CollectionRecreateAction.cs" /> - <Compile Include="Action\CollectionRemoveAction.cs" /> - <Compile Include="Action\CollectionUpdateAction.cs" /> - <Compile Include="Action\DelayedPostInsertIdentifier.cs" /> - <Compile Include="Action\EntityAction.cs" /> - <Compile Include="Action\EntityDeleteAction.cs" /> - <Compile Include="Action\EntityIdentityInsertAction.cs" /> - <Compile Include="Action\EntityInsertAction.cs" /> - <Compile Include="Action\EntityUpdateAction.cs" /> - <Compile Include="Action\IExecutable.cs" /> - <Compile Include="AdoNet\AdoNetContext.cs" /> - <Compile Include="AdoNet\ColumnNameCache.cs" /> - <Compile Include="AdoNet\Expectations.cs" /> - <Compile Include="AdoNet\IBatcherFactory.cs" /> - <Compile Include="AdoNet\IExpectation.cs" /> - <Compile Include="AdoNet\NonBatchingBatcherFactory.cs" /> - <Compile Include="AdoNet\OracleDataClientBatchingBatcherFactory.cs" /> - <Compile Include="AdoNet\ResultSetWrapper.cs" /> - <Compile Include="AdoNet\SqlClientBatchingBatcherFactory.cs" /> - <Compile Include="AdoNet\TooManyRowsAffectedException.cs" /> - <Compile Include="Bytecode\CodeDom\BytecodeProviderImpl.cs" /> - <Compile Include="Bytecode\DefaultProxyFactoryFactory.cs" /> - <Compile Include="Bytecode\IAccessOptimizer.cs" /> - <Compile Include="Bytecode\IBytecodeProvider.cs" /> - <Compile Include="Bytecode\IInjectableProxyFactoryFactory.cs" /> - <Compile Include="Bytecode\IInstantiationOptimizer.cs" /> - <Compile Include="Bytecode\IProxyFactoryFactory.cs" /> - <Compile Include="Bytecode\IReflectionOptimizer.cs" /> - <Compile Include="Bytecode\Lightweight\AccessOptimizer.cs" /> - <Compile Include="Bytecode\Lightweight\BytecodeProviderImpl.cs" /> - <Compile Include="Bytecode\Lightweight\Delegates.cs" /> - <Compile Include="Bytecode\Lightweight\ReflectionOptimizer.cs" /> - <Compile Include="Bytecode\NullBytecodeProvider.cs" /> - <Compile Include="Bytecode\EmitUtil.cs" /> - <Compile Include="CacheMode.cs" /> - <Compile Include="Cache\CacheKey.cs" /> - <Compile Include="Cache\Entry\CollectionCacheEntry.cs" /> - <Compile Include="Cache\Entry\ICacheEntryStructure.cs" /> - <Compile Include="Cache\Entry\StructuredCacheEntry.cs" /> - <Compile Include="Cache\Entry\StructuredCollectionCacheEntry.cs" /> - <Compile Include="Cache\Entry\StructuredMapCacheEntry.cs" /> - <Compile Include="Cache\Entry\UnstructuredCacheEntry.cs" /> - <Compile Include="Cache\FilterKey.cs" /> - <Compile Include="Cache\IOptimisticCacheSource.cs" /> - <Compile Include="Cache\NoCacheProvider.cs" /> - <Compile Include="Cache\NoCachingEnabledException.cs" /> - <Compile Include="Cfg\ClassExtractor.cs" /> - <Compile Include="Cfg\ConfigurationSchema\CfgXmlHelper.cs" /> - <Compile Include="Cfg\ConfigurationSchema\ClassCacheConfiguration.cs" /> - <Compile Include="Cfg\ConfigurationSchema\CollectionCacheConfiguration.cs" /> - <Compile Include="Cfg\ConfigurationSchema\EventConfiguration.cs" /> - <Compile Include="Cfg\ConfigurationSchema\HibernateConfiguration.cs" /> - <Compile Include="Cfg\ConfigurationSchema\ListenerConfiguration.cs" /> - <Compile Include="Cfg\ConfigurationSchema\MappingConfiguration.cs" /> - <Compile Include="Cfg\ConfigurationSchema\SessionFactoryConfiguration.cs" /> - <Compile Include="Cfg\ExtendsQueueEntry.cs" /> - <Compile Include="Cfg\HbmConstants.cs" /> - <Compile Include="Cfg\HibernateConfigException.cs" /> - <Compile Include="Cfg\IHibernateConfiguration.cs" /> - <Compile Include="Cfg\NamedXmlDocument.cs" /> - <Compile Include="Cfg\MappingsQueueEntry.cs" /> - <Compile Include="Cfg\MappingSchema\EndsWithHbmXmlFilter.cs" /> - <Compile Include="Cfg\MappingSchema\Hbm.generated.cs"> - <SubType>code</SubType> - </Compile> - <Compile Include="Cfg\MappingSchema\HbmBase.cs" /> - <Compile Include="Cfg\MappingSchema\HbmClass.cs" /> - <Compile Include="Cfg\MappingSchema\HbmDatabaseObject.cs" /> - <Compile Include="Cfg\MappingSchema\HbmMapping.cs" /> - <Compile Include="Cfg\MappingSchema\HbmMeta.cs" /> - <Compile Include="Cfg\MappingSchema\HbmParam.cs" /> - <Compile Include="Cfg\MappingSchema\HbmQuery.cs" /> - <Compile Include="Cfg\MappingSchema\HbmSqlQuery.cs" /> - <Compile Include="Cfg\MappingSchema\IAssemblyResourceFilter.cs" /> - <Compile Include="Cfg\MappingSchema\IMappingDocumentParser.cs" /> - <Compile Include="Cfg\MappingSchema\MappingDocumentAggregator.cs" /> - <Compile Include="Cfg\MappingSchema\MappingDocumentParser.cs" /> - <Compile Include="Cfg\XmlHbmBinding\AuxiliaryDatabaseObjectFactory.cs" /> - <Compile Include="Cfg\MappingSchema\HbmFilterDef.cs" /> - <Compile Include="Cfg\XmlHbmBinding\CacheModeConverter.cs" /> - <Compile Include="Cfg\XmlHbmBinding\ClassCompositeIdBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\ClassDiscriminatorBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\ClassIdBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\FilterDefinitionFactory.cs" /> - <Compile Include="Cfg\XmlHbmBinding\FlushModeConverter.cs" /> - <Compile Include="Cfg\XmlHbmBinding\ResultSetMappingBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\Binder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\ClassBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\CollectionBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\RootClassBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\JoinedSubclassBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\MappingRootBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\NamedQueryBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\NamedSQLQueryBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\SubclassBinder.cs" /> - <Compile Include="Cfg\XmlHbmBinding\UnionSubclassBinder.cs" /> - <Compile Include="Cfg\XmlSchemas.cs" /> - <Compile Include="Classic\ILifecycle.cs" /> - <Compile Include="Classic\IValidatable.cs" /> - <Compile Include="Classic\ValidationFailure.cs" /> - <Compile Include="Collection\AbstractPersistentCollection.cs" /> - <Compile Include="Collection\Generic\PersistentGenericSet.cs" /> - <Compile Include="Collection\Generic\PersistentGenericBag.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="Collection\Generic\PersistentGenericList.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="Collection\Generic\PersistentGenericMap.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="Collection\Generic\PersistentGenericIdentifierBag.cs" /> - <Compile Include="Collection\PersistentArrayHolder.cs" /> - <Compile Include="Collection\PersistentBag.cs" /> - <Compile Include="Collection\PersistentIdentifierBag.cs" /> - <Compile Include="Collection\PersistentList.cs" /> - <Compile Include="Collection\PersistentMap.cs" /> - <Compile Include="Collection\PersistentSet.cs" /> - <Compile Include="ConnectionReleaseMode.cs" /> - <Compile Include="Context\CallSessionContext.cs" /> - <Compile Include="Context\CurrentSessionContext.cs" /> - <Compile Include="Context\ICurrentSessionContext.cs" /> - <Compile Include="Context\ManagedWebSessionContext.cs" /> - <Compile Include="Context\MapBasedSessionContext.cs" /> - <Compile Include="Context\ThreadLocalSessionContext.cs" /> - <Compile Include="Context\ThreadStaticSessionContext.cs" /> - <Compile Include="Context\WebSessionContext.cs" /> - <Compile Include="CriteriaTransformer.cs" /> - <Compile Include="Criterion\NaturalIdentifier.cs" /> - <Compile Include="Criterion\Restrictions.cs" /> - <Compile Include="Criterion\RowCountInt64Projection.cs" /> - <Compile Include="DebugHelpers\DictionaryProxy.cs" /> - <Compile Include="DebugHelpers\CollectionProxy.cs" /> - <Compile Include="Dialect\Function\AnsiExtractFunction.cs" /> - <Compile Include="Dialect\Function\AnsiSubstringFunction.cs" /> - <Compile Include="Dialect\Function\AnsiTrimEmulationFunction.cs" /> - <Compile Include="Dialect\Function\AnsiTrimFunction.cs" /> - <Compile Include="Dialect\Function\CastFunction.cs" /> - <Compile Include="Dialect\Function\CharIndexFunction.cs" /> - <Compile Include="Dialect\Function\ClassicAggregateFunction.cs" /> - <Compile Include="Dialect\Function\ClassicAvgFunction.cs" /> - <Compile Include="Dialect\Function\ClassicCountFunction.cs" /> - <Compile Include="Dialect\Function\ClassicSumFunction.cs" /> - <Compile Include="Dialect\Function\CommonGrammar.cs" /> - <Compile Include="Dialect\Function\IFunctionGrammar.cs" /> - <Compile Include="Dialect\Function\ISQLFunction.cs" /> - <Compile Include="Dialect\Function\NoArgSQLFunction.cs" /> - <Compile Include="Dialect\Function\NvlFunction.cs" /> - <Compile Include="Dialect\Function\PositionSubstringFunction.cs" /> - <Compile Include="Dialect\Function\SQLFunctionRegistry.cs" /> - <Compile Include="Dialect\Function\SQLFunctionTemplate.cs" /> - <Compile Include="Dialect\Function\StandardSafeSQLFunction.cs" /> - <Compile Include="Dialect\Function\StandardSQLFunction.cs" /> - <Compile Include="Dialect\Function\VarArgsSQLFunction.cs" /> - <Compile Include="AdoNet\IEmbeddedBatcherFactoryProvider.cs" /> - <Compile Include="Dialect\InformixDialect.cs" /> - <Compile Include="Dialect\Lock\ILockingStrategy.cs" /> - <Compile Include="Dialect\Lock\SelectLockingStrategy.cs" /> - <Compile Include="Dialect\Lock\UpdateLockingStrategy.cs" /> - <Compile Include="Dialect\MsSqlCeDialect.cs" /> - <Compile Include="Dialect\MySQL5Dialect.cs" /> - <Compile Include="Criterion\SelectSubqueryExpression.cs" /> - <Compile Include="Dialect\PostgreSQL82Dialect.cs" /> - <Compile Include="Dialect\Schema\FirebirdMetaData.cs" /> - <Compile Include="Dialect\Schema\ITableMetadata.cs" /> - <Compile Include="Dialect\Schema\MsSqlMetaData.cs" /> - <Compile Include="Dialect\Schema\OracleMetaData.cs" /> - <Compile Include="Dialect\Sybase11Dialect.cs" /> - <Compile Include="Driver\ASA10ClientDriver.cs" /> - <Compile Include="Driver\ISqlParameterFormatter.cs" /> - <Compile Include="Driver\SqlStringFormatter.cs" /> - <Compile Include="Criterion\SubqueryProjection.cs" /> - <Compile Include="EmptyInterceptor.cs" /> - <Compile Include="Engine\ActionQueue.cs" /> - <Compile Include="Engine\AssociationKey.cs" /> - <Compile Include="Engine\BatchFetchQueue.cs" /> - <Compile Include="Engine\CascadeStyle.cs" /> - <Compile Include="Engine\CascadingAction.cs" /> - <Compile Include="Engine\Collections.cs" /> - <Compile Include="Engine\EntityUniqueKey.cs" /> - <Compile Include="Engine\FilterDefinition.cs" /> - <Compile Include="Engine\ForeignKeys.cs" /> - <Compile Include="Engine\IdentifierValue.cs" /> - <Compile Include="Engine\IPersistenceContext.cs" /> - <Compile Include="Engine\Loading\CollectionLoadContext.cs" /> - <Compile Include="Engine\Loading\EntityLoadContext.cs" /> - <Compile Include="Engine\Loading\LoadContexts.cs" /> - <Compile Include="Engine\Loading\LoadingCollectionEntry.cs" /> - <Compile Include="Engine\Nullability.cs" /> - <Compile Include="Engine\Query\HQLQueryPlan.cs" /> - <Compile Include="Engine\Query\NamedParameterDescriptor.cs" /> - <Compile Include="Engine\Query\NativeSQLQueryPlan.cs" /> - <Compile Include="Engine\Query\OrdinalParameterDescriptor.cs" /> - <Compile Include="Engine\Query\ParameterMetadata.cs" /> - <Compile Include="Engine\Query\ParamLocationRecognizer.cs" /> - <Compile Include="Engine\Query\QueryMetadata.cs" /> - <Compile Include="Engine\Query\QueryPlanCache.cs" /> - <Compile Include="Engine\Query\ReturnMetadata.cs" /> - <Compile Include="Engine\Query\FilterQueryPlan.cs" /> - <Compile Include="Engine\Query\Sql\INativeSQLQueryReturn.cs" /> - <Compile Include="Engine\Query\Sql\NativeSQLQueryCollectionReturn.cs" /> - <Compile Include="Engine\Query\Sql\NativeSQLQueryJoinReturn.cs" /> - <Compile Include="Engine\Query\Sql\NativeSQLQueryNonScalarReturn.cs" /> - <Compile Include="Engine\Query\Sql\NativeSQLQueryRootReturn.cs" /> - <Compile Include="Engine\Query\Sql\NativeSQLQueryScalarReturn.cs" /> - <Compile Include="Engine\StatefulPersistenceContext.cs" /> - <Compile Include="Engine\TransactionHelper.cs" /> - <Compile Include="Engine\Transaction\IIsolatedWork.cs" /> - <Compile Include="Engine\Transaction\Isolater.cs" /> - <Compile Include="Engine\TwoPhaseLoad.cs" /> - <Compile Include="Engine\ValueInclusion.cs" /> - <Compile Include="Engine\VersionValue.cs" /> - <Compile Include="EntityMode.cs" /> - <Compile Include="Event\AbstractCollectionEvent.cs" /> - <Compile Include="Event\AbstractEvent.cs" /> - <Compile Include="Event\AutoFlushEvent.cs" /> - <Compile Include="Event\Default\AbstractFlushingEventListener.cs" /> - <Compile Include="Event\Default\AbstractLockUpgradeEventListener.cs" /> - <Compile Include="Event\Default\AbstractReassociateEventListener.cs" /> - <Compile Include="Event\Default\AbstractSaveEventListener.cs" /> - <Compile Include="Event\Default\AbstractVisitor.cs" /> - <Compile Include="Event\Default\DefaultAutoFlushEventListener.cs" /> - <Compile Include="Event\Default\DefaultDeleteEventListener.cs" /> - <Compile Include="Event\Default\DefaultDirtyCheckEventListener.cs" /> - <Compile Include="Event\Default\DefaultEvictEventListener.cs" /> - <Compile Include="Event\Default\DefaultFlushEntityEventListener.cs" /> - <Compile Include="Event\Default\DefaultFlushEventListener.cs" /> - <Compile Include="Event\Default\DefaultInitializeCollectionEventListener.cs" /> - <Compile Include="Event\Default\DefaultLoadEventListener.cs" /> - <Compile Include="Event\Default\DefaultLockEventListener.cs" /> - <Compile Include="Event\Default\DefaultMergeEventListener.cs" /> - <Compile Include="Event\Default\DefaultPersistEventListener.cs" /> - <Compile Include="Event\Default\DefaultPersistOnFlushEventListener.cs" /> - <Compile Include="Event\Default\DefaultPostLoadEventListener.cs" /> - <Compile Include="Event\Default\DefaultPreLoadEventListener.cs" /> - <Compile Include="Event\Default\DefaultRefreshEventListener.cs" /> - <Compile Include="Event\Default\DefaultReplicateEventListener.cs" /> - <Compile Include="Event\Default\DefaultSaveEventListener.cs" /> - <Compile Include="Event\Default\DefaultSaveOrUpdateCopyEventListener.cs" /> - <Compile Include="Event\Default\DefaultSaveOrUpdateEventListener.cs" /> - <Compile Include="Event\Default\DefaultUpdateEventListener.cs" /> - <Compile Include="Event\Default\DirtyCollectionSearchVisitor.cs" /> - <Compile Include="Event\Default\EvictVisitor.cs" /> - <Compile Include="Event\Default\FlushVisitor.cs" /> - <Compile Include="Event\Default\OnLockVisitor.cs" /> - <Compile Include="Event\Default\OnReplicateVisitor.cs" /> - <Compile Include="Event\Default\OnUpdateVisitor.cs" /> - <Compile Include="Event\Default\ProxyVisitor.cs" /> - <Compile Include="Event\Default\WrapVisitor.cs" /> - <Compile Include="Event\DeleteEvent.cs" /> - <Compile Include="Event\DirtyCheckEvent.cs" /> - <Compile Include="Event\EventListeners.cs" /> - <Compile Include="Event\EvictEvent.cs" /> - <Compile Include="Event\FlushEntityEvent.cs" /> - <Compile Include="Event\FlushEvent.cs" /> - <Compile Include="Event\IAutoFlushEventListener.cs" /> - <Compile Include="Event\IDeleteEventListener.cs" /> - <Compile Include="Event\IDirtyCheckEventListener.cs" /> - <Compile Include="Event\IEventSource.cs" /> - <Compile Include="Event\IEvictEventListener.cs" /> - <Compile Include="Event\IFlushEntityEventListener.cs" /> - <Compile Include="Event\IFlushEventListener.cs" /> - <Compile Include="Event\IInitializable.cs" /> - <Compile Include="Event\IInitializeCollectionEventListener.cs" /> - <Compile Include="Event\ILoadEventListener.cs" /> - <Compile Include="Event\ILockEventListener.cs" /> - <Compile Include="Event\IMergeEventListener.cs" /> - <Compile Include="Event\InitializeCollectionEvent.cs" /> - <Compile Include="Event\IPersistEventListener.cs" /> - <Compile Include="Event\IPostCollectionRecreateEventListener.cs" /> - <Compile Include="Event\IPostCollectionRemoveEventListener.cs" /> - <Compile Include="Event\IPostCollectionUpdateEventListener.cs" /> - <Compile Include="Event\IPostDeleteEventListener.cs" /> - <Compile Include="Event\IPostInsertEventListener.cs" /> - <Compile Include="Event\IPostLoadEventListener.cs" /> - <Compile Include="Event\IPostUpdateEventListener.cs" /> - <Compile Include="Event\IPreCollectionRecreateEventListener.cs" /> - <Compile Include="Event\IPreCollectionRemoveEventListener.cs" /> - <Compile Include="Event\IPreCollectionUpdateEventListener.cs" /> - <Compile Include="Event\IPreDeleteEventListener.cs" /> - <Compile Include="Event\IPreInsertEventListener.cs" /> - <Compile Include="Event\IPreLoadEventListener.cs" /> - <Compile Include="Event\IPreUpdateEventListener.cs" /> - <Compile Include="Event\IRefreshEventListener.cs" /> - <Compile Include="Event\IReplicateEventListener.cs" /> - <Compile Include="Event\ISaveOrUpdateEventListener.cs" /> - <Compile Include="Event\ListenerType.cs" /> - <Compile Include="Even... [truncated message content] |
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: 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: <fab...@us...> - 2008-11-07 22:33:00
|
Revision: 3894 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3894&view=rev Author: fabiomaulo Date: 2008-11-07 22:32:55 +0000 (Fri, 07 Nov 2008) Log Message: ----------- - Fix some SVN problems of previous commit - Changed names of ProxyGenerators to ByteCode - Using LinFu for NH-Tests Added Paths: ----------- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyInitializer.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj trunk/nhibernate/src/NHibernate.ByteCode.Castle/Properties/ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/DebugConnectionProvider.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/Properties/ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxy.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyFixture.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.hbm.xml trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Classes.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CustomProxyFixture.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/TestCase.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/TestConfigurationHelper.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.LinFu/LazyInitializer.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.ByteCode.LinFu.csproj trunk/nhibernate/src/NHibernate.ByteCode.LinFu/Properties/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/App.config trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/DebugConnectionProvider.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/NHibernate.ByteCode.LinFu.Tests.csproj trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/Properties/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/IMyProxy.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/MyProxyImpl.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/ProxyFixture.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/ProxyImpl.hbm.xml trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/TestCase.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/TestConfigurationHelper.cs Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Castle ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: svn:ignore + obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,37 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.CastleDynamicProxy" + 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="Castle 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="Castle.Core.dll" /> + <include name="Castle.DynamicProxy2.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 Castle ProxyGenerators" /> + +</project> Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyInitializer.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyInitializer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyInitializer.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,86 @@ +using System; +using System.Reflection; +using Castle.Core.Interceptor; +using NHibernate.Proxy; +using NHibernate.Proxy.Poco; +using NHibernate.Type; +using NHibernate.Engine; + +namespace NHibernate.ByteCode.Castle +{ + /// <summary> + /// A <see cref="ILazyInitializer"/> for use with the Castle Dynamic Class Generator. + /// </summary> + [Serializable] + [CLSCompliant(false)] + public class LazyInitializer : BasicLazyInitializer, global::Castle.Core.Interceptor.IInterceptor + { + private static readonly MethodInfo Exception_InternalPreserveStackTrace = + typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); + + #region Instance + + public bool _constructed; + + /// <summary> + /// Initializes a new <see cref="LazyInitializer"/> object. + /// </summary> + /// <param name="entityName"></param> + /// <param name="persistentClass">The Class to Proxy.</param> + /// <param name="id">The Id of the Object we are Proxying.</param> + /// <param name="getIdentifierMethod"></param> + /// <param name="setIdentifierMethod"></param> + /// <param name="componentIdType"></param> + /// <param name="session">The ISession this Proxy is in.</param> + 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) + { + } + + /// <summary> + /// Invoke the actual Property/Method using the Proxy or instantiate the actual + /// object and use it when the Proxy can't handle the method. + /// </summary> + /// <param name="invocation">The <see cref="IInvocation"/> from the generated Castle.DynamicProxy.</param> + public virtual void Intercept(IInvocation invocation) + { + try + { + if (_constructed) + { + // let the generic LazyInitializer figure out if this can be handled + // with the proxy or if the real class needs to be initialized + invocation.ReturnValue = base.Invoke(invocation.Method, invocation.Arguments, invocation.Proxy); + + // the base LazyInitializer could not handle it so we need to Invoke + // the method/property against the real class + if (invocation.ReturnValue == InvokeImplementation) + { + invocation.ReturnValue = invocation.Method.Invoke(GetImplementation(), invocation.Arguments); + return; + } + else + { + return; + } + } + else + { + // TODO: Find out equivalent to CGLIB's 'method.invokeSuper'. + return; + } + } + catch (TargetInvocationException tie) + { + // Propagate the inner exception so that the proxy throws the same exception as + // the real object would + Exception_InternalPreserveStackTrace.Invoke(tie.InnerException, new Object[] { }); + throw tie.InnerException; + } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,78 @@ +<?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>{31C3F0EA-0FED-4A2F-B68D-96CE29844487}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ByteCode.Castle</RootNamespace> + <AssemblyName>NHibernate.ByteCode.Castle</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.Core.dll</HintPath> + </Reference> + <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.DynamicProxy2.dll</HintPath> + </Reference> + <Reference Include="Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\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="ByteCode.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 Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Castle/Properties ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,105 @@ +using System; +using System.Reflection; +using Castle.DynamicProxy; +using Iesi.Collections.Generic; +using log4net; +using NHibernate.Engine; +using NHibernate.Proxy; +using NHibernate.Type; + +namespace NHibernate.ByteCode.Castle +{ + public class ProxyFactory : IProxyFactory + { + protected static readonly ILog log = LogManager.GetLogger(typeof (ProxyFactory)); + private static readonly ProxyGenerator _proxyGenerator = new ProxyGenerator(); + + private System.Type _persistentClass; + private System.Type[] _interfaces; + private MethodInfo _getIdentifierMethod; + private MethodInfo _setIdentifierMethod; + private string _entityName; + private IAbstractComponentType _componentIdType; + + public virtual 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]; + interfaces.CopyTo(_interfaces, 0); + _getIdentifierMethod = getIdentifierMethod; + _setIdentifierMethod = setIdentifierMethod; + _componentIdType = componentIdType; + } + + protected static ProxyGenerator DefaultProxyGenerator + { + get { return _proxyGenerator; } + } + + protected System.Type PersistentClass + { + get { return _persistentClass; } + } + + protected System.Type[] Interfaces + { + get { return _interfaces; } + } + + protected MethodInfo GetIdentifierMethod + { + get { return _getIdentifierMethod; } + } + + protected MethodInfo SetIdentifierMethod + { + get { return _setIdentifierMethod; } + } + + protected bool IsClassProxy + { + get { return _interfaces.Length == 1; } + } + + public string EntityName + { + get { return _entityName; } + } + + public IAbstractComponentType ComponentIdType + { + get { return _componentIdType; } + } + + /// <summary> + /// Build a proxy using the Castle.DynamicProxy library. + /// </summary> + /// <param name="id">The value for the Id.</param> + /// <param name="session">The Session the proxy is in.</param> + /// <returns>A fully built <c>INHibernateProxy</c>.</returns> + public virtual INHibernateProxy GetProxy(object id, ISessionImplementor session) + { + try + { + var initializer = new LazyInitializer(EntityName, _persistentClass, id, _getIdentifierMethod, + _setIdentifierMethod, ComponentIdType, session); + + object generatedProxy = IsClassProxy + ? _proxyGenerator.CreateClassProxy(_persistentClass, _interfaces, initializer) + : _proxyGenerator.CreateInterfaceProxyWithoutTarget(_interfaces[0], _interfaces, + initializer); + + initializer._constructed = true; + return (INHibernateProxy) generatedProxy; + } + catch (Exception e) + { + log.Error("Creating a proxy instance failed", e); + throw new HibernateException("Creating a proxy instance failed", e); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactoryFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactoryFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactoryFactory.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,22 @@ +using NHibernate.Bytecode; +using NHibernate.Proxy; + +namespace NHibernate.ByteCode.Castle +{ + public class ProxyFactoryFactory : IProxyFactoryFactory + { + #region IProxyFactoryFactory Members + + public IProxyFactory BuildProxyFactory() + { + return new ProxyFactory(); + } + + public IProxyValidator ProxyValidator + { + get { return new DynProxyTypeValidator(); } + } + + #endregion + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: svn:ignore + obj .#* *.user *.xsx AssemblyInfo.cs hibernate.cfg.xml *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8" ?> +<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.ByteCode.Castle.Tests.DebugConnectionProvider, NHibernate.ByteCode.Castle.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> + + <!-- This property is the default value in NH Core --> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</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"> + <priority value="ERROR" /> + </logger> + + <logger name="NHibernate.Tool.hbm2ddl.SchemaExport"> + <level value="ERROR" /> + </logger> + </log4net> + + +</configuration> + + + Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,45 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.CastleDynamicProxy.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 Castle 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="Castle.Core.dll" /> + <include name="Castle.DynamicProxy2.dll" /> + <include name="NHibernate.dll" /> + <include name="NHibernate.ByteCode.Castle.dll" /> + <include name="nunit.framework.dll"/> + </assemblyfileset> + + <resourcefileset id="project.resources" prefix="NHibernate.ByteCode.Castle.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.ByteCode.Castle.Tests/DebugConnectionProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/DebugConnectionProvider.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/DebugConnectionProvider.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,72 @@ +using System.Collections; +using System.Data; +using Iesi.Collections; +using NHibernate.Connection; + +namespace NHibernate.ByteCode.Castle.Tests +{ + /// <summary> + /// This connection provider keeps a list of all open connections, + /// it is used when testing to check that tests clean up after themselves. + /// </summary> + 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.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,104 @@ +<?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>{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ByteCode.Castle.Tests</RootNamespace> + <AssemblyName>NHibernate.ByteCode.Castle.Tests</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.Core.dll</HintPath> + </Reference> + <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.DynamicProxy2.dll</HintPath> + </Reference> + <Reference Include="Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\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\2.0\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="DebugConnectionProvider.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="ProxyInterface\CastleProxy.cs" /> + <Compile Include="ProxyInterface\CastleProxyFixture.cs" /> + <Compile Include="ProxyInterface\CastleProxyImpl.cs" /> + <Compile Include="ProxyInterface\Classes.cs" /> + <Compile Include="ProxyInterface\CustomProxyFixture.cs" /> + <Compile Include="TestCase.cs" /> + <Compile Include="TestConfigurationHelper.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate.ByteCode.Castle\NHibernate.ByteCode.Castle.csproj"> + <Project>{31C3F0EA-0FED-4A2F-B68D-96CE29844487}</Project> + <Name>NHibernate.ByteCode.Castle</Name> + </ProjectReference> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ProxyInterface\CastleProxyImpl.hbm.xml" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ProxyInterface\Mappings.hbm.xml" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="ByteCode.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 Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/Properties ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxy.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxy.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxy.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,14 @@ +namespace NHibernate.ByteCode.Castle.Tests.ProxyInterface +{ + /// <summary> + /// Summary description for CastleProxy. + /// </summary> + public interface CastleProxy + { + int Id { get; set; } + + string Name { get; set; } + + void ThrowDeepException(); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyFixture.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,144 @@ +using System; +using System.Collections; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using NUnit.Framework; + +namespace NHibernate.ByteCode.Castle.Tests.ProxyInterface +{ + /// <summary> + /// Summary description for CastleProxyFixture. + /// </summary> + [TestFixture] + public class CastleProxyFixture : TestCase + { + protected override IList Mappings + { + get { return new[] {"ProxyInterface.CastleProxyImpl.hbm.xml"}; } + } + + [Test] + public void Proxy() + { + ISession s = OpenSession(); + CastleProxy ap = new CastleProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (CastleProxy) s.Load(typeof (CastleProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap)); + int id = ap.Id; + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "get id should not have initialized it."); + string name = ap.Name; + Assert.IsTrue(NHibernateUtil.IsInitialized(ap), "get name should have initialized it."); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + 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 ProxySerialize() + { + ISession s = OpenSession(); + CastleProxy ap = new CastleProxyImpl(); + ap.Id = 1; + ap.Name = "first proxy"; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (CastleProxy) s.Load(typeof (CastleProxyImpl), 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 = (CastleProxy) s.Load(typeof (CastleProxyImpl), 5); + Assert.AreEqual(5, notThere.Id); + s.Disconnect(); + + // serialize and then deserialize the session. + SerializeAndDeserialize(ref s); + + Assert.IsNotNull(s.Load(typeof (CastleProxyImpl), 5), "should be proxy - even though it doesn't exists in db"); + s.Close(); + } + + [Test] + public void ExceptionStackTrace() + { + ISession s = OpenSession(); + CastleProxy ap = new CastleProxyImpl(); + ap.Id = 1; + ap.Name = "first proxy"; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (CastleProxy) s.Load(typeof (CastleProxyImpl), 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(); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,35 @@ +using System; +using NHibernate.ByteCode.Castle.Tests.ProxyInterface; + +namespace NHibernate.ByteCode.Castle.Tests.ProxyInterface +{ + /// <summary> + /// Summary description for CastleProxyImpl. + /// </summary> + [Serializable] + public class CastleProxyImpl : CastleProxy + { + 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 Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.hbm.xml 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.ByteCode.Castle.Tests" + namespace="NHibernate.ByteCode.Castle.Tests.ProxyInterface"> + <class name="CastleProxyImpl" proxy="CastleProxy" table="avalon_p"> + <id name="Id"> + <generator class="assigned" /> + </id> + + <property name="Name" /> + </class> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Classes.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Classes.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Classes.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,212 @@ +using System.Collections; +using Iesi.Collections; + +namespace NHibernate.ByteCode.Castle.Tests.ProxyInterface +{ + public class Blog + { + private ISet _posts; + private ISet _users; + + private int blog_id; + + public virtual int BlogID + { + get { return blog_id; } + set { blog_id = value; } + } + + private string blog_name; + + public virtual string BlogName + { + get { return blog_name; } + set { blog_name = value; } + } + + public virtual ISet Posts + { + get { return _posts; } + set { _posts = value; } + } + + public virtual ISet Users + { + get { return _users; } + set { _users = value; } + } + + public Blog() + { + _posts = new HashedSet(); + _users = new HashedSet(); + } + + public Blog(string name) : this() + { + blog_name = name; + } + } + + public class Comment + { + private Comment() {} + + public Comment(string text) : this() + { + _text = text; + } + + private int _id; + private int _indexInPost; + private string _text; + private Post _post; + private User commenter; + + public User Commenter + { + get { return commenter; } + set { commenter = value; } + } + + public virtual int IndexInPost + { + get { return _indexInPost; } + set { _indexInPost = value; } + } + + public virtual Post Post + { + get { return _post; } + set { _post = value; } + } + + public virtual int CommentId + { + get { return _id; } + set { _id = value; } + } + + public virtual string Text + { + get { return _text; } + set { _text = value; } + } + } + + public class Post + { + private int post_id; + private Blog _blog; + private string post_title; + private IList _comments; + private ISet categories = new HashedSet(); + + public ISet Categories + { + get { return categories; } + set { categories = value; } + } + + public virtual IList Comments + { + get { return _comments; } + set { _comments = value; } + } + + public virtual int PostId + { + get { return post_id; } + set { post_id = value; } + } + + public virtual string PostTitle + { + get { return post_title; } + set { post_title = value; } + } + + public virtual Blog Blog + { + get { return _blog; } + set { _blog = value; } + } + + public Post() + { + _comments = new ArrayList(); + } + + public Post(string title) : this() + { + post_title = title; + } + } + + public class User + { + private string _userName; + private int _userId; + private ISet _blogs; + + public virtual ISet Blogs + { + get { return _blogs; } + set { _blogs = value; } + } + + public virtual int UserId + { + get { return _userId; } + set { _userId = value; } + } + + public virtual string UserName + { + get { return _userName; } + set { _userName = value; } + } + + public User() + { + _blogs = new HashedSet(); + } + + public User(string name) : this() + { + _userName = name; + } + } + + public class Category + { + private int category_id; + private string name; + private ISet posts = new HashedSet(); + + public Category() {} + + public Category(string name) + { + this.name = name; + } + + public int CategoryId + { + get { return category_id; } + set { category_id = value; } + } + + public string Name + { + get { return name; } + set { name = value; } + } + + public ISet Posts + { + get { return posts; } + set { posts = value; } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CustomProxyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CustomProxyFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CustomProxyFixture.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,151 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Reflection; +using Castle.Core.Interceptor; +using Castle.DynamicProxy; +using NHibernate.Bytecode; +using NHibernate.Cfg; +using NHibernate.Engine; +using NHibernate.Proxy; +using NHibernate.Type; +using NUnit.Framework; +using Environment=NHibernate.Cfg.Environment; + +namespace NHibernate.ByteCode.Castle.Tests.ProxyInterface +{ + [TestFixture] + public class CustomProxyFixture : TestCase + { + protected override IList Mappings + { + get { return new[] { "ProxyInterface.Mappings.hbm.xml" }; } + } + + protected override void Configure(Configuration configuration) + { + configuration.Properties[Environment.ProxyFactoryFactoryClass] = + typeof (CustomProxyFactoryFactory).AssemblyQualifiedName; + } + + [Test] + public void CanImplementNotifyPropertyChanged() + { + using (ISession s = OpenSession()) + { + s.Save(new Blog("blah")); + s.Flush(); + } + + using (ISession s = OpenSession()) + { + var blog = (Blog) s.Load(typeof (Blog), 1); + var propertyChanged = (INotifyPropertyChanged) blog; + string propChanged = null; + propertyChanged.PropertyChanged += + delegate(object sender, PropertyChangedEventArgs e) { propChanged = e.PropertyName; }; + + blog.BlogName = "foo"; + Assert.AreEqual("BlogName", propChanged); + } + + using (ISession s = OpenSession()) + { + s.Delete("from Blog"); + s.Flush(); + } + } + } + + public class CustomProxyFactoryFactory : IProxyFactoryFactory + { + #region IProxyFactoryFactory Members + + public IProxyFactory BuildProxyFactory() + { + return new DataBindingProxyFactory(); + } + + public IProxyValidator ProxyValidator + { + get { return new DynProxyTypeValidator(); } + } + + #endregion + } + + public class DataBindingProxyFactory : ProxyFactory + { + public override INHibernateProxy GetProxy(object id, ISessionImplementor session) + { + try + { + LazyInitializer initializer = new DataBindingInterceptor(EntityName, PersistentClass, id, GetIdentifierMethod, + SetIdentifierMethod, ComponentIdType, session); + + object generatedProxy; + + var list = new ArrayList(Interfaces); + list.Add(typeof (INotifyPropertyChanged)); + var interfaces = (System.Type[]) list.ToArray(typeof (System.Type)); + if (IsClassProxy) + { + generatedProxy = DefaultProxyGenerator.CreateClassProxy(PersistentClass, interfaces, ProxyGenerationOptions.Default, + initializer); + } + else + { + generatedProxy = DefaultProxyGenerator.CreateInterfaceProxyWithoutTarget(interfaces[0], interfaces, initializer); + } + + initializer._constructed = true; + return (INHibernateProxy) generatedProxy; + } + catch (Exception e) + { + log.Error("Creating a proxy instance failed", e); + throw new HibernateException("Creating a proxy instance failed", e); + } + } + } + + public class DataBindingInterceptor : LazyInitializer + { + private PropertyChangedEventHandler subscribers = delegate { }; + + public DataBindingInterceptor(string entityName, System.Type persistentClass, object id, + MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, + IAbstractComponentType componentIdType, ISessionImplementor session) + : base(entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session) {} + + //public DataBindingInterceptor(System.Type persistentClass, object id, MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, ISessionImplementor session) + // : base(persistentClass, id, getIdentifierMethod, setIdentifierMethod, session) + //{ + //} + + public override void Intercept(IInvocation invocation) + { + object result; + if (invocation.Method.DeclaringType == typeof (INotifyPropertyChanged)) + { + var propertyChangedEventHandler = (PropertyChangedEventHandler) invocation.GetArgumentValue(0); + if (invocation.Method.Name.StartsWith("add_")) + { + subscribers += propertyChangedEventHandler; + } + else + { + subscribers -= propertyChangedEventHandler; + } + return; + } + base.Intercept(invocation); + result = invocation.ReturnValue; + if (invocation.Method.Name.StartsWith("set_")) + { + subscribers(this, new PropertyChangedEventArgs(invocation.Method.Name.Substring(4))); + } + invocation.ReturnValue = result; + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/Mappings.hbm.xml 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,156 @@ +<?xml version='1.0' encoding='utf-8'?> +<hibernate-mapping + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' + xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns='urn:nhibernate-mapping-2.2' + assembly="NHibernate.ByteCode.Castle.Tests" + namespace="NHibernate.ByteCode.Castle.Tests.ProxyInterface" + default-lazy='false'> + + <class + name='Blog' + lazy='true' + table='Blogs'> + <id + name='BlogID' + column='blog_id' + unsaved-value='0'> + <generator + class='native' /> + </id> + <property + name='BlogName' + column='blog_name' /> + <set + name='Posts' + lazy='true' + cascade='all-delete-orphan' + inverse='true'> + <key + column='post_blogid' /> + <one-to-many + class='Post' /> + + </set> + <set + name='Users' + + table='UsersBlogs' + lazy='true' + cascade='save-update' + inverse='true'> + <key + column='blog_id' /> + <many-to-many + class='User' + column='user_id' /> + </set> + </class> + <class + name='User' + lazy='true' + table='`Users`'> + <id + name='UserId' + column='user_id'> + <generator + class='native' /> + </id> + <property + name='UserName' + type='string' + column='user_name' /> + <set + name='Blogs' + + table='UsersBlogs' + lazy='true' + cascade='save-update'> + <key + column='user_id' /> + + <many-to-many + class='Blog' + column='blog_id' /> + </set> + </class> + <class + name='Post' + table='Posts'> + <id + name='PostId' + column='post_id' + unsaved-value='0'> + <generator + class='native' /> + </id> + <many-to-one + name='Blog' + + class='Blog' + column='post_blogid' /> + <bag + name='Comments' + + table='Comments' + lazy='true' + cascade='all-delete-orphan' + inverse='true'> + + <key + column='comment_postid' /> + <one-to-many + class='Comment' /> + </bag> + <set name='Categories' + table='PostsCategories'> + <key column='post_id'/> + <many-to-many class='Category' + column='category_id'/> + </set> + </class> + <class name='Category' + table='Categories'> + <id + name='CategoryId' + column='category_id' + unsaved-value='0'> + <generator + class='native' /> + </id> + <property name='Name'/> + <set name='Posts' inverse='true' + table='PostsCategories'> + <key column='category_id'/> + <many-to-many class='Post' + column='post_id'/> + </set> + </class> + <class + name='Comment' + table='Comments'> + <id + name='CommentId' + column='comment_id' + unsaved-value='0'> + <generator + class='native' /> + </id> + <property + name='Text' + type='string' + column='comment_text' /> + + <property + name='IndexInPost' + column='comment_post_index' /> + <many-to-one + name='Post' + + class='Post' + column='comment_postid' /> + <many-to-one + name='Commenter' + class='User' + column='user_id' /> + </class> +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/TestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/TestCase.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/TestCase.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -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.ByteCode.Castle.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 typeof(TestCase).Namespace; } + } + + 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.ByteCode.Castle.Tests/TestConfigurationHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/TestConfigurationHelper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/TestConfigurationHelper.cs 2008-11-07 22:32:55 UTC (rev 3894) @@ -0,0 +1,40 @@ +using System; +using System.IO; +using NHibernate.Cfg; + +namespace NHibernate.ByteCode.Castle.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 = AppDo... [truncated message content] |
From: <fab...@us...> - 2008-11-07 22:40:48
|
Revision: 3895 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3895&view=rev Author: fabiomaulo Date: 2008-11-07 22:40:43 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Continue the FIX of SVN problem Modified Paths: -------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build 2008-11-07 22:32:55 UTC (rev 3894) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build 2008-11-07 22:40:43 UTC (rev 3895) @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <project - name="NHibernate.ProxyGenerators.CastleDynamicProxy" + name="NHibernate.ByteCode.Castle" default="build" xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" > @@ -32,6 +32,6 @@ </target> <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> - <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build Castle ProxyGenerators" /> + <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build Castle ByteCode" /> </project> Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build 2008-11-07 22:32:55 UTC (rev 3894) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build 2008-11-07 22:40:43 UTC (rev 3895) @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <project - name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests" + name="NHibernate.ByteCode.Castle.Tests" default="build" xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" > @@ -13,7 +13,7 @@ <target name="init" depends="common.init"> <property name="assembly.is-cls-compliant" value="false" /> - <property name="assembly.description" value="The Unit Tests for Castle ProxyGenerators." /> + <property name="assembly.description" value="The Unit Tests for Castle ByteCode." /> <property name="assembly.version" value="1.0.0.1" /> <property name="assembly.version.informational" value="1.0" /> Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build 2008-11-07 22:32:55 UTC (rev 3894) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build 2008-11-07 22:40:43 UTC (rev 3895) @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <project - name="NHibernate.ProxyGenerators.LinFuDynamicProxy" + name="NHibernate.ByteCode.LinFu" default="build" xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" > @@ -31,6 +31,6 @@ </target> <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> - <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build LinFu ProxyGenerators" /> + <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build LinFu ByteCode" /> </project> Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build 2008-11-07 22:32:55 UTC (rev 3894) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build 2008-11-07 22:40:43 UTC (rev 3895) @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <project - name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests" + name="NHibernate.ByteCode.LinFu.Tests" default="build" xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" > @@ -13,7 +13,7 @@ <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.description" value="The Unit Tests for LinFu ByteCode." /> <property name="assembly.version" value="1.0.0.1" /> <property name="assembly.version.informational" value="1.0" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2009-02-16 22:28:08
|
Revision: 4087 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4087&view=rev Author: davybrion Date: 2009-02-16 22:14:57 +0000 (Mon, 16 Feb 2009) Log Message: ----------- these 2 project files had incorrect references to non-existing locations of the nunit assemblies Modified Paths: -------------- trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj Property Changed: ---------------- trunk/nhibernate/src/Iesi.Collections.Test/ trunk/nhibernate/src/NHibernate.Examples/ Property changes on: trunk/nhibernate/src/Iesi.Collections.Test ___________________________________________________________________ Modified: svn:ignore - bin obj AssemblyInfo.cs + bin obj AssemblyInfo.cs [Bb]in [Dd]ebug [Rr]elease *.user *.aps *.eto Modified: trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj =================================================================== --- trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj 2009-02-13 23:06:46 UTC (rev 4086) +++ trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.csproj 2009-02-16 22:14:57 UTC (rev 4087) @@ -39,7 +39,7 @@ <ItemGroup> <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\nunit.framework.dll</HintPath> + <HintPath>..\..\lib\net\2.0\nunit.framework.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> Property changes on: trunk/nhibernate/src/NHibernate.Examples ___________________________________________________________________ Modified: svn:ignore - bin obj .#* *.user *.xsx + bin obj .#* *.user *.xsx [Bb]in [Dd]ebug [Rr]elease *.aps *.eto Modified: trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-02-13 23:06:46 UTC (rev 4086) +++ trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-02-16 22:14:57 UTC (rev 4087) @@ -81,7 +81,7 @@ </Reference> <Reference Include="nunit.framework"> <Name>nunit.framework</Name> - <HintPath>..\..\lib\net\nunit.framework.dll</HintPath> + <HintPath>..\..\lib\net\2.0\nunit.framework.dll</HintPath> </Reference> <Reference Include="System"> <Name>System</Name> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2009-03-07 21:46:02
|
Revision: 4119 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4119&view=rev Author: tehlike Date: 2009-03-07 21:45:52 +0000 (Sat, 07 Mar 2009) Log Message: ----------- Removing inconclusive Linq Provider. The working one can be found from the following location: https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.Linq/ Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Linq/ trunk/nhibernate/src/NHibernate.Linq.Test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-16 06:00:08
|
Revision: 4325 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4325&view=rev Author: fabiomaulo Date: 2009-05-16 06:00:06 +0000 (Sat, 16 May 2009) Log Message: ----------- Fixed some problems in the Example an Performance prjs... btw both are obsolete. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml Property Changed: ---------------- trunk/nhibernate/src/NHibernate.Examples/ Property changes on: trunk/nhibernate/src/NHibernate.Examples ___________________________________________________________________ Modified: svn:ignore - bin obj .#* *.user *.xsx [Bb]in [Dd]ebug [Rr]elease *.aps *.eto + bin obj .#* *.user *.xsx [Bb]in [Dd]ebug [Rr]elease *.aps *.eto hibernate.cfg.xml Modified: trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -39,7 +39,7 @@ // reload the blog to verify the db has the correct values ISession s = _sessions.OpenSession(); - blog = (Blog) s.Find("from Blog as b where b.Name=:name", "GregBlog", NHibernateUtil.String)[0]; + blog = s.CreateQuery("from Blog as b where b.Name=:name").SetString("name","GregBlog").List<Blog>()[0]; Assert.IsNotNull(blog); Assert.AreEqual(2, blog.Items.Count); @@ -98,7 +98,7 @@ public void Configure() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddClass(typeof(Blog)); cfg.AddClass(typeof(BlogItem)); _sessions = cfg.BuildSessionFactory(); @@ -106,7 +106,7 @@ public void ExportTables() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddClass(typeof(Blog)); cfg.AddClass(typeof(BlogItem)); new SchemaExport(cfg).Create(true, true); Modified: trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -19,7 +19,7 @@ [SetUp] public void SetUp() { - cfg = new Configuration(); + cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddAssembly("NHibernate.Examples"); new SchemaExport(cfg).Create(true, true); Modified: trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -19,7 +19,7 @@ [Test] public void ValidateQuickStart() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Examples.ForumQuestions.T1078029.Member.hbm.xml", Assembly.Load("NHibernate.Examples")); ISessionFactory factory = cfg.BuildSessionFactory(); Modified: trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -27,7 +27,7 @@ public void ExportSchema(string[] files, bool exportSchema) { - cfg = new Configuration(); + cfg = TestConfigurationHelper.GetDefaultConfiguration(); for (int i = 0; i < files.Length; i++) { Modified: trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-05-16 06:00:06 UTC (rev 4325) @@ -154,7 +154,7 @@ <Compile Include="QuickStart\UserFixture.cs"> <SubType>Code</SubType> </Compile> - <Content Include="hibernate.cfg.xml" /> + <Compile Include="TestConfigurationHelper.cs" /> <EmbeddedResource Include="Blogger\Blog.hbm.xml" /> <EmbeddedResource Include="Blogger\BlogItem.hbm.xml" /> <EmbeddedResource Include="Cascades\Alias.hbm.xml" /> @@ -181,9 +181,10 @@ </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> - <PreBuildEvent>copy /y "$(ProjectDir)App.config" "$(TargetPath).config" -copy /y "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml"</PreBuildEvent> - <PostBuildEvent> - </PostBuildEvent> + <PreBuildEvent> + </PreBuildEvent> + <PostBuildEvent>copy "$(ProjectDir)App.config" "$(TargetPath).config" +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 Modified: trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -16,7 +16,7 @@ [Test] public void ValidateQuickStart() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddAssembly("NHibernate.Examples"); ISessionFactory factory = cfg.BuildSessionFactory(); Copied: trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs (from rev 4323, trunk/nhibernate/src/NHibernate.Test/TestConfigurationHelper.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -0,0 +1,40 @@ +using System; +using System.IO; +using NHibernate.Cfg; + +namespace NHibernate.Examples +{ + 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 Deleted: trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml 2009-05-16 06:00:06 UTC (rev 4325) @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" > - <session-factory name="NHibernate.Test"> - <!-- properties --> - <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> - <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> - <property name="connection.connection_string">Server=localhost;initial catalog=nhibernate;Integrated Security=SSPI</property> - <property name="show_sql">false</property> - <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> - <property name="use_outer_join">true</property> - <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> - <!-- mapping files --> - <mapping assembly="NHibernate.Examples" /> - </session-factory> - -</hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -62,7 +62,7 @@ driver = (DriverBase) Activator.CreateInstance(System.Type.GetType(driverClass)); - string prepare = (string) cfg.Properties[Environment.PrepareSql] as string; + string prepare = cfg.GetProperty(Environment.PrepareSql); if (prepare == "true") { prepareSql = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2009-05-25 07:04:46
|
Revision: 4382 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4382&view=rev Author: tehlike Date: 2009-05-25 07:04:38 +0000 (Mon, 25 May 2009) Log Message: ----------- Further modifications to build files. Next step is to have special tc-nhibernate.cfg.xml for special configuration for teamcity. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build 2009-05-24 21:00:29 UTC (rev 4381) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build 2009-05-25 07:04:38 UTC (rev 4382) @@ -40,6 +40,6 @@ <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" /> + <target name="test" depends="init build common.run-database-tests" /> </project> Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build 2009-05-24 21:00:29 UTC (rev 4381) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build 2009-05-25 07:04:38 UTC (rev 4382) @@ -39,6 +39,6 @@ <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" /> + <target name="test" depends="init build common.run-database-tests" /> </project> Modified: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build 2009-05-24 21:00:29 UTC (rev 4381) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build 2009-05-25 07:04:38 UTC (rev 4382) @@ -42,6 +42,6 @@ <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" /> + <target name="test" depends="init build common.run-database-tests" /> </project> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2009-05-24 21:00:29 UTC (rev 4381) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2009-05-25 07:04:38 UTC (rev 4382) @@ -28,6 +28,8 @@ </target> <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> <target name="build" depends="init generate-assemblyinfo common.compile-tests"> + + <if test="${file::exists(config.FileName)}"> <copy file="hibernate.cfg.xml" tofile="${bin.dir}/hibernate.cfg.xml" /> </if> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2009-07-26 17:02:45
|
Revision: 4660 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4660&view=rev Author: davybrion Date: 2009-07-26 17:02:35 +0000 (Sun, 26 Jul 2009) Log Message: ----------- applying patch from 'Dima' to fix NH1899 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Type/GenericMapType.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs Property Changed: ---------------- trunk/nhibernate/src/ Property changes on: trunk/nhibernate/src ___________________________________________________________________ Added: svn:mergeinfo + /branches/2.1.x/nhibernate/src:4659 Modified: trunk/nhibernate/src/NHibernate/Type/GenericMapType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/GenericMapType.cs 2009-07-26 15:43:11 UTC (rev 4659) +++ trunk/nhibernate/src/NHibernate/Type/GenericMapType.cs 2009-07-26 17:02:35 UTC (rev 4660) @@ -71,7 +71,7 @@ IDictionary<TKey, TValue> result = (IDictionary<TKey, TValue>)target; result.Clear(); - IEnumerable iter = (IDictionary)original; + IEnumerable<KeyValuePair<TKey, TValue>> iter = (IDictionary<TKey, TValue>)original; foreach (KeyValuePair<TKey, TValue> me in iter) { TKey key = (TKey)cp.IndexType.Replace(me.Key, null, session, owner, copyCache); Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs 2009-07-26 15:43:11 UTC (rev 4659) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs 2009-07-26 17:02:35 UTC (rev 4660) @@ -1,33 +0,0 @@ - - -using System.Collections; -using System.Collections.Generic; -namespace NHibernate.Test.NHSpecificTest.NH1899 -{ - public class Parent - { - private int id; - private IDictionary<Key, Value> _relations; - - public int Id - { - get { return id; } - set { id = value; } - } - - public IDictionary<Key, Value> Relations { - get { return _relations; } - set { _relations = value; } - } - } - - public enum Key { - One, - Two - } - - public enum Value { - ValOne, - ValTwo - } -} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs (from rev 4659, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/DomainClass.cs 2009-07-26 17:02:35 UTC (rev 4660) @@ -0,0 +1,33 @@ + + +using System.Collections; +using System.Collections.Generic; +namespace NHibernate.Test.NHSpecificTest.NH1899 +{ + public class Parent + { + private int id; + private IDictionary<Key, Value> _relations; + + public int Id + { + get { return id; } + set { id = value; } + } + + public IDictionary<Key, Value> Relations { + get { return _relations; } + set { _relations = value; } + } + } + + public enum Key { + One, + Two + } + + public enum Value { + ValOne, + ValTwo + } +} \ No newline at end of file Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml 2009-07-26 15:43:11 UTC (rev 4659) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml 2009-07-26 17:02:35 UTC (rev 4660) @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.NHSpecificTest.NH1899" default-access="field.camelcase" - default-lazy="false"> - <class name="Parent"> - <id name="Id"> - <generator class="assigned" /> - </id> - <map name="_relations" table="RelationsTable" lazy="false" cascade="all-delete-orphan"> - <key column="ParentID" /> - <index column="KeyId" type="NHibernate.Test.NHSpecificTest.NH1899.Key, NHibernate.Test" /> - <element column="Value" type="NHibernate.Test.NHSpecificTest.NH1899.Value, NHibernate.Test" /> - </map> - </class> -</hibernate-mapping> \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml (from rev 4659, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/Mappings.hbm.xml 2009-07-26 17:02:35 UTC (rev 4660) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1899" default-access="field.camelcase" + default-lazy="false"> + <class name="Parent"> + <id name="Id"> + <generator class="assigned" /> + </id> + <map name="_relations" table="RelationsTable" lazy="false" cascade="all-delete-orphan"> + <key column="ParentID" /> + <index column="KeyId" type="NHibernate.Test.NHSpecificTest.NH1899.Key, NHibernate.Test" /> + <element column="Value" type="NHibernate.Test.NHSpecificTest.NH1899.Value, NHibernate.Test" /> + </map> + </class> +</hibernate-mapping> \ No newline at end of file Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs 2009-07-26 15:43:11 UTC (rev 4659) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs 2009-07-26 17:02:35 UTC (rev 4660) @@ -1,55 +0,0 @@ -using System.Collections.Generic; - -using NHibernate.Dialect; -using NUnit.Framework; - -namespace NHibernate.Test.NHSpecificTest.NH1899 -{ - [TestFixture] - public class SampleTest : BugTestCase - { - protected override void OnSetUp() - { - base.OnSetUp(); - using (ISession session = OpenSession()) - { - Parent entity = new Parent(); - entity.Id = 1; - entity.Relations = new Dictionary<Key, Value>(); - entity.Relations.Add(Key.One, Value.ValOne); - entity.Relations.Add(Key.Two, Value.ValTwo); - session.Save(entity); - session.Flush(); - } - } - - protected override void OnTearDown() - { - base.OnTearDown(); - using (ISession session = OpenSession()) - { - string hql = "from System.Object"; - session.Delete(hql); - session.Flush(); - } - } - - [Test] - public void ShouldNotThrowOnSaveUpdateCopy() - { - Parent entity; - - using (ISession session = OpenSession()) - { - entity = session.Get<Parent>(1); - session.Close(); - session.Dispose(); - } - - using (ISession session2 = OpenSession()) - { - entity = (Parent)session2.SaveOrUpdateCopy(entity); - } - } - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs (from rev 4659, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1899/SampleTest.cs 2009-07-26 17:02:35 UTC (rev 4660) @@ -0,0 +1,55 @@ +using System.Collections.Generic; + +using NHibernate.Dialect; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1899 +{ + [TestFixture] + public class SampleTest : BugTestCase + { + protected override void OnSetUp() + { + base.OnSetUp(); + using (ISession session = OpenSession()) + { + Parent entity = new Parent(); + entity.Id = 1; + entity.Relations = new Dictionary<Key, Value>(); + entity.Relations.Add(Key.One, Value.ValOne); + entity.Relations.Add(Key.Two, Value.ValTwo); + session.Save(entity); + session.Flush(); + } + } + + protected override void OnTearDown() + { + base.OnTearDown(); + using (ISession session = OpenSession()) + { + string hql = "from System.Object"; + session.Delete(hql); + session.Flush(); + } + } + + [Test] + public void ShouldNotThrowOnSaveUpdateCopy() + { + Parent entity; + + using (ISession session = OpenSession()) + { + entity = session.Get<Parent>(1); + session.Close(); + session.Dispose(); + } + + using (ISession session2 = OpenSession()) + { + entity = (Parent)session2.SaveOrUpdateCopy(entity); + } + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-07-26 15:43:11 UTC (rev 4659) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-07-26 17:02:35 UTC (rev 4660) @@ -550,6 +550,8 @@ <Compile Include="NHSpecificTest\NH1868\Model.cs" /> <Compile Include="NHSpecificTest\NH1877\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1877\Person.cs" /> + <Compile Include="NHSpecificTest\NH1899\DomainClass.cs" /> + <Compile Include="NHSpecificTest\NH1899\SampleTest.cs" /> <Compile Include="NHSpecificTest\NH473\Child.cs" /> <Compile Include="NHSpecificTest\NH473\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Parent.cs" /> @@ -1963,6 +1965,7 @@ <EmbeddedResource Include="Criteria\Lambda\Mappings.hbm.xml" /> <EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1899\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1877\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1868\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1857\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2009-08-02 16:47:19
|
Revision: 4672 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4672&view=rev Author: davybrion Date: 2009-08-02 16:46:25 +0000 (Sun, 02 Aug 2009) Log Message: ----------- applied patch from Jimmy Bogard for NH-1903 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs trunk/nhibernate/src/NHibernate.Test/GenericTest/MapGeneric/MapGenericFixture.cs Property Changed: ---------------- trunk/nhibernate/src/ Property changes on: trunk/nhibernate/src ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src:4659 + /branches/2.1.x/nhibernate/src:4659,4671 Modified: trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs 2009-08-02 16:26:52 UTC (rev 4671) +++ trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs 2009-08-02 16:46:25 UTC (rev 4672) @@ -16,13 +16,13 @@ /// <typeparam name="TKey">The type of the keys in the IDictionary.</typeparam> /// <typeparam name="TValue">The type of the elements in the IDictionary.</typeparam> [Serializable] - [DebuggerTypeProxy(typeof (DictionaryProxy<,>))] + [DebuggerTypeProxy(typeof(DictionaryProxy<,>))] public class PersistentGenericMap<TKey, TValue> : PersistentMap, IDictionary<TKey, TValue> { // TODO NH: find a way to writeonce (no duplicated code from PersistentMap) protected IDictionary<TKey, TValue> gmap; - public PersistentGenericMap() {} - public PersistentGenericMap(ISessionImplementor session) : base(session) {} + public PersistentGenericMap() { } + public PersistentGenericMap(ISessionImplementor session) : base(session) { } public PersistentGenericMap(ISessionImplementor session, IDictionary<TKey, TValue> map) : base(session, map as IDictionary) @@ -37,15 +37,15 @@ foreach (KeyValuePair<TKey, TValue> e in gmap) { object copy = persister.ElementType.DeepCopy(e.Value, entityMode, persister.Factory); - clonedMap[e.Key] = (TValue) copy; + clonedMap[e.Key] = (TValue)copy; } return clonedMap; } public override void BeforeInitialize(ICollectionPersister persister, int anticipatedSize) { - gmap = (IDictionary<TKey, TValue>) persister.CollectionType.Instantiate(anticipatedSize); - map = (IDictionary) gmap; + gmap = (IDictionary<TKey, TValue>)persister.CollectionType.Instantiate(anticipatedSize); + map = (IDictionary)gmap; } public override IEnumerable GetDeletes(ICollectionPersister persister, bool indexIsFormula) @@ -156,7 +156,7 @@ } else { - value = (TValue) result; + value = (TValue)result; return true; } } @@ -166,7 +166,7 @@ get { object result = ReadElementByIndex(key); - return result == Unknown ? gmap[key] : (TValue) result; + return result == Unknown ? gmap[key] : (TValue)result; } set { @@ -234,7 +234,7 @@ { if (exists.Value) { - TValue x = ((IDictionary<TKey, TValue>) this)[item.Key]; + TValue x = ((IDictionary<TKey, TValue>)this)[item.Key]; TValue y = item.Value; return EqualityComparer<TValue>.Default.Equals(x, y); } @@ -269,7 +269,7 @@ bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item) { - if (((ICollection<KeyValuePair<TKey, TValue>>) this).Contains(item)) + if (((ICollection<KeyValuePair<TKey, TValue>>)this).Contains(item)) { Remove(item.Key); return true; @@ -291,5 +291,15 @@ } #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + Read(); + return gmap.GetEnumerator(); + } + + #endregion } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/GenericTest/MapGeneric/MapGenericFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GenericTest/MapGeneric/MapGenericFixture.cs 2009-08-02 16:26:52 UTC (rev 4671) +++ trunk/nhibernate/src/NHibernate.Test/GenericTest/MapGeneric/MapGenericFixture.cs 2009-08-02 16:46:25 UTC (rev 4672) @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Text; using NHibernate.Engine; @@ -78,6 +79,51 @@ } } + [Test] + public void SimpleTypes() + { + A a = new A(); + a.Name = "first generic type"; + a.Items = new Dictionary<string, B>(); + B firstB = new B(); + firstB.Name = "first b"; + B secondB = new B(); + secondB.Name = "second b"; + B thirdB = new B(); + thirdB.Name = "third b"; + + a.Items.Add("first", firstB); + a.Items.Add("second", secondB); + a.Items.Add("third", thirdB); + + using (ISession s = OpenSession()) + { + s.SaveOrUpdate(a); + s.Flush(); + } + + using (ISession s = OpenSession()) + { + a = s.Load<A>(a.Id); + IDictionary<string, B> genericDict = a.Items; + IEnumerable<KeyValuePair<string, B>> genericEnum = a.Items; + IEnumerable nonGenericEnum = a.Items; + + foreach (var enumerable in genericDict) + { + Assert.That(enumerable, Is.InstanceOf<KeyValuePair<string, B>>()); + } + foreach (var enumerable in genericEnum) + { + Assert.That(enumerable, Is.InstanceOf<KeyValuePair<string, B>>()); + } + foreach (var enumerable in nonGenericEnum) + { + Assert.That(enumerable, Is.InstanceOf<KeyValuePair<string, B>>()); + } + } + } + // NH-669 [Test] public void UpdatesToSimpleMap() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2009-08-04 19:52:39
|
Revision: 4682 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4682&view=rev Author: davybrion Date: 2009-08-04 19:52:18 +0000 (Tue, 04 Aug 2009) Log Message: ----------- fix NH-1904 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Properties/BasicPropertyAccessor.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs Property Changed: ---------------- trunk/nhibernate/src/ Property changes on: trunk/nhibernate/src ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src:4659,4671 + /branches/2.1.x/nhibernate/src:4659,4671,4681 Modified: trunk/nhibernate/src/NHibernate/Properties/BasicPropertyAccessor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Properties/BasicPropertyAccessor.cs 2009-08-04 19:35:21 UTC (rev 4681) +++ trunk/nhibernate/src/NHibernate/Properties/BasicPropertyAccessor.cs 2009-08-04 19:52:18 UTC (rev 4682) @@ -130,13 +130,18 @@ return null; } - // the BindingFlags.IgnoreCase is important here because if type is a struct, the GetProperty method does - // not ignore case by default. If type is a class, it _does_ ignore case... we're better off explicitly - // stating that casing should be ignored so we get the same behavior for both structs and classes - PropertyInfo property = - type.GetProperty(propertyName, - BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly | BindingFlags.IgnoreCase); + BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; + if (type.IsValueType) + { + // the BindingFlags.IgnoreCase is important here because if type is a struct, the GetProperty method does + // not ignore case by default. If type is a class, it _does_ ignore case... we're better off explicitly + // stating that casing should be ignored so we get the same behavior for both structs and classes + bindingFlags = bindingFlags | BindingFlags.IgnoreCase; + } + + PropertyInfo property = type.GetProperty(propertyName, bindingFlags); + if (property != null && property.CanWrite) { return new BasicSetter(type, property, propertyName); Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs 2009-08-04 19:35:21 UTC (rev 4681) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs 2009-08-04 19:52:18 UTC (rev 4682) @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; - -using NUnit.Framework; - -namespace NHibernate.Test.NHSpecificTest.NH1904 -{ - [TestFixture] - public class Fixture : BugTestCase - { - [Test] - public void ExecuteQuery() - { - using (ISession session = OpenSession()) - using (ITransaction transaction = session.BeginTransaction()) - { - Invoice invoice = new Invoice(); - invoice.Issued = DateTime.Now; - - session.Save(invoice); - transaction.Commit(); - } - - using (ISession session = OpenSession()) - { - IList<Invoice> invoices = session.CreateCriteria<Invoice>().List<Invoice>(); - } - } - - protected override void OnTearDown() - { - base.OnTearDown(); - using (ISession session = OpenSession()) - { - session.CreateQuery("delete from Invoice").ExecuteUpdate(); - session.Flush(); - } - } - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs (from rev 4681, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs 2009-08-04 19:52:18 UTC (rev 4682) @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; + +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1904 +{ + [TestFixture] + public class Fixture : BugTestCase + { + [Test] + public void ExecuteQuery() + { + using (ISession session = OpenSession()) + using (ITransaction transaction = session.BeginTransaction()) + { + Invoice invoice = new Invoice(); + invoice.Issued = DateTime.Now; + + session.Save(invoice); + transaction.Commit(); + } + + using (ISession session = OpenSession()) + { + IList<Invoice> invoices = session.CreateCriteria<Invoice>().List<Invoice>(); + } + } + + protected override void OnTearDown() + { + base.OnTearDown(); + using (ISession session = OpenSession()) + { + session.CreateQuery("delete from Invoice").ExecuteUpdate(); + session.Flush(); + } + } + } +} Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml 2009-08-04 19:35:21 UTC (rev 4681) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml 2009-08-04 19:52:18 UTC (rev 4682) @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - assembly="NHibernate.Test" - namespace="NHibernate.Test.NHSpecificTest.NH1904"> - - <class name="Invoice"> - <id name="ID" type="Int32"> - <generator class="hilo" /> - </id> - - <property name="Issued" type="DateTime" /> - </class> - -</hibernate-mapping> Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml (from rev 4681, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml 2009-08-04 19:52:18 UTC (rev 4682) @@ -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.NH1904"> + + <class name="Invoice"> + <id name="ID" type="Int32"> + <generator class="hilo" /> + </id> + + <property name="Issued" type="DateTime" /> + </class> + +</hibernate-mapping> Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs 2009-08-04 19:35:21 UTC (rev 4681) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs 2009-08-04 19:52:18 UTC (rev 4682) @@ -1,12 +0,0 @@ -using System; - -namespace NHibernate.Test.NHSpecificTest.NH1904 -{ - public class Invoice - { - public virtual int ID { get; private set; } - public virtual DateTime Issued { get; set; } - - protected virtual DateTime issued { get; set; } - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs (from rev 4681, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs 2009-08-04 19:52:18 UTC (rev 4682) @@ -0,0 +1,12 @@ +using System; + +namespace NHibernate.Test.NHSpecificTest.NH1904 +{ + public class Invoice + { + public virtual int ID { get; private set; } + public virtual DateTime Issued { get; set; } + + protected virtual DateTime issued { get; set; } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-08-04 19:35:21 UTC (rev 4681) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-08-04 19:52:18 UTC (rev 4682) @@ -556,6 +556,8 @@ <Compile Include="NHSpecificTest\NH1898\SampleTest.cs" /> <Compile Include="NHSpecificTest\NH1899\DomainClass.cs" /> <Compile Include="NHSpecificTest\NH1899\SampleTest.cs" /> + <Compile Include="NHSpecificTest\NH1904\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1904\Model.cs" /> <Compile Include="NHSpecificTest\NH1907\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1907\MyType.cs" /> <Compile Include="NHSpecificTest\NH1908\Fixture.cs" /> @@ -1973,6 +1975,7 @@ <EmbeddedResource Include="Criteria\Lambda\Mappings.hbm.xml" /> <EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1904\Mappings.hbm.xml" /> <EmbeddedResource Include="FilterTest\SimpleFiltered.hbm.xml" /> <EmbeddedResource Include="FilterTest\SimpleFilteredFiltersDefsOk.hbm.xml" /> <EmbeddedResource Include="FilterTest\WrongFilterDefInClass.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2009-08-13 11:56:52
|
Revision: 4689 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4689&view=rev Author: steverstrong Date: 2009-08-13 11:56:42 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Added initial test for Linq provider to show the approach taken to integrate with the core Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs trunk/nhibernate/src/NHibernate/Engine/Query/QueryPlanCache.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs trunk/nhibernate/src/NHibernate/Hql/IQueryTranslatorFactory.cs trunk/nhibernate/src/NHibernate/ISession.cs trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/QueryImpl.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/IQueryExpression.cs trunk/nhibernate/src/NHibernate/Linq/ trunk/nhibernate/src/NHibernate/Linq/LinqExpression.cs trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs trunk/nhibernate/src/NHibernate/Linq/NhQueryProvider.cs trunk/nhibernate/src/NHibernate/Linq/Query.cs trunk/nhibernate/src/NHibernate/Linq/QueryProvider.cs trunk/nhibernate/src/NHibernate/Linq/TypeHelper.cs trunk/nhibernate/src/NHibernate.Test/Linq/ trunk/nhibernate/src/NHibernate.Test/Linq/BasicLinqTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Address.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Customer.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Employee.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Entity.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Northwind.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Order.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/OrderLine.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Product.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/ProductCategory.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Region.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Shipper.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Supplier.cs trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Territory.cs trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/ trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Customer.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Employee.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Order.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/OrderLine.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Product.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/ProductCategory.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Region.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Shipper.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Supplier.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Territory.hbm.xml Property Changed: ---------------- trunk/nhibernate/src/ trunk/nhibernate/src/NHibernate/ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ trunk/nhibernate/src/NHibernate.DomainModel/ trunk/nhibernate/src/NHibernate.Test/ Property changes on: trunk/nhibernate/src ___________________________________________________________________ Modified: svn:ignore - *.suo CloverSrc _ReSharper* *.resharperoptions *.resharper.user CloverBuild Ankh.Load *.resharper ConsoleTest + *.suo CloverSrc _ReSharper* *.resharperoptions *.resharper.user CloverBuild Ankh.Load *.resharper ConsoleTest _UpgradeReport_Files NHibernate.userprefs NHibernate.usertasks UpgradeLog.XML UpgradeLog2.XML UpgradeLog3.XML UpgradeLog4.XML UpgradeLog5.XML UpgradeLog6.XML UpgradeLog7.XML UpgradeLog8.XML UpgradeLog9.XML NHibernate.sln.proj NHibernate.sln.AssemblySurfaceCache.user NHibernate.sln.cache Property changes on: trunk/nhibernate/src/NHibernate ___________________________________________________________________ Modified: svn:ignore - obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* + obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* _ReSharper.NHibernate NHibernate.pidb Modified: trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -81,6 +81,14 @@ /// <returns></returns> IList List(string query, QueryParameters parameters); + /// <summary> + /// Execute a <c>List()</c> expression query + /// </summary> + /// <param name="queryExpression"></param> + /// <param name="parameters"></param> + /// <returns></returns> + IList List(IQueryExpression queryExpression, QueryParameters parameters); + void List(string query, QueryParameters parameters, IList results); /// <summary> Modified: trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -6,6 +6,7 @@ using log4net; using NHibernate.Event; using NHibernate.Hql; +using NHibernate.Hql.Ast.ANTLR; using NHibernate.Type; using NHibernate.Util; @@ -30,10 +31,16 @@ public HQLQueryPlan(string hql, bool shallow, IDictionary<string, IFilter> enabledFilters, ISessionFactoryImplementor factory) - : this(hql, null, shallow, enabledFilters, factory) + : this(hql, (string) null, shallow, enabledFilters, factory) { } + public HQLQueryPlan(string expressionStr, IQueryExpression queryExpression, bool shallow, + IDictionary<string, IFilter> enabledFilters, ISessionFactoryImplementor factory) + : this(expressionStr, queryExpression, null, shallow, enabledFilters, factory) + { + } + protected internal HQLQueryPlan(string hql, string collectionRole, bool shallow, IDictionary<string, IFilter> enabledFilters, ISessionFactoryImplementor factory) { @@ -98,9 +105,39 @@ } } } - } + protected internal HQLQueryPlan(string expressionStr, IQueryExpression queryExpression, string collectionRole, bool shallow, + IDictionary<string, IFilter> enabledFilters, ISessionFactoryImplementor factory) + { + sourceQuery = expressionStr; + this.shallow = shallow; + + enabledFilterNames = new HashedSet<string>(enabledFilters.Keys); + + // TODO - no support for polymorphism here - done during Expression -> AST translation? + // TODO - polymorphism approach used in method above also sucks. Could be done in AST much more cleanly? Look at this... + IQueryTranslatorFactory2 qtFactory = new ASTQueryTranslatorFactory(); + + IQueryTranslator translator = qtFactory.CreateQueryTranslator(expressionStr, queryExpression, enabledFilters, + factory); + + translator.Compile(factory.Settings.QuerySubstitutions, shallow); + + translators = new[] { translator }; + + sqlStrings = new List<string>(translator.CollectSqlStrings).ToArray(); + + querySpaces = new HashedSet<string>(translator.QuerySpaces); + + // TODO - need to build parameterMetadata. Current function no good, since is parses the HQL. Might need to walk the AST here, + // probably inside the QueryTranslator. That's probably a better place for the parsing to be anyway; possibly worth moving for classic as well... + //parameterMetadata = BuildParameterMetadata(translator.GetParameterTranslations(), hql); + parameterMetadata = new ParameterMetadata(new OrdinalParameterDescriptor[0], new Dictionary<string, NamedParameterDescriptor>()); + + returnMetadata = new ReturnMetadata(translator.ReturnAliases, translator.ReturnTypes); + } + public string SourceQuery { get { return sourceQuery; } Modified: trunk/nhibernate/src/NHibernate/Engine/Query/QueryPlanCache.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/Query/QueryPlanCache.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Engine/Query/QueryPlanCache.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -72,6 +72,35 @@ return plan; } + public HQLQueryPlan GetHQLQueryPlan(IQueryExpression queryExpression, bool shallow, IDictionary<string, IFilter> enabledFilters) + { + string expressionStr = queryExpression.Key; + + var key = new HQLQueryPlanKey(expressionStr, shallow, enabledFilters); + var plan = (HQLQueryPlan)planCache[key]; + + if (plan == null) + { + if (log.IsDebugEnabled) + { + log.Debug("unable to locate HQL query plan in cache; generating (" + expressionStr + ")"); + } + plan = new HQLQueryPlan(expressionStr, queryExpression, shallow, enabledFilters, factory); + } + else + { + if (log.IsDebugEnabled) + { + log.Debug("located HQL query plan in cache (" + expressionStr + ")"); + } + } + + planCache.Put(key, plan); + + return plan; + } + + public FilterQueryPlan GetFilterQueryPlan(string filterString, string collectionRole, bool shallow, IDictionary<string, IFilter> enabledFilters) { var key = new FilterQueryPlanKey(filterString, collectionRole, shallow, enabledFilters); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -10,7 +10,7 @@ /// Author: Gavin King /// Ported by: Steve Strong /// </summary> - public class ASTQueryTranslatorFactory : IQueryTranslatorFactory + public class ASTQueryTranslatorFactory : IQueryTranslatorFactory2 { public IQueryTranslator CreateQueryTranslator(string queryIdentifier, string queryString, IDictionary<string, IFilter> filters, ISessionFactoryImplementor factory) { @@ -21,5 +21,10 @@ { return new QueryTranslatorImpl(queryIdentifier, queryString, filters, factory); } + + public IQueryTranslator CreateQueryTranslator(string queryIdentifier, IQueryExpression queryExpression, IDictionary<string, IFilter> filters, ISessionFactoryImplementor factory) + { + return new QueryTranslatorImpl(queryIdentifier, queryExpression, filters, factory); + } } } Property changes on: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated ___________________________________________________________________ Added: svn:ignore + Hql.tokens HqlSqlWalker.tokens SqlGenerator.tokens Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -58,6 +58,28 @@ _factory = factory; } + /// <summary> + /// Creates a new AST-based query translator. + /// </summary> + /// <param name="queryIdentifier">The query-identifier (used in stats collection)</param> + /// <param name="queryExpression">The hql query to translate</param> + /// <param name="enabledFilters">Currently enabled filters</param> + /// <param name="factory">The session factory constructing this translator instance.</param> + public QueryTranslatorImpl( + string queryIdentifier, + IQueryExpression queryExpression, + IDictionary<string, IFilter> enabledFilters, + ISessionFactoryImplementor factory) + { + _queryIdentifier = queryIdentifier; + _hql = queryExpression.ToString(); + _compiled = false; + _shallowQuery = false; + _enabledFilters = enabledFilters; + _factory = factory; + _parser = new HqlParseEngine(queryExpression.Translate(factory), factory); + } + /// <summary> /// Compile a "normal" query. This method may be called multiple /// times. Subsequent invocations are no-ops. Modified: trunk/nhibernate/src/NHibernate/Hql/IQueryTranslatorFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/IQueryTranslatorFactory.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Hql/IQueryTranslatorFactory.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -39,4 +39,26 @@ /// <returns>An appropriate translator.</returns> IFilterTranslator CreateFilterTranslator(string queryIdentifier, string queryString, IDictionary<string, IFilter> filters, ISessionFactoryImplementor factory); } + + /// <summary> + /// Facade for generation of <see cref="NHibernate.Hql.IQueryTranslator"/> + /// and <see cref="NHibernate.Hql.IFilterTranslator"/> instances. + /// </summary> + public interface IQueryTranslatorFactory2 : IQueryTranslatorFactory + { + /// <summary> + /// Construct a <see cref="NHibernate.Hql.IQueryTranslator"/> instance + /// capable of translating a Linq expression. + /// </summary> + /// <param name="queryIdentifier"> + /// The query-identifier (used in <see cref="NHibernate.Stat.QueryStatistics"/> collection). + /// This is typically the same as the queryString parameter except for the case of + /// split polymorphic queries which result in multiple physical sql queries. + /// </param> + /// <param name="queryExpression">The query expression to be translated</param> + /// <param name="filters">Currently enabled filters</param> + /// <param name="factory">The session factory</param> + /// <returns>An appropriate translator.</returns> + IQueryTranslator CreateQueryTranslator(string queryIdentifier, IQueryExpression queryExpression, IDictionary<string, IFilter> filters, ISessionFactoryImplementor factory); + } } \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/IQueryExpression.cs =================================================================== --- trunk/nhibernate/src/NHibernate/IQueryExpression.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/IQueryExpression.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,11 @@ +using NHibernate.Hql.Ast.ANTLR.Tree; + +namespace NHibernate +{ + public interface IQueryExpression + { + IASTNode Translate(ISessionFactory sessionFactory); + string Key { get; } + System.Type Type { get; } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/IQueryExpression.cs ___________________________________________________________________ Added: svn:executable + * Modified: trunk/nhibernate/src/NHibernate/ISession.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ISession.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/ISession.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -804,6 +804,13 @@ /// <returns>The query</returns> IQuery CreateQuery(string queryString); + /// <summary> + /// Create a new instance of <c>Query</c> for the given query expression + /// <param name="queryExpression"/>A hibernate query expression</param> + /// <returns>The query</returns> + /// </summary> + IQuery CreateQuery(IQueryExpression queryExpression); + /// <summary> /// Create a new instance of <c>Query</c> for the given collection and filter string /// </summary> Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -76,6 +76,8 @@ public abstract void CloseSessionFromDistributedTransaction(); public abstract IList List(string query, QueryParameters parameters); public abstract void List(string query, QueryParameters parameters, IList results); + public abstract IList List(IQueryExpression queryExpression, QueryParameters parameters); + public abstract void List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results); public abstract IList<T> List<T>(string query, QueryParameters queryParameters); public abstract IList<T> List<T>(CriteriaImpl criteria); public abstract void List(CriteriaImpl criteria, IList results); @@ -245,6 +247,18 @@ } } + public virtual IQuery CreateQuery(IQueryExpression queryExpression) + { + using (new SessionIdLoggingContext(SessionId)) + { + CheckAndUpdateSessionStatus(); + QueryImpl query = new QueryImpl(queryExpression, this, + GetHQLQueryPlan(queryExpression, false).ParameterMetadata); + query.SetComment("[expression]"); + return query; + } + } + public virtual IQuery CreateQuery(string queryString) { using (new SessionIdLoggingContext(SessionId)) @@ -275,6 +289,14 @@ } } + protected internal virtual HQLQueryPlan GetHQLQueryPlan(IQueryExpression queryExpression, bool shallow) + { + using (new SessionIdLoggingContext(SessionId)) + { + return factory.QueryPlanCache.GetHQLQueryPlan(queryExpression, shallow, EnabledFilters); + } + } + protected internal virtual NativeSQLQueryPlan GetNativeSQLQueryPlan(NativeSQLQuerySpecification spec) { using (new SessionIdLoggingContext(SessionId)) Modified: trunk/nhibernate/src/NHibernate/Impl/QueryImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/QueryImpl.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Impl/QueryImpl.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -13,6 +13,7 @@ public class QueryImpl : AbstractQueryImpl { private readonly Dictionary<string, LockMode> lockModes = new Dictionary<string, LockMode>(2); + private readonly IQueryExpression _queryExpression; public QueryImpl(string queryString, FlushMode flushMode, ISessionImplementor session, ParameterMetadata parameterMetadata) : base(queryString, flushMode, session, parameterMetadata) @@ -24,6 +25,12 @@ { } + public QueryImpl(IQueryExpression queryExpression, ISessionImplementor session, ParameterMetadata parameterMetadata) + : base(queryExpression.Key, FlushMode.Unspecified, session, parameterMetadata) + { + _queryExpression = queryExpression; + } + public override IEnumerable Enumerable() { VerifyParameters(); @@ -61,7 +68,14 @@ Before(); try { - return Session.List(ExpandParameterLists(namedParams), GetQueryParameters(namedParams)); + if (_queryExpression == null) + { + return Session.List(ExpandParameterLists(namedParams), GetQueryParameters(namedParams)); + } + else + { + return Session.List(_queryExpression, GetQueryParameters(namedParams)); + } } finally { Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -645,6 +645,50 @@ } } + public override IList List(IQueryExpression queryExpression, QueryParameters parameters) + { + IList results = (IList) typeof(List<>).MakeGenericType(queryExpression.Type) + .GetConstructor(System.Type.EmptyTypes) + .Invoke(null); + + List(queryExpression, parameters, results); + + return results; + } + + public override void List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results) + { + using (new SessionIdLoggingContext(SessionId)) + { + CheckAndUpdateSessionStatus(); + queryParameters.ValidateParameters(); + HQLQueryPlan plan = GetHQLQueryPlan(queryExpression, false); + AutoFlushIfRequired(plan.QuerySpaces); + + bool success = false; + dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called + try + { + plan.PerformList(queryParameters, this, results); + success = true; + } + catch (HibernateException) + { + // Do not call Convert on HibernateExceptions + throw; + } + catch (Exception e) + { + throw Convert(e, "Could not execute query"); + } + finally + { + dontFlushFromFind--; + AfterOperation(success); + } + } + } + public override IQueryTranslator[] GetQueries(string query, bool scalar) { using (new SessionIdLoggingContext(SessionId)) Modified: trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -133,6 +133,16 @@ } } + public override IList List(IQueryExpression queryExpression, QueryParameters parameters) + { + throw new System.NotImplementedException(); + } + + public override void List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results) + { + throw new System.NotImplementedException(); + } + public override IList<T> List<T>(string query, QueryParameters queryParameters) { using (new SessionIdLoggingContext(SessionId)) Added: trunk/nhibernate/src/NHibernate/Linq/LinqExpression.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/LinqExpression.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/LinqExpression.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,41 @@ +using System; +using System.Linq.Expressions; +using NHibernate.Hql.Ast.ANTLR; +using NHibernate.Hql.Ast.ANTLR.Tree; + +namespace NHibernate.Linq +{ + class LinqExpression : IQueryExpression + { + private readonly Expression _linqExpression; + + internal LinqExpression(Expression linqExpression) + { + _linqExpression = linqExpression; + } + + public IASTNode Translate(ISessionFactory sessionFactory) + { + ASTFactory factory = new ASTFactory(new ASTTreeAdaptor()); + + return factory.CreateNode(HqlSqlWalker.QUERY, "query", + factory.CreateNode(HqlSqlWalker.SELECT_FROM, "select from", + factory.CreateNode(HqlSqlWalker.FROM, "from", + factory.CreateNode( + HqlSqlWalker.RANGE, "range", + factory.CreateNode( + HqlSqlWalker.IDENT, + "Product"))))); + } + + public string Key + { + get { return _linqExpression.ToString(); } + } + + public System.Type Type + { + get { return _linqExpression.Type.GetGenericArguments()[0]; } + } + } +} Property changes on: trunk/nhibernate/src/NHibernate/Linq/LinqExpression.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,12 @@ +using System.Linq; + +namespace NHibernate.Linq +{ + public static class ExtensionMethods + { + public static IQueryable<T> Query<T>(this ISession session) + { + return new Query<T>(new NhQueryProvider(session)); + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate/Linq/NhQueryProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/NhQueryProvider.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/NhQueryProvider.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,20 @@ +using System.Linq.Expressions; + +namespace NHibernate.Linq +{ + public class NhQueryProvider : QueryProvider + { + private readonly ISession _session; + + public NhQueryProvider(ISession session) + { + _session = session; + } + + public override object Execute(Expression expression) + { + // walk the expression tree and build an HQL AST to mirror it + return _session.CreateQuery(new LinqExpression(expression)).List(); + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/Linq/NhQueryProvider.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate/Linq/Query.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Query.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Query.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,85 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; + +namespace NHibernate.Linq +{ + /// <summary> + /// A default implementation of IQueryable for use with QueryProvider + /// </summary> + public class Query<T> : IOrderedQueryable<T> + { + private readonly Expression _expression; + private readonly IQueryProvider _provider; + + public Query(IQueryProvider provider) + { + if (provider == null) + { + throw new ArgumentNullException("provider"); + } + _provider = provider; + _expression = Expression.Constant(this); + } + + public Query(IQueryProvider provider, Expression expression) + { + if (provider == null) + { + throw new ArgumentNullException("provider"); + } + if (expression == null) + { + throw new ArgumentNullException("expression"); + } + if (!typeof (IQueryable<T>).IsAssignableFrom(expression.Type)) + { + throw new ArgumentOutOfRangeException("expression"); + } + _provider = provider; + _expression = expression; + } + + #region IQueryable<T> Members + + public Expression Expression + { + get { return _expression; } + } + + public System.Type ElementType + { + get { return typeof (T); } + } + + public IQueryProvider Provider + { + get { return _provider; } + } + + public IEnumerator<T> GetEnumerator() + { + return ((IEnumerable<T>) _provider.Execute(_expression)).GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable) _provider.Execute(_expression)).GetEnumerator(); + } + + #endregion + + public override string ToString() + { + if (_expression.NodeType == ExpressionType.Constant && + ((ConstantExpression) _expression).Value == this) + { + return "Query(" + typeof (T) + ")"; + } + + return _expression.ToString(); + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/Linq/Query.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate/Linq/QueryProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/QueryProvider.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/QueryProvider.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,49 @@ +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; + +namespace NHibernate.Linq +{ + /// <summary> + /// A basic abstract LINQ query provider + /// </summary> + public abstract class QueryProvider : IQueryProvider + { + #region IQueryProvider Members + + IQueryable<T> IQueryProvider.CreateQuery<T>(Expression expression) + { + return new Query<T>(this, expression); + } + + IQueryable IQueryProvider.CreateQuery(Expression expression) + { + System.Type elementType = TypeHelper.GetElementType(expression.Type); + try + { + return + (IQueryable) + Activator.CreateInstance(typeof (Query<>).MakeGenericType(elementType), new object[] {this, expression}); + } + catch (TargetInvocationException tie) + { + throw tie.InnerException; + } + } + + T IQueryProvider.Execute<T>(Expression expression) + { + return (T) Execute(expression); + } + + object IQueryProvider.Execute(Expression expression) + { + return Execute(expression); + } + + #endregion + + public abstract object Execute(Expression expression); + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/Linq/QueryProvider.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate/Linq/TypeHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/TypeHelper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/TypeHelper.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// This source code is made available under the terms of the Microsoft Public License (MS-PL) + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; + +namespace NHibernate.Linq +{ + /// <summary> + /// Type related helper methods + /// </summary> + public static class TypeHelper + { + public static System.Type FindIEnumerable(System.Type seqType) + { + if (seqType == null || seqType == typeof (string)) + return null; + if (seqType.IsArray) + return typeof (IEnumerable<>).MakeGenericType(seqType.GetElementType()); + if (seqType.IsGenericType) + { + foreach (System.Type arg in seqType.GetGenericArguments()) + { + System.Type ienum = typeof (IEnumerable<>).MakeGenericType(arg); + if (ienum.IsAssignableFrom(seqType)) + { + return ienum; + } + } + } + System.Type[] ifaces = seqType.GetInterfaces(); + if (ifaces != null && ifaces.Length > 0) + { + foreach (System.Type iface in ifaces) + { + System.Type ienum = FindIEnumerable(iface); + if (ienum != null) return ienum; + } + } + if (seqType.BaseType != null && seqType.BaseType != typeof (object)) + { + return FindIEnumerable(seqType.BaseType); + } + return null; + } + + public static System.Type GetSequenceType(System.Type elementType) + { + return typeof (IEnumerable<>).MakeGenericType(elementType); + } + + public static System.Type GetElementType(System.Type seqType) + { + System.Type ienum = FindIEnumerable(seqType); + if (ienum == null) return seqType; + return ienum.GetGenericArguments()[0]; + } + + public static bool IsNullableType(System.Type type) + { + return type != null && type.IsGenericType && type.GetGenericTypeDefinition() == typeof (Nullable<>); + } + + public static bool IsNullAssignable(System.Type type) + { + return !type.IsValueType || IsNullableType(type); + } + + public static System.Type GetNonNullableType(System.Type type) + { + if (IsNullableType(type)) + { + return type.GetGenericArguments()[0]; + } + return type; + } + + public static System.Type GetNullAssignableType(System.Type type) + { + if (!IsNullAssignable(type)) + { + return typeof (Nullable<>).MakeGenericType(type); + } + return type; + } + + public static ConstantExpression GetNullConstant(System.Type type) + { + return Expression.Constant(null, GetNullAssignableType(type)); + } + + public static System.Type GetMemberType(MemberInfo mi) + { + var fi = mi as FieldInfo; + if (fi != null) return fi.FieldType; + var pi = mi as PropertyInfo; + if (pi != null) return pi.PropertyType; + var ei = mi as EventInfo; + if (ei != null) return ei.EventHandlerType; + return null; + } + + public static object GetDefault(System.Type type) + { + bool isNullable = !type.IsValueType || IsNullableType(type); + if (!isNullable) + return Activator.CreateInstance(type); + return null; + } + + public static bool IsReadOnly(MemberInfo member) + { + switch (member.MemberType) + { + case MemberTypes.Field: + return (((FieldInfo) member).Attributes & FieldAttributes.InitOnly) != 0; + case MemberTypes.Property: + var pi = (PropertyInfo) member; + return !pi.CanWrite || pi.GetSetMethod() == null; + default: + return true; + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/Linq/TypeHelper.cs ___________________________________________________________________ Added: svn:executable + * Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-08-10 15:41:06 UTC (rev 4688) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-08-13 11:56:42 UTC (rev 4689) @@ -544,10 +544,17 @@ <Compile Include="Hql\Ast\ANTLR\Tree\ASTErrorNode.cs" /> <Compile Include="Hql\Ast\ANTLR\Tree\InsertStatement.cs" /> <Compile Include="Hql\Ast\ANTLR\Tree\UpdateStatement.cs" /> + <Compile Include="IQueryExpression.cs" /> <Compile Include="IQueryOver.cs" /> <Compile Include="Criterion\QueryOver.cs" /> <Compile Include="Impl\ExpressionProcessor.cs" /> <Compile Include="Impl\SessionIdLoggingContext.cs" /> + <Compile Include="Linq\LinqExpression.cs" /> + <Compile Include="Linq\LinqExtensionMethods.cs" /> + <Compile Include="Linq\NhQueryProvider.cs" /> + <Compile Include="Linq\Query.cs" /> + <Compile Include="Linq\QueryProvider.cs" /> + <Compile Include="Linq\TypeHelper.cs" /> <Compile Include="Param\AbstractExplicitParameterSpecification.cs" /> <Compile Include="Param\AggregatedIndexCollectionSelectorParameterSpecifications.cs" /> <Compile Include="Param\CollectionFilterKeyParameterSpecification.cs" /> Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.LinFu ___________________________________________________________________ Modified: svn:ignore - obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* + obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* NHibernate.ByteCode.LinFu.pidb Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests ___________________________________________________________________ Modified: svn:ignore - obj .#* *.user *.xsx AssemblyInfo.cs hibernate.cfg.xml *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* *.xml + obj .#* *.user *.xsx AssemblyInfo.cs hibernate.cfg.xml *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* *.xml NHibernate.ByteCode.LinFu.Tests.pidb Property changes on: trunk/nhibernate/src/NHibernate.DomainModel ___________________________________________________________________ Modified: svn:ignore - bin obj .#* *.user *.xsx AssemblyInfo.cs [Bb]in [Dd]ebug [Rr]elease *.aps *.eto + bin obj .#* *.user *.xsx AssemblyInfo.cs [Bb]in [Dd]ebug [Rr]elease *.aps *.eto NHibernate.DomainModel.pidb Property changes on: trunk/nhibernate/src/NHibernate.Test ___________________________________________________________________ Modified: svn:ignore - bin obj .#* *.user *.xsx AssemblyInfo.cs hibernate.cfg.xml Debug Release *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* *.xml + bin obj .#* *.user *.xsx AssemblyInfo.cs hibernate.cfg.xml Debug Release *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* *.xml NHibernate.Test.pidb test-results Added: trunk/nhibernate/src/NHibernate.Test/Linq/BasicLinqTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/BasicLinqTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/BasicLinqTests.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,19 @@ +using System.Linq; +using NUnit.Framework; + +namespace NHibernate.Test.Linq +{ + [TestFixture] + public class BasicLinqTests : LinqTestCase + { + [Test] + public void DummySelect() + { + var soldOutProducts = from p in db.Products select p; + + var results = soldOutProducts.ToList(); + + Assert.AreEqual(0, results.Count); + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/BasicLinqTests.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Address.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Address.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Address.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,117 @@ +namespace NHibernate.Test.Linq.Entities +{ + public class Address + { + private readonly string _city; + private readonly string _country; + private readonly string _fax; + private readonly string _phoneNumber; + private readonly string _postalCode; + private readonly string _region; + private readonly string _street; + + public Address() : this(null, null, null, null, null, null, null) + { + } + + public Address(string street, string city, string region, string postalCode, + string country, string phoneNumber, string fax) + { + _street = street; + _city = city; + _region = region; + _postalCode = postalCode; + _country = country; + _phoneNumber = phoneNumber; + _fax = fax; + } + + public string Street + { + get { return _street; } + } + + public string City + { + get { return _city; } + } + + public string Region + { + get { return _region; } + } + + public string PostalCode + { + get { return _postalCode; } + } + + public string Country + { + get { return _country; } + } + + public string PhoneNumber + { + get { return _phoneNumber; } + } + + public string Fax + { + get { return _fax; } + } + + public static bool operator ==(Address address1, Address address2) + { + if (!ReferenceEquals(address1, null) && + ReferenceEquals(address2, null)) + { + return false; + } + + if (ReferenceEquals(address1, null) && + !ReferenceEquals(address2, null)) + { + return false; + } + + return address1.Equals(address2); + } + + public static bool operator !=(Address address1, Address address2) + { + return !(address1 == address2); + } + + public override bool Equals(object obj) + { + var address = obj as Address; + + if (address != null) + { + return + _street == address.Street && + _city == address.City && + _region == address.Region && + _postalCode == address.PostalCode && + _country == address.Country && + _phoneNumber == address.PhoneNumber && + _fax == address.Fax; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return + (_street ?? string.Empty).GetHashCode() ^ + (_city ?? string.Empty).GetHashCode() ^ + (_region ?? string.Empty).GetHashCode() ^ + (_postalCode ?? string.Empty).GetHashCode() ^ + (_country ?? string.Empty).GetHashCode() ^ + (_phoneNumber ?? string.Empty).GetHashCode() ^ + (_fax ?? string.Empty).GetHashCode(); + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Address.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Customer.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Customer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Customer.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,73 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Iesi.Collections.Generic; + +namespace NHibernate.Test.Linq.Entities +{ + public class Customer : Entity<Customer> + { + private readonly ISet<Order> _orders; + private Address _address; + private string _companyName; + private string _contactName; + private string _contactTitle; + + public Customer() : this(null) + { + } + + public Customer(string companyName) + { + _orders = new HashedSet<Order>(); + + _companyName = companyName; + } + + public virtual string CompanyName + { + get { return _companyName; } + set { _companyName = value; } + } + + public virtual string ContactName + { + get { return _contactName; } + set { _contactName = value; } + } + + public virtual string ContactTitle + { + get { return _contactTitle; } + set { _contactTitle = value; } + } + + public virtual Address Address + { + get { return _address; } + set { _address = value; } + } + + public virtual ReadOnlyCollection<Order> Orders + { + get { return new ReadOnlyCollection<Order>(new List<Order>(_orders)); } + } + + public virtual void AddOrder(Order order) + { + if (!_orders.Contains(order)) + { + _orders.Add(order); + order.Customer = this; + } + } + + public virtual void RemoveOrder(Order order) + { + if (_orders.Contains(order)) + { + _orders.Remove(order); + order.Customer = null; + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Customer.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Employee.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Employee.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Employee.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Iesi.Collections.Generic; + +namespace NHibernate.Test.Linq.Entities +{ + public class Employee : Entity<Employee> + { + private readonly ISet<Order> _orders; + private readonly ISet<Employee> _subordinates; + private readonly IList<Territory> _territories; + private Address _address; + private DateTime? _birthDate; + private string _extension; + private string _firstName; + private DateTime? _hireDate; + private string _lastName; + private string _notes; + private Employee _superior; + private string _title; + private string _titleOfCourtesy; + + public Employee() + : this(null, null) + { + } + + public Employee(string firstName, string lastName) + { + _firstName = firstName; + _lastName = lastName; + + _subordinates = new HashedSet<Employee>(); + _orders = new HashedSet<Order>(); + _territories = new List<Territory>(); + } + + public virtual string FirstName + { + get { return _firstName; } + set { _firstName = value; } + } + + public virtual string LastName + { + get { return _lastName; } + set { _lastName = value; } + } + + public virtual string Title + { + get { return _title; } + set { _title = value; } + } + + public virtual string TitleOfCourtesy + { + get { return _titleOfCourtesy; } + set { _titleOfCourtesy = value; } + } + + public virtual DateTime? BirthDate + { + get { return _birthDate; } + set { _birthDate = value; } + } + + public virtual DateTime? HireDate + { + get { return _hireDate; } + set { _hireDate = value; } + } + + public virtual Address Address + { + get { return _address; } + set { _address = value; } + } + + public virtual string Extension + { + get { return _extension; } + set { _extension = value; } + } + + public virtual string Notes + { + get { return _notes; } + set { _notes = value; } + } + + public virtual Employee Superior + { + get { return _superior; } + set { _superior = value; } + } + + public virtual ReadOnlyCollection<Employee> Subordinates + { + get { return new ReadOnlyCollection<Employee>(new List<Employee>(_subordinates)); } + } + + public virtual ReadOnlyCollection<Territory> Territories + { + get { return new ReadOnlyCollection<Territory>(_territories); } + } + + public virtual ReadOnlyCollection<Order> Orders + { + get { return new ReadOnlyCollection<Order>(new List<Order>(_orders)); } + } + + public virtual void AddSubordinate(Employee subordinate) + { + if (!_subordinates.Contains(subordinate)) + { + subordinate.Superior = this; + _subordinates.Add(subordinate); + } + } + + public virtual void RemoveSubordinate(Employee subordinate) + { + if (_subordinates.Contains(subordinate)) + { + subordinate.Superior = null; + _subordinates.Remove(subordinate); + } + } + + public virtual void AddOrder(Order order) + { + if (!_orders.Contains(order)) + { + order.Employee = this; + _orders.Add(order); + } + } + + public virtual void RemoveOrder(Order order) + { + if (_orders.Contains(order)) + { + order.Employee = null; + _orders.Remove(order); + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Employee.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Entity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Entity.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Entity.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,9 @@ +namespace NHibernate.Test.Linq.Entities +{ + public abstract class Entity<T> + { + private long _id = -1; + + public virtual long Id { get { return _id; } set { _id = value; }} + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Entity.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Northwind.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Northwind.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Northwind.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,40 @@ +using System.Linq; +using NHibernate.Linq; + +namespace NHibernate.Test.Linq.Entities +{ + public class Northwind + { + private readonly ISession _session; + + public Northwind(ISession session) + { + _session = session; + } + + public IQueryable<Customer> Customers + { + get { return _session.Query<Customer>(); } + } + + public IQueryable<Product> Products + { + get { return _session.Query<Product>(); } + } + + public IQueryable<Order> Orders + { + get { return _session.Query<Order>(); } + } + + public IQueryable<OrderLine> OrderLines + { + get { return _session.Query<OrderLine>(); } + } + + public IQueryable<Employee> Employees + { + get { return _session.Query<Employee>(); } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Northwind.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Order.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Order.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Order.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Iesi.Collections.Generic; + +namespace NHibernate.Test.Linq.Entities +{ + public class Order : Entity<Order> + { + private readonly ISet<OrderLine> _orderLines; + private Customer _customer; + private Employee _employee; + private decimal? _freight; + private DateTime? _orderDate; + private DateTime? _requiredDate; + private string _shippedTo; + private Shipper _shipper; + private Address _shippingAddress; + private DateTime? _shippingDate; + + public Order() : this(null) + { + } + + public Order(Customer customer) + { + _orderLines = new HashedSet<OrderLine>(); + + _customer = customer; + } + + public virtual Customer Customer + { + get { return _customer; } + set { _customer = value; } + } + + public virtual Employee Employee + { + get { return _employee; } + set { _employee = value; } + } + + public virtual DateTime? OrderDate + { + get { return _orderDate; } + set { _orderDate = value; } + } + + public virtual DateTime? RequiredDate + { + get { return _requiredDate; } + set { _requiredDate = value; } + } + + public virtual DateTime? ShippingDate + { + get { return _shippingDate; } + set { _shippingDate = value; } + } + + public virtual Shipper Shipper + { + get { return _shipper; } + set { _shipper = value; } + } + + public virtual decimal? Freight + { + get { return _freight; } + set { _freight = value; } + } + + public virtual string ShippedTo + { + get { return _shippedTo; } + set { _shippedTo = value; } + } + + public virtual Address ShippingAddress + { + get { return _shippingAddress; } + set { _shippingAddress = value; } + } + + public virtual ReadOnlyCollection<OrderLine> OrderLines + { + get { return new ReadOnlyCollection<OrderLine>(new List<OrderLine>(_orderLines)); } + } + + public virtual void AddOrderLine(OrderLine orderLine) + { + if (!_orderLines.Contains(orderLine)) + { + orderLine.Order = this; + _orderLines.Add(orderLine); + } + } + + public virtual void RemoveOrderLine(OrderLine orderLine) + { + if (_orderLines.Contains(orderLine)) + { + _orderLines.Remove(orderLine); + orderLine.Order = null; + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Order.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/OrderLine.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/OrderLine.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/OrderLine.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,51 @@ +namespace NHibernate.Test.Linq.Entities +{ + public class OrderLine : Entity<OrderLine> + { + private decimal _discount; + private Order _order; + private Product _product; + private int _quantity; + private decimal _unitPrice; + + public OrderLine() : this(null, null) + { + } + + public OrderLine(Order order, Product product) + { + _order = order; + _product = product; + } + + public virtual Order Order + { + get { return _order; } + set { _order = value; } + } + + public virtual Product Product + { + get { return _product; } + set { _product = value; } + } + + public virtual decimal UnitPrice + { + get { return _unitPrice; } + set { _unitPrice = value; } + } + + public virtual int Quantity + { + get { return _quantity; } + set { _quantity = value; } + } + + public virtual decimal Discount + { + get { return _discount; } + set { _discount = value; } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/OrderLine.cs ___________________________________________________________________ Added: svn:executable + * Added: trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Product.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Product.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Product.cs 2009-08-13 11:56:42 UTC (rev 4689) @@ -0,0 +1,89 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace NHibernate.Test.Linq.Entities +{ + public class Product : Entity<Product> + { + private readonly IList<OrderLine> _orderLines; + private ProductCategory _category; + private bool _discontinued; + private string _name; + private string _quantityPerUnit; + private int _reorderLevel; + private Supplier _supplier; + private decimal? _unitPrice; + private int _unitsInStock; + private int _unitsOnOrder; + + public Product() : this(null) + { + } + + public Product(string name) + { + _orderLines = new List<OrderLine>(); + + _name = name; + } + + public virtual string Name + { + get { return _name; } + set { _name = value; } + } + + public virtual Supplier Supplier + { + get { return _supplier; } + set { _supplier = value; } + } + + public virtual ProductCategory Category + { + get { return _category; } + set { _category = value; } + } + + public virtual string QuantityPerUnit + { + get { return _quantityPerUnit; } + set { _quantityPerUnit = value; } + } + + public virtual decimal? UnitPrice + { + get { return _unitPrice; } + set { _unitPrice = value; } + } + + public virtual int UnitsInStock + { + get { return _unitsInSt... [truncated message content] |
From: <ric...@us...> - 2009-11-15 15:40:01
|
Revision: 4832 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4832&view=rev Author: ricbrown Date: 2009-11-15 15:39:52 +0000 (Sun, 15 Nov 2009) Log Message: ----------- Added compiler directives to allow tests to pass in Release build. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/MyProxyImpl.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs 2009-11-13 16:48:48 UTC (rev 4831) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CastleProxyImpl.cs 2009-11-15 15:39:52 UTC (rev 4832) @@ -9,11 +9,13 @@ [Serializable] public class CastleProxyImpl : CastleProxy { + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static void Level1() { Level2(); } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static void Level2() { throw new ArgumentException("thrown from Level2"); Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/MyProxyImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/MyProxyImpl.cs 2009-11-13 16:48:48 UTC (rev 4831) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ProxyInterface/MyProxyImpl.cs 2009-11-15 15:39:52 UTC (rev 4832) @@ -4,11 +4,13 @@ { public class MyProxyImpl: IMyProxy { + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static void Level1() { Level2(); } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static void Level2() { throw new ArgumentException("thrown from Level2"); Modified: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs 2009-11-13 16:48:48 UTC (rev 4831) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs 2009-11-15 15:39:52 UTC (rev 4832) @@ -4,11 +4,13 @@ { public class MyProxyImpl: IMyProxy { + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static void Level1() { Level2(); } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static void Level2() { throw new ArgumentException("thrown from Level2"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2010-01-06 21:35:27
|
Revision: 4909 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4909&view=rev Author: ayenderahien Date: 2010-01-06 21:35:19 +0000 (Wed, 06 Jan 2010) Log Message: ----------- Merging 4905-4908 revisions from 2.1 branch Modified Paths: -------------- trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Exceptions/SqlParseException.cs trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/ScriptSplitter.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs Property Changed: ---------------- trunk/nhibernate/src/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1927/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1928/ trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests/ Property changes on: trunk/nhibernate/src ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src:4659,4671,4681,4690-4691,4696-4697,4711,4715-4716 + /branches/2.1.x/nhibernate/src:4659,4671,4681,4690-4691,4696-4697,4711,4715-4716,4905-4908 Modified: trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -97,7 +97,6 @@ { try { - LogCommand(cmd); IDbConnection sessionConnection = connectionManager.GetConnection(); if (cmd.Connection != null) @@ -201,7 +200,8 @@ public int ExecuteNonQuery(IDbCommand cmd) { CheckReaders(); - Prepare(cmd); + LogCommand(cmd); + Prepare(cmd); Stopwatch duration = null; if(log.IsDebugEnabled) duration = Stopwatch.StartNew(); @@ -225,7 +225,8 @@ public IDataReader ExecuteReader(IDbCommand cmd) { CheckReaders(); - Prepare(cmd); + LogCommand(cmd); + Prepare(cmd); Stopwatch duration = null; if (log.IsDebugEnabled) duration = Stopwatch.StartNew(); Modified: trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Data; using System.Reflection; +using System.Text; +using NHibernate.AdoNet.Util; namespace NHibernate.AdoNet { @@ -18,20 +20,40 @@ private IDbCommand currentBatch; private IDictionary<string, List<object>> parameterValueListHashTable; private IDictionary<string, bool> parameterIsAllNullsHashTable; + private StringBuilder currentBatchCommandsLog; public OracleDataClientBatchingBatcher(ConnectionManager connectionManager, IInterceptor interceptor) : base(connectionManager, interceptor) { batchSize = Factory.Settings.AdoBatchSize; - } + //we always create this, because we need to deal with a scenario in which + //the user change the logging configuration at runtime. Trying to put this + //behind an if(log.IsDebugEnabled) will cause a null reference exception + //at that point. + currentBatchCommandsLog = new StringBuilder().AppendLine("Batch commands:"); + } public override void AddToBatch(IExpectation expectation) { bool firstOnBatch = true; totalExpectedRowsAffected += expectation.ExpectedRowCount; - log.Info("Adding to batch"); - LogCommand(CurrentCommand); + string lineWithParameters = null; + var sqlStatementLogger = Factory.Settings.SqlStatementLogger; + if (sqlStatementLogger.IsDebugEnabled || log.IsDebugEnabled) + { + lineWithParameters = sqlStatementLogger.GetCommandLineWithParameters(CurrentCommand); + var formatStyle = sqlStatementLogger.DetermineActualStyle(FormatStyle.Basic); + lineWithParameters = formatStyle.Formatter.Format(lineWithParameters); + currentBatchCommandsLog.Append("command ") + .Append(countOfCommands) + .Append(":") + .AppendLine(lineWithParameters); + } + if (log.IsDebugEnabled) + { + log.Debug("Adding to batch:" + lineWithParameters); + } if (currentBatch == null) { @@ -87,6 +109,12 @@ CheckReaders(); Prepare(currentBatch); + if (Factory.Settings.SqlStatementLogger.IsDebugEnabled) + { + Factory.Settings.SqlStatementLogger.LogBatchCommand(currentBatchCommandsLog.ToString()); + currentBatchCommandsLog = new StringBuilder().AppendLine("Batch commands:"); + } + foreach (IDataParameter currentParameter in currentBatch.Parameters) { List<object> parameterValueArray = parameterValueListHashTable[currentParameter.ParameterName]; Modified: trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -2105,5 +2105,17 @@ } } #endregion + + /// <summary> + /// Supports splitting batches using GO T-SQL command + /// </summary> + /// <remarks> + /// Batches http://msdn.microsoft.com/en-us/library/ms175502.aspx + /// </remarks> + public virtual bool SupportsSqlBatches + { + get { return false; } + } + } } Modified: trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -495,5 +495,13 @@ { get { return true; } } + + public override bool SupportsSqlBatches + { + get + { + return true; + } + } } } Copied: trunk/nhibernate/src/NHibernate/Exceptions/SqlParseException.cs (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate/Exceptions/SqlParseException.cs) =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/SqlParseException.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Exceptions/SqlParseException.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -0,0 +1,13 @@ +using System; + +namespace NHibernate.Exceptions +{ + public class SqlParseException : Exception + { + + public SqlParseException(string Message) : base(Message) + { + } + + } +} Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-01-06 21:35:19 UTC (rev 4909) @@ -607,6 +607,7 @@ <Compile Include="Event\IPreDatabaseOperationEventArgs.cs" /> <Compile Include="Exceptions\AdoExceptionContextInfo.cs" /> <Compile Include="Exceptions\ReflectionBasedSqlStateExtracter.cs" /> + <Compile Include="Exceptions\SqlParseException.cs" /> <Compile Include="Exceptions\SqlStateExtracter.cs" /> <Compile Include="Exceptions\TemplatedViolatedConstraintNameExtracter.cs" /> <Compile Include="Hql\Ast\ANTLR\AstPolymorphicProcessor.cs" /> @@ -800,6 +801,7 @@ <Compile Include="Proxy\AbstractProxyFactory.cs" /> <Compile Include="SqlCommand\InsertSelect.cs" /> <Compile Include="Tool\hbm2ddl\SchemaMetadataUpdater.cs" /> + <Compile Include="Tool\hbm2ddl\ScriptSplitter.cs" /> <Compile Include="Transaction\AdoNetWithDistrubtedTransactionFactory.cs" /> <Compile Include="Transform\ToListResultTransformer.cs" /> <Compile Include="Type\DbTimestampType.cs" /> Modified: trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -127,9 +127,7 @@ } if (export) { - statement.CommandText = sql; - statement.CommandType = CommandType.Text; - statement.ExecuteNonQuery(); + ExecuteSql(statement, sql); } } catch (Exception e) @@ -143,6 +141,29 @@ } } + private void ExecuteSql(IDbCommand cmd, string sql) + { + if (dialect.SupportsSqlBatches) + { + var objFactory = Environment.BytecodeProvider.ObjectsFactory; + ScriptSplitter splitter = (ScriptSplitter)objFactory.CreateInstance(typeof(ScriptSplitter), sql); + + foreach (string stmt in splitter) + { + log.DebugFormat("SQL Batch: {0}", stmt); + cmd.CommandText = stmt; + cmd.CommandType = CommandType.Text; + cmd.ExecuteNonQuery(); + } + } + else + { + cmd.CommandText = sql; + cmd.CommandType = CommandType.Text; + cmd.ExecuteNonQuery(); + } + } + /// <summary> /// Executes the Export of the Schema in the given connection /// </summary> Copied: trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/ScriptSplitter.cs (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate/Tool/hbm2ddl/ScriptSplitter.cs) =================================================================== --- trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/ScriptSplitter.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/ScriptSplitter.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -0,0 +1,405 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace NHibernate.Tool.hbm2ddl +{ + public class ScriptSplitter : IEnumerable<string> + { + private readonly TextReader _reader; + private StringBuilder _builder = new StringBuilder(); + private char _current; + private char _lastChar; + private ScriptReader _scriptReader; + + public ScriptSplitter(string script) + { + _reader = new StringReader(script); + _scriptReader = new SeparatorLineReader(this); + } + + internal bool HasNext + { + get { return _reader.Peek() != -1; } + } + + internal char Current + { + get { return _current; } + } + + internal char LastChar + { + get { return _lastChar; } + } + + #region IEnumerable<string> Members + + public IEnumerator<string> GetEnumerator() + { + while (Next()) + { + if (Split()) + { + string script = _builder.ToString().Trim(); + if (script.Length > 0) + { + yield return (script); + } + Reset(); + } + } + if (_builder.Length > 0) + { + string scriptRemains = _builder.ToString().Trim(); + if (scriptRemains.Length > 0) + { + yield return (scriptRemains); + } + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + #endregion + + internal bool Next() + { + if (!HasNext) + { + return false; + } + + _lastChar = _current; + _current = (char)_reader.Read(); + return true; + } + + internal int Peek() + { + return _reader.Peek(); + } + + private bool Split() + { + return _scriptReader.ReadNextSection(); + } + + internal void SetParser(ScriptReader newReader) + { + _scriptReader = newReader; + } + + internal void Append(string text) + { + _builder.Append(text); + } + + internal void Append(char c) + { + _builder.Append(c); + } + + void Reset() + { + _current = _lastChar = char.MinValue; + _builder = new StringBuilder(); + } + } + + abstract class ScriptReader + { + protected readonly ScriptSplitter Splitter; + + protected ScriptReader(ScriptSplitter splitter) + { + Splitter = splitter; + } + + /// <summary> + /// This acts as a template method. Specific Reader instances + /// override the component methods. + /// </summary> + public bool ReadNextSection() + { + if (IsQuote) + { + ReadQuotedString(); + return false; + } + + if (BeginDashDashComment) + { + return ReadDashDashComment(); + } + + if (BeginSlashStarComment) + { + ReadSlashStarComment(); + return false; + } + + return ReadNext(); + } + + protected virtual bool ReadDashDashComment() + { + Splitter.Append(Current); + while (Splitter.Next()) + { + Splitter.Append(Current); + if (EndOfLine) + { + break; + } + } + //We should be EndOfLine or EndOfScript here. + Splitter.SetParser(new SeparatorLineReader(Splitter)); + return false; + } + + protected virtual void ReadSlashStarComment() + { + if (ReadSlashStarCommentWithResult()) + { + Splitter.SetParser(new SeparatorLineReader(Splitter)); + return; + } + } + + private bool ReadSlashStarCommentWithResult() + { + Splitter.Append(Current); + while (Splitter.Next()) + { + if (BeginSlashStarComment) + { + ReadSlashStarCommentWithResult(); + continue; + } + Splitter.Append(Current); + + if (EndSlashStarComment) + { + return true; + } + } + return false; + } + + protected virtual void ReadQuotedString() + { + Splitter.Append(Current); + while (Splitter.Next()) + { + Splitter.Append(Current); + if (IsQuote) + { + return; + } + } + } + + protected abstract bool ReadNext(); + + #region Helper methods and properties + + protected bool HasNext + { + get { return Splitter.HasNext; } + } + + protected bool WhiteSpace + { + get { return char.IsWhiteSpace(Splitter.Current); } + } + + protected bool EndOfLine + { + get { return '\n' == Splitter.Current; } + } + + protected bool IsQuote + { + get { return '\'' == Splitter.Current; } + } + + protected char Current + { + get { return Splitter.Current; } + } + + protected char LastChar + { + get { return Splitter.LastChar; } + } + + bool BeginDashDashComment + { + get { return Current == '-' && Peek() == '-'; } + } + + bool BeginSlashStarComment + { + get { return Current == '/' && Peek() == '*'; } + } + + bool EndSlashStarComment + { + get { return LastChar == '*' && Current == '/'; } + } + + protected static bool CharEquals(char expected, char actual) + { + return Char.ToLowerInvariant(expected) == Char.ToLowerInvariant(actual); + } + + protected bool CharEquals(char compare) + { + return CharEquals(Current, compare); + } + + protected char Peek() + { + if (!HasNext) + { + return char.MinValue; + } + return (char)Splitter.Peek(); + } + + #endregion + } + + class SeparatorLineReader : ScriptReader + { + private StringBuilder _builder = new StringBuilder(); + private bool _foundGo; + private bool _gFound; + + public SeparatorLineReader(ScriptSplitter splitter) + : base(splitter) + { + } + + void Reset() + { + _foundGo = false; + _gFound = false; + _builder = new StringBuilder(); + } + + protected override bool ReadDashDashComment() + { + if (!_foundGo) + { + base.ReadDashDashComment(); + return false; + } + base.ReadDashDashComment(); + return true; + } + + protected override void ReadSlashStarComment() + { + if (_foundGo) + { + throw new NHibernate.Exceptions.SqlParseException(@"Incorrect syntax was encountered while parsing GO. Cannot have a slash star /* comment */ after a GO statement."); + } + base.ReadSlashStarComment(); + } + + protected override bool ReadNext() + { + if (EndOfLine) //End of line or script + { + if (!_foundGo) + { + _builder.Append(Current); + Splitter.Append(_builder.ToString()); + Splitter.SetParser(new SeparatorLineReader(Splitter)); + return false; + } + Reset(); + return true; + } + + if (WhiteSpace) + { + _builder.Append(Current); + return false; + } + + if (!CharEquals('g') && !CharEquals('o')) + { + FoundNonEmptyCharacter(Current); + return false; + } + + if (CharEquals('o')) + { + if (CharEquals('g', LastChar) && !_foundGo) + { + _foundGo = true; + } + else + { + FoundNonEmptyCharacter(Current); + } + } + + if (CharEquals('g', Current)) + { + if (_gFound || (!Char.IsWhiteSpace(LastChar) && LastChar != char.MinValue)) + { + FoundNonEmptyCharacter(Current); + return false; + } + + _gFound = true; + } + + if (!HasNext && _foundGo) + { + Reset(); + return true; + } + + _builder.Append(Current); + return false; + } + + void FoundNonEmptyCharacter(char c) + { + _builder.Append(c); + Splitter.Append(_builder.ToString()); + Splitter.SetParser(new SqlScriptReader(Splitter)); + } + } + + class SqlScriptReader : ScriptReader + { + public SqlScriptReader(ScriptSplitter splitter) + : base(splitter) + { + } + + protected override bool ReadNext() + { + if (EndOfLine) //end of line + { + Splitter.Append(Current); + Splitter.SetParser(new SeparatorLineReader(Splitter)); + return false; + } + + Splitter.Append(Current); + return false; + } + } +} Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs:4593-4594,4690-4691,4696-4697,4711,4715-4716 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Customer.cs:4593-4594,4690-4691,4696-4697,4711,4715-4716,4905-4908 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs:4593-4594,4690-4691,4696-4697,4711,4715-4716 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Fixture.cs:4593-4594,4690-4691,4696-4697,4711,4715-4716,4905-4908 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml:4593-4594,4690-4691,4696-4697,4711,4715-4716 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1850/Mappings.hbm.xml:4593-4594,4690-4691,4696-4697,4711,4715-4716,4905-4908 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs:4690-4691,4696-4697,4711,4715-4716 /trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Fixture.cs:4657 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Fixture.cs:4690-4691,4696-4697,4711,4715-4716,4905-4908 /trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Fixture.cs:4657 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml:4690-4691,4696-4697,4711,4715-4716 /trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Mappings.hbm.xml:4657 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Mappings.hbm.xml:4690-4691,4696-4697,4711,4715-4716,4905-4908 /trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Mappings.hbm.xml:4657 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs:4690-4691,4696-4697,4711,4715-4716 /trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Model.cs:4657 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs:4690-4691,4696-4697,4711,4715-4716,4905-4908 /trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Model.cs:4657 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1927 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1927:4691,4696-4697,4711,4715-4716 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1927:4691,4696-4697,4711,4715-4716,4905-4908 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1928 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1928:4690-4691,4696-4697,4711,4715-4716 + /branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1928:4690-4691,4696-4697,4711,4715-4716,4905-4908 Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using NHibernate; -using NHibernate.Engine; -using NHibernate.Mapping; - -namespace NHibernate.Test.NHSpecificTest.NH2055 -{ - public class AuxType : AbstractAuxiliaryDatabaseObject - { - - override public string SqlCreateString(Dialect.Dialect dialect, IMapping p, string defaultCatalog, string defaultSchema) - { - return "select '" + Parameters["scriptParameter"] + "'"; - } - - override public string SqlDropString(Dialect.Dialect dialect, string defaultCatalog, string defaultSchema) - { - return "select 'drop script'"; - } - - } -} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/AuxType.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using NHibernate; +using NHibernate.Engine; +using NHibernate.Mapping; + +namespace NHibernate.Test.NHSpecificTest.NH2055 +{ + public class AuxType : AbstractAuxiliaryDatabaseObject + { + + override public string SqlCreateString(Dialect.Dialect dialect, IMapping p, string defaultCatalog, string defaultSchema) + { + return "select '" + Parameters["scriptParameter"] + "'"; + } + + override public string SqlDropString(Dialect.Dialect dialect, string defaultCatalog, string defaultSchema) + { + return "select 'drop script'"; + } + + } +} \ No newline at end of file Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using NUnit.Framework; -using NHibernate.Tool.hbm2ddl; -using System.Text; -using NHibernate.Cfg; - -namespace NHibernate.Test.NHSpecificTest.NH2055 -{ - [TestFixture] - public class Fixture : BugTestCase - { - protected override bool AppliesTo(NHibernate.Dialect.Dialect dialect) - { - return (dialect is Dialect.MsSql2000Dialect); - } - - protected override void Configure(Configuration configuration) - { - base.Configure(configuration); - cfg = configuration; - } - - [Test] - public void CanCreateAndDropSchema() - { - using(var s = sessions.OpenSession()) - { - using(var cmd = s.Connection.CreateCommand()) - { - cmd.CommandType = CommandType.StoredProcedure; - - cmd.CommandText = "test_proc1"; - - Assert.AreEqual(1, cmd.ExecuteScalar()); - - cmd.CommandText = "test_proc2"; - - Assert.AreEqual(2, cmd.ExecuteScalar()); - } - } - } - - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Fixture.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Data; +using NUnit.Framework; +using NHibernate.Tool.hbm2ddl; +using System.Text; +using NHibernate.Cfg; + +namespace NHibernate.Test.NHSpecificTest.NH2055 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override bool AppliesTo(NHibernate.Dialect.Dialect dialect) + { + return (dialect is Dialect.MsSql2000Dialect); + } + + protected override void Configure(Configuration configuration) + { + base.Configure(configuration); + cfg = configuration; + } + + [Test] + public void CanCreateAndDropSchema() + { + using(var s = sessions.OpenSession()) + { + using(var cmd = s.Connection.CreateCommand()) + { + cmd.CommandType = CommandType.StoredProcedure; + + cmd.CommandText = "test_proc1"; + + Assert.AreEqual(1, cmd.ExecuteScalar()); + + cmd.CommandText = "test_proc2"; + + Assert.AreEqual(2, cmd.ExecuteScalar()); + } + } + } + + } +} Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml 2010-01-06 21:35:19 UTC (rev 4909) @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - assembly="NHibernate.Test" - namespace="NHibernate.Test.NHSpecificTest.NH2055"> - - <database-object> - <create> - CREATE PROC test_proc1 - AS - SELECT 1 - GO - CREATE PROC test_proc2 - AS - SELECT 2 - GO - </create> - <drop> - if (object_id('test_proc1') is not null ) - DROP PROC test_proc1 - GO - if (object_id('test_proc2') is not null ) - DROP PROC test_proc2 - GO - </drop> - </database-object> - -</hibernate-mapping> Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2055/Mappings.hbm.xml 2010-01-06 21:35:19 UTC (rev 4909) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH2055"> + + <database-object> + <create> + CREATE PROC test_proc1 + AS + SELECT 1 + GO + CREATE PROC test_proc2 + AS + SELECT 2 + GO + </create> + <drop> + if (object_id('test_proc1') is not null ) + DROP PROC test_proc1 + GO + if (object_id('test_proc2') is not null ) + DROP PROC test_proc2 + GO + </drop> + </database-object> + +</hibernate-mapping> Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Transactions; -using NHibernate.Impl; -using NUnit.Framework; -using NHibernate.Criterion; - -namespace NHibernate.Test.NHSpecificTest.NH2057 -{ - [TestFixture] - public class Fixture : BugTestCase - { - [Test] - public void WillCloseWhenUsingDTC() - { - SessionImpl s; - using (var tx = new TransactionScope()) - { - using (s = (SessionImpl)OpenSession()) - { - s.Get<Person>(1); - } - //not closed because the tx is opened yet - Assert.False(s.IsClosed); - tx.Complete(); - } - Assert.True(s.IsClosed); - } - - } -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Fixture.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Transactions; +using NHibernate.Impl; +using NUnit.Framework; +using NHibernate.Criterion; + +namespace NHibernate.Test.NHSpecificTest.NH2057 +{ + [TestFixture] + public class Fixture : BugTestCase + { + [Test] + public void WillCloseWhenUsingDTC() + { + SessionImpl s; + using (var tx = new TransactionScope()) + { + using (s = (SessionImpl)OpenSession()) + { + s.Get<Person>(1); + } + //not closed because the tx is opened yet + Assert.False(s.IsClosed); + tx.Complete(); + } + Assert.True(s.IsClosed); + } + + } +} Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml 2010-01-06 21:35:19 UTC (rev 4909) @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - assembly="NHibernate.Test" - namespace="NHibernate.Test.NHSpecificTest.NH2057"> - - <class name="Person"> - <id name="Id"> - <generator class="native" /> - </id> - <property name="Name"/> - </class> - -</hibernate-mapping> Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Mappings.hbm.xml 2010-01-06 21:35:19 UTC (rev 4909) @@ -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.NH2057"> + + <class name="Person"> + <id name="Id"> + <generator class="native" /> + </id> + <property name="Name"/> + </class> + +</hibernate-mapping> Deleted: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -1,19 +0,0 @@ -using System; -using System.Xml.Serialization; -using System.Collections; -using System.Collections.Generic; -using System.Text; - -using NHibernate; -using NHibernate.Classic; - -namespace NHibernate.Test.NHSpecificTest.NH2057 -{ - - public class Person - { - public virtual int Id { get; set; } - public virtual string Name { get; set; } - } - -} Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs (from rev 4908, branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2057/Model.cs 2010-01-06 21:35:19 UTC (rev 4909) @@ -0,0 +1,19 @@ +using System; +using System.Xml.Serialization; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +using NHibernate; +using NHibernate.Classic; + +namespace NHibernate.Test.NHSpecificTest.NH2057 +{ + + public class Person + { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + } + +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-01-06 21:05:51 UTC (rev 4908) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-01-06 21:35:19 UTC (rev 4909) @@ -658,6 +658,10 @@ <Compile Include="NHSpecificTest\NH1938\Model.cs" /> <Compile Include="NHSpecificTest\NH1939\AuxType.cs" /> <Compile Include="NHSpecificTest\NH1939\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2055\AuxType.cs" /> + <Compile Include="NHSpecificTest\NH2055\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2057\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2057\Model.cs" /> <Compile Include="NHSpecificTest\NH1941\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1941\Model.cs" /> <Compile Include="NHSpecificTest\NH1941\SexEnumStringType.cs" /> @@ -2096,6 +2100,8 @@ <Content Include="DynamicEntity\package.html" /> <EmbeddedResource Include="NHSpecificTest\NH2030\Mappings.hbm.xml" /> <EmbeddedResource Include="Linq\Mappings\Patient.hbm.xml" /> + <EmbeddedResource Include="NHSpecificTest\NH2055\Mappings.hbm.xml" /> + <EmbeddedResource Include="NHSpecificTest\NH2057\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2011\Mappings.hbm.xml" /> <EmbeddedResource Include="Linq\Mappings\Animal.hbm.xml" /> <EmbeddedResource Include="Linq\Mappings\AnotherEntity.hbm.xml" /> Property changes on: trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests ___________________________________________________________________ Modified: svn:mergeinfo - /branches/2.1.x/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests:4507-4508,4510-4513,4537-4538,4593-4594,4690-4691,4696-4697,4711,4715-4716 + /branches/2.1.x/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests:4507-4508,4510-4513,4537-4538,4593-4594,4690-4691,4696-4697,4711,4715-4716,4905-4908 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2010-01-24 16:47:04
|
Revision: 4923 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4923&view=rev Author: ayenderahien Date: 2010-01-24 16:46:51 +0000 (Sun, 24 Jan 2010) Log Message: ----------- Implementing lazy properties * Removing ignore from the lazy property fixture * Adding LazyFieldInterceptor impl for Castle. Adding IFieldInterceptorAccessor to allow setting the field interceptor Adding convenience methods to detect property invocations * Adding DefaultFieldInterceptor - since we don't need one tied to the actual field interception impl * Removing temporary #region * Detecting usage of non collection lazy properties in entity meta model and considering this for instrumented fields * Implementing FieldInterceptionHelper Delegating responsibility for detecting interception to the proxy factory * Adding support for detecting lazy properties in the mapping * Simplifying code * Removed overly complex code * Binding properties laziness * Adding the ability to create field interception proxy to proxy factories. * Will create field interception proxy when needed LazyPropertyFixture basic test now works * Fixing off by one error * Adding more tests to verify lazy properties actually work * Implementing empty impl of the new field interception capabilities to other proxy factories impl * Updating loaded sln projects Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/PropertiesBinder.cs trunk/nhibernate/src/NHibernate/Intercept/AbstractFieldInterceptor.cs trunk/nhibernate/src/NHibernate/Intercept/FieldInterceptionHelper.cs trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptor.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs trunk/nhibernate/src/NHibernate/Proxy/AbstractProxyFactory.cs trunk/nhibernate/src/NHibernate/Proxy/IProxyFactory.cs trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/EntityMetamodel.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs trunk/nhibernate/src/NHibernate/Tuple/PocoInstantiator.cs trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ProxyInterface/CustomProxyFixture.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.Test/Bytecode/WrongProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.Test/LazyProperty/LazyPropertyFixture.cs trunk/nhibernate/src/NHibernate.Test/LazyProperty/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SetFixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.sln Added Paths: ----------- trunk/nhibernate/src/NHibernate/Intercept/DefaultFieldInterceptor.cs trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptorAccessor.cs trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyFieldInterceptor.cs Modified: trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -36,5 +36,7 @@ */ IProxyValidator ProxyValidator { get; } + + bool IsInstrumented(System.Type entityClass); } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -22,6 +22,11 @@ get { return optimisticlock; } } + public bool IsLazyProperty + { + get { return lazy; } + } + #endregion #region Overrides of AbstractDecoratable Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -16,6 +16,11 @@ get { return access; } } + public bool IsLazyProperty + { + get { return false; } + } + public bool OptimisticLock { get { return optimisticlock; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -17,6 +17,11 @@ get { return access; } } + public bool IsLazyProperty + { + get { return false; } + } + public bool OptimisticLock { get { return optimisticlock; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -23,6 +23,11 @@ get { return node; } } + public bool IsLazyProperty + { + get { return lazy; } + } + public string Name { get { return name; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -18,6 +18,11 @@ get { return null; } } + public bool IsLazyProperty + { + get { return false; } + } + public string EmbeddedNode { get { return node; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -16,6 +16,11 @@ get { return access; } } + public bool IsLazyProperty + { + get { return false; } + } + public bool OptimisticLock { get { return optimisticlock; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -70,6 +70,11 @@ get { return name; } } + public bool IsLazyProperty + { + get { return false; } + } + public string Access { get { return access; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -56,6 +56,11 @@ get { return name; } } + public bool IsLazyProperty + { + get { return false; } + } + public string Access { get { return access; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -21,6 +21,11 @@ get { return optimisticlock; } } + public bool IsLazyProperty + { + get { return false; } + } + #endregion #region Implementation of IReferencePropertyMapping Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -18,6 +18,11 @@ get { return access; } } + public bool IsLazyProperty + { + get { return false; } + } + public bool OptimisticLock { get { return optimisticlock; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -16,6 +16,11 @@ get { return access; } } + public bool IsLazyProperty + { + get { return false; } + } + public bool OptimisticLock { get { return optimisticlock; } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -56,5 +56,10 @@ } #endregion + + public bool IsLazyProperty + { + get { return false; } + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -76,5 +76,10 @@ { get { return lazySpecified ? lazy : (HbmLaziness?)null; } } + + public bool IsLazyProperty + { + get { return Lazy == HbmLaziness.Proxy; } + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -21,6 +21,11 @@ get { return optimisticlock; } } + public bool IsLazyProperty + { + get { return false; } + } + #endregion #region Implementation of IReferencePropertyMapping Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -13,6 +13,11 @@ get { return name; } } + public bool IsLazyProperty + { + get { return lazy; } + } + public string Access { get { return access; } @@ -62,7 +67,7 @@ unique = unique, uniqueSpecified = true, uniquekey = uniquekey, - index = index + index = index, }; } } Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -22,6 +22,11 @@ get { return optimisticlock; } } + public bool IsLazyProperty + { + get { return false; } + } + #endregion #region Implementation of IReferencePropertyMapping Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -5,5 +5,6 @@ string Name { get; } string Access { get; } bool OptimisticLock { get; } + bool IsLazyProperty { get; } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/PropertiesBinder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/PropertiesBinder.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/PropertiesBinder.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -362,6 +362,7 @@ Name = propertyMapping.Name, PropertyAccessorName = propertyAccessorName, Value = value, + IsLazy = propertyMapping.IsLazyProperty, IsOptimisticLocked = propertyMapping.OptimisticLock, MetaAttributes = GetMetas(propertyMapping, inheritedMetas) }; Modified: trunk/nhibernate/src/NHibernate/Intercept/AbstractFieldInterceptor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Intercept/AbstractFieldInterceptor.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Intercept/AbstractFieldInterceptor.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -7,6 +7,8 @@ [Serializable] public abstract class AbstractFieldInterceptor : IFieldInterceptor { + public static readonly object InvokeImplementation = new object(); + [NonSerialized] private ISessionImplementor session; private ISet<string> uninitializedFields; @@ -72,41 +74,34 @@ get { return initializing; } } - protected internal object Intercept(object target, string fieldName, object value) + public object Intercept(object target, string fieldName) { - if (initializing) + if (initializing || + uninitializedFields == null || + !uninitializedFields.Contains(fieldName)) + return InvokeImplementation; + + if (session == null) { - return value; + throw new LazyInitializationException("entity with lazy properties is not associated with a session"); } - - if (uninitializedFields != null && uninitializedFields.Contains(fieldName)) + if (!session.IsOpen || !session.IsConnected) { - if (session == null) - { - throw new LazyInitializationException("entity with lazy properties is not associated with a session"); - } - else if (!session.IsOpen || !session.IsConnected) - { - throw new LazyInitializationException("session is not connected"); - } + throw new LazyInitializationException("session is not connected"); + } - object result; - initializing = true; - try - { - result = ((ILazyPropertyInitializer)session.Factory.GetEntityPersister(entityName)).InitializeLazyProperty(fieldName, target, session); - } - finally - { - initializing = false; - } - uninitializedFields = null; //let's assume that there is only one lazy fetch group, for now! - return result; + object result; + initializing = true; + try + { + result = ((ILazyPropertyInitializer)session.Factory.GetEntityPersister(entityName)).InitializeLazyProperty(fieldName, target, session); } - else + finally { - return value; + initializing = false; } + uninitializedFields = null; //let's assume that there is only one lazy fetch group, for now! + return result; } } } Added: trunk/nhibernate/src/NHibernate/Intercept/DefaultFieldInterceptor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Intercept/DefaultFieldInterceptor.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Intercept/DefaultFieldInterceptor.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -0,0 +1,13 @@ +using Iesi.Collections.Generic; +using NHibernate.Engine; + +namespace NHibernate.Intercept +{ + public class DefaultFieldInterceptor : AbstractFieldInterceptor + { + public DefaultFieldInterceptor(ISessionImplementor session, ISet<string> uninitializedFields, string entityName) + : base(session, uninitializedFields, entityName) + { + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Intercept/FieldInterceptionHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Intercept/FieldInterceptionHelper.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Intercept/FieldInterceptionHelper.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -7,44 +7,44 @@ public static class FieldInterceptionHelper { // VERY IMPORTANT!!!! - This class needs to be free of any static references - // to any Castle classes. Otherwise, users will always need both + // to any Castle/Spring/LinFu classes. Otherwise, users will always need both // on their classpaths no matter which (if either) they use. // // Another option here would be to remove the Hibernate.isPropertyInitialized() // method and have the users go through the SessionFactory to get this information. - - + public static bool IsInstrumented(System.Type entityClass) { - // TODO : Here code - return false; + // NH Specific: + // unlike Hibernate, NHibernate assumes that any class is valid for interception + // because we don't try to handle field interception + return Cfg.Environment.BytecodeProvider.ProxyFactoryFactory.IsInstrumented(entityClass); } - + public static bool IsInstrumented(object entity) { - return entity != null && IsInstrumented(entity.GetType()); + return entity is IFieldInterceptorAccessor; } - + public static IFieldInterceptor ExtractFieldInterceptor(object entity) { - if (entity == null) - { - return null; - } - // TODO : Here code to extract the Field Interceptor - return null; + var fieldInterceptorAccessor = entity as IFieldInterceptorAccessor; + return fieldInterceptorAccessor == null ? null : fieldInterceptorAccessor.FieldInterceptor; } - + public static IFieldInterceptor InjectFieldInterceptor(object entity, string entityName, ISet<string> uninitializedFieldNames, ISessionImplementor session) { - if (entity != null) + var fieldInterceptorAccessor = entity as IFieldInterceptorAccessor; + if (fieldInterceptorAccessor != null) { - // TODO : Here code to inject the Field Interceptor + var fieldInterceptorImpl = new DefaultFieldInterceptor(session, uninitializedFieldNames, entityName); + fieldInterceptorAccessor.FieldInterceptor = fieldInterceptorImpl; + return fieldInterceptorImpl; } return null; } - - public static void ClearDirty(object entity) + + public static void ClearDirty(object entity) { IFieldInterceptor interceptor = ExtractFieldInterceptor(entity); if (interceptor != null) @@ -52,8 +52,8 @@ interceptor.ClearDirty(); } } - - public static void MarkDirty(object entity) + + public static void MarkDirty(object entity) { IFieldInterceptor interceptor = ExtractFieldInterceptor(entity); if (interceptor != null) Modified: trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptor.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptor.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -26,5 +26,8 @@ /// <summary> Clear the internal dirty flag.</summary> void ClearDirty(); + + /// <summary> Intercept field set/get </summary> + object Intercept(object target, string fieldName); } } \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptorAccessor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptorAccessor.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Intercept/IFieldInterceptorAccessor.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -0,0 +1,7 @@ +namespace NHibernate.Intercept +{ + public interface IFieldInterceptorAccessor + { + IFieldInterceptor FieldInterceptor { get; set; } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-01-24 16:46:51 UTC (rev 4923) @@ -640,6 +640,8 @@ <Compile Include="Hql\Ast\ANTLR\Tree\UpdateStatement.cs" /> <Compile Include="Hql\Ast\HqlTreeBuilder.cs" /> <Compile Include="Hql\Ast\HqlTreeNode.cs" /> + <Compile Include="Intercept\DefaultFieldInterceptor.cs" /> + <Compile Include="Intercept\IFieldInterceptorAccessor.cs" /> <Compile Include="IQueryExpression.cs" /> <Compile Include="IQueryOver.cs" /> <Compile Include="Criterion\QueryOver.cs" /> Modified: trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -1245,7 +1245,7 @@ // are shared PK one-to-one associations which are // handled differently in the Type#nullSafeGet code... ps = session.Batcher.PrepareCommand(CommandType.Text, lazySelect, IdentifierType.SqlTypes(Factory)); - IdentifierType.NullSafeSet(ps, id, 1, session); + IdentifierType.NullSafeSet(ps, id, 0, session); rs = session.Batcher.ExecuteReader(ps); rs.Read(); } Modified: trunk/nhibernate/src/NHibernate/Proxy/AbstractProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/AbstractProxyFactory.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Proxy/AbstractProxyFactory.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -1,3 +1,4 @@ +using System; using System.Reflection; using Iesi.Collections.Generic; using NHibernate.Engine; @@ -42,5 +43,10 @@ public abstract INHibernateProxy GetProxy(object id, ISessionImplementor session); + + public virtual object GetFieldInterceptionProxy() + { + throw new NotSupportedException(); + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Proxy/IProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/IProxyFactory.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Proxy/IProxyFactory.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -5,48 +5,50 @@ namespace NHibernate.Proxy { - /// <summary> Contract for run-time, proxy-based lazy initialization proxies. </summary> - public interface IProxyFactory - { - /// <summary> Called immediately after instantiation of this factory. </summary> - /// <param name="entityName"> - /// The name of the entity for which this factory should generate proxies. - /// </param> - /// <param name="persistentClass"> - /// The entity class for which to generate proxies; not always the same as the entityName. - /// </param> - /// <param name="interfaces"> - /// The interfaces to expose in the generated proxy; - /// <see cref="INHibernateProxy"/> is already included in this collection. - /// </param> - /// <param name="getIdentifierMethod"> - /// Reference to the identifier getter method; invocation on this method should not force initialization - /// </param> - /// <param name="setIdentifierMethod"> - /// Reference to the identifier setter method; invocation on this method should not force initialization - /// </param> - /// <param name="componentIdType"> - /// For composite identifier types, a reference to - /// the <see cref="ComponentType">type</see> of the identifier - /// property; again accessing the id should generally not cause - /// initialization - but need to bear in mind key-many-to-one - /// mappings. - /// </param> - /// <exception cref="HibernateException"> Indicates a problem completing post </exception> - /// <remarks> - /// Essentially equivalent to constructor injection, but contracted - /// here via interface. - /// </remarks> - void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces, - MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType); + /// <summary> Contract for run-time, proxy-based lazy initialization proxies. </summary> + public interface IProxyFactory + { + /// <summary> Called immediately after instantiation of this factory. </summary> + /// <param name="entityName"> + /// The name of the entity for which this factory should generate proxies. + /// </param> + /// <param name="persistentClass"> + /// The entity class for which to generate proxies; not always the same as the entityName. + /// </param> + /// <param name="interfaces"> + /// The interfaces to expose in the generated proxy; + /// <see cref="INHibernateProxy"/> is already included in this collection. + /// </param> + /// <param name="getIdentifierMethod"> + /// Reference to the identifier getter method; invocation on this method should not force initialization + /// </param> + /// <param name="setIdentifierMethod"> + /// Reference to the identifier setter method; invocation on this method should not force initialization + /// </param> + /// <param name="componentIdType"> + /// For composite identifier types, a reference to + /// the <see cref="ComponentType">type</see> of the identifier + /// property; again accessing the id should generally not cause + /// initialization - but need to bear in mind key-many-to-one + /// mappings. + /// </param> + /// <exception cref="HibernateException"> Indicates a problem completing post </exception> + /// <remarks> + /// Essentially equivalent to constructor injection, but contracted + /// here via interface. + /// </remarks> + void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces, + MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType); - /// <summary> - /// Create a new proxy - /// </summary> - /// <param name="id">The id value for the proxy to be generated.</param> - /// <param name="session">The session to which the generated proxy will be associated.</param> - /// <returns>The generated proxy.</returns> - /// <exception cref="HibernateException">Indicates problems generating requested proxy.</exception> - INHibernateProxy GetProxy(object id, ISessionImplementor session); - } + /// <summary> + /// Create a new proxy + /// </summary> + /// <param name="id">The id value for the proxy to be generated.</param> + /// <param name="session">The session to which the generated proxy will be associated.</param> + /// <returns>The generated proxy.</returns> + /// <exception cref="HibernateException">Indicates problems generating requested proxy.</exception> + INHibernateProxy GetProxy(object id, ISessionImplementor session); + + object GetFieldInterceptionProxy(); + } } Modified: trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -1,3 +1,4 @@ +using System; using System.Reflection; using Iesi.Collections.Generic; using NHibernate.Engine; @@ -23,6 +24,11 @@ return new MapProxy(new MapLazyInitializer(entityName, id, session)); } + public object GetFieldInterceptionProxy() + { + throw new NotSupportedException(); + } + #endregion } } Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/EntityMetamodel.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/EntityMetamodel.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/EntityMetamodel.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -35,8 +35,6 @@ private readonly StandardProperty[] properties; - #region temporary - private readonly string[] propertyNames; private readonly IType[] propertyTypes; private readonly bool[] propertyLaziness; @@ -50,13 +48,12 @@ private readonly bool[] propertyVersionability; private readonly CascadeStyle[] cascadeStyles; - #endregion - private readonly IDictionary<string, int?> propertyIndexes = new Dictionary<string, int?>(); private readonly bool hasCollections; private readonly bool hasMutableProperties; private readonly bool hasLazyProperties; + private readonly int[] naturalIdPropertyNumbers; private bool lazy; @@ -106,8 +103,6 @@ properties = new StandardProperty[propertySpan]; List<int> naturalIdNumbers = new List<int>(); - #region temporary - propertyNames = new string[propertySpan]; propertyTypes = new IType[propertySpan]; propertyUpdateability = new bool[propertySpan]; @@ -121,9 +116,6 @@ propertyLaziness = new bool[propertySpan]; cascadeStyles = new CascadeStyle[propertySpan]; - #endregion - - int i = 0; int tempVersionProperty = NoVersionIndex; bool foundCascade = false; @@ -155,11 +147,11 @@ foundNonIdentifierPropertyNamedId = true; } - #region temporary - bool lazyProperty = prop.IsLazy && lazyAvailable; if (lazyProperty) + { hasLazy = true; + } propertyLaziness[i] = lazyProperty; propertyNames[i] = properties[i].Name; @@ -178,8 +170,6 @@ cascadeStyles[i] = properties[i].CascadeStyle; - #endregion - if (properties[i].IsLazy) { hasLazy = true; @@ -226,10 +216,22 @@ versionPropertyIndex = tempVersionProperty; hasLazyProperties = hasLazy; - if (hasLazyProperties) log.Info("lazy property fetching available for: " + name); - lazy = persistentClass.IsLazy && (!persistentClass.HasPocoRepresentation || !ReflectHelper.IsFinalClass(persistentClass.ProxyInterface)); + + if (hasLazy) + { + if (lazy == false) + { + log.WarnFormat("Disabled lazy properies fetching for {0} beacuse it does not support lazy at the entity level", name); + hasLazyProperties = false; + } + else + { + log.Info("lazy property fetching available for: " + name); + } + } + mutable = persistentClass.IsMutable; if (!persistentClass.IsAbstract.HasValue) Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -74,7 +74,11 @@ public override bool IsInstrumented { - get { return FieldInterceptionHelper.IsInstrumented(MappedClass); } + get { + return + EntityMetamodel.HasLazyProperties && + FieldInterceptionHelper.IsInstrumented(MappedClass); + } } public override System.Type MappedClass @@ -97,12 +101,12 @@ if (optimizer == null) { log.Debug("Create Instantiator without optimizer for:" + persistentClass.MappedClass.FullName); - return new PocoInstantiator(persistentClass, null); + return new PocoInstantiator(persistentClass, null, ProxyFactory, EntityMetamodel.HasLazyProperties); } else { log.Debug("Create Instantiator using optimizer for:" + persistentClass.MappedClass.FullName); - return new PocoInstantiator(persistentClass, optimizer.InstantiationOptimizer); + return new PocoInstantiator(persistentClass, optimizer.InstantiationOptimizer, ProxyFactory, EntityMetamodel.HasLazyProperties); } } Modified: trunk/nhibernate/src/NHibernate/Tuple/PocoInstantiator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/PocoInstantiator.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Tuple/PocoInstantiator.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -4,6 +4,7 @@ using log4net; using NHibernate.Bytecode; using NHibernate.Mapping; +using NHibernate.Proxy; using NHibernate.Util; namespace NHibernate.Tuple @@ -19,6 +20,10 @@ [NonSerialized] private readonly IInstantiationOptimizer optimizer; + private readonly IProxyFactory proxyFactory; + + private readonly bool hasLazyProperties; + private readonly bool embeddedIdentifier; [NonSerialized] @@ -49,12 +54,14 @@ } } - public PocoInstantiator(PersistentClass persistentClass, IInstantiationOptimizer optimizer) + public PocoInstantiator(PersistentClass persistentClass, IInstantiationOptimizer optimizer, IProxyFactory proxyFactory, bool hasLazyProperties) { mappedClass = persistentClass.MappedClass; proxyInterface = persistentClass.ProxyInterface; embeddedIdentifier = persistentClass.HasEmbeddedIdentifier; this.optimizer = optimizer; + this.proxyFactory = proxyFactory; + this.hasLazyProperties = hasLazyProperties; try { @@ -81,29 +88,30 @@ { throw new InstantiationException("Cannot instantiate abstract class or interface: ", mappedClass); } - else if (optimizer != null) + if (hasLazyProperties) { + return proxyFactory.GetFieldInterceptionProxy(); + } + if (optimizer != null) + { return optimizer.CreateInstance(); } - else if (mappedClass.IsValueType) + if (mappedClass.IsValueType) { return Cfg.Environment.BytecodeProvider.ObjectsFactory.CreateInstance(mappedClass, true); } - else if (constructor == null) + if (constructor == null) { throw new InstantiationException("No default constructor for entity: ", mappedClass); } - else + try { - try - { - return constructor.Invoke(null); - } - catch (Exception e) - { - throw new InstantiationException("Could not instantiate entity: ", e, mappedClass); - } + return constructor.Invoke(null); } + catch (Exception e) + { + throw new InstantiationException("Could not instantiate entity: ", e, mappedClass); + } } public bool IsInstance(object obj) Modified: trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs 2010-01-22 14:04:02 UTC (rev 4922) +++ trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs 2010-01-24 16:46:51 UTC (rev 4923) @@ -9,613 +9,628 @@ namespace NHibernate.Util { - /// <summary> - /// Helper class for Reflection related code. - /// </summary> - public static class ReflectHelper - { - private static readonly ILog log = LogManager.GetLogger(typeof(ReflectHelper)); + /// <summary> + /// Helper class for Reflection related code. + /// </summary> + public static class ReflectHelper + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReflectHelper)); - public const BindingFlags AnyVisibilityInstance = BindingFlags.Instance | BindingFlags.Public | - BindingFlags.NonPublic; + public const BindingFlags AnyVisibilityInstance = BindingFlags.Instance | BindingFlags.Public | + BindingFlags.NonPublic; - private static readonly System.Type[] NoClasses = System.Type.EmptyTypes; + private static readonly System.Type[] NoClasses = System.Type.EmptyTypes; - private static readonly MethodInfo Exception_InternalPreserveStackTrace = - typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly MethodInfo Exception_InternalPreserveStackTrace = + typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); - /// <summary> - /// Determine if the specified <see cref="System.Type"/> overrides the - /// implementation of Equals from <see cref="Object"/> - /// </summary> - /// <param name="clazz">The <see cref="System.Type"/> to reflect.</param> - /// <returns><see langword="true" /> if any type in the hierarchy overrides Equals(object).</returns> - public static bool OverridesEquals(System.Type clazz) - { - return OverrideMethod(clazz, "Equals", new[] { typeof(object) }); - } + /// <summary> + /// Determine if the specified <see cref="System.Type"/> overrides the + /// implementation of Equals from <see cref="Object"/> + /// </summary> + /// <param name="clazz">The <see cref="System.Type"/> to reflect.</param> + /// <returns><see langword="true" /> if any type in the hierarchy overrides Equals(object).</returns> + public static bool OverridesEquals(System.Type clazz) + { + return OverrideMethod(clazz, "Equals", new[] { typeof(object) }); + } - private static bool OverrideMethod(System.Type clazz, string methodName, System.Type[] parametersTypes) - { - try - { - MethodInfo method = !clazz.IsInterface - ? clazz.GetMethod(methodName, parametersTypes) - : GetMethodFromInterface(clazz, methodName, parametersTypes); - if (method == null) - { - return false; - } - else - { - // make sure that the DeclaringType is not System.Object - if that is the - // declaring type then there is no override. - return !method.DeclaringType.Equals(typeof(object)); - } - } - catch (AmbiguousMatchException) - { - // an ambigious match means that there is an override and it - // can't determine which one to use. - return true; - } - } + private static bool OverrideMethod(System.Type clazz, string methodName, System.Type[] parametersTypes) + { + try + { + MethodInfo method = !clazz.IsInterface + ? clazz.GetMethod(methodName, parametersTypes) + : GetMethodFromInterface(clazz, methodName, parametersTypes); + if (method == null) + { + return false; + } + else + { + // make sure that the DeclaringType is not System.Object - if that is the + // declaring type then there is no override. + return !method.DeclaringType.Equals(typeof(object)); + } + } + catch (AmbiguousMatchException) + { + // an ambigious match means that there is an override and it + // can't determine which one to use. + return true; + } + } - private static MethodInfo GetMethodFromInterface(System.Type type, string methodName, System.Type[] parametersTypes) - { - const BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly; - if(type == null) - { - return null; - } - MethodInfo method = type.GetMethod(methodName, flags, null, parametersTypes, null); - if (method == null) - { - System.Type[] interfaces = type.GetInterfaces(); - foreach (var @interface in interfaces) - { - method = GetMethodFromInterface(@interface, methodName, parametersTypes); - if(method != null) - { - return method; - } - } - } - return method; - } + private static MethodInfo GetMethodFromInterface(System.Type type, string methodName, System.Type[] parametersTypes) + { + const BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly; + if (type == null) + { + return null; + } + MethodInfo method = type.GetMethod(methodName, flags, null, parametersTypes, null); + if (method == null) + { + System.Type[] interfaces = type.GetInterfaces(); + foreach (var @interface in interfaces) + { + method = GetMethodFromInterface(@interface, methodName, parametersTypes); + if (method != null) + { + return method; + } + } + } + return method; + } - /// <summary> - /// Determine if the specified <see cref="System.Type"/> overrides the - /// implementation of GetHashCode from <see cref="Object"/> - /// </summary> - /// <param name="clazz">The <see cref="System.Type"/> to reflect.</param> - /// <returns><see langword="true" /> if any type in the hierarchy overrides GetHashCode().</returns> - public static bool OverridesGetHashCode(System.Type clazz) - { - return OverrideMethod(clazz, "GetHashCode", System.Type.EmptyTypes); - } + /// <summary> + /// Determine if the specified <see cref="System.Type"/> overrides the + /// implementation of GetHashCode from <see cref="Object"/> + /// </summary> + /// <param name="clazz">The <see cref="System.Type"/> to reflect.</param> + /// <returns><see langword="true" /> if any type in the hierarchy overrides GetHashCode().</returns> + public static bool OverridesGetHashCode(System.Type clazz) + { + return OverrideMethod(clazz, "GetHashCode", System.Type.EmptyTypes); + } - /// <summary> - /// Finds the <see cref="IGetter"/> for the property in the <see cref="System.Type"/>. - /// </summary> - /// <param name="theClass">The <see cref="System.Type"/> to find the property in.</param> - /// <param name="propertyName">The name of the Property to find.</param> - /// <param name="propertyAccessorName">The name of the property access strategy.</param> - /// <returns>The <see cref="IGetter"/> to get the value of the Property.</returns> - /// <remarks> - /// This one takes a propertyAccessor name as we might know the correct strategy by now so we avoid Exceptions which are costly - /// </remarks> - public static IGetter GetGetter(System.Type theClass, string propertyName, string propertyAccessorName) - { - return PropertyAccessorFactory - .GetPropertyAccessor(propertyAccessorName) - .GetGetter(theClass, propertyName); - } + /// <summary> + /// Finds the <see cref="IGetter"/> for the property in the <see cref="System.Type"/>. + /// </summary> + /// <param name="theClass">The <see cref="System.Type"/> to find the property in.</param> + /// <param name="propertyName">The name of the Property to find.</param> + /// <param name="propertyAccessorName">The name of the property access strategy.</param> + /// <returns>The <see cref="IGetter"/> to get the value of the Property.</returns> + /// <remarks> + /// This one takes a propertyAccessor name as we might know the correct strategy by now so we avoid Exceptions which are costly + /// </remarks> + public static IGetter GetGetter(System.Type theClass, string propertyName, string propertyAccessorName) + { + return PropertyAccessorFactory + .GetPropertyAccessor(propertyAccessorName) + .GetGetter(theClass, propertyName); + } - /// <summary> - /// Get the NHibernate <see cref="IType" /> for the named property of the <see cref="System.Type"/>. - /// </summary> - /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> - /// <param name="name">The name of the property/field to find in the class.</param> - /// <param name="access">The name of the property accessor for the property.</param> - /// <returns> - /// The NHibernate <see cref="IType"/> for the named property. - /// </returns> - public static IType ReflectedPropertyType(System.Type theClass, string name, string access) - { - System.Type propertyClass = ReflectedPropertyClass(theClass, name, access); + /// <summary> + /// Get the NHibernate <see cref="IType" /> for the named property of the <see cref="System.Type"/>. + /// </summary> + /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> + /// <param name="name">The name of the property/field to find in the class.</param> + /// <param name="access">The name of the property accessor for the property.</param> + /// <returns> + /// The NHibernate <see cref="IType"/> for the named property. + /// </returns> + public static IType ReflectedPropertyType(System.Type theClass, string name, string access) + { + System.Type propertyClass = ReflectedPropertyClass(theClass, name, access); - System.Type heuristicClass = propertyClass; + System.Type heuristicClass = propertyClass; - if (propertyClass.IsGenericType - && propertyClass.GetGenericTypeDefinition().Equals(typeof(Nullable<>))) - { - heuristicClass = propertyClass.GetGenericArguments()[0]; - } + if (propertyClass.IsGenericType + && propertyClass.GetGenericTypeDefinition().Equals(typeof(Nullable<>))) + { + heuristicClass = propertyClass.GetGenericArguments()[0]; + } - return TypeFactory.HeuristicType(heuristicClass.AssemblyQualifiedName); - } + return TypeFactory.HeuristicType(heuristicClass.AssemblyQualifiedName); + } - /// <summary> - /// Get the <see cref="System.Type" /> for the named property of a type. - /// </summary> - /// <param name="theClass">The <see cref="System.Type"/> to find the property in.</param> - /// <param name="name">The name of the property/field to find in the class.</param> - /// <param name="access">The name of the property accessor for the property.</param> - /// <returns>The <see cref="System.Type" /> for the named property.</returns> - public static System.Type ReflectedPropertyClass(System.Type theClass, string name, string access) - { - return GetGetter(theClass, name, access).ReturnType; - } + /// <summary> + /// Get the <see cref="System.Type" /> for the named property of a type. + /// </summary> + /// <param name="theClass">The <see cref="System.Type"/> to find the property in.</param> + /// <param name="name">The name of the property/field to find in the class.</param> + /// <param name="access">The name of the property accessor for the property.</param> + /// <returns>The <see cref="System.Type" /> for the named property.</returns> + public static System.Type ReflectedPropertyClass(System.Type theClass, string name, string access) + { + return GetGetter(theClass, name, access).ReturnType; + } - /// <summary> - /// Get the <see cref="System.Type" /> for the named property of a type. - /// </summary> - /// <param name="className">The FullName to find the property in.</param> - /// <param name="name">The name of the property/field to find in the class.</param> - /// <param name="accessorName">The name of the property accessor for the property.</param> - /// <returns>The <see cref="System.Type" /> for the named property.</returns> - public static System.Type ReflectedPropertyClass(string className, string name, string accessorName) - { - try - { - System.Type clazz = ClassForName(className); - return GetGetter(clazz, name, accessorName).ReturnType; - } - catch (Exception cnfe) - { - throw new MappingException(string.Format("class {0} not found while looking for property: {1}", className, name), cnfe); - } - } + /// <summary> + /// Get the <see cref="System.Type" /> for the named property of a type. + /// </summary> + /// <param name="className">The FullName to find the property in.</param> + /// <param name="name">The name of the property/field to find in the class.</param> + /// <param name="accessorName">The name of the property accessor for the property.</param> + /// <returns>The <see cref="System.Type" /> for the named property.</returns> + public static System.Type ReflectedPropertyClass(string className, string name, string accessorName) + { + try + { + System.Type clazz = ClassForName(className); + return GetGetter(clazz, name, accessorName).ReturnType; + } + catch (Exception cnfe) + { + throw new MappingException(string.Format("class {0} not found while looking for property: {1}", className, name), cnfe); + } + } - /// <summary> - /// Returns a reference to the Type. - /// </summary> - /// <param name="name">The name of the class or a fully qualified name.</param> - /// <returns>The Type for the Class.</returns> - public static System.Type ClassForName(string name) - { - AssemblyQualifiedTypeName parsedName = TypeNameParser.Parse(name); - System.Type result = TypeFromAssembly(parsedName, true); - return result; - } + /// <summary> + /// Returns a reference to the Type. + /// </summary> + /// <param name="name">The name of the class or a fully qualified name.</param> + /// <returns>The Type for the Class.</returns> + public static System.Type ClassForName(string name) + { + AssemblyQualifiedTypeName parsedName = TypeNameParser.Parse(name); + System.Type result = TypeFromAssembly(parsedName, true); + return result; + } - /// <summary> - /// Load a System.Type given is't name. - /// </summary> - /// <param name="classFullName">The class FullName or AssemblyQualifiedName</param> - /// <returns>The System.Type</returns> - /// <remarks> - /// If the <paramref name="classFullName"/> don't represent an <see cref="System.Type.AssemblyQualifiedName"/> - /// the method try to find the System.Type scanning all Assemblies of the <see cref="AppDomain.CurrentDomain"/>. - /// </remarks> - /// <exception cref="TypeLoadException">If no System.Type was found for <paramref name="classFullName"/>.</exception> - public static System.Type ClassForFullName(string classFullName) - { - System.Type result = null; - AssemblyQualifiedTypeName parsedName = TypeNameParser.Parse(classFullName); - if (!string.IsNullOrEmpty(parsedName.Assembly)) - { - result = TypeFromAssembly(parsedName, false); - } - else - { - if (!string.IsNullOrEmpty(classFullName)) - { - Assembly[] ass = AppDomain.CurrentDomain.GetAssemblies(); - foreach (Assembly a in ass) - { - result = a.GetType(classFullName, false, false); - if (result != null) - break; //<<<<<================ - } - } - } - if (result == null) - { - string message = "Could not load type " + classFullName + ". Possible cause: the assembly was not loaded or not specified."; - throw new TypeLoadException(message); - } + /// <summary> + /// Load a System.Type given is't name. + /// </summary> + /// <param name="classFullName">The class FullName or AssemblyQualifiedName</param> + /// <returns>The System.Type</returns> + /// <remarks> + /// If the <paramref name="classFullName"/> don't represent an <see cref="System.Type.AssemblyQualifiedName"/> + /// the method try to find the System.Type scanning all Assemblies of the <see cref="AppDomain.CurrentDomain"/>. + /// </remarks> + /// <exception cref="TypeLoadException">If no System.Type was found for <paramref name="classFullName"/>.</exception> + public static System.Type ClassForFullName(string classFullName) + { + System.Type result = null; + AssemblyQualifiedTypeName parsedName = TypeNameParser.Parse(classFullName); + if (!string.IsNullOrEmpty(parsedName.Assembly)) + { + result = TypeFromAssembly(parsedName, false); + } + else + { + if (!string.IsNullOrEmpty(classFullName)) + { + Assembly[] ass = AppDomain.CurrentDomain.GetAssemblies(); + foreach (Assembly a in ass) + { + result = a.GetType(classFullName, false, false); + if (result != null) + break; //<<<<<================ + } + } + } + if (result == null) + { + string message = "Could not load type " + classFullName + ". Possible cause: the assembly was not loaded or not specified."; + throw new TypeLoadException(message); + } - return result; - } + return result; + } - public static System.Type TypeFromAssembly(string type, string assembly, bool throwIfError) - { - return TypeFromAssembly(new AssemblyQualifiedTypeName(type, assembly), throwIfError); - } + public static System.Type TypeFromAssembly(string type, string assembly, bool throwIfError) + { + return TypeFromAssembly(new AssemblyQualifiedTypeName(type, assembly), throwIfError); + } - /// <summary> - /// Returns a <see cref="System.Type"/> from an already loaded Assembly or an - /// Assembly that is loaded with a partial name. - /// </summary> - /// <param name="name">An <see cref="AssemblyQualifiedTypeName" />.</param> - /// <param name="throwOnError"><see langword="true" /> if an exception should be thrown - /// in case of an error, <see langword="false" /> otherwise.</param> - /// <returns> - /// A <see cref="System.Type"/> object that represents the specified type, - /// or <see langword="null" /> if the type cannot be loaded. - /// </returns> - /// <remarks> - /// Attempts to get a reference to the type from an already loaded assembly. If the - /// type cannot be found then the assembly is loaded using - /// <see cref="Assembly.Load(string)" />. - /// </remarks> - public static System.Type TypeFromAssembly(AssemblyQualifiedTypeName name, bool throwOnError) - { - try - { - // Try to get the type from an already loaded assembly - System.Type type = System.Type.GetType(name.ToString()); + /// <summary> + /// Returns a <see cref="System.Type"/> from an already loaded Assembly or an + /// Assembly that is loaded with a partial name. + /// </summary> + /// <param name="name">An <see cref="AssemblyQualifiedTypeName" />.</param> + /// <param name="throwOnError"><see langword="true" /> if an exception should be thrown + /// in case of an error, <see langword="false" /> otherwise.</param> + /// <returns> + /// A <see cref="System.Type"/> object that represents the specified type, + /// or <see langword="null" /> if the type cannot be loaded. + /// </returns> + /// <remarks> + /// Attempts to get a reference to the type from an already loaded assembly. If the + /// type cannot be found then the assembly is loaded using + /// <see cref="Assembly.Load(string)" />. + /// </remarks> + public static System.Type TypeFromAssembly(AssemblyQualifiedTypeName name, bool throwOnError) + { + try + { + // Try to get the type from an already loaded assembly + System.Type type = System.Type.GetType(name.ToString()); - if (type != null) - { - return type; - } + if (type != null) + { + return type; + } - if (name.Assembly == null) - { - // No assembly was specified for the type, so just fail - string message = "Could not load type " + name + ". Possible cause: no assembly name specified."; - log.Warn(message); - if (throwOnError) throw new TypeLoadException(message); - return null; - } + if (name.Assembly == null) + { + // No assembly was specified for the type, so just fail + string message = "Could not load type " + name + ". Possible cause: no assembly name specified."; + log.Warn(message); + if (throwOnError) throw new TypeLoadException(message); + return null; + } - Assembly assembly = Assembly.Load(name.Assembly); + Assembly assembly = Assembly.Load(name.Assembly); - if (assembly == null) - { - log.Warn("Could not load type " + name + ". Possible cause: incorrect assembly name specified."); - return null; - } + if (assembly == null) + { + log.Warn("Could not load type " + name + ". Possible cause: incorrect assembly name specified."); + return null; + } - type = assembly.GetType(name.Type, throwOnError); + type = assembly.GetType(name.Type, throwOnError); - if (type == null) - { - log.Warn("Could not load type " + name + "."); - return null; - } + if (type == null) + { + log.Warn("Could not load type " + name + "."); + return null; + } - return type; - } - catch (Exception e) - { - if (log.IsErrorEnabled) - { - log.Error("Could not load type " + name + ".", e); - } - if (throwOnError) throw; - return null; - } - } + return type; + } + catch (Exception e) + { + ... [truncated message content] |
From: <ste...@us...> - 2010-02-24 15:52:33
|
Revision: 4945 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4945&view=rev Author: steverstrong Date: 2010-02-24 15:52:13 +0000 (Wed, 24 Feb 2010) Log Message: ----------- Linq provider now adds correct left join when accessing entity references in projections. Also some refactoring to the ResultOperator processing Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs trunk/nhibernate/src/NHibernate/Linq/GroupBy/NonAggregatingGroupByRewriter.cs trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs trunk/nhibernate/src/NHibernate/Linq/NhLinqExpression.cs trunk/nhibernate/src/NHibernate/Linq/ReWriters/MergeAggregatingResultsRewriter.cs trunk/nhibernate/src/NHibernate/Linq/ResultTransformer.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/EqualityHqlGenerator.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/SelectClauseVisitor.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/Linq/FunctionTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs trunk/nhibernate/src/NHibernate.Test/Linq/MethodCallTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/MiscellaneousTextFixture.cs trunk/nhibernate/src/NHibernate.Test/Linq/QueryReuseTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/RegresstionTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/SelectionTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs trunk/nhibernate/src/NHibernate.Test/ProjectionFixtures/Fixture.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate/Linq/Clauses/ trunk/nhibernate/src/NHibernate/Linq/Clauses/LeftJoinClause.cs trunk/nhibernate/src/NHibernate/Linq/ReWriters/AddLeftJoinsReWriter.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/LeftJoinDetector.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/NameGenerator.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/IResultOperatorProcessor.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessAggregate.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessAll.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessAny.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessClientSideSelect.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessContains.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessFirst.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessFirstOrSingleBase.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessGroupBy.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessNonAggregatingGroupBy.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessResultOperatorReturn.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessSingle.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessSkip.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessTake.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ResultOperatorMap.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ResultOperatorProcessor.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ResultOperatorProcessorBase.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/VisitorParameters.cs Property Changed: ---------------- trunk/nhibernate/src/ Property changes on: trunk/nhibernate/src ___________________________________________________________________ Modified: svn:ignore - *.suo CloverSrc _ReSharper* *.resharperoptions *.resharper.user CloverBuild Ankh.Load *.resharper ConsoleTest _UpgradeReport_Files NHibernate.userprefs NHibernate.usertasks UpgradeLog.XML UpgradeLog2.XML UpgradeLog3.XML UpgradeLog4.XML UpgradeLog5.XML UpgradeLog6.XML UpgradeLog7.XML UpgradeLog8.XML UpgradeLog9.XML NHibernate.sln.proj NHibernate.sln.AssemblySurfaceCache.user NHibernate.sln.cache + *.suo CloverSrc _ReSharper* *.resharperoptions *.resharper.user CloverBuild Ankh.Load *.resharper ConsoleTest _UpgradeReport_Files NHibernate.userprefs NHibernate.usertasks UpgradeLog.XML UpgradeLog2.XML UpgradeLog3.XML UpgradeLog4.XML UpgradeLog5.XML UpgradeLog6.XML UpgradeLog7.XML UpgradeLog8.XML UpgradeLog9.XML NHibernate.sln.proj NHibernate.sln.AssemblySurfaceCache.user NHibernate.sln.cache .git Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -390,5 +390,10 @@ { return new HqlIn(_factory, itemExpression, source); } + + public HqlTreeNode LeftJoin(HqlExpression expression, HqlAlias @alias) + { + return new HqlLeftJoin(_factory, expression, @alias); + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -667,6 +667,28 @@ } } + public class HqlLeftJoin : HqlTreeNode + { + public HqlLeftJoin(IASTFactory factory, HqlExpression expression, HqlAlias @alias) : base(HqlSqlWalker.JOIN, "join", factory, new HqlLeft(factory), expression, @alias) + { + } + } + + public class HqlFetch : HqlTreeNode + { + public HqlFetch(IASTFactory factory) : base(HqlSqlWalker.FETCH, "fetch", factory) + { + } + } + + public class HqlLeft : HqlTreeNode + { + public HqlLeft(IASTFactory factory) + : base(HqlSqlWalker.LEFT, "left", factory) + { + } + } + public class HqlAny : HqlBooleanExpression { public HqlAny(IASTFactory factory) : base(HqlSqlWalker.ANY, "any", factory) Added: trunk/nhibernate/src/NHibernate/Linq/Clauses/LeftJoinClause.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Clauses/LeftJoinClause.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Clauses/LeftJoinClause.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -0,0 +1,12 @@ +using System.Linq.Expressions; +using Remotion.Data.Linq.Clauses; + +namespace NHibernate.Linq.Visitors +{ + public class LeftJoinClause : AdditionalFromClause + { + public LeftJoinClause(string itemName, System.Type itemType, Expression fromExpression) : base(itemName, itemType, fromExpression) + { + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Linq/GroupBy/NonAggregatingGroupByRewriter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/GroupBy/NonAggregatingGroupByRewriter.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/GroupBy/NonAggregatingGroupByRewriter.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -96,7 +96,7 @@ } } - internal class ClientSideSelect : ClientSideTransformOperator + public class ClientSideSelect : ClientSideTransformOperator { public LambdaExpression SelectClause { get; private set; } Modified: trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -11,7 +11,7 @@ return new NhQueryable<T>(session); } - public static void ForEach<T>(this IEnumerable<T> query, System.Action<T> method) + public static void ForEach<T>(this IEnumerable<T> query, Action<T> method) { foreach (T item in query) { @@ -26,7 +26,7 @@ public static bool IsNullableOrReference(this System.Type type) { - return !type.IsValueType || (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)); + return !type.IsValueType || type.IsNullable(); } public static System.Type NullableOf(this System.Type type) @@ -34,6 +34,16 @@ return type.GetGenericArguments()[0]; } + public static bool IsPrimitive(this System.Type type) + { + return (type.IsValueType || type.IsNullable() || type == typeof (string)); + } + + public static bool IsNonPrimitive(this System.Type type) + { + return !type.IsPrimitive(); + } + public static T As<T>(this object source) { return (T) source; Modified: trunk/nhibernate/src/NHibernate/Linq/NhLinqExpression.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/NhLinqExpression.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/NhLinqExpression.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -3,7 +3,6 @@ using System.Linq; using System.Linq.Expressions; using NHibernate.Engine.Query; -using NHibernate.Hql.Ast; using NHibernate.Hql.Ast.ANTLR.Tree; using NHibernate.Linq.ResultOperators; using NHibernate.Linq.Visitors; @@ -71,8 +70,11 @@ var queryModel = NhRelinqQueryParser.Parse(_expression); ExpressionToHqlTranslationResults = QueryModelVisitor.GenerateHqlQuery(queryModel, - _constantToParameterMap, - requiredHqlParameters, true); + new VisitorParameters( + sessionFactory, + _constantToParameterMap, + requiredHqlParameters), + true); ParameterDescriptors = requiredHqlParameters.AsReadOnly(); _astNode = ExpressionToHqlTranslationResults.Statement.AstNode; Added: trunk/nhibernate/src/NHibernate/Linq/ReWriters/AddLeftJoinsReWriter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/ReWriters/AddLeftJoinsReWriter.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/ReWriters/AddLeftJoinsReWriter.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using Remotion.Data.Linq; +using Remotion.Data.Linq.Clauses; + +namespace NHibernate.Linq.Visitors +{ + public class AddLeftJoinsReWriter : QueryModelVisitorBase + { + private readonly ISessionFactory _sessionFactory; + + private AddLeftJoinsReWriter(ISessionFactory sessionFactory) + { + _sessionFactory = sessionFactory; + } + + public static void ReWrite(QueryModel queryModel, ISessionFactory sessionFactory) + { + var rewriter = new AddLeftJoinsReWriter(sessionFactory); + + rewriter.VisitQueryModel(queryModel); + } + + public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel) + { + var joins = LeftJoinDetector.Detect(selectClause.Selector, new NameGenerator(queryModel), _sessionFactory); + + if (joins.Joins.Count > 0) + { + selectClause.Selector = joins.Selector; + + queryModel.TransformExpressions(e => ExpressionSwapper.Swap(e, joins.ExpressionMap)); + + foreach (var join in joins.Joins) + { + queryModel.BodyClauses.Add(join); + } + } + } + } + + public class ExpressionSwapper : NhExpressionTreeVisitor + { + private readonly Dictionary<Expression, Expression> _expressionMap; + + private ExpressionSwapper(Dictionary<Expression, Expression> expressionMap) + { + _expressionMap = expressionMap; + } + + public static Expression Swap(Expression expression, Dictionary<Expression, Expression> expressionMap) + { + var swapper = new ExpressionSwapper(expressionMap); + + return swapper.VisitExpression(expression); + } + + protected override Expression VisitExpression(Expression expression) + { + if (expression == null) + { + return null; + } + + Expression replacement; + + if (_expressionMap.TryGetValue(expression, out replacement)) + { + return replacement; + } + else + { + return base.VisitExpression(expression); + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Linq/ReWriters/MergeAggregatingResultsRewriter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/ReWriters/MergeAggregatingResultsRewriter.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/ReWriters/MergeAggregatingResultsRewriter.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -67,24 +67,27 @@ public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel) { - selectClause.TransformExpressions(MergeAggregatingResultsInExpressionRewriter.Rewrite); + selectClause.TransformExpressions(e => MergeAggregatingResultsInExpressionRewriter.Rewrite(e, new NameGenerator(queryModel))); } public override void VisitWhereClause(WhereClause whereClause, QueryModel queryModel, int index) { - whereClause.TransformExpressions(MergeAggregatingResultsInExpressionRewriter.Rewrite); + whereClause.TransformExpressions(e => MergeAggregatingResultsInExpressionRewriter.Rewrite(e, new NameGenerator(queryModel))); } } internal class MergeAggregatingResultsInExpressionRewriter : NhExpressionTreeVisitor { - private MergeAggregatingResultsInExpressionRewriter() + private readonly NameGenerator _nameGenerator; + + private MergeAggregatingResultsInExpressionRewriter(NameGenerator nameGenerator) { + _nameGenerator = nameGenerator; } - public static Expression Rewrite(Expression expression) + public static Expression Rewrite(Expression expression, NameGenerator nameGenerator) { - var visitor = new MergeAggregatingResultsInExpressionRewriter(); + var visitor = new MergeAggregatingResultsInExpressionRewriter(nameGenerator); return visitor.VisitExpression(expression); } @@ -131,8 +134,7 @@ private Expression CreateAggregate(Expression fromClauseExpression, LambdaExpression body, Func<Expression,Expression> aggregateFactory, Func<ResultOperatorBase> resultOperatorFactory) { - // TODO - need generated name here - var fromClause = new MainFromClause("x2", body.Parameters[0].Type, fromClauseExpression); + var fromClause = new MainFromClause(_nameGenerator.GetNewName(), body.Parameters[0].Type, fromClauseExpression); var selectClause = body.Body; selectClause = ReplacingExpressionTreeVisitor.Replace(body.Parameters[0], new QuerySourceReferenceExpression( Modified: trunk/nhibernate/src/NHibernate/Linq/ResultTransformer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/ResultTransformer.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/ResultTransformer.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Linq; -using System.Linq.Expressions; using NHibernate.Transform; namespace NHibernate.Linq Modified: trunk/nhibernate/src/NHibernate/Linq/Visitors/EqualityHqlGenerator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/EqualityHqlGenerator.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/EqualityHqlGenerator.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Linq.Expressions; -using NHibernate.Engine.Query; using NHibernate.Hql.Ast; namespace NHibernate.Linq.Visitors @@ -12,29 +10,22 @@ public class EqualityHqlGenerator { private readonly HqlTreeBuilder _hqlTreeBuilder; - private readonly IDictionary<ConstantExpression, NamedParameter> _parameters; - private readonly IList<NamedParameterDescriptor> _requiredHqlParameters; + private readonly VisitorParameters _parameters; - public EqualityHqlGenerator(IDictionary<ConstantExpression, NamedParameter> parameters, IList<NamedParameterDescriptor> requiredHqlParameters) + public EqualityHqlGenerator(VisitorParameters parameters) { _parameters = parameters; - _requiredHqlParameters = requiredHqlParameters; _hqlTreeBuilder = new HqlTreeBuilder(); } public HqlBooleanExpression Visit(Expression innerKeySelector, Expression outerKeySelector) { - if (innerKeySelector is NewExpression && outerKeySelector is NewExpression) - { - return VisitNew((NewExpression)innerKeySelector, (NewExpression)outerKeySelector); - } - else - { - return GenerateEqualityNode(innerKeySelector, outerKeySelector); - } + return innerKeySelector is NewExpression && outerKeySelector is NewExpression + ? VisitNew((NewExpression) innerKeySelector, (NewExpression) outerKeySelector) + : GenerateEqualityNode(innerKeySelector, outerKeySelector); } - private HqlBooleanExpression VisitNew(NewExpression innerKeySelector, NewExpression outerKeySelector) + private HqlBooleanExpression VisitNew(NewExpression innerKeySelector, NewExpression outerKeySelector) { if (innerKeySelector.Arguments.Count != outerKeySelector.Arguments.Count) { @@ -59,8 +50,8 @@ private HqlEquality GenerateEqualityNode(Expression leftExpr, Expression rightExpr) { // TODO - why two visitors? Can't we just reuse? - var left = new HqlGeneratorExpressionTreeVisitor(_parameters, _requiredHqlParameters); - var right = new HqlGeneratorExpressionTreeVisitor(_parameters, _requiredHqlParameters); + var left = new HqlGeneratorExpressionTreeVisitor(_parameters); + var right = new HqlGeneratorExpressionTreeVisitor(_parameters); return _hqlTreeBuilder.Equality(left.Visit(leftExpr).AsExpression(), right.Visit(rightExpr).AsExpression()); } Modified: trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Linq.Expressions; using NHibernate.Engine.Query; using NHibernate.Hql.Ast; @@ -13,21 +11,19 @@ public class HqlGeneratorExpressionTreeVisitor : IHqlExpressionVisitor { private readonly HqlTreeBuilder _hqlTreeBuilder; - private readonly IDictionary<ConstantExpression, NamedParameter> _parameters; - private readonly IList<NamedParameterDescriptor> _requiredHqlParameters; + private readonly VisitorParameters _parameters; static private readonly FunctionRegistry FunctionRegistry = FunctionRegistry.Initialise(); - public static HqlTreeNode Visit(Expression expression, IDictionary<ConstantExpression, NamedParameter> parameters, IList<NamedParameterDescriptor> requiredHqlParameters) + public static HqlTreeNode Visit(Expression expression, VisitorParameters parameters) { - var visitor = new HqlGeneratorExpressionTreeVisitor(parameters, requiredHqlParameters); + var visitor = new HqlGeneratorExpressionTreeVisitor(parameters); return visitor.VisitExpression(expression); } - public HqlGeneratorExpressionTreeVisitor(IDictionary<ConstantExpression, NamedParameter> parameters, IList<NamedParameterDescriptor> requiredHqlParameters) + public HqlGeneratorExpressionTreeVisitor(VisitorParameters parameters) { - _parameters = parameters; - _requiredHqlParameters = requiredHqlParameters; + _parameters = parameters; _hqlTreeBuilder = new HqlTreeBuilder(); } @@ -184,7 +180,7 @@ protected HqlTreeNode VisitNhDistinct(NhDistinctExpression expression) { - var visitor = new HqlGeneratorExpressionTreeVisitor(_parameters, _requiredHqlParameters); + var visitor = new HqlGeneratorExpressionTreeVisitor(_parameters); return _hqlTreeBuilder.DistinctHolder( _hqlTreeBuilder.Distinct(), @@ -367,9 +363,9 @@ NamedParameter namedParameter; - if (_parameters.TryGetValue(expression, out namedParameter)) + if (_parameters.ConstantToParameterMap.TryGetValue(expression, out namedParameter)) { - _requiredHqlParameters.Add(new NamedParameterDescriptor(namedParameter.Name, null, new[] { _requiredHqlParameters.Count + 1 }, false)); + _parameters.RequiredHqlParameters.Add(new NamedParameterDescriptor(namedParameter.Name, null, new[] { _parameters.RequiredHqlParameters.Count + 1 }, false)); if (namedParameter.Value is bool) { @@ -415,7 +411,7 @@ protected HqlTreeNode VisitSubQueryExpression(SubQueryExpression expression) { - ExpressionToHqlTranslationResults query = QueryModelVisitor.GenerateHqlQuery(expression.QueryModel, _parameters, _requiredHqlParameters, false); + ExpressionToHqlTranslationResults query = QueryModelVisitor.GenerateHqlQuery(expression.QueryModel, _parameters, false); return query.Statement; } Added: trunk/nhibernate/src/NHibernate/Linq/Visitors/LeftJoinDetector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/LeftJoinDetector.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/LeftJoinDetector.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using System.Linq.Expressions; +using Remotion.Data.Linq.Clauses.Expressions; + +namespace NHibernate.Linq.Visitors +{ + public class LeftJoinDetector : NhExpressionTreeVisitor + { + private readonly NameGenerator _nameGenerator; + private readonly ISessionFactory _sessionFactory; + private readonly Dictionary<string, LeftJoinClause> _joins = new Dictionary<string, LeftJoinClause>(); + private readonly Dictionary<Expression, Expression> _expressionMap = new Dictionary<Expression, Expression>(); + + private LeftJoinDetector(NameGenerator nameGenerator, ISessionFactory sessionFactory) + { + _nameGenerator = nameGenerator; + _sessionFactory = sessionFactory; + } + + public static Results Detect(Expression selector, NameGenerator nameGenerator, ISessionFactory sessionFactory) + { + var detector = new LeftJoinDetector(nameGenerator, sessionFactory); + + var newSelector = detector.VisitExpression(selector); + + return new Results(newSelector, detector._joins.Values, detector._expressionMap); + } + + protected override Expression VisitMemberExpression(MemberExpression expression) + { + if (expression.Type.IsNonPrimitive() && IsEntity(expression.Type)) + { + var newExpr = AddJoin(expression); + _expressionMap.Add(expression, newExpr); + return newExpr; + } + + return base.VisitMemberExpression(expression); + } + + private bool IsEntity(System.Type type) + { + return _sessionFactory.GetClassMetadata(type) != null; + } + + private Expression AddJoin(MemberExpression expression) + { + string key = ExpressionKeyVisitor.Visit(expression, null); + LeftJoinClause join; + + if (!_joins.TryGetValue(key, out join)) + { + join = new LeftJoinClause(_nameGenerator.GetNewName(), expression.Type, expression); + _joins.Add(key, join); + } + + return new QuerySourceReferenceExpression(join); + } + + public class Results + { + public Expression Selector { get; private set; } + public ICollection<LeftJoinClause> Joins { get; private set; } + public Dictionary<Expression, Expression> ExpressionMap { get; private set; } + + public Results(Expression selector, ICollection<LeftJoinClause> joins, Dictionary<Expression, Expression> expressionMap) + { + Selector = selector; + Joins = joins; + ExpressionMap = expressionMap; + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Linq/Visitors/NameGenerator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/NameGenerator.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/NameGenerator.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -0,0 +1,19 @@ +using Remotion.Data.Linq; + +namespace NHibernate.Linq.Visitors +{ + public class NameGenerator + { + private readonly QueryModel _model; + + public NameGenerator(QueryModel model) + { + _model = model; + } + + public string GetNewName() + { + return _model.GetNewName("_"); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-02-16 22:50:19 UTC (rev 4944) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -1,15 +1,13 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using System.Reflection; -using NHibernate.Engine.Query; using NHibernate.Hql.Ast; using NHibernate.Linq.GroupBy; using NHibernate.Linq.GroupJoin; using NHibernate.Linq.ResultOperators; using NHibernate.Linq.ReWriters; +using NHibernate.Linq.Visitors.ResultOperatorProcessors; using NHibernate.Type; using Remotion.Data.Linq; using Remotion.Data.Linq.Clauses; @@ -21,7 +19,7 @@ { public class QueryModelVisitor : QueryModelVisitorBase { - public static ExpressionToHqlTranslationResults GenerateHqlQuery(QueryModel queryModel, IDictionary<ConstantExpression, NamedParameter> parameters, IList<NamedParameterDescriptor> requiredHqlParameters, bool root) + public static ExpressionToHqlTranslationResults GenerateHqlQuery(QueryModel queryModel, VisitorParameters parameters, bool root) { // Remove unnecessary body operators RemoveUnnecessaryBodyOperators.ReWrite(queryModel); @@ -44,47 +42,71 @@ // Flatten pointless subqueries QueryReferenceExpressionFlattener.ReWrite(queryModel); - var visitor = new QueryModelVisitor(parameters, requiredHqlParameters, root); - visitor.VisitQueryModel(queryModel); + // Add left joins for references + AddLeftJoinsReWriter.ReWrite(queryModel, parameters.SessionFactory); + var visitor = new QueryModelVisitor(parameters, root, queryModel); + visitor.Visit(); + return visitor.GetTranslation(); } - private readonly HqlTreeBuilder _hqlTreeBuilder; + private static readonly ResultOperatorMap ResultOperatorMap; private readonly List<Action<IQuery, IDictionary<string, Tuple<object, IType>>>> _additionalCriteria = new List<Action<IQuery, IDictionary<string, Tuple<object, IType>>>>(); private readonly List<LambdaExpression> _listTransformers = new List<LambdaExpression>(); private readonly List<LambdaExpression> _itemTransformers = new List<LambdaExpression>(); private readonly List<LambdaExpression> _postExecuteTransformers = new List<LambdaExpression>(); - - private IStreamedDataInfo _previousEvaluationType; - private IStreamedDataInfo _currentEvaluationType; - - private readonly IDictionary<ConstantExpression, NamedParameter> _parameters; - private readonly IList<NamedParameterDescriptor> _requiredHqlParameters; private readonly bool _root; private bool _serverSide = true; - private HqlTreeNode _treeNode; - private System.Type _resultType; + public HqlTreeNode Root { get; private set; } + public VisitorParameters VisitorParameters { get; private set; } + public IStreamedDataInfo CurrentEvaluationType { get; private set; } + public IStreamedDataInfo PreviousEvaluationType { get; private set; } + public HqlTreeBuilder TreeBuilder { get; private set; } + public QueryModel Model { get; private set; } - private QueryModelVisitor(IDictionary<ConstantExpression, NamedParameter> parameters, IList<NamedParameterDescriptor> requiredHqlParameters, bool root) + static QueryModelVisitor() + { + ResultOperatorMap = new ResultOperatorMap(); + + ResultOperatorMap.Add<AggregateResultOperator, ProcessAggregate>(); + ResultOperatorMap.Add<FirstResultOperator, ProcessFirst>(); + ResultOperatorMap.Add<TakeResultOperator, ProcessTake>(); + ResultOperatorMap.Add<SkipResultOperator, ProcessSkip>(); + ResultOperatorMap.Add<GroupResultOperator, ProcessGroupBy>(); + ResultOperatorMap.Add<SingleResultOperator, ProcessSingle>(); + ResultOperatorMap.Add<ContainsResultOperator, ProcessContains>(); + ResultOperatorMap.Add<NonAggregatingGroupBy, ProcessNonAggregatingGroupBy>(); + ResultOperatorMap.Add<ClientSideSelect, ProcessClientSideSelect>(); + ResultOperatorMap.Add<AnyResultOperator, ProcessAny>(); + ResultOperatorMap.Add<AllResultOperator, ProcessAll>(); + } + + private QueryModelVisitor(VisitorParameters visitorParameters, bool root, QueryModel queryModel) { - _parameters = parameters; - _requiredHqlParameters = requiredHqlParameters; + VisitorParameters = visitorParameters; + Model = queryModel; _root = root; - _hqlTreeBuilder = new HqlTreeBuilder(); - _treeNode = _hqlTreeBuilder.Query(_hqlTreeBuilder.SelectFrom(_hqlTreeBuilder.From())); + TreeBuilder = new HqlTreeBuilder(); + Root = TreeBuilder.Query(TreeBuilder.SelectFrom(TreeBuilder.From())); } - public ExpressionToHqlTranslationResults GetTranslation() + private void Visit() + { + VisitQueryModel(Model); + } + + + private ExpressionToHqlTranslationResults GetTranslation() { if (_root) { DetectOuterExists(); } - return new ExpressionToHqlTranslationResults(_treeNode, + return new ExpressionToHqlTranslationResults(Root, _itemTransformers, _listTransformers, _postExecuteTransformers, @@ -93,9 +115,9 @@ private void DetectOuterExists() { - if (_treeNode is HqlExists) + if (Root is HqlExists) { - _treeNode = _treeNode.Children.First(); + Root = Root.Children.First(); _additionalCriteria.Add((q, p) => q.SetMaxResults(1)); @@ -107,9 +129,9 @@ public override void VisitMainFromClause(MainFromClause fromClause, QueryModel queryModel) { - AddFromClause(_hqlTreeBuilder.Range( - HqlGeneratorExpressionTreeVisitor.Visit(fromClause.FromExpression, _parameters, _requiredHqlParameters), - _hqlTreeBuilder.Alias(fromClause.ItemName))); + AddFromClause(TreeBuilder.Range( + HqlGeneratorExpressionTreeVisitor.Visit(fromClause.FromExpression, VisitorParameters), + TreeBuilder.Alias(fromClause.ItemName))); base.VisitMainFromClause(fromClause, queryModel); } @@ -117,56 +139,55 @@ private void AddWhereClause(HqlBooleanExpression where) { - var currentWhere = _treeNode.NodesPreOrder.Where(n => n is HqlWhere).FirstOrDefault(); + var currentWhere = Root.NodesPreOrder.Where(n => n is HqlWhere).FirstOrDefault(); if (currentWhere == null) { - currentWhere = _hqlTreeBuilder.Where(where); - _treeNode.As<HqlQuery>().AddChild(currentWhere); + currentWhere = TreeBuilder.Where(where); + Root.As<HqlQuery>().AddChild(currentWhere); } else { var currentClause = (HqlBooleanExpression)currentWhere.Children.Single(); currentWhere.ClearChildren(); - currentWhere.AddChild(_hqlTreeBuilder.BooleanAnd(currentClause, where)); + currentWhere.AddChild(TreeBuilder.BooleanAnd(currentClause, where)); } } private void AddFromClause(HqlTreeNode from) { - _treeNode.NodesPreOrder.Where(n => n is HqlFrom).First().AddChild(from); + Root.NodesPreOrder.Where(n => n is HqlFrom).First().AddChild(from); } private void AddSelectClause(HqlTreeNode select) { - _treeNode.NodesPreOrder.Where(n => n is HqlSelectFrom).First().AddChild(select); + Root.NodesPreOrder.Where(n => n is HqlSelectFrom).First().AddChild(select); } private void AddGroupByClause(HqlGroupBy groupBy) { - _treeNode.As<HqlQuery>().AddChild(groupBy); + Root.As<HqlQuery>().AddChild(groupBy); } private void AddOrderByClause(HqlExpression orderBy, HqlDirectionStatement direction) { - var orderByRoot = _treeNode.NodesPreOrder.Where(n => n is HqlOrderBy).FirstOrDefault(); + var orderByRoot = Root.NodesPreOrder.Where(n => n is HqlOrderBy).FirstOrDefault(); if (orderByRoot == null) { - orderByRoot = _hqlTreeBuilder.OrderBy(); - _treeNode.As<HqlQuery>().AddChild(orderByRoot); + orderByRoot = TreeBuilder.OrderBy(); + Root.As<HqlQuery>().AddChild(orderByRoot); } orderByRoot.AddChild(orderBy); orderByRoot.AddChild(direction); } - public override void VisitResultOperator(ResultOperatorBase resultOperator, QueryModel queryModel, int index) { - _previousEvaluationType = _currentEvaluationType; - _currentEvaluationType = resultOperator.GetOutputDataInfo(_previousEvaluationType); + PreviousEvaluationType = CurrentEvaluationType; + CurrentEvaluationType = resultOperator.GetOutputDataInfo(PreviousEvaluationType); if (resultOperator is ClientSideTransformOperator) { @@ -180,270 +201,34 @@ } } - if (resultOperator is FirstResultOperator) - { - ProcessFirstOperator((FirstResultOperator) resultOperator); - } - else if (resultOperator is TakeResultOperator) - { - ProcessTakeOperator((TakeResultOperator)resultOperator); - } - else if (resultOperator is SkipResultOperator) - { - ProcessSkipOperator((SkipResultOperator)resultOperator); - } - else if (resultOperator is GroupResultOperator) - { - ProcessGroupByOperator((GroupResultOperator)resultOperator); - } - else if (resultOperator is SingleResultOperator) - { - ProcessSingleOperator((SingleResultOperator) resultOperator); - } - else if (resultOperator is ContainsResultOperator) - { - ProcessContainsOperator((ContainsResultOperator) resultOperator); - } - else if (resultOperator is NonAggregatingGroupBy) - { - ProcessNonAggregatingGroupBy((NonAggregatingGroupBy)resultOperator, queryModel); - } - else if (resultOperator is ClientSideSelect) - { - ProcessClientSideSelect((ClientSideSelect)resultOperator); - } - else if (resultOperator is AggregateResultOperator) - { - ProcessAggregateOperator((AggregateResultOperator)resultOperator); - } - else if (resultOperator is AnyResultOperator) - { - ProcessAnyOperator((AnyResultOperator) resultOperator); - } - else if (resultOperator is AllResultOperator) - { - ProcessAllOperator((AllResultOperator) resultOperator); - } - else - { - throw new NotSupportedException(string.Format("The {0} result operator is not current supported", - resultOperator.GetType().Name)); - } - } + var results = ResultOperatorMap.Process(resultOperator, this); - private void ProcessAllOperator(AllResultOperator resultOperator) - { - AddWhereClause(_hqlTreeBuilder.BooleanNot( - HqlGeneratorExpressionTreeVisitor.Visit(resultOperator.Predicate, _parameters, - _requiredHqlParameters).AsBooleanExpression())); - - _treeNode = _hqlTreeBuilder.BooleanNot(_hqlTreeBuilder.Exists((HqlQuery)_treeNode)); - } - - private void ProcessAnyOperator(AnyResultOperator anyOperator) - { - _treeNode = _hqlTreeBuilder.Exists((HqlQuery) _treeNode); - } - - private void ProcessContainsOperator(ContainsResultOperator resultOperator) - { - var itemExpression = - HqlGeneratorExpressionTreeVisitor.Visit(resultOperator.Item, _parameters, _requiredHqlParameters) - .AsExpression(); - - var from = GetFromRangeClause(); - var source = from.Children.First(); - - if (source is HqlParameter) + if (results.AdditionalCriteria != null) { - // This is an "in" style statement - _treeNode = _hqlTreeBuilder.In(itemExpression, source); - + _additionalCriteria.Add(results.AdditionalCriteria); } - else + if (results.GroupBy != null) { - // This is an "exists" style statement - AddWhereClause(_hqlTreeBuilder.Equality( - _hqlTreeBuilder.Ident(GetFromAlias().AstNode.Text), - itemExpression)); - - _treeNode = _hqlTreeBuilder.Exists((HqlQuery)_treeNode); + AddGroupByClause(results.GroupBy); } - } - - private HqlAlias GetFromAlias() - { - return _treeNode.NodesPreOrder.Single(n => n is HqlRange).Children.Single(n => n is HqlAlias) as HqlAlias; - } - - private HqlRange GetFromRangeClause() - { - return _treeNode.NodesPreOrder.Single(n => n is HqlRange).As<HqlRange>(); - } - - private void ProcessAggregateOperator(AggregateResultOperator resultOperator) - { - var inputType = resultOperator.Accumulator.Parameters[1].Type; - var accumulatorType = resultOperator.Accumulator.Parameters[0].Type; - var inputList = Expression.Parameter(typeof(IEnumerable<>).MakeGenericType(typeof(object)), "inputList"); - - var castToItem = EnumerableHelper.GetMethod("Cast", new[] { typeof(IEnumerable) }, new[] { inputType }); - var castToItemExpr = Expression.Call(castToItem, inputList); - - MethodCallExpression call; - - if (resultOperator.ParseInfo.ParsedExpression.Arguments.Count == 2) + if (results.ListTransformer != null) { - var aggregate = ReflectionHelper.GetMethod(() => Enumerable.Aggregate<object>(null, null)); - aggregate = aggregate.GetGenericMethodDefinition().MakeGenericMethod(inputType); - - call = Expression.Call( - aggregate, - castToItemExpr, - resultOperator.Accumulator - ); - + _listTransformers.Add(results.ListTransformer); } - else if (resultOperator.ParseInfo.ParsedExpression.Arguments.Count == 3) + if (results.PostExecuteTransformer != null) { - var aggregate = ReflectionHelper.GetMethod(() => Enumerable.Aggregate<object, object>(null, null, null)); - aggregate = aggregate.GetGenericMethodDefinition().MakeGenericMethod(inputType, accumulatorType); - - call = Expression.Call( - aggregate, - castToItemExpr, - resultOperator.OptionalSeed, - resultOperator.Accumulator - ); + _postExecuteTransformers.Add(results.PostExecuteTransformer); } - else + if (results.WhereClause != null) { - var selectorType = resultOperator.OptionalSelector.Type.GetGenericArguments()[2]; - var aggregate = ReflectionHelper.GetMethod(() => Enumerable.Aggregate<object, object, object>(null, null, null, null)); - aggregate = aggregate.GetGenericMethodDefinition().MakeGenericMethod(inputType, accumulatorType, selectorType); - - call = Expression.Call( - aggregate, - castToItemExpr, - resultOperator.OptionalSeed, - resultOperator.Accumulator, - resultOperator.OptionalSelector - ); + AddWhereClause(results.WhereClause); } - - _listTransformers.Add(Expression.Lambda(call, inputList)); - } - - private void ProcessClientSideSelect(ClientSideSelect resultOperator) - { - var inputType = resultOperator.SelectClause.Parameters[0].Type; - var outputType = resultOperator.SelectClause.Type.GetGenericArguments()[1]; - - var inputList = Expression.Parameter(typeof (IEnumerable<>).MakeGenericType(inputType), "inputList"); - - var selectMethod = EnumerableHelper.GetMethod("Select", new[] { typeof(IEnumerable<>), typeof(Func<,>) }, new[] { inputType, outputType }); - var toListMethod = EnumerableHelper.GetMethod("ToList", new[] {typeof (IEnumerable<>)}, new[] {outputType}); - - var lambda = Expression.Lambda( - Expression.Call(toListMethod, - Expression.Call(selectMethod, inputList, resultOperator.SelectClause)), - inputList); - - _listTransformers.Add(lambda); - } - - private void ProcessTakeOperator(TakeResultOperator resultOperator) - { - NamedParameter parameterName; - - // TODO - very similar to ProcessSkip, plus want to investigate the scenario in the "else" - // clause to see if it is valid - if (_parameters.TryGetValue(resultOperator.Count as ConstantExpression, out parameterName)) + if (results.TreeNode != null) { - _additionalCriteria.Add((q, p) => q.SetMaxResults((int) p[parameterName.Name].First)); + Root = results.TreeNode; } - else - { - _additionalCriteria.Add((q, p) => q.SetMaxResults(resultOperator.GetConstantCount())); - } - } - - private void ProcessSkipOperator(SkipResultOperator resultOperator) - { - NamedParameter parameterName; - - if (_parameters.TryGetValue(resultOperator.Count as ConstantExpression, out parameterName)) - { - _additionalCriteria.Add((q, p) => q.SetFirstResult((int)p[parameterName.Name].First)); - } - else - { - _additionalCriteria.Add((q, p) => q.SetFirstResult(resultOperator.GetConstantCount())); - } } - private void ProcessNonAggregatingGroupBy(NonAggregatingGroupBy resultOperator, QueryModel model) - { - var tSource = model.SelectClause.Selector.Type; - var tKey = resultOperator.GroupBy.KeySelector.Type; - var tElement = resultOperator.GroupBy.ElementSelector.Type; - - // Stuff in the group by that doesn't map to HQL. Run it client-side - var listParameter = Expression.Parameter(typeof (IEnumerable<object>), "list"); - - ParameterExpression itemParam = Expression.Parameter(tSource, "item"); - Expression keySelectorSource = itemParam; - - if (tSource != SourceOf(resultOperator.GroupBy.KeySelector)) - { - keySelectorSource = Expression.MakeMemberAccess(itemParam, - tSource.GetMember( - ((QuerySourceReferenceExpression) - resultOperator.GroupBy.KeySelector).ReferencedQuerySource. - ItemName)[0]); - } - - - Expression keySelector = new GroupByKeySelectorVisitor(keySelectorSource).Visit(resultOperator.GroupBy.KeySelector); - - Expression elementSelectorSource = itemParam; - - if (tSource != SourceOf(resultOperator.GroupBy.ElementSelector)) - { - elementSelectorSource = Expression.MakeMemberAccess(itemParam, - tSource.GetMember( - ((QuerySourceReferenceExpression) - resultOperator.GroupBy.ElementSelector).ReferencedQuerySource. - ItemName)[0]); - } - - Expression elementSelector = new GroupByKeySelectorVisitor(elementSelectorSource).Visit(resultOperator.GroupBy.ElementSelector); - - var groupByMethod = EnumerableHelper.GetMethod("GroupBy", - new[] { typeof(IEnumerable<>), typeof(Func<,>), typeof(Func<,>) }, - new[] { tSource, tKey, tElement }); - - var castToItem = EnumerableHelper.GetMethod("Cast", new[] { typeof(IEnumerable) }, new[] { tSource }); - - var toList = EnumerableHelper.GetMethod("ToList", new [] { typeof(IEnumerable<>)}, new [] {resultOperator.GroupBy.ItemType}); - - LambdaExpression keySelectorExpr = Expression.Lambda(keySelector, itemParam); - - LambdaExpression elementSelectorExpr = Expression.Lambda(elementSelector, itemParam); - - Expression castToItemExpr = Expression.Call(castToItem, listParameter); - - var groupByExpr = Expression.Call(groupByMethod, castToItemExpr, keySelectorExpr, elementSelectorExpr); - - var toListExpr = Expression.Call(toList, groupByExpr); - - var lambdaExpr = Expression.Lambda(toListExpr, listParameter); - - _listTransformers.Add(lambdaExpr); - - return; - } - private void GroupBy<TSource, TKey, TResult>(Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TResult>> elementSelector) { IQueryable<object> list = null; @@ -451,55 +236,11 @@ var x = list.Cast<TSource>().GroupBy(keySelector, elementSelector); } - private static System.Type SourceOf(Expression keySelector) - { - return new GroupByKeySourceFinder().Visit(keySelector).Type; - } - - private void ProcessGroupByOperator(GroupResultOperator resultOperator) - { - AddGroupByClause(_hqlTreeBuilder.GroupBy(HqlGeneratorExpressionTreeVisitor.Visit(resultOperator.KeySelector, _parameters, _requiredHqlParameters).AsExpression())); - } - - private void ProcessFirstOperator(FirstResultOperator resultOperator) - { - var firstMethod = resultOperator.ReturnDefaultWhenEmpty - ? ReflectionHelper.GetMethod(() => Queryable.FirstOrDefault<object>(null)) - : ReflectionHelper.GetMethod(() => Queryable.First<object>(null)); - - ProcessFirstOrSingle(firstMethod); - } - - private void ProcessSingleOperator(SingleResultOperator resultOperator) - { - var firstMethod = resultOperator.ReturnDefaultWhenEmpty - ? ReflectionHelper.GetMethod(() => Queryable.SingleOrDefault<object>(null)) - : ReflectionHelper.GetMethod(() => Queryable.Single<object>(null)); - - ProcessFirstOrSingle(firstMethod); - } - - private void ProcessFirstOrSingle(MethodInfo target) - { - target = target.MakeGenericMethod(_currentEvaluationType.DataType); - - var parameter = Expression.Parameter(_previousEvaluationType.DataType, null); - - var lambda = Expression.Lambda( - Expression.Call( - target, - parameter), - parameter); - - _additionalCriteria.Add((q, p) => q.SetMaxResults(1)); - _postExecuteTransformers.Add(lambda); - } - public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel) { - _currentEvaluationType = selectClause.GetOutputDataInfo(); + CurrentEvaluationType = selectClause.GetOutputDataInfo(); - var visitor = new SelectClauseVisitor(typeof(object[]), _parameters, _requiredHqlParameters); + var visitor = new SelectClauseVisitor(typeof(object[]), VisitorParameters); visitor.Visit(selectClause.Selector); @@ -508,7 +249,7 @@ _itemTransformers.Add(visitor.ProjectionExpression); } - AddSelectClause(_hqlTreeBuilder.Select(visitor.GetHqlNodes())); + AddSelectClause(TreeBuilder.Select(visitor.GetHqlNodes())); base.VisitSelectClause(selectClause, queryModel); } @@ -516,43 +257,50 @@ public override void VisitWhereClause(WhereClause whereClause, QueryModel queryModel, int index) { // Visit the predicate to build the query - AddWhereClause(HqlGeneratorExpressionTreeVisitor.Visit(whereClause.Predicate, _parameters, _requiredHqlParameters).AsBooleanExpression()); + AddWhereClause(HqlGeneratorExpressionTreeVisitor.Visit(whereClause.Predicate, VisitorParameters).AsBooleanExpression()); } public override void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index) { foreach (Ordering clause in orderByClause.Orderings) { - AddOrderByClause(HqlGeneratorExpressionTreeVisitor.Visit(clause.Expression, _parameters, _requiredHqlParameters).AsExpression(), + AddOrderByClause(HqlGeneratorExpressionTreeVisitor.Visit(clause.Expression, VisitorParameters).AsExpression(), clause.OrderingDirection == OrderingDirection.Asc - ? _hqlTreeBuilder.Ascending() - : (HqlDirectionStatement) _hqlTreeBuilder.Descending()); + ? TreeBuilder.Ascending() + : (HqlDirectionStatement) TreeBuilder.Descending()); } } public override void VisitJoinClause(JoinClause joinClause, QueryModel queryModel, int index) { - var equalityVisitor = new EqualityHqlGenerator(_parameters, _requiredHqlParameters); + var equalityVisitor = new EqualityHqlGenerator(VisitorParameters); var whereClause = equalityVisitor.Visit(joinClause.InnerKeySelector, joinClause.OuterKeySelector); AddWhereClause(whereClause); - AddFromClause(_hqlTreeBuilder.Range(HqlGeneratorExpressionTreeVisitor.Visit(joinClause.InnerSequence, _parameters, _requiredHqlParameters), - _hqlTreeBuilder.Alias(joinClause.ItemName))); + AddFromClause(TreeBuilder.Range(HqlGeneratorExpressionTreeVisitor.Visit(joinClause.InnerSequence, VisitorParameters), + TreeBuilder.Alias(joinClause.ItemName))); } public override void VisitAdditionalFromClause(AdditionalFromClause fromClause, QueryModel queryModel, int index) { - if (fromClause.FromExpression is MemberExpression) + if (fromClause is LeftJoinClause) + { + // It's a left join + AddFromClause(TreeBuilder.LeftJoin( + HqlGeneratorExpressionTreeVisitor.Visit(fromClause.FromExpression, VisitorParameters).AsExpression(), + TreeBuilder.Alias(fromClause.ItemName))); + } + else if (fromClause.FromExpression is MemberExpression) { var member = (MemberExpression) fromClause.FromExpression; if (member.Expression is QuerySourceReferenceExpression) { // It's a join - AddFromClause(_hqlTreeBuilder.Join( - HqlGeneratorExpressionTreeVisitor.Visit(fromClause.FromExpression, _parameters, _requiredHqlParameters).AsExpression(), - _hqlTreeBuilder.Alias(fromClause.ItemName))); + AddFromClause(TreeBuilder.Join( + HqlGeneratorExpressionTreeVisitor.Visit(fromClause.FromExpression, VisitorParameters).AsExpression(), + TreeBuilder.Alias(fromClause.ItemName))); } else { @@ -563,9 +311,9 @@ else { // TODO - exact same code as in MainFromClause; refactor this out - AddFromClause(_hqlTreeBuilder.Range( - HqlGeneratorExpressionTreeVisitor.Visit(fromClause.FromExpression, _parameters, _requiredHqlParameters), - _hqlTreeBuilder.Alias(fromClause.ItemName))); + AddFromClause(TreeBuilder.Range( + HqlGeneratorExpressionTreeVisitor.Visit(fromClause.FromExpression, VisitorParameters), + TreeBuilder.Alias(fromClause.ItemName))); } @@ -576,11 +324,5 @@ { throw new NotImplementedException(); } - - internal enum ResultOperatorProcessingMode - { - ProcessServerSide, - ProcessClientSide - } } } \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/IResultOperatorProcessor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/IResultOperatorProcessor.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/IResultOperatorProcessor.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -0,0 +1,7 @@ +namespace NHibernate.Linq.Visitors.ResultOperatorProcessors +{ + public interface IResultOperatorProcessor<T> + { + ProcessResultOperatorReturn Process(T resultOperator, QueryModelVisitor queryModelVisitor); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessAggregate.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessAggregate.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessAggregate.cs 2010-02-24 15:52:13 UTC (rev 4945) @@ -0,0 +1,63 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; + +namespace NHibernate.Linq.Visitors.ResultOperatorProcessors +{ + public class ProcessAggregate : IResultOperatorProcessor<AggregateResultOperator> + { + public ProcessResultOperatorReturn Process(AggregateResultOperator resultOperator, QueryModelVisitor queryModelVisitor) + { + var inputType = resultOperator.Accumulator.Parameters[1].Type; + var accumulatorType = resultOperator.Accumulator.Parameters[0].Type; + var inputList = Expression.Parameter(typeof(IEnumerable<>).MakeGenericType(typeof(object)), "inputList"); + + var castToItem = EnumerableHelper.GetMethod("Cast", new[] { typeof(IEnumerable) }, new[] { inputType }); + var castToItemExpr = Expression.Call(castToItem, inputList); + + MethodCallExpression call; + + if (resultOperator.ParseInfo.ParsedExpression.Arguments.Count == 2) + { + var aggregate = ReflectionHelper.GetMethod(() => Enumerable.Aggregate<object>(null, null)); + aggregate = aggregate.GetGenericMethodDefinition().MakeGenericMethod(inputType); + + call = Expression.Call( + aggregate, + castToItemExpr, + resultOperator.Accumulator + ); + + } + else if (resultOperator.ParseInfo.ParsedExpression.Arguments.Count == 3) + { + var aggregate = ReflectionHelper.GetMethod(() => Enumerable.Aggregate<object, object>(null, null, null)); + aggregate = aggregate.GetGenericMethodDefinition().MakeGenericMethod(inputType, accumulatorType); + + call = Expression.Call( + aggregate, + castToItemExpr, + resultOperator.OptionalSeed, + resultOperator.Accumulator + ); + } + else + { + var selectorType = resultOperator.OptionalSelector.Type.GetGenericArguments()[2]; + var aggregate = ReflectionHelper.GetMethod(() => Enumerable.Aggregate<object, object, object>(null, null, null, null)); + aggregate = aggregate.GetGenericMethodDefinition().MakeGenericMethod(inputType, accumulatorType, selectorType); + + call = Expression.Call( + aggregate, + castToItemExpr, + resultOperator.OptionalSeed, + resultOperator.Accumulator, + resultOperator.OptionalSelector + ... [truncated message content] |
From: <fab...@us...> - 2010-08-03 11:41:31
|
Revision: 5103 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5103&view=rev Author: fabiomaulo Date: 2010-08-03 11:41:25 +0000 (Tue, 03 Aug 2010) Log Message: ----------- Fix NH-2148 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyFieldInterceptor.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/BugFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Domain.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Mappings.hbm.xml Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyFieldInterceptor.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyFieldInterceptor.cs 2010-08-03 10:47:31 UTC (rev 5102) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/LazyFieldInterceptor.cs 2010-08-03 11:41:25 UTC (rev 5103) @@ -36,6 +36,10 @@ FieldInterceptor.Intercept(invocation.InvocationTarget, ReflectHelper.GetPropertyName(invocation.Method), null); invocation.Proceed(); } + else + { + invocation.Proceed(); + } } else { Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/BugFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/BugFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/BugFixture.cs 2010-08-03 11:41:25 UTC (rev 5103) @@ -0,0 +1,54 @@ +using NHibernate.ByteCode.Castle; +using NHibernate.Cfg; +using NUnit.Framework; +namespace NHibernate.Test.NHSpecificTest.NH2148 +{ + public class BugFixture : BugTestCase + { + protected override void Configure(NHibernate.Cfg.Configuration configuration) + { + configuration.SetProperty(Environment.ProxyFactoryFactoryClass, + typeof(ProxyFactoryFactory).AssemblyQualifiedName); + } + + protected override void OnSetUp() + { + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + s.Persist(new Book + { + Id = 1, + ALotOfText = "a lot of text ..." + }); + tx.Commit(); + } + + } + + protected override void OnTearDown() + { + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + Assert.That(s.CreateSQLQuery("delete from Book").ExecuteUpdate(), Is.EqualTo(1)); + tx.Commit(); + } + } + + [Test] + public void CanCallLazyPropertyEntityMethod() + { + using (ISession s = OpenSession()) + { + var book = s.Get<Book>(1) as IBook; + + Assert.IsNotNull(book); + + string s1 = "testing1"; + string s2 = book.SomeMethod(s1); + Assert.AreEqual(s1, s2); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Domain.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Domain.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Domain.cs 2010-08-03 11:41:25 UTC (rev 5103) @@ -0,0 +1,17 @@ +namespace NHibernate.Test.NHSpecificTest.NH2148 +{ + public class Book: IBook + { + public virtual int Id { get; set; } + public virtual string ALotOfText { get; set; } + public virtual string SomeMethod(string arg) + { + return arg; + } + } + + public interface IBook + { + string SomeMethod(string arg); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2148/Mappings.hbm.xml 2010-08-03 11:41:25 UTC (rev 5103) @@ -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.NH2148"> + + <class name="Book"> + <id name="Id"> + <generator class="assigned" /> + </id> + <property name="ALotOfText" lazy="true" /> + </class> + +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-08-03 10:47:31 UTC (rev 5102) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-08-03 11:41:25 UTC (rev 5103) @@ -443,6 +443,8 @@ <Compile Include="Linq\QueryCacheableTests.cs" /> <Compile Include="Linq\QueryReuseTests.cs" /> <Compile Include="Linq\ReadonlyTestCase.cs" /> + <Compile Include="NHSpecificTest\NH2148\BugFixture.cs" /> + <Compile Include="NHSpecificTest\NH2148\Domain.cs" /> <Compile Include="NHSpecificTest\NH2245\Fixture.cs" /> <Compile Include="NHSpecificTest\NH2245\Model.cs" /> <Compile Include="UtilityTest\ReflectionHelperIsMethodOfTests.cs" /> @@ -2226,6 +2228,7 @@ <EmbeddedResource Include="CollectionTest\NullableValueTypeElementMapFixture.hbm.xml" /> <EmbeddedResource Include="DriverTest\EntityForMs2008.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH2148\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2245\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2257\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2208\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2010-08-10 02:46:46
|
Revision: 5133 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5133&view=rev Author: fabiomaulo Date: 2010-08-10 02:46:39 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Removed log4net from Bytecodes Modified Paths: -------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.ByteCode.LinFu.csproj trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build 2010-08-09 13:03:36 UTC (rev 5132) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build 2010-08-10 02:46:39 UTC (rev 5133) @@ -23,7 +23,6 @@ <assemblyfileset basedir="${bin.dir}" id="project.references"> <include name="System.dll" /> <include name="Iesi.Collections.dll" /> - <include name="log4net.dll" /> <include name="Castle.Core.dll" /> <include name="Castle.DynamicProxy2.dll" /> <include name="NHibernate.dll" /> Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj 2010-08-09 13:03:36 UTC (rev 5132) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj 2010-08-10 02:46:39 UTC (rev 5133) @@ -45,10 +45,6 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\net\3.5\Iesi.Collections.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> Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs 2010-08-09 13:03:36 UTC (rev 5132) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ProxyFactory.cs 2010-08-10 02:46:39 UTC (rev 5133) @@ -1,6 +1,5 @@ using System; using Castle.DynamicProxy; -using log4net; using NHibernate.Engine; using NHibernate.Proxy; @@ -8,7 +7,7 @@ { public class ProxyFactory : AbstractProxyFactory { - protected static readonly ILog log = LogManager.GetLogger(typeof (ProxyFactory)); + protected static readonly ILogger log = LoggerProvider.LoggerFor(typeof (ProxyFactory)); private static readonly ProxyGenerator ProxyGenerator = new ProxyGenerator(); protected static ProxyGenerator DefaultProxyGenerator Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build 2010-08-09 13:03:36 UTC (rev 5132) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build 2010-08-10 02:46:39 UTC (rev 5133) @@ -23,7 +23,6 @@ <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> Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.ByteCode.LinFu.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.ByteCode.LinFu.csproj 2010-08-09 13:03:36 UTC (rev 5132) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.ByteCode.LinFu.csproj 2010-08-10 02:46:39 UTC (rev 5133) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -42,10 +42,6 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\net\3.5\LinFu.DynamicProxy.dll</HintPath> </Reference> - <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\3.5\log4net.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> <Compile Include="AssemblyInfo.cs" /> Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ProxyFactory.cs 2010-08-09 13:03:36 UTC (rev 5132) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ProxyFactory.cs 2010-08-10 02:46:39 UTC (rev 5133) @@ -1,5 +1,4 @@ using System; -using log4net; using NHibernate.Engine; using NHibernate.Proxy; @@ -8,7 +7,7 @@ public class ProxyFactory : AbstractProxyFactory { private static readonly global::LinFu.DynamicProxy.ProxyFactory factory = new global::LinFu.DynamicProxy.ProxyFactory(); - protected static readonly ILog log = LogManager.GetLogger(typeof (ProxyFactory)); + protected static readonly ILogger log = LoggerProvider.LoggerFor(typeof (ProxyFactory)); #region IProxyFactory Members Modified: trunk/nhibernate/src/NHibernate.ByteCode.Spring/ByteCode.build =================================================================== (Binary files differ) Modified: trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj 2010-08-09 13:03:36 UTC (rev 5132) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj 2010-08-10 02:46:39 UTC (rev 5133) @@ -45,10 +45,6 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\net\3.5\Iesi.Collections.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="Spring.Aop, Version=0.0.0.20110, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\net\3.5\Spring.Aop.dll</HintPath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-08-14 20:29:20
|
Revision: 5154 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5154&view=rev Author: ricbrown Date: 2010-08-14 20:29:14 +0000 (Sat, 14 Aug 2010) Log Message: ----------- Updated config for tests to work with Oracle. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/App.config trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config 2010-08-14 17:52:57 UTC (rev 5153) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/App.config 2010-08-14 20:29:14 UTC (rev 5154) @@ -24,6 +24,7 @@ <property name="prepare_sql">false</property> <property name="query.startup_check">false</property> <property name="connection.isolation">ReadCommitted</property> + <property name="hbm2ddl.keywords">none</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string"> Server=(local);initial catalog=nhibernate;Integrated Security=SSPI Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/App.config 2010-08-14 17:52:57 UTC (rev 5153) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/App.config 2010-08-14 20:29:14 UTC (rev 5154) @@ -22,6 +22,7 @@ <property name="prepare_sql">false</property> <property name="query.startup_check">false</property> <property name="connection.isolation">ReadCommitted</property> + <property name="hbm2ddl.keywords">none</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string"> Server=(local);initial catalog=nhibernate;Integrated Security=SSPI Modified: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config 2010-08-14 17:52:57 UTC (rev 5153) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config 2010-08-14 20:29:14 UTC (rev 5154) @@ -22,6 +22,7 @@ <property name="prepare_sql">false</property> <property name="query.startup_check">false</property> <property name="connection.isolation">ReadCommitted</property> + <property name="hbm2ddl.keywords">none</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string"> Server=(local);initial catalog=nhibernate;Integrated Security=SSPI This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2010-08-24 21:28:48
|
Revision: 5165 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5165&view=rev Author: fabiomaulo Date: 2010-08-24 21:28:41 +0000 (Tue, 24 Aug 2010) Log Message: ----------- Added test for NH-2294 (issue inside ANTLR) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2294/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2294/Fixture.cs Property Changed: ---------------- trunk/nhibernate/src/ Property changes on: trunk/nhibernate/src ___________________________________________________________________ Modified: svn:ignore - *.suo CloverSrc _ReSharper* *.resharperoptions *.resharper.user CloverBuild Ankh.Load *.resharper ConsoleTest _UpgradeReport_Files NHibernate.userprefs NHibernate.usertasks UpgradeLog.XML UpgradeLog2.XML UpgradeLog3.XML UpgradeLog4.XML UpgradeLog5.XML UpgradeLog6.XML UpgradeLog7.XML UpgradeLog8.XML UpgradeLog9.XML NHibernate.sln.proj NHibernate.sln.AssemblySurfaceCache.user NHibernate.sln.cache .git .gitignore NHibernate.5.0.ReSharper.user LocalTestRun.testrunconfig + *.suo CloverSrc _ReSharper* *.resharperoptions *.resharper.user CloverBuild Ankh.Load *.resharper ConsoleTest _UpgradeReport_Files NHibernate.userprefs NHibernate.usertasks UpgradeLog.XML UpgradeLog2.XML UpgradeLog3.XML UpgradeLog4.XML UpgradeLog5.XML UpgradeLog6.XML UpgradeLog7.XML UpgradeLog8.XML UpgradeLog9.XML NHibernate.sln.proj NHibernate.sln.AssemblySurfaceCache.user NHibernate.sln.cache .git .gitignore NHibernate.5.0.ReSharper.user LocalTestRun.testrunconfig *.user Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2294/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2294/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2294/Fixture.cs 2010-08-24 21:28:41 UTC (rev 5165) @@ -0,0 +1,27 @@ +using System.Linq; +using NHibernate.Hql.Ast.ANTLR; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.NHSpecificTest.NH2294 +{ + public class Fixture : BugTestCase + { + protected override System.Collections.IList Mappings + { + get + { + return Enumerable.Empty<object>().ToList(); + } + } + + [Test, Ignore("External issue. The bug is inside RecognitionException of Antlr.")] + public void WhenQueryHasJustAWhereThenThrowQuerySyntaxException() + { + using (ISession session = OpenSession()) + { + session.Executing(s => s.CreateQuery("where").List()).Throws<QuerySyntaxException>(); + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-08-20 18:44:29 UTC (rev 5164) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-08-24 21:28:41 UTC (rev 5165) @@ -465,6 +465,7 @@ <Compile Include="NHSpecificTest\NH2266\Fixture.cs" /> <Compile Include="NHSpecificTest\NH2287\Domain.cs" /> <Compile Include="NHSpecificTest\NH2287\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2294\Fixture.cs" /> <Compile Include="TypesTest\CharClass.cs" /> <Compile Include="TypesTest\CharClassFixture.cs" /> <Compile Include="TypesTest\DateTimeClass.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2010-08-31 16:30:56
|
Revision: 5171 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5171&view=rev Author: fabiomaulo Date: 2010-08-31 16:30:50 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Fix NH-2307 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/NHibernate.ByteCode.LinFu.Tests.csproj trunk/nhibernate/src/NHibernate.Everything.sln trunk/nhibernate/src/NHibernate.Example.Web/Web.Config Property Changed: ---------------- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/ Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Castle ___________________________________________________________________ Modified: svn:ignore - obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* + obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* *[Rr]esparper* Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj 2010-08-31 16:14:12 UTC (rev 5170) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj 2010-08-31 16:30:50 UTC (rev 5171) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>NHibernate.ByteCode.Castle</RootNamespace> <AssemblyName>NHibernate.ByteCode.Castle</AssemblyName> - <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <TargetFrameworkSubset> </TargetFrameworkSubset> @@ -42,6 +42,9 @@ <HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="AssemblyInfo.cs" /> Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests ___________________________________________________________________ Modified: svn:ignore - *.aps *.eto *.user *.xml *.xsx *resharper* .#* AssemblyInfo.cs [Bb]in [Dd]ebug [Rr]elease bin hibernate.cfg.xml obj + *.aps *.eto *.user *.xml *.xsx *resharper* .#* AssemblyInfo.cs [Bb]in [Dd]ebug [Rr]elease bin hibernate.cfg.xml obj *[Rr]esparper* Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj 2010-08-31 16:14:12 UTC (rev 5170) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj 2010-08-31 16:30:50 UTC (rev 5171) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>NHibernate.ByteCode.Castle.Tests</RootNamespace> <AssemblyName>NHibernate.ByteCode.Castle.Tests</AssemblyName> - <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <TargetFrameworkSubset> </TargetFrameworkSubset> @@ -50,6 +50,9 @@ <HintPath>..\..\lib\net\3.5\nunit.framework.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests ___________________________________________________________________ Modified: svn:ignore - obj .#* *.user *.xsx AssemblyInfo.cs hibernate.cfg.xml *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* *.xml NHibernate.ByteCode.LinFu.Tests.pidb + obj .#* *.user *.xsx AssemblyInfo.cs hibernate.cfg.xml *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* *.xml NHibernate.ByteCode.LinFu.Tests.pidb *[Rr]esparper* Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/NHibernate.ByteCode.LinFu.Tests.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/NHibernate.ByteCode.LinFu.Tests.csproj 2010-08-31 16:14:12 UTC (rev 5170) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu.Tests/NHibernate.ByteCode.LinFu.Tests.csproj 2010-08-31 16:30:50 UTC (rev 5171) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>NHibernate.ByteCode.LinFu.Tests</RootNamespace> <AssemblyName>NHibernate.ByteCode.LinFu.Tests</AssemblyName> - <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <TargetFrameworkSubset> </TargetFrameworkSubset> @@ -50,6 +50,9 @@ <HintPath>..\..\lib\net\3.5\nunit.framework.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> <Reference Include="System.Data" /> <Reference Include="System.XML" /> </ItemGroup> Modified: trunk/nhibernate/src/NHibernate.Everything.sln =================================================================== --- trunk/nhibernate/src/NHibernate.Everything.sln 2010-08-31 16:14:12 UTC (rev 5170) +++ trunk/nhibernate/src/NHibernate.Everything.sln 2010-08-31 16:30:50 UTC (rev 5171) @@ -73,7 +73,7 @@ EndProject Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "NHibernate.Example.Web", "NHibernate.Example.Web\", "{C5D6EE68-1760-4F97-AD31-42343593D8C1}" ProjectSection(WebsiteProperties) = preProject - TargetFramework = "2.0" + TargetFramework = "3.5" ProjectReferences = "{5909BFE7-93CF-4E5F-BE22-6293368AF01D}|NHibernate.dll;{8289D6AD-9714-42D3-A94D-D4D9814D1281}|NHibernate.ByteCode.LinFu.dll;" Debug.AspNetCompiler.VirtualPath = "/NHibernate.Example.Web" Debug.AspNetCompiler.PhysicalPath = "NHibernate.Example.Web\" @@ -110,9 +110,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.Spring.Tests", "NHibernate.ByteCode.Spring.Tests\NHibernate.ByteCode.Spring.Tests.csproj", "{7EFC4549-3761-4B68-B81F-12AA51D78E92}" EndProject Global - GlobalSection(TestCaseManagementSettings) = postSolution - CategoryFile = NHibernate.vsmdi - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET Debug|Any CPU = Debug|Any CPU Modified: trunk/nhibernate/src/NHibernate.Example.Web/Web.Config =================================================================== --- trunk/nhibernate/src/NHibernate.Example.Web/Web.Config 2010-08-31 16:14:12 UTC (rev 5170) +++ trunk/nhibernate/src/NHibernate.Example.Web/Web.Config 2010-08-31 16:30:50 UTC (rev 5171) @@ -9,14 +9,18 @@ --> <configuration> <configSections> - <section name="hibernate-configuration" - type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" - requirePermission="false" /> <!-- Important under Medium Trust --> - - <section name="log4net" - type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" - requirePermission="false" /> <!-- Important under Medium Trust --> - </configSections> + <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/> + <!-- Important under Medium Trust --> + <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/> + <!-- Important under Medium Trust --> + <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> + <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> + <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> + <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> + <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> + <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> + <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> + <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections> <appSettings/> <connectionStrings/> <system.web> @@ -26,7 +30,12 @@ affects performance, set this value to true only during development. --> - <compilation debug="true"/> + <compilation debug="true"> + <assemblies> + <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> + <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> + <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> + <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> <!-- The <authentication> section enables configuration of the security authentication mode used by @@ -45,14 +54,19 @@ <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> - <pages enableViewState="false" enableViewStateMac="false" /> + <pages enableViewState="false" enableViewStateMac="false"> + <controls> + <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> + <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages> <!-- <trust level="Medium" /> --> - <httpModules> - <add name="CurrentSessionModule" type="NHibernate.Example.Web.CurrentSessionModule" /> - </httpModules> - </system.web> - + <add name="CurrentSessionModule" type="NHibernate.Example.Web.CurrentSessionModule"/> + <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules> + <httpHandlers> + <remove verb="*" path="*.asmx"/> + <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> + <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> + <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpHandlers></system.web> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <bytecode-provider type="null"/><!-- Important under Medium Trust --> <session-factory> @@ -66,28 +80,50 @@ <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> - <log4net> <!-- Define some output appenders --> - <appender name="trace" - type="log4net.Appender.TraceAppender, log4net"> + <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" /> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> </layout> </appender> - - <appender name="console" - type="log4net.Appender.ConsoleAppender, log4net"> + <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" /> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> </layout> </appender> - <root> - <priority value="WARN" /> - <appender-ref ref="trace" /> + <priority value="WARN"/> + <appender-ref ref="trace"/> </root> </log4net> -</configuration> + <system.codedom> + <compilers> + <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> + <providerOption name="CompilerVersion" value="v3.5"/> + <providerOption name="WarnAsError" value="false"/></compiler> + <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> + <providerOption name="CompilerVersion" value="v3.5"/> + <providerOption name="OptionInfer" value="true"/> + <providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom> + <system.webServer> + <validation validateIntegratedModeConfiguration="false"/> + <modules> + <remove name="ScriptModule"/> + <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules> + <handlers> + <remove name="WebServiceHandlerFactory-Integrated"/> + <remove name="ScriptHandlerFactory"/> + <remove name="ScriptHandlerFactoryAppServices"/> + <remove name="ScriptResource"/> + <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> + <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> + <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> + <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> + <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2010-09-01 17:17:19
|
Revision: 5174 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5174&view=rev Author: fabiomaulo Date: 2010-09-01 17:17:12 +0000 (Wed, 01 Sep 2010) Log Message: ----------- Fix NH-2302 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs trunk/nhibernate/src/NHibernate/Driver/SqlClientDriver.cs trunk/nhibernate/src/NHibernate/SqlTypes/StringClobSqlType.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.sln Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/StringLengthEntity.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs 2010-09-01 17:08:11 UTC (rev 5173) +++ trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs 2010-09-01 17:17:12 UTC (rev 5174) @@ -40,6 +40,7 @@ /// </remarks> public class MsSql2000Dialect : Dialect { + public const int MaxSizeForLengthLimitedStrings = 4000; /// <summary></summary> public MsSql2000Dialect() { @@ -65,9 +66,9 @@ RegisterColumnType(DbType.Int64, "BIGINT"); RegisterColumnType(DbType.Single, "REAL"); //synonym for FLOAT(24) RegisterColumnType(DbType.StringFixedLength, "NCHAR(255)"); - RegisterColumnType(DbType.StringFixedLength, 4000, "NCHAR($l)"); + RegisterColumnType(DbType.StringFixedLength, MaxSizeForLengthLimitedStrings, "NCHAR($l)"); RegisterColumnType(DbType.String, "NVARCHAR(255)"); - RegisterColumnType(DbType.String, 4000, "NVARCHAR($l)"); + RegisterColumnType(DbType.String, MaxSizeForLengthLimitedStrings, "NVARCHAR($l)"); RegisterColumnType(DbType.String, 1073741823, "NTEXT"); RegisterColumnType(DbType.Time, "DATETIME"); Modified: trunk/nhibernate/src/NHibernate/Driver/SqlClientDriver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/SqlClientDriver.cs 2010-09-01 17:08:11 UTC (rev 5173) +++ trunk/nhibernate/src/NHibernate/Driver/SqlClientDriver.cs 2010-09-01 17:17:12 UTC (rev 5174) @@ -1,6 +1,7 @@ using System.Data; using System.Data.SqlClient; using NHibernate.AdoNet; +using NHibernate.Dialect; using NHibernate.SqlCommand; using NHibernate.SqlTypes; @@ -123,14 +124,7 @@ break; case DbType.String: case DbType.StringFixedLength: - if (sqlType is StringClobSqlType) - { - dbParam.Size = MaxStringClobSize; - } - else - { - dbParam.Size = MaxStringSize; - } + dbParam.Size = IsText(dbParam, sqlType) ? MaxStringClobSize : MaxStringSize; break; case DbType.DateTime2: dbParam.Size = MaxDateTime2; @@ -141,12 +135,18 @@ } } + private static bool IsText(IDbDataParameter dbParam, SqlType sqlType) + { + return (sqlType is StringClobSqlType) || (sqlType.LengthDefined && sqlType.Length > MsSql2000Dialect.MaxSizeForLengthLimitedStrings && + (DbType.String == dbParam.DbType || DbType.StringFixedLength == dbParam.DbType)); + } + private static void SetVariableLengthParameterSize(IDbDataParameter dbParam, SqlType sqlType) { SetDefaultParameterSize(dbParam, sqlType); // Override the defaults using data from SqlType. - if (sqlType.LengthDefined) + if (sqlType.LengthDefined && !IsText(dbParam, sqlType)) { dbParam.Size = sqlType.Length; } Modified: trunk/nhibernate/src/NHibernate/SqlTypes/StringClobSqlType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/SqlTypes/StringClobSqlType.cs 2010-09-01 17:08:11 UTC (rev 5173) +++ trunk/nhibernate/src/NHibernate/SqlTypes/StringClobSqlType.cs 2010-09-01 17:17:12 UTC (rev 5174) @@ -26,7 +26,8 @@ /// <summary> /// Initializes a new instance of the <see cref="StringClobSqlType"/> class. /// </summary> - public StringClobSqlType() : base() + public StringClobSqlType() + : base(int.MaxValue / 2) { } Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Fixture.cs 2010-09-01 17:17:12 UTC (rev 5174) @@ -0,0 +1,176 @@ +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH2302 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void OnTearDown() + { + CleanUp(); + + base.OnTearDown(); + } + + [Test] + public void StringHugeLength() + { + int id; + // buildup a string the exceed the mapping + string str = GetFixedLengthString12000(); + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + // create and save the entity + StringLengthEntity entity = new StringLengthEntity(); + entity.StringHugeLength = str; + sess.Save(entity); + tx.Commit(); + id = entity.ID; + } + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + StringLengthEntity loaded = sess.Get<StringLengthEntity>(id); + Assert.IsNotNull(loaded); + Assert.AreEqual(12000, loaded.StringHugeLength.Length); + Assert.AreEqual(str, loaded.StringHugeLength); + tx.Commit(); + } + } + + [Test, Ignore("Not supported without specify the string length.")] + public void StringSqlType() + { + int id; + // buildup a string the exceed the mapping + string str = GetFixedLengthString12000(); + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + // create and save the entity + StringLengthEntity entity = new StringLengthEntity(); + entity.StringSqlType = str; + sess.Save(entity); + tx.Commit(); + id = entity.ID; + } + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + StringLengthEntity loaded = sess.Get<StringLengthEntity>(id); + Assert.IsNotNull(loaded); + Assert.AreEqual(12000, loaded.StringSqlType.Length); + Assert.AreEqual(str, loaded.StringSqlType); + tx.Commit(); + } + } + + [Test] + public void BlobSqlType() + { + int id; + // buildup a string the exceed the mapping + string str = GetFixedLengthString12000(); + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + // create and save the entity + StringLengthEntity entity = new StringLengthEntity(); + entity.BlobSqlType = str; + sess.Save(entity); + tx.Commit(); + id = entity.ID; + } + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + StringLengthEntity loaded = sess.Get<StringLengthEntity>(id); + Assert.IsNotNull(loaded); + Assert.AreEqual(12000, loaded.BlobSqlType.Length); + Assert.AreEqual(str, loaded.BlobSqlType); + tx.Commit(); + } + } + + [Test] + public void BlobWithLength() + { + int id; + // buildup a string the exceed the mapping + string str = GetFixedLengthString12000(); + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + // create and save the entity + StringLengthEntity entity = new StringLengthEntity(); + entity.BlobLength = str; + sess.Save(entity); + tx.Commit(); + id = entity.ID; + } + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + StringLengthEntity loaded = sess.Get<StringLengthEntity>(id); + Assert.IsNotNull(loaded); + Assert.AreEqual(12000, loaded.BlobLength.Length); + Assert.AreEqual(str, loaded.BlobLength); + tx.Commit(); + } + } + + [Test] + public void BlobWithoutLength() + { + int id; + // buildup a string the exceed the mapping + string str = GetFixedLengthString12000(); + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + // create and save the entity + StringLengthEntity entity = new StringLengthEntity(); + entity.Blob = str; + sess.Save(entity); + tx.Commit(); + id = entity.ID; + } + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + StringLengthEntity loaded = sess.Get<StringLengthEntity>(id); + Assert.IsNotNull(loaded); + Assert.AreEqual(12000, loaded.Blob.Length); + Assert.AreEqual(str, loaded.Blob); + tx.Commit(); + } + } + + private void CleanUp() + { + using (ISession session = OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + session.Delete("from StringLengthEntity"); + tx.Commit(); + } + } + + private static string GetFixedLengthString12000() + { + return new string('a', 12000); + } + + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/Mappings.hbm.xml 2010-09-01 17:17:12 UTC (rev 5174) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false" default-cascade="all-delete-orphan"> + <class name="NHibernate.Test.NHSpecificTest.NH2302.StringLengthEntity, NHibernate.Test" table="StringLengthEntity" + lazy="false"> + <id name="ID" access="nosetter.pascalcase-m" column="ID" type="Int32" > + <generator class="native" /> + </id> + <!-- this generates an nvarchar(255) --> + <property name="StringDefault" column="StringDefault" type="string" /> + <!-- this generates an nvarchar(50) --> + <property name="StringFixedLength" column="StringFixedLength" type="string" length="50" /> + <!-- this generates an nvarchar(max) but it operate a truncation on reading and writing, in NHib 2.1 this was --> + <property name="StringHugeLength" column="StringHugeLength" type="string" length="10000" /> + <!-- this generates an nvarchar(max) but it operate a truncation reading and writing to the default string length (4000) --> + <property name="StringSqlType" type="string"> + <column name="StringSqlType" sql-type="nvarchar(max)" /> + </property> + <!-- this generates an nvarchar(255) otherwise reading and writing seem to be ok --> + <property name="Blob" column="Blob" type="StringClob" /> + <!-- this generates an nvarchar(max) but it operate a truncation on reading and writing (same as StringHugeLength) --> + <property name="BlobLength" column="BlobLength" type="StringClob" length="15000" /> + <!-- this mapping works! for generation, writing and reading --> + <property name="BlobSqlType" type="StringClob" > + <column name="BlobSqlType" sql-type="nvarchar(max)" /> + </property> + </class> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/StringLengthEntity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/StringLengthEntity.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2302/StringLengthEntity.cs 2010-09-01 17:17:12 UTC (rev 5174) @@ -0,0 +1,25 @@ +namespace NHibernate.Test.NHSpecificTest.NH2302 +{ + public class StringLengthEntity + { + private int mID = 0; + public int ID + { + get { return mID; } + } + + public string StringDefault { get; set; } + + public string StringFixedLength { get; set; } + + public string StringHugeLength { get; set; } + + public string StringSqlType { get; set; } + + public string Blob { get; set; } + + public string BlobLength { get; set; } + + public string BlobSqlType { get; set; } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-09-01 17:08:11 UTC (rev 5173) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-09-01 17:17:12 UTC (rev 5174) @@ -471,6 +471,8 @@ <Compile Include="NHSpecificTest\NH2287\Fixture.cs" /> <Compile Include="NHSpecificTest\NH2293\Fixture.cs" /> <Compile Include="NHSpecificTest\NH2294\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2302\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2302\StringLengthEntity.cs" /> <Compile Include="NHSpecificTest\NH2303\Fixture.cs" /> <Compile Include="NHSpecificTest\NH2303\Model.cs" /> <Compile Include="TypesTest\CharClass.cs" /> @@ -2261,6 +2263,7 @@ <EmbeddedResource Include="CollectionTest\NullableValueTypeElementMapFixture.hbm.xml" /> <EmbeddedResource Include="DriverTest\EntityForMs2008.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH2302\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2303\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2287\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2266\Mappings.hbm.xml" /> Modified: trunk/nhibernate/src/NHibernate.sln =================================================================== --- trunk/nhibernate/src/NHibernate.sln 2010-09-01 17:08:11 UTC (rev 5173) +++ trunk/nhibernate/src/NHibernate.sln 2010-09-01 17:17:12 UTC (rev 5174) @@ -23,6 +23,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.TestDatabaseSetup", "NHibernate.TestDatabaseSetup\NHibernate.TestDatabaseSetup.csproj", "{BEEC1564-6FB6-49F7-BBE5-8EBD2F0F6E8A}" EndProject Global + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = NHibernate.vsmdi + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jul...@us...> - 2010-12-05 08:35:56
|
Revision: 5294 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5294&view=rev Author: julian-maughan Date: 2010-12-05 08:35:46 +0000 (Sun, 05 Dec 2010) Log Message: ----------- Relocation of Northwind domain entities and mappings from NHibernate.Tests to NHibernate.DomainModel project Modified Paths: -------------- trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Address.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Animal.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/AnotherEntity.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Customer.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Employee.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Entity.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Northwind.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Order.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/OrderLine.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Patient.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Product.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/ProductCategory.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Region.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Role.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Shipper.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Supplier.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Territory.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Timesheet.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/User.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/UserComponent.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/UserDto.cs trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Animal.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/AnotherEntity.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Customer.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Employee.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Order.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/OrderLine.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Patient.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Product.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/ProductCategory.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Region.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Role.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Shipper.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Supplier.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Territory.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/TimeSheet.hbm.xml trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/User.hbm.xml trunk/nhibernate/src/NHibernate.Test/Linq/BinaryBooleanExpressionTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/BooleanMethodExtensionExample.cs trunk/nhibernate/src/NHibernate.Test/Linq/DynamicQueryTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/EagerLoadTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/EnumTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs trunk/nhibernate/src/NHibernate.Test/Linq/LinqReadonlyTestsContext.cs trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs trunk/nhibernate/src/NHibernate.Test/Linq/MiscellaneousTextFixture.cs trunk/nhibernate/src/NHibernate.Test/Linq/NorthwindDbCreator.cs trunk/nhibernate/src/NHibernate.Test/Linq/NullComparisonTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/ParameterisedQueries.cs trunk/nhibernate/src/NHibernate.Test/Linq/PatientTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/QueryReuseTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/RegresstionTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/SelectionTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.DomainModel/Northwind/ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/ Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/ trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/ Modified: trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.csproj 2010-12-05 08:35:46 UTC (rev 5294) @@ -137,6 +137,27 @@ <Compile Include="NHSpecific\SimpleComponent.cs" /> <Compile Include="NHSpecific\Team.cs" /> <Compile Include="NHSpecific\UnsavedType.cs" /> + <Compile Include="Northwind\Entities\Address.cs" /> + <Compile Include="Northwind\Entities\Animal.cs" /> + <Compile Include="Northwind\Entities\AnotherEntity.cs" /> + <Compile Include="Northwind\Entities\Customer.cs" /> + <Compile Include="Northwind\Entities\Employee.cs" /> + <Compile Include="Northwind\Entities\Entity.cs" /> + <Compile Include="Northwind\Entities\Northwind.cs" /> + <Compile Include="Northwind\Entities\Order.cs" /> + <Compile Include="Northwind\Entities\OrderLine.cs" /> + <Compile Include="Northwind\Entities\Patient.cs" /> + <Compile Include="Northwind\Entities\Product.cs" /> + <Compile Include="Northwind\Entities\ProductCategory.cs" /> + <Compile Include="Northwind\Entities\Region.cs" /> + <Compile Include="Northwind\Entities\Role.cs" /> + <Compile Include="Northwind\Entities\Shipper.cs" /> + <Compile Include="Northwind\Entities\Supplier.cs" /> + <Compile Include="Northwind\Entities\Territory.cs" /> + <Compile Include="Northwind\Entities\Timesheet.cs" /> + <Compile Include="Northwind\Entities\User.cs" /> + <Compile Include="Northwind\Entities\UserComponent.cs" /> + <Compile Include="Northwind\Entities\UserDto.cs" /> <Compile Include="NotMono.cs" /> <Compile Include="One.cs" /> <Compile Include="Outer.cs" /> @@ -223,6 +244,22 @@ </ItemGroup> <ItemGroup> <None Include="NHibernate.DomainModel.build" /> + <EmbeddedResource Include="Northwind\Mappings\Animal.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\AnotherEntity.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Customer.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Employee.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Order.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\OrderLine.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Patient.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Product.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\ProductCategory.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Region.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Role.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Shipper.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Supplier.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\Territory.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\TimeSheet.hbm.xml" /> + <EmbeddedResource Include="Northwind\Mappings\User.hbm.xml" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\NHibernate\NHibernate.csproj"> @@ -241,6 +278,9 @@ <Service Include="..\..\..\..\trunk\nhibernate\src\NHibernate.DomainModel\{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> </ItemGroup> <ItemGroup> + <Folder Include="Northwind" /> + <Folder Include="Northwind\Entities" /> + <Folder Include="Northwind\Mappings" /> <Folder Include="Properties\" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Property changes on: trunk/nhibernate/src/NHibernate.DomainModel/Northwind ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Address.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Address.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Address.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Address { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Animal.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Animal.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Animal.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Animal { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/AnotherEntity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/AnotherEntity.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/AnotherEntity.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class AnotherEntity { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Customer.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Customer.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Customer.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Collections.ObjectModel; using Iesi.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Customer { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Employee.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Employee.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Employee.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -3,7 +3,7 @@ using System.Collections.ObjectModel; using Iesi.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Employee { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Entity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Entity.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Entity.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public abstract class Entity<T> { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Northwind.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Northwind.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Northwind.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -3,7 +3,7 @@ using System.Linq; using NHibernate.Linq; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Northwind { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Order.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Order.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Order.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -3,7 +3,7 @@ using System.Collections.ObjectModel; using Iesi.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Order { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/OrderLine.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/OrderLine.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/OrderLine.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class OrderLine : Entity<OrderLine> { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Patient.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Patient.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Patient.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Patient { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Product.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Product.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Product.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Thing { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/ProductCategory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/ProductCategory.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/ProductCategory.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Collections.ObjectModel; using Iesi.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class ProductCategory { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Region.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Region.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Region.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Collections.ObjectModel; using Iesi.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Region : Entity<Region> { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Role.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Role.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Role.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Role { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Shipper.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Shipper.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Shipper.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Shipper { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Supplier.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Supplier.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Supplier.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Collections.ObjectModel; using Iesi.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Supplier { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Territory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Territory.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Territory.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Collections.ObjectModel; using Iesi.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Territory : Entity<Territory> { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Timesheet.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/Timesheet.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/Timesheet.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class Timesheet { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/User.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/User.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/User.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Data; using NHibernate.Type; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { [Flags] public enum FeatureSet Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/UserComponent.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/UserComponent.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/UserComponent.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class UserComponent { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/UserDto.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Entities/UserDto.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Entities/UserDto.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ using System; -namespace NHibernate.Test.Linq.Entities +namespace NHibernate.DomainModel.Northwind.Entities { public class UserDto { Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Animal.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Animal.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Animal.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Animal"> <id name="Id"> <generator class="native"/> Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/AnotherEntity.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/AnotherEntity.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/AnotherEntity.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="AnotherEntity" table="AnotherEntity"> <id name="Id"> <generator class="native" /> Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Customer.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Customer.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Customer.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Customer" table="Customers"> <id name="CustomerId" column="CustomerId" type="string" unsaved-value="-1" @@ -17,7 +17,7 @@ <property name="ContactTitle" column="ContactTitle" type="string" length="30" access="field.camelcase-underscore"/> - <component name="Address" class="NHibernate.Test.Linq.Entities.Address, NHibernate.Test" + <component name="Address" class="NHibernate.DomainModel.Northwind.Entities.Address, NHibernate.DomainModel" access="field.camelcase-underscore" insert="true" update="true"> <property name="Street" column="Address" type="string" length="60" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Employee.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Employee.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Employee.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Employee" table="Employees"> <id name="EmployeeId" column="EmployeeId" type="int" unsaved-value="-1" @@ -26,7 +26,7 @@ <property name="HireDate" column="HireDate" type="DateTime" access="field.camelcase-underscore"/> - <component name="Address" class="NHibernate.Test.Linq.Entities.Address, NHibernate.Test" + <component name="Address" class="NHibernate.DomainModel.Northwind.Entities.Address, NHibernate.DomainModel" access="field.camelcase-underscore" insert="true" update="true"> <property name="Street" column="Address" type="string" length="60" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Order.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Order.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Order.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Order" table="Orders"> <id name="OrderId" column="OrderId" type="int" unsaved-value="-1" @@ -32,7 +32,7 @@ <property name="ShippedTo" column="ShipName" type="string" length="40" access="field.camelcase-underscore"/> - <component name="ShippingAddress" class="NHibernate.Test.Linq.Entities.Address, NHibernate.Test" + <component name="ShippingAddress" class="NHibernate.DomainModel.Northwind.Entities.Address, NHibernate.DomainModel" access="field.camelcase-underscore" insert="true" update="true"> <property name="Street" column="ShipAddress" type="string" length="60" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/OrderLine.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/OrderLine.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/OrderLine.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="OrderLine" table="OrderLines"> Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Patient.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Patient.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Patient.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Patient" table="Patients"> <id name="Id" column="PatientId" type="Int64"> <generator class="native" /> @@ -23,7 +23,7 @@ <id name="Id" column="PatientRecordId" type="System.Int64"> <generator class="native" /> </id> - <property type="NHibernate.Test.Linq.Entities.Gender, NHibernate.Test" not-null="true" name="Gender" column="`Gender`" /> + <property type="NHibernate.DomainModel.Northwind.Entities.Gender, NHibernate.DomainModel" not-null="true" name="Gender" column="`Gender`" /> <property type="System.DateTime" not-null="true" name="BirthDate" column="`BirthDate`" /> <component name="Name" class="PatientName"> Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Product.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Product.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Product.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> - <import class="NHibernate.Test.Linq.Entities.Thing, NHibernate.Test"/> + <import class="NHibernate.DomainModel.Northwind.Entities.Thing, NHibernate.DomainModel"/> <class name="Product" table="Products"> <id name="ProductId" column="ProductId" type="int" unsaved-value="-1" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/ProductCategory.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/ProductCategory.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/ProductCategory.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="ProductCategory" table="Categories"> Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Region.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Region.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Region.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Region" table="Region"> <id name="Id" column="RegionId" type="long" unsaved-value="-1" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Role.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Role.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Role.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Role" table="Roles"> <id name="Id"> <generator class="native" /> Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Shipper.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Shipper.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Shipper.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Shipper" table="Shippers"> <id name="ShipperId" column="ShipperId" type="int" unsaved-value="-1" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Supplier.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Supplier.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Supplier.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Supplier" table="Suppliers"> <id name="SupplierId" column="SupplierId" type="int" unsaved-value="-1" @@ -20,7 +20,7 @@ <property name="HomePage" column="HomePage" type="string" access="field.camelcase-underscore"/> - <component name="Address" class="NHibernate.Test.Linq.Entities.Address, NHibernate.Test" + <component name="Address" class="NHibernate.DomainModel.Northwind.Entities.Address, NHibernate.DomainModel" access="field.camelcase-underscore" insert="true" update="true"> <property name="Street" column="Address" type="string" length="60" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Territory.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/Territory.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/Territory.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" - namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> + namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Territory" table="Territories"> <id name="Id" column="TerritoryId" type="long" unsaved-value="-1" Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/TimeSheet.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/TimeSheet.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/TimeSheet.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="Timesheet" table="Timesheets"> <id name="Id" column="TimesheetId"> <generator class="native" /> @@ -10,12 +10,12 @@ <bag name="Entries" cascade="all-delete-orphan"> <key column="TimesheetID" /> - <one-to-many class="NHibernate.Test.Linq.Entities.TimesheetEntry" /> + <one-to-many class="NHibernate.DomainModel.Northwind.Entities.TimesheetEntry" /> </bag> <bag name="Users" cascade="all-delete-orphan" access="field.camelcase" table="TimeSheetUsers"> <key column="TimesheetID" /> - <many-to-many class="NHibernate.Test.Linq.Entities.User" column="UserId" /> + <many-to-many class="NHibernate.DomainModel.Northwind.Entities.User" column="UserId" /> </bag> </class> Modified: trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/User.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/Mappings/User.hbm.xml 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.DomainModel/Northwind/Mappings/User.hbm.xml 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.Linq.Entities" assembly="NHibernate.Test"> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.DomainModel.Northwind.Entities" assembly="NHibernate.DomainModel"> <class name="User" table="Users" proxy="IUser" > @@ -12,7 +12,7 @@ <property name="RegisteredAt" type="DateTime" /> <property name="LastLoginDate" type="DateTime" /> - <property name="Enum1" type="NHibernate.Test.Linq.Entities.EnumStoredAsStringType, NHibernate.Test"> + <property name="Enum1" type="NHibernate.DomainModel.Northwind.Entities.EnumStoredAsStringType, NHibernate.DomainModel"> <column name="Enum1" length="12" /> </property> Modified: trunk/nhibernate/src/NHibernate.Test/Linq/BinaryBooleanExpressionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/BinaryBooleanExpressionTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/BinaryBooleanExpressionTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System; using System.Linq; using System.Linq.Expressions; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/BooleanMethodExtensionExample.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/BooleanMethodExtensionExample.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/BooleanMethodExtensionExample.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -10,7 +10,7 @@ using NHibernate.Linq; using NHibernate.Linq.Functions; using NHibernate.Linq.Visitors; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; using SharpTestsEx; Modified: trunk/nhibernate/src/NHibernate.Test/Linq/DynamicQueryTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/DynamicQueryTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/DynamicQueryTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System; using System.Linq; //using System.Linq.Dynamic; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/EagerLoadTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/EagerLoadTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/EagerLoadTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ using System.Linq; using NHibernate.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; using SharpTestsEx; Modified: trunk/nhibernate/src/NHibernate.Test/Linq/EnumTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/EnumTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/EnumTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ using System.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/LinqQuerySamples.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/LinqReadonlyTestsContext.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/LinqReadonlyTestsContext.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/LinqReadonlyTestsContext.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -14,29 +14,37 @@ [SetUpFixture] public class LinqReadonlyTestsContext { + /// <summary> + /// Assembly to load mapping files from + /// </summary> + protected virtual string MappingsAssembly + { + get { return "NHibernate.DomainModel"; } + } + private IEnumerable<string> Mappings { get { return new[] - { - "Linq.Mappings.Customer.hbm.xml", - "Linq.Mappings.Employee.hbm.xml", - "Linq.Mappings.Order.hbm.xml", - "Linq.Mappings.OrderLine.hbm.xml", - "Linq.Mappings.Product.hbm.xml", - "Linq.Mappings.ProductCategory.hbm.xml", - "Linq.Mappings.Region.hbm.xml", - "Linq.Mappings.Shipper.hbm.xml", - "Linq.Mappings.Supplier.hbm.xml", - "Linq.Mappings.Territory.hbm.xml", - "Linq.Mappings.AnotherEntity.hbm.xml", - "Linq.Mappings.Role.hbm.xml", - "Linq.Mappings.User.hbm.xml", - "Linq.Mappings.TimeSheet.hbm.xml", - "Linq.Mappings.Animal.hbm.xml", - "Linq.Mappings.Patient.hbm.xml" - }; + { + "Northwind.Mappings.Customer.hbm.xml", + "Northwind.Mappings.Employee.hbm.xml", + "Northwind.Mappings.Order.hbm.xml", + "Northwind.Mappings.OrderLine.hbm.xml", + "Northwind.Mappings.Product.hbm.xml", + "Northwind.Mappings.ProductCategory.hbm.xml", + "Northwind.Mappings.Region.hbm.xml", + "Northwind.Mappings.Shipper.hbm.xml", + "Northwind.Mappings.Supplier.hbm.xml", + "Northwind.Mappings.Territory.hbm.xml", + "Northwind.Mappings.AnotherEntity.hbm.xml", + "Northwind.Mappings.Role.hbm.xml", + "Northwind.Mappings.User.hbm.xml", + "Northwind.Mappings.TimeSheet.hbm.xml", + "Northwind.Mappings.Animal.hbm.xml", + "Northwind.Mappings.Patient.hbm.xml" + }; } } @@ -106,10 +114,9 @@ configuration.SetProperty(Environment.ConnectionProvider, typeof (DriverConnectionProvider).AssemblyQualifiedName); - string assemblyName = "NHibernate.Test"; - Assembly assembly = Assembly.Load(assemblyName); + Assembly assembly = Assembly.Load(MappingsAssembly); - foreach (string file in Mappings.Select(mf => assemblyName + "." + mf)) + foreach (string file in Mappings.Select(mf => MappingsAssembly + "." + mf)) { configuration.AddResource(file, assembly); } Modified: trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/LinqTestCase.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,7 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq @@ -11,34 +11,29 @@ private Northwind _northwind; private ISession _session; - protected override string MappingsAssembly - { - get { return "NHibernate.Test"; } - } - protected override IList Mappings { get { return new[] - { - "Linq.Mappings.Customer.hbm.xml", - "Linq.Mappings.Employee.hbm.xml", - "Linq.Mappings.Order.hbm.xml", - "Linq.Mappings.OrderLine.hbm.xml", - "Linq.Mappings.Product.hbm.xml", - "Linq.Mappings.ProductCategory.hbm.xml", - "Linq.Mappings.Region.hbm.xml", - "Linq.Mappings.Shipper.hbm.xml", - "Linq.Mappings.Supplier.hbm.xml", - "Linq.Mappings.Territory.hbm.xml", - "Linq.Mappings.AnotherEntity.hbm.xml", - "Linq.Mappings.Role.hbm.xml", - "Linq.Mappings.User.hbm.xml", - "Linq.Mappings.TimeSheet.hbm.xml", - "Linq.Mappings.Animal.hbm.xml", - "Linq.Mappings.Patient.hbm.xml" - }; + { + "Northwind.Mappings.Customer.hbm.xml", + "Northwind.Mappings.Employee.hbm.xml", + "Northwind.Mappings.Order.hbm.xml", + "Northwind.Mappings.OrderLine.hbm.xml", + "Northwind.Mappings.Product.hbm.xml", + "Northwind.Mappings.ProductCategory.hbm.xml", + "Northwind.Mappings.Region.hbm.xml", + "Northwind.Mappings.Shipper.hbm.xml", + "Northwind.Mappings.Supplier.hbm.xml", + "Northwind.Mappings.Territory.hbm.xml", + "Northwind.Mappings.AnotherEntity.hbm.xml", + "Northwind.Mappings.Role.hbm.xml", + "Northwind.Mappings.User.hbm.xml", + "Northwind.Mappings.TimeSheet.hbm.xml", + "Northwind.Mappings.Animal.hbm.xml", + "Northwind.Mappings.Patient.hbm.xml" + }; } } Modified: trunk/nhibernate/src/NHibernate.Test/Linq/MiscellaneousTextFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/MiscellaneousTextFixture.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/MiscellaneousTextFixture.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Linq; using System.Linq.Expressions; using NHibernate.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/NorthwindDbCreator.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/NorthwindDbCreator.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/NorthwindDbCreator.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -2,7 +2,7 @@ using System.Linq; using System.Collections; using System.Collections.Generic; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; namespace NHibernate.Test.Linq { Modified: trunk/nhibernate/src/NHibernate.Test/Linq/NullComparisonTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/NullComparisonTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/NullComparisonTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -3,7 +3,7 @@ using System.Linq; using System.Text; using NHibernate.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/ParameterisedQueries.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/ParameterisedQueries.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/ParameterisedQueries.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -4,7 +4,7 @@ using System.Linq; using System.Linq.Expressions; using NHibernate.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/PatientTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/PatientTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/PatientTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,5 +1,5 @@ using System.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/QueryReuseTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/QueryReuseTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/QueryReuseTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/RegresstionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/RegresstionTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/RegresstionTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ using System.Linq; using NUnit.Framework; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; namespace NHibernate.Test.Linq { Modified: trunk/nhibernate/src/NHibernate.Test/Linq/SelectionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/SelectionTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/SelectionTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -1,6 +1,6 @@ using System; using System.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; namespace NHibernate.Test.Linq Modified: trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-12-05 08:35:46 UTC (rev 5294) @@ -3,7 +3,7 @@ using System.Linq; using System.Linq.Expressions; using NHibernate.Linq; -using NHibernate.Test.Linq.Entities; +using NHibernate.DomainModel.Northwind.Entities; using NUnit.Framework; using SharpTestsEx; Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-12-05 01:54:39 UTC (rev 5293) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-12-05 08:35:46 UTC (rev 5294) @@ -417,27 +417,6 @@ <Compile Include="Linq\DateTimeTests.cs" /> <Compile Include="Linq\DynamicQueryTests.cs" /> <Compile Include="Linq\EagerLoadTests.cs" /> - <Compile Include="Linq\Entities\Address.cs" /> - <Compile Include="Linq\Entities\Animal.cs" /> - <Compile Include="Linq\Entities\AnotherEntity.cs" /> - <Compile Include="Linq\Entities\Customer.cs" /> - <Compile Include="Linq\Entities\Employee.cs" /> - <Compile Include="Linq\Entities\Entity.cs" /> - <Compile Include="Linq\Entities\Northwind.cs" /> - <Compile Include="Linq\Entities\Order.cs" /> - <Compile Include="Linq\Entities\OrderLine.cs" /> - <Compile Include="Linq\Entities\Patient.cs" /> - <Compile Include="Linq\Entities\Product.cs" /> - <Compile Include="Linq\Entities\ProductCategory.cs" /> - <Compile Include="Linq\Entities\Region.cs" /> - <Compile Include="Linq\Entities\Role.cs" /> - <Compile Include="Linq\Entities\Shipper.cs" /> - <Compile Include="Linq\Entities\Supplier.cs" /> - <Compile Include="Linq\Entities\Territory.cs" /> - <Compile Include="Linq\Entities\Timesheet.cs" /> - <Compile Include="Linq\Entities\User.cs" /> - <Compile Include="Linq\Entities\UserComponent.cs" /> - <Compile Include="Linq\Entities\UserDto.cs" /> <Compile Include="Linq\EnumTests.cs" /> <Compile Include="Linq\ExtensionMethods.cs" /> <Compile Include="Linq\FunctionTests.cs" /> @@ -2430,15 +2409,9 @@ <EmbeddedResource Include="NHSpecificTest\NH1978\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2044\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2030\Mappings.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Patient.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2055\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2057\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2011\Mappings.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Animal.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\AnotherEntity.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Role.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\TimeSheet.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\User.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ManyToOneFilters20Behaviour\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2000\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2003\Mappings.hbm.xml" /> @@ -2465,16 +2438,6 @@ <EmbeddedResource Include="NHSpecificTest\NH1939\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1911\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1920\Mappings.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Customer.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Employee.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Order.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\OrderLine.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Product.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\ProductCategory.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Region.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Shipper.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Supplier.hbm.xml" /> - <EmbeddedResource Include="Linq\Mappings\Territory.hbm.xml" /> <EmbeddedResource Include="IdTest\AssignedClass.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1927\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1928\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |