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 12011201 <Compile Include =" NHSpecificTest\NH2860\SampleTest.cs" />
12021202 <Compile Include =" NHSpecificTest\NH3641\Domain.cs" />
12031203 <Compile Include =" NHSpecificTest\NH3641\TestFixture.cs" />
1204+ <Compile Include =" NHSpecificTest\NH3757\Fixture.cs" />
1205+ <Compile Include =" NHSpecificTest\NH3757\Money.cs" />
12041206 <Compile Include =" NHSpecificTest\Properties\CompositePropertyRefTest.cs" />
12051207 <Compile Include =" NHSpecificTest\Properties\DynamicEntityTest.cs" />
12061208 <Compile Include =" NHSpecificTest\Properties\Model.cs" />
30733075 <EmbeddedResource Include =" NHSpecificTest\NH1291AnonExample\Mappings.hbm.xml" />
30743076 </ItemGroup >
30753077 <ItemGroup >
3078+ <EmbeddedResource Include =" NHSpecificTest\NH3757\Mappings.hbm.xml" />
30763079 <EmbeddedResource Include =" LazyComponentTest\Person.hbm.xml" />
30773080 <EmbeddedResource Include =" NHSpecificTest\NH3570\Mappings.hbm.xml" />
30783081 <EmbeddedResource Include =" NHSpecificTest\NH3455\Mappings.hbm.xml" />
You can’t perform that action at this time.
0 commit comments