|
From: <fab...@us...> - 2009-06-03 22:56:52
|
Revision: 4405
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4405&view=rev
Author: fabiomaulo
Date: 2009-06-03 22:56:42 +0000 (Wed, 03 Jun 2009)
Log Message:
-----------
Fix NH-1427
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Fixture.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Mappings.hbm.xml
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Person.cs
Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2009-06-03 06:15:26 UTC (rev 4404)
+++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2009-06-03 22:56:42 UTC (rev 4405)
@@ -345,10 +345,13 @@
//PropertiesFromXML(node, persistentClass, mappings);
foreach (XmlNode subnode in node.ChildNodes)
{
+ //I am only concerned with elements that are from the nhibernate namespace
+ if (subnode.NamespaceURI != Configuration.MappingSchemaXMLNS)
+ continue;
+
string name = subnode.Name;
XmlAttribute nameAttribute = subnode.Attributes["name"];
string propertyName = nameAttribute == null ? null : nameAttribute.Value;
-
IValue value = null;
var collectionBinder = new CollectionBinder(this);
if (collectionBinder.CanCreate(name))
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Fixture.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Fixture.cs 2009-06-03 22:56:42 UTC (rev 4405)
@@ -0,0 +1,16 @@
+using NHibernate.Cfg;
+using NUnit.Framework;
+
+namespace NHibernate.Test.NHSpecificTest.NH1427
+{
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void TestMappingWithJoinElementContainingXmlComments()
+ {
+ Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration();
+ Assert.DoesNotThrow(() => cfg.AddResource("NHibernate.Test.NHSpecificTest.NH1427.Mappings.hbm.xml", GetType().Assembly));
+ }
+ }
+}
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Mappings.hbm.xml
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Mappings.hbm.xml (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Mappings.hbm.xml 2009-06-03 22:56:42 UTC (rev 4405)
@@ -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.NH1427">
+
+ <class name="Person" table="Person1">
+
+ <id name="PersonId" column="PersonId" type="Int32">
+ <generator class="assigned" />
+ </id>
+
+ <property name="Name" column="Name" type="String" length="25" not-null="true" />
+
+ <join table="Person2">
+ <!-- Comment: causes test to fail -->
+ <key column="PersonId" />
+ <property name="LogonId" column="LogonId" type="String" length="16" not-null="true" />
+ <property name="LastLogon" column="LastLogon" type="DateTime" not-null="false" />
+ </join>
+
+ </class>
+
+</hibernate-mapping>
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Person.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Person.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1427/Person.cs 2009-06-03 22:56:42 UTC (rev 4405)
@@ -0,0 +1,12 @@
+using System;
+
+namespace NHibernate.Test.NHSpecificTest.NH1427
+{
+ public class Person
+ {
+ public virtual int PersonId { get; set; }
+ public virtual string Name { get; set; }
+ public virtual string LogonId { get; set; }
+ public virtual DateTime LastLogon { get; set; }
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-03 06:15:26 UTC (rev 4404)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-06-03 22:56:42 UTC (rev 4405)
@@ -364,6 +364,8 @@
<Compile Include="NHSpecificTest\NH1343\Product.cs" />
<Compile Include="NHSpecificTest\NH1343\ProductFixture.cs" />
<Compile Include="NHSpecificTest\NH1388\Fixture.cs" />
+ <Compile Include="NHSpecificTest\NH1427\Fixture.cs" />
+ <Compile Include="NHSpecificTest\NH1427\Person.cs" />
<Compile Include="NHSpecificTest\NH1487\Fixture.cs" />
<Compile Include="NHSpecificTest\NH1531\DomainClass.cs" />
<Compile Include="NHSpecificTest\NH1531\SampleTest.cs" />
@@ -1858,6 +1860,7 @@
<EmbeddedResource Include="CacheTest\EntityWithFilters.xml" />
<EmbeddedResource Include="Classic\EntityWithLifecycle.hbm.xml" />
<Content Include="DynamicEntity\package.html" />
+ <EmbeddedResource Include="NHSpecificTest\NH1427\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1531\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1757\Mappings.hbm.xml" />
<EmbeddedResource Include="Events\PostEvents\SimpleEntity.hbm.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|