|
From: <ric...@us...> - 2010-05-24 20:02:33
|
Revision: 4981
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4981&view=rev
Author: ricbrown
Date: 2010-05-24 20:02:27 +0000 (Mon, 24 May 2010)
Log Message:
-----------
Fix NH-2201 (NDataReader doesn't reset the currentrow index when a move to NextResult is executed)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs
Modified: trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2010-05-10 11:24:31 UTC (rev 4980)
+++ trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2010-05-24 20:02:27 UTC (rev 4981)
@@ -117,6 +117,7 @@
public bool NextResult()
{
currentResultIndex++;
+ currentRowIndex = -1;
if (currentResultIndex >= results.Length)
{
Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201
___________________________________________________________________
Added: bugtraq:url
+ http://jira.nhibernate.org/browse/%BUGID%
Added: bugtraq:logregex
+ NH-\d+
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs 2010-05-24 20:02:27 UTC (rev 4981)
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+
+namespace NHibernate.Test.NHSpecificTest.NH2201
+{
+ [TestFixture]
+ public class Fixture : BugTestCase
+ {
+ protected override void OnTearDown()
+ {
+ using (var s = OpenSession())
+ using (var tx = s.BeginTransaction())
+ {
+ s.Delete("from Parent");
+ tx.Commit();
+ }
+
+ base.OnTearDown();
+ }
+
+ [Test]
+ public void CanUseMutliCriteriaAndFetchSelect()
+ {
+ using (var s = OpenSession())
+ using (var tx = s.BeginTransaction())
+ {
+ s.Save(new Parent());
+ s.Save(new SubClass() { Name = "test" });
+
+ tx.Commit();
+ }
+
+ using (ISession s = OpenSession())
+ {
+ Console.WriteLine("*** start");
+ var results =
+ s.CreateMultiCriteria()
+ .Add<Parent>(s.CreateCriteria<Parent>())
+ .Add<Parent>(s.CreateCriteria<Parent>())
+ .List();
+
+ var result1 = (IList<Parent>)results[0];
+ var result2 = (IList<Parent>)results[1];
+
+ Assert.That(result1.Count, Is.EqualTo(2));
+ Assert.That(result2.Count, Is.EqualTo(2));
+ Console.WriteLine("*** end");
+ }
+ }
+ }
+}
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml 2010-05-24 20:02:27 UTC (rev 4981)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
+ assembly="NHibernate.Test"
+ namespace="NHibernate.Test.NHSpecificTest.NH2201">
+
+ <class name="Parent" lazy="false">
+ <id name="Id">
+ <generator class="guid.comb" />
+ </id>
+ <discriminator />
+ <subclass name="SubClass">
+ <join table="ParentDetail" fetch="select">
+ <key column="ParentId" />
+ <property name="Name" />
+ </join>
+ </subclass>
+ </class>
+
+</hibernate-mapping>
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs 2010-05-24 20:02:27 UTC (rev 4981)
@@ -0,0 +1,14 @@
+using System;
+
+namespace NHibernate.Test.NHSpecificTest.NH2201
+{
+ public class Parent
+ {
+ public virtual Guid Id { get; set; }
+ }
+
+ public class SubClass : Parent
+ {
+ public virtual string Name { get; set; }
+ }
+}
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-10 11:24:31 UTC (rev 4980)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-24 20:02:27 UTC (rev 4981)
@@ -712,6 +712,8 @@
<Compile Include="NHSpecificTest\NH2113\Model.cs" />
<Compile Include="NHSpecificTest\NH2192\Fixture.cs" />
<Compile Include="NHSpecificTest\NH2192\Model.cs" />
+ <Compile Include="NHSpecificTest\NH2201\Fixture.cs" />
+ <Compile Include="NHSpecificTest\NH2201\Model.cs" />
<Compile Include="NHSpecificTest\NH473\Child.cs" />
<Compile Include="NHSpecificTest\NH473\Fixture.cs" />
<Compile Include="NHSpecificTest\NH473\Parent.cs" />
@@ -2134,6 +2136,7 @@
<EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" />
<EmbeddedResource Include="DriverTest\SqlServerCeEntity.hbm.xml" />
<Content Include="DynamicEntity\package.html" />
+ <EmbeddedResource Include="NHSpecificTest\NH2201\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH2192\Mappings.hbm.xml" />
<EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|