File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed
Expand file tree Collapse file tree 4 files changed +60
-0
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 13211321 <Compile Include =" NHSpecificTest\NH3641\TestFixture.cs" />
13221322 <Compile Include =" NHSpecificTest\NH3800\Domain.cs" />
13231323 <Compile Include =" NHSpecificTest\NH3800\Fixture.cs" />
1324+ <Compile Include =" NHSpecificTest\NH3757\Fixture.cs" />
1325+ <Compile Include =" NHSpecificTest\NH3757\Money.cs" />
13241326 <Compile Include =" NHSpecificTest\Properties\CompositePropertyRefTest.cs" />
13251327 <Compile Include =" NHSpecificTest\Properties\DynamicEntityTest.cs" />
13261328 <Compile Include =" NHSpecificTest\Properties\Model.cs" />
32213223 <EmbeddedResource Include =" NHSpecificTest\NH3800\Mappings.hbm.xml" >
32223224 <SubType >Designer</SubType >
32233225 </EmbeddedResource >
3226+ <EmbeddedResource Include =" NHSpecificTest\NH3757\Mappings.hbm.xml" />
32243227 <EmbeddedResource Include =" LazyComponentTest\Person.hbm.xml" />
32253228 <EmbeddedResource Include =" NHSpecificTest\NH3372\Mappings.hbm.xml" />
32263229 <EmbeddedResource Include =" NHSpecificTest\NH3567\Mappings.hbm.xml" />
You can’t perform that action at this time.
0 commit comments