File tree Expand file tree Collapse file tree 4 files changed +38
-13
lines changed
NHibernate.Test/Tools/hbm2ddl/SchemaMetadataUpdaterTest Expand file tree Collapse file tree 4 files changed +38
-13
lines changed Original file line number Diff line number Diff line change 44 assembly =" NHibernate.Test"
55 default-lazy =" false" >
66
7- <class name =" Order" >
8- <id type =" int" >
9- <generator class =" native" />
10- </id >
11- <property name =" Select" />
12- <property name =" From" />
13- <property name =" And" />
14- <property name =" Column" />
15- <property name =" Name" />
16- <property name =" Abracadabra" />
17- </class >
7+ <class name =" Order" >
8+ <id type =" int" >
9+ <generator class =" native" />
10+ </id >
11+ <property name =" Select" />
12+ <property name =" From" />
13+ <property name =" And" />
14+ <property name =" Column" />
15+ <property name =" Name" />
16+ <property name =" Abracadabra" />
17+ <set name =" Rows" cascade =" none" >
18+ <key column =" Order" />
19+ <one-to-many class =" OrderRow" />
20+ </set >
21+ </class >
22+ <class name =" OrderRow" >
23+ <id name =" Id" >
24+ <generator class =" native" />
25+ </id >
26+ <property name =" Name" />
27+ <many-to-one name =" Order" column =" Order" not-null =" true" />
28+ </class >
1829
19- </hibernate-mapping >
30+ </hibernate-mapping >
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+
13namespace NHibernate . Test . Tools . hbm2ddl . SchemaMetadataUpdaterTest
24{
35 public class Order
@@ -8,5 +10,6 @@ public class Order
810 public string Column { get ; set ; }
911 public string Name { get ; set ; }
1012 public string Abracadabra { get ; set ; }
13+ public ISet < OrderRow > Rows { get ; set ; }
1114 }
12- }
15+ }
Original file line number Diff line number Diff line change 1+ namespace NHibernate . Test . Tools . hbm2ddl . SchemaMetadataUpdaterTest
2+ {
3+ public class OrderRow
4+ {
5+ public int Id { get ; set ; }
6+ public Order Order { get ; set ; }
7+ public string Name { get ; set ; }
8+ }
9+ }
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ public static void QuoteTableAndColumns(Configuration configuration)
5555
5656 public static void QuoteTableAndColumns ( Configuration configuration , Dialect . Dialect dialect )
5757 {
58+ // We have to build the mappings in order to quote collection mappings that use a second pass command to be fully initialized
59+ configuration . BuildMappings ( ) ;
5860 foreach ( var cm in configuration . ClassMappings )
5961 {
6062 QuoteTable ( cm . Table , dialect ) ;
You can’t perform that action at this time.
0 commit comments