Skip to content

NH-3693 - AliasToBeanResultTransformer fails under Firebird #597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ private void AssertObjectsAreEqual(object expected, object actual, string name)

if ((expectedType.IsValueType)
|| (expected is System.Type)
|| (expected is string))
|| (expected is string)
|| (expected is FieldInfo)
|| (expected is PropertyInfo))
{
Assert.AreEqual(expected, actual, fieldPath);
_fieldPath.Pop();
Expand Down
15 changes: 15 additions & 0 deletions src/NHibernate.Test/NHSpecificTest/NH1904/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,19 @@ public class Invoice

protected virtual DateTime issued { get; set; }
}

public class InvoiceWithAddress : Invoice
{
public virtual Address BillingAddress { get; set; }
}

public struct Address
{
public string Line { get; set; }
public string line { get; set; }
public string Line2 { get; set; }
public string City { get; set; }
public string ZipCode { get; set; }
public string Country { get; set; }
}
}
47 changes: 47 additions & 0 deletions src/NHibernate.Test/NHSpecificTest/NH1904/StructFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections;
using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH1904
{
[TestFixture]
public class StructFixture : BugTestCase
{
protected override IList Mappings =>
new string[]
{
"NHSpecificTest." + BugNumber + ".StructMappings.hbm.xml"
};

[Test]
public void ExecuteQuery()
{
using (ISession session = OpenSession())
using (ITransaction transaction = session.BeginTransaction())
{
var invoice = new InvoiceWithAddress
{
Issued = DateTime.Now,
BillingAddress = new Address { Line = "84 rue du 22 septembre", City = "Courbevoie", ZipCode = "92400", Country = "France" }
};
session.Save(invoice);
transaction.Commit();
}

using (ISession session = OpenSession())
{
var invoices = session.CreateCriteria<Invoice>().List<Invoice>();
}
}

protected override void OnTearDown()
{
base.OnTearDown();
using (ISession session = OpenSession())
{
session.CreateQuery("delete from InvoiceWithAddress").ExecuteUpdate();
session.Flush();
}
}
}
}
22 changes: 22 additions & 0 deletions src/NHibernate.Test/NHSpecificTest/NH1904/StructMappings.hbm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="NHibernate.Test"
namespace="NHibernate.Test.NHSpecificTest.NH1904">

<class name="InvoiceWithAddress">
<id name="ID" type="Int32">
<generator class="hilo" />
</id>

<property name="Issued" type="DateTime" />

<component name="BillingAddress">
<property name="Line"/>
<property name="Line2"/>
<property name="City"/>
<property name="ZipCode"/>
<property name="Country"/>
</component>
</class>

</hibernate-mapping>
2 changes: 2 additions & 0 deletions src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@
<Compile Include="NHSpecificTest\EntityWithUserTypeCanHaveLinqGenerators\FooExample.cs" />
<Compile Include="NHSpecificTest\EntityWithUserTypeCanHaveLinqGenerators\IExample.cs" />
<Compile Include="Insertordering\NH3931Entities.cs" />
<Compile Include="NHSpecificTest\NH1904\StructFixture.cs" />
<Compile Include="NHSpecificTest\NH3247\Entity.cs" />
<Compile Include="NHSpecificTest\NH3247\Fixture.cs" />
<Compile Include="NHSpecificTest\NH3386\Entity.cs" />
Expand Down Expand Up @@ -3251,6 +3252,7 @@
<EmbeddedResource Include="NHSpecificTest\NH1291AnonExample\Mappings.hbm.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="NHSpecificTest\NH1904\StructMappings.hbm.xml" />
<EmbeddedResource Include="Insertordering\FamilyModel\Mappings.hbm.xml" />
<EmbeddedResource Include="Insertordering\AnimalModel\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH3247\Mappings.hbm.xml" />
Expand Down
Loading