|
From: <fab...@us...> - 2010-06-27 13:30:23
|
Revision: 4994
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4994&view=rev
Author: fabiomaulo
Date: 2010-06-27 13:30:16 +0000 (Sun, 27 Jun 2010)
Log Message:
-----------
Starting fix NH-2230
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs
trunk/nhibernate/src/NHibernate/Mapping/Component.cs
trunk/nhibernate/src/NHibernate/Tuple/Component/PocoComponentTuplizer.cs
Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2010-06-21 14:57:32 UTC (rev 4993)
+++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2010-06-27 13:30:16 UTC (rev 4994)
@@ -305,7 +305,11 @@
// Parent
if (componentMapping.Parent != null && !string.IsNullOrEmpty(componentMapping.Parent.name))
{
- model.ParentProperty = componentMapping.Parent.name;
+ model.ParentProperty = new Property
+ {
+ Name = componentMapping.Parent.name,
+ PropertyAccessorName = mappings.DefaultAccess
+ };
}
new PropertiesBinder(Mappings, model, className, path, isNullable, Mappings.Dialect).Bind(
Modified: trunk/nhibernate/src/NHibernate/Mapping/Component.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Mapping/Component.cs 2010-06-21 14:57:32 UTC (rev 4993)
+++ trunk/nhibernate/src/NHibernate/Mapping/Component.cs 2010-06-27 13:30:16 UTC (rev 4994)
@@ -16,7 +16,7 @@
private readonly List<Property> properties = new List<Property>();
private System.Type componentClass;
private bool embedded;
- private string parentProperty;
+ private Property parentProperty;
private PersistentClass owner;
private bool dynamic;
private bool isKey;
@@ -165,7 +165,7 @@
}
/// <summary></summary>
- public string ParentProperty
+ public Property ParentProperty
{
get { return parentProperty; }
set { parentProperty = value; }
Modified: trunk/nhibernate/src/NHibernate/Tuple/Component/PocoComponentTuplizer.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Tuple/Component/PocoComponentTuplizer.cs 2010-06-21 14:57:32 UTC (rev 4993)
+++ trunk/nhibernate/src/NHibernate/Tuple/Component/PocoComponentTuplizer.cs 2010-06-27 13:30:16 UTC (rev 4994)
@@ -28,17 +28,16 @@
{
componentClass = component.ComponentClass;
- string parentPropertyName = component.ParentProperty;
- if (parentPropertyName == null)
+ var parentProperty = component.ParentProperty;
+ if (parentProperty == null)
{
parentSetter = null;
parentGetter = null;
}
else
{
- IPropertyAccessor pa = PropertyAccessorFactory.GetPropertyAccessor(null);
- parentSetter = pa.GetSetter(componentClass, parentPropertyName);
- parentGetter = pa.GetGetter(componentClass, parentPropertyName);
+ parentSetter = parentProperty.GetSetter(componentClass);
+ parentGetter = parentProperty.GetGetter(componentClass);
}
if (hasCustomAccessors || !Cfg.Environment.UseReflectionOptimizer)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|