Skip to content

Commit 3ad4b7b

Browse files
David EllingsworthDavid Ellingsworth
David Ellingsworth
authored and
David Ellingsworth
committed
nhibernateGH-3530: Force all columns to be strings to highlight conversion errors.
1 parent 8b59014 commit 3ad4b7b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/NHibernate.Test/NHSpecificTest/GH3530/Entities.cs

+9
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,13 @@ public class LocaleEntity
1414
public virtual double DoubleValue { get; set; }
1515
public virtual decimal DecimalValue { get; set; }
1616
}
17+
18+
public class SchemaLocaleEntity
19+
{
20+
public virtual Guid Id { get; set; }
21+
public virtual string IntegerValue { get; set; }
22+
public virtual string DateTimeValue { get; set; }
23+
public virtual string DoubleValue { get; set; }
24+
public virtual string DecimalValue { get; set; }
25+
}
1726
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test"
33
namespace="NHibernate.Test.NHSpecificTest.GH3530">
4-
<class name="LocaleEntity">
4+
<!-- The schema exporter should ignore this version but we should be able to map it to the version created below. -->
5+
<class name="LocaleEntity" schema-action="none" table="LocaleEntity">
56
<id name="Id" generator="guid.comb" />
67
<property name="IntegerValue" column="IntegerValue"/>
78
<property name="DateTimeValue" column="DateTimeValue"/>
89
<property name="DoubleValue" column="DoubleValue"/>
10+
<property name="DecimalValue" column="DecimalValue"/>
11+
</class>
12+
<!-- The schema exporter should export this version of the entity and generate text columns for all types. -->
13+
<class name="SchemaLocaleEntity" table="LocaleEntity">
14+
<id name="Id" generator="guid.comb" />
15+
<property name="IntegerValue" column="IntegerValue"/>
16+
<property name="DateTimeValue" column="DateTimeValue"/>
17+
<property name="DoubleValue" column="DoubleValue"/>
18+
<property name="DecimalValue" column="DecimalValue"/>
919
</class>
1020
</hibernate-mapping>

0 commit comments

Comments
 (0)