File tree Expand file tree Collapse file tree 6 files changed +85
-2
lines changed
Expand file tree Collapse file tree 6 files changed +85
-2
lines changed Original file line number Diff line number Diff line change @@ -43,5 +43,18 @@ public async Task SimpleDeleteAsync()
4343 await ( tx . CommitAsync ( ) ) ;
4444 }
4545 }
46+
47+ [ Test , KnownBug ( "#3489" ) ]
48+ public async Task InsertFromSelectWithMultipleAssociationsAsync ( )
49+ {
50+ using var s = OpenSession ( ) ;
51+ using var tx = s . BeginTransaction ( ) ;
52+
53+ await ( s . CreateQuery ( "insert into Enrolment (Course, Student)" +
54+ " select e.Course, e.Student from Enrolment e" )
55+ . ExecuteUpdateAsync ( ) ) ;
56+
57+ await ( tx . CommitAsync ( ) ) ;
58+ }
4659 }
47- }
60+ }
Original file line number Diff line number Diff line change 1+ namespace NHibernate . Test . BulkManipulation
2+ {
3+ public class Course
4+ {
5+ public virtual long CourseId { get ; set ; }
6+ public virtual string Description { get ; set ; }
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ namespace NHibernate . Test . BulkManipulation
4+ {
5+ [ Serializable ]
6+ public class Enrolment
7+ {
8+ public virtual long EnrolmentId { get ; set ; }
9+ public virtual Student Student { get ; set ; }
10+ public virtual Course Course { get ; set ; }
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <hibernate-mapping
3+ xmlns=" urn:nhibernate-mapping-2.2"
4+ assembly=" NHibernate.Test"
5+ namespace=" NHibernate.Test.BulkManipulation" >
6+
7+ <class name =" Course" >
8+ <id name =" CourseId" >
9+ <generator class =" native" />
10+ </id >
11+ <property name =" Description" />
12+ </class >
13+
14+ <class name =" Student" >
15+ <id name =" StudentId" >
16+ <generator class =" native" />
17+ </id >
18+ <property name =" Name" />
19+ </class >
20+
21+ <class name =" Enrolment" >
22+ <id name =" EnrolmentId" >
23+ <generator class =" native" />
24+ </id >
25+ <many-to-one name =" Student" column =" StudentId" class =" Student" />
26+ <many-to-one name =" Course" column =" CourseId" class =" Course" />
27+ </class >
28+
29+ </hibernate-mapping >
Original file line number Diff line number Diff line change @@ -32,5 +32,18 @@ public void SimpleDelete()
3232 tx . Commit ( ) ;
3333 }
3434 }
35+
36+ [ Test , KnownBug ( "#3489" ) ]
37+ public void InsertFromSelectWithMultipleAssociations ( )
38+ {
39+ using var s = OpenSession ( ) ;
40+ using var tx = s . BeginTransaction ( ) ;
41+
42+ s . CreateQuery ( "insert into Enrolment (Course, Student)" +
43+ " select e.Course, e.Student from Enrolment e" )
44+ . ExecuteUpdate ( ) ;
45+
46+ tx . Commit ( ) ;
47+ }
3548 }
36- }
49+ }
Original file line number Diff line number Diff line change 1+ namespace NHibernate . Test . BulkManipulation
2+ {
3+ public class Student
4+ {
5+ public virtual long StudentId { get ; set ; }
6+ public virtual string Name { get ; set ; }
7+ }
8+ }
You can’t perform that action at this time.
0 commit comments