|
From: <ric...@us...> - 2009-09-24 11:23:08
|
Revision: 4724
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4724&view=rev
Author: ricbrown
Date: 2009-09-24 11:22:59 +0000 (Thu, 24 Sep 2009)
Log Message:
-----------
Merge r4723 (Fix NH-1948 Allow scale of zero)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs
trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Fixture.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Mappings.hbm.xml
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Model.cs
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs 2009-09-24 11:20:25 UTC (rev 4723)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs 2009-09-24 11:22:59 UTC (rev 4724)
@@ -152,7 +152,7 @@
public string precision;
/// <remarks/>
- [System.Xml.Serialization.XmlAttributeAttribute(DataType="positiveInteger")]
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="nonNegativeInteger")]
public string scale;
/// <remarks/>
@@ -937,7 +937,7 @@
public string precision;
/// <remarks/>
- [System.Xml.Serialization.XmlAttributeAttribute(DataType="positiveInteger")]
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="nonNegativeInteger")]
public string scale;
/// <remarks/>
@@ -1101,7 +1101,7 @@
public string precision;
/// <remarks/>
- [System.Xml.Serialization.XmlAttributeAttribute(DataType="positiveInteger")]
+ [System.Xml.Serialization.XmlAttributeAttribute(DataType="nonNegativeInteger")]
public string scale;
/// <remarks/>
Modified: trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd
===================================================================
--- trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd 2009-09-24 11:20:25 UTC (rev 4723)
+++ trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd 2009-09-24 11:22:59 UTC (rev 4724)
@@ -233,7 +233,7 @@
</xs:attribute>
<xs:attribute name="length" type="xs:positiveInteger" />
<xs:attribute name="precision" type="xs:positiveInteger" />
- <xs:attribute name="scale" type="xs:positiveInteger" />
+ <xs:attribute name="scale" type="xs:nonNegativeInteger" />
<xs:attribute name="not-null" type="xs:boolean">
</xs:attribute>
<xs:attribute name="unique" type="xs:boolean">
@@ -448,7 +448,7 @@
<xs:attribute name="type" type="xs:string" />
<xs:attribute name="length" type="xs:positiveInteger" />
<xs:attribute name="precision" type="xs:positiveInteger" />
- <xs:attribute name="scale" type="xs:positiveInteger" />
+ <xs:attribute name="scale" type="xs:nonNegativeInteger" />
<xs:attribute name="not-null" default="false" type="xs:boolean">
</xs:attribute>
<xs:attribute name="unique" default="false" type="xs:boolean">
@@ -1158,7 +1158,7 @@
<xs:attribute name="column" type="xs:string" />
<xs:attribute name="length" type="xs:positiveInteger" />
<xs:attribute name="precision" type="xs:positiveInteger" />
- <xs:attribute name="scale" type="xs:positiveInteger" />
+ <xs:attribute name="scale" type="xs:nonNegativeInteger" />
<xs:attribute name="not-null" type="xs:boolean">
</xs:attribute>
<xs:attribute name="unique" default="false" type="xs:boolean">
Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948
___________________________________________________________________
Added: bugtraq:url
+ http://jira.nhibernate.org/browse/%BUGID%
Added: bugtraq:logregex
+ NH-\d+
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Fixture.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Fixture.cs 2009-09-24 11:22:59 UTC (rev 4724)
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+using NUnit.Framework;
+
+namespace NHibernate.Test.NHSpecificTest.NH1948
+{
+ [TestFixture]
+ public class Fixture : BugTestCase
+ {
+
+ [Test]
+ public void CanUseDecimalScaleZero()
+ {
+ using (ISession s = OpenSession())
+ using (ITransaction tx = s.BeginTransaction())
+ {
+ Person person =
+ new Person()
+ {
+ Age = 50,
+ ShoeSize = 10,
+ FavouriteNumbers =
+ new List<decimal>()
+ {
+ 20,
+ 30,
+ 40,
+ },
+ };
+
+ s.Save(person);
+ s.Flush();
+ tx.Rollback();
+ }
+ }
+ }
+}
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Mappings.hbm.xml
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Mappings.hbm.xml (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Mappings.hbm.xml 2009-09-24 11:22:59 UTC (rev 4724)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
+ assembly="NHibernate.Test"
+ namespace="NHibernate.Test.NHSpecificTest.NH1948">
+
+ <class name="Person">
+ <id name="Id">
+ <generator class="native" />
+ </id>
+
+ <property name="Age" type="decimal" precision="2" scale="0" />
+
+ <property name="ShoeSize">
+ <column name="ShoeSizeColumn" precision="2" scale="0"/>
+ </property>
+
+ <bag name="FavouriteNumbers" table="FavNum">
+ <key column="Person" />
+ <element type="decimal" precision="2" scale="0" />
+ </bag>
+
+ </class>
+
+</hibernate-mapping>
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Model.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Model.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1948/Model.cs 2009-09-24 11:22:59 UTC (rev 4724)
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+
+namespace NHibernate.Test.NHSpecificTest.NH1948
+{
+ public class Person
+ {
+ public virtual int Id { get; set; }
+ public virtual decimal Age { get; set; }
+ public virtual decimal ShoeSize { get; set; }
+ public virtual IList<decimal> FavouriteNumbers { get; set; }
+ }
+}
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-09-24 11:20:25 UTC (rev 4723)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-09-24 11:22:59 UTC (rev 4724)
@@ -606,6 +606,8 @@
<Compile Include="NHSpecificTest\NH1941\Fixture.cs" />
<Compile Include="NHSpecificTest\NH1941\Model.cs" />
<Compile Include="NHSpecificTest\NH1941\SexEnumStringType.cs" />
+ <Compile Include="NHSpecificTest\NH1948\Fixture.cs" />
+ <Compile Include="NHSpecificTest\NH1948\Model.cs" />
<Compile Include="NHSpecificTest\NH1963\CacheableQueryOnByteArray.cs" />
<Compile Include="NHSpecificTest\NH1963\DomainClass.cs" />
<Compile Include="NHSpecificTest\NH1969\DummyEntity.cs" />
@@ -2025,6 +2027,7 @@
<EmbeddedResource Include="Criteria\Lambda\Mappings.hbm.xml" />
<EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" />
<Content Include="DynamicEntity\package.html" />
+ <EmbeddedResource Include="NHSpecificTest\NH1948\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1941\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1963\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1969\Mappings.hbm.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|