diff --git a/src/NHibernate.Test/NHSpecificTest/NH3757/Fixture.cs b/src/NHibernate.Test/NHSpecificTest/NH3757/Fixture.cs new file mode 100644 index 00000000000..ac9ecd4eda6 --- /dev/null +++ b/src/NHibernate.Test/NHSpecificTest/NH3757/Fixture.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH3757 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void OnTearDown() + { + using (ISession s = OpenSession()) + { + using (ITransaction tx = s.BeginTransaction()) + { + s.CreateSQLQuery("delete from EntityName").ExecuteUpdate(); + tx.Commit(); + } + } + } + + [Test] + public void ShouldBePossibleToHaveComponentInEntityNameMappedEntity() + { + using (ISession session = OpenSession()) + using (ITransaction transaction = session.BeginTransaction()) + { + var e1 = new Dictionary(); + e1["Money"] = new Money { Amount = 100m, Currency = "USD" }; + session.Save("EntityName", e1); + + session.Flush(); + transaction.Commit(); + } + } + } +} \ No newline at end of file diff --git a/src/NHibernate.Test/NHSpecificTest/NH3757/Mappings.hbm.xml b/src/NHibernate.Test/NHSpecificTest/NH3757/Mappings.hbm.xml new file mode 100644 index 00000000000..55d39756ced --- /dev/null +++ b/src/NHibernate.Test/NHSpecificTest/NH3757/Mappings.hbm.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NHibernate.Test/NHSpecificTest/NH3757/Money.cs b/src/NHibernate.Test/NHSpecificTest/NH3757/Money.cs new file mode 100644 index 00000000000..b00e71ac4a8 --- /dev/null +++ b/src/NHibernate.Test/NHSpecificTest/NH3757/Money.cs @@ -0,0 +1,9 @@ +namespace NHibernate.Test.NHSpecificTest.NH3757 +{ + public class Money + { + public virtual decimal Amount { get; set; } + + public virtual string Currency { get; set; } + } +} diff --git a/src/NHibernate.Test/NHibernate.Test.csproj b/src/NHibernate.Test/NHibernate.Test.csproj index f21597364cf..a3aafcda21a 100644 --- a/src/NHibernate.Test/NHibernate.Test.csproj +++ b/src/NHibernate.Test/NHibernate.Test.csproj @@ -1321,6 +1321,8 @@ + + @@ -3221,6 +3223,7 @@ Designer + diff --git a/src/NHibernate/Tuple/Component/ComponentEntityModeToTuplizerMapping.cs b/src/NHibernate/Tuple/Component/ComponentEntityModeToTuplizerMapping.cs index 8b4fd90691b..4734e508a75 100644 --- a/src/NHibernate/Tuple/Component/ComponentEntityModeToTuplizerMapping.cs +++ b/src/NHibernate/Tuple/Component/ComponentEntityModeToTuplizerMapping.cs @@ -46,7 +46,7 @@ public ComponentEntityModeToTuplizerMapping(Mapping.Component component) userSuppliedTuplizerImpls.TryGetValue(EntityMode.Poco, out tempObject2); userSuppliedTuplizerImpls.Remove(EntityMode.Poco); tuplizerImpl = tempObject2; - if (owner.HasPocoRepresentation && component.HasPocoRepresentation) + if (component.HasPocoRepresentation) { if (tuplizerImpl == null) {