You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dav...@us...> - 2008-11-29 18:25:26
|
Revision: 3938 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3938&view=rev Author: davybrion Date: 2008-11-29 18:25:20 +0000 (Sat, 29 Nov 2008) Log Message: ----------- applied patch from Jon Stelly for NH-1579 Modified Paths: -------------- branches/2.0.x/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs branches/2.0.x/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj Added Paths: ----------- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs Modified: branches/2.0.x/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs 2008-11-29 18:07:21 UTC (rev 3937) +++ branches/2.0.x/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs 2008-11-29 18:25:20 UTC (rev 3938) @@ -522,7 +522,8 @@ public override string OneToManyFilterFragment(string alias) { - return forceDiscriminator ? DiscriminatorFilterFragment(alias) : string.Empty; + //Previous code was checking forceDiscriminator value here, which caused issues with collection loading. + return DiscriminatorFilterFragment(alias); } private string DiscriminatorFilterFragment(string alias) Added: branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs (rev 0) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs 2008-11-29 18:25:20 UTC (rev 3938) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public class Apple : Fruit + { + public Apple(Entity container) + : base(container) + { + } + + protected Apple() + { + } + } +} Added: branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs (rev 0) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs 2008-11-29 18:25:20 UTC (rev 3938) @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public class Cart : Entity + { + public Cart(string vendorName) + { + if (String.IsNullOrEmpty(vendorName)) + throw new ArgumentNullException("vendorName"); + + VendorName = vendorName; + EnsureCollections(); + } + + private void EnsureCollections() + { + if(Apples == null) + Apples = new List<Apple>(); + if(Oranges == null) + Oranges = new List<Orange>(); + } + + protected Cart() + { + } + + public string VendorName { get; set; } + public IList<Apple> Apples { get; set; } + public IList<Orange> Oranges { get; set; } + } +} Added: branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs (rev 0) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs 2008-11-29 18:25:20 UTC (rev 3938) @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public abstract class Entity + { + public Entity() + { + } + + public Guid ID { get; private set; } + } +} Added: branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs (rev 0) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs 2008-11-29 18:25:20 UTC (rev 3938) @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public abstract class Fruit : Entity + { + public Fruit(Entity container) + { + if (container == null) + throw new ArgumentNullException("container"); + Container = container; + } + + protected Fruit() + { + } + + public Entity Container { get; private set; } + + } +} Added: branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml (rev 0) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml 2008-11-29 18:25:20 UTC (rev 3938) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.NHSpecificTest.NH1579" assembly="NHibernate.Test" default-lazy="false"> + <class name="Entity" abstract="true" table="Entities"> + <id name="ID"> + <generator class="guid.comb" /> + </id> + <discriminator column="EntityType" length="64"/> + </class> + + <subclass name="Fruit" abstract="true" discriminator-value="Fruit" extends="NHibernate.Test.NHSpecificTest.NH1579.Entity, NHibernate.Test"> + <many-to-one name="Container" column="ContainerID" /> + </subclass> + <subclass name="Apple" discriminator-value="Apple" extends="NHibernate.Test.NHSpecificTest.NH1579.Fruit, NHibernate.Test"/> + <subclass name="Orange" discriminator-value="Orange" extends="NHibernate.Test.NHSpecificTest.NH1579.Fruit, NHibernate.Test"/> + + <subclass name="Cart" discriminator-value="Cart" extends="NHibernate.Test.NHSpecificTest.NH1579.Entity, NHibernate.Test"> + <property name="VendorName" length="128"/> + <bag name="Apples" cascade="all-delete-orphan" inverse="true"> + <key column="ContainerID"/> + <one-to-many class="NHibernate.Test.NHSpecificTest.NH1579.Apple, NHibernate.Test"/> + </bag> + <bag name="Oranges" cascade="all-delete-orphan" inverse="true"> + <key column="ContainerID"/> + <one-to-many class="NHibernate.Test.NHSpecificTest.NH1579.Orange, NHibernate.Test"/> + </bag> + </subclass> +</hibernate-mapping> Added: branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs (rev 0) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs 2008-11-29 18:25:20 UTC (rev 3938) @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + [TestFixture] + public class NH1579Fixture : BugTestCase + { + [Test] + public void Test() + { + Cart cart = new Cart("Fred"); + Apple apple = new Apple(cart); + Orange orange = new Orange(cart); + cart.Apples.Add(apple); + cart.Oranges.Add(orange); + + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Save(cart); + tx.Commit(); + } + } + + using (ISession session = OpenSession()) + { + IQuery query = session.CreateQuery("FROM Fruit f WHERE f.Container.id = :containerID"); + query.SetGuid("containerID", cart.ID); + IList<Fruit> fruit = query.List<Fruit>(); + Assert.AreEqual(2, fruit.Count); + } + + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Delete("FROM Entity"); + tx.Commit(); + } + } + } + } +} Added: branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs (rev 0) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs 2008-11-29 18:25:20 UTC (rev 3938) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public class Orange : Fruit + { + public Orange(Entity container) + : base(container) + { + } + + protected Orange() + { + } + } +} Modified: branches/2.0.x/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj =================================================================== --- branches/2.0.x/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj 2008-11-29 18:07:21 UTC (rev 3937) +++ branches/2.0.x/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj 2008-11-29 18:25:20 UTC (rev 3938) @@ -1,14 +1,19 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<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> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{7AEE5B37-C552-4E59-9B6F-88755BCB5070}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>NHibernate.Test</RootNamespace> <AssemblyName>NHibernate.Test</AssemblyName> + <FileUpgradeFlags> + </FileUpgradeFlags> + <OldToolsVersion>2.0</OldToolsVersion> + <UpgradeBackupLocation> + </UpgradeBackupLocation> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -265,6 +270,12 @@ <Compile Include="NHSpecificTest\BasicTimeFixture.cs" /> <Compile Include="NHSpecificTest\BugTestCase.cs" /> <Compile Include="NHSpecificTest\CollectionFixture.cs" /> + <Compile Include="NHSpecificTest\NH1579\Apple.cs" /> + <Compile Include="NHSpecificTest\NH1579\Cart.cs" /> + <Compile Include="NHSpecificTest\NH1579\Entity.cs" /> + <Compile Include="NHSpecificTest\NH1579\Fruit.cs" /> + <Compile Include="NHSpecificTest\NH1579\NH1579Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1579\Orange.cs" /> <Compile Include="NHSpecificTest\NH1077\A.cs" /> <Compile Include="NHSpecificTest\NH1077\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1098\FilterParameterOrderFixture.cs" /> @@ -1363,6 +1374,9 @@ <EmbeddedResource Include="NHSpecificTest\NH1508\Mappings.hbm.xml" /> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="NHSpecificTest\NH1579\Mappings.hbm.xml" /> + </ItemGroup> + <ItemGroup> <Folder Include="Properties\" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> @@ -1381,4 +1395,4 @@ if exist "$(ProjectDir)hibernate.cfg.xml" (copy "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml") copy /y "..\..\..\NHibernate.DomainModel\ABC.hbm.xml" "ABC.hbm.xml"</PostBuildEvent> </PropertyGroup> -</Project> \ No newline at end of file +</Project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2008-11-29 18:07:26
|
Revision: 3937 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3937&view=rev Author: davybrion Date: 2008-11-29 18:07:21 +0000 (Sat, 29 Nov 2008) Log Message: ----------- applied patch from Jon Stelly for NH-1579 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs Modified: trunk/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs 2008-11-27 20:12:33 UTC (rev 3936) +++ trunk/nhibernate/src/NHibernate/Persister/Entity/SingleTableEntityPersister.cs 2008-11-29 18:07:21 UTC (rev 3937) @@ -522,7 +522,8 @@ public override string OneToManyFilterFragment(string alias) { - return forceDiscriminator ? DiscriminatorFilterFragment(alias) : string.Empty; + //Previous code was checking forceDiscriminator value here, which caused issues with collection loading. + return DiscriminatorFilterFragment(alias); } private string DiscriminatorFilterFragment(string alias) Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Apple.cs 2008-11-29 18:07:21 UTC (rev 3937) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public class Apple : Fruit + { + public Apple(Entity container) + : base(container) + { + } + + protected Apple() + { + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Cart.cs 2008-11-29 18:07:21 UTC (rev 3937) @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public class Cart : Entity + { + public Cart(string vendorName) + { + if (String.IsNullOrEmpty(vendorName)) + throw new ArgumentNullException("vendorName"); + + VendorName = vendorName; + EnsureCollections(); + } + + private void EnsureCollections() + { + if(Apples == null) + Apples = new List<Apple>(); + if(Oranges == null) + Oranges = new List<Orange>(); + } + + protected Cart() + { + } + + public string VendorName { get; set; } + public IList<Apple> Apples { get; set; } + public IList<Orange> Oranges { get; set; } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Entity.cs 2008-11-29 18:07:21 UTC (rev 3937) @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public abstract class Entity + { + public Entity() + { + } + + public Guid ID { get; private set; } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Fruit.cs 2008-11-29 18:07:21 UTC (rev 3937) @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public abstract class Fruit : Entity + { + public Fruit(Entity container) + { + if (container == null) + throw new ArgumentNullException("container"); + Container = container; + } + + protected Fruit() + { + } + + public Entity Container { get; private set; } + + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Mappings.hbm.xml 2008-11-29 18:07:21 UTC (rev 3937) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate.Test.NHSpecificTest.NH1579" assembly="NHibernate.Test" default-lazy="false"> + <class name="Entity" abstract="true" table="Entities"> + <id name="ID"> + <generator class="guid.comb" /> + </id> + <discriminator column="EntityType" length="64"/> + </class> + + <subclass name="Fruit" abstract="true" discriminator-value="Fruit" extends="NHibernate.Test.NHSpecificTest.NH1579.Entity, NHibernate.Test"> + <many-to-one name="Container" column="ContainerID" /> + </subclass> + <subclass name="Apple" discriminator-value="Apple" extends="NHibernate.Test.NHSpecificTest.NH1579.Fruit, NHibernate.Test"/> + <subclass name="Orange" discriminator-value="Orange" extends="NHibernate.Test.NHSpecificTest.NH1579.Fruit, NHibernate.Test"/> + + <subclass name="Cart" discriminator-value="Cart" extends="NHibernate.Test.NHSpecificTest.NH1579.Entity, NHibernate.Test"> + <property name="VendorName" length="128"/> + <bag name="Apples" cascade="all-delete-orphan" inverse="true"> + <key column="ContainerID"/> + <one-to-many class="NHibernate.Test.NHSpecificTest.NH1579.Apple, NHibernate.Test"/> + </bag> + <bag name="Oranges" cascade="all-delete-orphan" inverse="true"> + <key column="ContainerID"/> + <one-to-many class="NHibernate.Test.NHSpecificTest.NH1579.Orange, NHibernate.Test"/> + </bag> + </subclass> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/NH1579Fixture.cs 2008-11-29 18:07:21 UTC (rev 3937) @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + [TestFixture] + public class NH1579Fixture : BugTestCase + { + [Test] + public void Test() + { + Cart cart = new Cart("Fred"); + Apple apple = new Apple(cart); + Orange orange = new Orange(cart); + cart.Apples.Add(apple); + cart.Oranges.Add(orange); + + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Save(cart); + tx.Commit(); + } + } + + using (ISession session = OpenSession()) + { + IQuery query = session.CreateQuery("FROM Fruit f WHERE f.Container.id = :containerID"); + query.SetGuid("containerID", cart.ID); + IList<Fruit> fruit = query.List<Fruit>(); + Assert.AreEqual(2, fruit.Count); + } + + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Delete("FROM Entity"); + tx.Commit(); + } + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1579/Orange.cs 2008-11-29 18:07:21 UTC (rev 3937) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1579 +{ + public class Orange : Fruit + { + public Orange(Entity container) + : base(container) + { + } + + protected Orange() + { + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-27 20:12:33 UTC (rev 3936) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-29 18:07:21 UTC (rev 3937) @@ -524,6 +524,12 @@ <Compile Include="NHSpecificTest\NH1556\Patient.cs" /> <Compile Include="NHSpecificTest\NH1556\Product.cs" /> <Compile Include="NHSpecificTest\NH1556\ProductIdentifier.cs" /> + <Compile Include="NHSpecificTest\NH1579\Apple.cs" /> + <Compile Include="NHSpecificTest\NH1579\Cart.cs" /> + <Compile Include="NHSpecificTest\NH1579\Entity.cs" /> + <Compile Include="NHSpecificTest\NH1579\Fruit.cs" /> + <Compile Include="NHSpecificTest\NH1579\NH1579Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1579\Orange.cs" /> <Compile Include="NHSpecificTest\NH1587\A.cs" /> <Compile Include="NHSpecificTest\NH1587\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Fixture.cs" /> @@ -1546,6 +1552,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1579\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH298\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1587\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1556\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-27 20:12:38
|
Revision: 3936 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3936&view=rev Author: tehlike Date: 2008-11-27 20:12:33 +0000 (Thu, 27 Nov 2008) Log Message: ----------- Fix for NH-1591 by Henry Concei?\195?\167?\195?\163o with tests added. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Criterion/DetachedCriteria.cs trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs Modified: trunk/nhibernate/src/NHibernate/Criterion/DetachedCriteria.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/DetachedCriteria.cs 2008-11-27 19:58:01 UTC (rev 3935) +++ trunk/nhibernate/src/NHibernate/Criterion/DetachedCriteria.cs 2008-11-27 20:12:33 UTC (rev 3936) @@ -166,6 +166,18 @@ return this; } + public DetachedCriteria SetCacheRegion(string region) + { + criteria.SetCacheRegion(region); + return this; + } + + public DetachedCriteria SetCacheable(bool cacheable) + { + criteria.SetCacheable(cacheable); + return this; + } + public DetachedCriteria SetProjection(IProjection projection) { criteria.SetProjection(projection); Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs 2008-11-27 19:58:01 UTC (rev 3935) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs 2008-11-27 20:12:33 UTC (rev 3936) @@ -7,6 +7,7 @@ using NHibernate.Type; using NHibernate.Util; using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Criteria { @@ -1589,7 +1590,35 @@ t.Commit(); session.Close(); } + [Test] + public void CacheDetachedCriteria() + { + using (ISession session = OpenSession()) + { + bool current = sessions.Statistics.IsStatisticsEnabled; + sessions.Statistics.IsStatisticsEnabled = true; + sessions.Statistics.Clear(); + DetachedCriteria dc = DetachedCriteria.For(typeof (Student)) + .Add(Property.ForName("Name").Eq("Gavin King")) + .SetProjection(Property.ForName("StudentNumber")) + .SetCacheable(true); + Assert.That(sessions.Statistics.QueryCacheMissCount,Is.EqualTo(0)); + Assert.That(sessions.Statistics.QueryCacheHitCount, Is.EqualTo(0)); + dc.GetExecutableCriteria(session).List(); + Assert.That(sessions.Statistics.QueryCacheMissCount, Is.EqualTo(1)); + dc = DetachedCriteria.For(typeof(Student)) + .Add(Property.ForName("Name").Eq("Gavin King")) + .SetProjection(Property.ForName("StudentNumber")) + .SetCacheable(true); + dc.GetExecutableCriteria(session).List(); + + Assert.That(sessions.Statistics.QueryCacheMissCount, Is.EqualTo(1)); + Assert.That(sessions.Statistics.QueryCacheHitCount, Is.EqualTo(1)); + sessions.Statistics.IsStatisticsEnabled = false; + } + + } [Test] public void PropertyWithFormulaAndPagingTest() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-27 19:58:07
|
Revision: 3935 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3935&view=rev Author: tehlike Date: 2008-11-27 19:58:01 +0000 (Thu, 27 Nov 2008) Log Message: ----------- Fix NH-1578 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Criterion/NotExpression.cs trunk/nhibernate/src/NHibernate.Test/ExpressionTest/NotExpressionFixture.cs Modified: trunk/nhibernate/src/NHibernate/Criterion/NotExpression.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/NotExpression.cs 2008-11-26 22:38:49 UTC (rev 3934) +++ trunk/nhibernate/src/NHibernate/Criterion/NotExpression.cs 2008-11-27 19:58:01 UTC (rev 3935) @@ -28,24 +28,10 @@ { //TODO: set default capacity SqlStringBuilder builder = new SqlStringBuilder(); - - bool needsParens = criteriaQuery.Factory.Dialect is MySQLDialect; - if (needsParens) - { - builder.Add("not ("); - } - else - { - builder.Add("not "); - } - + builder.Add("not ("); builder.Add(_criterion.ToSqlString(criteria, criteriaQuery, enabledFilters)); + builder.Add(")"); - if (needsParens) - { - builder.Add(")"); - } - return builder.ToSqlString(); } @@ -56,7 +42,7 @@ public override string ToString() { - return "not " + _criterion.ToString(); + return string.Format("not ({0})", _criterion.ToString()); } public override IProjection[] GetProjections() Modified: trunk/nhibernate/src/NHibernate.Test/ExpressionTest/NotExpressionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ExpressionTest/NotExpressionFixture.cs 2008-11-26 22:38:49 UTC (rev 3934) +++ trunk/nhibernate/src/NHibernate.Test/ExpressionTest/NotExpressionFixture.cs 2008-11-27 19:58:01 UTC (rev 3935) @@ -23,12 +23,8 @@ CreateObjects(typeof(Simple), session); SqlString sqlString = notExpression.ToSqlString(criteria, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter>()); - string expectedSql = dialect is MySQLDialect ? - "not (sql_alias.address = ?)" : - "not sql_alias.address = ?"; - + string expectedSql = "not (sql_alias.address = ?)"; CompareSqlStrings(sqlString, expectedSql, 1); - session.Close(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2008-11-26 22:38:54
|
Revision: 3934 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3934&view=rev Author: davybrion Date: 2008-11-26 22:38:49 +0000 (Wed, 26 Nov 2008) Log Message: ----------- various minor cleanups Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs trunk/nhibernate/src/NHibernate/Collection/AbstractPersistentCollection.cs trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs trunk/nhibernate/src/NHibernate/Collection/PersistentArrayHolder.cs trunk/nhibernate/src/NHibernate/Collection/PersistentBag.cs trunk/nhibernate/src/NHibernate/Collection/PersistentIdentifierBag.cs trunk/nhibernate/src/NHibernate/Collection/PersistentList.cs trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs trunk/nhibernate/src/NHibernate/Collection/PersistentSet.cs trunk/nhibernate/src/NHibernate/Criterion/InExpression.cs trunk/nhibernate/src/NHibernate/Criterion/Junction.cs trunk/nhibernate/src/NHibernate/Dialect/Function/AnsiTrimEmulationFunction.cs trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs trunk/nhibernate/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs trunk/nhibernate/src/NHibernate/Engine/ResultSetMappingDefinition.cs trunk/nhibernate/src/NHibernate/Hql/Classic/PathExpressionParser.cs trunk/nhibernate/src/NHibernate/Hql/Classic/QueryTranslator.cs trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs trunk/nhibernate/src/NHibernate/Loader/Loader.cs trunk/nhibernate/src/NHibernate/SqlCommand/SqlStringBuilder.cs Modified: trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -24,8 +24,7 @@ Stopwatch stopwatch = null; if (statsEnabled) { - stopwatch = new Stopwatch(); - stopwatch.Start(); + stopwatch = Stopwatch.StartNew(); } IPersistentCollection collection = Collection; Modified: trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -61,8 +61,7 @@ Stopwatch stopwatch = null; if (statsEnabled) { - stopwatch = new Stopwatch(); - stopwatch.Start(); + stopwatch = Stopwatch.StartNew(); } PreRemove(); Modified: trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -34,8 +34,7 @@ Stopwatch stopwatch = null; if (statsEnabled) { - stopwatch = new Stopwatch(); - stopwatch.Start(); + stopwatch = Stopwatch.StartNew(); } PreUpdate(); Modified: trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -39,8 +39,7 @@ Stopwatch stopwatch = null; if (statsEnabled) { - stopwatch = new Stopwatch(); - stopwatch.Start(); + stopwatch = Stopwatch.StartNew(); } bool veto = PreDelete(); Modified: trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -62,8 +62,7 @@ Stopwatch stopwatch = null; if (statsEnabled) { - stopwatch = new Stopwatch(); - stopwatch.Start(); + stopwatch = Stopwatch.StartNew(); } bool veto = PreInsert(); Modified: trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -46,8 +46,7 @@ Stopwatch stopwatch = null; if (statsEnabled) { - stopwatch = new Stopwatch(); - stopwatch.Start(); + stopwatch = Stopwatch.StartNew(); } bool veto = PreInsert(); Modified: trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -51,8 +51,7 @@ Stopwatch stopwatch = null; if (statsEnabled) { - stopwatch = new Stopwatch(); - stopwatch.Start(); + stopwatch = Stopwatch.StartNew(); } bool veto = PreUpdate(); Modified: trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -16,7 +16,7 @@ private int countOfCommands = 0; private int totalExpectedRowsAffected; private IDbCommand currentBatch; - private IDictionary<string, ArrayList> parameterValueArrayHashTable; + private IDictionary<string, List<object>> parameterValueListHashTable; private IDictionary<string, bool> parameterIsAllNullsHashTable; @@ -37,7 +37,7 @@ { // use first command as the batching command currentBatch = CurrentCommand; - parameterValueArrayHashTable = new Dictionary<string, ArrayList>(); + parameterValueListHashTable = new Dictionary<string, List<object>>(); //oracle does not allow array containing all null values // so this Dictionary is keeping track if all values are null or not parameterIsAllNullsHashTable = new Dictionary<string, bool>(); @@ -47,25 +47,25 @@ firstOnBatch = false; } - ArrayList parameterValueArray; + List<object> parameterValueList; foreach (IDataParameter currentParameter in CurrentCommand.Parameters) { if (firstOnBatch) { - parameterValueArray = new ArrayList(); - parameterValueArrayHashTable.Add(currentParameter.ParameterName, parameterValueArray); + parameterValueList = new List<object>(); + parameterValueListHashTable.Add(currentParameter.ParameterName, parameterValueList); parameterIsAllNullsHashTable.Add(currentParameter.ParameterName, true); } else { - parameterValueArray = parameterValueArrayHashTable[currentParameter.ParameterName]; + parameterValueList = parameterValueListHashTable[currentParameter.ParameterName]; } if (currentParameter.Value != DBNull.Value) { parameterIsAllNullsHashTable[currentParameter.ParameterName] = false; } - parameterValueArray.Add(currentParameter.Value); + parameterValueList.Add(currentParameter.Value); } countOfCommands++; @@ -89,7 +89,7 @@ foreach (IDataParameter currentParameter in currentBatch.Parameters) { - ArrayList parameterValueArray = parameterValueArrayHashTable[currentParameter.ParameterName]; + List<object> parameterValueArray = parameterValueListHashTable[currentParameter.ParameterName]; currentParameter.Value = parameterValueArray.ToArray(); arraySize = parameterValueArray.Count; } @@ -104,7 +104,7 @@ totalExpectedRowsAffected = 0; currentBatch = null; - parameterValueArrayHashTable = null; + parameterValueListHashTable = null; } } Modified: trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -65,31 +65,29 @@ { return false; } - else + + long ts = session.Timestamp; + + if (log.IsDebugEnabled) { - long ts = session.Timestamp; + log.Debug("caching query results in region: " + regionName); + } - if (log.IsDebugEnabled) + IList cacheable = new List<object>(result.Count + 1); + cacheable.Add(ts); + for (int i = 0; i < result.Count; i++) + { + if (returnTypes.Length == 1) { - log.Debug("caching query results in region: " + regionName); + cacheable.Add(returnTypes[0].Disassemble(result[i], session, null)); } - - IList cacheable = new ArrayList(result.Count + 1); - cacheable.Add(ts); - for (int i = 0; i < result.Count; i++) + else { - if (returnTypes.Length == 1) - { - cacheable.Add(returnTypes[0].Disassemble(result[i], session, null)); - } - else - { - cacheable.Add(TypeFactory.Disassemble((object[]) result[i], returnTypes, null, session, null)); - } + cacheable.Add(TypeFactory.Disassemble((object[]) result[i], returnTypes, null, session, null)); } - queryCache.Put(key, cacheable); - return true; } + queryCache.Put(key, cacheable); + return true; } public IList Get(QueryKey key, ICacheAssembler[] returnTypes, bool isNaturalKeyLookup, ISet<string> spaces, @@ -125,7 +123,7 @@ TypeFactory.BeforeAssemble((object[])cacheable[i], returnTypes, session); } } - IList result = new ArrayList(cacheable.Count - 1); + IList result = new List<object>(cacheable.Count - 1); for (int i = 1; i < cacheable.Count; i++) { try @@ -151,10 +149,8 @@ queryCache.Remove(key); return null; } - else - { - throw; - } + + throw; } } return result; Modified: trunk/nhibernate/src/NHibernate/Collection/AbstractPersistentCollection.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/AbstractPersistentCollection.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/AbstractPersistentCollection.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -646,8 +646,8 @@ { if (HasQueuedOperations) { - ArrayList additions = new ArrayList(operationQueue.Count); - ArrayList removals = new ArrayList(operationQueue.Count); + List<object> additions = new List<object>(operationQueue.Count); + List<object> removals = new List<object>(operationQueue.Count); for (int i = 0; i < operationQueue.Count; i++) { IDelayedOperation op = operationQueue[i]; @@ -662,10 +662,8 @@ } return GetOrphans(removals, additions, entityName, session); } - else - { - return CollectionHelper.EmptyCollection; - } + + return CollectionHelper.EmptyCollection; } /// <summary> @@ -707,7 +705,7 @@ IType idType = session.Factory.GetEntityPersister(entityName).IdentifierType; // create the collection holding the orphans - ArrayList res = new ArrayList(); + List<object> res = new List<object>(); // collect EntityIdentifier(s) of the *current* elements - add them into a HashSet for fast access HashedSet<TypedValue> currentIds = new HashedSet<TypedValue>(); @@ -740,7 +738,7 @@ IType idType = session.Factory.GetEntityPersister(entityName).IdentifierType; object idOfCurrent = ForeignKeys.GetEntityIdentifierIfNotUnsaved(entityName, obj, session); - ArrayList toRemove = new ArrayList(list.Count); + List<object> toRemove = new List<object>(list.Count); foreach (object current in list) { if (current == null) Modified: trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -50,7 +50,7 @@ public override IEnumerable GetDeletes(ICollectionPersister persister, bool indexIsFormula) { - IList deletes = new ArrayList(); + IList deletes = new List<object>(); IDictionary<TKey, TValue> sn = (IDictionary<TKey, TValue>)GetSnapshot(); foreach (KeyValuePair<TKey, TValue> e in sn) { Modified: trunk/nhibernate/src/NHibernate/Collection/PersistentArrayHolder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/PersistentArrayHolder.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/PersistentArrayHolder.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Diagnostics; using log4net; @@ -29,7 +30,7 @@ /// A temporary list that holds the objects while the PersistentArrayHolder is being /// populated from the database. /// </summary> - [NonSerialized] private ArrayList tempList; + [NonSerialized] private List<object> tempList; public PersistentArrayHolder(ISessionImplementor session, object array) : base(session) { @@ -97,7 +98,7 @@ { object[] sn = (object[]) snapshot; object[] arr = (object[]) array; - ArrayList result = new ArrayList(sn); + List<object> result = new List<object>(sn); for (int i = 0; i < sn.Length; i++) { IdentityRemove(result, arr[i], entityName, Session); @@ -165,7 +166,7 @@ public override void BeginRead() { base.BeginRead(); - tempList = new ArrayList(); + tempList = new List<object>(); } /// <summary> @@ -223,7 +224,7 @@ public override IEnumerable GetDeletes(ICollectionPersister persister, bool indexIsFormula) { - IList deletes = new ArrayList(); + IList deletes = new List<object>(); Array sn = (Array) GetSnapshot(); int snSize = sn.Length; int arraySize = array.Length; Modified: trunk/nhibernate/src/NHibernate/Collection/PersistentBag.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/PersistentBag.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/PersistentBag.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Diagnostics; using NHibernate.DebugHelpers; @@ -134,7 +135,7 @@ public override ICollection GetSnapshot(ICollectionPersister persister) { EntityMode entityMode = Session.EntityMode; - ArrayList clonedList = new ArrayList(bag.Count); + List<object> clonedList = new List<object>(bag.Count); foreach (object current in bag) { clonedList.Add(persister.ElementType.DeepCopy(current, entityMode, persister.Factory)); @@ -210,7 +211,7 @@ { IType elementType = persister.ElementType; EntityMode entityMode = Session.EntityMode; - ArrayList deletes = new ArrayList(); + List<object> deletes = new List<object>(); IList sn = (IList) GetSnapshot(); int i = 0; foreach (object old in sn) @@ -440,7 +441,7 @@ if (persister.IsOneToMany && HasQueuedOperations) { int additionStartFrom = bag.Count; - IList additionQueue = new ArrayList(additionStartFrom); + IList additionQueue = new List<object>(additionStartFrom); foreach (object o in QueuedAdditionIterator) { if (o != null) Modified: trunk/nhibernate/src/NHibernate/Collection/PersistentIdentifierBag.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/PersistentIdentifierBag.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/PersistentIdentifierBag.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -95,7 +95,7 @@ public override void BeforeInitialize(ICollectionPersister persister, int anticipatedSize) { identifiers = anticipatedSize <= 0 ? new Dictionary<int, object>() : new Dictionary<int, object>(anticipatedSize + 1); - values = anticipatedSize <= 0 ? new ArrayList() : new ArrayList(anticipatedSize); + values = anticipatedSize <= 0 ? new List<object>() : new List<object>(anticipatedSize); } public override object Disassemble(ICollectionPersister persister) Modified: trunk/nhibernate/src/NHibernate/Collection/PersistentList.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/PersistentList.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/PersistentList.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Diagnostics; using NHibernate.DebugHelpers; @@ -54,7 +55,7 @@ { EntityMode entityMode = Session.EntityMode; - ArrayList clonedList = new ArrayList(list.Count); + List<object> clonedList = new List<object>(list.Count); foreach (object current in list) { object deepCopy = persister.ElementType.DeepCopy(current, entityMode, persister.Factory); @@ -164,7 +165,7 @@ public override IEnumerable GetDeletes(ICollectionPersister persister, bool indexIsFormula) { - IList deletes = new ArrayList(); + IList deletes = new List<object>(); IList sn = (IList) GetSnapshot(); int end; if (sn.Count > list.Count) Modified: trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Diagnostics; using NHibernate.DebugHelpers; @@ -152,7 +153,7 @@ public override IEnumerable GetDeletes(ICollectionPersister persister, bool indexIsFormula) { - IList deletes = new ArrayList(); + IList deletes = new List<object>(); IDictionary sn = (IDictionary) GetSnapshot(); foreach (DictionaryEntry e in sn) { Modified: trunk/nhibernate/src/NHibernate/Collection/PersistentSet.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/PersistentSet.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Collection/PersistentSet.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Diagnostics; using Iesi.Collections; @@ -102,15 +103,13 @@ { return false; } - else + + foreach (object obj in set) { - foreach (object obj in set) + object oldValue = snapshot[obj]; + if (oldValue == null || elementType.IsDirty(oldValue, obj, Session)) { - object oldValue = snapshot[obj]; - if (oldValue == null || elementType.IsDirty(oldValue, obj, Session)) - { - return false; - } + return false; } } @@ -177,7 +176,7 @@ public override void BeginRead() { base.BeginRead(); - tempList = new ArrayList(); + tempList = new List<object>(); } /// <summary> @@ -214,7 +213,7 @@ { IType elementType = persister.ElementType; IDictionary sn = (IDictionary) GetSnapshot(); - ArrayList deletes = new ArrayList(sn.Count); + List<object> deletes = new List<object>(sn.Count); foreach (object obj in sn.Keys) { if (!set.Contains(obj)) Modified: trunk/nhibernate/src/NHibernate/Criterion/InExpression.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/InExpression.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Criterion/InExpression.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -115,7 +115,7 @@ public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery) { - ArrayList list = new ArrayList(); + List<TypedValue> list = new List<TypedValue>(); IType type; if (_projection == null) { @@ -158,7 +158,7 @@ } } - return (TypedValue[]) list.ToArray(typeof (TypedValue)); + return list.ToArray(); } public object[] Values Modified: trunk/nhibernate/src/NHibernate/Criterion/Junction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/Junction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Criterion/Junction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -14,7 +14,7 @@ [Serializable] public abstract class Junction : AbstractCriterion { - private IList _criteria = new ArrayList(); + private readonly IList<ICriterion> criteria = new List<ICriterion>(); /// <summary> /// Adds an <see cref="ICriterion"/> to the list of <see cref="ICriterion"/>s @@ -26,7 +26,7 @@ /// </returns> public Junction Add(ICriterion criterion) { - _criteria.Add(criterion); + criteria.Add(criterion); return this; } @@ -39,7 +39,7 @@ { ArrayList typedValues = new ArrayList(); - foreach (ICriterion criterion in _criteria) + foreach (ICriterion criterion in this.criteria) { TypedValue[] subvalues = criterion.GetTypedValues(criteria, criteriaQuery); ArrayHelper.AddAll(typedValues, subvalues); @@ -56,7 +56,7 @@ public override SqlString ToSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary<string, IFilter> enabledFilters) { - if (_criteria.Count == 0) + if (this.criteria.Count == 0) { return EmptyExpression; } @@ -66,15 +66,13 @@ sqlBuilder.Add("("); - for (int i = 0; i < _criteria.Count - 1; i++) + for (int i = 0; i < this.criteria.Count - 1; i++) { - sqlBuilder.Add( - ((ICriterion) _criteria[i]).ToSqlString(criteria, criteriaQuery, enabledFilters)); + sqlBuilder.Add(this.criteria[i].ToSqlString(criteria, criteriaQuery, enabledFilters)); sqlBuilder.Add(Op); } - sqlBuilder.Add( - ((ICriterion) _criteria[_criteria.Count - 1]).ToSqlString(criteria, criteriaQuery, enabledFilters)); + sqlBuilder.Add(this.criteria[this.criteria.Count - 1].ToSqlString(criteria, criteriaQuery, enabledFilters)); sqlBuilder.Add(")"); @@ -84,7 +82,7 @@ public override string ToString() { - return '(' + StringHelper.Join(Op, _criteria) + ')'; + return '(' + StringHelper.Join(Op, criteria) + ')'; } public override IProjection[] GetProjections() Modified: trunk/nhibernate/src/NHibernate/Dialect/Function/AnsiTrimEmulationFunction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Function/AnsiTrimEmulationFunction.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Dialect/Function/AnsiTrimEmulationFunction.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,5 +1,7 @@ using System; using System.Collections; +using System.Collections.Generic; + using NHibernate.Engine; using NHibernate.SqlCommand; using NHibernate.Type; @@ -95,101 +97,96 @@ // so we trim leading and trailing spaces return BothSpaceTrim.Render(args, factory); } - else if (StringHelper.EqualsCaseInsensitive("from", firstArg)) + + if (StringHelper.EqualsCaseInsensitive("from", firstArg)) { // we have the form: trim(from trimSource). // This is functionally equivalent to trim(trimSource) return BothSpaceTrimFrom.Render(args, factory); } + + // otherwise, a trim-specification and/or a trim-character + // have been specified; we need to decide which options + // are present and "do the right thing" + bool leading = true; // should leading trim-characters be trimmed? + bool trailing = true; // should trailing trim-characters be trimmed? + string trimCharacter = null; // the trim-character + object trimSource = null; // the trim-source + + // potentialTrimCharacterArgIndex = 1 assumes that a + // trim-specification has been specified. we handle the + // exception to that explicitly + int potentialTrimCharacterArgIndex = 1; + if (StringHelper.EqualsCaseInsensitive("leading", firstArg)) + { + trailing = false; + } + else if (StringHelper.EqualsCaseInsensitive("trailing", firstArg)) + { + leading = false; + } + else if (StringHelper.EqualsCaseInsensitive("both", firstArg)) + { + } else { - // otherwise, a trim-specification and/or a trim-character - // have been specified; we need to decide which options - // are present and "do the right thing" - bool leading = true; // should leading trim-characters be trimmed? - bool trailing = true; // should trailing trim-characters be trimmed? - string trimCharacter = null; // the trim-character - object trimSource = null; // the trim-source + potentialTrimCharacterArgIndex = 0; + } - // potentialTrimCharacterArgIndex = 1 assumes that a - // trim-specification has been specified. we handle the - // exception to that explicitly - int potentialTrimCharacterArgIndex = 1; - if (StringHelper.EqualsCaseInsensitive("leading", firstArg)) + object potentialTrimCharacter = args[potentialTrimCharacterArgIndex]; + if (StringHelper.EqualsCaseInsensitive("from", potentialTrimCharacter.ToString())) + { + trimCharacter = "' '"; + trimSource = args[potentialTrimCharacterArgIndex + 1]; + } + else if (potentialTrimCharacterArgIndex + 1 >= args.Count) + { + trimCharacter = "' '"; + trimSource = potentialTrimCharacter; + } + else + { + trimCharacter = potentialTrimCharacter.ToString(); + if (StringHelper.EqualsCaseInsensitive("from", args[potentialTrimCharacterArgIndex + 1].ToString())) { - trailing = false; + trimSource = args[potentialTrimCharacterArgIndex + 2]; } - else if (StringHelper.EqualsCaseInsensitive("trailing", firstArg)) - { - leading = false; - } - else if (StringHelper.EqualsCaseInsensitive("both", firstArg)) - { - } else { - potentialTrimCharacterArgIndex = 0; - } - - object potentialTrimCharacter = args[potentialTrimCharacterArgIndex]; - if (StringHelper.EqualsCaseInsensitive("from", potentialTrimCharacter.ToString())) - { - trimCharacter = "' '"; trimSource = args[potentialTrimCharacterArgIndex + 1]; } - else if (potentialTrimCharacterArgIndex + 1 >= args.Count) - { - trimCharacter = "' '"; - trimSource = potentialTrimCharacter; - } - else - { - trimCharacter = potentialTrimCharacter.ToString(); - if (StringHelper.EqualsCaseInsensitive("from", args[potentialTrimCharacterArgIndex + 1].ToString())) - { - trimSource = args[potentialTrimCharacterArgIndex + 2]; - } - else - { - trimSource = args[potentialTrimCharacterArgIndex + 1]; - } - } + } - IList argsToUse = new ArrayList(); - argsToUse.Add(trimSource); - argsToUse.Add(trimCharacter); + IList argsToUse = new List<object>(); + argsToUse.Add(trimSource); + argsToUse.Add(trimCharacter); - if (trimCharacter.Equals("' '")) + if (trimCharacter.Equals("' '")) + { + if (leading && trailing) { - if (leading && trailing) - { - return BothSpaceTrim.Render(argsToUse, factory); - } - else if (leading) - { - return LeadingSpaceTrim.Render(argsToUse, factory); - } - else - { - return TrailingSpaceTrim.Render(argsToUse, factory); - } + return BothSpaceTrim.Render(argsToUse, factory); } - else + + if (leading) { - if (leading && trailing) - { - return BothTrim.Render(argsToUse, factory); - } - else if (leading) - { - return LeadingTrim.Render(argsToUse, factory); - } - else - { - return TrailingTrim.Render(argsToUse, factory); - } + return LeadingSpaceTrim.Render(argsToUse, factory); } + + return TrailingSpaceTrim.Render(argsToUse, factory); } + + if (leading && trailing) + { + return BothTrim.Render(argsToUse, factory); + } + + if (leading) + { + return LeadingTrim.Render(argsToUse, factory); + } + + return TrailingTrim.Render(argsToUse, factory); } #endregion Modified: trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -501,7 +501,7 @@ { schemaTable = reader.GetSchemaTable(); - ArrayList recordsList = new ArrayList(); + List<object[]> recordsList = new List<object[]>(); int rowIndex = 0; // if we are in the middle of processing the reader then don't bother @@ -533,7 +533,7 @@ isMidstream = false; } - records = (object[][]) recordsList.ToArray(typeof(object[])); + records = recordsList.ToArray(); } /// <summary> Modified: trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -12,7 +12,7 @@ public class JoinSequence { private readonly ISessionFactoryImplementor factory; - private readonly ArrayList joins = new ArrayList(); + private readonly List<Join> joins = new List<Join>(); private bool useThetaStyle = false; private readonly SqlStringBuilder conditions = new SqlStringBuilder(); private string rootAlias; @@ -162,7 +162,7 @@ for (int i = 0; i < joins.Count; i++) { - Join join = (Join) joins[i]; + Join join = joins[i]; string on = join.AssociationType.GetOnCondition(join.Alias, factory, enabledFilters); string condition; if (last != null && Modified: trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Engine/Query/HQLQueryPlan.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -218,7 +218,7 @@ queryParametersToUse = queryParameters; } - IList combinedResults = results ?? new ArrayList(); + IList combinedResults = results ?? new List<object>(); IdentitySet distinction = new IdentitySet(); int includedCount = -1; for (int i = 0; i < translators.Length; i++) Modified: trunk/nhibernate/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Engine/Query/NativeSQLQueryPlan.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -177,7 +177,7 @@ private SqlType[] GetParameterTypes(QueryParameters parameters, ISessionImplementor session) { - ArrayList paramTypeList = new ArrayList(); + List<IType> paramTypeList = new List<IType>(); int span = 0; foreach (IType type in parameters.FilteredPositionalParameterTypes) @@ -207,7 +207,7 @@ return ConvertITypesToSqlTypes(paramTypeList, span, session); } - private static SqlType[] ConvertITypesToSqlTypes(ArrayList nhTypes, int totalSpan, ISessionImplementor session) + private static SqlType[] ConvertITypesToSqlTypes(IList<IType> nhTypes, int totalSpan, ISessionImplementor session) { SqlType[] result = new SqlType[totalSpan]; Modified: trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -292,8 +292,8 @@ SqlStringBuilder result = new SqlStringBuilder(); - IList parameters = new ArrayList(); - IList parameterTypes = new ArrayList(); + List<object> parameters = new List<object>(); + List<IType> parameterTypes = new List<IType>(); int parameterCount = 0; // keep track of the positional parameter foreach (object part in sql.Parts) @@ -367,8 +367,8 @@ } } - processedPositionalParameterValues = ((ArrayList)parameters).ToArray(); - processedPositionalParameterTypes = (IType[])((ArrayList)parameterTypes).ToArray(typeof(IType)); + processedPositionalParameterValues = parameters.ToArray(); + processedPositionalParameterTypes = parameterTypes.ToArray(); processedSQL = result.ToSqlString(); } } Modified: trunk/nhibernate/src/NHibernate/Engine/ResultSetMappingDefinition.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/ResultSetMappingDefinition.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Engine/ResultSetMappingDefinition.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,4 +1,6 @@ using System.Collections; +using System.Collections.Generic; + using NHibernate.Engine.Query.Sql; namespace NHibernate.Engine @@ -6,7 +8,7 @@ public class ResultSetMappingDefinition { private readonly string name; - private readonly IList queryReturns = new ArrayList(); + private readonly IList<INativeSQLQueryReturn> queryReturns = new List<INativeSQLQueryReturn>(); public ResultSetMappingDefinition(string name) { Modified: trunk/nhibernate/src/NHibernate/Hql/Classic/PathExpressionParser.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Classic/PathExpressionParser.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Hql/Classic/PathExpressionParser.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -469,12 +469,12 @@ } private bool expectingCollectionIndex; - private ArrayList collectionElements = new ArrayList(); + private readonly List<CollectionElement> collectionElements = new List<CollectionElement>(); /// <summary></summary> public CollectionElement LastCollectionElement() { - CollectionElement ce = (CollectionElement) collectionElements[collectionElements.Count - 1]; + CollectionElement ce = collectionElements[collectionElements.Count - 1]; collectionElements.RemoveAt(collectionElements.Count - 1); return ce; //remove last } @@ -482,7 +482,7 @@ /// <summary></summary> public void SetLastCollectionElementIndexValue(SqlString value) { - ((CollectionElement) collectionElements[collectionElements.Count - 1]).IndexValue.Add(value); //getlast + collectionElements[collectionElements.Count - 1].IndexValue.Add(value); //getlast } /// <summary></summary> @@ -569,11 +569,9 @@ { return AddFromCollection(q); } - else - { - q.AddFrom(currentName, joinSequence); - return currentName; - } + + q.AddFrom(currentName, joinSequence); + return currentName; } /// <summary> @@ -615,12 +613,10 @@ currentPropertyMapping = new CollectionPropertyMapping(collectionPersister); return elementName; } - else - { - // collection of values - q.AddFromCollection(collectionName, collectionRole, joinSequence); - return collectionName; - } + + // collection of values + q.AddFromCollection(collectionName, collectionRole, joinSequence); + return collectionName; } /// <summary></summary> Modified: trunk/nhibernate/src/NHibernate/Hql/Classic/QueryTranslator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Classic/QueryTranslator.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Hql/Classic/QueryTranslator.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1072,7 +1072,7 @@ ExtractFunctionClause(tokens, ref tokenIdx); // The function render simply translate its name for a specific dialect. - return func.Render(new ArrayList(), Factory); + return func.Render(new List<object>(), Factory); } functionTokens = ExtractFunctionClause(tokens, ref tokenIdx); @@ -1080,7 +1080,7 @@ if (fg == null) fg = new CommonGrammar(); - IList args = new ArrayList(); + IList args = new List<object>(); SqlStringBuilder argBuf = new SqlStringBuilder(); // Extract args splitting first 2 token because are: FuncName( // last token is ')' Modified: trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -95,7 +95,7 @@ ISet filterKeys = FilterKey.CreateFilterKeys(session.EnabledFilters, session.EntityMode); ISet<string> querySpaces = new HashedSet<string>(); - ArrayList resultTypesList = new ArrayList(); + List<IType[]> resultTypesList = new List<IType[]>(); int[] maxRows = new int[loaders.Count]; int[] firstRows = new int[loaders.Count]; for (int i = 0; i < loaders.Count; i++) @@ -159,7 +159,7 @@ private IList DoList() { - ArrayList results = new ArrayList(); + List<IList> results = new List<IList>(); GetResultsFromDatabase(results); return results; } Modified: trunk/nhibernate/src/NHibernate/Loader/Loader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Loader.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/Loader/Loader.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -255,7 +255,7 @@ bool returnProxies) { int entitySpan = EntityPersisters.Length; - IList hydratedObjects = entitySpan == 0 ? null : new ArrayList(entitySpan); + IList hydratedObjects = entitySpan == 0 ? null : new List<object>(entitySpan); object result; try @@ -391,7 +391,7 @@ int entitySpan = EntityPersisters.Length; - ArrayList hydratedObjects = entitySpan == 0 ? null : new ArrayList(entitySpan * 10); + List<object> hydratedObjects = entitySpan == 0 ? null : new List<object>(entitySpan * 10); IDbCommand st = PrepareQueryCommand(queryParameters, false, session); @@ -408,7 +408,7 @@ bool createSubselects = IsSubselectLoadingEnabled; List<EntityKey[]> subselectResultKeys = createSubselects ? new List<EntityKey[]>() : null; - IList results = new ArrayList(); + IList results = new List<object>(); try { @@ -1764,7 +1764,7 @@ return new SqlCommandInfo(sqlString, GetParameterTypes(parameters, useLimit, useOffset)); } - protected SqlType[] ConvertITypesToSqlTypes(ArrayList nhTypes, int totalSpan) + protected SqlType[] ConvertITypesToSqlTypes(List<IType> nhTypes, int totalSpan) { SqlType[] result = new SqlType[totalSpan]; @@ -1782,7 +1782,7 @@ /// <returns><see cref="IList" /> of <see cref="IType" /></returns> protected SqlType[] GetParameterTypes(QueryParameters parameters, bool addLimit, bool addOffset) { - ArrayList paramTypeList = new ArrayList(); + List<IType> paramTypeList = new List<IType>(); int span = 0; foreach (IType type in parameters.FilteredPositionalParameterTypes) Modified: trunk/nhibernate/src/NHibernate/SqlCommand/SqlStringBuilder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/SqlCommand/SqlStringBuilder.cs 2008-11-26 13:50:31 UTC (rev 3933) +++ trunk/nhibernate/src/NHibernate/SqlCommand/SqlStringBuilder.cs 2008-11-26 22:38:49 UTC (rev 3934) @@ -1,5 +1,7 @@ using System; using System.Collections; +using System.Collections.Generic; + using NHibernate.Util; namespace NHibernate.SqlCommand @@ -30,7 +32,7 @@ public class SqlStringBuilder : ISqlStringBuilder { // this holds the strings and parameters that make up the full sql statement. - private ArrayList sqlParts; + private List<object> sqlParts; private AddingSqlStringVisitor addingVisitor; @@ -59,7 +61,7 @@ /// <param name="partsCapacity">The number of parts expected.</param> public SqlStringBuilder(int partsCapacity) { - sqlParts = new ArrayList(partsCapacity); + sqlParts = new List<object>(partsCapacity); } /// <summary> @@ -68,7 +70,7 @@ /// <param name="sqlString">The SqlString to modify.</param> public SqlStringBuilder(SqlString sqlString) { - sqlParts = new ArrayList(sqlString.Count); + sqlParts = new List<object>(sqlString.Count); Add(sqlString); } @@ -311,7 +313,7 @@ /// <returns>The SqlString that was built.</returns> public SqlString ToSqlString() { - return new SqlString((object[]) sqlParts.ToArray(typeof(object))); + return new SqlString(sqlParts.ToArray()); } public override string ToString() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-26 13:50:34
|
Revision: 3933 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3933&view=rev Author: fabiomaulo Date: 2008-11-26 13:50:31 +0000 (Wed, 26 Nov 2008) Log Message: ----------- Minor Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs Modified: trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs 2008-11-26 13:34:00 UTC (rev 3932) +++ trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs 2008-11-26 13:50:31 UTC (rev 3933) @@ -11,7 +11,7 @@ { private readonly IAccessOptimizer accessOptimizer; private readonly CreateInstanceInvoker createInstanceMethod; - private readonly System.Type mappedType; + protected readonly System.Type mappedType; private readonly System.Type typeOfThis; public IAccessOptimizer AccessOptimizer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-26 13:34:03
|
Revision: 3932 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3932&view=rev Author: fabiomaulo Date: 2008-11-26 13:34:00 +0000 (Wed, 26 Nov 2008) Log Message: ----------- Minor refactoring Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs Modified: trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs 2008-11-26 12:38:52 UTC (rev 3931) +++ trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs 2008-11-26 13:34:00 UTC (rev 3932) @@ -24,9 +24,9 @@ get { return this; } } - public object CreateInstance() + public virtual object CreateInstance() { - return createInstanceMethod(); + return createInstanceMethod != null ? createInstanceMethod() : null; } /// <summary> @@ -59,7 +59,7 @@ return null; } - DynamicMethod method = new DynamicMethod(string.Empty, typeof (object), null, type, true); + var method = new DynamicMethod(string.Empty, typeof (object), null, type, true); ILGenerator il = method.GetILGenerator(); @@ -70,20 +70,31 @@ il.Emit(OpCodes.Initobj, type); il.Emit(OpCodes.Ldloc, tmpLocal); il.Emit(OpCodes.Box, type); + il.Emit(OpCodes.Ret); + + return (CreateInstanceInvoker)method.CreateDelegate(typeof(CreateInstanceInvoker)); } else { ConstructorInfo constructor = ReflectHelper.GetDefaultConstructor(type); - if (constructor == null) + if (constructor != null) { - throw new InstantiationException("Object class " + type + " must declare a default (no-argument) constructor", type); + il.Emit(OpCodes.Newobj, constructor); + il.Emit(OpCodes.Ret); + + return (CreateInstanceInvoker) method.CreateDelegate(typeof (CreateInstanceInvoker)); } - il.Emit(OpCodes.Newobj, constructor); + else + { + ThrowExceptionForNoDefaultCtor(type); + } } + return null; + } - il.Emit(OpCodes.Ret); - - return (CreateInstanceInvoker) method.CreateDelegate(typeof (CreateInstanceInvoker)); + protected virtual void ThrowExceptionForNoDefaultCtor(System.Type type) + { + throw new InstantiationException("Object class " + type + " must declare a default (no-argument) constructor", type); } protected DynamicMethod CreateDynamicMethod(System.Type returnType, System.Type[] argumentTypes) @@ -110,7 +121,7 @@ /// </summary> private GetPropertyValuesInvoker GenerateGetPropertyValuesMethod(IGetter[] getters) { - System.Type[] methodArguments = new[] {typeof (object), typeof (GetterCallback)}; + var methodArguments = new[] {typeof (object), typeof (GetterCallback)}; DynamicMethod method = CreateDynamicMethod(typeof (object[]), methodArguments); ILGenerator il = method.GetILGenerator(); @@ -139,7 +150,7 @@ il.Emit(OpCodes.Ldc_I4, i); // get the value... - IOptimizableGetter optimizableGetter = getter as IOptimizableGetter; + var optimizableGetter = getter as IOptimizableGetter; if (optimizableGetter != null) { // using the getter's emitted IL code @@ -175,7 +186,7 @@ /// <returns></returns> private SetPropertyValuesInvoker GenerateSetPropertyValuesMethod(IGetter[] getters, ISetter[] setters) { - System.Type[] methodArguments = new[] {typeof (object), typeof (object[]), typeof (SetterCallback)}; + var methodArguments = new[] {typeof (object), typeof (object[]), typeof (SetterCallback)}; DynamicMethod method = CreateDynamicMethod(null, methodArguments); ILGenerator il = method.GetILGenerator(); @@ -192,7 +203,7 @@ ISetter setter = setters[i]; System.Type valueType = getters[i].ReturnType; - IOptimizableSetter optimizableSetter = setter as IOptimizableSetter; + var optimizableSetter = setter as IOptimizableSetter; if (optimizableSetter != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-26 12:38:56
|
Revision: 3931 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3931&view=rev Author: fabiomaulo Date: 2008-11-26 12:38:52 +0000 (Wed, 26 Nov 2008) Log Message: ----------- Fix NH-1589 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs Modified: trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs 2008-11-26 04:19:41 UTC (rev 3930) +++ trunk/nhibernate/src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs 2008-11-26 12:38:52 UTC (rev 3931) @@ -52,7 +52,7 @@ /// Generates a dynamic method which creates a new instance of <paramref name="type" /> /// when invoked. /// </summary> - private static CreateInstanceInvoker CreateCreateInstanceMethod(System.Type type) + protected virtual CreateInstanceInvoker CreateCreateInstanceMethod(System.Type type) { if (type.IsInterface || type.IsAbstract) { @@ -110,7 +110,7 @@ /// </summary> private GetPropertyValuesInvoker GenerateGetPropertyValuesMethod(IGetter[] getters) { - System.Type[] methodArguments = new System.Type[] {typeof (object), typeof (GetterCallback)}; + System.Type[] methodArguments = new[] {typeof (object), typeof (GetterCallback)}; DynamicMethod method = CreateDynamicMethod(typeof (object[]), methodArguments); ILGenerator il = method.GetILGenerator(); @@ -151,7 +151,7 @@ { // using the getter itself via a callback MethodInfo invokeMethod = typeof (GetterCallback).GetMethod("Invoke", - new System.Type[] {typeof (object), typeof (int)}); + new[] {typeof (object), typeof (int)}); il.Emit(OpCodes.Ldarg_1); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldc_I4, i); @@ -175,7 +175,7 @@ /// <returns></returns> private SetPropertyValuesInvoker GenerateSetPropertyValuesMethod(IGetter[] getters, ISetter[] setters) { - System.Type[] methodArguments = new System.Type[] {typeof (object), typeof (object[]), typeof (SetterCallback)}; + System.Type[] methodArguments = new[] {typeof (object), typeof (object[]), typeof (SetterCallback)}; DynamicMethod method = CreateDynamicMethod(null, methodArguments); ILGenerator il = method.GetILGenerator(); @@ -213,8 +213,7 @@ { // using the setter itself via a callback MethodInfo invokeMethod = typeof (SetterCallback).GetMethod("Invoke", - new System.Type[] - {typeof (object), typeof (int), typeof (object)}); + new[] {typeof (object), typeof (int), typeof (object)}); il.Emit(OpCodes.Ldarg_2); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldc_I4, i); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2008-11-26 04:19:52
|
Revision: 3930 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3930&view=rev Author: ayenderahien Date: 2008-11-26 04:19:41 +0000 (Wed, 26 Nov 2008) Log Message: ----------- Adding passing tests from Adrian Alexander for NH-298 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Category.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/IndexedBidirectionalOneToManyTest.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Mappings.hbm.xml Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Category.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Category.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Category.cs 2008-11-26 04:19:41 UTC (rev 3930) @@ -0,0 +1,42 @@ +using System.Collections.Generic; + +namespace NHibernate.Test.NHSpecificTest.NH298 { + + public class Category { + private int id; + private string name; + private IList<Category> subCategories; + private Category parentCategory; + + public int Id { + get { return id; } + set { id = value; } + } + + public string Name { + get { return name; } + set { name = value; } + } + + public IList<Category> SubCategories { + get { return subCategories; } + private set { subCategories = value; } + } + + public Category ParentCategory { + get { return parentCategory; } + set { parentCategory = value; } + } + + public Category( int id, string name, Category parent ) { + this.id = id; + this.name = name; + subCategories = new List<Category>(); + parentCategory = parent; + } + + protected Category() : this( 0, "Unknown Category", null ) { } + + public override string ToString() { return name; } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/IndexedBidirectionalOneToManyTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/IndexedBidirectionalOneToManyTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/IndexedBidirectionalOneToManyTest.cs 2008-11-26 04:19:41 UTC (rev 3930) @@ -0,0 +1,76 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using NHibernate.Dialect; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH298 { + + [TestFixture] + public class IndexedBidirectionalOneToManyTest : BugTestCase { + + protected override void OnSetUp() { + base.OnSetUp(); + using ( ISession session = this.OpenSession() ) { + Category root = new Category( 1, "Root", null ); + root.SubCategories.Add( new Category( 2, "First", root ) ); + root.SubCategories.Add( new Category( 3, "Second", root ) ); + root.SubCategories.Add( new Category( 4, "Third", root ) ); + + session.Save( root ); + session.Flush(); + } + } + + protected override void OnTearDown() { + base.OnTearDown(); + using ( ISession session = this.OpenSession() ) { + session.Delete( "from System.Object" ); + //session.CreateSQLQuery( "delete from Category" ).List(); + session.Flush(); + } + } + + [Test] + public void SubItemMovesCorrectly() { + Category root1 = null, itemToMove = null; + + using ( ISession session = this.OpenSession() ) { + root1 = session.Get<Category>( 1 ); + itemToMove = root1.SubCategories[1]; //get the middle item + root1.SubCategories.Remove( itemToMove ); //remove the middle item + root1.SubCategories.Add( itemToMove ); //re-add it to the end + + session.Update( root1 ); + session.Flush(); + } + + using ( ISession session = this.OpenSession() ) { + Category root2 = session.Get<Category>( 1 ); + Assert.AreEqual( root1.SubCategories.Count, root2.SubCategories.Count ); + Assert.AreEqual( root1.SubCategories[1].Id, root2.SubCategories[1].Id ); + Assert.AreEqual( root1.SubCategories[2].Id, root2.SubCategories[2].Id ); + Assert.AreEqual( itemToMove.Id, root1.SubCategories[2].Id ); + } + } + + [Test] + public void RemoveAtWorksCorrectly() { + Category root1 = null; + + using ( ISession session = this.OpenSession() ) { + root1 = session.Get<Category>( 1 ); + root1.SubCategories.RemoveAt( 1 ); + + session.Update( root1 ); + session.Flush(); + } + + using ( ISession session = this.OpenSession() ) { + Category root2 = session.Get<Category>( 1 ); + Assert.AreEqual( root1.SubCategories.Count, root2.SubCategories.Count ); + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH298/Mappings.hbm.xml 2008-11-26 04:19:41 UTC (rev 3930) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" ?> + +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH298"> + + <class name="Category" lazy="false"> + <id name="Id"><generator class="assigned"/></id> + <property name="Name"/> + <list name="SubCategories" cascade="all"> + <key column="ParentCategoryID"/> + <index column="PositionInList"/> + <one-to-many class="Category"/> + </list> + <many-to-one name="ParentCategory" column="ParentCategoryID" insert="false" update="false"/> + </class> + +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-25 22:10:57 UTC (rev 3929) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-26 04:19:41 UTC (rev 3930) @@ -535,6 +535,8 @@ <Compile Include="NHSpecificTest\NH1054\NH1054Fixture.cs" /> <Compile Include="NHSpecificTest\NH1080\Domain.cs" /> <Compile Include="NHSpecificTest\NH1080\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH298\Category.cs" /> + <Compile Include="NHSpecificTest\NH298\IndexedBidirectionalOneToManyTest.cs" /> <Compile Include="NHSpecificTest\NH364\Invoice.cs" /> <Compile Include="NHSpecificTest\NH662\Domain.cs" /> <Compile Include="NHSpecificTest\NH662\Fixture.cs" /> @@ -1544,6 +1546,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH298\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1587\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1556\Mappings.hbm.xml" /> <EmbeddedResource Include="Tools\hbm2ddl\SchemaValidator\2_Version.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: T. T. <te...@gm...> - 2008-11-25 22:30:41
|
Thanks for the tip! I missed it. On Tue, Nov 25, 2008 at 11:31 PM, <fab...@us...> wrote: > Revision: 3926 > > http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3926&view=rev > Author: fabiomaulo > Date: 2008-11-25 21:31:27 +0000 (Tue, 25 Nov 2008) > > Log Message: > ----------- > avoid the name of catalog in test (each one can use a different > configuration) > > Modified Paths: > -------------- > > trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs > > Modified: > trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs > =================================================================== > --- > trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs > 2008-11-25 21:27:27 UTC (rev 3925) > +++ > trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs > 2008-11-25 21:31:27 UTC (rev 3926) > @@ -6,6 +6,7 @@ > using NHibernate.Cfg; > using NHibernate.Tool.hbm2ddl; > using NUnit.Framework; > +using NUnit.Framework.SyntaxHelpers; > > namespace NHibernate.Test.Tools.hbm2ddl.SchemaValidator > { > @@ -26,7 +27,6 @@ > } > > [Test] > - [ExpectedException(typeof(HibernateException), > ExpectedMessage = "Missing column: Name in nhibernate.dbo.Version")] > public void ShouldNotVerifyModifiedTable() > { > string resource1 = > "NHibernate.Test.Tools.hbm2ddl.SchemaValidator.1_Version.hbm.xml"; > @@ -39,7 +39,14 @@ > v2cfg.AddInputStream(stream); > new > NHibernate.Tool.hbm2ddl.SchemaExport(v1cfg).Execute(true, true, false, > true); > var v2schemaValidator = new > NHibernate.Tool.hbm2ddl.SchemaValidator((v2cfg)); > - v2schemaValidator.Validate(); > + try > + { > + v2schemaValidator.Validate(); > + } > + catch (HibernateException e) > + { > + Assert.That(e.Message, > Text.StartsWith("Missing column: Name")); > + } > } > } > } > > > 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 http://www.tunatoksoz.com Typos included to enhance the readers attention! |
From: <fab...@us...> - 2008-11-25 22:22:43
|
Revision: 3926 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3926&view=rev Author: fabiomaulo Date: 2008-11-25 21:31:27 +0000 (Tue, 25 Nov 2008) Log Message: ----------- avoid the name of catalog in test (each one can use a different configuration) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs 2008-11-25 21:27:27 UTC (rev 3925) +++ trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs 2008-11-25 21:31:27 UTC (rev 3926) @@ -6,6 +6,7 @@ using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Tools.hbm2ddl.SchemaValidator { @@ -26,7 +27,6 @@ } [Test] - [ExpectedException(typeof(HibernateException), ExpectedMessage = "Missing column: Name in nhibernate.dbo.Version")] public void ShouldNotVerifyModifiedTable() { string resource1 = "NHibernate.Test.Tools.hbm2ddl.SchemaValidator.1_Version.hbm.xml"; @@ -39,7 +39,14 @@ v2cfg.AddInputStream(stream); new NHibernate.Tool.hbm2ddl.SchemaExport(v1cfg).Execute(true, true, false, true); var v2schemaValidator = new NHibernate.Tool.hbm2ddl.SchemaValidator((v2cfg)); - v2schemaValidator.Validate(); + try + { + v2schemaValidator.Validate(); + } + catch (HibernateException e) + { + Assert.That(e.Message, Text.StartsWith("Missing column: Name")); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-25 22:11:03
|
Revision: 3929 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3929&view=rev Author: fabiomaulo Date: 2008-11-25 22:10:57 +0000 (Tue, 25 Nov 2008) Log Message: ----------- Fix NH-1588 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs 2008-11-25 21:50:57 UTC (rev 3928) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs 2008-11-25 22:10:57 UTC (rev 3929) @@ -19,10 +19,10 @@ private readonly IGetter idGetter; private readonly ISetter idSetter; - protected internal int propertySpan; - protected internal IGetter[] getters; - protected internal ISetter[] setters; - protected internal bool hasCustomAccessors; + protected int propertySpan; + protected IGetter[] getters; + protected ISetter[] setters; + protected bool hasCustomAccessors; protected IInstantiator instantiator; private readonly IProxyFactory proxyFactory; private readonly IAbstractComponentType identifierMapperType; @@ -30,7 +30,7 @@ /// <summary> Constructs a new AbstractEntityTuplizer instance. </summary> /// <param name="entityMetamodel">The "interpreted" information relating to the mapped entity. </param> /// <param name="mappingInfo">The parsed "raw" mapping data relating to the given entity. </param> - public AbstractEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo) + protected AbstractEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo) { this.entityMetamodel = entityMetamodel; @@ -303,13 +303,13 @@ /// <summary> Return the entity-mode handled by this tuplizer instance. </summary> public abstract EntityMode EntityMode { get;} - protected internal virtual IInstantiator Instantiator + protected virtual IInstantiator Instantiator { get { return instantiator; } } /// <summary>Retrieves the defined entity-name for the tuplized entity. </summary> - protected internal virtual string EntityName + protected virtual string EntityName { get { return entityMetamodel.Name; } } @@ -317,7 +317,7 @@ /// <summary> /// Retrieves the defined entity-names for any subclasses defined for this entity. /// </summary> - protected internal virtual ISet<string> SubclassEntityNames + protected virtual ISet<string> SubclassEntityNames { get { return entityMetamodel.SubclassEntityNames; } } @@ -326,32 +326,32 @@ /// <param name="mappedProperty">The property to be accessed via the built Getter. </param> /// <param name="mappedEntity">The entity information regarding the mapped entity owning this property. </param> /// <returns> An appropriate Getter instance. </returns> - protected internal abstract IGetter BuildPropertyGetter(Mapping.Property mappedProperty, PersistentClass mappedEntity); + protected abstract IGetter BuildPropertyGetter(Mapping.Property mappedProperty, PersistentClass mappedEntity); /// <summary> Build an appropriate Setter for the given property. </summary> /// <param name="mappedProperty">The property to be accessed via the built Setter. </param> /// <param name="mappedEntity">The entity information regarding the mapped entity owning this property. </param> /// <returns> An appropriate Setter instance. </returns> - protected internal abstract ISetter BuildPropertySetter(Mapping.Property mappedProperty, PersistentClass mappedEntity); + protected abstract ISetter BuildPropertySetter(Mapping.Property mappedProperty, PersistentClass mappedEntity); /// <summary> Build an appropriate Instantiator for the given mapped entity. </summary> /// <param name="mappingInfo">The mapping information regarding the mapped entity. </param> /// <returns> An appropriate Instantiator instance. </returns> - protected internal abstract IInstantiator BuildInstantiator(PersistentClass mappingInfo); + protected abstract IInstantiator BuildInstantiator(PersistentClass mappingInfo); /// <summary> Build an appropriate ProxyFactory for the given mapped entity. </summary> /// <param name="mappingInfo">The mapping information regarding the mapped entity. </param> /// <param name="idGetter">The constructed Getter relating to the entity's id property. </param> /// <param name="idSetter">The constructed Setter relating to the entity's id property. </param> /// <returns> An appropriate ProxyFactory instance. </returns> - protected internal abstract IProxyFactory BuildProxyFactory(PersistentClass mappingInfo, IGetter idGetter, ISetter idSetter); + protected abstract IProxyFactory BuildProxyFactory(PersistentClass mappingInfo, IGetter idGetter, ISetter idSetter); /// <summary> Extract a component property value. </summary> /// <param name="type">The component property types. </param> /// <param name="component">The component instance itself. </param> /// <param name="propertyPath">The property path for the property to be extracted. </param> /// <returns> The property value extracted. </returns> - protected internal virtual object GetComponentValue(ComponentType type, object component, string propertyPath) + protected virtual object GetComponentValue(ComponentType type, object component, string propertyPath) { int loc = propertyPath.IndexOf('.'); string basePropertyName = loc > 0 ? propertyPath.Substring(0, (loc) - (0)) : propertyPath; @@ -381,17 +381,17 @@ } } - protected internal virtual IProxyFactory ProxyFactory + protected virtual IProxyFactory ProxyFactory { get { return proxyFactory; } } - protected internal virtual bool ShouldGetAllProperties(object entity) + protected virtual bool ShouldGetAllProperties(object entity) { return !HasUninitializedLazyProperties(entity); } - protected internal EntityMetamodel EntityMetamodel + protected EntityMetamodel EntityMetamodel { get { return entityMetamodel; } } Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs 2008-11-25 21:50:57 UTC (rev 3928) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs 2008-11-25 22:10:57 UTC (rev 3929) @@ -40,7 +40,7 @@ get { return EntityMode.Map; } } - protected internal override IGetter BuildPropertyGetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) + protected override IGetter BuildPropertyGetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) { return BuildPropertyAccessor(mappedProperty).GetGetter(null, mappedProperty.Name); } @@ -50,17 +50,17 @@ return PropertyAccessorFactory.DynamicMapPropertyAccessor; } - protected internal override ISetter BuildPropertySetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) + protected override ISetter BuildPropertySetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) { return BuildPropertyAccessor(mappedProperty).GetSetter(null, mappedProperty.Name); } - protected internal override IInstantiator BuildInstantiator(PersistentClass mappingInfo) + protected override IInstantiator BuildInstantiator(PersistentClass mappingInfo) { return new DynamicMapInstantiator(mappingInfo); } - protected internal override IProxyFactory BuildProxyFactory(PersistentClass mappingInfo, IGetter idGetter, + protected override IProxyFactory BuildProxyFactory(PersistentClass mappingInfo, IGetter idGetter, ISetter idSetter) { IProxyFactory pf = new MapProxyFactory(); Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-11-25 21:50:57 UTC (rev 3928) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-11-25 22:10:57 UTC (rev 3929) @@ -70,17 +70,17 @@ get { return mappedClass; } } - protected internal override IGetter BuildPropertyGetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) + protected override IGetter BuildPropertyGetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) { return mappedProperty.GetGetter(mappedEntity.MappedClass); } - protected internal override ISetter BuildPropertySetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) + protected override ISetter BuildPropertySetter(Mapping.Property mappedProperty, PersistentClass mappedEntity) { return mappedProperty.GetSetter(mappedEntity.MappedClass); } - protected internal override IInstantiator BuildInstantiator(PersistentClass persistentClass) + protected override IInstantiator BuildInstantiator(PersistentClass persistentClass) { if (optimizer == null) { @@ -94,7 +94,7 @@ } } - protected internal override IProxyFactory BuildProxyFactory(PersistentClass persistentClass, IGetter idGetter, + protected override IProxyFactory BuildProxyFactory(PersistentClass persistentClass, IGetter idGetter, ISetter idSetter) { bool needAccesorCheck = true; // NH specific (look the comment below) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-25 22:00:05
|
Revision: 3927 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3927&view=rev Author: fabiomaulo Date: 2008-11-25 21:46:24 +0000 (Tue, 25 Nov 2008) Log Message: ----------- Fix NH-1587 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs 2008-11-25 21:31:27 UTC (rev 3926) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs 2008-11-25 21:46:24 UTC (rev 3927) @@ -23,7 +23,7 @@ protected internal IGetter[] getters; protected internal ISetter[] setters; protected internal bool hasCustomAccessors; - private readonly IInstantiator instantiator; + protected IInstantiator instantiator; private readonly IProxyFactory proxyFactory; private readonly IAbstractComponentType identifierMapperType; @@ -67,7 +67,8 @@ } hasCustomAccessors = foundCustomAccessor; - instantiator = BuildInstantiator(mappingInfo); + //NH-1587 + //instantiator = BuildInstantiator(mappingInfo); if (entityMetamodel.IsLazy) { Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs 2008-11-25 21:31:27 UTC (rev 3926) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs 2008-11-25 21:46:24 UTC (rev 3927) @@ -14,7 +14,11 @@ private static readonly ILog log = LogManager.GetLogger(typeof(PocoEntityTuplizer)); internal DynamicMapEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo) - : base(entityMetamodel, mappingInfo) {} + : base(entityMetamodel, mappingInfo) + { + // NH different behavior fo NH-1587 + instantiator = BuildInstantiator(mappingInfo); + } public override System.Type ConcreteProxyClass { Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-11-25 21:31:27 UTC (rev 3926) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-11-25 21:46:24 UTC (rev 3927) @@ -40,13 +40,16 @@ lazyPropertyNames.Add(property.Name); } - if (hasCustomAccessors || !Cfg.Environment.UseReflectionOptimizer) + if (Cfg.Environment.UseReflectionOptimizer) { - optimizer = null; + // NH different behavior fo NH-1587 + optimizer = Cfg.Environment.BytecodeProvider.GetReflectionOptimizer(mappedClass, getters, setters); } - else + instantiator = BuildInstantiator(mappedEntity); + + if (hasCustomAccessors) { - optimizer = Cfg.Environment.BytecodeProvider.GetReflectionOptimizer(mappedClass, getters, setters); + optimizer = null; } proxyValidator = Cfg.Environment.BytecodeProvider.ProxyFactoryFactory.ProxyValidator; @@ -81,10 +84,12 @@ { if (optimizer == null) { + log.Debug("Create Instantiator without optimizer for:" + persistentClass.MappedClass.FullName); return new PocoInstantiator(persistentClass, null); } else { + log.Debug("Create Instantiator using optimizer for:" + persistentClass.MappedClass.FullName); return new PocoInstantiator(persistentClass, optimizer.InstantiationOptimizer); } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs 2008-11-25 21:31:27 UTC (rev 3926) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs 2008-11-25 21:46:24 UTC (rev 3927) @@ -8,7 +8,7 @@ [TestFixture] public class Fixture { - [Test, Ignore("Not fixed yet")] + [Test] public void Bug() { XmlConfigurator.Configure(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-25 22:00:04
|
Revision: 3928 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3928&view=rev Author: fabiomaulo Date: 2008-11-25 21:50:57 +0000 (Tue, 25 Nov 2008) Log Message: ----------- Fix NH-1586 (Informix drive by Robert Sosnowski) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Driver/IfxDriver.cs Added: trunk/nhibernate/src/NHibernate/Driver/IfxDriver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/IfxDriver.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Driver/IfxDriver.cs 2008-11-25 21:50:57 UTC (rev 3928) @@ -0,0 +1,37 @@ +namespace NHibernate.Driver +{ + /// <summary> + /// A NHibernate Driver for using the Informix DataProvider + /// </summary> + public class IfxDriver : ReflectionBasedDriver + { + /// <summary> + /// Initializes a new instance of the <see cref="IfxDriver"/> class. + /// </summary> + /// <exception cref="HibernateException"> + /// Thrown when the <c>IBM.Data.Informix</c> assembly can not be loaded. + /// </exception> + public IfxDriver() + : base( + "IBM.Data.Informix", + "IBM.Data.Informix.IfxConnection", + "IBM.Data.Informix.IfxCommand") + { + } + + public override bool UseNamedPrefixInSql + { + get { return false; } + } + + public override bool UseNamedPrefixInParameter + { + get { return false; } + } + + public override string NamedPrefix + { + get { return ":"; } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-25 21:46:24 UTC (rev 3927) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-25 21:50:57 UTC (rev 3928) @@ -447,6 +447,7 @@ <Compile Include="Dialect\Schema\SybaseAnywhereMetaData.cs" /> <Compile Include="Dialect\SybaseASA10Dialect.cs" /> <Compile Include="Dialect\SybaseASA9Dialect.cs" /> + <Compile Include="Driver\IfxDriver.cs" /> <Compile Include="Id\SelectGenerator.cs" /> <Compile Include="Properties\BackFieldStrategy.cs" /> <Compile Include="Bytecode\CodeDom\BytecodeProviderImpl.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-25 21:27:33
|
Revision: 3925 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3925&view=rev Author: fabiomaulo Date: 2008-11-25 21:27:27 +0000 (Tue, 25 Nov 2008) Log Message: ----------- Ignore test (see comment in it) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs 2008-11-25 13:30:17 UTC (rev 3924) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs 2008-11-25 21:27:27 UTC (rev 3925) @@ -4,9 +4,12 @@ namespace NHibernate.Test.NHSpecificTest.NH1556 { - [TestFixture] + [TestFixture, Ignore("To investigate")] public class Fixture : BugTestCase { + // This test not fail but something very strange happen in various others tests + // probably the problem is the implementation of QuotedAndParenthesisStringTokenizer in MsSql2005Dialect + // but i'm not sure private Patient patient; protected override void OnSetUp() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Davy B. <ra...@da...> - 2008-11-25 14:54:56
|
ah ok :) On Mon, Nov 24, 2008 at 8:59 PM, Tuna Toksöz <te...@gm...> wrote: > Davy just a quick tip > > Stopwatch.StartNew() > > will do the same, nothing major, it is even not a minor :) > > + stopwatch = new Stopwatch(); > + stopwatch.Start(); > > You can use > > On Mon, Nov 24, 2008 at 9:57 PM, <dav...@us...> wrote: > >> - stopWath.Start(); >> + stopwatch = new Stopwatch(); >> + stopwatch.Start(); >> > > > > -- > Tuna Toksöz > http://www.tunatoksoz.com > > Typos included to enhance the readers attention! > > > ------------------------------------------------------------------------- > 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 > > |
From: <fab...@us...> - 2008-11-25 13:30:21
|
Revision: 3924 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3924&view=rev Author: fabiomaulo Date: 2008-11-25 13:30:17 +0000 (Tue, 25 Nov 2008) Log Message: ----------- Test for NH-1587 (only test because there are some existing failing tests to fix) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/A.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Mappings.hbm.xml Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/A.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/A.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/A.cs 2008-11-25 13:30:17 UTC (rev 3924) @@ -0,0 +1,7 @@ +namespace NHibernate.Test.NHSpecificTest.NH1587 +{ + public class A + { + public virtual string Description { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Fixture.cs 2008-11-25 13:30:17 UTC (rev 3924) @@ -0,0 +1,37 @@ +using log4net.Config; +using log4net.Core; +using NHibernate.Cfg; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1587 +{ + [TestFixture] + public class Fixture + { + [Test, Ignore("Not fixed yet")] + public void Bug() + { + XmlConfigurator.Configure(); + var cfg = new Configuration(); + if (TestConfigurationHelper.hibernateConfigFile != null) + cfg.Configure(TestConfigurationHelper.hibernateConfigFile); + cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1587.Mappings.hbm.xml", GetType().Assembly); + cfg.Configure(); + + bool useOptimizer= false; + using (var ls = new LogSpy("NHibernate.Tuple.Entity.PocoEntityTuplizer")) + { + cfg.BuildSessionFactory(); + foreach (LoggingEvent loggingEvent in ls.Appender.GetEvents()) + { + if (((string)(loggingEvent.MessageObject)).StartsWith("Create Instantiator using optimizer")) + { + useOptimizer = true; + break; + } + } + } + Assert.That(useOptimizer); + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Mappings.hbm.xml 2008-11-25 13:30:17 UTC (rev 3924) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1587"> + <class name="A"> + <id type="int"> + <generator class="native"/> + </id> + <property name="Description"/> + </class> +</hibernate-mapping> Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1587/Mappings.hbm.xml ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-24 19:56:59 UTC (rev 3923) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-25 13:30:17 UTC (rev 3924) @@ -524,6 +524,8 @@ <Compile Include="NHSpecificTest\NH1556\Patient.cs" /> <Compile Include="NHSpecificTest\NH1556\Product.cs" /> <Compile Include="NHSpecificTest\NH1556\ProductIdentifier.cs" /> + <Compile Include="NHSpecificTest\NH1587\A.cs" /> + <Compile Include="NHSpecificTest\NH1587\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Foo.cs" /> <Compile Include="NHSpecificTest\NH1018\Employee.cs" /> @@ -1542,6 +1544,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1587\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1556\Mappings.hbm.xml" /> <EmbeddedResource Include="Tools\hbm2ddl\SchemaValidator\2_Version.hbm.xml" /> <EmbeddedResource Include="Tools\hbm2ddl\SchemaValidator\1_Version.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: T. T. <te...@gm...> - 2008-11-24 20:00:05
|
Davy just a quick tip Stopwatch.StartNew() will do the same, nothing major, it is even not a minor :) + stopwatch = new Stopwatch(); + stopwatch.Start(); You can use On Mon, Nov 24, 2008 at 9:57 PM, <dav...@us...> wrote: > - stopWath.Start(); > + stopwatch = new Stopwatch(); > + stopwatch.Start(); > -- Tuna Toksöz http://www.tunatoksoz.com Typos included to enhance the readers attention! |
From: <dav...@us...> - 2008-11-24 19:57:04
|
Revision: 3923 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3923&view=rev Author: davybrion Date: 2008-11-24 19:56:59 +0000 (Mon, 24 Nov 2008) Log Message: ----------- minor modifications in the Action classes to make sure the StopWatch instance is only instantiated when Statistics are enabled instead of every time one of the affected actions is executed. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs Modified: trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs 2008-11-24 19:31:52 UTC (rev 3922) +++ trunk/nhibernate/src/NHibernate/Action/CollectionRecreateAction.cs 2008-11-24 19:56:59 UTC (rev 3923) @@ -21,10 +21,11 @@ public override void Execute() { bool statsEnabled = Session.Factory.Statistics.IsStatisticsEnabled; - var stopWath = new Stopwatch(); + Stopwatch stopwatch = null; if (statsEnabled) { - stopWath.Start(); + stopwatch = new Stopwatch(); + stopwatch.Start(); } IPersistentCollection collection = Collection; @@ -39,8 +40,8 @@ PostRecreate(); if (statsEnabled) { - stopWath.Stop(); - Session.Factory.StatisticsImplementor.RecreateCollection(Persister.Role, stopWath.Elapsed); + stopwatch.Stop(); + Session.Factory.StatisticsImplementor.RecreateCollection(Persister.Role, stopwatch.Elapsed); } } Modified: trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs 2008-11-24 19:31:52 UTC (rev 3922) +++ trunk/nhibernate/src/NHibernate/Action/CollectionRemoveAction.cs 2008-11-24 19:56:59 UTC (rev 3923) @@ -58,10 +58,11 @@ public override void Execute() { bool statsEnabled = Session.Factory.Statistics.IsStatisticsEnabled; - var stopWath = new Stopwatch(); + Stopwatch stopwatch = null; if (statsEnabled) { - stopWath.Start(); + stopwatch = new Stopwatch(); + stopwatch.Start(); } PreRemove(); @@ -83,8 +84,8 @@ if (statsEnabled) { - stopWath.Stop(); - Session.Factory.StatisticsImplementor.RemoveCollection(Persister.Role, stopWath.Elapsed); + stopwatch.Stop(); + Session.Factory.StatisticsImplementor.RemoveCollection(Persister.Role, stopwatch.Elapsed); } } Modified: trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs 2008-11-24 19:31:52 UTC (rev 3922) +++ trunk/nhibernate/src/NHibernate/Action/CollectionUpdateAction.cs 2008-11-24 19:56:59 UTC (rev 3923) @@ -31,10 +31,11 @@ bool affectedByFilters = persister.IsAffectedByEnabledFilters(session); bool statsEnabled = session.Factory.Statistics.IsStatisticsEnabled; - var stopWath = new Stopwatch(); + Stopwatch stopwatch = null; if (statsEnabled) { - stopWath.Start(); + stopwatch = new Stopwatch(); + stopwatch.Start(); } PreUpdate(); @@ -82,8 +83,8 @@ if (statsEnabled) { - stopWath.Stop(); - Session.Factory.StatisticsImplementor.UpdateCollection(Persister.Role, stopWath.Elapsed); + stopwatch.Stop(); + Session.Factory.StatisticsImplementor.UpdateCollection(Persister.Role, stopwatch.Elapsed); } } Modified: trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs 2008-11-24 19:31:52 UTC (rev 3922) +++ trunk/nhibernate/src/NHibernate/Action/EntityDeleteAction.cs 2008-11-24 19:56:59 UTC (rev 3923) @@ -36,10 +36,11 @@ object instance = Instance; bool statsEnabled = Session.Factory.Statistics.IsStatisticsEnabled; - var stopWath = new Stopwatch(); + Stopwatch stopwatch = null; if (statsEnabled) { - stopWath.Start(); + stopwatch = new Stopwatch(); + stopwatch.Start(); } bool veto = PreDelete(); @@ -93,8 +94,8 @@ if (statsEnabled && !veto) { - stopWath.Stop(); - Session.Factory.StatisticsImplementor.DeleteEntity(Persister.EntityName, stopWath.Elapsed); + stopwatch.Stop(); + Session.Factory.StatisticsImplementor.DeleteEntity(Persister.EntityName, stopwatch.Elapsed); } } Modified: trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs 2008-11-24 19:31:52 UTC (rev 3922) +++ trunk/nhibernate/src/NHibernate/Action/EntityIdentityInsertAction.cs 2008-11-24 19:56:59 UTC (rev 3923) @@ -59,10 +59,11 @@ object instance = Instance; bool statsEnabled = Session.Factory.Statistics.IsStatisticsEnabled; - var stopWath = new Stopwatch(); + Stopwatch stopwatch = null; if (statsEnabled) { - stopWath.Start(); + stopwatch = new Stopwatch(); + stopwatch.Start(); } bool veto = PreInsert(); @@ -94,8 +95,8 @@ PostInsert(); if (statsEnabled && !veto) { - stopWath.Stop(); - Session.Factory.StatisticsImplementor.InsertEntity(Persister.EntityName, stopWath.Elapsed); + stopwatch.Stop(); + Session.Factory.StatisticsImplementor.InsertEntity(Persister.EntityName, stopwatch.Elapsed); } } Modified: trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs 2008-11-24 19:31:52 UTC (rev 3922) +++ trunk/nhibernate/src/NHibernate/Action/EntityInsertAction.cs 2008-11-24 19:56:59 UTC (rev 3923) @@ -43,10 +43,11 @@ object id = Id; bool statsEnabled = Session.Factory.Statistics.IsStatisticsEnabled; - var stopWath = new Stopwatch(); + Stopwatch stopwatch = null; if (statsEnabled) { - stopWath.Start(); + stopwatch = new Stopwatch(); + stopwatch.Start(); } bool veto = PreInsert(); @@ -97,8 +98,8 @@ if (statsEnabled && !veto) { - stopWath.Stop(); - factory.StatisticsImplementor.InsertEntity(Persister.EntityName, stopWath.Elapsed); + stopwatch.Stop(); + factory.StatisticsImplementor.InsertEntity(Persister.EntityName, stopwatch.Elapsed); } } Modified: trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs 2008-11-24 19:31:52 UTC (rev 3922) +++ trunk/nhibernate/src/NHibernate/Action/EntityUpdateAction.cs 2008-11-24 19:56:59 UTC (rev 3923) @@ -48,10 +48,11 @@ object instance = Instance; bool statsEnabled = Session.Factory.Statistics.IsStatisticsEnabled; - var stopWath = new Stopwatch(); + Stopwatch stopwatch = null; if (statsEnabled) { - stopWath.Start(); + stopwatch = new Stopwatch(); + stopwatch.Start(); } bool veto = PreUpdate(); @@ -129,8 +130,8 @@ if (statsEnabled && !veto) { - stopWath.Stop(); - factory.StatisticsImplementor.UpdateEntity(Persister.EntityName, stopWath.Elapsed); + stopwatch.Stop(); + factory.StatisticsImplementor.UpdateEntity(Persister.EntityName, stopwatch.Elapsed); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2008-11-24 19:31:59
|
Revision: 3922 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3922&view=rev Author: davybrion Date: 2008-11-24 19:31:52 +0000 (Mon, 24 Nov 2008) Log Message: ----------- minor cleanup, mostly replacing hashtables with dictionaries where it was safe to do so Modified Paths: -------------- trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs trunk/nhibernate/src/NHibernate/Criterion/Projections.cs trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs trunk/nhibernate/src/NHibernate/Id/Enhanced/SequenceStructure.cs trunk/nhibernate/src/NHibernate/Impl/Printer.cs trunk/nhibernate/src/NHibernate/Impl/SessionFactoryObjectFactory.cs trunk/nhibernate/src/NHibernate/Loader/Custom/Sql/SQLQueryReturnProcessor.cs trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs trunk/nhibernate/src/NHibernate/SqlCommand/SelectFragment.cs trunk/nhibernate/src/NHibernate/Type/ComponentType.cs trunk/nhibernate/src/NHibernate.Test/ConnectionTest/ThreadLocalCurrentSessionTest.cs trunk/nhibernate/src/NHibernate.Test/Naturalid/Immutable/ImmutableNaturalIdFixture.cs Modified: trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/AdoNet/OracleDataClientBatchingBatcher.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Reflection; @@ -15,8 +16,8 @@ private int countOfCommands = 0; private int totalExpectedRowsAffected; private IDbCommand currentBatch; - private Hashtable parameterValueArrayHashTable; - private Hashtable parameterIsAllNullsHashTable; + private IDictionary<string, ArrayList> parameterValueArrayHashTable; + private IDictionary<string, bool> parameterIsAllNullsHashTable; public OracleDataClientBatchingBatcher(ConnectionManager connectionManager, IInterceptor interceptor) @@ -36,10 +37,10 @@ { // use first command as the batching command currentBatch = CurrentCommand; - parameterValueArrayHashTable = new Hashtable(); + parameterValueArrayHashTable = new Dictionary<string, ArrayList>(); //oracle does not allow array containing all null values - // so this HashTable is keeping track if all values are null or not - parameterIsAllNullsHashTable = new Hashtable(); + // so this Dictionary is keeping track if all values are null or not + parameterIsAllNullsHashTable = new Dictionary<string, bool>(); } else { @@ -57,7 +58,7 @@ } else { - parameterValueArray = parameterValueArrayHashTable[currentParameter.ParameterName] as ArrayList; + parameterValueArray = parameterValueArrayHashTable[currentParameter.ParameterName]; } if (currentParameter.Value != DBNull.Value) @@ -73,8 +74,6 @@ { DoExecuteBatch(currentBatch); } - - } protected override void DoExecuteBatch(IDbCommand ps) @@ -90,7 +89,7 @@ foreach (IDataParameter currentParameter in currentBatch.Parameters) { - ArrayList parameterValueArray = parameterValueArrayHashTable[currentParameter.ParameterName] as ArrayList; + ArrayList parameterValueArray = parameterValueArrayHashTable[currentParameter.ParameterName]; currentParameter.Value = parameterValueArray.ToArray(); arraySize = parameterValueArray.Count; } Modified: trunk/nhibernate/src/NHibernate/Criterion/Projections.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/Projections.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Criterion/Projections.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -257,8 +257,9 @@ /// Return a constant value /// </summary> /// <param name="obj">The obj.</param> + /// <param name="type"></param> /// <returns></returns> - public static IProjection Constant(object obj,IType type) + public static IProjection Constant(object obj, IType type) { return new ConstantProjection(obj,type); } Modified: trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -58,13 +58,13 @@ { throw new QueryException("function takes no arguments: " + name); } - SqlStringBuilder buf = new SqlStringBuilder(2); - buf.Add(name); + if (hasParenthesesIfNoArguments) { - buf.Add("()"); + return new SqlString(name + "()"); } - return buf.ToSqlString(); + + return new SqlString(name); } #endregion Modified: trunk/nhibernate/src/NHibernate/Id/Enhanced/SequenceStructure.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/Enhanced/SequenceStructure.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Id/Enhanced/SequenceStructure.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -113,7 +113,7 @@ { rs.Close(); } - catch (Exception ignore) + catch { // intentionally empty } Modified: trunk/nhibernate/src/NHibernate/Impl/Printer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/Printer.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Impl/Printer.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -27,7 +27,7 @@ return entity.GetType().FullName; } - IDictionary result = new Hashtable(); + IDictionary<string, string> result = new Dictionary<string, string>(); if (cm.HasIdentifierProperty) { @@ -49,7 +49,8 @@ public string ToString(IType[] types, object[] values) { - IList list = new ArrayList(types.Length); + List<string> list = new List<string>(types.Length); + for (int i = 0; i < types.Length; i++) { if (types[i] != null) @@ -62,7 +63,7 @@ public string ToString(IDictionary<string, TypedValue> namedTypedValues) { - IDictionary result = new Hashtable(namedTypedValues.Count); + IDictionary<string, string> result = new Dictionary<string, string>(namedTypedValues.Count); foreach (KeyValuePair<string, TypedValue> me in namedTypedValues) { Modified: trunk/nhibernate/src/NHibernate/Impl/SessionFactoryObjectFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionFactoryObjectFactory.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Impl/SessionFactoryObjectFactory.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -28,8 +28,8 @@ private static readonly ILog log; // in h2.0.3 these use a class called "FastHashMap" - private static readonly Hashtable Instances = new Hashtable(); - private static readonly Hashtable NamedInstances = new Hashtable(); + private static readonly IDictionary<string, ISessionFactory> Instances = new Dictionary<string, ISessionFactory>(); + private static readonly IDictionary<string, ISessionFactory> NamedInstances = new Dictionary<string, ISessionFactory>(); /// <summary></summary> static SessionFactoryObjectFactory() @@ -54,13 +54,13 @@ { if (log.IsDebugEnabled) { - string nameMsg = ((name != null && name.Length > 0) ? name : "unnamed"); + string nameMsg = ((!string.IsNullOrEmpty(name)) ? name : "unnamed"); log.Debug("registered: " + uid + "(" + nameMsg + ")"); } Instances[uid] = instance; - if (name != null && name.Length > 0) + if (!string.IsNullOrEmpty(name)) { log.Info("Factory name:" + name); NamedInstances[name] = instance; @@ -79,7 +79,7 @@ /// <param name="properties">The configured properties for the ISessionFactory.</param> public static void RemoveInstance(string uid, string name, IDictionary<string, string> properties) { - if (name != null && name.Length > 0) + if (!string.IsNullOrEmpty(name)) { log.Info("unbinding factory: " + name); @@ -97,7 +97,7 @@ public static ISessionFactory GetNamedInstance(string name) { log.Debug("lookup: name=" + name); - ISessionFactory factory = NamedInstances[name] as ISessionFactory; + ISessionFactory factory = NamedInstances[name]; if (factory == null) { log.Warn("Not found: " + name); @@ -113,7 +113,7 @@ public static ISessionFactory GetInstance(string uid) { log.Debug("lookup: uid=" + uid); - ISessionFactory factory = Instances[uid] as ISessionFactory; + ISessionFactory factory = Instances[uid]; if (factory == null) { log.Warn("Not found: " + uid); Modified: trunk/nhibernate/src/NHibernate/Loader/Custom/Sql/SQLQueryReturnProcessor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Custom/Sql/SQLQueryReturnProcessor.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Loader/Custom/Sql/SQLQueryReturnProcessor.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -293,7 +293,7 @@ public IList GenerateCustomReturns(bool queryHadAliases) { IList customReturns = new ArrayList(); - IDictionary customReturnsByAlias = new Hashtable(); + IDictionary<string, object> customReturnsByAlias = new Dictionary<string, object>(); for (int i = 0; i < queryReturns.Length; i++) { if (queryReturns[i] is NativeSQLQueryScalarReturn) Modified: trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -160,8 +160,8 @@ private readonly string[] spaces; - private readonly IDictionary collectionPropertyColumnAliases = new Hashtable(); - private readonly IDictionary collectionPropertyColumnNames = new Hashtable(); + private readonly IDictionary<string, object> collectionPropertyColumnAliases = new Dictionary<string, object>(); + private readonly IDictionary<string, object> collectionPropertyColumnNames = new Dictionary<string, object>(); private static readonly ILog log = LogManager.GetLogger(typeof (ICollectionPersister)); Modified: trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Persister/Entity/AbstractEntityPersister.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -204,7 +204,7 @@ #endregion - private readonly Hashtable uniqueKeyLoaders = new Hashtable(); + private readonly Dictionary<string, EntityLoader> uniqueKeyLoaders = new Dictionary<string, EntityLoader>(); private readonly Dictionary<LockMode, ILockingStrategy> lockers = new Dictionary<LockMode, ILockingStrategy>(); private readonly Dictionary<string, IUniqueEntityLoader> loaders = new Dictionary<string, IUniqueEntityLoader>(); @@ -1996,12 +1996,10 @@ if (useStaticLoader) { - return (EntityLoader)uniqueKeyLoaders[propertyName]; + return uniqueKeyLoaders[propertyName]; } - else - { - return CreateUniqueKeyLoader(propertyMapping.ToType(propertyName), propertyMapping.ToColumns(propertyName), enabledFilters); - } + + return CreateUniqueKeyLoader(propertyMapping.ToType(propertyName), propertyMapping.ToColumns(propertyName), enabledFilters); } public int GetPropertyIndex(string propertyName) Modified: trunk/nhibernate/src/NHibernate/SqlCommand/SelectFragment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/SqlCommand/SelectFragment.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/SqlCommand/SelectFragment.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Text; using Iesi.Collections; using NHibernate.Util; @@ -12,8 +13,8 @@ public class SelectFragment { private string suffix; - private IList columns = new ArrayList(); - private IList columnAliases = new ArrayList(); + private IList<string> columns = new List<string>(); + private IList<string> columnAliases = new List<string>(); private Dialect.Dialect dialect; private string[] usedAliases; private string extraSelectList; @@ -57,7 +58,7 @@ public SelectFragment AddColumn(string tableAlias, string columnName, string columnAlias) { - if (tableAlias == null || tableAlias.Length == 0) + if (string.IsNullOrEmpty(tableAlias)) { columns.Add(columnName); } @@ -140,8 +141,8 @@ bool found = false; for (int i = 0; i < columns.Count; i++) { - string col = columns[i] as string; - string columnAlias = columnAliases[i] as string; + string col = columns[i]; + string columnAlias = columnAliases[i]; if (columnsUnique.Add(columnAlias)) { Modified: trunk/nhibernate/src/NHibernate/Type/ComponentType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/ComponentType.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate/Type/ComponentType.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Reflection; using System.Xml; @@ -311,7 +312,7 @@ { return "null"; } - IDictionary result = new Hashtable(); + IDictionary<string, string> result = new Dictionary<string, string>(); EntityMode? entityMode = tuplizerMapping.GuessEntityMode(value); if (!entityMode.HasValue) { Modified: trunk/nhibernate/src/NHibernate.Test/ConnectionTest/ThreadLocalCurrentSessionTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ConnectionTest/ThreadLocalCurrentSessionTest.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate.Test/ConnectionTest/ThreadLocalCurrentSessionTest.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -59,7 +59,7 @@ session.CreateQuery("from Silly"); Assert.Fail("method other than beginTransaction{} allowed"); } - catch (HibernateException e) + catch (HibernateException) { // ok } Modified: trunk/nhibernate/src/NHibernate.Test/Naturalid/Immutable/ImmutableNaturalIdFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Naturalid/Immutable/ImmutableNaturalIdFixture.cs 2008-11-24 12:59:36 UTC (rev 3921) +++ trunk/nhibernate/src/NHibernate.Test/Naturalid/Immutable/ImmutableNaturalIdFixture.cs 2008-11-24 19:31:52 UTC (rev 3922) @@ -73,7 +73,7 @@ s.Flush(); Assert.Fail(); } - catch (HibernateException he) {} + catch (HibernateException) {} u.UserName = "steve"; s.Delete(u); t.Commit(); @@ -82,63 +82,63 @@ [Test] public void NaturalIdCache() - { - ISession s = OpenSession(); - s.BeginTransaction(); - User u = new User("steve", "superSecret"); - s.Persist(u); - s.Transaction.Commit(); - s.Close(); - - sessions.Statistics.Clear(); - - s = OpenSession(); - s.BeginTransaction(); + { + ISession s = OpenSession(); + s.BeginTransaction(); + User u = new User("steve", "superSecret"); + s.Persist(u); + s.Transaction.Commit(); + s.Close(); + + sessions.Statistics.Clear(); + + s = OpenSession(); + s.BeginTransaction(); u = (User) s.CreateCriteria(typeof (User)).Add(Restrictions.NaturalId().Set("UserName", "steve")).SetCacheable(true). UniqueResult(); - Assert.That(u, Is.Not.Null); - s.Transaction.Commit(); + Assert.That(u, Is.Not.Null); + s.Transaction.Commit(); s.Close(); Assert.AreEqual(1, sessions.Statistics.QueryExecutionCount); Assert.AreEqual(0, sessions.Statistics.QueryCacheHitCount); - Assert.AreEqual(1, sessions.Statistics.QueryCachePutCount); - - s = OpenSession(); - s.BeginTransaction(); - User v = new User("gavin", "supsup"); - s.Persist(v); - s.Transaction.Commit(); - s.Close(); - - sessions.Statistics.Clear(); - - s = OpenSession(); - s.BeginTransaction(); + Assert.AreEqual(1, sessions.Statistics.QueryCachePutCount); + + s = OpenSession(); + s.BeginTransaction(); + User v = new User("gavin", "supsup"); + s.Persist(v); + s.Transaction.Commit(); + s.Close(); + + sessions.Statistics.Clear(); + + s = OpenSession(); + s.BeginTransaction(); u = (User) s.CreateCriteria(typeof(User)).Add(Restrictions.NaturalId().Set("UserName", "steve")).SetCacheable(true). UniqueResult(); Assert.That(u, Is.Not.Null); Assert.AreEqual(0, sessions.Statistics.QueryExecutionCount); - Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); + Assert.AreEqual(1, sessions.Statistics.QueryCacheHitCount); u = (User) s.CreateCriteria(typeof(User)).Add(Restrictions.NaturalId().Set("UserName", "steve")).SetCacheable(true). UniqueResult(); Assert.That(u, Is.Not.Null); Assert.AreEqual(0, sessions.Statistics.QueryExecutionCount); - Assert.AreEqual(2, sessions.Statistics.QueryCacheHitCount); - s.Transaction.Commit(); - s.Close(); - - s = OpenSession(); - s.BeginTransaction(); - s.Delete("from User"); - s.Transaction.Commit(); - s.Close(); + Assert.AreEqual(2, sessions.Statistics.QueryCacheHitCount); + s.Transaction.Commit(); + s.Close(); + + s = OpenSession(); + s.BeginTransaction(); + s.Delete("from User"); + s.Transaction.Commit(); + s.Close(); } } } \ 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: <dav...@us...> - 2008-11-24 12:59:40
|
Revision: 3921 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3921&view=rev Author: davybrion Date: 2008-11-24 12:59:36 +0000 (Mon, 24 Nov 2008) Log Message: ----------- minor changes to the NResult to use strong typed collections internally instead of ArrayLists. I think we can avoid a lot of boxing/unboxing and unnecessary casting this way. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs Modified: trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2008-11-22 21:31:16 UTC (rev 3920) +++ trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2008-11-24 12:59:36 UTC (rev 3921) @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Data; using NHibernate.Util; @@ -479,14 +480,14 @@ private readonly object[][] records; private int colCount = 0; - private DataTable schemaTable; + private readonly DataTable schemaTable; // key = field name // index = field index - private readonly IDictionary fieldNameToIndex = new Hashtable(); - private readonly ArrayList fieldIndexToName = new ArrayList(); - private readonly ArrayList fieldTypes = new ArrayList(); - private readonly ArrayList fieldDataTypeNames = new ArrayList(); + private readonly IDictionary<string, int> fieldNameToIndex = new Dictionary<string, int>(); + private readonly IList<string> fieldIndexToName = new List<string>(); + private readonly IList<System.Type> fieldTypes = new List<System.Type>(); + private readonly IList<string> fieldDataTypeNames = new List<string>(); /// <summary> /// Initializes a new instance of the NResult class. @@ -532,7 +533,6 @@ isMidstream = false; } - records = (object[][]) recordsList.ToArray(typeof(object[])); } @@ -543,7 +543,7 @@ /// <returns></returns> public string GetDataTypeName(int colIndex) { - return (string) fieldDataTypeNames[colIndex]; + return fieldDataTypeNames[colIndex]; } /// <summary> @@ -562,7 +562,7 @@ /// <returns></returns> public System.Type GetFieldType(int colIndex) { - return (System.Type) fieldTypes[colIndex]; + return fieldTypes[colIndex]; } /// <summary> @@ -572,7 +572,7 @@ /// <returns></returns> public string GetName(int colIndex) { - return (string) fieldIndexToName[colIndex]; + return fieldIndexToName[colIndex]; } /// <summary></summary> @@ -593,21 +593,20 @@ // interface, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataIDataRecordClassItemTopic1.asp. // This is necessary for databases that don't preserve the case of field names when // they are created without quotes (e.g. DB2, PostgreSQL). - if (fieldNameToIndex[colName] != null) + if (fieldNameToIndex.ContainsKey(colName)) { - return (int) fieldNameToIndex[colName]; + return fieldNameToIndex[colName]; } - else + + foreach (KeyValuePair<string, int> pair in fieldNameToIndex) { - foreach (DictionaryEntry entry in fieldNameToIndex) + if (StringHelper.EqualsCaseInsensitive(pair.Key, colName)) { - if (StringHelper.EqualsCaseInsensitive((string) entry.Key, colName)) - { - return (int) entry.Value; - } + return pair.Value; } - throw new IndexOutOfRangeException(String.Format("No column with the specified name was found: {0}.", colName)); } + + throw new IndexOutOfRangeException(String.Format("No column with the specified name was found: {0}.", colName)); } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-22 22:22:04
|
Revision: 3920 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3920&view=rev Author: fabiomaulo Date: 2008-11-22 21:31:16 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Removed TODO because done Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs 2008-11-22 20:38:45 UTC (rev 3919) +++ trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs 2008-11-22 21:31:16 UTC (rev 3920) @@ -311,7 +311,6 @@ } if (settings.IsAutoValidateSchema) { - // TODO NH : Schema validator not ported yet new SchemaValidator(cfg, settings).Validate(); } if (settings.IsAutoDropSchema) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-22 20:38:50
|
Revision: 3919 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3919&view=rev Author: tehlike Date: 2008-11-22 20:38:45 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Minors. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs 2008-11-22 18:56:04 UTC (rev 3918) +++ trunk/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs 2008-11-22 20:38:45 UTC (rev 3919) @@ -151,7 +151,10 @@ settings.IsAutoCreateSchema = true; settings.IsAutoDropSchema = true; } - + if ("validate" == autoSchemaExport) + { + settings.IsAutoValidateSchema = true; + } bool useSecondLevelCache = PropertiesHelper.GetBoolean(Environment.UseSecondLevelCache, properties, true); bool useQueryCache = PropertiesHelper.GetBoolean(Environment.UseQueryCache, properties); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2008-11-22 18:56:06
|
Revision: 3918 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3918&view=rev Author: tehlike Date: 2008-11-22 18:56:04 +0000 (Sat, 22 Nov 2008) Log Message: ----------- Finalizing NH-1569 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs 2008-11-17 21:54:06 UTC (rev 3917) +++ trunk/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs 2008-11-22 18:56:04 UTC (rev 3918) @@ -312,7 +312,7 @@ if (settings.IsAutoValidateSchema) { // TODO NH : Schema validator not ported yet - // new SchemaValidator(cfg, settings).validate(); + new SchemaValidator(cfg, settings).Validate(); } if (settings.IsAutoDropSchema) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-17 21:54:08
|
Revision: 3917 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3917&view=rev Author: fabiomaulo Date: 2008-11-17 21:54:06 +0000 (Mon, 17 Nov 2008) Log Message: ----------- Test for NH-1556 (fixed in some moment on trunk but the test is useful for others matters involved with NsSQL2005 dialect) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Claim.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Patient.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Product.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/ProductIdentifier.cs Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Claim.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Claim.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Claim.cs 2008-11-17 21:54:06 UTC (rev 3917) @@ -0,0 +1,43 @@ +using System; + +namespace NHibernate.Test.NHSpecificTest.NH1556 +{ + public class Claim + { + private Guid id; + private DateTime lastFilled; + private ProductIdentifier productIdentifier; + private Patient patient; + + protected Claim() + { + } + + public Claim(Patient patient, DateTime lastFilled, ProductIdentifier productIdentifier) + { + this.patient = patient; + this.lastFilled = lastFilled; + this.productIdentifier = productIdentifier; + } + + public virtual Guid Id + { + get { return id; } + } + + public virtual DateTime LastFilled + { + get { return lastFilled; } + } + + public virtual ProductIdentifier ProductIdentifier + { + get { return productIdentifier; } + } + + public virtual Patient Patient + { + get { return patient; } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Fixture.cs 2008-11-17 21:54:06 UTC (rev 3917) @@ -0,0 +1,86 @@ +using System; +using System.Collections; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1556 +{ + [TestFixture] + public class Fixture : BugTestCase + { + private Patient patient; + + protected override void OnSetUp() + { + var prozac = new Product("Prozac"); + var prozacId1 = new ProductIdentifier("12345-2345-11", prozac); + var prozacId2 = new ProductIdentifier("12345-2345-12", prozac); + + var warfarin = new Product("Warfarin"); + var warfarinId3 = new ProductIdentifier("12345-4321-13", warfarin); + + patient = new Patient("John", "Doe"); + + var prozacClaim1 = new Claim(patient, new DateTime(2000, 1, 1), prozacId1); + var prozacClaim2 = new Claim(patient, new DateTime(2001, 1, 1), prozacId2); + var warfarinClaim1 = new Claim(patient, new DateTime(2000, 4, 1), warfarinId3); + + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Save(prozac); + session.Save(warfarin); + session.Save(patient); + session.Save(prozacClaim1); + session.Save(prozacClaim2); + session.Save(warfarinClaim1); + + tx.Commit(); + } + } + } + + protected override void OnTearDown() + { + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Delete("from Claim"); + session.Delete("from Patient"); + session.Delete("from ProductIdentifier"); + session.Delete("from Product"); + tx.Commit(); + } + } + } + + [Test] + public void CanOrderByAggregate() + { + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + var loadedPatient = session.Get<Patient>(patient.Id); + + IList list = + session.CreateQuery( + @"select p.Id, p.ProductName, max(c.LastFilled), count(c.Id) +from Claim as c +from c.ProductIdentifier.Product as p +where c.Patient = :patient +group by p.Id, p.ProductName +order by max(c.LastFilled) asc, p.ProductName") + .SetParameter("patient", loadedPatient).SetFirstResult(0).SetMaxResults(2).List(); + + Assert.AreEqual(2, list.Count); + Assert.AreEqual(new DateTime(2000, 4, 1), ((object[]) list[0])[2]); + Assert.AreEqual(new DateTime(2001, 1, 1), ((object[]) list[1])[2]); + Assert.AreEqual(1, ((object[]) list[0])[3]); + Assert.AreEqual(2, ((object[]) list[1])[3]); + } + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Mappings.hbm.xml 2008-11-17 21:54:06 UTC (rev 3917) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + default-access="nosetter.camelcase" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1556"> + + <class name="Claim" table="Claims"> + <id name="Id" column="Id" type="System.Guid"> + <generator class="guid.comb" /> + </id> + <property type="System.DateTime" not-null="true" name="LastFilled" column="[LastFilled]" /> + <many-to-one name="ProductIdentifier" cascade="none" column="ProductIdentifierId" not-null="true" class="ProductIdentifier" /> + <many-to-one name="Patient" cascade="none" column="PatientId" not-null="true" class="Patient" /> + </class> + + <class name="Patient" table="Patients"> + <id name="Id" column="Id" type="System.Int64"> + <generator class="native" /> + </id> + <property type="System.String" not-null="true" name="FirstName" column="[FirstName]" /> + <property type="System.String" not-null="true" name="LastName" column="[LastName]" /> + </class> + + <class name="ProductIdentifier" table="ProductIdentifier"> + <id name="Id" column="Id" type="System.Int64"> + <generator class="native" /> + </id> + <property type="System.String" not-null="true" name="IdentifierField" column="[IdentifierField]" /> + <many-to-one name="Product" cascade="none" column="ProductId" class="Product" /> + </class> + + <class name="Product" table="Product"> + <id name="Id" column="Id" type="System.Int64"> + <generator class="native" /> + </id> + <property type="System.String" not-null="true" name="ProductName" column="[ProductName]" unique="true" /> + <bag name="ProductIdentifiers" inverse="true" lazy="true" cascade="all"> + <key column="ProductId" /> + <one-to-many class="ProductIdentifier" /> + </bag> + </class> + +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Patient.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Patient.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Patient.cs 2008-11-17 21:54:06 UTC (rev 3917) @@ -0,0 +1,34 @@ +namespace NHibernate.Test.NHSpecificTest.NH1556 +{ + public class Patient + { + private long id; + private string firstName; + private string lastName; + + protected Patient() + { + } + + public Patient(string firstName, string lastName) + { + this.firstName = firstName; + this.lastName = lastName; + } + + public virtual long Id + { + get { return id; } + } + + public virtual string FirstName + { + get { return firstName; } + } + + public virtual string LastName + { + get { return lastName; } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Product.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Product.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/Product.cs 2008-11-17 21:54:06 UTC (rev 3917) @@ -0,0 +1,40 @@ +using System.Collections.Generic; + +namespace NHibernate.Test.NHSpecificTest.NH1556 +{ + public class Product + { + protected Product() + { + productIdentifiers = new List<ProductIdentifier>(); + } + + public Product(string productName) : this() + { + this.productName = productName; + } + + private long id; + public virtual long Id + { + get { return id; } + } + + private string productName; + public virtual string ProductName + { + get { return productName; } + } + + private IList<ProductIdentifier> productIdentifiers; + public virtual IList<ProductIdentifier> ProductIdentifiers + { + get { return productIdentifiers; } + } + + public virtual void AddIdentifier(ProductIdentifier productIdentifier) + { + productIdentifiers.Add(productIdentifier); + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/ProductIdentifier.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/ProductIdentifier.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1556/ProductIdentifier.cs 2008-11-17 21:54:06 UTC (rev 3917) @@ -0,0 +1,34 @@ +namespace NHibernate.Test.NHSpecificTest.NH1556 +{ + public class ProductIdentifier + { + protected ProductIdentifier() + { + } + + public ProductIdentifier(string identifierField, Product product) + { + this.identifierField = identifierField; + this.product = product; + this.product.AddIdentifier(this); + } + + private long id; + public virtual long Id + { + get { return id; } + } + + private string identifierField; + public virtual string IdentifierField + { + get { return identifierField; } + } + + private Product product; + public virtual Product Product + { + get { return product; } + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-17 21:34:20 UTC (rev 3916) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-17 21:54:06 UTC (rev 3917) @@ -519,6 +519,11 @@ <Compile Include="NHSpecificTest\NH1508\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1508\Person.cs" /> <Compile Include="NHSpecificTest\NH1515\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1556\Claim.cs" /> + <Compile Include="NHSpecificTest\NH1556\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1556\Patient.cs" /> + <Compile Include="NHSpecificTest\NH1556\Product.cs" /> + <Compile Include="NHSpecificTest\NH1556\ProductIdentifier.cs" /> <Compile Include="NHSpecificTest\NH280\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Foo.cs" /> <Compile Include="NHSpecificTest\NH1018\Employee.cs" /> @@ -1537,6 +1542,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1556\Mappings.hbm.xml" /> <EmbeddedResource Include="Tools\hbm2ddl\SchemaValidator\2_Version.hbm.xml" /> <EmbeddedResource Include="Tools\hbm2ddl\SchemaValidator\1_Version.hbm.xml" /> <EmbeddedResource Include="TypesTest\GenericEnumStringClass.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |