File tree Expand file tree Collapse file tree 3 files changed +79
-0
lines changed
src/NHibernate.Test/NHSpecificTest/GH2614 Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System . Collections ;
2
+ using System . Threading . Tasks ;
3
+ using NUnit . Framework ;
4
+
5
+ namespace NHibernate . Test . NHSpecificTest . GH2614
6
+ {
7
+ public class Fixture : BugTestCase
8
+ {
9
+ [ Test ]
10
+ public async Task TestOk ( )
11
+ {
12
+ using ( ISession s = OpenSession ( ) )
13
+ {
14
+ using ( ITransaction t = s . BeginTransaction ( ) )
15
+ {
16
+ try
17
+ {
18
+ {
19
+ s . Save ( new ConcreteClass1 { Name = "C1" } ) ;
20
+ s . Save ( new ConcreteClass2 { Name = "C2" } ) ;
21
+ }
22
+ {
23
+ var query = s . CreateQuery ( @"
24
+ SELECT Name FROM NHibernate.Test.NHSpecificTest.GH2614.BaseClass ROOT" ) ;
25
+ query . SetMaxResults ( 5 ) ;
26
+ IList listAsync = await query . ListAsync ( ) ;
27
+ Assert . AreEqual ( 2 , listAsync . Count ) ;
28
+ Assert . AreEqual ( 2 , query . List ( ) . Count ) ;
29
+ }
30
+ }
31
+ finally
32
+ {
33
+ s . Delete ( "from ConcreteClass1" ) ;
34
+ s . Delete ( "from ConcreteClass2" ) ;
35
+ t . Commit ( ) ;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <hibernate-mapping xmlns =" urn:nhibernate-mapping-2.2"
3
+ namespace =" NHibernate.Test.NHSpecificTest.GH2614"
4
+ assembly =" NHibernate.Test"
5
+ >
6
+ <class name =" ConcreteClass1" >
7
+ <id name =" Id" >
8
+ <generator class =" increment" />
9
+ </id >
10
+ <property name =" Name" />
11
+ </class >
12
+
13
+ <class name =" ConcreteClass2" >
14
+ <id name =" Id" >
15
+ <generator class =" increment" />
16
+ </id >
17
+ <property name =" Name" />
18
+ </class >
19
+
20
+ </hibernate-mapping >
Original file line number Diff line number Diff line change
1
+ using System . Collections . Generic ;
2
+
3
+ namespace NHibernate . Test . NHSpecificTest . GH2614
4
+ {
5
+ public abstract class BaseClass
6
+ {
7
+ public virtual int Id { get ; set ; }
8
+ public virtual string Name { get ; set ; }
9
+ }
10
+
11
+ public class ConcreteClass1 : BaseClass
12
+ {
13
+ }
14
+
15
+ public class ConcreteClass2 : BaseClass
16
+ {
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments