|
From: <fab...@us...> - 2011-06-19 21:20:12
|
Revision: 5962
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5962&view=rev
Author: fabiomaulo
Date: 2011-06-19 21:20:05 +0000 (Sun, 19 Jun 2011)
Log Message:
-----------
Passing test for NH-2746 (the refactoring of param. management was for something)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/DomainClasses.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Fixture.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Mappings.hbm.xml
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/DomainClasses.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/DomainClasses.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/DomainClasses.cs 2011-06-19 21:20:05 UTC (rev 5962)
@@ -0,0 +1,27 @@
+using Iesi.Collections.Generic;
+
+namespace NHibernate.Test.NHSpecificTest.NH2746
+{
+ public class T1
+ {
+ public virtual int Id { get; set; }
+ public virtual string Name { get; set; }
+ public virtual Iesi.Collections.Generic.ISet<T2> Children { get; protected set; }
+
+ public T1()
+ {
+ this.Children = new HashedSet<T2>();
+ }
+ }
+
+ public class T2
+ {
+ public virtual int Id { get; set; }
+ public virtual string Name { get; set; }
+ public virtual T1 Parent { get; set; }
+
+ public T2()
+ {
+ }
+ }
+}
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Fixture.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Fixture.cs 2011-06-19 21:20:05 UTC (rev 5962)
@@ -0,0 +1,32 @@
+using NHibernate.Criterion;
+using NHibernate.Transform;
+using NUnit.Framework;
+using SharpTestsEx;
+
+namespace NHibernate.Test.NHSpecificTest.NH2746
+{
+ public class Fixture: BugTestCase
+ {
+ [Test]
+ public void TestQuery()
+ {
+ using (ISession session = OpenSession())
+ {
+ DetachedCriteria page = DetachedCriteria.For<T1>()
+ .SetFirstResult(3)
+ .SetMaxResults(7)
+ .AddOrder(NHibernate.Criterion.Order.Asc(Projections.Id()))
+ .SetProjection(Projections.Id());
+
+ ICriteria crit = session.CreateCriteria<T1>()
+ .Add(Subqueries.PropertyIn("id", page))
+ .SetResultTransformer(new DistinctRootEntityResultTransformer())
+ .SetFetchMode("Children", NHibernate.FetchMode.Join);
+
+ session.EnableFilter("nameFilter").SetParameter("name", "Another child");
+
+ crit.Executing(c=> c.List<T1>()).NotThrows();
+ }
+ }
+ }
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Mappings.hbm.xml
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Mappings.hbm.xml (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2746/Mappings.hbm.xml 2011-06-19 21:20:05 UTC (rev 5962)
@@ -0,0 +1,29 @@
+<?xml version="1.0" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
+ namespace="NHibernate.Test.NHSpecificTest.NH2746" assembly="NHibernate.Test">
+ <class xmlns="urn:nhibernate-mapping-2.2" mutable="true" name="T1" table="T1">
+ <id column="Id" name="Id" >
+ <generator class="native" />
+ </id>
+
+ <property name="Name" column="Name" type="System.String" length="50" not-null="false" />
+ <set name="Children" inverse="true" >
+ <key column="T1Id" />
+ <one-to-many class="T2" />
+ <filter name="nameFilter" condition=":name=Name" />
+ </set>
+ </class>
+
+ <class name="T2" table="T2">
+ <id column="Id" name="Id" >
+ <generator class="native" />
+ </id>
+
+ <property name="Name" column="Name" type="System.String" length="50" not-null="false" />
+ <many-to-one name="Parent" column="T1Id" not-null="true" />
+ </class>
+
+ <filter-def name="nameFilter" >
+ <filter-param name="name" type="System.String" />
+ </filter-def>
+</hibernate-mapping>
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-06-19 21:07:39 UTC (rev 5961)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-06-19 21:20:05 UTC (rev 5962)
@@ -874,6 +874,8 @@
<Compile Include="NHSpecificTest\NH2733\Model.cs" />
<Compile Include="NHSpecificTest\NH2736\Domain.cs" />
<Compile Include="NHSpecificTest\NH2736\Fixture.cs" />
+ <Compile Include="NHSpecificTest\NH2746\DomainClasses.cs" />
+ <Compile Include="NHSpecificTest\NH2746\Fixture.cs" />
<Compile Include="NHSpecificTest\NH2760\Fixture.cs" />
<Compile Include="NHSpecificTest\NH2760\Model.cs" />
<Compile Include="NHSpecificTest\NH941\Domain.cs" />
@@ -2722,6 +2724,7 @@
<EmbeddedResource Include="NHSpecificTest\NH1291AnonExample\Mappings.hbm.xml" />
</ItemGroup>
<ItemGroup>
+ <EmbeddedResource Include="NHSpecificTest\NH2746\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH2700\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH2296\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH2760\Mappings.hbm.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|