File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed
src/FluentNHibernate.Testing Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Linq ;
2
3
using FluentNHibernate . Mapping ;
4
+ using FluentNHibernate . Mapping . Providers ;
5
+ using FluentNHibernate . MappingModel . ClassBased ;
3
6
using NUnit . Framework ;
4
7
5
8
namespace FluentNHibernate . Testing . DomainModel . Mapping
@@ -207,5 +210,12 @@ public class ComponentKey
207
210
public virtual int KeyCol1 { get ; set ; }
208
211
public virtual int KeyCol2 { get ; set ; }
209
212
}
213
+
214
+ [ Test ]
215
+ public void Can_Have_Multiple_key_Columns ( )
216
+ {
217
+ var provider = ( IIndeterminateSubclassMappingProvider ) new MultipleKeyColumnsTester . TestMap ( ) ;
218
+ provider . GetSubclassMapping ( SubclassType . JoinedSubclass ) . Key . Columns . Count ( ) . ShouldEqual ( 2 ) ;
219
+ }
210
220
}
211
221
}
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using FluentNHibernate . Mapping ;
6
+ using FluentNHibernate . Mapping . Providers ;
7
+ using FluentNHibernate . MappingModel . ClassBased ;
8
+ using NUnit . Framework ;
9
+
10
+ namespace FluentNHibernate . Testing . DomainModel . Mapping
11
+ {
12
+ [ TestFixture ]
13
+ public class MultipleKeyColumnsTester
14
+ {
15
+ [ Test ]
16
+ public void CanHaveMultipleKeyColumns ( )
17
+ {
18
+ var provider = ( IIndeterminateSubclassMappingProvider ) new TestMap ( ) ;
19
+ provider . GetSubclassMapping ( SubclassType . JoinedSubclass ) . Key . Columns . Count ( ) . ShouldEqual ( 2 ) ;
20
+ }
21
+
22
+ public class Base
23
+ {
24
+ public int Id { get ; set ; }
25
+ }
26
+
27
+ public class TestMap : SubclassMap < Base >
28
+ {
29
+ public TestMap ( )
30
+ {
31
+ KeyColumn ( "col1" ) ;
32
+ KeyColumn ( "col2" ) ;
33
+ }
34
+ }
35
+ }
36
+ }
Original file line number Diff line number Diff line change 121
121
<Compile Include =" AutoMapping\Overrides\CompositeIdOverrides.cs" />
122
122
<Compile Include =" AutoMapping\Overrides\HibernateMappingOverrides.cs" />
123
123
<Compile Include =" DomainModel\Mapping\ManyToManySelfReferencedInverseIntegrationTester.cs" />
124
+ <Compile Include =" DomainModel\Mapping\MultipleKeyColumnsTester.cs" />
124
125
<Compile Include =" DomainModel\MemberAccessResolverTests.cs" />
125
126
<Compile Include =" DomainModel\MemberBackingFieldTests.cs" />
126
127
<Compile Include =" DomainModel\NamingTests.cs" />
You can’t perform that action at this time.
0 commit comments