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 4
4
assembly =" NHibernate.Test"
5
5
default-lazy =" false" >
6
6
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 >
18
29
19
- </hibernate-mapping >
30
+ </hibernate-mapping >
Original file line number Diff line number Diff line change
1
+ using System . Collections . Generic ;
2
+
1
3
namespace NHibernate . Test . Tools . hbm2ddl . SchemaMetadataUpdaterTest
2
4
{
3
5
public class Order
@@ -8,5 +10,6 @@ public class Order
8
10
public string Column { get ; set ; }
9
11
public string Name { get ; set ; }
10
12
public string Abracadabra { get ; set ; }
13
+ public ISet < OrderRow > Rows { get ; set ; }
11
14
}
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)
55
55
56
56
public static void QuoteTableAndColumns ( Configuration configuration , Dialect . Dialect dialect )
57
57
{
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 ( ) ;
58
60
foreach ( var cm in configuration . ClassMappings )
59
61
{
60
62
QuoteTable ( cm . Table , dialect ) ;
You can’t perform that action at this time.
0 commit comments