File tree Expand file tree Collapse file tree 5 files changed +61
-1
lines changed
NHibernate/Tuple/Component Expand file tree Collapse file tree 5 files changed +61
-1
lines changed Original file line number Diff line number Diff line change
1
+ using System . Collections . Generic ;
2
+ using NUnit . Framework ;
3
+
4
+ namespace NHibernate . Test . NHSpecificTest . NH3757
5
+ {
6
+ [ TestFixture ]
7
+ public class Fixture : BugTestCase
8
+ {
9
+ protected override void OnTearDown ( )
10
+ {
11
+ using ( ISession s = OpenSession ( ) )
12
+ {
13
+ using ( ITransaction tx = s . BeginTransaction ( ) )
14
+ {
15
+ s . CreateSQLQuery ( "delete from EntityName" ) . ExecuteUpdate ( ) ;
16
+ tx . Commit ( ) ;
17
+ }
18
+ }
19
+ }
20
+
21
+ [ Test ]
22
+ public void ShouldBePossibleToHaveComponentInEntityNameMappedEntity ( )
23
+ {
24
+ using ( ISession session = OpenSession ( ) )
25
+ using ( ITransaction transaction = session . BeginTransaction ( ) )
26
+ {
27
+ var e1 = new Dictionary < string , object > ( ) ;
28
+ e1 [ "Money" ] = new Money { Amount = 100m , Currency = "USD" } ;
29
+ session . Save ( "EntityName" , e1 ) ;
30
+
31
+ session . Flush ( ) ;
32
+ transaction . Commit ( ) ;
33
+ }
34
+ }
35
+ }
36
+ }
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" assembly =" NHibernate.Test" namespace =" NHibernate.Test.NHSpecificTest.NH3757" >
3
+
4
+ <class entity-name =" EntityName" >
5
+ <id name =" Id" type =" Int32" generator =" native" />
6
+ <component name =" Money" class =" Money" >
7
+ <property name =" Amount" type =" decimal" />
8
+ <property name =" Currency" type =" string" />
9
+ </component >
10
+ </class >
11
+
12
+ </hibernate-mapping >
Original file line number Diff line number Diff line change
1
+ namespace NHibernate . Test . NHSpecificTest . NH3757
2
+ {
3
+ public class Money
4
+ {
5
+ public virtual decimal Amount { get ; set ; }
6
+
7
+ public virtual string Currency { get ; set ; }
8
+ }
9
+ }
Original file line number Diff line number Diff line change 1321
1321
<Compile Include =" NHSpecificTest\NH3641\TestFixture.cs" />
1322
1322
<Compile Include =" NHSpecificTest\NH3800\Domain.cs" />
1323
1323
<Compile Include =" NHSpecificTest\NH3800\Fixture.cs" />
1324
+ <Compile Include =" NHSpecificTest\NH3757\Fixture.cs" />
1325
+ <Compile Include =" NHSpecificTest\NH3757\Money.cs" />
1324
1326
<Compile Include =" NHSpecificTest\Properties\CompositePropertyRefTest.cs" />
1325
1327
<Compile Include =" NHSpecificTest\Properties\DynamicEntityTest.cs" />
1326
1328
<Compile Include =" NHSpecificTest\Properties\Model.cs" />
3221
3223
<EmbeddedResource Include =" NHSpecificTest\NH3800\Mappings.hbm.xml" >
3222
3224
<SubType >Designer</SubType >
3223
3225
</EmbeddedResource >
3226
+ <EmbeddedResource Include =" NHSpecificTest\NH3757\Mappings.hbm.xml" />
3224
3227
<EmbeddedResource Include =" LazyComponentTest\Person.hbm.xml" />
3225
3228
<EmbeddedResource Include =" NHSpecificTest\NH3372\Mappings.hbm.xml" />
3226
3229
<EmbeddedResource Include =" NHSpecificTest\NH3567\Mappings.hbm.xml" />
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public ComponentEntityModeToTuplizerMapping(Mapping.Component component)
46
46
userSuppliedTuplizerImpls . TryGetValue ( EntityMode . Poco , out tempObject2 ) ;
47
47
userSuppliedTuplizerImpls . Remove ( EntityMode . Poco ) ;
48
48
tuplizerImpl = tempObject2 ;
49
- if ( owner . HasPocoRepresentation && component . HasPocoRepresentation )
49
+ if ( component . HasPocoRepresentation )
50
50
{
51
51
if ( tuplizerImpl == null )
52
52
{
You can’t perform that action at this time.
0 commit comments