File tree Expand file tree Collapse file tree 4 files changed +83
-0
lines changed
src/NHibernate.Test/NHSpecificTest/NH2783 Expand file tree Collapse file tree 4 files changed +83
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System . Collections . Generic ;
2
+
3
+ namespace NHibernate . Test . NHSpecificTest . NH2783
4
+ {
5
+ class Bar
6
+ {
7
+ public virtual int Id { get ; set ; }
8
+
9
+ public virtual int DynValString2 { get ; set ; }
10
+
11
+ public virtual IDictionary < string , object > MyProps { get ; set ; } = new Dictionary < string , object > ( ) ;
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ using NUnit . Framework ;
2
+
3
+ namespace NHibernate . Test . NHSpecificTest . NH2783
4
+ {
5
+ [ TestFixture ]
6
+ public class Fixture : BugTestCase
7
+ {
8
+ protected override void OnSetUp ( )
9
+ {
10
+ }
11
+
12
+ protected override void OnTearDown ( )
13
+ {
14
+ using ( var session = OpenSession ( ) )
15
+ using ( var transaction = session . BeginTransaction ( ) )
16
+ {
17
+ // The HQL delete does all the job inside the database without loading the entities, but it does
18
+ // not handle delete order for avoiding violating constraints if any. Use
19
+ // session.Delete("from System.Object");
20
+ // instead if in need of having NHbernate ordering the deletes, but this will cause
21
+ // loading the entities in the session.
22
+ session . CreateQuery ( "delete from System.Object" ) . ExecuteUpdate ( ) ;
23
+
24
+ transaction . Commit ( ) ;
25
+ }
26
+ }
27
+
28
+ [ Test ]
29
+ public void DoNothing ( )
30
+ {
31
+ }
32
+ }
33
+ }
Original file line number Diff line number Diff line change
1
+ using System . Collections . Generic ;
2
+
3
+ namespace NHibernate . Test . NHSpecificTest . NH2783
4
+ {
5
+ class Foo
6
+ {
7
+ public virtual int Id { get ; set ; }
8
+
9
+ public virtual IDictionary < string , object > MyProps { get ; set ; } = new Dictionary < string , object > ( ) ;
10
+ }
11
+ }
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
+ assembly =" NHibernate.Test"
4
+ namespace =" NHibernate.Test.NHSpecificTest.NH2783" >
5
+
6
+ <class name =" Foo" >
7
+ <id type =" int" name =" Id" >
8
+ <column name =" Id" />
9
+ <generator class =" native" />
10
+ </id >
11
+
12
+ <dynamic-component name =" MyProps" >
13
+ <many-to-one name =" DynPointer" class =" Bar" property-ref =" MyProps.DynValString2" />
14
+ </dynamic-component >
15
+ </class >
16
+
17
+ <class name =" Bar" >
18
+ <id type =" int" name =" Id" >
19
+ <column name =" Id" />
20
+ <generator class =" native" />
21
+ </id >
22
+ <dynamic-component name =" MyProps" >
23
+ <property name =" DynValString2" type =" string" unique =" 1" />
24
+ </dynamic-component >
25
+ </class >
26
+ </hibernate-mapping >
You can’t perform that action at this time.
0 commit comments